del_entry.php (mrbs-1.9.4) | : | del_entry.php (mrbs-1.10.0) | ||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
if (isset($action) && ($action == "reject")) | if (isset($action) && ($action == "reject")) | |||
{ | { | |||
$authorised = is_book_admin($info['room_id']); | $authorised = is_book_admin($info['room_id']); | |||
} | } | |||
else | else | |||
{ | { | |||
$authorised = getWritable($info['create_by'], $info['room_id']); | $authorised = getWritable($info['create_by'], $info['room_id']); | |||
} | } | |||
if ($authorised) | if ($authorised) | |||
{ | { | |||
$day = strftime("%d", $info["start_time"]); | $day = utf8_strftime("%d", $info["start_time"]); | |||
$month = strftime("%m", $info["start_time"]); | $month = utf8_strftime("%m", $info["start_time"]); | |||
$year = strftime("%Y", $info["start_time"]); | $year = utf8_strftime("%Y", $info["start_time"]); | |||
$area = mrbsGetRoomArea($info["room_id"]); | $area = mrbsGetRoomArea($info["room_id"]); | |||
// Get the settings for this area (they will be needed for policy checking) | // Get the settings for this area (they will be needed for policy checking) | |||
get_area_settings($area); | get_area_settings($area); | |||
$notify_by_email = $mail_settings['on_delete'] && need_to_send_mail(); | $notify_by_email = $mail_settings['on_delete'] && need_to_send_mail(); | |||
if ($notify_by_email) | if ($notify_by_email) | |||
{ | { | |||
// Gather all fields values for use in emails. | // Gather all fields values for use in emails. | |||
$mail_previous = get_booking_info($id, FALSE); | $mail_previous = get_booking_info($id, FALSE); | |||
// If this is an individual entry of a series then force the entry_type | // If this is an individual entry of a series then force the entry_type | |||
// to be a changed entry, so that when we create the iCalendar object we k now that | // to be a changed entry, so that when we create the iCalendar object we k now that | |||
// we only want to delete the individual entry | // we only want to delete the individual entry | |||
if (!$series && ($mail_previous['rep_type'] != REP_NONE)) | if (!$series && ($mail_previous['rep_type'] != REP_NONE)) | |||
{ | { | |||
$mail_previous['entry_type'] = ENTRY_RPT_CHANGED; | $mail_previous['entry_type'] = ENTRY_RPT_CHANGED; | |||
} | } | |||
} | } | |||
$start_times = mrbsDelEntry($id, $series, 1); | $start_times = mrbsDelEntry($id, $series, true); | |||
// [At the moment MRBS does not inform the user if it was not able to delete | // [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 | // 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 ent ries | // example if a booking policy is in force that prevents the deletion of ent ries | |||
// in the past. It would be better to inform the user that the operation h as | // in the past. It would be better to inform the user that the operation h as | |||
// been unsuccessful or only partially successful] | // been unsuccessful or only partially successful] | |||
if (($start_times !== FALSE) && (count($start_times) > 0)) | if (($start_times !== FALSE) && (count($start_times) > 0)) | |||
{ | { | |||
// Send a mail to the Administrator | // Send a mail to the Administrator | |||
if ($notify_by_email) | if ($notify_by_email) | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |