示例#1
0
                    $feedback = "<p class=\"Error\">" . $strSaveError . "</p>";
                } else {
                    $db = new db();
                    $db->query('INSERT INTO cal_view_subscriptions VALUES ("' . $GO_SECURITY->user_id . '","' . $view_id . '")');
                }
            }
        }
    } else {
        $feedback = "<p class=\"Error\">" . $error_missing_field . "</p>";
    }
    if (!isset($feedback)) {
        $calendars = isset($_POST['calendars']) ? $_POST['calendars'] : array();
        $cal->get_authorised_calendars($GO_SECURITY->user_id);
        $cal2 = new calendar();
        while ($cal->next_record()) {
            if (in_array($cal->f('id'), $calendars)) {
                if (!$cal2->calendar_is_in_view($cal->f('id'), $view_id)) {
                    $cal2->add_calendar_to_view($cal->f('id'), $view_id);
                }
            } else {
                if ($cal2->calendar_is_in_view($cal->f('id'), $view_id)) {
                    $cal2->remove_calendar_from_view($cal->f('id'), $view_id);
                }
            }
        }
        if ($_POST['close'] == 'true') {
            header('Location: ' . $return_to);
            exit;
        }
    }
}
示例#2
0
     echo '<p class="Error">' . $feedback . '</p>';
 }
 if (!$GO_SECURITY->has_permission($GO_SECURITY->user_id, $event["acl_read"]) && !$GO_SECURITY->has_permission($GO_SECURITY->user_id, $event["acl_write"])) {
     $GO_SECURITY->add_user_to_acl($GO_SECURITY->user_id, $event["acl_read"]);
 }
 $calendar_count = $cal->get_user_calendars($GO_SECURITY->user_id);
 $calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
 if ($calendar_count > 1) {
     echo $sc_select_calendar . ': ';
     echo '<form name="accept" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
     echo '<input type="hidden" name="email" value="' . $_REQUEST['email'] . '" />';
     echo '<input type="hidden" name="event_id" value="' . $_REQUEST['event_id'] . '" />';
     echo '<input type="hidden" name="member" value="' . $_REQUEST['member'] . '" />';
     echo '<table border="0">';
     while ($cal->next_record()) {
         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $cal->f('acl_write'))) {
             $calendars_check = isset($_POST['calendars']) && in_array($cal->f('id'), $_POST['calendars']) ? 'checked' : '';
             echo '<tr><td><input type="checkbox" name="calendars[]" value="' . $cal->f('id') . '" ' . $calendars_check . '  /></td><td>' . $cal->f('name') . '</td></tr>';
         }
     }
     echo '</table>';
     $button = new button($cmdOk, "javascript:document.forms[0].submit();");
     echo '</form>';
 } else {
     if ($calendar_count == 1) {
         $cal->next_record();
         $calendar_id = $cal->f('id');
         if ($calendar_id > 0) {
             if (!$cal->event_is_subscribed($_REQUEST['event_id'], $calendar_id)) {
                 if ($cal->subscribe_event($_REQUEST['event_id'], $calendar_id)) {
                     if ($cal->set_event_status($_REQUEST['event_id'], '1', $_REQUEST['email'])) {
echo "{$sc_view}: ";
$dropbox->print_dropbox('view_type', $view_type, 'onchange="frm.submit()"');
?>
</td></tr>
  <?php 
if (isset($feedback)) {
    echo '<tr><td colspan="5" height="25">' . $feedback . '</td></tr>';
}
echo '<tr><td><h3>' . $strName . '</h3></td><td><h3>' . $sc_owner . '</h3></td><td><h3>' . $sc_subscribed . '</h3></td><td>&nbsp;</td><td>&nbsp;</td></tr>';
$settings = $cal->get_settings($GO_SECURITY->user_id);
$calendar_count = $cal->get_authorised_calendars($GO_SECURITY->user_id);
if ($calendar_count > 0) {
    $subscr_count = 0;
    while ($cal->next_record()) {
        $checked = '';
        $uid = $cal->f('user_id');
        if (!isset($subscribed)) {
            if ($uid == $GO_SECURITY->user_id) {
                $checked = 'checked';
            } elseif ($view_type != SHOW_ALL) {
                continue;
            }
        } else {
            $go_next = true;
            if (in_array($cal->f('id'), $subscribed)) {
                $checked = 'checked';
            }
            switch ($view_type) {
                case SHOW_OWN:
                    $go_next = $uid == $GO_SECURITY->user_id;
                    break;
示例#4
0
        $cal_start_hour = $view['start_hour'];
        $cal_end_hour = $view['end_hour'];
    }
}
if (!isset($view) || !$view) {
    //get the calendar properties and check permissions
    if ($calendar_id != 0 && ($calendar = $cal->get_calendar($calendar_id))) {
        $calendar['read_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_read']);
        $calendar['write_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_write']);
        if (!$calendar['read_permission'] && !$calendar['write_permission']) {
            //hmm no calendar_id given and default calendar is set
            //Does this user even have calendars?
            $cal->get_user_calendars($GO_SECURITY->user_id);
            if ($cal->next_record()) {
                //yes he does so set it default
                $calendar_id = $cal->f('id');
            } else {
                $calendar_name = $_SESSION['GO_SESSION']['name'];
                $new_calendar_name = $calendar_name;
                $x = 1;
                while ($cal->get_calendar_by_name($new_calendar_name)) {
                    $new_calendar_name = $calendar_name . ' (' . $x . ')';
                    $x++;
                }
                if (!($calendar_id = $cal->add_calendar($GO_SECURITY->user_id, addslashes($new_calendar_name), 7, 20))) {
                    $feedback = '<p class="Error">' . $strSaveError . '</p>';
                }
            }
            $calendar = $cal->get_calendar($calendar_id);
            if ($calendar) {
                $calendar['read_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_read']);
示例#5
0
         switch ($_POST['permissions']) {
             case 'everybody_read':
                 $GO_SECURITY->add_group_to_acl($GO_CONFIG->group_everyone, $acl_read);
                 break;
             case 'everybody_write':
                 $GO_SECURITY->add_group_to_acl($GO_CONFIG->group_everyone, $acl_write);
                 break;
         }
     }
 }
 if (!isset($feedback)) {
     //enter the event in all selected calendars
     $cal2 = new calendar();
     $cal->get_authorised_calendars($GO_SECURITY->user_id);
     while ($cal->next_record()) {
         if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $cal->f('acl_write'))) {
             if (in_array($cal->f('id'), $_POST['calendars'])) {
                 if (!$cal2->event_is_subscribed($event_id, $cal->f('id'))) {
                     $cal2->subscribe_event($event_id, $cal->f('id'));
                 }
             } else {
                 if ($cal2->event_is_subscribed($event_id, $cal->f('id'))) {
                     $cal2->unsubscribe_event($event_id, $cal->f('id'));
                 }
             }
         }
     }
     //set the reminder
     if ($_POST['reminder'] > 0) {
         $next_recurrence_time = $cal->get_next_recurrence_time($event_id);
         $remind_time = $next_recurrence_time - $_POST['reminder'];
echo '<tr><td colspan="2"><br />';
$button = new button($cmdClose, "javascript:document.location= '" . $return_to . "'");
echo '</td></tr>';
?>
	</table>
	</td>
	<td valign="top">
	<?php 
if ($cal->get_participants($event_id)) {
    echo '<input type="hidden" name="status" />';
    echo '<table border="0">';
    echo '<tr><td><h3>' . $strName . '</td>';
    echo '<td><h3>' . $strEmail . '</td>';
    echo '<td><h3>' . $sc_status . '</td></tr>';
    while ($cal->next_record()) {
        echo '<tr><td nowrap>' . show_profile_by_email($cal->f('email'), $cal->f('name')) . '&nbsp;</td>';
        echo '<td nowrap>' . mail_to($cal->f('email')) . '&nbsp;</td><td>';
        switch ($cal->f('status')) {
            case '0':
                echo $sc_not_responded;
                break;
            case '1':
                echo $sc_accepted;
                break;
            case '2':
                echo $sc_declined;
                break;
        }
        echo '</td></tr>';
    }
    echo '</table>';
示例#7
0
$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('calendar');
require $GO_LANGUAGE->get_language_file('calendar');
require_once $GO_MODULES->path . 'classes/calendar.class.inc';
require_once $GO_MODULES->path . 'classes/todos.class.inc';
$cal = new calendar();
$todos = new todos();
$page_title = $sc_reminder;
require $GO_THEME->theme_path . "header.inc";
echo '<embed src="' . $GO_THEME->sounds['reminder'] . '" hidden="true" autostart="true"><noembed><bgsound src="' . $GO_THEME->sounds['reminder'] . '"></noembed>';
if ($event_count = $cal->get_events_to_remind($GO_SECURITY->user_id)) {
    echo '<h2>' . $sc_events . '</h2>';
    echo '<table border="0" cellspacing="0" cellpadding="0" width="450">' . '<tr height="20"><td class="TableHead2">' . $strName . '</td>' . '<td class="TableHead2">' . $strDate . '</td></tr>';
    $cal2 = new calendar();
    while ($cal->next_record()) {
        $event = $cal2->get_event($cal->f('event_id'));
        $next_recurrence_time = $cal2->get_next_recurrence_time(0, 0, $event);
        echo '<tr><td><a class="normal" href="javascript:goto_event(\'' . $cal->f('event_id') . '\')">' . $event['name'] . '</a></td>';
        if ($event['all_day_event']) {
            $date_format = $_SESSION['GO_SESSION']['date_format'];
            $timezone_offset = 0;
        } else {
            $date_format = $_SESSION['GO_SESSION']['date_format'] . ' ' . $_SESSION['GO_SESSION']['time_format'];
            $timezone_offset = $_SESSION['GO_SESSION']['timezone'] * 3600;
        }
        echo '<td>' . date($date_format, $next_recurrence_time + $timezone_offset) . '</td></tr>';
        $update_reminder = $cal2->get_next_recurrence_time(0, $next_recurrence_time, $event);
        if ($update_reminder > $next_recurrence_time) {
            $cal2->update_reminder($GO_SECURITY->user_id, $event['id'], $update_reminder);
        } else {
            $cal2->delete_reminder($GO_SECURITY->user_id, $event['id']);