예제 #1
0
            }
        } else {
            $remind_style = '0';
            $remind_time = '0';
        }
        if ($todo_id > 0) {
            if (!$todos->update_todo($todo_id, $_POST['contact_id'], $_POST['res_user_id'], $start_time, $due_time, $status, $_POST['priority'], $completion_time, $remind_time, $remind_style, $name, smart_addslashes($_POST['description']), smart_addslashes($_POST['location']), $_POST['background'])) {
                $feedback = '<p class="Error">' . $strSaveError . '</p>';
            } else {
                if ($_POST['close'] == 'true') {
                    header('Location: ' . $return_to);
                    exit;
                }
            }
        } else {
            if (!($todo_id = $todos->add_todo($GO_SECURITY->user_id, $_POST['contact_id'], $_POST['res_user_id'], $start_time, $due_time, $status, $_POST['priority'], $completion_time, $remind_time, $remind_style, $name, smart_addslashes($_POST['description']), smart_addslashes($_POST['location']), $_POST['background']))) {
                $feedback = '<p class="Error">' . $strSaveError . '</p>';
            } else {
                if ($_POST['close'] == 'true') {
                    header('Location: ' . $return_to);
                    exit;
                }
            }
        }
    }
}
if ($todo_id > 0 && $task != 'save_todo') {
    //get the todo
    $todo = $todos->get_todo($todo_id);
    $todo['start_time'] += $_SESSION['GO_SESSION']['timezone'] * 3600;
    $todo['start_hour'] = date('G', $todo['start_time']);