projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added timesheet approval email notification.
[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
1bfd6f4
..
4a2320b
100644
(file)
--- a/
WEB-INF/lib/ttUser.class.php
+++ b/
WEB-INF/lib/ttUser.class.php
@@
-167,6
+167,11
@@
class ttUser {
return ($this->behalfUser ? $this->behalfUser->id : $this->id);
}
return ($this->behalfUser ? $this->behalfUser->id : $this->id);
}
+ // getName returns user name on behalf of whom the current user is operating.
+ function getName() {
+ return ($this->behalfUser ? $this->behalfUser->name : $this->name);
+ }
+
// getQuotaPercent returns quota percent for active user.
function getQuotaPercent() {
return ($this->behalfUser ? $this->behalfUser->quota_percent : $this->quota_percent);
// getQuotaPercent returns quota percent for active user.
function getQuotaPercent() {
return ($this->behalfUser ? $this->behalfUser->quota_percent : $this->quota_percent);
@@
-592,7
+597,7
@@
class ttUser {
return false;
// So far, so good. Check user now.
return false;
// So far, so good. Check user now.
- $options = array('
group_id'=>$group_id,'
status'=>ACTIVE,'max_rank'=>MAX_RANK);
+ $options = array('status'=>ACTIVE,'max_rank'=>MAX_RANK);
$users = $this->getUsers($options);
foreach($users as $one_user) {
if ($one_user['id'] == $this->behalf_id)
$users = $this->getUsers($options);
foreach($users as $one_user) {
if ($one_user['id'] == $this->behalf_id)
@@
-695,7
+700,8
@@
class ttUser {
return false;
// Mark user as deleted.
return false;
// Mark user as deleted.
- $sql = "update tt_users set status = NULL where id = $user_id".
+ $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($this->id);
+ $sql = "update tt_users set status = null $modified_part where id = $user_id".
" and group_id = $group_id and org_id = $org_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
" and group_id = $group_id and org_id = $org_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))