summaryrefslogtreecommitdiff
path: root/app/Template/board/task_private.php
blob: 4880af00ba449e2c443c9fb04aae9a7d4ae9cd37 (plain)
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
80
81
82
83
84
85
<div class="
        task-board
        <?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('board', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?>
        color-<?= $task['color_id'] ?>"
     data-task-id="<?= $task['id'] ?>"
     data-column-id="<?= $task['column_id'] ?>"
     data-swimlane-id="<?= $task['swimlane_id'] ?>"
     data-position="<?= $task['position'] ?>"
     data-owner-id="<?= $task['owner_id'] ?>"
     data-category-id="<?= $task['category_id'] ?>"
     data-due-date="<?= $task['date_due'] ?>"
     data-task-url="<?= $this->url->href('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>">

    <div class="task-board-sort-handle" style="display: none;"><i class="fa fa-arrows-alt"></i></div>

    <?php if ($this->board->isCollapsed($task['project_id'])): ?>
        <div class="task-board-collapsed">
            <div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse"></i></div>
            <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
                <?= $this->render('board/task_menu', array('task' => $task)) ?>
            <?php else: ?>
                <strong><?= '#'.$task['id'] ?></strong>
            <?php endif ?>

            <?php if (! empty($task['assignee_username'])): ?>
                <span title="<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>">
                    <?= $this->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?>
                </span> -
            <?php endif ?>
            <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->e($task['title'])) ?>
        </div>
    <?php else: ?>
        <div class="task-board-expanded">
            <div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse fa-2x"></i></div>
            <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
                <?= $this->render('board/task_menu', array('task' => $task)) ?>
            <?php else: ?>
                <strong><?= '#'.$task['id'] ?></strong>
            <?php endif ?>

            <?php if ($task['reference']): ?>
            <span class="task-board-reference" title="<?= t('Reference') ?>">
                (<?= $task['reference'] ?>)
            </span>
            <?php endif ?>

            <?php if (! empty($task['owner_id'])): ?>
            <span class="task-board-user <?= $this->user->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>">
                <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
                    <?= $this->url->link(
                        $task['assignee_name'] ?: $task['assignee_username'],
                        'BoardPopover',
                        'changeAssignee',
                        array('task_id' => $task['id'], 'project_id' => $task['project_id']),
                        false,
                        'popover',
                        t('Change assignee')
                    ) ?>
                <?php else: ?>
                    <?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
                <?php endif ?>
            </span>
            <?php endif ?>

            <?php if ($task['is_active'] == 1): ?>
            <div class="task-board-days">
                <span title="<?= t('Task age in days')?>" class="task-days-age"><?= $this->dt->age($task['date_creation']) ?></span>
                <span title="<?= t('Days in this column')?>" class="task-days-incolumn"><?= $this->dt->age($task['date_moved']) ?></span>
            </div>
            <?php else: ?>
                <div class="task-board-closed"><i class="fa fa-ban fa-fw"></i><?= t('Closed') ?></div>
            <?php endif ?>

            <div class="task-board-title">
                <?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
            </div>

            <?= $this->render('board/task_footer', array(
                    'task' => $task,
                    'not_editable' => $not_editable,
                    'project' => $project,
            )) ?>
        </div>
    <?php endif ?>
</div>