summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorFelix Favre <felix.favre@protonet.info>2015-08-26 15:00:10 +0200
committerFelix Favre <felix.favre@protonet.info>2015-08-26 15:00:48 +0200
commite4bd324801d881f29d342e4826324c193d88d77d (patch)
treeb488d97d567ff6cce056da08f3e65a4e26674417 /includes
parent1af6b8cf2082411362112200c094e0b9d96eb6a5 (diff)
changed all y-m-d date formats to Y-m-d date formats
part of #202
Diffstat (limited to 'includes')
-rw-r--r--includes/mailer/shifts_mailer.php12
-rw-r--r--includes/pages/user_myshifts.php4
-rw-r--r--includes/pages/user_shifts.php34
-rw-r--r--includes/view/Shifts_view.php4
4 files changed, 27 insertions, 27 deletions
diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php
index fb234aab..e50cd1a1 100644
--- a/includes/mailer/shifts_mailer.php
+++ b/includes/mailer/shifts_mailer.php
@@ -21,12 +21,12 @@ function mail_shift_change($old_shift, $new_shift) {
}
if ($old_shift["start"] != $new_shift["start"]) {
- $message .= sprintf(_("* Shift Start changed from %s to %s"), date("y-m-d H:i", $old_shift["start"]), date("y-m-d H:i", $new_shift["start"])) . "\n";
+ $message .= sprintf(_("* Shift Start changed from %s to %s"), date("Y-m-d H:i", $old_shift["start"]), date("Y-m-d H:i", $new_shift["start"])) . "\n";
$noticable_changes = true;
}
if ($old_shift["end"] != $new_shift["end"]) {
- $message .= sprintf(_("* Shift End changed from %s to %s"), date("y-m-d H:i", $old_shift["end"]), date("y-m-d H:i", $new_shift["end"])) . "\n";
+ $message .= sprintf(_("* Shift End changed from %s to %s"), date("Y-m-d H:i", $old_shift["end"]), date("Y-m-d H:i", $new_shift["end"])) . "\n";
$noticable_changes = true;
}
@@ -45,7 +45,7 @@ function mail_shift_change($old_shift, $new_shift) {
$message .= $new_shift["name"] . "\n";
$message .= $new_shift["title"] . "\n";
- $message .= date("y-m-d H:i", $new_shift["start"]) . " - " . date("H:i", $new_shift["end"]) . "\n";
+ $message .= date("Y-m-d H:i", $new_shift["start"]) . " - " . date("H:i", $new_shift["end"]) . "\n";
$message .= $new_room["Name"] . "\n";
foreach ($users as $user)
@@ -61,7 +61,7 @@ function mail_shift_delete($shift) {
$message .= $shift["name"] . "\n";
$message .= $new_shift["title"] . "\n";
- $message .= date("y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
+ $message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
foreach ($users as $user)
@@ -76,7 +76,7 @@ function mail_shift_assign($user, $shift) {
$message = _("You have been assigned to a Shift:") . "\n";
$message .= $shift["name"] . "\n";
$message .= $shift["title"] . "\n";
- $message .= date("y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
+ $message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
engelsystem_email_to_user($user, '[engelsystem] ' . _("Assigned to Shift"), $message, true);
@@ -90,7 +90,7 @@ function mail_shift_removed($user, $shift) {
$message = _("You have been removed from a Shift:") . "\n";
$message .= $shift["name"] . "\n";
$message .= $shift["title"] . "\n";
- $message .= date("y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
+ $message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
engelsystem_email_to_user($user, '[engelsystem] ' . _("Removed from Shift"), $message, true);
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index ee3cf1be..66e591d1 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -68,7 +68,7 @@ function user_myshifts() {
if ($result === false)
engelsystem_error('Unable to update shift entr.');
- engelsystem_log("Updated " . User_Nick_render($user_source) . "'s shift " . $shift['name'] . " from " . date("y-m-d H:i", $shift['start']) . " to " . date("y-m-d H:i", $shift['end']) . " with comment " . $comment . ". Freeloaded: " . ($freeloaded ? "YES Comment: " . $freeload_comment : "NO"));
+ engelsystem_log("Updated " . User_Nick_render($user_source) . "'s shift " . $shift['name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " with comment " . $comment . ". Freeloaded: " . ($freeloaded ? "YES Comment: " . $freeload_comment : "NO"));
success(_("Shift saved."));
redirect(page_link_to('users') . '&action=view&user_id=' . $shifts_user['UID']);
}
@@ -93,7 +93,7 @@ function user_myshifts() {
$angeltype = AngelType($shift['TID']);
$shifttype = ShiftType($shift['shifttype_id']);
- engelsystem_log("Deleted own shift: " . $shifttype['name'] . " at " . $room['Name'] . " from " . date("y-m-d H:i", $shift['start']) . " to " . date("y-m-d H:i", $shift['end']) . " as " . $angeltype['name']);
+ engelsystem_log("Deleted own shift: " . $shifttype['name'] . " at " . $room['Name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " as " . $angeltype['name']);
success(_("You have been signed off from the shift."));
} else
error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so."));
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 8c01eef8..96a423d9 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -6,40 +6,40 @@ function shifts_title() {
function user_shifts() {
global $user, $privileges, $max_freeloadable_shifts;
-
+
if (User_is_freeloader($user))
redirect(page_link_to('user_myshifts'));
-
+
// Locations laden
$rooms = sql_select("SELECT * FROM `Room` WHERE `show`='Y' ORDER BY `Name`");
$room_array = array();
foreach ($rooms as $room)
$room_array[$room['RID']] = $room['Name'];
-
+
// Löschen einzelner Schicht-Einträge (Also Belegung einer Schicht von Engeln) durch Admins
if (isset($_REQUEST['entry_id']) && in_array('user_shifts_admin', $privileges)) {
if (isset($_REQUEST['entry_id']) && test_request_int('entry_id'))
$entry_id = $_REQUEST['entry_id'];
else
redirect(page_link_to('user_shifts'));
-
+
$shift_entry_source = sql_select("
- SELECT `User`.`Nick`, `ShiftEntry`.`Comment`, `ShiftEntry`.`UID`, `ShiftTypes`.`name`, `Shifts`.*, `Room`.`Name`, `AngelTypes`.`name` as `angel_type`
- FROM `ShiftEntry`
- JOIN `User` ON (`User`.`UID`=`ShiftEntry`.`UID`)
- JOIN `AngelTypes` ON (`ShiftEntry`.`TID` = `AngelTypes`.`id`)
- JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
+ SELECT `User`.`Nick`, `ShiftEntry`.`Comment`, `ShiftEntry`.`UID`, `ShiftTypes`.`name`, `Shifts`.*, `Room`.`Name`, `AngelTypes`.`name` as `angel_type`
+ FROM `ShiftEntry`
+ JOIN `User` ON (`User`.`UID`=`ShiftEntry`.`UID`)
+ JOIN `AngelTypes` ON (`ShiftEntry`.`TID` = `AngelTypes`.`id`)
+ JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)
JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
- JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)
+ JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)
WHERE `ShiftEntry`.`id`='" . sql_escape($entry_id) . "'");
if (count($shift_entry_source) > 0) {
$shift_entry_source = $shift_entry_source[0];
-
+
$result = ShiftEntry_delete($entry_id);
if ($result === false)
engelsystem_error('Unable to delete shift entry.');
-
- engelsystem_log("Deleted " . User_Nick_render($shift_entry_source) . "'s shift: " . $shift_entry_source['name'] . " at " . $shift_entry_source['Name'] . " from " . date("y-m-d H:i", $shift_entry_source['start']) . " to " . date("y-m-d H:i", $shift_entry_source['end']) . " as " . $shift_entry_source['angel_type']);
+
+ engelsystem_log("Deleted " . User_Nick_render($shift_entry_source) . "'s shift: " . $shift_entry_source['name'] . " at " . $shift_entry_source['Name'] . " from " . date("Y-m-d H:i", $shift_entry_source['start']) . " to " . date("Y-m-d H:i", $shift_entry_source['end']) . " as " . $shift_entry_source['angel_type']);
success(_("Shift entry deleted."));
} else
error(_("Entry not found."));
@@ -161,8 +161,8 @@ function user_shifts() {
sql_query("INSERT INTO `NeededAngelTypes` SET `shift_id`='" . sql_escape($shift_id) . "', `angel_type_id`='" . sql_escape($type_id) . "', `count`='" . sql_escape($count) . "'");
$needed_angel_types_info[] = $angel_types[$type_id]['name'] . ": " . $count;
}
-
- engelsystem_log("Updated shift '" . $name . "' from " . date("y-m-d H:i", $start) . " to " . date("y-m-d H:i", $end) . " with angel types " . join(", ", $needed_angel_types_info));
+
+ engelsystem_log("Updated shift '" . $name . "' from " . date("Y-m-d H:i", $start) . " to " . date("Y-m-d H:i", $end) . " with angel types " . join(", ", $needed_angel_types_info));
success(_("Shift updated."));
redirect(shift_link([
@@ -294,7 +294,7 @@ function user_shifts() {
sql_query("INSERT INTO `UserAngelTypes` (`user_id`, `angeltype_id`) VALUES ('" . sql_escape($user_id) . "', '" . sql_escape($selected_type_id) . "')");
$user_source = User($user_id);
- engelsystem_log("User " . User_Nick_render($user_source) . " signed up for shift " . $shift['name'] . " from " . date("y-m-d H:i", $shift['start']) . " to " . date("y-m-d H:i", $shift['end']));
+ engelsystem_log("User " . User_Nick_render($user_source) . " signed up for shift " . $shift['name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']));
success(_("You are subscribed. Thank you!") . ' <a href="' . page_link_to('user_myshifts') . '">' . _("My shifts") . ' &raquo;</a>');
redirect(shift_link($shift));
}
@@ -530,7 +530,7 @@ function view_user_shifts() {
$thistime = $first + ($i * 15 * 60);
if ($thistime % (24 * 60 * 60) == 23 * 60 * 60 && $endtime - $starttime > 24 * 60 * 60) {
$shifts_table .= "<tr class=\"row-day\"><th class=\"row-header\">";
- $shifts_table .= date('y-m-d<b\r />H:i', $thistime);
+ $shifts_table .= date('Y-m-d<b\r />H:i', $thistime);
} elseif ($thistime % (60 * 60) == 0) {
$shifts_table .= "<tr class=\"row-hour\"><th>";
$shifts_table .= date("H:i", $thistime);
diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php
index b0628a3b..c67ca740 100644
--- a/includes/view/Shifts_view.php
+++ b/includes/view/Shifts_view.php
@@ -87,7 +87,7 @@ function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source,
div('col-sm-3 col-xs-6', [
'<h4>' . _('Start') . '</h4>',
'<p class="lead' . (time() >= $shift['start'] ? ' text-success' : '') . '">',
- glyph('calendar') . date('y-m-d', $shift['start']),
+ glyph('calendar') . date('Y-m-d', $shift['start']),
'<br />',
glyph('time') . date('H:i', $shift['start']),
'</p>'
@@ -95,7 +95,7 @@ function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source,
div('col-sm-3 col-xs-6', [
'<h4>' . _('End') . '</h4>',
'<p class="lead' . (time() >= $shift['end'] ? ' text-success' : '') . '">',
- glyph('calendar') . date('y-m-d', $shift['end']),
+ glyph('calendar') . date('Y-m-d', $shift['end']),
'<br />',
glyph('time') . date('H:i', $shift['end']),
'</p>'