Ejemplo n.º 1
0
                $returl = "day.php";
        }
        $returl .= "?year={$year}&month={$month}&day={$day}&area={$area}";
    }
}
$link_returl = urlencode($returl);
// for use in links
if (empty($series)) {
    $series = 0;
} else {
    $series = 1;
}
// Now that we know all the data we start drawing it
echo "<h3" . ($keep_private && $is_private_field['entry.name'] ? " class=\"private\"" : "") . ">\n";
echo $keep_private && $is_private_field['entry.name'] ? "[" . get_vocab("private") . "]" : htmlspecialchars($row['name']);
if (is_private_event($private) && $writeable) {
    echo ' (' . get_vocab("private") . ')';
}
echo "</h3>\n";
echo "<table id=\"entry\">\n";
// Output any error messages
if (!empty($error)) {
    echo "<tr><td>&nbsp;</td><td class=\"error\">" . get_vocab($error) . "</td></tr>\n";
}
// If bookings require approval, and the room is enabled, put the buttons
// to do with managing the bookings in the footer
if ($approval_enabled && !$room_disabled && $status & STATUS_AWAITING_APPROVAL) {
    echo "<tfoot id=\"approve_buttons\">\n";
    // PHASE 2 - REJECT
    if (isset($action) && $action == "reject") {
        // del_entry expects the id of a member of a series
Ejemplo n.º 2
0
 if (!$res) {
     trigger_error(sql_error(), E_USER_WARNING);
     fatal_error(TRUE, get_vocab("fatal_db_error"));
 } else {
     for ($i = 0; $row = sql_row_keyed($res, $i); $i++) {
         if ($debug_flag) {
             echo "<br>DEBUG: result {$i}, id " . $row['id'] . ", starts " . $row['start_time'] . ", ends " . $row['end_time'] . "\n";
         }
         if ($debug_flag) {
             echo "<br>DEBUG: Entry " . $row['id'] . " day {$day_num}\n";
         }
         $d[$day_num]["id"][] = $row['id'];
         $d[$day_num]["color"][] = $row['type'];
         $d[$day_num]["is_repeat"][] = !empty($row['repeat_id']);
         // Handle private events
         if (is_private_event($row['status'] & STATUS_PRIVATE)) {
             if (getWritable($row['create_by'], $user, $room)) {
                 $private = FALSE;
             } else {
                 $private = TRUE;
             }
         } else {
             $private = FALSE;
         }
         if ($private & $is_private_field['entry.name']) {
             $d[$day_num]["status"][] = $row['status'] | STATUS_PRIVATE;
             // Set the private bit
             $d[$day_num]["shortdescrip"][] = '[' . get_vocab('unavailable') . ']';
         } else {
             $d[$day_num]["status"][] = $row['status'] & ~STATUS_PRIVATE;
             // Clear the private bit
Ejemplo n.º 3
0
 sql_free($res);
 // We've possibly got a new room and area, so we need to update the settings
 // for this area.
 $area = get_area($row['room_id']);
 get_area_settings($area);
 $private = $row['status'] & STATUS_PRIVATE;
 if ($private_mandatory) {
     $private = $private_default;
 }
 // Need to clear some data if entry is private and user
 // does not have permission to edit/view details
 if (isset($copy) && $user != $row['create_by']) {
     // Entry being copied by different user
     // If they don't have rights to view details, clear them
     $privatewriteable = getWritable($row['create_by'], $user, $row['room_id']);
     $keep_private = is_private_event($private) && !$privatewriteable;
 } else {
     $keep_private = FALSE;
 }
 // default settings
 $rep_day = array();
 $rep_type = REP_NONE;
 $rep_num_weeks = 1;
 foreach ($row as $column => $value) {
     switch ($column) {
         // Don't bother with these columns
         case 'id':
         case 'timestamp':
         case 'reminded':
         case 'info_time':
         case 'info_user':
Ejemplo n.º 4
0
 //  d[monthday]["id"][] = ID of each entry, for linking.
 //  d[monthday]["data"][] = "start-stop" times or "name" of each entry.
 $res = sql_query($sql);
 if (!$res) {
     echo sql_error();
 } else {
     for ($i = 0; $row = sql_row_keyed($res, $i); $i++) {
         if ($debug_flag) {
             echo "<br>DEBUG: result {$i}, id " . $row['id'] . ", starts " . $row['start_time'] . ", ends " . $row['end_time'] . "\n";
         }
         if ($debug_flag) {
             echo "<br>DEBUG: Entry " . $row['id'] . " day {$day_num}\n";
         }
         $d[$day_num]["id"][] = $row['id'];
         // Handle private events
         if (is_private_event($row['private'])) {
             if (getWritable($row['create_by'], $user)) {
                 $private = FALSE;
             } else {
                 $private = TRUE;
             }
         } else {
             $private = FALSE;
         }
         if ($private) {
             $d[$day_num]["shortdescrip"][] = '[' . get_vocab('unavailable') . ']';
         } else {
             $d[$day_num]["shortdescrip"][] = htmlspecialchars($row['name']);
         }
         $d[$day_num]["is_private"][] = $private;
         $d[$day_num]["color"][] = $row['type'];