/
_task.html.php
79 lines (78 loc) · 3.11 KB
/
_task.html.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<tr class="<?php echo $style ?>">
<td>
<?php
if ($have_edit) {
if (!$task->completed) {
if (!$task->childrenCompleted()) {
$label = _("Incomplete sub tasks, complete them first");
echo Horde::img('unchecked.png', $label, array('title' => $label));
} else {
$label = sprintf(_("Complete \"%s\""), $task->name);
echo Horde::link($task->complete_link, $label) . Horde::img('unchecked.png', $label) . '</a>';
}
} else {
if ($task->parent && $task->parent->completed) {
$label = _("Completed parent task, mark it as incomplete first");
echo Horde::img('checked.png', $label, array('title' => $label));
} else {
$label = sprintf(_("Mark \"%s\" as incomplete"), $task->name);
echo Horde::link($task->complete_link, $label) . Horde::img('checked.png', $label) . '</a>';
}
}
} else {
echo Nag::formatCompletion($task->completed);
}
?>
</td>
<?php if (in_array('tasklist', $columns)): ?>
<td><?php echo htmlspecialchars($owner) ?></td>
<?php endif; if (in_array('priority', $columns)): ?>
<td><?php echo Nag::formatPriority($task->priority) ?></td>
<?php endif; ?>
<td>
<?php
if ($have_edit &&
(!$task->private || $task->owner == $GLOBALS['registry']->getAuth())) {
$label = sprintf(_("Edit \"%s\""), $task->name);
echo Horde::link($task->edit_link->add(array('have_search' => $this->haveSearch, 'tab_name' => $this->tabName)), $label) . Horde::img('edit.png', $label) . '</a>';
}
?>
</td>
<td>
<?php
echo $task->treeIcons();
$task_name = strlen($task->name)
? htmlspecialchars($task->name)
: _("[none]");
if ($have_read) {
echo Horde::linkTooltip($task->view_link->add('have_search', $this->haveSearch), '', '', '', '', $task->desc)
. $task_name . '</a>';
} else {
echo $task_name;
}?>
<ul class='horde-tags'>
<?php foreach ($task->tags as $t): ?><li><?php echo $this->h($t) ?></li><?php endforeach;?>
</ul>
</td>
<td><?php echo strlen($task->desc) ? Horde::img('note.png', _("Task Note")) : ' ' ?></td>
<td><?php echo ($task->alarm && $due) ?
Horde::img('alarm_small.png', _("Task Alarm")) : ' ' ?>
</td>
<?php if (in_array('due', $columns)): ?>
<td class="nowrap" sortval="<?php echo $due ? $due->timestamp() : PHP_INT_MAX ?>">
<?php echo $due ? $due->strftime($dateFormat) : ' ' ?>
</td>
<?php endif; if (in_array('start', $columns)): ?>
<td class="nowrap" sortval="<?php echo $task->start ? (int)$task->start : PHP_INT_MAX ?>">
<?php echo $task->start ? strftime($dateFormat, $task->start) : ' ' ?>
</td>
<?php endif; if (in_array('estimate', $columns)): ?>
<td class="nowrap" sortval="<?php echo htmlspecialchars($task->estimation()) ?>">
<?php echo htmlspecialchars($task->estimation()) ?>
</td>
<?php endif; if (in_array('assignee', $columns)): ?>
<td>
<?php echo Nag::formatAssignee($task->assignee) ?>
</td>
<?php endif; ?>
</tr>