From de128dbad860478496a0d655b5eb5c1005ebbabe Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Feb 2017 09:42:01 -0500 Subject: Remove default swimlane --- app/Api/Procedure/SwimlaneProcedure.php | 11 +- app/Api/Procedure/TaskProcedure.php | 4 +- app/Controller/BoardPopoverController.php | 4 +- app/Controller/SwimlaneController.php | 90 +-------- app/Controller/TaskCreationController.php | 10 +- app/Export/TaskExport.php | 7 +- app/Filter/TaskSwimlaneFilter.php | 3 - app/Formatter/BoardFormatter.php | 3 +- app/Helper/TaskHelper.php | 2 +- app/Locale/bs_BA/translations.php | 3 - app/Locale/cs_CZ/translations.php | 3 - app/Locale/da_DK/translations.php | 3 - app/Locale/de_DE/translations.php | 3 - app/Locale/el_GR/translations.php | 3 - app/Locale/es_ES/translations.php | 3 - app/Locale/fi_FI/translations.php | 3 - app/Locale/fr_FR/translations.php | 3 - app/Locale/hu_HU/translations.php | 3 - app/Locale/id_ID/translations.php | 3 - app/Locale/it_IT/translations.php | 3 - app/Locale/ja_JP/translations.php | 3 - app/Locale/ko_KR/translations.php | 3 - app/Locale/my_MY/translations.php | 3 - app/Locale/nb_NO/translations.php | 3 - app/Locale/nl_NL/translations.php | 3 - app/Locale/pl_PL/translations.php | 3 - app/Locale/pt_BR/translations.php | 3 - app/Locale/pt_PT/translations.php | 3 - app/Locale/ru_RU/translations.php | 3 - app/Locale/sr_Latn_RS/translations.php | 3 - app/Locale/sv_SE/translations.php | 3 - app/Locale/th_TH/translations.php | 3 - app/Locale/tr_TR/translations.php | 3 - app/Locale/zh_CN/translations.php | 3 - app/Model/ProjectDuplicationModel.php | 10 +- app/Model/ProjectModel.php | 21 +- app/Model/SwimlaneModel.php | 308 +++++++++++------------------- app/Model/TaskCreationModel.php | 4 +- app/Model/TaskDuplicationModel.php | 12 +- app/Model/TaskFinderModel.php | 5 +- app/Model/TaskPositionModel.php | 4 + app/Model/TaskStatusModel.php | 2 +- app/Schema/Migration.php | 63 ++++++ app/Schema/Mysql.php | 14 +- app/Schema/Postgres.php | 15 +- app/Schema/Sqlite.php | 9 +- app/Template/project_creation/create.php | 1 - app/Template/project_view/duplicate.php | 1 - app/Template/search/results.php | 2 +- app/Template/swimlane/edit_default.php | 14 -- app/Template/swimlane/index.php | 17 +- app/Template/swimlane/table.php | 27 --- app/Template/task_duplication/copy.php | 2 +- app/Template/task_duplication/move.php | 2 +- app/Template/task_list/show.php | 2 +- app/Validator/SwimlaneValidator.php | 22 --- app/Validator/TaskValidator.php | 1 + 57 files changed, 277 insertions(+), 490 deletions(-) create mode 100644 app/Schema/Migration.php delete mode 100644 app/Template/swimlane/edit_default.php (limited to 'app') diff --git a/app/Api/Procedure/SwimlaneProcedure.php b/app/Api/Procedure/SwimlaneProcedure.php index 9b7d181d..25b1efb0 100644 --- a/app/Api/Procedure/SwimlaneProcedure.php +++ b/app/Api/Procedure/SwimlaneProcedure.php @@ -3,6 +3,7 @@ namespace Kanboard\Api\Procedure; use Kanboard\Api\Authorization\ProjectAuthorization; +use Kanboard\Model\SwimlaneModel; /** * Swimlane API controller @@ -15,7 +16,7 @@ class SwimlaneProcedure extends BaseProcedure public function getActiveSwimlanes($project_id) { ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'getActiveSwimlanes', $project_id); - return $this->swimlaneModel->getSwimlanes($project_id); + return $this->swimlaneModel->getAllByStatus($project_id, SwimlaneModel::ACTIVE); } public function getAllSwimlanes($project_id) @@ -42,16 +43,10 @@ class SwimlaneProcedure extends BaseProcedure return $this->swimlaneModel->getById($swimlane_id); } - public function getDefaultSwimlane($project_id) - { - ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'getDefaultSwimlane', $project_id); - return $this->swimlaneModel->getDefault($project_id); - } - public function addSwimlane($project_id, $name, $description = '') { ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'addSwimlane', $project_id); - return $this->swimlaneModel->create(array('project_id' => $project_id, 'name' => $name, 'description' => $description)); + return $this->swimlaneModel->create($project_id, $name, $description); } public function updateSwimlane($swimlane_id, $name, $description = null) diff --git a/app/Api/Procedure/TaskProcedure.php b/app/Api/Procedure/TaskProcedure.php index c43e5876..847d336f 100644 --- a/app/Api/Procedure/TaskProcedure.php +++ b/app/Api/Procedure/TaskProcedure.php @@ -68,7 +68,7 @@ class TaskProcedure extends BaseProcedure return $this->taskModel->remove($task_id); } - public function moveTaskPosition($project_id, $task_id, $column_id, $position, $swimlane_id = 0) + public function moveTaskPosition($project_id, $task_id, $column_id, $position, $swimlane_id) { ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'moveTaskPosition', $project_id); return $this->taskPositionModel->movePosition($project_id, $task_id, $column_id, $position, $swimlane_id); @@ -87,7 +87,7 @@ class TaskProcedure extends BaseProcedure } public function createTask($title, $project_id, $color_id = '', $column_id = 0, $owner_id = 0, $creator_id = 0, - $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = 0, $priority = 0, + $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = null, $priority = 0, $recurrence_status = 0, $recurrence_trigger = 0, $recurrence_factor = 0, $recurrence_timeframe = 0, $recurrence_basedate = 0, $reference = '', array $tags = array(), $date_started = '') { diff --git a/app/Controller/BoardPopoverController.php b/app/Controller/BoardPopoverController.php index a0f5ae12..bbbe815a 100644 --- a/app/Controller/BoardPopoverController.php +++ b/app/Controller/BoardPopoverController.php @@ -25,7 +25,7 @@ class BoardPopoverController extends BaseController 'project' => $project, 'nb_tasks' => $this->taskFinderModel->countByColumnAndSwimlaneId($project['id'], $column_id, $swimlane_id), 'column' => $this->columnModel->getColumnTitleById($column_id), - 'swimlane' => $this->swimlaneModel->getNameById($swimlane_id) ?: t($project['default_swimlane']), + 'swimlane' => $this->swimlaneModel->getNameById($swimlane_id), 'values' => array('column_id' => $column_id, 'swimlane_id' => $swimlane_id), ))); } @@ -41,7 +41,7 @@ class BoardPopoverController extends BaseController $values = $this->request->getValues(); $this->taskStatusModel->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->columnModel->getColumnTitleById($values['column_id']), $this->swimlaneModel->getNameById($values['swimlane_id']) ?: t($project['default_swimlane']))); + $this->flash->success(t('All tasks of the column "%s" and the swimlane "%s" have been closed successfully.', $this->columnModel->getColumnTitleById($values['column_id']), $this->swimlaneModel->getNameById($values['swimlane_id']))); $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id']))); } } diff --git a/app/Controller/SwimlaneController.php b/app/Controller/SwimlaneController.php index c7c20ce8..93d19188 100644 --- a/app/Controller/SwimlaneController.php +++ b/app/Controller/SwimlaneController.php @@ -42,7 +42,6 @@ class SwimlaneController extends BaseController $project = $this->getProject(); $this->response->html($this->helper->layout->project('swimlane/index', array( - 'default_swimlane' => $this->swimlaneModel->getDefault($project['id']), 'active_swimlanes' => $this->swimlaneModel->getAllByStatus($project['id'], SwimlaneModel::ACTIVE), 'inactive_swimlanes' => $this->swimlaneModel->getAllByStatus($project['id'], SwimlaneModel::INACTIVE), 'project' => $project, @@ -81,59 +80,16 @@ class SwimlaneController extends BaseController list($valid, $errors) = $this->swimlaneValidator->validateCreation($values); if ($valid) { - if ($this->swimlaneModel->create($values) !== false) { + if ($this->swimlaneModel->create($project['id'], $values['name'], $values['description']) !== false) { $this->flash->success(t('Your swimlane have been created successfully.')); - return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); + $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])), true); + return; } else { $errors = array('name' => array(t('Another swimlane with the same name exists in the project'))); } } - return $this->create($values, $errors); - } - - /** - * Edit default swimlane (display the form) - * - * @access public - * @param array $values - * @param array $errors - * @throws \Kanboard\Core\Controller\PageNotFoundException - */ - public function editDefault(array $values = array(), array $errors = array()) - { - $project = $this->getProject(); - $swimlane = $this->swimlaneModel->getDefault($project['id']); - - $this->response->html($this->helper->layout->project('swimlane/edit_default', array( - 'values' => empty($values) ? $swimlane : $values, - 'errors' => $errors, - 'project' => $project, - ))); - } - - /** - * Change the default swimlane - * - * @access public - */ - public function updateDefault() - { - $project = $this->getProject(); - - $values = $this->request->getValues() + array('show_default_swimlane' => 0); - list($valid, $errors) = $this->swimlaneValidator->validateDefaultModification($values); - - if ($valid) { - if ($this->swimlaneModel->updateDefault($values)) { - $this->flash->success(t('The default swimlane have been updated successfully.')); - return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])), true); - } else { - $this->flash->failure(t('Unable to update this swimlane.')); - } - } - - return $this->editDefault($values, $errors); + $this->create($values, $errors); } /** @@ -236,25 +192,6 @@ class SwimlaneController extends BaseController $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); } - /** - * Disable default swimlane - * - * @access public - */ - public function disableDefault() - { - $this->checkCSRFParam(); - $project = $this->getProject(); - - if ($this->swimlaneModel->disableDefault($project['id'])) { - $this->flash->success(t('Swimlane updated successfully.')); - } else { - $this->flash->failure(t('Unable to update this swimlane.')); - } - - $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); - } - /** * Enable a swimlane * @@ -275,25 +212,6 @@ class SwimlaneController extends BaseController $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); } - /** - * Enable default swimlane - * - * @access public - */ - public function enableDefault() - { - $this->checkCSRFParam(); - $project = $this->getProject(); - - if ($this->swimlaneModel->enableDefault($project['id'])) { - $this->flash->success(t('Swimlane updated successfully.')); - } else { - $this->flash->failure(t('Unable to update this swimlane.')); - } - - $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); - } - /** * Move swimlane position * diff --git a/app/Controller/TaskCreationController.php b/app/Controller/TaskCreationController.php index faf2d250..0d808c54 100644 --- a/app/Controller/TaskCreationController.php +++ b/app/Controller/TaskCreationController.php @@ -60,8 +60,14 @@ class TaskCreationController extends BaseController $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true); } else { $task_id = $this->taskCreationModel->create($values); - $this->flash->success(t('Task created successfully.')); - $this->afterSave($project, $values, $task_id); + + if ($task_id > 0) { + $this->flash->success(t('Task created successfully.')); + $this->afterSave($project, $values, $task_id); + } else { + $this->flash->failure(t('Unable to create this task.')); + $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true); + } } } diff --git a/app/Export/TaskExport.php b/app/Export/TaskExport.php index 9ca5f798..f47cd082 100644 --- a/app/Export/TaskExport.php +++ b/app/Export/TaskExport.php @@ -31,11 +31,10 @@ class TaskExport extends Base { $tasks = $this->getTasks($project_id, $from, $to); $colors = $this->colorModel->getList(); - $defaultSwimlane = $this->swimlaneModel->getDefault($project_id); $results = array($this->getColumns()); foreach ($tasks as &$task) { - $task = $this->format($task, $defaultSwimlane['default_swimlane'], $colors); + $task = $this->format($task, $colors); $results[] = array_values($task); } @@ -104,16 +103,14 @@ class TaskExport extends Base * * @access protected * @param array $task - * @param string $defaultSwimlaneName * @param array $colors * @return array */ - protected function format(array &$task, $defaultSwimlaneName, array $colors) + protected function format(array &$task, array $colors) { $task['is_active'] = $task['is_active'] == TaskModel::STATUS_OPEN ? e('Open') : e('Closed'); $task['color_id'] = $colors[$task['color_id']]; $task['score'] = $task['score'] ?: 0; - $task['swimlane_name'] = $task['swimlane_name'] ?: $defaultSwimlaneName; $task = $this->dateParser->format( $task, diff --git a/app/Filter/TaskSwimlaneFilter.php b/app/Filter/TaskSwimlaneFilter.php index 07243969..1afc6d48 100644 --- a/app/Filter/TaskSwimlaneFilter.php +++ b/app/Filter/TaskSwimlaneFilter.php @@ -36,12 +36,9 @@ class TaskSwimlaneFilter extends BaseFilter implements FilterInterface { if (is_int($this->value) || ctype_digit($this->value)) { $this->query->eq(TaskModel::TABLE.'.swimlane_id', $this->value); - } elseif ($this->value === 'default') { - $this->query->eq(TaskModel::TABLE.'.swimlane_id', 0); } else { $this->query->beginOr(); $this->query->ilike(SwimlaneModel::TABLE.'.name', $this->value); - $this->query->ilike(ProjectModel::TABLE.'.default_swimlane', $this->value); $this->query->closeOr(); } diff --git a/app/Formatter/BoardFormatter.php b/app/Formatter/BoardFormatter.php index 3f47bfa9..59a8fb18 100644 --- a/app/Formatter/BoardFormatter.php +++ b/app/Formatter/BoardFormatter.php @@ -3,6 +3,7 @@ namespace Kanboard\Formatter; use Kanboard\Core\Filter\FormatterInterface; +use Kanboard\Model\SwimlaneModel; use Kanboard\Model\TaskModel; /** @@ -42,7 +43,7 @@ class BoardFormatter extends BaseFormatter implements FormatterInterface */ public function format() { - $swimlanes = $this->swimlaneModel->getSwimlanes($this->projectId); + $swimlanes = $this->swimlaneModel->getAllByStatus($this->projectId, SwimlaneModel::ACTIVE); $columns = $this->columnModel->getAll($this->projectId); if (empty($swimlanes) || empty($columns)) { diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index 71596b60..9484a479 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -123,7 +123,7 @@ class TaskHelper extends Base $attributes = array_merge(array('tabindex="5"'), $attributes); $html = ''; - if (! (count($swimlanes) === 1 && key($swimlanes) == 0)) { + if (count($swimlanes) > 1) { $html .= $this->helper->form->label(t('Swimlane'), 'swimlane_id'); $html .= $this->helper->form->select('swimlane_id', $swimlanes, $values, $errors, $attributes); } diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php index fe60bb2f..931588c4 100644 --- a/app/Locale/bs_BA/translations.php +++ b/app/Locale/bs_BA/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Ovaj izvoz sadržava broj zadataka po koloni grupisanih po danima.', 'Active swimlanes' => 'Aktivne swimline trake', 'Add a new swimlane' => 'Dodaj novu swimline traku', - 'Change default swimlane' => 'Preimenuj podrazumijevanu swimline traku', 'Default swimlane' => 'Podrazumijevana swimline traka', 'Do you really want to remove this swimlane: "%s"?' => 'Da li zaista želiš ukloniti ovu swimline traku: "%s"?', 'Inactive swimlanes' => 'Neaktivne swimline trake', 'Remove a swimlane' => 'Ukloni swimline traku', - 'Show default swimlane' => 'Prikaži podrazumijevanu swimline traku', 'Swimlane modification for the project "%s"' => 'Izmjene swimline trake za projekat "%s"', 'Swimlane removed successfully.' => 'Swimline traka uspješno uklonjena.', 'Swimlanes' => 'Swimline trake', 'Swimlane updated successfully.' => 'Swimline traka uspjeno ažurirana.', - 'The default swimlane have been updated successfully.' => 'Podrazumijevana swimline traka uspješno ažurirana.', 'Unable to remove this swimlane.' => 'Nemoguće ukloniti swimline traku.', 'Unable to update this swimlane.' => 'Nemoguće ažurirati swimline traku.', 'Your swimlane have been created successfully.' => 'Swimline traka je uspješno kreirana.', diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index a42b103d..239fae33 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Tento export obsahuje počet úkolů pro jednotlivé sloupce seskupených podle dní.', 'Active swimlanes' => 'Aktivní dráhy', 'Add a new swimlane' => 'Přidat novou dráhu', - 'Change default swimlane' => 'Změnit výchozí dráhu', 'Default swimlane' => 'Výchozí dráha', 'Do you really want to remove this swimlane: "%s"?' => 'Opravdu si přejete odstranit tuto dráhu: "%s"?', 'Inactive swimlanes' => 'Neaktivní dráha', 'Remove a swimlane' => 'Odstranit dráhu', - 'Show default swimlane' => 'Zobrazit výchozí dráhu', 'Swimlane modification for the project "%s"' => 'Změny dráhy pro projekt "%s"', 'Swimlane removed successfully.' => 'Dráha byla odstraněna.', 'Swimlanes' => 'Dráhy', 'Swimlane updated successfully.' => 'Dráha byla upravena.', - 'The default swimlane have been updated successfully.' => 'Výchozí dráha byla upravena', 'Unable to remove this swimlane.' => 'Tuto dráhu nelze odstranit.', 'Unable to update this swimlane.' => 'Tuto dráhu nelze upravit.', 'Your swimlane have been created successfully.' => 'Dráha byla vytvořena.', diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 65095cbe..8c4643a7 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -441,17 +441,14 @@ return array( // 'This export contains the number of tasks per column grouped per day.' => '', // 'Active swimlanes' => '', // 'Add a new swimlane' => '', - // 'Change default swimlane' => '', // 'Default swimlane' => '', // 'Do you really want to remove this swimlane: "%s"?' => '', // 'Inactive swimlanes' => '', // 'Remove a swimlane' => '', - // 'Show default swimlane' => '', // 'Swimlane modification for the project "%s"' => '', // 'Swimlane removed successfully.' => '', // 'Swimlanes' => '', // 'Swimlane updated successfully.' => '', - // 'The default swimlane have been updated successfully.' => '', // 'Unable to remove this swimlane.' => '', // 'Unable to update this swimlane.' => '', // 'Your swimlane have been created successfully.' => '', diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 14bf71e6..13e24442 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Dieser Export enthält die Anzahl der Aufgaben pro Spalte nach Tagen gruppiert.', 'Active swimlanes' => 'Aktive Swimlane', 'Add a new swimlane' => 'Eine neue Swimlane hinzufügen', - 'Change default swimlane' => 'Standard-Swimlane ändern', 'Default swimlane' => 'Standard-Swimlane', 'Do you really want to remove this swimlane: "%s"?' => 'Diese Swimlane wirklich ändern: "%s"?', 'Inactive swimlanes' => 'Inaktive Swimlane', 'Remove a swimlane' => 'Swimlane entfernen', - 'Show default swimlane' => 'Standard-Swimlane anzeigen', 'Swimlane modification for the project "%s"' => 'Swimlane-Änderung für das Projekt "%s"', 'Swimlane removed successfully.' => 'Swimlane erfolgreich entfernt.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane erfolgreich geändert.', - 'The default swimlane have been updated successfully.' => 'Die Standard-Swimlane wurden erfolgreich aktualisiert. Die Standard-Swimlane wurden erfolgreich aktualisiert.', 'Unable to remove this swimlane.' => 'Es ist nicht möglich, die Swimlane zu entfernen.', 'Unable to update this swimlane.' => 'Es ist nicht möglich, die Swimlane zu ändern.', 'Your swimlane have been created successfully.' => 'Die Swimlane wurde erfolgreich angelegt.', diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php index 8aab2e54..ad038068 100644 --- a/app/Locale/el_GR/translations.php +++ b/app/Locale/el_GR/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Αυτή η κατάσταση περιέχει τον αριθμό των εργασιών ανά στήλη ομαδοποιημένα ανά ημέρα.', 'Active swimlanes' => 'Ενεργές λωρίδες', 'Add a new swimlane' => 'Προσθήκη λωρίδας', - 'Change default swimlane' => 'Αλλαγή της εξ\' ορισμού λωρίδας', 'Default swimlane' => 'Εξ\' ορισμού λωρίδα', 'Do you really want to remove this swimlane: "%s"?' => 'Σίγουρα θέλετε να αφαιρέσετε τη λωρίδα : « %s » ?', 'Inactive swimlanes' => 'Ανενεργές Λωρίδες', 'Remove a swimlane' => 'Αφαίρεση λωρίδας', - 'Show default swimlane' => 'Εμφάνιση προεπιλεγμένων λωρίδων', 'Swimlane modification for the project "%s"' => 'Τροποποίηση λωρίδας για το έργο « %s »', 'Swimlane removed successfully.' => 'Η λωρίδα αφαιρέθηκε με επιτυχία.', 'Swimlanes' => 'Λωρίδες', 'Swimlane updated successfully.' => 'Η λωρίδα ενημερώθηκε με επιτυχία.', - 'The default swimlane have been updated successfully.' => 'Η προεπιλεγμένη λωρίδα ενημερώθηκε με επιτυχία.', 'Unable to remove this swimlane.' => 'Αδύνατο να αφαιρεθεί η λωρίδα.', 'Unable to update this swimlane.' => 'Αδύνατο να ενημερωθεί η λωρίδα.', 'Your swimlane have been created successfully.' => 'Η λωρίδα δημιουργήθηκε με επιτυχία.', diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index db1ad870..713beaa0 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Esta exportación contiene el número de tareas por columna agrupadas por día.', 'Active swimlanes' => 'Calles activas', 'Add a new swimlane' => 'Añadir nueva calle', - 'Change default swimlane' => 'Cambiar la calle por defecto', 'Default swimlane' => 'Calle por defecto', 'Do you really want to remove this swimlane: "%s"?' => '¿Realmente desea eliminar esta calle: «%s»?', 'Inactive swimlanes' => 'Calles inactivas', 'Remove a swimlane' => 'Eliminar una calle', - 'Show default swimlane' => 'Mostrar calle por defecto', 'Swimlane modification for the project "%s"' => 'Modificación de la calle para el proyecto «%s»', 'Swimlane removed successfully.' => 'Calle eliminada correctamente.', 'Swimlanes' => 'Calles', 'Swimlane updated successfully.' => 'Calle actualizada correctamente.', - 'The default swimlane have been updated successfully.' => 'La calle por defecto ha sido actualizada correctamente.', 'Unable to remove this swimlane.' => 'No es posible eliminar esta calle.', 'Unable to update this swimlane.' => 'No es posible actualizar esta calle.', 'Your swimlane have been created successfully.' => 'Su calle ha sido creada correctamente.', diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index e3e8ef37..70280181 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Tämä tiedosto sisältää tehtäviä sarakkeisiin päiväkohtaisesti ryhmilteltyinä', 'Active swimlanes' => 'Aktiiviset kaistat', 'Add a new swimlane' => 'Lisää uusi kaista', - 'Change default swimlane' => 'Vaihda oletuskaistaa', 'Default swimlane' => 'Oletuskaista', 'Do you really want to remove this swimlane: "%s"?' => 'Haluatko varmasti poistaa tämän kaistan: "%s"?', 'Inactive swimlanes' => 'Passiiviset kaistat', 'Remove a swimlane' => 'Poista kaista', - 'Show default swimlane' => 'Näytä oletuskaista', 'Swimlane modification for the project "%s"' => 'Kaistamuutos projektille "%s"', 'Swimlane removed successfully.' => 'Kaista poistettu onnistuneesti.', 'Swimlanes' => 'Kaistat', 'Swimlane updated successfully.' => 'Kaista päivitetty onnistuneesti.', - 'The default swimlane have been updated successfully.' => 'Oletuskaista päivitetty onnistuneesti.', 'Unable to remove this swimlane.' => 'Kaistan poisto epäonnistui.', 'Unable to update this swimlane.' => 'Kaistan päivittäminen epäonnistui.', 'Your swimlane have been created successfully.' => 'Kaista luotu onnistuneesti.', diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index dea558cd..58f64459 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Cet export contient le nombre de tâches par colonne groupé par jour.', 'Active swimlanes' => 'Swimlanes actives', 'Add a new swimlane' => 'Ajouter une nouvelle swimlane', - 'Change default swimlane' => 'Modifier la swimlane par défaut', 'Default swimlane' => 'Swimlane par défaut', 'Do you really want to remove this swimlane: "%s"?' => 'Voulez-vous vraiment supprimer cette swimlane : « %s » ?', 'Inactive swimlanes' => 'Swimlanes inactives', 'Remove a swimlane' => 'Supprimer une swimlane', - 'Show default swimlane' => 'Afficher la swimlane par défaut', 'Swimlane modification for the project "%s"' => 'Modification d\'une swimlane pour le projet « %s »', 'Swimlane removed successfully.' => 'Swimlane supprimée avec succès.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane mise à jour avec succès.', - 'The default swimlane have been updated successfully.' => 'La swimlane par défaut a été mise à jour avec succès.', 'Unable to remove this swimlane.' => 'Impossible de supprimer cette swimlane.', 'Unable to update this swimlane.' => 'Impossible de mettre à jour cette swimlane.', 'Your swimlane have been created successfully.' => 'Votre swimlane a été créée avec succès.', diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index f4567dce..ff0386b5 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Ez az export tartalmazza a feladatok számát oszloponként összesítve, napokra lebontva.', 'Active swimlanes' => 'Aktív sávok', 'Add a new swimlane' => 'Új sáv', - 'Change default swimlane' => 'Alapértelmezett sáv megváltoztatása', 'Default swimlane' => 'Alapértelmezett folyamat', 'Do you really want to remove this swimlane: "%s"?' => 'Valóban törölni akarja ezt a sávot: %s ?', 'Inactive swimlanes' => 'Inaktív sávok', 'Remove a swimlane' => 'Sáv törlés', - 'Show default swimlane' => 'Alapértelmezett sáv megjelenítése', 'Swimlane modification for the project "%s"' => '%s projekt sávjainak módosítása', 'Swimlane removed successfully.' => 'Sáv sikeresen törölve.', 'Swimlanes' => 'Sávok', 'Swimlane updated successfully.' => 'Sáv sikeresen frissítve', - 'The default swimlane have been updated successfully.' => 'Az alapértelmezett sáv sikeresen frissítve.', 'Unable to remove this swimlane.' => 'A sáv törlése sikertelen.', 'Unable to update this swimlane.' => 'A sáv frissítése sikertelen.', 'Your swimlane have been created successfully.' => 'A sáv sikeresen létrehozva.', diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php index 6891c411..9ec4efbb 100644 --- a/app/Locale/id_ID/translations.php +++ b/app/Locale/id_ID/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Ekspor ini berisi jumlah dari tugas per kolom yang dikelompokan per hari.', 'Active swimlanes' => 'Swimlanes aktif', 'Add a new swimlane' => 'Tambah swimlane baru', - 'Change default swimlane' => 'Ganti swimlane default', 'Default swimlane' => 'Swimlane default', 'Do you really want to remove this swimlane: "%s"?' => 'Apakah Anda yakin mau menghapus swimlane ini: "%s"?', 'Inactive swimlanes' => 'Swimlanes tidak aktif', 'Remove a swimlane' => 'Hapus swimlane', - 'Show default swimlane' => 'Lihat swimlane default', 'Swimlane modification for the project "%s"' => 'Modifikasi swimlane untuk proyek "%s"', 'Swimlane removed successfully.' => 'Swimlane berhasil dihapus.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane berhasil diperbarui.', - 'The default swimlane have been updated successfully.' => 'Swimlane default berhasil diperbarui.', 'Unable to remove this swimlane.' => 'Tidak dapat menghapus swimlane ini.', 'Unable to update this swimlane.' => 'Tidak dapat memperbarui swimlane ini.', 'Your swimlane have been created successfully.' => 'Swimlane Anda berhasil dibuat.', diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 5e75d036..b57e57a4 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Questo export contiene il numero di task per colonna raggruppati per giorno', 'Active swimlanes' => 'Corsie attive', 'Add a new swimlane' => 'Aggiungi una corsia', - 'Change default swimlane' => 'Cambia la corsia predefinita', 'Default swimlane' => 'Corsia predefinita', 'Do you really want to remove this swimlane: "%s"?' => 'Vuoi davvero rimuovere la seguente corsia: "%s"?', 'Inactive swimlanes' => 'Corsie inattive', 'Remove a swimlane' => 'Rimuovi una corsia', - 'Show default swimlane' => 'Mostra la corsia predefinita', 'Swimlane modification for the project "%s"' => 'Modifica corsia per il progetto "%s"', 'Swimlane removed successfully.' => 'Corsia rimossa con successo.', 'Swimlanes' => 'Corsie', 'Swimlane updated successfully.' => 'Corsia aggiornata con successo.', - 'The default swimlane have been updated successfully.' => 'La corsia predefinita è stata aggiornata con successo.', 'Unable to remove this swimlane.' => 'Impossibile rimuovere questa corsia.', 'Unable to update this swimlane.' => 'Impossibile aggiornare questa corsia.', 'Your swimlane have been created successfully.' => 'La tua corsia è stata creata con successo', diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 0a379357..67a69c14 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'この出力は日時のカラムごとのタスク数を集計したものです', 'Active swimlanes' => 'アクティブなスイムレーン', 'Add a new swimlane' => '新しいスイムレーン', - 'Change default swimlane' => 'デフォルトスイムレーンの変更', 'Default swimlane' => 'デフォルトスイムレーン', 'Do you really want to remove this swimlane: "%s"?' => 'このスイムレーン「%s」を本当に削除しますか?', 'Inactive swimlanes' => 'インタラクティブなスイムレーン', 'Remove a swimlane' => 'スイムレーンの削除', - 'Show default swimlane' => 'デフォルトスイムレーンの表示', 'Swimlane modification for the project "%s"' => '「%s」に対するスイムレーン変更', 'Swimlane removed successfully.' => 'スイムレーンを削除しました。', 'Swimlanes' => 'スイムレーン', 'Swimlane updated successfully.' => 'スイムレーンを更新しました。', - 'The default swimlane have been updated successfully.' => 'デフォルトスイムレーンを更新しました。', 'Unable to remove this swimlane.' => 'スイムレーンを削除できませんでした。', 'Unable to update this swimlane.' => 'スイムレーンを更新できませんでした。', 'Your swimlane have been created successfully.' => 'スイムレーンが作成されました。', diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php index fca221a6..acacf7de 100644 --- a/app/Locale/ko_KR/translations.php +++ b/app/Locale/ko_KR/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => '이 출력은 날짜의 칼람별 할일 수를 집계한 것입니다', 'Active swimlanes' => '액티브한 스윔레인', 'Add a new swimlane' => ' 새로운 스윔레인', - 'Change default swimlane' => '기본 스윔레인의 변경', 'Default swimlane' => '기본 스윔레인', 'Do you really want to remove this swimlane: "%s"?' => '스웜레인을 삭제하시겠습니까: "%s"?', 'Inactive swimlanes' => '인터랙티브한 스윔레인', 'Remove a swimlane' => '스윔레인의 삭제', - 'Show default swimlane' => '기본 스윔레인의 표시', 'Swimlane modification for the project "%s"' => '"%s" 프로젝트의 스웜레인 수정', 'Swimlane removed successfully.' => '스윔레인을 삭제했습니다.', 'Swimlanes' => '스윔레인', 'Swimlane updated successfully.' => '스윔레인을 갱신했습니다.', - 'The default swimlane have been updated successfully.' => '기본 스윔레인을 갱신했습니다.', 'Unable to remove this swimlane.' => '스윔레인을 삭제할 수 없었습니다.', 'Unable to update this swimlane.' => '스윔레인을 갱신할 수 없었습니다.', 'Your swimlane have been created successfully.' => '스윔레인이 작성되었습니다.', diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php index 9f0768f4..6c25e536 100644 --- a/app/Locale/my_MY/translations.php +++ b/app/Locale/my_MY/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Ekspor ini berisi jumlah dari tugas per kolom dikelompokan perhari.', 'Active swimlanes' => 'Swimlanes aktif', 'Add a new swimlane' => 'Tambah swimlane baharu', - 'Change default swimlane' => 'Tukar piawai swimlane', 'Default swimlane' => 'Piawai swimlane', 'Do you really want to remove this swimlane: "%s"?' => 'Anda yakin untuk menghapus swimlane ini : « %s » ?', 'Inactive swimlanes' => 'Swimlanes tidak aktif', 'Remove a swimlane' => 'Padam swimlane', - 'Show default swimlane' => 'Tampilkan piawai swimlane', 'Swimlane modification for the project "%s"' => 'Modifikasi swimlane untuk projek « %s »', 'Swimlane removed successfully.' => 'Swimlane telah dipadamkan.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane telah dikemaskini.', - 'The default swimlane have been updated successfully.' => 'Standar swimlane berhasil diperbaharui.', 'Unable to remove this swimlane.' => 'Tidak dapat menghapus swimlane ini.', 'Unable to update this swimlane.' => 'Tidak dapat memperbaharui swimlane ini.', 'Your swimlane have been created successfully.' => 'Swimlane anda berhasil dibuat.', diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php index 2f98533d..0d3603ef 100644 --- a/app/Locale/nb_NO/translations.php +++ b/app/Locale/nb_NO/translations.php @@ -441,17 +441,14 @@ return array( // 'This export contains the number of tasks per column grouped per day.' => '', 'Active swimlanes' => 'Aktive svømmebaner', 'Add a new swimlane' => 'Legg til en ny svømmebane', - 'Change default swimlane' => 'Endre standard svømmebane', 'Default swimlane' => 'Standard svømmebane', // 'Do you really want to remove this swimlane: "%s"?' => '', // 'Inactive swimlanes' => '', 'Remove a swimlane' => 'Fjern en svømmebane', - 'Show default swimlane' => 'Vis standard svømmebane', // 'Swimlane modification for the project "%s"' => '', 'Swimlane removed successfully.' => 'Svømmebane fjernet', 'Swimlanes' => 'Svømmebaner', 'Swimlane updated successfully.' => 'Svømmebane oppdatert', - // 'The default swimlane have been updated successfully.' => '', // 'Unable to remove this swimlane.' => '', // 'Unable to update this swimlane.' => '', // 'Your swimlane have been created successfully.' => '', diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index 13fbc074..0d14518d 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Dit rapport bevat het aantal taken per kolom gegroupeerd per dag.', 'Active swimlanes' => 'Actieve swinlanes', 'Add a new swimlane' => 'Nieuwe swimlane toevoegen', - 'Change default swimlane' => 'Standaard swimlane aapassen', 'Default swimlane' => 'Standaard swinlane', 'Do you really want to remove this swimlane: "%s"?' => 'Weet u zeker dat u deze swimlane wil verwijderen : « %s » ?', 'Inactive swimlanes' => 'Inactieve swinlanes', 'Remove a swimlane' => 'Verwijder swinlane', - 'Show default swimlane' => 'Standaard swimlane tonen', 'Swimlane modification for the project "%s"' => 'Swinlane aanpassing voor project « %s »', 'Swimlane removed successfully.' => 'Swimlane succesvol verwijderd.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane succesvol aangepast.', - 'The default swimlane have been updated successfully.' => 'De standaard swimlane is succesvol aangepast.', 'Unable to remove this swimlane.' => 'Swimlane verwijderen niet gelukt.', 'Unable to update this swimlane.' => 'Swimlane aanpassen niet gelukt.', 'Your swimlane have been created successfully.' => 'Swimlane succesvol aangemaakt.', diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 0689f459..d7c1d1e8 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Ten eksport zawiera ilość zadań zgrupowanych w kolumnach na dzień', 'Active swimlanes' => 'Aktywne tory', 'Add a new swimlane' => 'Dodaj tor', - 'Change default swimlane' => 'Zmień domyślny tor', 'Default swimlane' => 'Domyślny tor', 'Do you really want to remove this swimlane: "%s"?' => 'Czy na pewno chcesz usunąć tor: "%s"?', 'Inactive swimlanes' => 'Nieaktywne tory', 'Remove a swimlane' => 'Usuń tor', - 'Show default swimlane' => 'Pokaż domyślny tor', 'Swimlane modification for the project "%s"' => 'Edycja torów dla projektu "%s"', 'Swimlane removed successfully.' => 'Tor usunięty pomyślnie.', 'Swimlanes' => 'Tory', 'Swimlane updated successfully.' => 'Zaktualizowano tor.', - 'The default swimlane have been updated successfully.' => 'Domyślny tor zaktualizowany pomyślnie.', 'Unable to remove this swimlane.' => 'Nie można usunąć toru.', 'Unable to update this swimlane.' => 'Nie można zaktualizować toru.', 'Your swimlane have been created successfully.' => 'Tor utworzony pomyślnie.', diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index b4c549b0..554396e1 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Esta exportação contém o número de tarefas por coluna agrupada por dia.', 'Active swimlanes' => 'Ativar swimlanes', 'Add a new swimlane' => 'Adicionar swimlane', - 'Change default swimlane' => 'Alterar swimlane padrão', 'Default swimlane' => 'Swimlane padrão', 'Do you really want to remove this swimlane: "%s"?' => 'Você realmente deseja remover esta swimlane: "%s"?', 'Inactive swimlanes' => 'Desativar swimlanes', 'Remove a swimlane' => 'Remover uma swimlane', - 'Show default swimlane' => 'Exibir swimlane padrão', 'Swimlane modification for the project "%s"' => 'Modificação de swimlane para o projeto "%s"', 'Swimlane removed successfully.' => 'Swimlane removida com sucesso.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane atualizada com sucesso.', - 'The default swimlane have been updated successfully.' => 'A swimlane padrão foi atualizada com sucesso.', 'Unable to remove this swimlane.' => 'Não foi possível remover esta swimlane.', 'Unable to update this swimlane.' => 'Não foi possível atualizar esta swimlane.', 'Your swimlane have been created successfully.' => 'Sua swimlane foi criada com sucesso.', diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php index a8f9ab62..b8fdd4d7 100644 --- a/app/Locale/pt_PT/translations.php +++ b/app/Locale/pt_PT/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Esta exportação contém o número de tarefas por coluna agrupada por dia.', 'Active swimlanes' => 'Activar swimlanes', 'Add a new swimlane' => 'Adicionar novo swimlane', - 'Change default swimlane' => 'Alterar swimlane padrão', 'Default swimlane' => 'Swimlane padrão', 'Do you really want to remove this swimlane: "%s"?' => 'Tem a certeza que quer remover este swimlane: "%s"?', 'Inactive swimlanes' => 'Desactivar swimlanes', 'Remove a swimlane' => 'Remover um swimlane', - 'Show default swimlane' => 'Mostrar swimlane padrão', 'Swimlane modification for the project "%s"' => 'Modificação de swimlane para o projeto "%s"', 'Swimlane removed successfully.' => 'Swimlane removido com sucesso.', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane atualizado com sucesso.', - 'The default swimlane have been updated successfully.' => 'O swimlane padrão foi atualizado com sucesso.', 'Unable to remove this swimlane.' => 'Não foi possível remover este swimlane.', 'Unable to update this swimlane.' => 'Não foi possível atualizar este swimlane.', 'Your swimlane have been created successfully.' => 'Seu swimlane foi criado com sucesso.', diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 8e691371..5ee12b9b 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Этот экспорт содержит ряд задач в колонках, сгруппированные по дням.', 'Active swimlanes' => 'Активные дорожки', 'Add a new swimlane' => 'Добавить новую дорожку', - 'Change default swimlane' => 'Сменить стандартную дорожку', 'Default swimlane' => 'Стандартная дорожка', 'Do you really want to remove this swimlane: "%s"?' => 'Вы действительно хотите удалить дорожку "%s"?', 'Inactive swimlanes' => 'Неактивные дорожки', 'Remove a swimlane' => 'Удалить дорожку', - 'Show default swimlane' => 'Показать стандартную дорожку', 'Swimlane modification for the project "%s"' => 'Редактирование дорожки для проекта "%s"', 'Swimlane removed successfully.' => 'Дорожка успешно удалена', 'Swimlanes' => 'Дорожки', 'Swimlane updated successfully.' => 'Дорожка успешно обновлена.', - 'The default swimlane have been updated successfully.' => 'Стандартная swimlane был успешно обновлен.', 'Unable to remove this swimlane.' => 'Невозможно удалить дорожку.', 'Unable to update this swimlane.' => 'Невозможно обновить дорожку.', 'Your swimlane have been created successfully.' => 'Ваша дорожка была успешно создан.', diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index b5228d1f..a24e7db2 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -441,17 +441,14 @@ return array( // 'This export contains the number of tasks per column grouped per day.' => '', 'Active swimlanes' => 'Aktivni razdelnik', 'Add a new swimlane' => 'Dodaj razdelnik', - 'Change default swimlane' => 'Zameni osnovni razdelnik', 'Default swimlane' => 'Osnovni razdelnik', 'Do you really want to remove this swimlane: "%s"?' => 'Da li da uklonim razdelnik: "%s"?', 'Inactive swimlanes' => 'Neaktivni razdelniki', 'Remove a swimlane' => 'Ukloni razdelnik', - 'Show default swimlane' => 'Prikaži osnovni razdelnik', 'Swimlane modification for the project "%s"' => 'Izmena razdelnika za projekat "%s"', 'Swimlane removed successfully.' => 'Razdelnik uspešno uklonjen.', 'Swimlanes' => 'Razdelnici', 'Swimlane updated successfully.' => 'Razdelnik zaktualizowany pomyślnie.', - // 'The default swimlane have been updated successfully.' => '', // 'Unable to remove this swimlane.' => '', // 'Unable to update this swimlane.' => '', 'Your swimlane have been created successfully.' => 'Razdelnik je uspešno kreiran.', diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index cfecd415..51dee948 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Denna export innehåller antalet uppgifter per kolumn grupperade per dag.', 'Active swimlanes' => 'Aktiva swimlanes', 'Add a new swimlane' => 'Lägg till en nytt swimlane', - 'Change default swimlane' => 'Ändra standard swimlane', 'Default swimlane' => 'Standard swimlane', 'Do you really want to remove this swimlane: "%s"?' => 'Vill du verkligen ta bort denna swimlane: "%s"?', 'Inactive swimlanes' => 'Inaktiv swimlane', 'Remove a swimlane' => 'Ta bort en swimlane', - 'Show default swimlane' => 'Visa standard swimlane', 'Swimlane modification for the project "%s"' => 'Ändra swimlane för projektet "%s"', 'Swimlane removed successfully.' => 'Swimlane togs bort', 'Swimlanes' => 'Swimlanes', 'Swimlane updated successfully.' => 'Swimlane uppdaterad', - 'The default swimlane have been updated successfully.' => 'Standardswimlane har uppdaterats', 'Unable to remove this swimlane.' => 'Kunde inte ta bort swimlane', 'Unable to update this swimlane.' => 'Kunde inte uppdatera swimlane', 'Your swimlane have been created successfully.' => 'Din swimlane har skapats', diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 67f8c442..4234211d 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'การส่งออกนี้เป็นการนับจำนวนงานในแต่ละคอลัมน์ในแต่ละวัน', 'Active swimlanes' => 'สวิมเลนพร้อมใช้งาน', 'Add a new swimlane' => 'เพิ่มสวิมเลนใหม่', - 'Change default swimlane' => 'เปลี่ยนสวิมเลนเริ่มต้น', 'Default swimlane' => 'สวิมเลนเริ่มต้น', 'Do you really want to remove this swimlane: "%s"?' => 'คุณต้องการลบสวิมเลนนี้ : "%s"?', 'Inactive swimlanes' => 'สวิมเลนไม่ทำงาน', 'Remove a swimlane' => 'ลบสวิมเลน', - 'Show default swimlane' => 'แสดงสวิมเลนเริ่มต้น', 'Swimlane modification for the project "%s"' => 'แก้ไขสวิมเลนสำหรับโปรเจค "%s"', 'Swimlane removed successfully.' => 'ลบสวิมเลนเรียบร้อยแล้ว', 'Swimlanes' => 'สวิมเลน', 'Swimlane updated successfully.' => 'ปรับปรุงสวิมเลนเรียบร้อยแล้ว', - 'The default swimlane have been updated successfully.' => 'สวิมเลนเริ่มต้นปรับปรุงเรียบร้อยแล้ว', 'Unable to remove this swimlane.' => 'ไม่สามารถลบสวิมเลนนี้', 'Unable to update this swimlane.' => 'ไม่สามารถปรับปรุงสวิมเลนนี้', 'Your swimlane have been created successfully.' => 'สวิมเลนของคุณถูกสร้างเรียบร้อยแล้ว', diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index c403894f..6f4dd2e6 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => 'Bu dışa aktarım günlük gruplanmış olarak her sütundaki görev sayısını içerir.', 'Active swimlanes' => 'Aktif Kulvar', 'Add a new swimlane' => 'Yeni bir Kulvar ekle', - 'Change default swimlane' => 'Varsayılan Kulvarı değiştir', 'Default swimlane' => 'Varsayılan Kulvar', 'Do you really want to remove this swimlane: "%s"?' => 'Bu Kulvarı silmek istediğinize emin misiniz?: "%s"?', 'Inactive swimlanes' => 'Pasif Kulvarlar', 'Remove a swimlane' => 'Kulvarı sil', - 'Show default swimlane' => 'Varsayılan Kulvarı göster', 'Swimlane modification for the project "%s"' => '"%s" Projesi için Kulvar değişikliği', 'Swimlane removed successfully.' => 'Kulvar başarıyla kaldırıldı.', 'Swimlanes' => 'Kulvarlar', 'Swimlane updated successfully.' => 'Kulvar başarıyla güncellendi.', - 'The default swimlane have been updated successfully.' => 'Varsayılan Kulvarlar başarıyla güncellendi.', 'Unable to remove this swimlane.' => 'Bu Kulvarı silmek mümkün değil.', 'Unable to update this swimlane.' => 'Bu Kulvarı değiştirmek mümkün değil.', 'Your swimlane have been created successfully.' => 'Kulvar başarıyla oluşturuldu.', diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index ca476aa2..3800f239 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -441,17 +441,14 @@ return array( 'This export contains the number of tasks per column grouped per day.' => '此导出包含每列的任务数,按天分组', 'Active swimlanes' => '活动里程碑', 'Add a new swimlane' => '添加新里程碑', - 'Change default swimlane' => '修改默认里程碑', 'Default swimlane' => '默认里程碑', 'Do you really want to remove this swimlane: "%s"?' => '确定要删除里程碑:"%s"?', 'Inactive swimlanes' => '非活动里程碑', 'Remove a swimlane' => '删除里程碑', - 'Show default swimlane' => '显示默认里程碑', 'Swimlane modification for the project "%s"' => '项目"%s"的里程碑变更', 'Swimlane removed successfully.' => '成功删除里程碑', 'Swimlanes' => '里程碑', 'Swimlane updated successfully.' => '成功更新了里程碑。', - 'The default swimlane have been updated successfully.' => '成功更新了默认里程碑。', 'Unable to remove this swimlane.' => '无法删除此里程碑', 'Unable to update this swimlane.' => '无法更新此里程碑', 'Your swimlane have been created successfully.' => '已经成功创建里程碑。', diff --git a/app/Model/ProjectDuplicationModel.php b/app/Model/ProjectDuplicationModel.php index d32fa367..1d1eed8e 100644 --- a/app/Model/ProjectDuplicationModel.php +++ b/app/Model/ProjectDuplicationModel.php @@ -26,7 +26,6 @@ class ProjectDuplicationModel extends Base 'categoryModel', 'projectPermissionModel', 'actionModel', - 'swimlaneModel', 'tagDuplicationModel', 'projectMetadataModel', 'projectTaskDuplicationModel', @@ -42,6 +41,7 @@ class ProjectDuplicationModel extends Base public function getPossibleSelection() { return array( + 'swimlaneModel', 'boardModel', 'categoryModel', 'projectPermissionModel', @@ -94,7 +94,7 @@ class ProjectDuplicationModel extends Base return false; } - // Clone Columns, Categories, Permissions and Actions + // Clone Swimlanes, Columns, Categories, Permissions and Actions foreach ($this->getPossibleSelection() as $model) { // Skip if optional part has not been selected @@ -151,11 +151,7 @@ class ProjectDuplicationModel extends Base 'priority_end' => $project['priority_end'], ); - if (! $this->db->table(ProjectModel::TABLE)->save($values)) { - return false; - } - - return $this->db->getLastId(); + return $this->db->table(ProjectModel::TABLE)->persist($values); } /** diff --git a/app/Model/ProjectModel.php b/app/Model/ProjectModel.php index 7f9cfb9b..a4d75a0b 100644 --- a/app/Model/ProjectModel.php +++ b/app/Model/ProjectModel.php @@ -321,19 +321,19 @@ class ProjectModel extends Base * Create a project * * @access public - * @param array $values Form values - * @param integer $user_id User who create the project - * @param bool $add_user Automatically add the user - * @return integer Project id + * @param array $values Form values + * @param integer $userId User who create the project + * @param bool $addUser Automatically add the user + * @return int Project id */ - public function create(array $values, $user_id = 0, $add_user = false) + public function create(array $values, $userId = 0, $addUser = false) { $this->db->startTransaction(); $values['token'] = ''; $values['last_modified'] = time(); $values['is_private'] = empty($values['is_private']) ? 0 : 1; - $values['owner_id'] = $user_id; + $values['owner_id'] = $userId; if (! empty($values['identifier'])) { $values['identifier'] = strtoupper($values['identifier']); @@ -353,8 +353,13 @@ class ProjectModel extends Base return false; } - if ($add_user && $user_id) { - $this->projectUserRoleModel->addUser($project_id, $user_id, Role::PROJECT_MANAGER); + if (! $this->swimlaneModel->create($project_id, t('Default swimlane'))) { + $this->db->cancelTransaction(); + return false; + } + + if ($addUser && $userId) { + $this->projectUserRoleModel->addUser($project_id, $userId, Role::PROJECT_MANAGER); } $this->categoryModel->createDefaultCategories($project_id); diff --git a/app/Model/SwimlaneModel.php b/app/Model/SwimlaneModel.php index f20bfa2f..785a1054 100644 --- a/app/Model/SwimlaneModel.php +++ b/app/Model/SwimlaneModel.php @@ -37,38 +37,40 @@ class SwimlaneModel extends Base * Get a swimlane by the id * * @access public - * @param integer $swimlane_id Swimlane id + * @param integer $swimlaneId * @return array */ - public function getById($swimlane_id) + public function getById($swimlaneId) { - return $this->db->table(self::TABLE)->eq('id', $swimlane_id)->findOne(); + return $this->db->table(self::TABLE)->eq('id', $swimlaneId)->findOne(); } /** * Get the swimlane name by the id * * @access public - * @param integer $swimlane_id Swimlane id + * @param integer $swimlaneId * @return string */ - public function getNameById($swimlane_id) + public function getNameById($swimlaneId) { - return $this->db->table(self::TABLE)->eq('id', $swimlane_id)->findOneColumn('name') ?: ''; + return $this->db->table(self::TABLE) + ->eq('id', $swimlaneId) + ->findOneColumn('name'); } /** * Get a swimlane id by the project and the name * * @access public - * @param integer $project_id Project id + * @param integer $projectId Project id * @param string $name Name * @return integer */ - public function getIdByName($project_id, $name) + public function getIdByName($projectId, $name) { return (int) $this->db->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->eq('name', $name) ->findOneColumn('id'); } @@ -77,14 +79,14 @@ class SwimlaneModel extends Base * Get a swimlane by the project and the name * * @access public - * @param integer $project_id Project id + * @param integer $projectId Project id * @param string $name Swimlane name * @return array */ - public function getByName($project_id, $name) + public function getByName($projectId, $name) { return $this->db->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->eq('name', $name) ->findOne(); } @@ -93,54 +95,46 @@ class SwimlaneModel extends Base * Get first active swimlane for a project * * @access public - * @param integer $project_id + * @param integer $projectId * @return array|null */ - public function getFirstActiveSwimlane($project_id) + public function getFirstActiveSwimlane($projectId) { - $swimlanes = $this->getSwimlanes($project_id); - - if (empty($swimlanes)) { - return null; - } - - return $swimlanes[0]; + return $this->db->table(self::TABLE) + ->eq('project_id', $projectId) + ->eq('is_active', 1) + ->asc('position') + ->findOne(); } /** - * Get default swimlane properties + * Get first active swimlaneId * * @access public - * @param integer $project_id Project id - * @return array + * @param int $projectId + * @return int */ - public function getDefault($project_id) + public function getFirstActiveSwimlaneId($projectId) { - $result = $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->columns('id', 'default_swimlane', 'show_default_swimlane') - ->findOne(); - - if ($result['default_swimlane'] === 'Default swimlane') { - $result['default_swimlane'] = t($result['default_swimlane']); - } - - return $result; + return (int) $this->db->table(self::TABLE) + ->eq('project_id', $projectId) + ->eq('is_active', 1) + ->asc('position') + ->findOneColumn('id'); } /** * Get all swimlanes for a given project * * @access public - * @param integer $project_id Project id + * @param integer $projectId * @return array */ - public function getAll($project_id) + public function getAll($projectId) { return $this->db ->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->orderBy('position', 'asc') ->findAll(); } @@ -149,15 +143,15 @@ class SwimlaneModel extends Base * Get the list of swimlanes by status * * @access public - * @param integer $project_id Project id - * @param integer $status Status + * @param integer $projectId + * @param integer $status * @return array */ - public function getAllByStatus($project_id, $status = self::ACTIVE) + public function getAllByStatus($projectId, $status = self::ACTIVE) { $query = $this->db ->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->eq('is_active', $status); if ($status == self::ACTIVE) { @@ -169,66 +163,27 @@ class SwimlaneModel extends Base return $query->findAll(); } - /** - * Get active swimlanes - * - * @access public - * @param integer $project_id Project id - * @return array - */ - public function getSwimlanes($project_id) - { - $swimlanes = $this->db - ->table(self::TABLE) - ->columns('id', 'name', 'description') - ->eq('project_id', $project_id) - ->eq('is_active', self::ACTIVE) - ->orderBy('position', 'asc') - ->findAll(); - - $defaultSwimlane = $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->eq('show_default_swimlane', 1) - ->findOneColumn('default_swimlane'); - - if ($defaultSwimlane) { - if ($defaultSwimlane === 'Default swimlane') { - $defaultSwimlane = t($defaultSwimlane); - } - - array_unshift($swimlanes, array('id' => 0, 'name' => $defaultSwimlane)); - } - - return $swimlanes; - } - /** * Get list of all swimlanes * * @access public - * @param integer $project_id Project id - * @param boolean $prepend Prepend default value - * @param boolean $only_active Return only active swimlanes + * @param integer $projectId Project id + * @param boolean $prepend Prepend default value + * @param boolean $onlyActive Return only active swimlanes * @return array */ - public function getList($project_id, $prepend = false, $only_active = false) + public function getList($projectId, $prepend = false, $onlyActive = false) { $swimlanes = array(); - $default = $this->db->table(ProjectModel::TABLE)->eq('id', $project_id)->eq('show_default_swimlane', 1)->findOneColumn('default_swimlane'); if ($prepend) { $swimlanes[-1] = t('All swimlanes'); } - if (! empty($default)) { - $swimlanes[0] = $default === 'Default swimlane' ? t($default) : $default; - } - return $swimlanes + $this->db ->hashtable(self::TABLE) - ->eq('project_id', $project_id) - ->in('is_active', $only_active ? array(self::ACTIVE) : array(self::ACTIVE, self::INACTIVE)) + ->eq('project_id', $projectId) + ->in('is_active', $onlyActive ? array(self::ACTIVE) : array(self::ACTIVE, self::INACTIVE)) ->orderBy('position', 'asc') ->getAll('id', 'name'); } @@ -237,17 +192,24 @@ class SwimlaneModel extends Base * Add a new swimlane * * @access public - * @param array $values Form values - * @return integer|boolean + * @param int $projectId + * @param string $name + * @param string $description + * @return bool|int */ - public function create($values) + public function create($projectId, $name, $description = '') { - if (! $this->projectModel->exists($values['project_id'])) { + if (! $this->projectModel->exists($projectId)) { return 0; } - $values['position'] = $this->getLastPosition($values['project_id']); - return $this->db->table(self::TABLE)->persist($values); + return $this->db->table(self::TABLE)->persist(array( + 'project_id' => $projectId, + 'name' => $name, + 'description' => $description, + 'position' => $this->getLastPosition($projectId), + 'is_active' => 1, + )); } /** @@ -265,70 +227,18 @@ class SwimlaneModel extends Base ->update($values); } - /** - * Update the default swimlane - * - * @access public - * @param array $values Form values - * @return bool - */ - public function updateDefault(array $values) - { - return $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $values['id']) - ->update(array( - 'default_swimlane' => $values['default_swimlane'], - 'show_default_swimlane' => $values['show_default_swimlane'], - )); - } - - /** - * Enable the default swimlane - * - * @access public - * @param integer $project_id - * @return bool - */ - public function enableDefault($project_id) - { - return $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->update(array( - 'show_default_swimlane' => 1, - )); - } - - /** - * Disable the default swimlane - * - * @access public - * @param integer $project_id - * @return bool - */ - public function disableDefault($project_id) - { - return $this->db - ->table(ProjectModel::TABLE) - ->eq('id', $project_id) - ->update(array( - 'show_default_swimlane' => 0, - )); - } - /** * Get the last position of a swimlane * * @access public - * @param integer $project_id + * @param integer $projectId * @return integer */ - public function getLastPosition($project_id) + public function getLastPosition($projectId) { return $this->db ->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->eq('is_active', 1) ->count() + 1; } @@ -337,23 +247,23 @@ class SwimlaneModel extends Base * Disable a swimlane * * @access public - * @param integer $project_id Project id - * @param integer $swimlane_id Swimlane id + * @param integer $projectId + * @param integer $swimlaneId * @return bool */ - public function disable($project_id, $swimlane_id) + public function disable($projectId, $swimlaneId) { $result = $this->db ->table(self::TABLE) - ->eq('id', $swimlane_id) + ->eq('id', $swimlaneId) + ->eq('project_id', $projectId) ->update(array( 'is_active' => self::INACTIVE, 'position' => 0, )); if ($result) { - // Re-order positions - $this->updatePositions($project_id); + $this->updatePositions($projectId); } return $result; @@ -363,18 +273,19 @@ class SwimlaneModel extends Base * Enable a swimlane * * @access public - * @param integer $project_id Project id - * @param integer $swimlane_id Swimlane id + * @param integer $projectId + * @param integer $swimlaneId * @return bool */ - public function enable($project_id, $swimlane_id) + public function enable($projectId, $swimlaneId) { return $this->db ->table(self::TABLE) - ->eq('id', $swimlane_id) + ->eq('id', $swimlaneId) + ->eq('project_id', $projectId) ->update(array( 'is_active' => self::ACTIVE, - 'position' => $this->getLastPosition($project_id), + 'position' => $this->getLastPosition($projectId), )); } @@ -382,25 +293,25 @@ class SwimlaneModel extends Base * Remove a swimlane * * @access public - * @param integer $project_id Project id - * @param integer $swimlane_id Swimlane id + * @param integer $projecId + * @param integer $swimlaneId * @return bool */ - public function remove($project_id, $swimlane_id) + public function remove($projecId, $swimlaneId) { $this->db->startTransaction(); - // Tasks should not be assigned anymore to this swimlane - $this->db->table(TaskModel::TABLE)->eq('swimlane_id', $swimlane_id)->update(array('swimlane_id' => 0)); - - if (! $this->db->table(self::TABLE)->eq('id', $swimlane_id)->remove()) { + if ($this->db->table(TaskModel::TABLE)->eq('swimlane_id', $swimlaneId)->exists()) { $this->db->cancelTransaction(); return false; } - // Re-order positions - $this->updatePositions($project_id); + if (! $this->db->table(self::TABLE)->eq('id', $swimlaneId)->remove()) { + $this->db->cancelTransaction(); + return false; + } + $this->updatePositions($projecId); $this->db->closeTransaction(); return true; @@ -410,15 +321,15 @@ class SwimlaneModel extends Base * Update swimlane positions after disabling or removing a swimlane * * @access public - * @param integer $project_id Project id + * @param integer $projectId * @return boolean */ - public function updatePositions($project_id) + public function updatePositions($projectId) { $position = 0; $swimlanes = $this->db ->table(self::TABLE) - ->eq('project_id', $project_id) + ->eq('project_id', $projectId) ->eq('is_active', 1) ->asc('position') ->asc('id') @@ -441,37 +352,37 @@ class SwimlaneModel extends Base * Change swimlane position * * @access public - * @param integer $project_id - * @param integer $swimlane_id + * @param integer $projectId + * @param integer $swimlaneId * @param integer $position * @return boolean */ - public function changePosition($project_id, $swimlane_id, $position) + public function changePosition($projectId, $swimlaneId, $position) { - if ($position < 1 || $position > $this->db->table(self::TABLE)->eq('project_id', $project_id)->count()) { + if ($position < 1 || $position > $this->db->table(self::TABLE)->eq('project_id', $projectId)->count()) { return false; } - $swimlane_ids = $this->db->table(self::TABLE) + $swimlaneIds = $this->db->table(self::TABLE) ->eq('is_active', 1) - ->eq('project_id', $project_id) - ->neq('id', $swimlane_id) + ->eq('project_id', $projectId) + ->neq('id', $swimlaneId) ->asc('position') ->findAllByColumn('id'); $offset = 1; $results = array(); - foreach ($swimlane_ids as $current_swimlane_id) { + foreach ($swimlaneIds as $currentSwimlaneId) { if ($offset == $position) { $offset++; } - $results[] = $this->db->table(self::TABLE)->eq('id', $current_swimlane_id)->update(array('position' => $offset)); + $results[] = $this->db->table(self::TABLE)->eq('id', $currentSwimlaneId)->update(array('position' => $offset)); $offset++; } - $results[] = $this->db->table(self::TABLE)->eq('id', $swimlane_id)->update(array('position' => $position)); + $results[] = $this->db->table(self::TABLE)->eq('id', $swimlaneId)->update(array('position' => $position)); return !in_array(false, $results, true); } @@ -480,29 +391,30 @@ class SwimlaneModel extends Base * Duplicate Swimlane to project * * @access public - * @param integer $project_from Project Template - * @param integer $project_to Project that receives the copy - * @return integer|boolean + * @param integer $projectSrcId + * @param integer $projectDstId + * @return boolean */ - - public function duplicate($project_from, $project_to) + public function duplicate($projectSrcId, $projectDstId) { - $swimlanes = $this->getAll($project_from); + $swimlanes = $this->getAll($projectSrcId); foreach ($swimlanes as $swimlane) { - unset($swimlane['id']); - $swimlane['project_id'] = $project_to; - - if (! $this->db->table(self::TABLE)->save($swimlane)) { - return false; + if (! $this->db->table(self::TABLE)->eq('project_id', $projectDstId)->eq('name', $swimlane['name'])->exists()) { + $values = array( + 'name' => $swimlane['name'], + 'description' => $swimlane['description'], + 'position' => $swimlane['position'], + 'is_active' => $swimlane['is_active'], + 'project_id' => $projectDstId, + ); + + if (! $this->db->table(self::TABLE)->persist($values)) { + return false; + } } } - $default_swimlane = $this->getDefault($project_from); - $default_swimlane['id'] = $project_to; - - $this->updateDefault($default_swimlane); - return true; } } diff --git a/app/Model/TaskCreationModel.php b/app/Model/TaskCreationModel.php index bd95c1a4..95f62ee5 100644 --- a/app/Model/TaskCreationModel.php +++ b/app/Model/TaskCreationModel.php @@ -62,7 +62,7 @@ class TaskCreationModel extends Base $values = $this->dateParser->convert($values, array('date_started'), true); $this->helper->model->removeFields($values, array('another_task', 'duplicate_multiple_projects')); - $this->helper->model->resetFields($values, array('creator_id', 'owner_id', 'swimlane_id', 'date_due', 'date_started', 'score', 'category_id', 'time_estimated', 'time_spent')); + $this->helper->model->resetFields($values, array('creator_id', 'owner_id', 'date_due', 'date_started', 'score', 'category_id', 'time_estimated', 'time_spent')); if (empty($values['column_id'])) { $values['column_id'] = $this->columnModel->getFirstColumnId($values['project_id']); @@ -80,7 +80,7 @@ class TaskCreationModel extends Base $values['creator_id'] = $this->userSession->getId(); } - $values['swimlane_id'] = empty($values['swimlane_id']) ? 0 : $values['swimlane_id']; + $values['swimlane_id'] = empty($values['swimlane_id']) ? $this->swimlaneModel->getFirstActiveSwimlaneId($values['project_id']) : $values['swimlane_id']; $values['date_creation'] = time(); $values['date_modification'] = $values['date_creation']; $values['date_moved'] = $values['date_creation']; diff --git a/app/Model/TaskDuplicationModel.php b/app/Model/TaskDuplicationModel.php index c9079653..c07ebca0 100644 --- a/app/Model/TaskDuplicationModel.php +++ b/app/Model/TaskDuplicationModel.php @@ -79,11 +79,13 @@ class TaskDuplicationModel extends Base } // Check if the swimlane exists for the destination project - if ($values['swimlane_id'] > 0) { - $values['swimlane_id'] = $this->swimlaneModel->getIdByName( - $values['project_id'], - $this->swimlaneModel->getNameById($values['swimlane_id']) - ); + $values['swimlane_id'] = $this->swimlaneModel->getIdByName( + $values['project_id'], + $this->swimlaneModel->getNameById($values['swimlane_id']) + ); + + if ($values['swimlane_id'] == 0) { + $values['swimlane_id'] = $this->swimlaneModel->getFirstActiveSwimlaneId($values['project_id']); } // Check if the column exists for the destination project diff --git a/app/Model/TaskFinderModel.php b/app/Model/TaskFinderModel.php index e54a613b..b610a371 100644 --- a/app/Model/TaskFinderModel.php +++ b/app/Model/TaskFinderModel.php @@ -142,7 +142,6 @@ class TaskFinderModel extends Base ColumnModel::TABLE.'.title AS column_name', ColumnModel::TABLE.'.position AS column_position', SwimlaneModel::TABLE.'.name AS swimlane_name', - ProjectModel::TABLE.'.default_swimlane', ProjectModel::TABLE.'.name AS project_name' ) ->join(UserModel::TABLE, 'id', 'owner_id', TaskModel::TABLE) @@ -304,15 +303,13 @@ class TaskFinderModel extends Base CategoryModel::TABLE.'.name AS category_name', SwimlaneModel::TABLE.'.name AS swimlane_name', ProjectModel::TABLE.'.name AS project_name', - ProjectModel::TABLE.'.default_swimlane', ColumnModel::TABLE.'.title AS column_title', UserModel::TABLE.'.username AS assignee_username', UserModel::TABLE.'.name AS assignee_name', 'uc.username AS creator_username', 'uc.name AS creator_name', CategoryModel::TABLE.'.description AS category_description', - ColumnModel::TABLE.'.position AS column_position', - ProjectModel::TABLE.'.default_swimlane' + ColumnModel::TABLE.'.position AS column_position' ) ->join(UserModel::TABLE, 'id', 'owner_id', TaskModel::TABLE) ->left(UserModel::TABLE, 'uc', 'id', TaskModel::TABLE, 'creator_id') diff --git a/app/Model/TaskPositionModel.php b/app/Model/TaskPositionModel.php index aeb7edde..8805d57e 100644 --- a/app/Model/TaskPositionModel.php +++ b/app/Model/TaskPositionModel.php @@ -33,6 +33,10 @@ class TaskPositionModel extends Base $task = $this->taskFinderModel->getById($task_id); + if ($swimlane_id == 0) { + $swimlane_id = $task['swimlane_id']; + } + if ($onlyOpen && $task['is_active'] == TaskModel::STATUS_CLOSED) { return true; } diff --git a/app/Model/TaskStatusModel.php b/app/Model/TaskStatusModel.php index dc114698..bb6725ff 100644 --- a/app/Model/TaskStatusModel.php +++ b/app/Model/TaskStatusModel.php @@ -139,6 +139,6 @@ class TaskStatusModel extends Base ->table(TaskModel::TABLE) ->eq('id', $task_id) ->eq('is_active', $status) - ->count() === 1; + ->exists(); } } diff --git a/app/Schema/Migration.php b/app/Schema/Migration.php new file mode 100644 index 00000000..395ac1ad --- /dev/null +++ b/app/Schema/Migration.php @@ -0,0 +1,63 @@ +prepare('INSERT INTO swimlanes (project_id, name, is_active, position) VALUES (?, ?, ?, ?)'); + $rq->execute(array( + $project['id'], + $project['default_swimlane'], + (int) $project['show_default_swimlane'], + $project['show_default_swimlane'] == 1 ? 1 : 0, + )); + + $swimlaneId = get_last_insert_id($pdo); + + // Reorder swimlanes if the default one was active + if ($project['show_default_swimlane']) { + $rq = $pdo->prepare("UPDATE swimlanes SET position=position+1 WHERE project_id=? AND is_active='1' AND id!=?"); + $rq->execute(array( + $project['id'], + $swimlaneId, + )); + } + + // Move all tasks to new swimlane + $rq = $pdo->prepare("UPDATE tasks SET swimlane_id=? WHERE swimlane_id='0' AND project_id=?"); + $rq->execute(array( + $swimlaneId, + $project['id'], + )); + + // Migrate automatic actions + $rq = $pdo->prepare("UPDATE action_has_params SET value=? WHERE id IN (SELECT action_has_params.id FROM action_has_params LEFT JOIN actions ON actions.id=action_has_params.action_id WHERE project_id=? AND name='swimlane_id' AND value='0')"); + $rq->execute(array($swimlaneId, $project['id'])); + } +} + +function get_all_projects(PDO $pdo) +{ + $rq = $pdo->prepare('SELECT * FROM projects'); + $rq->execute(); + return $rq->fetchAll(PDO::FETCH_ASSOC); +} + +function get_last_insert_id(PDO $pdo) +{ + if (DB_DRIVER === 'postgres') { + $rq = $pdo->prepare('SELECT LASTVAL()'); + $rq->execute(); + return $rq->fetchColumn(); + } + + return $pdo->lastInsertId(); +} + diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index ca9f45ad..385f63a3 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -2,11 +2,23 @@ namespace Schema; +require_once __DIR__.'/Migration.php'; + use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 121; +const VERSION = 122; + +function version_122(PDO $pdo) +{ + migrate_default_swimlane($pdo); + + $pdo->exec('ALTER TABLE `projects` DROP COLUMN `default_swimlane`'); + $pdo->exec('ALTER TABLE `projects` DROP COLUMN `show_default_swimlane`'); + $pdo->exec('ALTER TABLE `tasks` MODIFY `swimlane_id` INT(11) NOT NULL;'); + $pdo->exec('ALTER TABLE tasks ADD CONSTRAINT tasks_swimlane_ibfk_1 FOREIGN KEY (swimlane_id) REFERENCES swimlanes(id) ON DELETE CASCADE'); +} function version_121(PDO $pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index cbea908f..cc3d9632 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -2,11 +2,24 @@ namespace Schema; +require_once __DIR__.'/Migration.php'; + use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 100; +const VERSION = 101; + +function version_101(PDO $pdo) +{ + migrate_default_swimlane($pdo); + + $pdo->exec('ALTER TABLE "projects" DROP COLUMN "default_swimlane"'); + $pdo->exec('ALTER TABLE "projects" DROP COLUMN "show_default_swimlane"'); + $pdo->exec('ALTER TABLE "tasks" ALTER COLUMN "swimlane_id" SET NOT NULL'); + $pdo->exec('ALTER TABLE "tasks" ALTER COLUMN "swimlane_id" DROP DEFAULT'); + $pdo->exec('ALTER TABLE "tasks" ADD FOREIGN KEY (swimlane_id) REFERENCES swimlanes ON DELETE CASCADE'); +} function version_100(PDO $pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index a68ed418..2d35b99e 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -2,11 +2,18 @@ namespace Schema; +require_once __DIR__.'/Migration.php'; + use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; use PDO; -const VERSION = 111; +const VERSION = 112; + +function version_112(PDO $pdo) +{ + migrate_default_swimlane($pdo); +} function version_111(PDO $pdo) { diff --git a/app/Template/project_creation/create.php b/app/Template/project_creation/create.php index 171bd17a..3317a61e 100644 --- a/app/Template/project_creation/create.php +++ b/app/Template/project_creation/create.php @@ -25,7 +25,6 @@ form->checkbox('categoryModel', t('Categories'), 1, true) ?> form->checkbox('tagDuplicationModel', t('Tags'), 1, true) ?> form->checkbox('actionModel', t('Actions'), 1, true) ?> - form->checkbox('swimlaneModel', t('Swimlanes'), 1, true) ?> form->checkbox('projectTaskDuplicationModel', t('Tasks'), 1, false) ?> diff --git a/app/Template/project_view/duplicate.php b/app/Template/project_view/duplicate.php index 561378d1..d24a52a0 100644 --- a/app/Template/project_view/duplicate.php +++ b/app/Template/project_view/duplicate.php @@ -17,7 +17,6 @@ form->checkbox('categoryModel', t('Categories'), 1, true) ?> form->checkbox('tagDuplicationModel', t('Tags'), 1, true) ?> form->checkbox('actionModel', t('Actions'), 1, true) ?> - form->checkbox('swimlaneModel', t('Swimlanes'), 1, false) ?> form->checkbox('projectMetadataModel', t('Metadata'), 1, false) ?> form->checkbox('projectTaskDuplicationModel', t('Tasks'), 1, false) ?> diff --git a/app/Template/search/results.php b/app/Template/search/results.php index 8c439a8a..3fbfc314 100644 --- a/app/Template/search/results.php +++ b/app/Template/search/results.php @@ -19,7 +19,7 @@ url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> - text->e($task['swimlane_name'] ?: $task['default_swimlane']) ?> + text->e($task['swimlane_name']) ?> text->e($task['column_name']) ?> diff --git a/app/Template/swimlane/edit_default.php b/app/Template/swimlane/edit_default.php deleted file mode 100644 index a2c3ee73..00000000 --- a/app/Template/swimlane/edit_default.php +++ /dev/null @@ -1,14 +0,0 @@ - -
- form->csrf() ?> - form->hidden('id', $values) ?> - - form->label(t('Name'), 'default_swimlane') ?> - form->text('default_swimlane', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> - - form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $values['show_default_swimlane'] == 1) ?> - - modal->submitButtons() ?> -
diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php index e05b9088..35bbb589 100644 --- a/app/Template/swimlane/index.php +++ b/app/Template/swimlane/index.php @@ -7,21 +7,22 @@ -

+ + +

+ render('swimlane/table', array( 'swimlanes' => $active_swimlanes, - 'project' => $project, - 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 1 ? $default_swimlane : array() + 'project' => $project, )) ?> - +

render('swimlane/table', array( - 'swimlanes' => $inactive_swimlanes, - 'project' => $project, - 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 0 ? $default_swimlane : array(), - 'disable_handler' => true + 'swimlanes' => $inactive_swimlanes, + 'project' => $project, + 'disable_handler' => true, )) ?> diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php index 2d783a00..4f87924d 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -6,33 +6,6 @@ - - - - - text->e($default_swimlane['default_swimlane']) ?> - -  () - - - -