Exemplo n.º 1
0
        jsonExit(array('error' => 0));
        // done
    } else {
        jsonExit(array('error' => 1));
        // error
    }
} elseif (isset($_GET['countNotifications'])) {
    $notifications_count = Config::get('multiuser') == 1 ? Notification::getUnreadCount() : 0;
    jsonExit(array('count' => $notifications_count));
} elseif (isset($_GET['trackWorkTime'])) {
    check_write_access();
    stop_gpc($_POST);
    $taskid = (int) _post('ytt_taskId');
    $time = (int) _post('ytt_time');
    $date = _post('ytt_date');
    TimeTracker::trackTime($taskid, $time, $date);
    jsonExit(array('done' => 1));
} elseif (isset($_GET['addComment'])) {
    check_write_access();
    stop_gpc($_POST);
    $taskid = (int) _post('ytt_taskId');
    $comment = _post('ytt_comment');
    $current_user_id = (int) $_SESSION['userid'];
    $db->dq("INSERT INTO {$db->prefix}comments (task_id,user_id,comment) VALUES(?,?,?)", array($taskid, $current_user_id, $comment));
    jsonExit(array('done' => 1, 'user' => getUserName($current_user_id), 'date' => date(Config::get('dateformat'))));
}
###################################################################################################
function loadTasks($listId, $compl = 0, $tag = '', $s = '', $sort = 0, $setCompl = 0, $setNotification = null)
{
    $db = DBConnection::instance();
    $sqlWhere = $inner = '';