diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-10-20 14:47:04 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-10-20 14:47:04 -0700 |
commit | ed98f95cfa4a31609b98fc8354b62a8895f68cda (patch) | |
tree | 48f213463e2683a1848228631a381daa86937f14 /app | |
parent | f1ef49823c38227cab4f28a0a2378556893850c2 (diff) |
Add bulk subtasks creation
Diffstat (limited to 'app')
31 files changed, 143 insertions, 73 deletions
diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index b9bb0934..d5db9b2e 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -67,29 +67,50 @@ class SubtaskController extends BaseController $task = $this->getTask(); $values = $this->request->getValues(); $values['task_id'] = $task['id']; + $subtasks = explode("\r\n", isset($values['title']) ? $values['title'] : ''); + $subtasksAdded = 0; - list($valid, $errors) = $this->subtaskValidator->validateCreation($values); + foreach ($subtasks as $subtask) { + $subtask = trim($subtask); - if ($valid) { - if ($this->subtaskModel->create($values) !== false) { - $this->flash->success(t('Sub-task added successfully.')); - } else { - $this->flash->failure(t('Unable to create your sub-task.')); - } + if (! empty($subtask)) { + $subtaskValues = $values; + $subtaskValues['title'] = $subtask; + + list($valid, $errors) = $this->subtaskValidator->validateCreation($subtaskValues); + + if (! $valid) { + $this->create($values, $errors); + return false; + } - if (isset($values['another_subtask']) && $values['another_subtask'] == 1) { - return $this->create(array( - 'project_id' => $task['project_id'], - 'task_id' => $task['id'], - 'user_id' => $values['user_id'], - 'another_subtask' => 1 - )); + if (! $this->subtaskModel->create($subtaskValues)) { + $this->flash->failure(t('Unable to create your sub-task.')); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']), 'subtasks'), true); + return false; + } + + $subtasksAdded++; } + } - return $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']), 'subtasks'), true); + if (isset($values['another_subtask']) && $values['another_subtask'] == 1) { + return $this->create(array( + 'project_id' => $task['project_id'], + 'task_id' => $task['id'], + 'user_id' => $values['user_id'], + 'another_subtask' => 1, + 'subtasks_added' => $subtasksAdded, + )); + } else if ($subtasksAdded > 0) { + if ($subtasksAdded === 1) { + $this->flash->success(t('Subtask added successfully.')); + } else { + $this->flash->success(t('%d subtasks added successfully.', $subtasksAdded)); + } } - return $this->create($values, $errors); + $this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id']), 'subtasks'), true); } /** diff --git a/app/Helper/SubtaskHelper.php b/app/Helper/SubtaskHelper.php index b11e3b04..67875a63 100644 --- a/app/Helper/SubtaskHelper.php +++ b/app/Helper/SubtaskHelper.php @@ -92,6 +92,17 @@ class SubtaskHelper extends Base return $html; } + public function renderBulkTitleField(array $values, array $errors = array(), array $attributes = array()) + { + $attributes = array_merge(array('tabindex="1"', 'required'), $attributes); + + $html = $this->helper->form->label(t('Title'), 'title'); + $html .= $this->helper->form->textarea('title', $values, $errors, $attributes); + $html .= '<p class="form-help">'.t('Enter one subtask by line.').'</p>'; + + return $html; + } + public function renderTitleField(array $values, array $errors = array(), array $attributes = array()) { $attributes = array_merge(array('tabindex="1"', 'required', 'maxlength="255"'), $attributes); diff --git a/app/Locale/bs_BA/translations.php b/app/Locale/bs_BA/translations.php index f16d2f2b..4c5461e6 100644 --- a/app/Locale/bs_BA/translations.php +++ b/app/Locale/bs_BA/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Pod-zadatak uspješno ažuriran.', 'Unable to update your sub-task.' => 'Nemoguće ažurirati pod-zadatak.', 'Unable to create your sub-task.' => 'Nemoguće dodati pod-zadatak.', - 'Sub-task added successfully.' => 'Pod-zadatak uspješno dodan.', 'Maximum size: ' => 'Maksimalna veličina: ', 'Display another project' => 'Prikaži drugi projekat', 'Created by %s' => 'Kreirao %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Pregled', 'Write' => 'Piši', 'Write your text in Markdown' => 'Upiši tekst u Markdown', - 'New External Task: %s' => 'Novi vanjski zadatak: %s', 'No personal API access token registered.' => 'Nema registrovanog ličnog pristupnog API tokena', 'Your personal API access token is "%s"' => 'Tvoj lični pristupni API token je: "%s"', 'Remove your token' => 'Ukloni svoj token', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/ca_ES/translations.php b/app/Locale/ca_ES/translations.php index ad3c7ccb..b109b894 100644 --- a/app/Locale/ca_ES/translations.php +++ b/app/Locale/ca_ES/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Subtasca actualitzat correctament.', 'Unable to update your sub-task.' => 'No es pot actualitzar el seu sub-tasques.', 'Unable to create your sub-task.' => 'No es pot crear el sub-tasques.', - 'Sub-task added successfully.' => 'Subtasca afegit correctament.', 'Maximum size: ' => 'Mida màxima: ', 'Display another project' => 'Mostra un altre projecte', 'Created by %s' => 'Creat per %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Vista prèvia', 'Write' => 'escriure', 'Write your text in Markdown' => 'Escriure el text en Markdown', - 'New External Task: %s' => 'Nova tasca externa: %s', 'No personal API access token registered.' => 'Sense accés a l\'API personals símbol registrat.', // 'Your personal API access token is "%s"' => '', 'Remove your token' => 'Traieu el testimoni', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/cs_CZ/translations.php b/app/Locale/cs_CZ/translations.php index 45d6d621..bef1a201 100644 --- a/app/Locale/cs_CZ/translations.php +++ b/app/Locale/cs_CZ/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Dílčí úkol byl aktualizován.', 'Unable to update your sub-task.' => 'Nelze aktualizovat dílčí úkol.', 'Unable to create your sub-task.' => 'Nelze vytvořit dílčí úkol.', - 'Sub-task added successfully.' => 'Dílčí úkol byl úspěšně přidán.', 'Maximum size: ' => 'Maximální velikost: ', 'Display another project' => 'Zobrazit jiný projekt', 'Created by %s' => 'Vytvořeno uživatelem %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 83d81455..cc2ffc01 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Under-opgaven er opdateret.', 'Unable to update your sub-task.' => 'Under-opgaven kunne ikke opdateres.', 'Unable to create your sub-task.' => 'Under-opgaven kunne ikke oprettes.', - 'Sub-task added successfully.' => 'Under-opgaven er tilføjet.', 'Maximum size: ' => 'Maksimum størrelse: ', 'Display another project' => 'Vis et andet projekt...', 'Created by %s' => 'Oprettet af %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Forhåndsvisning', 'Write' => 'Skriv', 'Write your text in Markdown' => 'Skriv din tekst i Markdown', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index b93e706b..964e05d2 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Teilaufgabe erfolgreich aktualisiert.', 'Unable to update your sub-task.' => 'Aktualisieren der Teilaufgabe nicht möglich.', 'Unable to create your sub-task.' => 'Erstellen der Teilaufgabe nicht möglich.', - 'Sub-task added successfully.' => 'Teilaufgabe erfolgreich angelegt.', 'Maximum size: ' => 'Maximalgröße: ', 'Display another project' => 'Zu Projekt wechseln', 'Created by %s' => 'Erstellt durch %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Vorschau', 'Write' => 'Schreiben', 'Write your text in Markdown' => 'Schreiben Sie Ihren Text in Markdown', - 'New External Task: %s' => 'Neue externe Aufgabe: %s', 'No personal API access token registered.' => 'Keine persönlichen API-Zugriffsinformationen registriert', 'Your personal API access token is "%s"' => 'Ihre persönlichen API-Zugriffsinformationen: "%s"', 'Remove your token' => 'Ihre Zugriffsinformationen entfernen', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/el_GR/translations.php b/app/Locale/el_GR/translations.php index 2351a506..0e9bea51 100644 --- a/app/Locale/el_GR/translations.php +++ b/app/Locale/el_GR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Η υπο-εργασία ενημερώθηκε με επιτυχία.', 'Unable to update your sub-task.' => 'Αδύνατο να ενημερωθεί η υπο-εργασία.', 'Unable to create your sub-task.' => 'Αδύνατο να δημιουργηθεί η υπο-εργασία.', - 'Sub-task added successfully.' => 'Η υπο-εργασία προστέθηκε με επιτυχία.', 'Maximum size: ' => 'Μέγιστο μέγεθος : ', 'Display another project' => 'Εμφάνιση άλλου έργου', 'Created by %s' => 'Δημιουργήθηκε από %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 10364e6b..b3ef338d 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Sub-tarea actualizada correctamente.', 'Unable to update your sub-task.' => 'No pude actualizar tu subtarea.', 'Unable to create your sub-task.' => 'No pude crear tu subtarea.', - 'Sub-task added successfully.' => 'Sub-tarea añadida correctamente.', 'Maximum size: ' => 'Tamaño máximo', 'Display another project' => 'Mostrar otro proyecto', 'Created by %s' => 'Creado por %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Previsualizar', 'Write' => 'Escribir', 'Write your text in Markdown' => 'Redacta el texto en Markdown', - 'New External Task: %s' => 'Nueva tarea externa: %s', 'No personal API access token registered.' => 'No se ha registrado ningún token de acceso a API personal.', 'Your personal API access token is "%s"' => 'Su token de acceso a la API personal es "%s"', 'Remove your token' => 'Elimine su token', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index c7abdfd4..9607a8f7 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Alitehtävä päivitettiin onnistuneesti.', 'Unable to update your sub-task.' => 'Alitehtävän päivitys epäonnistui.', 'Unable to create your sub-task.' => 'Alitehtävän luonti epäonnistui.', - 'Sub-task added successfully.' => 'Alitehtävä luotiin onnistuneesti.', 'Maximum size: ' => 'Maksimikoko: ', 'Display another project' => 'Näytä toinen projekti', 'Created by %s' => 'Luonut: %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 30d3aa49..12161219 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Sous-tâche mise à jour avec succès.', 'Unable to update your sub-task.' => 'Impossible de mettre à jour votre sous-tâche.', 'Unable to create your sub-task.' => 'Impossible de créer votre sous-tâche.', - 'Sub-task added successfully.' => 'Sous-tâche ajoutée avec succès.', 'Maximum size: ' => 'Taille maximum : ', 'Display another project' => 'Afficher un autre projet', 'Created by %s' => 'Créé par %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Aperçu', 'Write' => 'Écrire', 'Write your text in Markdown' => 'Écrivez votre texte en Markdown', - 'New External Task: %s' => 'Nouvelle tâche externe : %s', 'No personal API access token registered.' => 'Aucun jeton d\'accès personnel à l\'API enregistré.', 'Your personal API access token is "%s"' => 'Votre jeton d\'accès personnel à l\'API est « %s »', 'Remove your token' => 'Supprimer votre jeton', @@ -1344,4 +1342,7 @@ return array( 'Subtask not started' => 'Sous-tâche pas encore commencé', 'Subtask currently in progress' => 'Sous-tâche actuellement en progrès', 'Subtask completed' => 'Sous-tâche terminée', + 'Subtask added successfully.' => 'Sous-tâche ajoutée avec succès.', + '%d subtasks added successfully.' => '%d sous-tâches ajoutées avec succès.', + 'Enter one subtask by line.' => 'Entrez une sous-tâche par ligne.', ); diff --git a/app/Locale/hr_HR/translations.php b/app/Locale/hr_HR/translations.php index 60cde5ac..5647603a 100644 --- a/app/Locale/hr_HR/translations.php +++ b/app/Locale/hr_HR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Pod-zadatak je uspješno dopunjen.', 'Unable to update your sub-task.' => 'Nije moguće dopuniti ovaj pod-zadatak.', 'Unable to create your sub-task.' => 'Nije moguće krerati ovaj pod-zadatak.', - 'Sub-task added successfully.' => 'Pod-zadatak uspješno dodan', 'Maximum size: ' => 'Maksimalna veličina: ', 'Display another project' => 'Prikaži drugi projekt', 'Created by %s' => 'Kreirao %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', 'No personal API access token registered.' => 'Nije zabilježen niti jedan pristupni token.', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 050bb043..ac33e389 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Részfeladat sikeresen frissítve.', 'Unable to update your sub-task.' => 'Részfeladat frissítése nem lehetséges.', 'Unable to create your sub-task.' => 'Részfeladat létrehozása nem lehetséges.', - 'Sub-task added successfully.' => 'Részfeladat sikeresen létrehozva.', 'Maximum size: ' => 'Maximális méret: ', 'Display another project' => 'Másik projekt megjelenítése', 'Created by %s' => 'Készítette: %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Előnézet', 'Write' => 'Írás', 'Write your text in Markdown' => 'Markdown-ban írja a szöveget', - 'New External Task: %s' => 'Új, külső feladat: %s', 'No personal API access token registered.' => 'Nincs személyes API access token regisztrálva.', 'Your personal API access token is "%s"' => 'Személyes API access token: "%s"', 'Remove your token' => 'Személyes token eltávolítása', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/id_ID/translations.php b/app/Locale/id_ID/translations.php index a0473eb6..62e6ca04 100644 --- a/app/Locale/id_ID/translations.php +++ b/app/Locale/id_ID/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Sub-tugas berhasil diperbarui.', 'Unable to update your sub-task.' => 'Tidak dapat memperbarui sub-tugas Anda.', 'Unable to create your sub-task.' => 'Tidak dapat membuat sub-tugas Anda.', - 'Sub-task added successfully.' => 'Sub-tugas berhasil dibuat.', 'Maximum size: ' => 'Ukuran maksimum: ', 'Display another project' => 'Lihat proyek lain', 'Created by %s' => 'Dibuat oleh %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Pratinjau', 'Write' => 'Tulis', 'Write your text in Markdown' => 'Tuliskan teks Anda di Markdown', - 'New External Task: %s' => 'Tugas Eksternal Baru: %s', 'No personal API access token registered.' => 'Tidak ada token akses API personal yang terdaftar.', 'Your personal API access token is "%s"' => 'Token akses API personal Anda adalah "%s"', 'Remove your token' => 'Hapus token Anda', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index a8eaad96..9f045d8e 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Sotto-task aggiornato con successo.', 'Unable to update your sub-task.' => 'Impossibile aggiornare il tuo sotto-task.', 'Unable to create your sub-task.' => 'Impossibile creare il tuo sotto-task.', - 'Sub-task added successfully.' => 'Sotto-task aggiunto con successo.', 'Maximum size: ' => 'Dimensioni massime: ', 'Display another project' => 'Mostra un altro progetto', 'Created by %s' => 'Creato da %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 8d85fa1d..f25f25fa 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'サブタスクを更新しました', 'Unable to update your sub-task.' => 'サブタスクの更新に失敗しました', 'Unable to create your sub-task.' => 'サブタスクの追加に失敗しました', - 'Sub-task added successfully.' => 'サブタスクを追加しました', 'Maximum size: ' => '最大:', 'Display another project' => '別のプロジェクトを表示', 'Created by %s' => '%s が作成', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'プレビュー', 'Write' => '書込み', 'Write your text in Markdown' => 'Markdownで入力', - 'New External Task: %s' => '新しい外部タスク:%s', 'No personal API access token registered.' => '個人APIアクセストークンは登録されていません', 'Your personal API access token is "%s"' => 'あなたのパーソナルAPIアクセストークン "%s"', 'Remove your token' => 'あなたのトークンを削除する', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/ko_KR/translations.php b/app/Locale/ko_KR/translations.php index 082deba5..d1aec37c 100644 --- a/app/Locale/ko_KR/translations.php +++ b/app/Locale/ko_KR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => '서브 할일을 갱신했습니다.', 'Unable to update your sub-task.' => '서브 할일의 경신에 실패했습니다.', 'Unable to create your sub-task.' => '서브 할일의 추가에 실패했습니다.', - 'Sub-task added successfully.' => '서브 할일을 추가했습니다.', 'Maximum size: ' => '최대: ', 'Display another project' => '프로젝트 보기', 'Created by %s' => '작성자 %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/my_MY/translations.php b/app/Locale/my_MY/translations.php index e275d15c..962943e2 100644 --- a/app/Locale/my_MY/translations.php +++ b/app/Locale/my_MY/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Sub-tugas berhasil diperbaharui.', 'Unable to update your sub-task.' => 'Tidak dapat memperbaharui sub-tugas anda.', 'Unable to create your sub-task.' => 'Tidak dapat membuat sub-tugas anda.', - 'Sub-task added successfully.' => 'Sub-tugas berhasil dibuat.', 'Maximum size: ' => 'Ukuran maksimum: ', 'Display another project' => 'Lihat projek lain', 'Created by %s' => 'Dibuat oleh %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/nb_NO/translations.php b/app/Locale/nb_NO/translations.php index 46ac4787..9802daf1 100644 --- a/app/Locale/nb_NO/translations.php +++ b/app/Locale/nb_NO/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Deloppgaven er opdateret.', 'Unable to update your sub-task.' => 'Deloppgaven kunne ikke opdateres.', 'Unable to create your sub-task.' => 'Deloppgaven kunne ikke oprettes.', - 'Sub-task added successfully.' => 'Deloppgaven er lagt til.', 'Maximum size: ' => 'Maksimum størrelse: ', 'Display another project' => 'Vis annet prosjekt...', 'Created by %s' => 'Opprettet av %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/nl_NL/translations.php b/app/Locale/nl_NL/translations.php index bade288f..485a041d 100644 --- a/app/Locale/nl_NL/translations.php +++ b/app/Locale/nl_NL/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Subtaak succesvol aangepast.', 'Unable to update your sub-task.' => 'Subtaak aanpassen niet gelukt.', 'Unable to create your sub-task.' => 'Subtaak aanmaken niet gelukt.', - 'Sub-task added successfully.' => 'Subtaak succesvol aangemaakt.', 'Maximum size: ' => 'Maximale grootte : ', 'Display another project' => 'Een ander project weergeven', 'Created by %s' => 'Aangemaakt door %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 5993bc19..e2a2be6f 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Pod-zadanie zaktualizowane pomyślnie.', 'Unable to update your sub-task.' => 'Nie można zaktualizować tego pod-zadania.', 'Unable to create your sub-task.' => 'Nie można utworzyć tego pod-zadania.', - 'Sub-task added successfully.' => 'Pod-zadanie utworzone pomyślnie', 'Maximum size: ' => 'Maksymalny rozmiar: ', 'Display another project' => 'Wyświetl inny projekt', 'Created by %s' => 'Utworzone przez %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 2d482325..74cbed04 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Subtarefa atualizada com sucesso.', 'Unable to update your sub-task.' => 'Não foi possível atualizar a sua subtarefa.', 'Unable to create your sub-task.' => 'Não é possível criar a sua subtarefa.', - 'Sub-task added successfully.' => 'Subtarefa adicionada com sucesso.', 'Maximum size: ' => 'Tamanho máximo: ', 'Display another project' => 'Exibir outro projeto', 'Created by %s' => 'Criado por %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Pré-visualizar', 'Write' => 'Escrever', 'Write your text in Markdown' => 'Escrever seu texto em Markdown', - 'New External Task: %s' => 'Nova Tarefa Externa: %s', 'No personal API access token registered.' => 'Nenhum token de acesso pessoal à API registrado.', 'Your personal API access token is "%s"' => 'Seu token de acesso pessoal à API é "%s"', 'Remove your token' => 'Remover seu token', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/pt_PT/translations.php b/app/Locale/pt_PT/translations.php index a12aa9a2..7448be5b 100644 --- a/app/Locale/pt_PT/translations.php +++ b/app/Locale/pt_PT/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Subtarefa atualizada com sucesso.', 'Unable to update your sub-task.' => 'Não foi possível atualizar a sua subtarefa.', 'Unable to create your sub-task.' => 'Não é possível criar a sua subtarefa.', - 'Sub-task added successfully.' => 'Subtarefa adicionada com sucesso.', 'Maximum size: ' => 'Tamanho máximo: ', 'Display another project' => 'Mostrar outro projeto', 'Created by %s' => 'Criado por %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Pré-Visualizar', 'Write' => 'Escrever', 'Write your text in Markdown' => 'Escreva o seu texto em Markdown', - 'New External Task: %s' => 'Nova Tarefa Externa: %s', 'No personal API access token registered.' => 'Nenhum token pessoal de acesso ao API ', 'Your personal API access token is "%s"' => 'O seu token de acesso pessoal ao API é "%s"', 'Remove your token' => 'Remover o seu token', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 15385dd2..aad9bb48 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Подзадача обновлена.', 'Unable to update your sub-task.' => 'Не удалось обновить подзадачу.', 'Unable to create your sub-task.' => 'Не удалось создать подзадачу.', - 'Sub-task added successfully.' => 'Подзадача добавлена.', 'Maximum size: ' => 'Максимальный размер: ', 'Display another project' => 'Показать другой проект', 'Created by %s' => 'Создано %s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Предпросмотр', 'Write' => 'Редактирование', 'Write your text in Markdown' => 'Добавьте Ваше описание в формате Markdown', - 'New External Task: %s' => 'Новая внешняя задача: %s', 'No personal API access token registered.' => 'Персональные токены доступа к API не созданы.', 'Your personal API access token is "%s"' => 'Ваш персональный токен доступа к API: "%s"', 'Remove your token' => 'Удалить токен', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/sr_Latn_RS/translations.php b/app/Locale/sr_Latn_RS/translations.php index 64c8551e..f9c2e5f4 100644 --- a/app/Locale/sr_Latn_RS/translations.php +++ b/app/Locale/sr_Latn_RS/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Pod-zadatak zaktualizowane pomyślnie.', 'Unable to update your sub-task.' => 'Nie można zaktalizować tego pod-zadania.', 'Unable to create your sub-task.' => 'Nie można utworzyć tego pod-zadania.', - 'Sub-task added successfully.' => 'Pod-zadatak utworzone pomyślnie', 'Maximum size: ' => 'Maksimalna veličina: ', 'Display another project' => 'Prikaži drugi projekat', 'Created by %s' => 'Kreirao %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index b585b09d..11c45345 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Deluppgiften har uppdaterats.', 'Unable to update your sub-task.' => 'Kunde inte uppdatera din deluppgift.', 'Unable to create your sub-task.' => 'Kunde inte skapa din deluppgift.', - 'Sub-task added successfully.' => 'Deluppgiften har lagts till.', 'Maximum size: ' => 'Maxstorlek: ', 'Display another project' => 'Visa ett annat projekt', 'Created by %s' => 'Skapad av %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index a87c1cb6..a092657c 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'ปรับปรุงงานย่อย่่เรียบร้อยแล้ว', 'Unable to update your sub-task.' => 'ไม่สามารถปรับปรุงานย่อยได้', 'Unable to create your sub-task.' => 'ไม่สามารถสร้างงานย่อยได้', - 'Sub-task added successfully.' => 'เพิ่มงานย่อยเรียบร้อยแล้ว', 'Maximum size: ' => 'ขนาดไฟล์สูงสุด:', 'Display another project' => 'แสดงโปรเจคอื่น', 'Created by %s' => 'สร้างโดย %s', @@ -1207,7 +1206,6 @@ return array( // 'Preview' => '', // 'Write' => '', // 'Write your text in Markdown' => '', - // 'New External Task: %s' => '', // 'No personal API access token registered.' => '', // 'Your personal API access token is "%s"' => '', // 'Remove your token' => '', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/tr_TR/translations.php b/app/Locale/tr_TR/translations.php index fca0d0c0..fb44d346 100644 --- a/app/Locale/tr_TR/translations.php +++ b/app/Locale/tr_TR/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Alt görev güncellendi.', 'Unable to update your sub-task.' => 'Alt görev güncellenemiyor.', 'Unable to create your sub-task.' => 'Alt görev oluşturulamadı.', - 'Sub-task added successfully.' => 'Alt görev başarıyla eklendi.', 'Maximum size: ' => 'Maksimum boyutu', 'Display another project' => 'Başka bir proje göster', 'Created by %s' => '%s tarafından oluşturuldu', @@ -1207,7 +1206,6 @@ return array( 'Preview' => 'Öngörünüm', 'Write' => 'Yaz', 'Write your text in Markdown' => 'Metninizi Markdown a yazın', - 'New External Task: %s' => 'Yeni Harici Görev: %s', 'No personal API access token registered.' => 'Kişisel API erişim anahtarınız kaydedilmedi.', 'Your personal API access token is "%s"' => 'Kişisel API erişim anahtarınız "%s"', 'Remove your token' => 'Anahtarı kaldır', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/vi_VN/translations.php b/app/Locale/vi_VN/translations.php index 3749a288..cd3d6aea 100644 --- a/app/Locale/vi_VN/translations.php +++ b/app/Locale/vi_VN/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => 'Tiểu nhiệm vụ được cập nhật thành công.', 'Unable to update your sub-task.' => 'Không thể cập nhật tiểu nhiệm vụ của bạn.', 'Unable to create your sub-task.' => 'Không thể tạo ra nhiệm vụ phụ của bạn.', - 'Sub-task added successfully.' => 'Thêm nhiệm vụ thành công.', 'Maximum size: ' => 'Kích thước tối đa: ', 'Display another project' => 'Hiển thị một dự án khác', 'Created by %s' => 'Đã tạo bởi %s', @@ -1213,7 +1212,6 @@ return array( 'Preview' => 'Xem trước', 'Write' => 'Viết', 'Write your text in Markdown' => 'Viết văn bản của bạn trong Markdown', - 'New External Task: %s' => 'Nhiệm vụ bên ngoài mới: %s', 'No personal API access token registered.' => 'Không có đăng nhập truy cập API cá nhân.', 'Your personal API access token is "%s"' => 'Mã thông báo truy cập API cá nhân của bạn là "%s"', 'Remove your token' => 'Hủy bỏ mã thông báo của bạn', @@ -1350,4 +1348,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index 0c9e0356..6e4523b1 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -273,7 +273,6 @@ return array( 'Sub-task updated successfully.' => '成功创建子任务', 'Unable to update your sub-task.' => '无法更新子任务', 'Unable to create your sub-task.' => '无法创建子任务', - 'Sub-task added successfully.' => '成功添加子任务', 'Maximum size: ' => '大小上限:', 'Display another project' => '显示其它项目', 'Created by %s' => '创建者:%s', @@ -1207,7 +1206,6 @@ return array( 'Preview' => '预览', 'Write' => '写入', 'Write your text in Markdown' => '用markdown格式写入文本', - 'New External Task: %s' => '新的外部任务:%s', 'No personal API access token registered.' => '没有API access token 注册。', 'Your personal API access token is "%s"' => '你的API access token 是 “%s”', 'Remove your token' => '移除token', @@ -1344,4 +1342,7 @@ return array( // 'Subtask not started' => '', // 'Subtask currently in progress' => '', // 'Subtask completed' => '', + // 'Subtask added successfully.' => '', + // '%d subtasks added successfully.' => '', + // 'Enter one subtask by line.' => '', ); diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index bbb64005..1ed36d47 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -2,10 +2,20 @@ <h2><?= t('Add a sub-task') ?></h2> </div> +<?php if (isset($values['subtasks_added']) && $values['subtasks_added'] > 0): ?> + <p class="alert alert-success"> + <?php if ($values['subtasks_added'] == 1): ?> + <?= t('Subtask added successfully.') ?> + <?php else: ?> + <?= t('%d subtasks added successfully.', $values['subtasks_added']) ?> + <?php endif ?> + </p> +<?php endif ?> + <form method="post" action="<?= $this->url->href('SubtaskController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> - <?= $this->subtask->renderTitleField($values, $errors, array('autofocus')) ?> + <?= $this->subtask->renderBulkTitleField($values, $errors, array('autofocus')) ?> <?= $this->subtask->renderAssigneeField($users_list, $values, $errors) ?> <?= $this->subtask->renderTimeEstimatedField($values, $errors) ?> |