~ubuntu-branches/ubuntu/vivid/php-horde-nag/vivid-proposed

« back to all changes in this revision

Viewing changes to nag-4.1.4/templates/list.html.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2014-03-11 21:27:39 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140311212739-m6rbihspu5zjpvaq
Tags: 4.1.4-1
New upstream version 4.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<script type="text/javascript">
 
2
 
 
3
var PREFS_UPDATE_TIMEOUT;
 
4
 
 
5
function table_sortCallback(tableId, column, sortDown)
 
6
{
 
7
    if (typeof PREFS_UPDATE_TIMEOUT != "undefined") {
 
8
        window.clearTimeout(PREFS_UPDATE_TIMEOUT);
 
9
    }
 
10
 
 
11
    PREFS_UPDATE_TIMEOUT = window.setTimeout('doPrefsUpdate("' + column + '", "' + sortDown + '")', 300);
 
12
}
 
13
 
 
14
function doPrefsUpdate(column, sortDown)
 
15
{
 
16
    baseurl = '<?php echo $GLOBALS['registry']->getServiceLink('prefs', 'nag') ?>';
 
17
    try {
 
18
        new Ajax.Request(baseurl, { parameters: { pref: 'sortby', value: encodeURIComponent(column.substring(1)) } });
 
19
        new Ajax.Request(baseurl, { parameters: { pref: 'sortdir', value: encodeURIComponent(sortDown) } });
 
20
    } catch (e) {}
 
21
}
 
22
 
 
23
</script>
 
24
<div id="page">
 
25
  <?php echo $this->render('list/header'); ?>
 
26
  <?php echo $this->tabs; ?>
 
27
  <?php echo $this->browser; ?>
 
28
  <?php if (!$this->tasks->hasTasks()): ?>
 
29
 
 
30
    <p class="text"><em><?php echo _("There are no tasks matching the current criteria.") ?></em></p>
 
31
 
 
32
  <?php else: ?>
 
33
 
 
34
    <table id="tasks" class="horde-table sortable nowrap">
 
35
      <?php echo $this->render('list/task_headers'); ?>
 
36
      <tbody id="tasks-body">
 
37
        <?php while ($task = $this->tasks->each()):
 
38
            $due = $task->due ? $task->getNextDue() : null;
 
39
            if (!empty($task->completed)) {
 
40
                $style = 'linedRow closed';
 
41
            } elseif ($due && $due->before(time())) {
 
42
                $style = 'linedRow overdue';
 
43
            } else {
 
44
                $style = '';
 
45
            }
 
46
            if ($task->tasklist == '**EXTERNAL**') {
 
47
                $share = $GLOBALS['nag_shares']->newShare($GLOBALS['registry']->getAuth(), '**EXTERNAL**', $task->tasklist_name);
 
48
                $owner = $task->tasklist_name;
 
49
            } else {
 
50
                try {
 
51
                    $share = $GLOBALS['nag_shares']->getShare($task->tasklist);
 
52
                    $owner = Nag::getLabel($share);
 
53
                } catch (Horde_Share_Exception $e) {
 
54
                    $owner = $task->tasklist;
 
55
                }
 
56
            }
 
57
            $locals = array(
 
58
              'style' => $style,
 
59
              'have_read' => $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ),
 
60
              'have_edit' => $share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
 
61
              'owner' => $owner,
 
62
              'task' => $task,
 
63
              'due' => $due,
 
64
              'columns' => $this->columns,
 
65
              'dynamic_sort' => $this->dynamic_sort &= !$task->hasSubTasks(),
 
66
              'dateFormat' => $GLOBALS['prefs']->getValue('date_format')); ?>
 
67
            <?php echo $this->renderPartial('list/task', array('locals' => $locals)) ?>
 
68
        <?php endwhile; ?>
 
69
      </tbody>
 
70
    </table>
 
71
    <?php if ($this->dynamic_sort) $GLOBALS['page_output']->addScriptFile('tables.js', 'horde') ?>
 
72
 
 
73
  <?php endif; ?>
 
74
 
 
75
<div id="tasks_empty" style="display:none">
 
76
 <?php echo _("No tasks match") ?>
 
77
</div>
 
78
</div>
 
 
b'\\ No newline at end of file'