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
1 merge request!4Draft: Icon creation
......@@ -494,7 +494,7 @@ class Calendar_SingleController extends Calendar_CalendarController
}
$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')) {
$sem = Request::get('sem_select', $sem);
}
......
......@@ -7,7 +7,7 @@
<? foreach ($sem_courses as $sem_key => $course_group) : ?>
<table class="default collapsable">
<caption>
<?= htmlReady($sem_data[$sem_key]['name']) ?>
<?= htmlReady($sem_data[$sem_key]['name'] ?? _('Unbekanntes Semester')) ?>
</caption>
<colgroup>
<col width="7px">
......
......@@ -14,7 +14,7 @@
</colgroup>
<thead>
<tr class="sortable">
<? if ($show_bulk_checkboxes) : ?>
<? if (!empty($show_bulk_checkboxes)) : ?>
<th data-sort="false">
<input type="checkbox"
<?= !empty($table_id)
......
......@@ -29,7 +29,7 @@
<td>
<label>
<?= _('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>
</td>
</tr>
......@@ -73,7 +73,7 @@
</div>
<div id="fileviewer_<?= $key; ?>">
<ul class="stgfiles list-unstyled">
<? if ($documents && key_exists($key, $documents)): ?>
<? if (isset($documents[$key])): ?>
<li class="stgfile">
<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>
......
......@@ -88,18 +88,12 @@
</td>
<? endif ?>
<td>
<a href="<?= (
$booking_plan_link_on_name
? $resource->getActionLink('booking_plan')
: $resource->getActionLink('show')
) ?>"
<a href="<?= $resource->getActionLink(empty($booking_plan_link_on_name) ? 'show' : 'booking_plan') ?>"
<?= !empty($user_has_booking_rights) ? '' : 'data-dialog' ?>
data-id="<?= htmlReady($resource->id) ?>"
data-range_type="<?= $clipboard_range_type
? htmlReady($clipboard_range_type)
: 'Resource' ?>"
data-range_type="<?= htmlReady($clipboard_range_type ?? 'Resource') ?>"
data-name="<?= htmlReady($resource->name) ?>"
<?= $clipboard_range_type ? 'class="clipboard-draggable-item"' : '' ?>>
<?= isset($clipboard_range_type) ? 'class="clipboard-draggable-item"' : '' ?>>
<? if ($show_picture): ?>
<? $picture_url = $resource->getPictureUrl(); ?>
<? if ($picture_url): ?>
......
......@@ -32,7 +32,7 @@
]
) ?>
</fieldset>
<? if ($defined_properties) : ?>
<? if (!empty($defined_properties)) : ?>
<?= $this->render_partial(
'resources/resource/_standard_properties_form_part.php',
[
......
......@@ -849,11 +849,21 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
}
if ($this->metadate_id) {
$date = $this->cycle->dates->last();
if (!isset($date)) {
return null;
}
$end_date->setTimestamp($this->cycle->dates->last()->end_time);
return $end_date;
}
if ($this->course_id) {
$date = $this->course->dates->last();
if (!isset($date)) {
return null;
}
$end_date->setTimestamp($this->course->dates->last()->end_time);
return $end_date;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment