Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
6b3ca21b
Commit
6b3ca21b
authored
2 years ago
by
Moritz Strohm
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
TIC #842
Merge request
studip/studip!491
parent
5866bdf1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/classes/ProfileModel.php
+13
-1
13 additions, 1 deletion
lib/classes/ProfileModel.php
lib/models/Semester.class.php
+21
-0
21 additions, 0 deletions
lib/models/Semester.class.php
with
34 additions
and
1 deletion
lib/classes/ProfileModel.php
+
13
−
1
View file @
6b3ca21b
...
...
@@ -96,7 +96,19 @@ class ProfileModel
public
function
getDozentSeminars
()
{
$courses
=
[];
$semester
=
array_reverse
(
Semester
::
getAll
());
$semester
=
[];
$next_semester
=
Semester
::
findNext
();
$current_semester
=
Semester
::
findCurrent
();
$previous_semester
=
Semester
::
findPrevious
();
if
(
$next_semester
)
{
$semester
[
$next_semester
->
id
]
=
$next_semester
;
}
if
(
$current_semester
)
{
$semester
[
$current_semester
->
id
]
=
$current_semester
;
}
if
(
$previous_semester
)
{
$semester
[
$previous_semester
->
id
]
=
$previous_semester
;
}
$field
=
'name'
;
if
(
Config
::
get
()
->
IMPORTANT_SEMNUMBER
)
{
$field
=
"veranstaltungsnummer,
{
$field
}
"
;
...
...
This diff is collapsed.
Click to expand it.
lib/models/Semester.class.php
+
21
−
0
View file @
6b3ca21b
...
...
@@ -116,6 +116,27 @@ class Semester extends SimpleORMap
return
null
;
}
/**
* Returns the previous semester for a semester specified by a timestamp.
* If no timestamp is specified, the previous semester of the current semester is returned.
*
* @param integer|null $timestamp The timestamp of the semester whose predecessor
* shall be found. Defaults to null.
*
* @return null|Semester A previous semester to the specified one or null, if no such semester
* could be found.
*/
public
static
function
findPrevious
(
$timestamp
=
null
)
{
$timestamp
=
$timestamp
?:
time
();
$semester
=
self
::
findByTimestamp
(
$timestamp
);
if
(
$semester
)
{
return
self
::
findByTimestamp
((
int
)
$semester
->
beginn
-
1
);
}
return
null
;
}
/**
* returns current Semester
*/
...
...
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