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

second batch of changes, re #2193

Merge request studip/studip!1421
parent ad2f20bf
No related branches found
No related tags found
No related merge requests found
...@@ -494,7 +494,7 @@ class Calendar_SingleController extends Calendar_CalendarController ...@@ -494,7 +494,7 @@ class Calendar_SingleController extends Calendar_CalendarController
} }
$this->sem_data = Semester::findAllVisible(); $this->sem_data = Semester::findAllVisible();
$sem = ($config_sem && $config_sem != '0' ? $config_sem : Config::get()->MY_COURSES_DEFAULT_CYCLE); $sem = $config_sem ?: Config::get()->MY_COURSES_DEFAULT_CYCLE;
if (Request::option('sem_select')) { if (Request::option('sem_select')) {
$sem = Request::get('sem_select', $sem); $sem = Request::get('sem_select', $sem);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<? foreach ($sem_courses as $sem_key => $course_group) : ?> <? foreach ($sem_courses as $sem_key => $course_group) : ?>
<table class="default collapsable"> <table class="default collapsable">
<caption> <caption>
<?= htmlReady($sem_data[$sem_key]['name']) ?> <?= htmlReady($sem_data[$sem_key]['name'] ?? _('Unbekanntes Semester')) ?>
</caption> </caption>
<colgroup> <colgroup>
<col width="7px"> <col width="7px">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</colgroup> </colgroup>
<thead> <thead>
<tr class="sortable"> <tr class="sortable">
<? if ($show_bulk_checkboxes) : ?> <? if (!empty($show_bulk_checkboxes)) : ?>
<th data-sort="false"> <th data-sort="false">
<input type="checkbox" <input type="checkbox"
<?= !empty($table_id) <?= !empty($table_id)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<td> <td>
<label> <label>
<?= _('Angezeigter Name des Dokuments') ?> <?= _('Angezeigter Name des Dokuments') ?>
<input name="doc_displayname_<?= $key; ?>" type="text" value="<?= (!$documents || !key_exists($key, $documents)) ? '' : htmlReady($documents[$key]->name) ?>"<?= $perm->disable('name') ?>> <input name="doc_displayname_<?= $key; ?>" type="text" value="<?= !isset($documents[$key]) ? '' : htmlReady($documents[$key]->name) ?>"<?= $perm->disable('name') ?>>
</label> </label>
</td> </td>
</tr> </tr>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</div> </div>
<div id="fileviewer_<?= $key; ?>"> <div id="fileviewer_<?= $key; ?>">
<ul class="stgfiles list-unstyled"> <ul class="stgfiles list-unstyled">
<? if ($documents && key_exists($key, $documents)): ?> <? if (isset($documents[$key])): ?>
<li class="stgfile"> <li class="stgfile">
<input type="hidden" name="document_id" id="document_id" value="<?= htmlReady($documents[$key]->fileref_id) ?>"> <input type="hidden" name="document_id" id="document_id" value="<?= htmlReady($documents[$key]->fileref_id) ?>">
<span class="icon"><?= Icon::create('file', Icon::ROLE_INFO, ['class' => 'text-bottom']); ?></span> <span class="icon"><?= Icon::create('file', Icon::ROLE_INFO, ['class' => 'text-bottom']); ?></span>
......
...@@ -88,18 +88,12 @@ ...@@ -88,18 +88,12 @@
</td> </td>
<? endif ?> <? endif ?>
<td> <td>
<a href="<?= ( <a href="<?= $resource->getActionLink(empty($booking_plan_link_on_name) ? 'show' : 'booking_plan') ?>"
$booking_plan_link_on_name
? $resource->getActionLink('booking_plan')
: $resource->getActionLink('show')
) ?>"
<?= !empty($user_has_booking_rights) ? '' : 'data-dialog' ?> <?= !empty($user_has_booking_rights) ? '' : 'data-dialog' ?>
data-id="<?= htmlReady($resource->id) ?>" data-id="<?= htmlReady($resource->id) ?>"
data-range_type="<?= $clipboard_range_type data-range_type="<?= htmlReady($clipboard_range_type ?? 'Resource') ?>"
? htmlReady($clipboard_range_type)
: 'Resource' ?>"
data-name="<?= htmlReady($resource->name) ?>" data-name="<?= htmlReady($resource->name) ?>"
<?= $clipboard_range_type ? 'class="clipboard-draggable-item"' : '' ?>> <?= isset($clipboard_range_type) ? 'class="clipboard-draggable-item"' : '' ?>>
<? if ($show_picture): ?> <? if ($show_picture): ?>
<? $picture_url = $resource->getPictureUrl(); ?> <? $picture_url = $resource->getPictureUrl(); ?>
<? if ($picture_url): ?> <? if ($picture_url): ?>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
] ]
) ?> ) ?>
</fieldset> </fieldset>
<? if ($defined_properties) : ?> <? if (!empty($defined_properties)) : ?>
<?= $this->render_partial( <?= $this->render_partial(
'resources/resource/_standard_properties_form_part.php', 'resources/resource/_standard_properties_form_part.php',
[ [
......
...@@ -849,11 +849,21 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen ...@@ -849,11 +849,21 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
} }
if ($this->metadate_id) { if ($this->metadate_id) {
$date = $this->cycle->dates->last();
if (!isset($date)) {
return null;
}
$end_date->setTimestamp($this->cycle->dates->last()->end_time); $end_date->setTimestamp($this->cycle->dates->last()->end_time);
return $end_date; return $end_date;
} }
if ($this->course_id) { if ($this->course_id) {
$date = $this->course->dates->last();
if (!isset($date)) {
return null;
}
$end_date->setTimestamp($this->course->dates->last()->end_time); $end_date->setTimestamp($this->course->dates->last()->end_time);
return $end_date; return $end_date;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment