Skip to content
Snippets Groups Projects
Verified Commit 413b8969 authored by Till Glöggler's avatar Till Glöggler
Browse files

fixes #284, show room in tooltip

parent 4c06fda4
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
) )
) ?>) ) ?>)
<? endif ?> <? endif ?>
<?= tooltipIcon(join("\n", $request->getTimeIntervalStrings())) ?> <?= tooltipIcon(nl2br(join("\n", $request->getTimeIntervalStrings())), false, true) ?>
<? endif ?> <? endif ?>
</td> </td>
<? $priority = $request->getPriority() ?> <? $priority = $request->getPriority() ?>
......
...@@ -1195,16 +1195,27 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen ...@@ -1195,16 +1195,27 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
public function getTimeIntervalStrings() public function getTimeIntervalStrings()
{ {
$strings = []; $strings = [];
$intervals = $this->getTimeIntervals(); $intervals = $this->getTimeIntervals(false, true);
foreach ($intervals as $interval) { foreach ($intervals as $interval) {
$room = '';
$date = call_user_func([$interval['range'], 'find'], $interval['range_id']);
if ($room_obj = Room::find($date->room_booking->resource_id)) {
$room = $room_obj->name;
}
$same_day = (date('Ymd', $interval['begin']) $same_day = (date('Ymd', $interval['begin'])
== date('Ymd', $interval['end']) == date('Ymd', $interval['end'])
); );
if ($same_day) { if ($same_day) {
$strings[] = strftime('%a %x %R', $interval['begin']) . ' - ' . strftime('%R', $interval['end']); $strings[] = strftime('%a. %x %R', $interval['begin'])
. ' - ' . strftime('%R', $interval['end'])
. ($room ? ', '. $room : '');
} else { } else {
$strings[] = strftime('%a %x %R', $interval['begin']) . ' - ' . strftime('%a %x %R', $interval['end']); $strings[] = strftime('%a. %x %R', $interval['begin'])
. ' - ' . strftime('%a %x %R', $interval['end'])
. ($room ? ', '. $room : '');
} }
} }
return $strings; return $strings;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment