예제 #1
0
     $start_min = '0';
     $end_hour = '0';
     $end_min = '0';
     $start_time = date_to_unixtime($_POST['start_date'] . ' ' . $start_hour . ':' . $start_min);
     $end_time = date_to_unixtime($_POST['end_date'] . ' ' . $end_hour . ':' . $end_min);
 } else {
     $all_day_event = '0';
     $start_min = $_POST['start_min'];
     $start_hour = $_POST['start_hour'];
     $end_hour = $_POST['end_hour'];
     $end_min = $_POST['end_min'];
     $start_time = get_gmt_time(date_to_unixtime($_POST['start_date'] . ' ' . $start_hour . ':' . $start_min));
     $end_time = get_gmt_time(date_to_unixtime($_POST['end_date'] . ' ' . $end_hour . ':' . $end_min));
 }
 if ($_POST['repeat_type'] != REPEAT_NONE) {
     $repeat_end_time = isset($_POST['repeat_forever']) ? '0' : date_to_unixtime($_POST['repeat_end_date']);
 } else {
     $repeat_end_time = 0;
 }
 $shift_day = 0;
 //shift the selected weekdays to GMT time
 if (!isset($_POST['all_day_event'])) {
     $shifted_start_hour = $start_hour - $timezone_offset;
     if ($shifted_start_hour > 23) {
         $shifted_start_hour = $shifted_start_hour - 24;
         $shift_day = 1;
     } elseif ($shifted_start_hour < 0) {
         $shifted_start_hour = 24 + $shifted_start_hour;
         $shift_day = -1;
     }
 }
