From b02288380ea55515a15990d16547e901e438883f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 19 Jul 2018 16:49:37 +0000 Subject: [PATCH] Started coding Work units plugin. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/group_edit.tpl | 14 ++++++++++++++ group_edit.php | 6 ++++++ 32 files changed, 53 insertions(+) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index cc8264d8..ad3f5879 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -243,6 +243,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index b73f31a2..eb1565e9 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -253,6 +253,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 668699f6..d506f28d 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -224,6 +224,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Login', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index e329907f..b4ee16f9 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -220,6 +220,7 @@ $i18n_key_words = array( // TODO: translate the following. // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Anmelden', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 45dbdfee..35958ada 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -211,6 +211,7 @@ $i18n_key_words = array( 'label.mark_paid' => 'Mark paid', 'label.week_note' => 'Week note', 'label.week_list' => 'Week list', +'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Login', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 12796439..8693dbb8 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -246,6 +246,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Sesión iniciada', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index c007e0f6..aa327dee 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -249,6 +249,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 9adc21b1..6fc87e51 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -236,6 +236,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'ورود', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 79b454de..5d1417f2 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -228,6 +228,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Kirjautuminen', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 9a134023..be9abdea 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -222,6 +222,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Connexion', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 8573946f..89d0e50c 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -212,6 +212,8 @@ $i18n_key_words = array( 'label.mark_paid' => 'Σήμανση πληρωμένα', 'label.week_note' => 'Σημείωση εβδομάδας', 'label.week_list' => 'Λίστα εβδομάδων', +// TODO: translate the following. +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Σύνδεση', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 7929baa2..482a7439 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -246,6 +246,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'כניסה', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index e6aa959a..375664b8 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -246,6 +246,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Bejelentkezés', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 2a02eb04..60310ebd 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -217,6 +217,8 @@ $i18n_key_words = array( 'label.mark_paid' => 'Segna come pagato', 'label.week_note' => 'Nota settimanale', 'label.week_list' => 'Lista settimanale', +// TODO: translate the following. +// 'label.work_units' => 'Work units', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 75a1546f..9241d735 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -251,6 +251,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'ログイン', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 1f16aff5..0d39209b 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -251,6 +251,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => '로그인', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 18e1cf85..961651fd 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -210,6 +210,8 @@ $i18n_key_words = array( 'label.mark_paid' => 'Markeer als betaald', 'label.week_note' => 'Week aantekening', 'label.week_list' => 'Week overzicht', +// TODO: translate the following. +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Aanmelden', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index b4deac5c..d218341f 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -249,6 +249,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Innlogging', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index fb48e7bc..e218b929 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -229,6 +229,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Logowanie', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 968f78cb..a9030812 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -226,6 +226,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Login', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index ff6d7130..30ed9bde 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -238,6 +238,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Login', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 217f6741..f4f0c85b 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -250,6 +250,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 51413f28..d3276d88 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -210,6 +210,7 @@ $i18n_key_words = array( 'label.mark_paid' => 'Отметить оплату', 'label.week_note' => 'Комментарий недели', 'label.week_list' => 'Список недели', +'label.work_units' => 'Единицы работы', // Form titles. 'title.login' => 'Вход в систему', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index e80db533..3f508121 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -236,6 +236,7 @@ $i18n_key_words = array( // 'button.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Prihlásenie', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 6bf161e2..f85164b9 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -233,6 +233,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Prijava', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 5754b603..a2287f38 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -228,6 +228,7 @@ $i18n_key_words = array( // 'button.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => 'Prijava', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index cee942fb..0b96da48 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -222,6 +222,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Rubriker för formulär 'title.login' => 'Logga in', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 111b2d49..3683e3af 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -257,6 +257,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. // Form titles. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 4d5307b7..519faa96 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -240,6 +240,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => '登录', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 9665a6a1..0cf2d6c6 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -247,6 +247,7 @@ $i18n_key_words = array( // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.work_units' => 'Work units', // Form titles. 'title.login' => '登錄', diff --git a/WEB-INF/templates/group_edit.tpl b/WEB-INF/templates/group_edit.tpl index 144971b0..a8f56a2d 100644 --- a/WEB-INF/templates/group_edit.tpl +++ b/WEB-INF/templates/group_edit.tpl @@ -91,6 +91,14 @@ function handlePluginCheckboxes() { } else { configureLabel.style.visibility = "hidden"; } + + var workUnitsCheckbox = document.getElementById("work_units"); + configureLabel = document.getElementById("work_units_config"); + if (workUnitsCheckbox.checked){ + configureLabel.style.visibility = "visible"; + } else { + configureLabel.style.visibility = "hidden"; + } } @@ -239,6 +247,12 @@ function handlePluginCheckboxes() { {$forms.groupForm.week_view.control} {$i18n.label.configure} + {if defined('WORK_UNITS_DEBUG')} + + {$forms.groupForm.work_units.control} + {$i18n.label.configure} + + {/if} {/if} diff --git a/group_edit.php b/group_edit.php index d79ba2d3..676a4d77 100644 --- a/group_edit.php +++ b/group_edit.php @@ -75,6 +75,7 @@ if ($request->isPost()) { $cl_locking = $request->getParameter('locking'); $cl_quotas = $request->getParameter('quotas'); $cl_week_view = $request->getParameter('week_view'); + $cl_work_units = $request->getParameter('work_units'); } else { $cl_group = $user->group; $cl_currency = ($user->currency == ''? CURRENCY_DEFAULT : $user->currency); @@ -109,6 +110,7 @@ if ($request->isPost()) { $cl_locking = in_array('lk', $plugins); $cl_quotas = in_array('mq', $plugins); $cl_week_view = in_array('wv', $plugins); + $cl_work_units = in_array('wu', $plugins); } $form = new Form('groupForm'); @@ -207,6 +209,10 @@ $form->addInput(array('type'=>'checkbox','name'=>'notifications','value'=>$cl_no $form->addInput(array('type'=>'checkbox','name'=>'locking','value'=>$cl_locking,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'quotas','value'=>$cl_quotas,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_view,'onchange'=>'handlePluginCheckboxes()')); +if (defined('WORK_UNITS_DEBUG')) { + $form->addInput(array('type'=>'checkbox','name'=>'work_units','value'=>$cl_work_units,'onchange'=>'handlePluginCheckboxes()')); +} + $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); if ($user->can('delete_group')) $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('button.delete'))); -- 2.20.1