function prepareTaskRow($r, $lists) { $lang = Lang::instance(); $dueA = prepare_duedate($r['duedate']); $formatCreatedInline = $formatCompletedInline = Config::get('dateformatshort'); if (date('Y') != date('Y', $r['d_created'])) { $formatCreatedInline = Config::get('dateformat2'); } if ($r['d_completed'] && date('Y') != date('Y', $r['d_completed'])) { $formatCompletedInline = Config::get('dateformat2'); } $dCreated = timestampToDatetime($r['d_created']); $dCompleted = $r['d_completed'] ? timestampToDatetime($r['d_completed']) : ''; return array('id' => $r['id'], 'title' => escapeTags($r['title']), 'listId' => $r['list_id'], 'listName' => $lists['list'][$r['list_id']]['name'], 'date' => htmlarray($dCreated), 'dateInt' => (int) $r['d_created'], 'dateInline' => htmlarray(formatTime($formatCreatedInline, $r['d_created'])), 'dateInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_created'), $dCreated)), 'dateEditedInt' => (int) $r['d_edited'], 'dateCompleted' => htmlarray($dCompleted), 'dateCompletedInline' => $r['d_completed'] ? htmlarray(formatTime($formatCompletedInline, $r['d_completed'])) : '', 'dateCompletedInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_completed'), $dCompleted)), 'compl' => (int) $r['compl'], 'prio' => $r['prio'], 'note' => nl2br(escapeTags($r['note'])), 'noteText' => (string) $r['note'], 'ow' => (int) $r['ow'], 'tags' => htmlarray($r['tags']), 'tags_ids' => htmlarray($r['tags_ids']), 'duedate' => $dueA['formatted'], 'dueClass' => $dueA['class'], 'dueStr' => htmlarray($r['compl'] && $dueA['timestamp'] ? formatTime($formatCompletedInline, $dueA['timestamp']) : $dueA['str']), 'dueInt' => date2int($r['duedate']), 'dueTitle' => htmlarray(sprintf($lang->get('taskdate_inline_duedate'), $dueA['formatted']))); }
function prepareTaskRow($r) { $lang = Lang::instance(); $dueA = prepare_duedate($r['duedate']); $formatCreatedInline = $formatCompletedInline = Config::get('dateformatshort'); if (date('Y') != date('Y', $r['d_created'])) { $formatCreatedInline = Config::get('dateformat2'); } if ($r['d_completed'] && date('Y') != date('Y', $r['d_completed'])) { $formatCompletedInline = Config::get('dateformat2'); } $dCreated = timestampToDatetime($r['d_created']); $dCompleted = $r['d_completed'] ? timestampToDatetime($r['d_completed']) : ''; $db = DBConnection::instance(); $current_user_id = (int) $_SESSION['userid']; $notification_id = (int) $db->sq("SELECT id FROM {$db->prefix}notification_listeners WHERE type = 'list' AND value = " . $r['id'] . " AND user_id=" . $current_user_id); $progress = ''; $progress_current = ''; $progress_total = ''; if (!empty($r['duration'])) { $progress = ceil(TimeTracker::getTaskTotal($r['id']) * 100 / ($r['duration'] * 60)); $progress_current = TimeTracker::getTaskTotal($r['id']) / 60; $progress_total = $r['duration']; } return array('id' => $r['id'], 'title' => escapeTags($r['title']), 'listId' => $r['list_id'], 'date' => htmlarray($dCreated), 'dateInt' => (int) $r['d_created'], 'dateInline' => htmlarray(formatTime($formatCreatedInline, $r['d_created'])), 'dateInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_created'), $dCreated)), 'dateEditedInt' => (int) $r['d_edited'], 'dateCompleted' => htmlarray($dCompleted), 'dateCompletedInline' => $r['d_completed'] ? htmlarray(formatTime($formatCompletedInline, $r['d_completed'])) : '', 'dateCompletedInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_completed'), $dCompleted)), 'compl' => (int) $r['compl'], 'notification' => $notification_id > 0 ? 1 : 0, 'prio' => $r['prio'], 'note' => nl2br(escapeTags($r['note'])), 'noteText' => (string) $r['note'], 'ow' => (int) $r['ow'], 'tags' => htmlarray($r['tags']), 'tags_ids' => htmlarray($r['tags_ids']), 'duedate' => $dueA['formatted'], 'dueClass' => $dueA['class'], 'dueStr' => htmlarray($r['compl'] && $dueA['timestamp'] ? formatTime($formatCompletedInline, $dueA['timestamp']) : $dueA['str']), 'dueInt' => date2int($r['duedate']), 'dueTitle' => htmlarray(sprintf($lang->get('taskdate_inline_duedate'), $dueA['formatted'])), 'duration' => empty($r['duration']) ? '' : $r['duration'], 'progress' => $progress, 'progress_current' => $progress_current, 'progress_total' => $progress_total, 'comments' => getTaskComments($r['id'])); }
function prepareTaskRow($r) { $lang = Lang::instance(); $dueA = prepare_duedate($r['duedate']); $c_date = prepare_duedate($r['c_date']); //$reminderformat = Config::get('dateformat2'); //$reminderdate = formatTime($reminderformat, $r['r_date']); //From query //'reminderdate' => $reminderdate, //'reminderemail' => $r['r_email'], //'remindernote' => $r['r_note'], $formatCreatedInline = $formatCompletedInline = Config::get('dateformatshort'); if (date('Y') != date('Y', $r['d_created'])) { $formatCreatedInline = Config::get('dateformat2'); } if ($r['d_completed'] && date('Y') != date('Y', $r['d_completed'])) { $formatCompletedInline = Config::get('dateformat2'); } $dCreated = timestampToDatetime($r['d_created']); $dCompleted = $r['d_completed'] ? timestampToDatetime($r['d_completed']) : ''; $return = array('id' => $r['id'], 'title' => escapeTags($r['title']), 'listId' => $r['list_id'], 'date' => htmlarray($dCreated), 'dateInt' => (int) $r['d_created'], 'dateInline' => htmlarray(formatTime($formatCreatedInline, $r['d_created'])), 'dateInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_created'), $dCreated)), 'dateEditedInt' => (int) $r['d_edited'], 'dateCompleted' => htmlarray($dCompleted), 'dateCompletedInline' => $r['d_completed'] ? htmlarray(formatTime($formatCompletedInline, $r['d_completed'])) : '', 'dateCompletedInlineTitle' => htmlarray(sprintf($lang->get('taskdate_inline_completed'), $dCompleted)), 'compl' => (int) $r['compl'], 'prio' => $r['prio'], 'contact' => $r['c_contact'], 'contactdate' => $c_date['formatted'], 'contacttype' => $r['c_type'], 'note' => nl2br(escapeTags($r['note'])), 'noteText' => (string) $r['note'], 'ow' => (int) $r['ow'], 'tags' => htmlarray($r['tags']), 'tags_ids' => htmlarray($r['tags_ids']), 'duedate' => $dueA['formatted'], 'dueClass' => $dueA['class'], 'dueStr' => htmlarray($r['compl'] && $dueA['timestamp'] ? formatTime($formatCompletedInline, $dueA['timestamp']) : $dueA['str']), 'dueInt' => date2int($r['duedate']), 'dueTitle' => htmlarray(sprintf($lang->get('taskdate_inline_duedate'), $dueA['formatted']))); return $return; }
function prepareTaskRow($r, $tz = null) { $dueA = prepare_duedate($r['duedate'], $tz); return array('id' => $r['id'], 'title' => htmlarray($r['title']), 'date' => htmlarray($r['d']), 'compl' => (int) $r['compl'], 'prio' => $r['prio'], 'note' => nl2br(htmlarray($r['note'])), 'noteText' => (string) $r['note'], 'ow' => (int) $r['ow'], 'tags' => htmlarray($r['tags']), 'duedate' => $dueA['formatted'], 'dueClass' => $dueA['class'], 'dueStr' => htmlarray($dueA['str']), 'dueInt' => date2int($r['duedate'])); }