예제 #2
0
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'];
            $completion_time = 0;
        }
        //substract timezone offset
        if (isset($_POST['reminder'])) {
            $remind_style = $_POST['remind_style'];
            if ($remind_style == REMIND_BEFORE_STARTTIME) {
                $remind_time = $start_time - $_POST['remind_interval'];
            } else {
                $remind_time = $due_time - $_POST['remind_interval'];
            }
        } else {
            $remind_style = '0';
            $remind_time = '0';
function change_end_date($Ticket_Number, $end_date_d_m_y, $end_date_h, $end_date_i)
{
    $end_date = date_to_unixtime("{$end_date_d_m_y} {$end_date_h}:{$end_date_i}:00");
    $last_end_date = Ticket::get_end_date($Ticket_Number);
    if ($last_end_date != $end_date) {
        $last_end_date = date("Y/m/d H:i", Ticket::get_end_date($Ticket_Number));
        $result = Ticket::change_end_date($Ticket_Number, $end_date);
        $print_end_date = date("Y/m/d H:i", $end_date);
        $comment = "end date changed from \\'{$last_end_date}\\' to \\'{$print_end_date}\\'";
        add_task($Ticket_Number, $comment);
        notify_change($Ticket_Number, $comment);
    }
}
예제 #4
0
$change_date = $post_date;
if (!isset($_POST['due_date_d_m_y'])) {
    $due_date = $change_date;
} else {
    $due_date_d_m_y = $_POST['due_date_d_m_y'];
    $due_date_h = $_POST['due_date_h'];
    $due_date_i = $_POST['due_date_i'];
    $due_date = date_to_unixtime("{$due_date_d_m_y} {$due_date_h}:{$due_date_i}:00");
}
if (!isset($_POST['end_date_d_m_y'])) {
    $end_date = $change_date;
} else {
    $end_date_d_m_y = $_POST['end_date_d_m_y'];
    $end_date_h = $_POST['end_date_h'];
    $end_date_i = $_POST['end_date_i'];
    $end_date = date_to_unixtime("{$end_date_d_m_y} {$end_date_h}:{$end_date_i}:00");
}
# NEEDS TO BE FIXED
$t_subject = '';
if (Security::is_action_allowed("imperson") and isset($_POST['t_from'])) {
    $t_from = Security::sqlsecure($_POST['t_from']);
    if ($t_from != whoami()) {
        $t_subject = "(submitted by " . whatsmyname(whoami()) . ") : ";
    }
} else {
    $t_from = $GO_SECURITY->user_id;
}
$my_ticket->issuer = $t_from;
if (!isset($_POST['t_assigned'])) {
    $t_assigned = whoami();
}
예제 #5
0
    $ab_module = false;
} else {
    require_once $ab_module['class_path'] . 'addressbook.class.inc';
    $ab = new addressbook();
}
$projects_module = $GO_MODULES->get_module('projects');
if ($projects_module) {
    require $projects_module['class_path'] . 'projects.class.inc';
}
$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
$note_id = isset($_REQUEST['note_id']) ? $_REQUEST['note_id'] : 0;
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$link_back = isset($_REQUEST['link_back']) ? $_REQUEST['link_back'] : $_SERVER['REQUEST_URI'];
switch ($task) {
    case 'save_note':
        $due_date = date_to_unixtime($_POST['due_date']);
        $name = smart_addslashes(trim($_POST['name']));
        if ($note_id > 0) {
            if ($name == '') {
                $feedback = '<p class="Error">' . $error_missing_field . '</p>';
            } else {
                $existing_note = $notes->get_note_by_name($name);
                if ($existing_note && $existing_note['id'] != $note_id) {
                    $feedback = '<p class="Error">' . $pm_note_exists . '</p>';
                } elseif (!$notes->update_note($_POST['note_id'], $name, $_POST['catagory_id'], $_POST['responsible_user_id'], $due_date, smart_addslashes($_POST['content']))) {
                    $feedback = '<p class="Error">' . $strSaveError . '</p>';
                } else {
                    if ($note = $notes->get_note($_POST['note_id'])) {
                        if ($_POST['responsible_user_id'] > 0 && (!$GO_SECURITY->user_in_acl($_POST['responsible_user_id'], $note['acl_read']) && !$GO_SECURITY->user_in_acl($_POST['responsible_user_id'], $note['acl_write']))) {
                            $GO_SECURITY->add_user_to_acl($_POST['responsible_user_id'], $note['acl_read']);
                        }
예제 #6
0
    }
    if ($to != '') {
        $query .= 'TO "' . $to . '" ';
    }
    if ($cc != '') {
        $query .= 'CC "' . $cc . '" ';
    }
    if ($body != '') {
        $query .= 'BODY "' . $body . '" ';
    }
    if ($before != '') {
        $unix_before = date_to_unixtime($before);
        $query .= 'BEFORE "' . date('d-M-Y', $unix_before) . '" ';
    }
    if ($since != '') {
        $unix_since = date_to_unixtime($since);
        $query .= 'SINCE "' . date('d-M-Y', $unix_since) . '" ';
    }
    if ($_POST['flagged'] != '') {
        $query .= $_POST['flagged'] . ' ';
    }
    if ($_POST['answered'] != '') {
        $query .= $_POST['answered'] . ' ';
    }
    if ($query == '') {
        echo '<p class="Error">' . $ml_select_one_criteria . '</p>';
    }
}
echo '<table border="0"><tr><td valign="top">';
echo '<table border="0">';
if ($account['type'] == "imap") {
예제 #7
0
             $feedback = '<p class="Error">' . $strSaveError . '</p>';
         } else {
             $feedback = '<p class="Success">' . $pm_add_hours_success . '</p>';
             if ($_GET['close'] == 'true') {
                 header('Location: ' . $return_to);
                 exit;
             }
         }
     }
     break;
 case 'change_catalog':
     break;
 case 'save_project':
     //translate the given date stamp to unix time
     $start_date = date_to_unixtime($_GET['start_date']);
     $end_date = date_to_unixtime($_GET['end_date']);
     $name = smart_addslashes(trim($_GET['name']));
     $task_template_id = $_GET['task_template_id'];
     if ($project_id > 0) {
         if ($name == '') {
             $feedback = '<p class="Error">' . $error_missing_field . '</p>';
         } else {
             $existing_project = $projects->get_project_by_name($name);
             if ($existing_project && $existing_project['id'] != $project_id) {
                 $feedback = '<p class="Error">' . $pm_project_exists . '</p>';
             } elseif (!$projects->update_project($_GET['project_id'], $name, smart_addslashes($_GET['description']), $_GET['contact_id'], smart_addslashes($_GET['comments']), $start_date, $end_date, $_GET['responsible_user_id'], $_GET['probability'], $_GET['fee_id'], $_GET['budget'])) {
                 $feedback = '<p class="Error">' . $strSaveError . '</p>';
             } else {
                 if ($_GET['close'] == 'true') {
                     header('Location: ' . $return_to);
                     exit;