From 1c40fb09e97ff643c80e9b96106d891e6fdbde1b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 23 Feb 2018 21:50:57 +0000 Subject: [PATCH] Work in progress on roles. Implemented role delete. --- WEB-INF/lib/ttRoleHelper.class.php | 34 +++++++++++++++ WEB-INF/lib/ttTaskHelper.class.php | 4 +- WEB-INF/resources/ca.lang.php | 6 +++ WEB-INF/resources/cs.lang.php | 4 ++ WEB-INF/resources/da.lang.php | 5 +++ WEB-INF/resources/de.lang.php | 5 +++ WEB-INF/resources/en.lang.php | 4 ++ WEB-INF/resources/es.lang.php | 5 +++ WEB-INF/resources/et.lang.php | 5 +++ WEB-INF/resources/fa.lang.php | 5 +++ WEB-INF/resources/fi.lang.php | 5 +++ WEB-INF/resources/fr.lang.php | 5 +++ WEB-INF/resources/he.lang.php | 5 +++ WEB-INF/resources/hu.lang.php | 4 ++ WEB-INF/resources/it.lang.php | 5 +++ WEB-INF/resources/ja.lang.php | 5 +++ WEB-INF/resources/ko.lang.php | 5 +++ WEB-INF/resources/nl.lang.php | 5 +++ WEB-INF/resources/no.lang.php | 5 +++ WEB-INF/resources/pl.lang.php | 5 +++ WEB-INF/resources/pt-br.lang.php | 5 +++ WEB-INF/resources/pt.lang.php | 5 +++ WEB-INF/resources/ro.lang.php | 5 +++ WEB-INF/resources/ru.lang.php | 11 +++-- WEB-INF/resources/sk.lang.php | 5 +++ WEB-INF/resources/sl.lang.php | 4 ++ WEB-INF/resources/sr.lang.php | 5 +++ WEB-INF/resources/sv.lang.php | 5 +++ WEB-INF/resources/tr.lang.php | 5 +++ WEB-INF/resources/zh-cn.lang.php | 5 +++ WEB-INF/resources/zh-tw.lang.php | 5 +++ WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/role_delete.tpl | 20 +++++++++ mobile/task_delete.php | 4 +- mobile/task_edit.php | 2 +- role_delete.php | 69 ++++++++++++++++++++++++++++++ roles.php | 2 +- task_delete.php | 4 +- task_edit.php | 2 +- 39 files changed, 277 insertions(+), 14 deletions(-) create mode 100644 WEB-INF/templates/role_delete.tpl create mode 100644 role_delete.php diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 9abef9df..62d2bafe 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -28,6 +28,40 @@ // The ttRoleHelper is a class to help with custom group roles. class ttRoleHelper { + + // get - gets details of a role identified by its id. + static function get($id) + { + global $user; + + $mdb2 = getConnection(); + + $sql = "select id, name, description, rank, rights, status from tt_roles + where id = $id and team_id = $user->team_id and (status = 0 or status = 1)"; + $res = $mdb2->query($sql); + + if (!is_a($res, 'PEAR_Error')) { + $val = $res->fetchRow(); + if ($val['id'] != '') { + return $val; + } else + return false; + } + return false; + } + + // delete - marks the role as deleted. + static function delete($role_id) { + global $user; + + $mdb2 = getConnection(); + + // Mark the task as deleted. + $sql = "update tt_roles set status = NULL where id = $role_id and team_id = $user->team_id"; + $affected = $mdb2->exec($sql); + return (!is_a($affected, 'PEAR_Error')); + } + // insert - inserts an entry into tt_roles table. static function insert($fields) { diff --git a/WEB-INF/lib/ttTaskHelper.class.php b/WEB-INF/lib/ttTaskHelper.class.php index b398228b..d238bfbc 100644 --- a/WEB-INF/lib/ttTaskHelper.class.php +++ b/WEB-INF/lib/ttTaskHelper.class.php @@ -29,8 +29,8 @@ // Class ttTaskHelper is used to help with task related operations. class ttTaskHelper { - // getTask - gets details of the task identified by its id. - static function getTask($id) + // get - gets details of a task identified by its id. + static function get($id) { global $user; diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 6486845f..3ea8edcf 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -273,6 +273,7 @@ $i18n_key_words = array( 'title.add_project' => 'Agregant projecte', 'title.edit_project' => 'Modificant projecte', 'title.delete_project' => 'Eliminant projecte', +// TODO: translate the following. // 'title.tasks' => 'Tasks', // 'title.add_task' => 'Adding Task', // 'title.edit_task' => 'Editing Task', @@ -281,6 +282,11 @@ $i18n_key_words = array( 'title.add_user' => 'Agregant usuari', 'title.edit_user' => 'Modificant usuari', 'title.delete_user' => 'Eliminant usuari', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clients', 'title.add_client' => 'Agregar client', 'title.edit_client' => 'Modificar client', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index fbe11d68..e7e7318b 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -294,6 +294,10 @@ $i18n_key_words = array( // 'title.edit_user' => 'Editing User', 'title.delete_user' => 'Smazat uživatele', // TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Zákazníci', 'title.add_client' => 'Přidat zákazníka', 'title.edit_client' => 'Upravit zákazníka', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index d997da67..177b2d14 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -248,6 +248,11 @@ $i18n_key_words = array( 'title.add_user' => 'Tilføj Bruger', 'title.edit_user' => 'Redigér Bruger', 'title.delete_user' => 'Slet Bruger', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klienter', 'title.add_client' => 'Tilføj Klient', 'title.edit_client' => 'Redigér Klient', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 9ab421be..ea9460e6 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -240,6 +240,11 @@ $i18n_key_words = array( 'title.add_user' => 'Benutzerkonto erstellen', 'title.edit_user' => 'Benutzerdaten bearbeiten', 'title.delete_user' => 'Benutzer löschen', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Kunden', 'title.add_client' => 'Kunden hinzufügen', 'title.edit_client' => 'Kunden bearbeiten', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index f5a1be1d..6ddf977b 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -242,6 +242,10 @@ $i18n_key_words = array( 'title.add_user' => 'Adding User', 'title.edit_user' => 'Editing User', 'title.delete_user' => 'Deleting User', +'title.roles' => 'Roles', +'title.add_role' => 'Adding Role', +'title.edit_role' => 'Editing Role', +'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clients', 'title.add_client' => 'Adding Client', 'title.edit_client' => 'Editing Client', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 5ab1ca4f..069527db 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -281,6 +281,11 @@ $i18n_key_words = array( 'title.add_user' => 'Creando usuario', 'title.edit_user' => 'Modificando usuario', 'title.delete_user' => 'Eliminando usuario', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clientes', 'title.add_client' => 'Agregar cliente', 'title.edit_client' => 'Modificando cliente', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 5d0479e1..01aefb22 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -288,6 +288,11 @@ $i18n_key_words = array( 'title.add_user' => 'Kasutaja lisamine', // TODO: is this correct? 'title.edit_user' => 'Kasutaja muutmine', 'title.delete_user' => 'Kasutaja kustutamine', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Kliendid', 'title.add_client' => 'Lisa klient', 'title.edit_client' => 'Muuda klienti', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 193d74d7..8b023751 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -258,6 +258,11 @@ $i18n_key_words = array( 'title.add_user' => 'درج کاربر', 'title.edit_user' => 'ویرایش کاربر', 'title.delete_user' => 'حذف کاربر', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'مشتریان', 'title.add_client' => 'درج مشتری', 'title.edit_client' => 'ویرایش مشتری', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 776da59c..68e953aa 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -247,6 +247,11 @@ $i18n_key_words = array( 'title.add_user' => 'Käyttäjän lisäys', 'title.edit_user' => 'Käyttäjän muokkaus', 'title.delete_user' => 'Käyttäjän poisto', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Asiakkaat', 'title.add_client' => 'Asiakkaan lisäys', 'title.edit_client' => 'Asiakkaan muokkaus', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index a127c519..e22f856d 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -242,6 +242,11 @@ $i18n_key_words = array( 'title.add_user' => 'Création d\\\'un utilisateur', 'title.edit_user' => 'Modification d\\\'un utilisateur', 'title.delete_user' => 'Suppression d\\\'un utilisateur', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clients', 'title.add_client' => 'Ajout d\\\'un client', 'title.edit_client' => 'Modification d\\\'un client', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 1835f968..1c7d48de 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -268,6 +268,11 @@ $i18n_key_words = array( 'title.add_user' => 'הוספת משתמש', 'title.edit_user' => 'עריכת משתמש', 'title.delete_user' => 'מחיקת משתמש', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'לקוחות', 'title.add_client' => 'הוספת לקוח', 'title.edit_client' => 'עריכת לקוח', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 8070e59e..9704884a 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -281,6 +281,10 @@ $i18n_key_words = array( // 'title.add_user' => 'Adding User', // 'title.edit_user' => 'Editing User', // 'title.delete_user' => 'Deleting User', +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Ügyfelek', 'title.add_client' => 'Ügyfél hozzáadása', 'title.edit_client' => 'Ügyfél szerkesztése', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index e524e14a..141a6f83 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -248,6 +248,11 @@ $i18n_key_words = array( 'title.add_user' => 'Crea utente', 'title.edit_user' => 'Modifica utente', 'title.delete_user' => 'Elimina utente', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clienti', 'title.add_client' => 'Aggiungi cliente', 'title.edit_client' => 'Modifica cliente', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index ee0a958e..42c2f109 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -284,6 +284,11 @@ $i18n_key_words = array( 'title.add_user' => 'ユーザーの作成', 'title.edit_user' => 'ユーザーの編集', 'title.delete_user' => 'ユーザーの削除', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'クライアント', 'title.add_client' => 'クライアントの追加', 'title.edit_client' => 'クライアントの編集', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index f2cf5584..005fb34d 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -286,6 +286,11 @@ $i18n_key_words = array( 'title.add_user' => '사용자를 추가하기', // TODO: is this correct? 'title.edit_user' => '사용자를 편집하기', 'title.delete_user' => '사용자를 삭제하기', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => '클라이언트', 'title.add_client' => '클라이언트 추가', 'title.edit_client' => '클라이언트 편집', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 89c06c0e..50b4f5e7 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -244,6 +244,11 @@ $i18n_key_words = array( 'title.add_user' => 'Medewerker toevoegen', 'title.edit_user' => 'Medewerker wijzigen', 'title.delete_user' => 'Medewerker verwijderen', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klanten', 'title.add_client' => 'Klant toevoegen', 'title.edit_client' => 'Klant wijzigen', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index baaa0f09..c7573bea 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -281,6 +281,11 @@ $i18n_key_words = array( 'title.add_user' => 'Legg til bruker', 'title.edit_user' => 'Endre bruker', 'title.delete_user' => 'Slett bruker', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klienter', 'title.add_client' => 'Legg til klient', 'title.edit_client' => 'Endre klient', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 3eb14de1..a91a7544 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -249,6 +249,11 @@ $i18n_key_words = array( 'title.add_user' => 'Dodawanie użytkownika', 'title.edit_user' => 'Edytowanie użytkownika', 'title.delete_user' => 'Usuwanie użytkownika', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klienci', 'title.add_client' => 'Dodawanie klienta', 'title.edit_client' => 'Edytowanie klienta', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index cd5f41a5..aecc2226 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -246,6 +246,11 @@ $i18n_key_words = array( 'title.add_user' => 'Adicionando usuário', 'title.edit_user' => 'Editando usuário', 'title.delete_user' => 'Apagando usuário', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clientes', 'title.add_client' => 'Adicionando cliente', 'title.edit_client' => 'Editando cliente', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 96601719..6aeed5ed 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -271,6 +271,11 @@ $i18n_key_words = array( 'title.add_user' => 'Adicionando usuário', 'title.edit_user' => 'Editando usuário', 'title.delete_user' => 'Apagando usuário', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', // 'title.clients' => 'Clients', // 'title.add_client' => 'Adding Client', // 'title.edit_client' => 'Editing Client', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index e4f15bba..9dd29a1d 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -289,6 +289,11 @@ $i18n_key_words = array( 'title.add_user' => 'Adaugare utilizator', 'title.edit_user' => 'Editare utilizator', 'title.delete_user' => 'Stergere utilizator', // TODO: is this correct? +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Clienti', 'title.add_client' => 'Adaugare client', // TODO: is this correct? 'title.edit_client' => 'Editare client', // TODO: is this correct? diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index b14d9242..c43a58d1 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -52,14 +52,13 @@ $i18n_key_words = array( 'menu.charts' => 'Диаграммы', 'menu.projects' => 'Проекты', 'menu.tasks' => 'Задачи', -'menu.users' => 'Люди', +'menu.users' => 'Пользователи', 'menu.teams' => 'Команды', 'menu.export' => 'Экспорт', 'menu.clients' => 'Клиенты', 'menu.options' => 'Опции', // Footer - strings on the bottom of most pages. -'footer.mobile_phones' => 'Time Tracker доступен на мобильных телефонах.', 'footer.contribute_msg' => 'Вы можете улучшить Time Tracker разными способами.', 'footer.credits' => 'Авторы', 'footer.license' => 'Лицензия', @@ -238,10 +237,14 @@ $i18n_key_words = array( 'title.add_task' => 'Добавление задачи', 'title.edit_task' => 'Редактирование задачи', 'title.delete_task' => 'Удаление задачи', -'title.users' => 'Сотрудники', -'title.add_user' => 'Создание пользователя', +'title.users' => 'Пользователи', +'title.add_user' => 'Добавление пользователя', 'title.edit_user' => 'Редактирование пользователя', 'title.delete_user' => 'Удаление пользователя', +'title.roles' => 'Роли', +'title.add_role' => 'Добавление роли', +'title.edit_role' => 'Редактирование роли', +'title.delete_role' => 'Удаление роли', 'title.clients' => 'Клиенты', 'title.add_client' => 'Добавление клиента', 'title.edit_client' => 'Редактирование клиента', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 9c0159bd..90b8b0a5 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -259,6 +259,11 @@ $i18n_key_words = array( 'title.add_user' => 'Pridávanie používateľa', 'title.edit_user' => 'Upravovanie používateľa', 'title.delete_user' => 'Vymazávanie používateľa', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klienti', 'title.add_client' => 'Pridávanie klienta', 'title.edit_client' => 'Upravovanie klienta', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 89e21273..72228894 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -268,6 +268,10 @@ $i18n_key_words = array( // 'title.add_user' => 'Adding User', // 'title.edit_user' => 'Editing User', // 'title.delete_user' => 'Deleting User', +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', // 'title.clients' => 'Clients', // 'title.add_client' => 'Adding Client', // 'title.edit_client' => 'Editing Client', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 21de811f..5137ef34 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -247,6 +247,11 @@ $i18n_key_words = array( 'title.add_user' => 'Dodavanje korisnika', 'title.edit_user' => 'Izmena korisnika', 'title.delete_user' => 'Brisanje korisnika', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Klijenti', 'title.add_client' => 'Dodavanje klijenta', 'title.edit_client' => 'Izmena klijenta', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 69ebcc4c..ba55c2c2 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -248,6 +248,11 @@ $i18n_key_words = array( 'title.add_user' => 'Lägg till användare', 'title.edit_user' => 'Redigera användare', 'title.delete_user' => 'Ta bort användare', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Kunder', 'title.add_client' => 'Lägg till kund', 'title.edit_client' => 'Redigera kund', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index ba909dac..8a9f1970 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -297,6 +297,11 @@ $i18n_key_words = array( 'title.add_user' => 'Kullanıcı yarat', // TODO: we need consistency with all titles. Why not ekleniyor? 'title.edit_user' => 'Kullanıcı düzenleniyor', 'title.delete_user' => 'Kullanıcı siliniyor', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => 'Müşteriler', 'title.add_client' => 'Müşteri ekle', 'title.edit_client' => 'Müşteriyi düzenle', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index f046bebe..ae04c02f 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -273,6 +273,11 @@ $i18n_key_words = array( 'title.add_user' => '添加用户', // TODO: is this correct? 'title.edit_user' => '编辑用户', 'title.delete_user' => '删除用户', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => '客户', 'title.add_client' => '添加客户', 'title.edit_client' => '编辑客户', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index e6a8883a..84240080 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -281,6 +281,11 @@ $i18n_key_words = array( 'title.add_user' => '添加用戶', // TODO: is this correct? 'title.edit_user' => '編輯用戶', 'title.delete_user' => '刪除用戶', +// TODO: translate the following. +// 'title.roles' => 'Roles', +// 'title.add_role' => 'Adding Role', +// 'title.edit_role' => 'Editing Role', +// 'title.delete_role' => 'Deleting Role', 'title.clients' => '客戶', 'title.add_client' => '添加客戶', 'title.edit_client' => '編輯客戶', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 351c189d..3090f09b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.31.4021 | Copyright © Anuko | +  Anuko Time Tracker 1.17.31.4022 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/role_delete.tpl b/WEB-INF/templates/role_delete.tpl new file mode 100644 index 00000000..9c85d220 --- /dev/null +++ b/WEB-INF/templates/role_delete.tpl @@ -0,0 +1,20 @@ +{$forms.roleDeleteForm.open} + + + + +
+ + + + + + + + + + + +
{$role_to_delete|escape}
 
