Add dropdown menu on each board column title to close all tasks

This commit is contained in:
Frederic Guillot
2016-01-17 11:03:33 -05:00
parent 3c57626918
commit d45fa6a33b
44 changed files with 310 additions and 72 deletions

View File

@@ -98,4 +98,39 @@ class BoardPopover extends Base
'redirect' => 'board',
)));
}
/**
* Confirmation before to close all column tasks
*
* @access public
*/
public function confirmCloseColumnTasks()
{
$project = $this->getProject();
$column_id = $this->request->getIntegerParam('column_id');
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
$this->response->html($this->template->render('board/popover_close_all_tasks_column', array(
'project' => $project,
'nb_tasks' => $this->taskFinder->countByColumnAndSwimlaneId($project['id'], $column_id, $swimlane_id),
'column' => $this->board->getColumnTitleById($column_id),
'swimlane' => $this->swimlane->getNameById($swimlane_id) ?: t($project['default_swimlane']),
'values' => array('column_id' => $column_id, 'swimlane_id' => $swimlane_id),
)));
}
/**
* Close all column tasks
*
* @access public
*/
public function closeColumnTasks()
{
$project = $this->getProject();
$values = $this->request->getValues();
$this->taskStatus->closeTasksBySwimlaneAndColumn($values['swimlane_id'], $values['column_id']);
$this->flash->success(t('All tasks of the column "%s" and the swimlane "%s" have been closed successfully.', $this->board->getColumnTitleById($values['column_id']), $this->swimlane->getNameById($values['swimlane_id']) ?: t($project['default_swimlane'])));
$this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])));
}
}

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
'Creation' => 'Erstellung',
'Expiration' => 'Ablauf',
'Password reset history' => 'Verlauf Passwortrücksetzung',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1101,4 +1101,8 @@ return array(
'Creation' => 'Création',
'Expiration' => 'Expiration',
'Password reset history' => 'Historique de la réinitialisation du mot de passe',
'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => 'Toutes les tâches de la colonne « %s » et de la swimlane « %s » ont été fermées avec succès.',
'Do you really want to close all tasks of this column?' => 'Voulez-vous vraiment fermer toutes les tâches de cette colonne ?',
'%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '%d tâche(s) dans la colonne « %s » et la swimlane « %s » seront fermées.',
'Close all tasks of this column' => 'Fermer toutes les tâches de cette colonne',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1,4 +1,5 @@
<?php
return array(
'number.decimals_separator' => '.',
'number.thousands_separator' => ',',
@@ -682,7 +683,7 @@ return array(
'This chart show the task complexity over the time (Work Remaining).' => 'Grafik ini menunjukkan kompleksitas tugas dari waktu ke waktu (Sisa Pekerjaan).',
'Screenshot taken %s' => 'Screenshot diambil %s',
'Add a screenshot' => 'Tambah screenshot',
'Take a screenshot and press CTRL+V or ?+V to paste here.' => 'Mengambil screenshot dan tekan CTRL + V atau ? + V untuk paste di sini.',
// 'Take a screenshot and press CTRL+V or +V to paste here.' => '',
'Screenshot uploaded successfully.' => 'Screenshot berhasil diunggah.',
'SEK - Swedish Krona' => 'SEK - Krona Swedia',
'The project identifier is an optional alphanumeric code used to identify your project.' => 'Identifier projek adalah kode alfanumerik opsional digunakan untuk mengidentifikasi projek Anda.',
@@ -1093,8 +1094,12 @@ return array(
// 'Change Password' => '',
// 'To reset your password click on this link:' => '',
// 'Last Password Reset' => '',
//'The password has never been reinitialized.' => 'Kata laluan tidak pernah ',
// 'The password has never been reinitialized.' => '',
'Creation' => 'Ciptaan',
'Expiration' => 'Jangka hayat',
'Password reset history' => 'Sirah tetap semula kata laluan',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
'Creation' => 'Criação',
'Expiration' => 'Expiração',
'Password reset history' => 'Histórico da redefinição da password',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -1098,4 +1098,8 @@ return array(
// 'Creation' => '',
// 'Expiration' => '',
// 'Password reset history' => '',
// 'All tasks of the column "%s" and the swimlane "%s" have been closed successfully.' => '',
// 'Do you really want to close all tasks of this column?' => '',
// '%d task(s) in the column "%s" and the swimlane "%s" will be closed.' => '',
// 'Close all tasks of this column' => '',
);

View File

@@ -61,6 +61,32 @@ class TaskStatus extends Base
return $this->changeStatus($task_id, Task::STATUS_OPEN, 0, Task::EVENT_OPEN);
}
/**
* Close multiple tasks
*
* @access public
* @param array $task_ids
*/
public function closeMultipleTasks(array $task_ids)
{
foreach ($task_ids as $task_id) {
$this->close($task_id);
}
}
/**
* Close all tasks within a column/swimlane
*
* @access public
* @param integer $swimlane_id
* @param integer $column_id
*/
public function closeTasksBySwimlaneAndColumn($swimlane_id, $column_id)
{
$task_ids = $this->db->table(Task::TABLE)->eq('swimlane_id', $swimlane_id)->eq('column_id', $column_id)->findAllByColumn('id');
$this->closeMultipleTasks($task_ids);
}
/**
* Common method to change the status of task
*

View File

@@ -1,21 +1,21 @@
<section id="main">
<section>
<h3><?= t('Change assignee for the task "%s"', $values['title']) ?></h3>
<form method="post" action="<?= $this->url->href('BoardPopover', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>">
<div class="page-header">
<h2><?= t('Change assignee for the task "%s"', $values['title']) ?></h2>
</div>
<form method="post" action="<?= $this->url->href('BoardPopover', 'updateAssignee', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>">
<?= $this->form->csrf() ?>
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?><br/>
<?= $this->form->label(t('Assignee'), 'owner_id') ?>
<?= $this->form->select('owner_id', $users_list, $values, array(), array('autofocus')) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div>
</form>
</section>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div>
</form>
</section>

View File

@@ -1,21 +1,21 @@
<section id="main">
<section>
<h3><?= t('Change category for the task "%s"', $values['title']) ?></h3>
<form method="post" action="<?= $this->url->href('BoardPopover', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>">
<div class="page-header">
<h2><?= t('Change category for the task "%s"', $values['title']) ?></h2>
</div>
<form method="post" action="<?= $this->url->href('BoardPopover', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $project['id'])) ?>">
<?= $this->form->csrf() ?>
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->form->hidden('id', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/>
<?= $this->form->label(t('Category'), 'category_id') ?>
<?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div>
</form>
</section>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div>
</form>
</section>

View File

@@ -0,0 +1,18 @@
<section id="main">
<div class="page-header">
<h2><?= t('Do you really want to close all tasks of this column?') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('BoardPopover', 'closeColumnTasks', array('project_id' => $project['id'])) ?>">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('column_id', $values) ?>
<?= $this->form->hidden('swimlane_id', $values) ?>
<p class="alert"><?= t('%d task(s) in the column "%s" and the swimlane "%s" will be closed.', $nb_tasks, $column, $swimlane) ?></p>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-red">
<?= t('or') ?>
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
</div>
</form>
</section>

View File

@@ -24,8 +24,22 @@
</span>
<?php endif ?>
<span class="board-column-title" data-column-id="<?= $column['id'] ?>" title="<?= t('Hide this column') ?>">
<?= $this->e($column['title']) ?>
<span class="board-column-title">
<span class="dropdown">
<a href="#" class="dropdown-menu"><?= $this->e($column['title']) ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li>
<i class="fa fa-minus-square fa-fw"></i>
<a href="#" class="board-toggle-column-view" data-column-id="<?= $column['id'] ?>"><?= t('Hide this column') ?></a>
</li>
<?php if ($this->user->hasProjectAccess('BoardPopover', 'closeColumnTasks', $column['project_id']) && $column['nb_tasks'] > 0): ?>
<li>
<i class="fa fa-close fa-fw"></i>
<?= $this->url->link(t('Close all tasks of this column'), 'BoardPopover', 'confirmCloseColumnTasks', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
</li>
<?php endif ?>
</ul>
</span>
</span>
<?php if (! $not_editable && ! empty($column['description'])): ?>

View File

@@ -21,8 +21,8 @@
<!-- column in collapsed mode (rotated text) -->
<div class="board-column-collapsed">
<div class="board-rotation-wrapper">
<div class="board-column-title board-rotation" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>">
<i class="fa fa-chevron-circle-up tooltip" title="<?= $this->e($column['title']) ?>"></i> <?= $this->e($column['title']) ?>
<div class="board-column-title board-rotation board-toggle-column-view" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>">
<i class="fa fa-plus-square tooltip" title="<?= $this->e($column['title']) ?>"></i> <?= $this->e($column['title']) ?>
</div>
</div>
</div>