projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A bit more refactoring for subgroups.
[timetracker.git]
/
WEB-INF
/
lib
/
ttUser.class.php
diff --git
a/WEB-INF/lib/ttUser.class.php
b/WEB-INF/lib/ttUser.class.php
index
e6f271d
..
c00bd9f
100644
(file)
--- a/
WEB-INF/lib/ttUser.class.php
+++ b/
WEB-INF/lib/ttUser.class.php
@@
-29,6
+29,8
@@
import('ttConfigHelper');
import('ttGroupHelper');
import('ttGroup');
import('ttConfigHelper');
import('ttGroupHelper');
import('ttGroup');
+import('form.Form');
+import('form.ActionForm');
class ttUser {
var $login = null; // User login.
class ttUser {
var $login = null; // User login.
@@
-111,9
+113,9
@@
class ttUser {
$this->role_id = $val['role_id'];
$this->role_name = $val['role_name'];
$this->rights = explode(',', $val['rights']);
$this->role_id = $val['role_id'];
$this->role_name = $val['role_name'];
$this->rights = explode(',', $val['rights']);
- $this->is_client = !in_array('track_own_time', $this->rights);
$this->rank = $val['rank'];
$this->client_id = $val['client_id'];
$this->rank = $val['rank'];
$this->client_id = $val['client_id'];
+ $this->is_client = $this->client_id && !in_array('track_own_time', $this->rights);
$this->email = $val['email'];
$this->lang = $val['lang'];
$this->decimal_mark = $val['decimal_mark'];
$this->email = $val['email'];
$this->lang = $val['lang'];
$this->decimal_mark = $val['decimal_mark'];
@@
-214,6
+216,11
@@
class ttUser {
return ($this->behalfGroup ? $this->behalfGroup->lock_spec : $this->lock_spec);
}
return ($this->behalfGroup ? $this->behalfGroup->lock_spec : $this->lock_spec);
}
+ // getWorkdayMinutes returns workday_minutes for active group.
+ function getWorkdayMinutes() {
+ return ($this->behalfGroup ? $this->behalfGroup->workday_minutes : $this->workday_minutes);
+ }
+
// getConfig returns config string for active group.
function getConfig() {
return ($this->behalfGroup ? $this->behalfGroup->config : $this->config);
// getConfig returns config string for active group.
function getConfig() {
return ($this->behalfGroup ? $this->behalfGroup->config : $this->config);
@@
-782,6
+789,13
@@
class ttUser {
unset($_SESSION['behalf_id']);
unset($_SESSION['behalf_name']);
unset($_SESSION['behalf_id']);
unset($_SESSION['behalf_name']);
+ // Destroy report bean if it was set in session.
+ $form = new Form('dummyForm');
+ $bean = new ActionForm('reportBean', $form, $request);
+ if ($bean->isSaved()) {
+ $bean->destroyBean();
+ }
+
// Do not do anything if we don't have rights.
if (!$this->can('manage_subgroups')) return;
// Do not do anything if we don't have rights.
if (!$this->can('manage_subgroups')) return;