{$forms.roleDeleteForm.btn_delete.control}  {$forms.roleDeleteForm.btn_cancel.control}
+
+{$forms.roleDeleteForm.close} diff --git a/mobile/task_delete.php b/mobile/task_delete.php index 1fea8e12..44f840c1 100644 --- a/mobile/task_delete.php +++ b/mobile/task_delete.php @@ -37,7 +37,7 @@ if (!ttAccessCheck(right_manage_team) || MODE_PROJECTS_AND_TASKS != $user->track } $cl_task_id = (int)$request->getParameter('id'); -$task = ttTaskHelper::getTask($cl_task_id); +$task = ttTaskHelper::get($cl_task_id); $task_to_delete = $task['name']; $form = new Form('taskDeleteForm'); @@ -47,7 +47,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getK if ($request->isPost()) { if ($request->getParameter('btn_delete')) { - if(ttTaskHelper::getTask($cl_task_id)) { + if(ttTaskHelper::get($cl_task_id)) { if (ttTaskHelper::delete($cl_task_id)) { header('Location: tasks.php'); exit(); diff --git a/mobile/task_edit.php b/mobile/task_edit.php index e2dcc990..b454cbe5 100644 --- a/mobile/task_edit.php +++ b/mobile/task_edit.php @@ -46,7 +46,7 @@ if ($request->isPost()) { $cl_status = $request->getParameter('status'); $cl_projects = $request->getParameter('projects'); } else { - $task = ttTaskHelper::getTask($cl_task_id); + $task = ttTaskHelper::get($cl_task_id); $cl_name = $task['name']; $cl_description = $task['description']; $cl_status = $task['status']; diff --git a/role_delete.php b/role_delete.php new file mode 100644 index 00000000..4198ec60 --- /dev/null +++ b/role_delete.php @@ -0,0 +1,69 @@ +getParameter('id'); +$role = ttRoleHelper::get($cl_role_id); +$role_to_delete = $role['name']; + +$form = new Form('roleDeleteForm'); +$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_role_id)); +$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'))); +$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel'))); + +if ($request->isPost()) { + if ($request->getParameter('btn_delete')) { + if(ttRoleHelper::get($cl_role_id)) { + if (ttRoleHelper::delete($cl_role_id)) { + header('Location: roles.php'); + exit(); + } else + $err->add($i18n->getKey('error.db')); + } else + $err->add($i18n->getKey('error.db')); + } elseif ($request->getParameter('btn_cancel')) { + header('Location: roles.php'); + exit(); + } +} // isPost + +$smarty->assign('role_to_delete', $role_to_delete); +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"'); +$smarty->assign('title', $i18n->getKey('title.delete_role')); +$smarty->assign('content_page_name', 'role_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/roles.php b/roles.php index ebf416cc..4e951e9d 100644 --- a/roles.php +++ b/roles.php @@ -42,6 +42,6 @@ if (!ttRoleHelper::rolesExist()) ttRoleHelper::createDefaultRoles(); $smarty->assign('active_roles', ttTeamHelper::getActiveRoles($user->team_id)); $smarty->assign('inactive_roles', ttTeamHelper::getInactiveRoles($user->team_id)); -$smarty->assign('title', $i18n->getKey('label.roles')); +$smarty->assign('title', $i18n->getKey('title.roles')); $smarty->assign('content_page_name', 'roles.tpl'); $smarty->display('index.tpl'); diff --git a/task_delete.php b/task_delete.php index ebc96e21..f04f0326 100644 --- a/task_delete.php +++ b/task_delete.php @@ -37,7 +37,7 @@ if (!ttAccessCheck(right_manage_team) || MODE_PROJECTS_AND_TASKS != $user->track } $cl_task_id = (int)$request->getParameter('id'); -$task = ttTaskHelper::getTask($cl_task_id); +$task = ttTaskHelper::get($cl_task_id); $task_to_delete = $task['name']; $form = new Form('taskDeleteForm'); @@ -47,7 +47,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getK if ($request->isPost()) { if ($request->getParameter('btn_delete')) { - if(ttTaskHelper::getTask($cl_task_id)) { + if(ttTaskHelper::get($cl_task_id)) { if (ttTaskHelper::delete($cl_task_id)) { header('Location: tasks.php'); exit(); diff --git a/task_edit.php b/task_edit.php index 077c7c6b..bfc1bef0 100644 --- a/task_edit.php +++ b/task_edit.php @@ -46,7 +46,7 @@ if ($request->isPost()) { $cl_status = $request->getParameter('status'); $cl_projects = $request->getParameter('projects'); } else { - $task = ttTaskHelper::getTask($cl_task_id); + $task = ttTaskHelper::get($cl_task_id); $cl_name = $task['name']; $cl_description = $task['description']; $cl_status = $task['status']; -- 2.20.1