Ejemplo n.º 1
0
                    // details.
                    if (MAIL_DETAILS) {
                        $sql = "SELECT r.id, r.room_name, r.area_id, a.area_name ";
                        $sql .= "FROM {$tbl_room} r, {$tbl_area} a ";
                        $sql .= "WHERE r.id={$room_id} AND r.area_id = a.id";
                        $res = sql_query($sql);
                        $row = sql_row($res, 0);
                        $room_name = $row[1];
                        $area_name = $row[3];
                    }
                    // If this is a modified entry then call
                    // getPreviousEntryData to prepare entry comparison.
                    if (isset($id)) {
                        $mail_previous = getPreviousEntryData($id, 0);
                    }
                    $result = notifyAdminOnBooking(!isset($id), $new_id);
                }
            }
        }
    }
    # end foreach $rooms
    # Delete the original entry
    if (isset($id)) {
        mrbsDelEntry(getUserName(), $id, $edit_type == "series", 1);
    }
    sql_mutex_unlock("{$tbl_entry}");
    $area = mrbsGetRoomArea($room_id);
    # Now its all done go back to the day view
    Header("Location: day.php?year={$year}&month={$month}&day={$day}&area={$area}");
    exit;
}
                    $data['room_name'] = $row['room_name'];
                    $data['area_name'] = $row['area_name'];
                }
                // If this is a modified entry then get the previous entry data
                // so that we can highlight the changes
                if (isset($id)) {
                    if ($edit_type == "series") {
                        $mail_previous = mrbsGetBookingInfo($repeat_id, TRUE);
                    } else {
                        $mail_previous = mrbsGetBookingInfo($id, FALSE);
                    }
                } else {
                    $mail_previous = array();
                }
                // Send the email
                $result = notifyAdminOnBooking($data, $mail_previous, !isset($id), $is_repeat_table);
            }
        }
    }
    // end foreach $rooms
    // Delete the original entry
    if (isset($id)) {
        mrbsDelEntry($user, $id, $edit_type == "series", 1);
    }
    sql_mutex_unlock("{$tbl_entry}");
    // Now it's all done go back to the previous view
    header("Location: {$returl}");
    exit;
}
// The room was not free.
sql_mutex_unlock("{$tbl_entry}");
            // update the more info fields
            mrbsUpdateMoreInfo($id, $series, $user, $note);
            $result = TRUE;
            // We'll assume success and end an email anyway
            break;
            // ACTION = "REMIND"
        // ACTION = "REMIND"
        case 'remind':
            // update the last reminded time
            mrbsUpdateLastReminded($id, $series);
            $result = TRUE;
            // We'll assume success and end an email anyway
            break;
        default:
            $result = FALSE;
            // should not get here
            break;
    }
    // switch ($action)
    // Now send an email if required and the operation was successful
    if ($result && $need_to_send_mail) {
        // Get the area settings for this area (we will need to know if periods are enabled
        // so that we will kniow whether to include iCalendar information in the email)
        get_area_settings($data['area_id']);
        // Send the email
        $result = notifyAdminOnBooking($data, $mail_previous, $is_new_entry, $series, $start_times, $action, $note);
    }
}
// Now it's all done go back to the previous view
header("Location: {$returl}");
exit;
Ejemplo n.º 4
0
        exit;
    }
    // ACTION = "ACCEPT"
    if ($action == "accept") {
        if (!mrbsConfirmEntry($id, $series)) {
            $returl .= "&error=accept_failed";
        } elseif ($need_to_send_mail) {
            $result = notifyAdminOnBooking(TRUE, $id, $series, $action);
        }
    }
    // ACTION = "MORE_INFO"
    if ($action == "more_info") {
        // update the last reminded time (the ball is back in the
        // originator's court, so the clock gets reset)
        mrbsUpdateLastReminded($id, $series);
        if ($need_to_send_mail) {
            $result = notifyAdminOnBooking(TRUE, $id, $series, $action);
        }
    }
    // ACTION = "REMIND"
    if ($action == "remind") {
        // update the last reminded time
        mrbsUpdateLastReminded($id, $series);
        if ($need_to_send_mail) {
            $result = notifyAdminOnBooking(TRUE, $id, $series, $action);
        }
    }
}
// Now it's all done go back to the previous view
header("Location: {$returl}");
exit;
Ejemplo n.º 5
0
                    // details.
                    if (MAIL_DETAILS) {
                        $sql = "SELECT r.id, r.room_name, r.area_id, a.area_name ";
                        $sql .= "FROM {$tbl_room} r, {$tbl_area} a ";
                        $sql .= "WHERE r.id={$room_id} AND r.area_id = a.id";
                        $res = sql_query($sql);
                        $row = sql_row($res, 0);
                        $room_name = $row[1];
                        $area_name = $row[3];
                    }
                    // If this is a modified entry then call
                    // getPreviousEntryData to prepare entry comparison.
                    if ($id > 0) {
                        $mail_previous = getPreviousEntryData($id, 0);
                    }
                    $result = notifyAdminOnBooking($id == 0, $new_id);
                }
            }
        }
    }
    # end foreach $rooms
    # Delete the original entry
    if ($id > 0) {
        mrbsDelEntry(getUserName(), $id, $edit_type == "series", 1);
    }
    sql_mutex_unlock("{$tbl_entry}");
    $area = mrbsGetRoomArea($room_id);
    # Now its all done go back to the day view
    redirect($CFG->wwwroot . '/blocks/mrbs/web/day.php?year=' . $year . '&month=' . $month . '&day=' . $day . '&area=' . $area, $forcemoveoutput, 20);
    exit;
}
Ejemplo n.º 6
0
                    // details.
                    if ($mail_settings['details']) {
                        $sql = "SELECT r.id AS room_id, r.room_name, r.area_id, a.area_name ";
                        $sql .= "FROM {$tbl_room} r, {$tbl_area} a ";
                        $sql .= "WHERE r.id={$room_id} AND r.area_id = a.id";
                        $res = sql_query($sql);
                        $row = sql_row_keyed($res, 0);
                        $room_name = $row['room_name'];
                        $area_name = $row['area_name'];
                    }
                    // If this is a modified entry then call
                    // getPreviousEntryData to prepare entry comparison.
                    if (isset($id)) {
                        $mail_previous = getPreviousEntryData($id, 0);
                    }
                    $result = notifyAdminOnBooking(!isset($id), $new_id, $edit_type == "series");
                }
            }
        }
    }
    // end foreach $rooms
    // Delete the original entry
    if (isset($id)) {
        mrbsDelEntry($user, $id, $edit_type == "series", 1);
    }
    sql_mutex_unlock("{$tbl_entry}");
    // Now it's all done go back to the previous view
    header("Location: {$returl}");
    exit;
}
// The room was not free.