Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CourseCopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stud.IP
Plugins
CourseCopy
Commits
b5687370
Commit
b5687370
authored
5 years ago
by
Rasmus Fuhse
Browse files
Options
Downloads
Patches
Plain Diff
add avatar copying, KursVorabInfo and bugfixing
parent
7167e80d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
controllers/copy.php
+35
-0
35 additions, 0 deletions
controllers/copy.php
plugin.manifest
+1
-1
1 addition, 1 deletion
plugin.manifest
with
36 additions
and
1 deletion
controllers/copy.php
+
35
−
0
View file @
b5687370
...
...
@@ -64,6 +64,13 @@ class CopyController extends PluginController
}
$newcourse
->
store
();
//copy avatar
if
(
CourseAvatar
::
getAvatar
(
$course_id
)
->
is_customized
())
{
CourseAvatar
::
getAvatar
(
$newcourse
->
getId
())
->
createFrom
(
CourseAvatar
::
getAvatar
(
$course_id
)
->
getFilename
(
Avatar
::
NORMAL
)
);
}
//Check if the old course is in at least one course
//group ("LV-Gruppe") of the module managemeny system:
$course_groups
=
Lvgruppe
::
findBySeminar
(
$course_id
);
...
...
@@ -152,8 +159,31 @@ class CopyController extends PluginController
$newentry
->
store
();
}
$wanted_course_configs
=
array
(
"KURSVORABINFO_INFO"
);
foreach
(
$wanted_course_configs
as
$config
)
{
if
(
CourseConfig
::
get
(
$course_id
)
->
$config
)
{
CourseConfig
::
get
(
$newcourse
->
getId
())
->
store
(
$config
,
CourseConfig
::
get
(
$course_id
)
->
$config
);
}
}
if
(
Request
::
get
(
"cycles"
))
{
foreach
(
$oldcourse
->
cycles
as
$cycledate
)
{
$statement
=
DBManager
::
get
()
->
prepare
(
"
SELECT date_typ
FROM (
SELECT termine.date_typ, COUNT(*) AS number
FROM termine
WHERE termine.metadate_id = :metadate_id
GROUP BY termine.date_typ
) AS counter
ORDER BY number DESC
LIMIT 1
"
);
$statement
->
execute
(
array
(
'metadate_id'
=>
$cycledate
->
getId
()));
$date_type
=
$statement
->
fetch
(
PDO
::
FETCH_COLUMN
,
0
);
$newcycle
=
new
SeminarCycleDate
();
$newcycle
->
setData
(
$cycledate
->
toArray
());
$newcycle
->
setId
(
$newcycle
->
getNewId
());
...
...
@@ -166,6 +196,11 @@ class CopyController extends PluginController
$newcycle
[
'chdate'
]
=
time
();
$newcycle
->
store
();
foreach
(
$newcycle
->
dates
as
$newdate
)
{
$newdate
[
'date_typ'
]
=
$date_type
;
$newdate
->
store
();
}
if
(
Request
::
get
(
"resource_assignments"
))
{
$statement
=
DBManager
::
get
()
->
prepare
(
"
SELECT resource_id
...
...
This diff is collapsed.
Click to expand it.
plugin.manifest
+
1
−
1
View file @
b5687370
pluginname=CourseCopy
pluginclassname=CourseCopy
version=1.
3.1
version=1.
4
origin=data-quest
studipMinVersion=4.0
studipMaxVersion=4.99.99
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment