From 3588c58386ea0e275d019b635dcc815f280589de Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 18 Feb 2018 15:47:52 +0000 Subject: [PATCH] Added a requirement to select a client for a client role. --- WEB-INF/templates/footer.tpl | 2 +- user_add.php | 2 ++ user_edit.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 1e7e0784..df6a8da6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.22.3999 | Copyright © Anuko | +  Anuko Time Tracker 1.17.23.4000 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/user_add.php b/user_add.php index b8b5d302..906b2edf 100644 --- a/user_add.php +++ b/user_add.php @@ -141,6 +141,8 @@ if ($request->isPost()) { $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password')); } if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email')); + // Require selection of a client for a client role. + if ($user->isPluginEnabled('cl') && $cl_role == ROLE_CLIENT && !$cl_client_id) $err->add($i18n->getKey('error.client')); if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate')); if ($err->no()) { diff --git a/user_edit.php b/user_edit.php index d7a3feb5..41500536 100644 --- a/user_edit.php +++ b/user_edit.php @@ -174,6 +174,8 @@ if ($request->isPost()) { } if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email')); if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate')); + // Require selection of a client for a client role. + if ($user->isPluginEnabled('cl') && $cl_role == ROLE_CLIENT && !$cl_client_id) $err->add($i18n->getKey('error.client')); if ($err->no()) { $existing_user = ttUserHelper::getUserByLogin($cl_login); -- 2.20.1