コード例 #1
0
ファイル: todo.php プロジェクト: BackupTheBerlios/hpt-obm-svn
$local_time = get_time();
$year = isset($_REQUEST['year']) ? $_REQUEST['year'] : gmdate("Y", $local_time);
$month = isset($_REQUEST['month']) ? $_REQUEST['month'] : gmdate("m", $local_time);
$day = isset($_REQUEST['day']) ? $_REQUEST['day'] : gmdate("j", $local_time);
$hour = isset($_REQUEST['hour']) ? $_REQUEST['hour'] : date("H", $local_time);
$min = isset($_REQUEST['min']) ? $_REQUEST['min'] : gmdate("i", $local_time);
$hours = array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23");
for ($i = 0; $i <= 60; $i++) {
    $text = strlen($i) < 2 ? '0' . $i : $i;
    $mins[] = $text;
}
$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('calendar');
require $GO_LANGUAGE->get_language_file('calendar');
require_once $GO_MODULES->path . 'classes/todos.class.inc';
$todos = new todos();
$task = isset($_POST['task']) ? $_POST['task'] : '';
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$todo_id = isset($_REQUEST['todo_id']) ? $_REQUEST['todo_id'] : 0;
if ($task == 'save_todo') {
    $name = smart_addslashes(trim($_POST['name']));
    if ($name == '') {
        $feedback = '<p class="Error">' . $error_missing_field . '</p>';
    } else {
        $start_time = date_to_unixtime($_POST['start_date'] . ' ' . $_POST['start_hour'] . ':' . $_POST['start_min']) - $_SESSION['GO_SESSION']['timezone'] * 3600;
        $due_time = date_to_unixtime($_POST['due_date'] . ' ' . $_POST['due_hour'] . ':' . $_POST['due_min']) - $_SESSION['GO_SESSION']['timezone'] * 3600;
        if (isset($_POST['completed'])) {
            $status = '100';
            $completion_time = date_to_unixtime($_POST['completion_date'] . ' ' . $_POST['completion_hour'] . ':' . $_POST['completion_min']) - $_SESSION['GO_SESSION']['timezone'] * 3600;
        } else {
            $status = $_POST['status'];
コード例 #2
0
  popup.focus();
}
</script>
<title><?php 
echo $GO_CONFIG->title;
?>
</title>
<?php 
echo '<meta http-equiv="refresh" content="' . $GO_CONFIG->refresh_rate . ';url=' . $_SERVER['PHP_SELF'] . '">';
//if user uses the calendar then check for events to remind
$calendar_module = $GO_MODULES->get_module('calendar');
if ($calendar_module && ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $calendar_module['acl_write']))) {
    require_once $calendar_module['class_path'] . 'calendar.class.inc';
    require_once $calendar_module['class_path'] . 'todos.class.inc';
    $cal = new calendar();
    $todos = new todos();
    $remind_events = $cal->get_events_to_remind($GO_SECURITY->user_id);
    $remind_todos = $todos->get_todos_to_remind($GO_SECURITY->user_id);
    if ($remind_events || $remind_todos) {
        echo '<script language="javascript" type="text/javascript">popup("' . $calendar_module['url'] . 'reminder.php", "500", "200", "reminder");</script>';
    }
    unset($cal);
}
$_SESSION['notified_new_mail'] = isset($_SESSION['notified_new_mail']) ? $_SESSION['notified_new_mail'] : 0;
$_SESSION['new_mail'] = 0;
//check for email
$email_module = $GO_MODULES->get_module('email');
if ($email_module && ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $email_module['acl_read']) || $GO_SECURITY->has_permission($GO_SECURITY->user_id, $email_module['acl_write']))) {
    require_once $email_module['class_path'] . 'email.class.inc';
    require_once $GO_CONFIG->class_path . 'imap.class.inc';
    $imap = new imap();
コード例 #3
0
            $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']);
        }
    }
}
if ($todo_count = $todos->get_todos_to_remind($GO_SECURITY->user_id)) {
    $todos2 = new todos();
    echo '<h2>' . $cal_todos . '</h2>';
    echo '<table border="0" cellspacing="0" cellpadding="0" width="450">' . '<tr height="20"><td class="TableHead2">' . $strName . '</td>' . '<td class="TableHead2">' . $sc_start_at . '</td>' . '<td class="TableHead2">' . $cal_due_at . '</td></tr>';
    while ($todos->next_record()) {
        $todos2->set_reminded($todos->f('id'));
        echo '<tr><td><a class="normal" href="javascript:goto_todo(\'' . $todos->f('id') . '\')">' . $todos->f('name') . '</a></td>' . '<td>' . date($_SESSION['GO_SESSION']['date_format'] . ' ' . $_SESSION['GO_SESSION']['time_format'], $todos->f('start_time')) . '</td>' . '<td>' . date($_SESSION['GO_SESSION']['date_format'] . ' ' . $_SESSION['GO_SESSION']['time_format'], $todos->f('due_time')) . '</td></tr>';
    }
}
echo '</table><br />';
$button = new button($cmdClose, "javascript:window.close()");
?>
<script type="text/javascript">
function goto_event(event_id)
{
	opener.parent.main.document.location=
		'<?php