From a11d26d207f4825ae546783375a2dedfd961e10d Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Thu, 21 Oct 2010 21:57:49 -0400 Subject: [PATCH] May as well share this - beginnings of a jquery mobile task list inside Nag. --- nag/mobile.php | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 nag/mobile.php diff --git a/nag/mobile.php b/nag/mobile.php new file mode 100644 index 000000000..e35cf25fd --- /dev/null +++ b/nag/mobile.php @@ -0,0 +1,98 @@ +actionID; + +/* Page variables. */ +$title = _("My Tasks"); + +/* Get the full, sorted task list. */ +$tasks = Nag::listTasks($prefs->getValue('sortby'), + $prefs->getValue('sortdir'), + $prefs->getValue('altsortby')); +if (is_a($tasks, 'PEAR_Error')) { + $notification->push($tasks, 'horde.error'); + $tasks = new Nag_Task(); +} + +?> + + + + <?php echo htmlspecialchars($title) ?> + + + + + + +
+ +

My Tasks

+ +
+
    +hasTasks()) { + $sortby = $prefs->getValue('sortby'); + $sortdir = $prefs->getValue('sortdir'); + $dateFormat = $prefs->getValue('date_format'); + $columns = @unserialize($prefs->getValue('tasklist_columns')); + if (empty($columns)) { + $columns = array(); + } + $dynamic_sort = true; + + $baseurl = 'list.php'; + if ($actionID == 'search_tasks') { + $baseurl = Horde_Util::addParameter( + $baseurl, + array('actionID' => 'search_tasks', + 'search_pattern' => $search_pattern, + 'search_name' => $search_name ? 'on' : 'off', + 'search_desc' => $search_desc ? 'on' : 'off', + 'search_category' => $search_category ? 'on' : 'off')); + } + + $tasks->reset(); + while ($task = $tasks->each()) { + $dynamic_sort &= !$task->hasSubTasks(); + + if (!empty($task->completed)) { + $style = 'linedRow closed'; + } elseif (!empty($task->due) && $task->due < time()) { + $style = 'linedRow overdue'; + } else { + $style = 'linedRow'; + } + + if ($task->tasklist == '**EXTERNAL**') { + // Just use a new share that this user owns for tasks from + // external calls - if the API gives them back, we'll trust it. + $share = $GLOBALS['nag_shares']->newShare('**EXTERNAL**'); + $owner = $task->tasklist_name; + } else { + try { + $share = $GLOBALS['nag_shares']->getShare($task->tasklist); + $owner = $share->get('name'); + } catch (Horde_Share_Exception $e) { + $owner = $task->tasklist; + } + } + + echo '
  • ' . htmlspecialchars($task->name) . '
  • '; + } +} +?> +
+
+ +
+ +
+ + + -- 2.11.0