projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finished integrating improvements for Danish language file.
[timetracker.git]
/
WEB-INF
/
lib
/
ttUserHelper.class.php
diff --git
a/WEB-INF/lib/ttUserHelper.class.php
b/WEB-INF/lib/ttUserHelper.class.php
index
a8bfe62
..
cc8b90d
100644
(file)
--- a/
WEB-INF/lib/ttUserHelper.class.php
+++ b/
WEB-INF/lib/ttUserHelper.class.php
@@
-247,8
+247,6
@@
class ttUserHelper {
}
// markDeleted - marks user and its associated things as deleted.
}
// markDeleted - marks user and its associated things as deleted.
- // TODO: address the problem when a deleted user has a scheduled notification configured,
- // in which case all other notifications may stop working because of MySQL syntax error.
static function markDeleted($user_id) {
$mdb2 = getConnection();
global $user;
static function markDeleted($user_id) {
$mdb2 = getConnection();
global $user;
@@
-269,6
+267,12
@@
class ttUserHelper {
if (is_a($affected, 'PEAR_Error'))
return false;
if (is_a($affected, 'PEAR_Error'))
return false;
+ // Mark favorite reports as deleted.
+ $sql = "update tt_fav_reports set status = NULL where user_id = $user_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error'))
+ return false;
+
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id";
$affected = $mdb2->exec($sql);
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id";
$affected = $mdb2->exec($sql);
@@
-282,6
+286,12
@@
class ttUserHelper {
if (is_a($affected, 'PEAR_Error'))
return false;
if (is_a($affected, 'PEAR_Error'))
return false;
+ // Mark favorite reports as deleted.
+ $sql = "update tt_fav_reports set status = NULL where user_id = $user_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error'))
+ return false;
+
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id and team_id = ".$user->team_id;
$affected = $mdb2->exec($sql);
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id and team_id = ".$user->team_id;
$affected = $mdb2->exec($sql);
@@
-331,6
+341,12
@@
class ttUserHelper {
if (is_a($affected, 'PEAR_Error'))
return false;
if (is_a($affected, 'PEAR_Error'))
return false;
+ // Mark favorite reports as deleted.
+ $sql = "update tt_fav_reports set status = NULL where user_id = $user_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error'))
+ return false;
+
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id and team_id = ".$user->team_id;
$affected = $mdb2->exec($sql);
// Mark user as deleted.
$sql = "update tt_users set status = NULL where id = $user_id and team_id = ".$user->team_id;
$affected = $mdb2->exec($sql);