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
2614eef6
Unverified
Commit
2614eef6
authored
1 year ago
by
Rasmus Fuhse
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3 from noackorama/master
fix letzte Semesterwoche
parents
766d3519
c9e7079a
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
+5
-5
5 additions, 5 deletions
controllers/copy.php
plugin.manifest
+1
-1
1 addition, 1 deletion
plugin.manifest
views/copy/semester_start_und_ende.php
+17
-22
17 additions, 22 deletions
views/copy/semester_start_und_ende.php
with
23 additions
and
28 deletions
controllers/copy.php
+
5
−
5
View file @
2614eef6
...
@@ -25,7 +25,7 @@ class CopyController extends PluginController
...
@@ -25,7 +25,7 @@ class CopyController extends PluginController
}
}
if
(
count
(
Request
::
getArray
(
"c"
))
==
1
)
{
if
(
count
(
Request
::
getArray
(
"c"
))
==
1
)
{
$this
->
single_course
=
Course
::
find
(
current
(
Request
::
getArray
(
"c"
)));
$this
->
single_course
=
Course
::
find
(
current
(
Request
::
getArray
(
"c"
)));
$this
->
single_course_name
=
$
course
->
nam
e
;
$this
->
single_course_name
=
$
this
->
single_cours
e
;
}
}
}
else
{
}
else
{
throw
new
Trails_Exception
(
400
);
throw
new
Trails_Exception
(
400
);
...
@@ -97,6 +97,7 @@ class CopyController extends PluginController
...
@@ -97,6 +97,7 @@ class CopyController extends PluginController
$newcourse
[
'mkdate'
]
=
time
();
$newcourse
[
'mkdate'
]
=
time
();
$newcourse
->
setId
(
$newcourse
->
getNewId
());
$newcourse
->
setId
(
$newcourse
->
getNewId
());
$newcourse
[
'start_time'
]
=
$semester
[
'beginn'
];
$newcourse
[
'start_time'
]
=
$semester
[
'beginn'
];
$newcourse
[
'duration_time'
]
=
0
;
if
(
$invisible_copied_courses
)
{
if
(
$invisible_copied_courses
)
{
$newcourse
[
'visible'
]
=
0
;
$newcourse
[
'visible'
]
=
0
;
}
}
...
@@ -222,6 +223,7 @@ class CopyController extends PluginController
...
@@ -222,6 +223,7 @@ class CopyController extends PluginController
if
(
Request
::
get
(
"cycles"
))
{
if
(
Request
::
get
(
"cycles"
))
{
$last_week
=
count
(
$semester
->
getStartWeeks
())
-
1
;
foreach
(
$oldcourse
->
cycles
as
$cycledate
)
{
foreach
(
$oldcourse
->
cycles
as
$cycledate
)
{
$statement
=
DBManager
::
get
()
->
prepare
(
"
$statement
=
DBManager
::
get
()
->
prepare
(
"
...
@@ -242,10 +244,8 @@ class CopyController extends PluginController
...
@@ -242,10 +244,8 @@ class CopyController extends PluginController
$newcycle
->
setData
(
$cycledate
->
toArray
());
$newcycle
->
setData
(
$cycledate
->
toArray
());
$newcycle
->
setId
(
$newcycle
->
getNewId
());
$newcycle
->
setId
(
$newcycle
->
getNewId
());
$newcycle
[
'seminar_id'
]
=
$newcourse
->
getId
();
$newcycle
[
'seminar_id'
]
=
$newcourse
->
getId
();
$newcycle
[
'week_offset'
]
=
Request
::
get
(
"week_offset"
);
$newcycle
[
'week_offset'
]
=
Request
::
int
(
"week_offset"
);
$newcycle
[
'end_offset'
]
=
Request
::
get
(
"end_offset"
)
!==
10000
$newcycle
[
'end_offset'
]
=
Request
::
get
(
'end_offset'
)
==
'last'
?
$last_week
:
Request
::
int
(
"end_offset"
);
?
Request
::
get
(
"end_offset"
)
:
floor
((
$semester
[
'vorles_ende'
]
-
$semester
[
'vorles_beginn'
])
/
(
86400
*
7
));
$newcycle
[
'mkdate'
]
=
time
();
$newcycle
[
'mkdate'
]
=
time
();
$newcycle
[
'chdate'
]
=
time
();
$newcycle
[
'chdate'
]
=
time
();
$newcycle
->
store
();
$newcycle
->
store
();
...
...
This diff is collapsed.
Click to expand it.
plugin.manifest
+
1
−
1
View file @
2614eef6
pluginname=CourseCopy
pluginname=CourseCopy
pluginclassname=CourseCopy
pluginclassname=CourseCopy
version=1.9.
3
version=1.9.
4
origin=data-quest
origin=data-quest
studipMinVersion=4.0
studipMinVersion=4.0
studipMaxVersion=5.3.99
studipMaxVersion=5.3.99
This diff is collapsed.
Click to expand it.
views/copy/semester_start_und_ende.php
+
17
−
22
View file @
2614eef6
<?php
$start_weeks
=
$semester
->
getStartWeeks
();
$last_week
=
count
(
$start_weeks
)
-
1
;
?>
<label>
<label>
<?=
_
(
"Startwoche"
)
?>
<?=
_
(
"Startwoche"
)
?>
<select
name=
"week_offset"
>
<select
name=
"week_offset"
>
<?
$i
=
0
?>
<?
foreach
(
$start_weeks
as
$i
=>
$text
)
:
?>
<?
while
(
$semester
[
'vorles_beginn'
]
+
43200
+
86400
*
7
*
$i
<
$semester
[
'vorles_ende'
])
:
?>
<option
value=
"
<?=
$i
?>
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_WEEK_OFFSET
==
$i
?
" checked"
:
""
?>
>
<option
value=
"
<?=
$i
?>
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_WEEK_OFFSET
==
$i
?
" checked"
:
""
?>
>
<?
<?=
$text
?>
$timestamp
=
$semester
[
'vorles_beginn'
]
+
43200
+
86400
*
7
*
$i
;
$timestamp
=
$timestamp
-
((
date
(
"w"
,
$timestamp
)
-
1
)
%
7
)
*
86400
;
?>
<?=
sprintf
(
_
(
"%s. Semesterwoche (ab %s)"
),
$i
+
1
,
date
(
"d.m.Y"
,
$timestamp
))
?>
</option>
</option>
<?
$i
++
?>
<?
endforeach
;
?>
<?
endwhile
?>
</select>
</select>
</label>
</label>
<label>
<label>
<?=
_
(
"Endwoche"
)
?>
<?=
_
(
"Endwoche"
)
?>
<select
name=
"end_offset"
>
<select
name=
"end_offset"
>
<option
value=
"10000"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_END_OFFSET
==
10000
?
" checked"
:
""
?>
>
<?
foreach
(
array_reverse
(
$start_weeks
,
true
)
as
$i
=>
$text
)
:
?>
<?=
_
(
"Letzte Semesterwoche"
)
?>
<?
if
(
$i
==
$last_week
)
:
?>
<option
value=
"last"
>
<?=
_
(
'Semesterende: '
)
.
$text
?>
</option>
</option>
<?
$i
=
floor
((
$semester
[
'vorles_ende'
]
-
$semester
[
'vorles_beginn'
])
/
(
86400
*
7
))
-
1
?>
<?
else
:
?>
<?
while
(
$i
>=
0
)
:
?>
<option
value=
"
<?=
$i
?>
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_END_OFFSET
==
$i
?
" checked"
:
""
?>
>
<option
value=
"
<?=
$i
?>
"
<?=
UserConfig
::
get
(
$GLOBALS
[
'user'
]
->
id
)
->
COURSECOPY_SETTINGS_END_OFFSET
==
$i
?
" checked"
:
""
?>
>
<?
<?=
$text
?>
$timestamp
=
$semester
[
'vorles_beginn'
]
+
43200
+
86400
*
7
*
$i
;
$timestamp
=
$timestamp
-
((
date
(
"w"
,
$timestamp
)
-
1
)
%
7
)
*
86400
;
?>
<?=
sprintf
(
_
(
"%s. Semesterwoche (ab %s)"
),
$i
+
1
,
date
(
"d.m.Y"
,
$timestamp
))
?>
</option>
</option>
<?
$i
--
?>
<?
endif
?>
<?
end
while
?>
<?
end
foreach
?>
</select>
</select>
</label>
</label>
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