X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/7bc3223af35eeceb1e63daf3ae3cb66739337696..ca6d2f927b985f4d80b31e5e2c6deb98e4fae6f6:/WEB-INF/lib/ttUser.class.php diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 8c4595db..ccd1f961 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -28,6 +28,7 @@ import('ttConfigHelper'); import('ttGroupHelper'); +import('ttGroup'); class ttUser { var $login = null; // User login. @@ -74,6 +75,8 @@ class ttUser { var $first_unit_threshold = 0;// Threshold for 1st unit for Work units plugin. var $unit_totals_only = 0; // Totals only option for the Work units plugin. + var $behalfGroup = null; // A ttGroup instance with on behalf group attributes. + // Constructor. function __construct($login, $id = null) { if (!$login && !$id) { @@ -150,13 +153,15 @@ class ttUser { // Set "on behalf" id and name (user). if (isset($_SESSION['behalf_id'])) { - $this->behalf_id = $_SESSION['behalf_id']; - $this->behalf_name = $_SESSION['behalf_name']; + $this->behalf_id = $_SESSION['behalf_id']; + $this->behalf_name = $_SESSION['behalf_name']; } // Set "on behalf" id and name (group). if (isset($_SESSION['behalf_group_id'])) { - $this->behalf_group_id = $_SESSION['behalf_group_id']; - $this->behalf_group_name = $_SESSION['behalf_group_name']; + $this->behalf_group_id = $_SESSION['behalf_group_id']; + $this->behalf_group_name = $_SESSION['behalf_group_name']; + + $this->behalfGroup = new ttGroup($this->behalf_group_id, $this->org_id); } } } @@ -714,6 +719,9 @@ class ttUser { $this->behalf_group_id = $group_id; $this->behalf_group_name = $onBehalfGroupName; + unset($this->behalfGroup); + $this->behalfGroup = new ttGroup($this->behalf_group_id, $this->org_id); + // Adjust on behalf user. $this->adjustBehalfId(); return;