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
7fd4be5d
Commit
7fd4be5d
authored
Aug 19, 2019
by
Rasmus Fuhse
Browse files
Options
Downloads
Patches
Plain Diff
add assignments and user config
parent
90c08f22
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
controllers/copy.php
+29
-1
29 additions, 1 deletion
controllers/copy.php
plugin.manifest
+1
-1
1 addition, 1 deletion
plugin.manifest
views/copy/info.php
+25
-5
25 additions, 5 deletions
views/copy/info.php
with
55 additions
and
7 deletions
controllers/copy.php
+
29
−
1
View file @
7fd4be5d
...
@@ -14,12 +14,17 @@ class CopyController extends PluginController
...
@@ -14,12 +14,17 @@ class CopyController extends PluginController
"OR auth_user_md5.username LIKE :input) "
.
"OR auth_user_md5.username LIKE :input) "
.
"AND "
.
get_vis_query
()
.
" "
.
"AND "
.
get_vis_query
()
.
" "
.
"AND auth_user_md5.perms = 'dozent' "
.
"AND auth_user_md5.perms = 'dozent' "
.
"ORDER BY Vorname, Nachname"
,
_
(
"
Doz
en
t
ennamen eingeben"
),
"user_id"
);
"ORDER BY Vorname, Nachname"
,
_
(
"
Lehr
en
d
ennamen eingeben"
),
"user_id"
);
}
}
public
function
process_action
()
public
function
process_action
()
{
{
if
(
Request
::
isPost
())
{
if
(
Request
::
isPost
())
{
foreach
(
array
(
"semester_id"
,
"dozent_id"
,
"lock_copied_courses"
,
"cycles"
,
"resource_assignments"
)
as
$param
)
{
$config_name
=
"COURSECOPY_SETTINGS_"
.
strtoupper
(
$param
);
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
store
(
$config_name
,
Request
::
get
(
$param
));
}
$dozent
=
null
;
$dozent
=
null
;
if
(
Request
::
option
(
"dozent_id"
))
{
if
(
Request
::
option
(
"dozent_id"
))
{
$dozent
=
User
::
find
(
Request
::
option
(
"dozent_id"
));
$dozent
=
User
::
find
(
Request
::
option
(
"dozent_id"
));
...
@@ -126,6 +131,29 @@ class CopyController extends PluginController
...
@@ -126,6 +131,29 @@ class CopyController extends PluginController
$newcycle
[
'mkdate'
]
=
time
();
$newcycle
[
'mkdate'
]
=
time
();
$newcycle
[
'chdate'
]
=
time
();
$newcycle
[
'chdate'
]
=
time
();
$newcycle
->
store
();
$newcycle
->
store
();
if
(
Request
::
get
(
"resource_assignments"
))
{
$statement
=
DBManager
::
get
()
->
prepare
(
"
SELECT resource_id
FROM (
SELECT resource_id, COUNT(*) AS number
FROM termine
INNER JOIN resources_assign ON (resources_assign.assign_user_id = termine.termin_id)
WHERE termine.metadate_id = :metadate_id
GROUP BY resources_assign.resource_id
) AS counter
ORDER BY number DESC
LIMIT 1
"
);
$statement
->
execute
(
array
(
'metadate_id'
=>
$cycledate
->
getId
()));
$resource_id
=
$statement
->
fetch
(
PDO
::
FETCH_COLUMN
,
0
);
if
(
$resource_id
)
{
foreach
(
$newcycle
->
dates
as
$newdate
)
{
$singledate
=
new
SingleDate
(
$newdate
);
$singledate
->
bookRoom
(
$resource_id
);
}
}
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
plugin.manifest
+
1
−
1
View file @
7fd4be5d
pluginname=CourseCopy
pluginname=CourseCopy
pluginclassname=CourseCopy
pluginclassname=CourseCopy
version=1.
2
.0
version=1.
3
.0
origin=data-quest
origin=data-quest
studipMinVersion=4.0
studipMinVersion=4.0
studipMaxVersion=4.99.99
studipMaxVersion=4.99.99
\ No newline at end of file
This diff is collapsed.
Click to expand it.
views/copy/info.php
+
25
−
5
View file @
7fd4be5d
...
@@ -14,22 +14,42 @@
...
@@ -14,22 +14,42 @@
<select
name=
"semester_id"
required
>
<select
name=
"semester_id"
required
>
<option
value=
""
></option>
<option
value=
""
></option>
<?
foreach
(
array_reverse
(
Semester
::
getAll
())
as
$semester
)
:
?>
<?
foreach
(
array_reverse
(
Semester
::
getAll
())
as
$semester
)
:
?>
<option
value=
"
<?=
htmlReady
(
$semester
->
getId
())
?>
"
>
<?=
htmlReady
(
$semester
[
'name'
])
?>
</option>
<option
value=
"
<?=
htmlReady
(
$semester
->
getId
())
?>
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_SEMESTER_ID
==
$semester
->
getId
()
?
" selected"
:
""
?>
>
<?=
htmlReady
(
$semester
[
'name'
])
?>
</option>
<?
endforeach
?>
<?
endforeach
?>
</select>
</select>
</label>
</label>
<label>
<label>
<?=
_
(
"Dozenten ersetzen durch ..."
)
?>
<?=
_
(
"Lehrende ersetzen durch ..."
)
?>
<?=
QuickSearch
::
get
(
"dozent_id"
,
$dozentensearch
)
->
render
()
?>
<?
$qs
=
QuickSearch
::
get
(
"dozent_id"
,
$dozentensearch
);
if
(
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_DOZENT_ID
)
{
$qs
->
defaultValue
(
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_DOZENT_ID
,
get_fullname
(
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_DOZENT_ID
)
);
}
echo
$qs
->
render
()
?>
</label>
</label>
<label>
<label>
<input
type=
"checkbox"
name=
"cycles"
value=
"1"
checked
>
<input
type=
"checkbox"
name=
"cycles"
onChange=
"jQuery('#resource_assignments').toggle();"
value=
"1"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_CYCLES
?
" checked"
:
""
?>
>
<?=
_
(
"Regelmäßige Termine mit kopieren"
)
?>
<?=
_
(
"Regelmäßige Termine mit kopieren"
)
?>
</label>
</label>
<label
id=
"resource_assignments"
style=
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_CYCLES
?
""
:
"display: none;"
?>
"
>
<input
type=
"checkbox"
name=
"resource_assignments"
value=
"1"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_RESOURCE_ASSIGNMENTS
?
" checked"
:
""
?>
>
<?=
_
(
"Raumbuchungen mit übernehmen"
)
?>
</label>
<label>
<label>
<input
type=
"checkbox"
name=
"lock_copied_courses"
value=
"1"
>
<input
type=
"checkbox"
name=
"lock_copied_courses"
value=
"1"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_LOCK_COPIED_COURSES
?
" checked"
:
""
?>
>
<?=
_
(
'Kopierte Veranstaltungen sperren'
)
?>
<?=
_
(
'Kopierte Veranstaltungen sperren'
)
?>
</label>
</label>
</fieldset>
</fieldset>
...
...
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