|
|
@ -1,7 +1,6 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
function mail_shift_change($old_shift, $new_shift) {
|
|
|
|
function mail_shift_change($old_shift, $new_shift) {
|
|
|
|
|
|
|
|
|
|
|
|
$users = ShiftEntries_by_shift($old_shift["SID"]);
|
|
|
|
$users = ShiftEntries_by_shift($old_shift["SID"]);
|
|
|
|
$old_room = Room($old_shift["RID"]);
|
|
|
|
$old_room = Room($old_shift["RID"]);
|
|
|
|
$new_room = Room($new_shift["RID"]);
|
|
|
|
$new_room = Room($new_shift["RID"]);
|
|
|
@ -43,15 +42,12 @@ function mail_shift_change($old_shift, $new_shift) {
|
|
|
|
$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";
|
|
|
|
$message .= $new_room["Name"] . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($users as $user) {
|
|
|
|
foreach ($users as $user)
|
|
|
|
if ($user["email_shiftinfo"]) {
|
|
|
|
if ($user["email_shiftinfo"])
|
|
|
|
engelsystem_email_to_user($user, _("[Angelsystem] Your Shift has changed"), $message);
|
|
|
|
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your Shift has changed"), $message);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function mail_shift_delete($shift) {
|
|
|
|
function mail_shift_delete($shift) {
|
|
|
|
|
|
|
|
|
|
|
|
$users = ShiftEntries_by_shift($shift["SID"]);
|
|
|
|
$users = ShiftEntries_by_shift($shift["SID"]);
|
|
|
|
$room = Room($shift["RID"]);
|
|
|
|
$room = Room($shift["RID"]);
|
|
|
|
|
|
|
|
|
|
|
@ -61,11 +57,9 @@ function mail_shift_delete($shift) {
|
|
|
|
$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";
|
|
|
|
$message .= $room["Name"] . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($users as $user) {
|
|
|
|
foreach ($users as $user)
|
|
|
|
if ($user["email_shiftinfo"]) {
|
|
|
|
if ($user["email_shiftinfo"])
|
|
|
|
engelsystem_email_to_user($user, _("[Angelsystem] Your Shift was deleted"), $message);
|
|
|
|
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your Shift was deleted"), $message);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function mail_shift_assign($user, $shift) {
|
|
|
|
function mail_shift_assign($user, $shift) {
|
|
|
@ -77,7 +71,7 @@ function mail_shift_assign($user, $shift) {
|
|
|
|
$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";
|
|
|
|
$message .= $room["Name"] . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
engelsystem_email_to_user($user, _("[Angelsystem] Assigned to Shift"), $message);
|
|
|
|
engelsystem_email_to_user($user, '[engelsystem] ' . _("Assigned to Shift"), $message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -90,7 +84,7 @@ function mail_shift_removed($user, $shift) {
|
|
|
|
$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";
|
|
|
|
$message .= $room["Name"] . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
engelsystem_email_to_user($user, _("[Angelsystem] Assigned to Shift"), $message);
|
|
|
|
engelsystem_email_to_user($user, '[engelsystem] ' . _("Removed from Shift"), $message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|