Skip to content
Snippets Groups Projects
Commit 7602ce0b authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

first batch of changes (packet 1), re #2193

Merge request !1419
parent 83f7b36c
No related branches found
No related tags found
No related merge requests found
Showing
with 19 additions and 21 deletions
......@@ -55,7 +55,7 @@ class Studiengaenge_FachbereichestgteileController extends Studiengaenge_Studien
if (Request::isXhr()) {
$this->render_template('studiengaenge/studiengangteile/details_grouped');
} else {
$this->performe_relayed('index');
$this->perform_relayed('index');
}
}
......
......@@ -46,9 +46,6 @@ class Studiengaenge_FaecherController extends Studiengaenge_StudiengangteileCont
}
$this->count = StudiengangTeil::getCountAssignedFaecher($filter);
}
if (!isset($this->fach_id)) {
$this->fach_id = null;
}
$this->show_sidebar_search = true;
$this->setSidebar();
}
......
......@@ -3,7 +3,7 @@
<section class="hgroup">
<?= _('Kalender') ?>
<select class="sidebar-selectlist submit-upon-select" style="width: 16em;" name="range_id">
<option value="user.<?= get_username() ?>"<?= (get_userid() == $calendar_id ? ' selected' : '') ?>>
<option value="user.<?= get_username() ?>"<?= get_userid() === $range_id ? ' selected' : '' ?>>
<?= _("Eigener Kalender") ?>
</option>
<? $groups = Calendar::getGroups($GLOBALS['user']->id); ?>
......
......@@ -8,7 +8,7 @@
<? $perms = [1 => _('Keine'), 2 => _('Lesen'), 4 => _('Schreiben')] ?>
<table class="default">
<caption>
<?= htmlReady($title) ?>
<?= _('Bestehende Freigaben') ?>
<span class="actions" style="font-size: 0.8em;">
<label>
<?= _('Auswahl') ?>:
......@@ -81,7 +81,7 @@
<?= $perms[$own_perms[$user->user_id]] ?>
</td>
<td class="actions">
<a title="<?= _('Benutzer entfernen') ?>" onClick="STUDIP.CalendarDialog.removeUser(this);" href="<?= $controller->url_for('calendar/single/remove_user/' . $calendar->getRangeId() . $filter, ['user_id' => $user->user_id]) ?>">
<a title="<?= _('Benutzer entfernen') ?>" onClick="STUDIP.CalendarDialog.removeUser(this);" href="<?= $controller->url_for('calendar/single/remove_user/' . $calendar->getRangeId(), ['user_id' => $user->user_id]) ?>">
<?= Icon::create('trash', 'clickable')->asImg() ?>
</a>
</td>
......
......@@ -66,7 +66,7 @@
<? if ($news_items && count($news_items)) : ?>
<? foreach ($area_structure as $type => $area_data) : ?>
<? $last_title = 'none' ?>
<? if (is_array($news_items[$type]) && count($news_items[$type])) : ?>
<? if (isset($news_items[$type]) && is_array($news_items[$type]) && count($news_items[$type]) > 0) : ?>
<table class="default">
<? if (!$area_type) : ?>
<caption>
......
......@@ -41,7 +41,7 @@
<td style="text-align: center;" class="dont-hide"><?= $abschluss->count_studiengaenge ?></td>
<td></td>
</tr>
<? if ($abschluss_id === $abschluss->id) : ?>
<? if (isset($abschluss_id) && $abschluss_id === $abschluss->id) : ?>
<tr class="loaded-details nohover">
<?= $this->render_partial('studiengaenge/studiengaenge/details') ?>
</tr>
......
......@@ -42,7 +42,7 @@
<td style="text-align: center;" class="dont-hide"><?= $fachbereich->count_objects ?></td>
<td></td>
</tr>
<? if ($fachbereich_id === $fachbereich->id) : ?>
<? if (isset($fachbereich_id) && $fachbereich_id === $fachbereich->id) : ?>
<tr class="loaded-details nohover">
<?= $this->render_partial('studiengaenge/studiengaenge/details') ?>
</tr>
......
......@@ -35,7 +35,8 @@
</a>
<? endif; ?>
</td>
<? if ($details_id === $fachbereich['institut_id'] || count($stgteil_ids)) : ?>
</tr>
<? if (isset($details_id) && $details_id === $fachbereich['institut_id'] || count($stgteil_ids)) : ?>
<? $stgteile = StudiengangTeil::findByFachbereich($fachbereich['institut_id'], ['mvv_stgteil.stgteil_id' => $stgteil_ids], 'fach_name,zusatz,kp', 'ASC'); ?>
<tr class="loaded-details nohover">
<?= $this->render_partial('studiengaenge/studiengangteile/details_grouped', compact('stgteile')) ?>
......
......@@ -42,7 +42,7 @@
<td style="text-align: center;" class="dont-hide"><?= $kategorie->count_studiengaenge ?></td>
<td></td>
</tr>
<? if ($kategorie_id == $kategorie->id) : ?>
<? if (isset($kategorie_id) && $kategorie_id == $kategorie->id) : ?>
<tr class="loaded-details nohover">
<?= $this->render_partial('studiengaenge/studiengaenge/details') ?>
</tr>
......
......@@ -21,7 +21,7 @@ use Studip\Button, Studip\LinkButton;
<legend>
<?= _('Fach') ?>
</legend>
<? if (is_array($faecher)) : ?>
<? if (isset($faecher) && is_array($faecher)) : ?>
<label>
<?= sprintf(_('Mögliche Fächer im gewählten Fachbereich %s:'), '<strong>' . htmlReady($fachbereich->name) . '</strong>') ?>
<select name="fach_item">
......
......@@ -51,7 +51,7 @@ class ModulesNotification
$metadata = $module->getMetadata();
$this->registered_notification_modules[$id] = [
'icon' => $metadata['icon'],
'icon' => !empty($metadata['icon']) ? $metadata['icon'] : null,
'name' => !empty($metadata['displayname']) ? $metadata['displayname'] : $module->getPluginName(),
];
if ($module instanceof CoreOverview) {
......
......@@ -111,7 +111,7 @@ class FileManager
return 'file-generic';
}
[$category, $type] = explode('/', $mime_type, 2);
list($category, $type) = explode('/', $mime_type, 2);
switch($category) {
case 'image':
......@@ -1639,9 +1639,9 @@ class FileManager
$header_parts = explode(';', $disposition_header);
foreach ($header_parts as $part) {
$part = trim($part);
[$key, $value] = explode('=', $part, 2);
if (mb_strtolower($key) === 'filename') {
$header['filename'] = trim($value, '"');
$chunks = explode('=', $part, 2);
if (count($chunks) === 2 && mb_strtolower($chunks[0]) === 'filename') {
$header['filename'] = trim($chunks[1], '"');
}
}
} else {
......
......@@ -608,7 +608,7 @@ class Studiengang extends ModuleManagementModelTreeItem
$result = [];
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $status) {
$result[$status['stat']] = [
'name' => $GLOBALS['MVV_STUDIENGANG']['STATUS']['values'][$status['stat']]['name'],
'name' => $GLOBALS['MVV_STUDIENGANG']['STATUS']['values'][$status['stat']]['name'] ?? _('Undefinierter Status'),
'count_objects' => $status['count_objects']
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment