Skip to content

Commit

Permalink
Add quick link assign me in different views
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Jun 7, 2018
1 parent dfea2f2 commit 9d4be20
Show file tree
Hide file tree
Showing 41 changed files with 94 additions and 48 deletions.
39 changes: 37 additions & 2 deletions app/Controller/TaskModificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
*/
class TaskModificationController extends BaseController
{
public function assignToMe()
{
$task = $this->getTask();
$values = ['id' => $task['id'], 'owner_id' => $this->userSession->getId()];

if (! $this->helper->projectRole->canUpdateTask($task)) {
throw new AccessForbiddenException(t('You are not allowed to update tasks assigned to someone else.'));
}

$this->taskModificationModel->update($values);
$this->redirectAfterQuickAction($task);
}

/**
* Set the start date automatically
*
Expand All @@ -22,12 +35,34 @@ class TaskModificationController extends BaseController
public function start()
{
$task = $this->getTask();
$values = array('id' => $task['id'], 'date_started' => time());
$values = ['id' => $task['id'], 'date_started' => time()];

if (! $this->helper->projectRole->canUpdateTask($task)) {
throw new AccessForbiddenException(t('You are not allowed to update tasks assigned to someone else.'));
}

$this->taskModificationModel->update($values);
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', array('project_id' => $task['project_id'], 'task_id' => $task['id'])));
$this->redirectAfterQuickAction($task);
}

protected function redirectAfterQuickAction(array $task)
{
switch ($this->request->getStringParam('redirect')) {
case 'board':
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', ['project_id' => $task['project_id']]));
break;
case 'list':
$this->response->redirect($this->helper->url->to('TaskListController', 'show', ['project_id' => $task['project_id']]));
break;
case 'dashboard':
$this->response->redirect($this->helper->url->to('DashboardController', 'show', [], 'project-tasks-'.$task['project_id']));
break;
case 'dashboard-tasks':
$this->response->redirect($this->helper->url->to('DashboardController', 'tasks', ['user_id' => $this->userSession->getId()]));
break;
default:
$this->response->redirect($this->helper->url->to('TaskViewController', 'show', ['project_id' => $task['project_id'], 'task_id' => $task['id']]));
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Locale/bs_BA/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Uredi opis',
'New internal link' => 'Nova unutrašnja veza',
'Display list of keyboard shortcuts' => 'Prikaži listu prečica na tastaturi',
'Set start date' => 'Postavi početni datum',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Dodaj sliku za moj avatar',
'Remove my image' => 'Ukloni moju sliku',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/ca_ES/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Modifica la descripció',
'New internal link' => 'Nou enllaç intern',
'Display list of keyboard shortcuts' => 'Visualització de la llista de dreceres de teclat',
'Set start date' => 'Comença',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Puja la imatge meu avatar',
'Remove my image' => 'Traieu la meva imatge',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/cs_CZ/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/da_DK/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Redigere beskrivelse',
'New internal link' => 'Ny intern henvisning',
'Display list of keyboard shortcuts' => 'Vise liste over tastaturgenveje',
'Set start date' => 'Angive startdato',
'Avatar' => 'Ikon',
'Upload my avatar image' => 'Overføre ikon billede',
'Remove my image' => 'Fjerne billede',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/de_DE/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Beschreibung bearbeiten',
'New internal link' => 'Neue interne Verbindung',
'Display list of keyboard shortcuts' => 'Liste der Tastaturkürzel anzeigen',
'Set start date' => 'Anfangsdatum setzen',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Mein Avatar Bild hochladen',
'Remove my image' => 'Mein Bild entfernen',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/el_GR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/es_ES/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Editar Descripción',
'New internal link' => 'Nuevo enlace interno',
'Display list of keyboard shortcuts' => 'Mostrar lista de atajos de teclado',
'Set start date' => 'Establecer fecha de inicio',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Subir mi imagen de avatar',
'Remove my image' => 'Eliminar mi imagen',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/fi_FI/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/fr_FR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Modifier la description',
'New internal link' => 'Nouveau lien interne',
'Display list of keyboard shortcuts' => 'Afficher la liste des raccourcis claviers',
'Set start date' => 'Définir la date de début',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Uploader mon image d\'avatar',
'Remove my image' => 'Supprimer mon image',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
'Edit tasks in bulk' => 'Modifier les tâches en masse',
'Choose the properties that you would like to change for the selected tasks.' => 'Choisissez les propriétés que vous souhaitez changer pour les tâches sélectionnées.',
'Configure this project' => 'Configurer ce projet',
'Start now' => 'Débuter maintenant',
);
2 changes: 1 addition & 1 deletion app/Locale/hr_HR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
'Set start date' => 'Postavi početni datum',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/hu_HU/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Leírás szerkesztése',
'New internal link' => 'Új belső hivatkozás',
'Display list of keyboard shortcuts' => 'Gyorsbillentyűk listájának megjelenítése',
'Set start date' => 'Kezdési dátum beállítása',
'Avatar' => 'Avatár',
'Upload my avatar image' => 'Saját avatárkép feltöltése',
'Remove my image' => 'Saját kép eltávolítása',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/id_ID/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Edit deskripsi',
'New internal link' => 'Tautan internal baru',
'Display list of keyboard shortcuts' => 'Tampilkan daftar pintasan keyboard',
'Set start date' => 'Atur tanggal mulai',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Unggah foto avatar saya',
'Remove my image' => 'Hapus foto saya',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/it_IT/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Modifica descrizione',
'New internal link' => 'Nuovo link interno',
'Display list of keyboard shortcuts' => 'Mostra una lista di scorciatoie da tastiera',
'Set start date' => 'Imposta la data di inizio',
// 'Avatar' => '',
'Upload my avatar image' => 'Carica l\'immagine del mio avatar',
'Remove my image' => 'Rimuovi la mia immagine',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/ja_JP/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => '説明を編集',
'New internal link' => '新しい内部リンク',
'Display list of keyboard shortcuts' => 'キーボードショートカットのリストを表示',
'Set start date' => '開始する',
'Avatar' => 'アバター',
'Upload my avatar image' => '自分のアバター画像をアップロード',
'Remove my image' => '画像を削除',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/ko_KR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => '설명 수정',
'New internal link' => '새로운 내부 링크',
'Display list of keyboard shortcuts' => '키보드 숏컷 리스트 보여주기',
'Set start date' => '시작일 설정',
'Avatar' => '아바타',
'Upload my avatar image' => '아바타 이미지 올리기',
'Remove my image' => '이미지 삭제',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/my_MY/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/nb_NO/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/nl_NL/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/pl_PL/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Edytuj opis',
'New internal link' => 'Nowy wewnętrzny link',
'Display list of keyboard shortcuts' => 'Wyświetl skróty klawiszowe',
'Set start date' => 'Ustaw datę rozpoczęcia',
// 'Avatar' => '',
'Upload my avatar image' => 'Prześlij avatar',
'Remove my image' => 'Usuń',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/pt_BR/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Editar a descrição',
'New internal link' => 'Novo link interno',
'Display list of keyboard shortcuts' => 'Ver a lista dos atalhos de teclado',
'Set start date' => 'Definir a data de início',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Enviar a minha imagem de avatar',
'Remove my image' => 'Remover a minha imagem',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/pt_PT/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Editar descrição',
'New internal link' => 'Nova ligação interna',
'Display list of keyboard shortcuts' => 'Mostrar lista de atalhos do teclado',
'Set start date' => 'Definir data de inicio',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Enviar a minha imagem de avatar',
'Remove my image' => 'Remover a minha imagem',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/ro_RO/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Modifică descrierea',
'New internal link' => 'Legătură internă nouă',
'Display list of keyboard shortcuts' => 'Afișează lista de scurtături pe tastatură',
'Set start date' => 'Definește data pornirii',
'Avatar' => 'Avatar',
'Upload my avatar image' => 'Încarcă o imagine de avatar',
'Remove my image' => 'Șterge imaginea mea',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/ru_RU/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
'Edit description' => 'Изменение описания',
'New internal link' => 'Новая внутренняя ссылка',
'Display list of keyboard shortcuts' => 'Показать список клавиатурных сокращений',
'Set start date' => 'Установить дату начала',
'Avatar' => 'Аватар',
'Upload my avatar image' => 'Загрузить моё изображение для аватара',
'Remove my image' => 'Удалить моё изображение',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
2 changes: 1 addition & 1 deletion app/Locale/sr_Latn_RS/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,6 @@
// 'Edit description' => '',
// 'New internal link' => '',
// 'Display list of keyboard shortcuts' => '',
// 'Set start date' => '',
// 'Avatar' => '',
// 'Upload my avatar image' => '',
// 'Remove my image' => '',
Expand Down Expand Up @@ -1383,4 +1382,5 @@
// 'Edit tasks in bulk' => '',
// 'Choose the properties that you would like to change for the selected tasks.' => '',
// 'Configure this project' => '',
// 'Start now' => '',
);
Loading

0 comments on commit 9d4be20

Please sign in to comment.