From: Nik Okuntseff Date: Mon, 5 Nov 2018 21:49:07 +0000 (+0000) Subject: Fixed adding custom role with org_id field population. X-Git-Tag: timetracker_1.19-1~702 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=96dd4d9712381a9c2d9df96961f96dc4c2dcc6f2;p=timetracker.git Fixed adding custom role with org_id field population. --- diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 42c7102b..e250a4fc 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -152,6 +152,7 @@ class ttImportHelper { foreach ($this->roles as $key=>$role_item) { $role_id = ttRoleHelper::insert(array( 'group_id' => $this->group_id, + 'org_id' => $this->org_id, 'name' => $role_item['NAME'], 'rank' => $role_item['RANK'], 'rights' => $role_item['RIGHTS'], diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 51c95b1d..e5bf6a7d 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -154,14 +154,15 @@ class ttRoleHelper { $mdb2 = getConnection(); $group_id = (int) $fields['group_id']; + $org_id = (int) $fields['org_id']; $name = $fields['name']; $rank = (int) $fields['rank']; $description = $fields['description']; $rights = $fields['rights']; $status = $fields['status']; - $sql = "insert into tt_roles (group_id, name, rank, description, rights, status) - values ($group_id, ".$mdb2->quote($name).", $rank, ".$mdb2->quote($description).", ".$mdb2->quote($rights).", ".$mdb2->quote($status).")"; + $sql = "insert into tt_roles (group_id, org_id, name, rank, description, rights, status) + values ($group_id, $org_id, ".$mdb2->quote($name).", $rank, ".$mdb2->quote($description).", ".$mdb2->quote($rights).", ".$mdb2->quote($status).")"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 90828c1b..6430f8a6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.08.4371 | Copyright © Anuko | +  Anuko Time Tracker 1.18.08.4372 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/role_add.php b/role_add.php index c8df24c7..cb3d6f40 100644 --- a/role_add.php +++ b/role_add.php @@ -63,6 +63,7 @@ if ($request->isPost()) { // Insert a role with default user rights. if (ttRoleHelper::insert(array( 'group_id' => $user->group_id, + 'org_id' => $user->org_id, 'name' => $cl_name, 'rank' => $cl_rank, 'description' => $cl_description,