示例#1
0
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
//date('Ymd', time())
require "../../Group-Office.php";
if ($calendar_module = $GO_MODULES->get_module('calendar')) {
    require $calendar_module['path'] . "classes/calendar.class.inc";
}
$cal = new calendar();
require $GO_LANGUAGE->get_language_file('calendar');
//echo '1=='.$_REQUEST['event_id'];
$getevent = $cal->get_event($_REQUEST['event_id']);
//echo '2=='.$getevent['end_time'].'-->'.time();
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if (isset($_POST['calendars'])) {
        $cal->set_event_status($_REQUEST['event_id'], '1', $_POST['email']);
        while ($calendar_id = array_shift($_POST['calendars'])) {
            if (!$cal->event_is_subscribed($_POST['event_id'], $calendar_id)) {
                if ($cal->subscribe_event($_POST['event_id'], $calendar_id)) {
                    if (!$cal->set_event_status($_POST['event_id'], '1', $_POST['email'])) {
                        $error = true;
                    }
                } else {
                    $error = true;
                }
            }
        }
        require $GO_THEME->theme_path . 'header.inc';
        require_once $GO_CONFIG->root_path . 'lib/tkdlib.php';
        if ($getevent['end_time'] <= time()) {
            alert($sc_no_ok_in_past);
示例#2
0
Version: 1.0 Release date: 08 July 2003

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
*/
require "../../Group-Office.php";
require $GO_MODULES->path . "classes/calendar.class.inc";
$cal = new calendar();
require $GO_LANGUAGE->get_language_file('calendar');
require $GO_THEME->theme_path . 'header.inc';
echo '<table border="0" cellpadding="10" cellspacing="0"><tr><td><h1>' . $sc_decline_title . '</h1>';
if ($_REQUEST['task'] == 'submit') {
    if ($_REQUEST['event_id'] > 0 && $_REQUEST['email'] != '') {
        if ($cal->set_event_status($_REQUEST['event_id'], '2', $_REQUEST['email'])) {
            $db = new db();
            $email = $_REQUEST['email'];
            $db->query("SELECT first_name, middle_name, last_name FROM users WHERE email='" . $email . "'");
            if ($db->next_record()) {
                $name = $db->f('last_name') . ' ' . $db->f('middle_name') . ' ' . $db->f('first_name');
            }
            //		$db->query("SELECT u.email, c.name FROM cal_events c INNER JOIN users u ON c.user_id = u.id WHERE c.id = '".$_REQUEST['event_id']."'");
            $db->query("SELECT u.email, u.date_format, u.time_format, u.DST, c.* FROM cal_events c INNER JOIN users u ON c.user_id = u.id WHERE c.id = '" . $_REQUEST['event_id'] . "'");
            if ($db->next_record()) {
                $mail_to = $db->f('email');
                $title = $db->f('name');
                require 'decline_mail.php';
                require_once $GO_CONFIG->root_path . 'lib/tkdlib.php';
                echo send_mail($mail_to, $mail_body, $sc_declined_mail_title, $name, $email);
                echo $sc_decline_confirm;
示例#3
0
                 	      '</a>&nbsp|&nbsp;<a href="'.$GO_CONFIG->full_url.
                 	      'index.php?return_to='.urlencode($GO_MODULES->url.
                 		  'decline.php?event_id='.$event_id.'&member=true&email='.
                 		  $participants[$i]).'" class="blue">'.$sc_decline.'</a></p>';
                 */
                 $user_link = '<p class="cmd"><a href="' . $GO_CONFIG->full_url . 'index.php?return_to=' . urlencode($GO_MODULES->full_url . 'accept.php?event_id=' . $event_id . '&member=true&email=' . $participants[$i]) . '" class="blue">' . $sc_accept . '</a>&nbsp|&nbsp;<a href="' . $GO_CONFIG->full_url . 'index.php?return_to=' . urlencode($GO_MODULES->full_url . 'decline.php?event_id=' . $event_id . '&member=true&email=' . $participants[$i]) . '" class="blue">' . $sc_decline . '</a></p>';
                 if ($GO_SECURITY->user_id != $id) {
                     $mail->Body = $mail_body . $user_link;
                     $mail->ClearAllRecipients();
                     $mail->AddAddress($participants[$i]);
                     if ($mail->Send()) {
                         $cal->add_participant($event_id, addslashes($user_profile["email"]), $id);
                     }
                 } else {
                     $cal->add_participant($event_id, addslashes($user_profile["email"]), $id);
                     $cal->set_event_status($event_id, '1', $user_profile["email"]);
                 }
             }
         }
     }
     if ($_POST['close'] == 'true') {
         header('Location: ' . $return_to);
         exit;
     } else {
         $task = '';
         if (isset($_POST['emptyform']) && $_POST['emptyform'] == 'true') {
             $event_id = 0;
             $feedback .= '<p class="Success">' . sprintf($strSaveOk, $name) . '</p>';
         }
     }
 }
require $GO_LANGUAGE->get_language_file('calendar');
require $GO_MODULES->path . 'classes/calendar.class.inc';
$cal = new calendar();
//get the local times
$local_time = get_time();
$year = isset($_REQUEST['year']) ? $_REQUEST['year'] : date("Y", $local_time);
$month = isset($_REQUEST['month']) ? $_REQUEST['month'] : date("m", $local_time);
$day = isset($_REQUEST['day']) ? $_REQUEST['day'] : date("j", $local_time);
$hour = isset($_REQUEST['hour']) ? $_REQUEST['hour'] : date("H", $local_time);
$min = isset($_REQUEST['min']) ? $_REQUEST['min'] : date("i", $local_time);
$task = isset($_POST['task']) ? $_POST['task'] : '';
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
$event_id = isset($_REQUEST['event_id']) ? $_REQUEST['event_id'] : 0;
if (isset($_REQUEST['status'])) {
    $cal->set_event_status($event_id, $_REQUEST['status'], $_SESSION['GO_SESSION']['email']);
}
$event = $cal->get_event($event_id);
/*if ($calendar = $cal->get_calendar($calendar_id))
{
	$calendar['write_permission'] = $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar['acl_write']);
}else
{
	exit($strDataError);
}*/
require $GO_THEME->theme_path . 'header.inc';
echo '<form name="event" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="calendar_id" value="' . $calendar_id . '" />';
echo '<input type="hidden" name="event_id" value="' . $event_id . '" />';
echo '<input type="hidden" name="task" value="" />';
echo '<input type="hidden" name="return_to" value="' . $return_to . '" />';