From 207eb3b5bf14dcfeefead3a894c4056d06a102ea Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 5 Nov 2018 20:36:24 +0000 Subject: [PATCH] Started to populate org_id furing creation of pre-defined roles. --- WEB-INF/lib/ttRoleHelper.class.php | 10 +++++----- WEB-INF/lib/ttTeamHelper.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 958f034f..51c95b1d 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -193,7 +193,7 @@ class ttRoleHelper { $name = $mdb2->quote($i18n->get('role.user.label')); $description = $mdb2->quote($i18n->get('role.user.description')); $rights = $mdb2->quote($rights_user); - $sql = "insert into tt_roles (group_id, name, description, rank, rights, status) values($group_id, $name, $description, 4, $rights, 1)"; + $sql = "insert into tt_roles (group_id, org_id, name, description, rank, rights, status) values($group_id, $group_id, $name, $description, 4, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; @@ -201,7 +201,7 @@ class ttRoleHelper { $name = $mdb2->quote($i18n->get('role.client.label')); $description = $mdb2->quote($i18n->get('role.client.description')); $rights = $mdb2->quote($rights_client); - $sql = "insert into tt_roles (group_id, name, description, rank, rights, status) values($group_id, $name, $description, 16, $rights, 1)"; + $sql = "insert into tt_roles (group_id, org_id, name, description, rank, rights, status) values($group_id, $group_id, $name, $description, 16, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; @@ -209,7 +209,7 @@ class ttRoleHelper { $name = $mdb2->quote($i18n->get('role.comanager.label')); $description = $mdb2->quote($i18n->get('role.comanager.description')); $rights = $mdb2->quote($rights_comanager); - $sql = "insert into tt_roles (group_id, name, description, rank, rights, status) values($group_id, $name, $description, 68, $rights, 1)"; + $sql = "insert into tt_roles (group_id, org_id, name, description, rank, rights, status) values($group_id, $group_id, $name, $description, 68, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; @@ -217,7 +217,7 @@ class ttRoleHelper { $name = $mdb2->quote($i18n->get('role.manager.label')); $description = $mdb2->quote($i18n->get('role.manager.description')); $rights = $mdb2->quote($rights_manager); - $sql = "insert into tt_roles (group_id, name, description, rank, rights, status) values($group_id, $name, $description, 324, $rights, 1)"; + $sql = "insert into tt_roles (group_id, org_id, name, description, rank, rights, status) values($group_id, $group_id, $name, $description, 324, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; @@ -226,7 +226,7 @@ class ttRoleHelper { $name = $mdb2->quote($i18n->get('role.supervisor.label')); $description = $mdb2->quote($i18n->get('role.supervisor.description')); $rights = $mdb2->quote($rights_supervisor); - $sql = "insert into tt_roles (group_id, name, description, rank, rights, status) values($group_id, $name, $description, 12, $rights, 0)"; + $sql = "insert into tt_roles (group_id, org_id, name, description, rank, rights, status) values($group_id, $group_id, $name, $description, 12, $rights, 0)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index eafc9167..8b9d7ed6 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -290,7 +290,7 @@ class ttTeamHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name, description, rank, rights from tt_roles where group_id = $user->group_id and rank < $user->rank and status = 1 order by rank"; + $sql = "select id, name, description, rank, rights from tt_roles where group_id = $user->group_id and org_id = $user->org_id and rank < $user->rank and status = 1 order by rank"; $res = $mdb2->query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { @@ -348,7 +348,7 @@ class ttTeamHelper { $result = array(); $mdb2 = getConnection(); - $sql = "select id, name, description, rank, rights from tt_roles where group_id = $user->group_id and rank < $user->rank and status = 0 order by rank"; + $sql = "select id, name, description, rank, rights from tt_roles where group_id = $user->group_id and org_id = $user->org_id and rank < $user->rank and status = 0 order by rank"; $res = $mdb2->query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index fe0ad54f..90828c1b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.08.4370 | Copyright © Anuko | +  Anuko Time Tracker 1.18.08.4371 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1