summaryrefslogtreecommitdiff
path: root/includes/pages
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-12-26 19:39:40 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2018-12-26 19:39:40 +0100
commit36830c43e7cd1bf277564a60ef1dcc7c69b7ea9c (patch)
treedfa378233b1c2b980534722d3ab671b4adb0dd8f /includes/pages
parent26f58b8156324f09f5fc24680b45b844f6998fd6 (diff)
Fix warning if searching two whitespaces and formatting
Diffstat (limited to 'includes/pages')
-rw-r--r--includes/pages/admin_arrive.php4
-rw-r--r--includes/pages/admin_shifts.php32
2 files changed, 19 insertions, 17 deletions
diff --git a/includes/pages/admin_arrive.php b/includes/pages/admin_arrive.php
index 90f939fb..aedb0803 100644
--- a/includes/pages/admin_arrive.php
+++ b/includes/pages/admin_arrive.php
@@ -79,11 +79,13 @@ function admin_arrive()
$match = false;
$index = join(' ', $usr->toArray());
foreach ($tokens as $t) {
- if (stristr($index, trim($t))) {
+ $t = trim($t);
+ if (!empty($t) && stristr($index, $t)) {
$match = true;
break;
}
}
+
if (!$match) {
continue;
}
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 51167bc4..8ef713a1 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -183,10 +183,10 @@ function admin_shifts()
$shifts = [];
if ($mode == 'single') {
$shifts[] = [
- 'start' => $start,
- 'end' => $end,
- 'RID' => $rid,
- 'title' => $title,
+ 'start' => $start,
+ 'end' => $end,
+ 'RID' => $rid,
+ 'title' => $title,
'shifttype_id' => $shifttype_id
];
} elseif ($mode == 'multi') {
@@ -202,10 +202,10 @@ function admin_shifts()
}
$shifts[] = [
- 'start' => $shift_start,
- 'end' => $shift_end,
- 'RID' => $rid,
- 'title' => $title,
+ 'start' => $shift_start,
+ 'end' => $shift_end,
+ 'RID' => $rid,
+ 'title' => $title,
'shifttype_id' => $shifttype_id
];
@@ -261,10 +261,10 @@ function admin_shifts()
}
$shifts[] = [
- 'start' => $shift_start,
- 'end' => $shift_end,
- 'RID' => $rid,
- 'title' => $title,
+ 'start' => $shift_start,
+ 'end' => $shift_end,
+ 'RID' => $rid,
+ 'title' => $title,
'shifttype_id' => $shifttype_id
];
@@ -276,14 +276,14 @@ function admin_shifts()
$shifts_table = [];
foreach ($shifts as $shift) {
$shifts_table_entry = [
- 'timeslot' =>
+ 'timeslot' =>
'<span class="glyphicon glyphicon-time"></span> '
. date('Y-m-d H:i', $shift['start'])
. ' - '
. date('H:i', $shift['end'])
. '<br />'
. Room_name_render(Room($shift['RID'])),
- 'title' =>
+ 'title' =>
ShiftType_name_render(ShiftType($shifttype_id))
. ($shift['title'] ? '<br />' . $shift['title'] : ''),
'needed_angels' => ''
@@ -319,8 +319,8 @@ function admin_shifts()
form_hidden('angelmode', $angelmode),
form_submit('back', __('back')),
table([
- 'timeslot' => __('Time and location'),
- 'title' => __('Type and title'),
+ 'timeslot' => __('Time and location'),
+ 'title' => __('Type and title'),
'needed_angels' => __('Needed angels')
], $shifts_table),
form_submit('submit', __('Save'))