summaryrefslogtreecommitdiff
path: root/app/Template/swimlane
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-18 13:38:51 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-18 13:38:51 -0500
commit49c8e5c1be15b9732023703473bb7e15864770f6 (patch)
treea4dcf83e0601fd734d44ad67e36299921959c3c2 /app/Template/swimlane
parent948b7fbaaa58c0a825938f7e8bda9a07ec39239b (diff)
Prevent people to remove swimlanes that contains tasks
Diffstat (limited to 'app/Template/swimlane')
-rw-r--r--app/Template/swimlane/index.php2
-rw-r--r--app/Template/swimlane/table.php50
2 files changed, 30 insertions, 22 deletions
diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php
index 35bbb589..59133db3 100644
--- a/app/Template/swimlane/index.php
+++ b/app/Template/swimlane/index.php
@@ -23,6 +23,6 @@
<?= $this->render('swimlane/table', array(
'swimlanes' => $inactive_swimlanes,
'project' => $project,
- 'disable_handler' => true,
+ 'disable_handle' => true,
)) ?>
<?php endif ?>
diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php
index 4f87924d..708b67f5 100644
--- a/app/Template/swimlane/table.php
+++ b/app/Template/swimlane/table.php
@@ -4,17 +4,39 @@
<thead>
<tr>
<th><?= t('Name') ?></th>
- <th class="column-8"><?= t('Actions') ?></th>
+ <th class="column-15"><?= t('Open tasks') ?></th>
+ <th class="column-15"><?= t('Closed tasks') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($swimlanes as $swimlane): ?>
<tr data-swimlane-id="<?= $swimlane['id'] ?>">
<td>
- <?php if (! isset($disable_handler)): ?>
- <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>
+ <?php if (! isset($disable_handle)): ?>
+ <i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>&nbsp;
<?php endif ?>
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
+ <ul>
+ <li>
+ <?= $this->modal->medium('edit', t('Edit'), 'SwimlaneController', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
+ </li>
+ <li>
+ <?php if ($swimlane['is_active']): ?>
+ <?= $this->url->icon('toggle-off', t('Disable'), 'SwimlaneController', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
+ <?php else: ?>
+ <?= $this->url->icon('toggle-on', t('Enable'), 'SwimlaneController', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
+ <?php endif ?>
+ </li>
+ <?php if ($swimlane['nb_open_tasks'] == 0 && $swimlane['nb_closed_tasks'] == 0): ?>
+ <li>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'SwimlaneController', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
+ </li>
+ <?php endif ?>
+ </ul>
+ </div>
+
<?= $this->text->e($swimlane['name']) ?>
<?php if (! empty($swimlane['description'])): ?>
@@ -24,24 +46,10 @@
<?php endif ?>
</td>
<td>
- <div class="dropdown">
- <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
- <ul>
- <li>
- <?= $this->modal->medium('edit', t('Edit'), 'SwimlaneController', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
- </li>
- <li>
- <?php if ($swimlane['is_active']): ?>
- <?= $this->url->icon('toggle-off', t('Disable'), 'SwimlaneController', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
- <?php else: ?>
- <?= $this->url->icon('toggle-on', t('Enable'), 'SwimlaneController', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
- <?php endif ?>
- </li>
- <li>
- <?= $this->modal->confirm('trash-o', t('Remove'), 'SwimlaneController', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
- </li>
- </ul>
- </div>
+ <?= $swimlane['nb_open_tasks'] ?>
+ </td>
+ <td>
+ <?= $swimlane['nb_closed_tasks'] ?>
</td>
</tr>
<?php endforeach ?>