reformatted code due to guidelines

This commit is contained in:
jwacalex 2018-12-22 02:13:02 +01:00 committed by msquare
parent 60a9c15454
commit 8c5b52aa11
1 changed files with 25 additions and 25 deletions

View File

@ -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
];
@ -217,17 +217,17 @@ function admin_shifts()
$change_index = 0;
// Ersten/nächsten passenden Schichtwechsel suchen
foreach ($change_hours as $i => $change_time) {
if(!preg_match('/\d{2}:\d{2}/',$change_time)) {
$change_time = $change_time.":00";
if (!preg_match('/\d{2}:\d{2}/', $change_time)) {
$change_time = $change_time . ":00";
}
$change_time = explode(':',$change_time);
$change_time = explode(':', $change_time);
$change_hour = $change_time[0];
$change_minute = $change_time[1];
if ($start < $day + $change_hour * 60 * 60 + $change_minute * 60) {
if ($start < $day + $change_hour * 60 * 60 + $change_minute * 60) {
$change_index = $i;
} elseif ($start == $day + $change_hour * 60 * 60 + $change_minute * 60) {
} elseif ($start == $day + $change_hour * 60 * 60 + $change_minute * 60) {
// Start trifft Schichtwechsel
$change_index = ($i + count($change_hours) - 1) % count($change_hours);
break;
@ -240,12 +240,12 @@ function admin_shifts()
do {
$day = parse_date('Y-m-d H:i', date('Y-m-d', $shift_start) . ' 00:00');
$change_time=$change_hours[$change_index];
if(!preg_match('/\d{2}:\d{2}/',$change_time)) {
$change_time = $change_time.":00";
$change_time = $change_hours[$change_index];
if (!preg_match('/\d{2}:\d{2}/', $change_time)) {
$change_time = $change_time . ":00";
}
$change_time = explode(':',$change_time);
$change_time = explode(':', $change_time);
$change_hour = $change_time[0];
$change_minute = $change_time[1];
@ -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'))