} if ($authorised) { $day = strftime("%d", $info["start_time"]); $month = strftime("%m", $info["start_time"]); $year = strftime("%Y", $info["start_time"]); $area = mrbsGetRoomArea($info["room_id"]); $notify_by_email = $mail_settings['admin_on_delete'] || $mail_settings['book_admin_on_provisional']; if ($notify_by_email) { require_once "functions_mail.inc"; // Gather all fields values for use in emails. $mail_previous = getPreviousEntryData($id, $series); } sql_begin(); $result = mrbsDelEntry(getUserName(), $id, $series, 1); sql_commit(); if ($result) { // Send a mail to the Administrator if ($notify_by_email) { if (isset($action) && $action == "reject") { $result = notifyAdminOnDelete($mail_previous, $action, $note); } else { $result = notifyAdminOnDelete($mail_previous); } } Header("Location: {$returl}"); exit; } } } // If you got this far then we got an access denied. showAccessDenied($day, $month, $year, $area, "");
break; case "week": $returl = "week.php"; break; default: $returl = "day.php"; } $returl .= "?year={$year}&month={$month}&day={$day}&area={$area}"; } if (getAuthorised(1) && ($info = mrbsGetEntryInfo($id))) { $day = strftime("%d", $info["start_time"]); $month = strftime("%m", $info["start_time"]); $year = strftime("%Y", $info["start_time"]); $area = mrbsGetRoomArea($info["room_id"]); if (MAIL_ADMIN_ON_DELETE) { require_once "functions_mail.inc"; // Gather all fields values for use in emails. $mail_previous = getPreviousEntryData($id, $series); } sql_begin(); $result = mrbsDelEntry(getUserName(), $id, $series, 1); sql_commit(); if ($result) { // Send a mail to the Administrator MAIL_ADMIN_ON_DELETE ? $result = notifyAdminOnDelete($mail_previous) : ''; Header("Location: {$returl}"); exit; } } // If you got this far then we got an access denied. showAccessDenied($day, $month, $year, $area, "");
sqlsrv_begin_transaction($conn); $start_times = mrbsDelEntry('test', $id, $series, 1); sqlsrv_commit($conn); // [At the moment MRBS does not inform the user if it was not able to delete // an entry, or, for a series, some entries in a series. This could happen for // example if a booking policy is in force that prevents the deletion of entries // in the past. It would be better to inform the user that the operation has // been unsuccessful or only partially successful] if ($start_times !== FALSE && count($start_times) > 0) { // Send a mail to the Administrator if ($notify_by_email) { // Now that we've finished with mrbsDelEntry, change the id so that it's // the repeat_id if we're looking at a series. (This is a complete hack, // but brings us back into line with the rest of MRBS until the anomaly // of del_entry is fixed) if ($series) { $mail_previous['id'] = $mail_previous['repeat_id']; } if (isset($action) && $action == "reject") { $result = notifyAdminOnDelete($mail_previous, $series, $start_times, $action, $note); } else { $result = notifyAdminOnDelete($mail_previous, $series, $start_times); } } } Header("Location: {$returl}"); exit; } } // If you got this far then we got an access denied. showAccessDenied($day, $month, $year, $area, "");