Skip to content
Snippets Groups Projects
Commit d674bcfb authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

prevent php8 warnings, fixes #2235

Closes #2235

Merge request studip/studip!1469
parent 573b6658
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -197,7 +197,7 @@ class Search_StudiengaengeController extends MVVController ...@@ -197,7 +197,7 @@ class Search_StudiengaengeController extends MVVController
$this->sessSet('selected_semester', $sem); $this->sessSet('selected_semester', $sem);
} }
$this->with_courses = Request::option('with_courses', ($_SESSION['MVV_SEARCH_SEQUENCE_WITH_COURSES'] ?: null)); $this->with_courses = Request::option('with_courses', $_SESSION['MVV_SEARCH_SEQUENCE_WITH_COURSES'] ?? null);
$_SESSION['MVV_SEARCH_SEQUENCE_WITH_COURSES'] = $this->with_courses; $_SESSION['MVV_SEARCH_SEQUENCE_WITH_COURSES'] = $this->with_courses;
$studiengangTeil = StudiengangTeil::find($stgteil_id); $studiengangTeil = StudiengangTeil::find($stgteil_id);
......
...@@ -85,10 +85,10 @@ ...@@ -85,10 +85,10 @@
_('Semesterplan'), _('Semesterplan'),
[ [
'editable' => true, 'editable' => true,
'selectable' => ($fullcalendar_studip_urls['add'] != null), 'selectable' => isset($fullcalendar_studip_urls['add']),
'studip_urls' => $fullcalendar_studip_urls, 'studip_urls' => $fullcalendar_studip_urls,
'minTime' => ($min_time), 'minTime' => $min_time,
'maxTime' => ($max_time), 'maxTime' => $max_time,
'allDaySlot' => false, 'allDaySlot' => false,
'columnHeaderFormat' => ['weekday'=> 'short'], 'columnHeaderFormat' => ['weekday'=> 'short'],
'header' => [ 'header' => [
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<? $sum_points = count($bc_points) - 1; ?> <? $sum_points = count($bc_points) - 1; ?>
<? $index = 0; ?> <? $index = 0; ?>
<? foreach($bc_points as $type => $point):?> <? foreach($bc_points as $type => $point):?>
<? $id2 = reset(array_values((array) $point['add'])); ?> <? $id2 = array_values((array) ($point['add'] ?? []))[0] ?? null; ?>
<? $link = $controller->action_link('' . $point['actn'], $point['id'], $id2); ?> <? $link = $controller->action_link('' . $point['actn'], $point['id'] ?? null, $id2); ?>
<? if (is_array($point['add'])) : ?> <? if (isset($point['add']) && is_array($point['add'])) : ?>
<? $mvv_object = $type::find($point['id']); ?> <? $mvv_object = $type::find($point['id']); ?>
<? if ($mvv_object && $type == 'Fach' && $additional_object = Abschluss::find($point['add']['Abschluss'])) : ?> <? if ($mvv_object && $type == 'Fach' && $additional_object = Abschluss::find($point['add']['Abschluss'])) : ?>
<a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName() . ' (' . $additional_object->name . ')') ?></a> <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName() . ' (' . $additional_object->name . ')') ?></a>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<? else : ?> <? else : ?>
<? if ($type == 'StudiengangTeil' && $mvv_object = $type::find($point['id'])) : ?> <? if ($type == 'StudiengangTeil' && $mvv_object = $type::find($point['id'])) : ?>
<a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(ModuleManagementModel::DISPLAY_FACH)) ?></a> <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(ModuleManagementModel::DISPLAY_FACH)) ?></a>
<? elseif ($point['id'] && $mvv_object = $type::find($point['id'])) : ?> <? elseif (!empty($point['id']) && $mvv_object = $type::find($point['id'])) : ?>
<a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(0)) ?></a> <a href="<?= $link ?>"><?= htmlReady($mvv_object->getDisplayName(0)) ?></a>
<? else : ?> <? else : ?>
<a href="<?= $link ?>"><?= htmlReady($point['name']) ?></a> <a href="<?= $link ?>"><?= htmlReady($point['name']) ?></a>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<th class="mvv-modul-details-head" data-mvv-field="mvv_modul.code"><?= htmlReady($modul->code) ?></th> <th class="mvv-modul-details-head" data-mvv-field="mvv_modul.code"><?= htmlReady($modul->code) ?></th>
<th class="mvv-modul-details-head" data-mvv-field="mvv_modul.kp" style="text-align: right;"><?= sprintf("%d CP", $modul->kp) ?></th> <th class="mvv-modul-details-head" data-mvv-field="mvv_modul.kp" style="text-align: right;"><?= sprintf("%d CP", $modul->kp) ?></th>
</tr> </tr>
<? if ($show_synopse || $modul->fassung_nr): ?> <? if (!empty($show_synopse) || $modul->fassung_nr): ?>
<tr> <tr>
<th colspan="2" style="font-weight: normal;"> <th colspan="2" style="font-weight: normal;">
<? if ($show_synopse) : ?> <? if ($show_synopse) : ?>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</tr> </tr>
<tr> <tr>
<td><strong><?= _('Semester der erstmaligen Durchführung') ?></strong></td> <td><strong><?= _('Semester der erstmaligen Durchführung') ?></strong></td>
<td data-mvv-field="mvv_modul.start"><?= htmlReady($startSemester['name']) ?></td> <td data-mvv-field="mvv_modul.start"><?= htmlReady($startSemester['name'] ?? '') ?></td>
</tr> </tr>
<? if ($instituteName) : ?> <? if ($instituteName) : ?>
<tr> <tr>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
?> ?>
<li data-mvv-field="mvv_stgteilabschnitt_modul" data-mvv-id="<?= $affect_id; ?>" data-mvv-cooid="<?= $modul->getId(); ?>"> <li data-mvv-field="mvv_stgteilabschnitt_modul" data-mvv-id="<?= $affect_id; ?>" data-mvv-cooid="<?= $modul->getId(); ?>">
<?= htmlReady($path)?> <?= htmlReady($path)?>
<? if (!$download && (count($pathes) > 9 && $i == 4)) : ?> <? if (empty($download) && count($pathes) > 9 && $i == 4) : ?>
<label class="cb-more-label" for="cb_more_studycourses"><?= _('mehr...') ?></label> <label class="cb-more-label" for="cb_more_studycourses"><?= _('mehr...') ?></label>
<? endif; ?> <? endif; ?>
</li> </li>
......
...@@ -175,11 +175,8 @@ class StudipSemTreeViewSimple ...@@ -175,11 +175,8 @@ class StudipSemTreeViewSimple
public function getInfoIcon($item_id) public function getInfoIcon($item_id)
{ {
if ($item_id === 'root') { $info = $item_id === 'root' ? $this->root_content : '';
$info = $this->root_content; return $info ? tooltipicon(kill_format($info)) : '';
}
$ret = $info ? tooltipicon(kill_format($info)) : '';
return $ret;
} }
public function showContent($item_id, $num_all_entries = 0) public function showContent($item_id, $num_all_entries = 0)
......
...@@ -339,8 +339,12 @@ class RoomSearchWidget extends SidebarWidget ...@@ -339,8 +339,12 @@ class RoomSearchWidget extends SidebarWidget
$properties[$name] = $criteria['value']; $properties[$name] = $criteria['value'];
} }
if ($properties[$name][0] && $properties[$name][1] && if (
($properties[$name][0] > $properties[$name][1]) && $name != 'room_category_id') { isset($properties[$name][0], $properties[$name][1])
&& $properties[$name][0] && $properties[$name][1]
&& $properties[$name][0] > $properties[$name][1]
&& $name !== 'room_category_id'
) {
//A range is selected, but the range start is bigger //A range is selected, but the range start is bigger
//then the range end. That's an error! //then the range end. That's an error!
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* @category Stud.IP * @category Stud.IP
* @since 3.5 * @since 3.5
*/ */
class Abschluss extends ModuleManagementModelTreeItem implements PrivacyObject class Abschluss extends ModuleManagementModelTreeItem implements PrivacyObject
{ {
protected static function configure($config = []) protected static function configure($config = [])
...@@ -47,16 +46,21 @@ class Abschluss extends ModuleManagementModelTreeItem implements PrivacyObject ...@@ -47,16 +46,21 @@ class Abschluss extends ModuleManagementModelTreeItem implements PrivacyObject
'order_by' => 'GROUP BY fach_id ORDER BY name' 'order_by' => 'GROUP BY fach_id ORDER BY name'
]; ];
$config['additional_fields']['count_faecher']['get'] = $config['additional_fields']['count_faecher']['get'] = function (Abschluss $abschluss) {
function($abschluss) { return $abschluss->count_faecher; }; return $abschluss->count_faecher;
$config['additional_fields']['kategorie_name']['get'] = };
function($abschluss) { return $abschluss->kategorie_name; }; $config['additional_fields']['kategorie_name']['get'] = function (Abschluss $abschluss) {
$config['additional_fields']['kategorie_id']['get'] = return $abschluss->kategorie_name;
function($abschluss) { return $abschluss->category_assignment->kategorie_id; }; };
$config['additional_fields']['count_studiengaenge']['get'] = $config['additional_fields']['kategorie_id']['get'] = function (Abschluss $abschluss) {
function($abschluss) { return $abschluss->count_studiengaenge; }; return $abschluss->category_assignment ? $abschluss->category_assignment->kategorie_id : null;
$config['additional_fields']['count_objects']['get'] = };
function($abschluss) { return $abschluss->count_objects; }; $config['additional_fields']['count_studiengaenge']['get'] = function (Abschluss $abschluss) {
return $abschluss->count_studiengaenge;
};
$config['additional_fields']['count_objects']['get'] = function (Abschluss $abschluss) {
return $abschluss->count_objects;
};
$config['additional_fields']['count_user']['get'] = 'countUser'; $config['additional_fields']['count_user']['get'] = 'countUser';
$config['i18n_fields']['name'] = true; $config['i18n_fields']['name'] = true;
......
...@@ -268,6 +268,10 @@ class Semester extends SimpleORMap ...@@ -268,6 +268,10 @@ class Semester extends SimpleORMap
$use_semester_id = true $use_semester_id = true
) )
{ {
$select_attributes = array_merge([
'name' => 'sem_select',
], $select_attributes ?? []);
$semester = Semester::findAllVisible(); $semester = Semester::findAllVisible();
unset($semester[0]); unset($semester[0]);
...@@ -280,10 +284,6 @@ class Semester extends SimpleORMap ...@@ -280,10 +284,6 @@ class Semester extends SimpleORMap
} }
$semester = array_reverse($semester, true); $semester = array_reverse($semester, true);
if (!$select_attributes['name']) {
$select_attributes['name'] = 'sem_select';
}
$template = $GLOBALS['template_factory']->open('shared/semester-selector'); $template = $GLOBALS['template_factory']->open('shared/semester-selector');
$template->semesters = $semester; $template->semesters = $semester;
$template->select_attributes = $select_attributes; $template->select_attributes = $select_attributes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment