aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/admin/courses.php
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2023-03-02 10:08:18 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-03-02 10:08:18 +0000
commit29c100644d5d1e15fece4339fd1d380b4ceebaca (patch)
tree83eddc7e21e7c4bc8e95879ab92f58bf8640c584 /app/controllers/admin/courses.php
parent7e98a8d43ae8dbc508bc61a6bab9311e3ff7a9c1 (diff)
prevent php-warnings, closes #2238
Closes #2238 Merge request studip/studip!1471
Diffstat (limited to 'app/controllers/admin/courses.php')
-rw-r--r--app/controllers/admin/courses.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/app/controllers/admin/courses.php b/app/controllers/admin/courses.php
index 7e78aae..7328380 100644
--- a/app/controllers/admin/courses.php
+++ b/app/controllers/admin/courses.php
@@ -169,22 +169,22 @@ class Admin_CoursesController extends AuthenticatedController
Now draw the configurable elements according
to the values inside the visibleElements array.
*/
- if ($visibleElements['search']) {
+ if (!empty($visibleElements['search'])) {
$this->setSearchWiget();
}
- if ($visibleElements['institute']) {
+ if (!empty($visibleElements['institute'])) {
$this->setInstSelector();
}
- if ($visibleElements['semester']) {
+ if (!empty($visibleElements['semester'])) {
$this->setSemesterSelector();
}
- if ($visibleElements['stgteil']) {
+ if (!empty($visibleElements['stgteil'])) {
$this->setStgteilSelector();
}
- if ($visibleElements['courseType']) {
+ if (!empty($visibleElements['courseType'])) {
$this->setCourseTypeWidget($courseTypeFilterConfig);
}
- if ($visibleElements['teacher']) {
+ if (!empty($visibleElements['teacher'])) {
$this->setTeacherWidget();
}
@@ -592,7 +592,7 @@ class Admin_CoursesController extends AuthenticatedController
$inst = explode('_', Request::option('institute'));
$GLOBALS['user']->cfg->store('MY_INSTITUTES_DEFAULT', $inst[0]);
- if ($inst[1] == 'withinst') {
+ if ($inst[1] === 'withinst') {
$GLOBALS['user']->cfg->store('MY_INSTITUTES_INCLUDE_CHILDREN', 1);
} else {
$GLOBALS['user']->cfg->store('MY_INSTITUTES_INCLUDE_CHILDREN', 0);
@@ -648,11 +648,11 @@ class Admin_CoursesController extends AuthenticatedController
}
$course = Course::find($course_id);
- if ($value == 'none') {
+ if ($value === 'none') {
$value = null;
}
- if ($course->lock_rule == $value) {
+ if ($course->lock_rule === $value) {
continue;
}
@@ -689,7 +689,7 @@ class Admin_CoursesController extends AuthenticatedController
$all_courses = Request::getArray('all_sem');
$course_set_id = CourseSet::getGlobalLockedAdmissionSetId();
-
+ $log_msg = '';
foreach ($all_courses as $course_id) {
if ($GLOBALS['perm']->have_studip_perm('dozent', $course_id)) {
$set = CourseSet::getSetForCourse($course_id);
@@ -713,7 +713,7 @@ class Admin_CoursesController extends AuthenticatedController
}
if ($log_msg) {
- StudipLog::log('SEM_CHANGED_ACCESS', $course_id, NULL, $log_msg);
+ StudipLog::log('SEM_CHANGED_ACCESS', $course_id, null, $log_msg);
}
}
}
@@ -880,7 +880,7 @@ class Admin_CoursesController extends AuthenticatedController
throw new AccessDeniedException();
}
$course = Course::find($course_id);
- $course->completion = ($course->completion + 1) % 3;
+ $course->completion = ((int)$course->completion + 1) % 3;
$course->store();
if (Request::isXhr()) {
@@ -1350,7 +1350,7 @@ class Admin_CoursesController extends AuthenticatedController
//from that faculty and all its institutes.
//$institut is an array, we can't use the method isFaculty() here!
- if ($institut['fakultaets_id'] == $institut['Institut_id']) {
+ if ($institut['fakultaets_id'] === $institut['Institut_id']) {
$list->addElement(
new SelectElement(
$institut['Institut_id'] . '_withinst', //_withinst = with institutes