introduce static variable ignore_acl for the use in async infolog notification to make sure that we are able to resolve infolog specific placeholders for notification/signature merge

This commit is contained in:
Klaus Leithoff 2013-02-06 13:21:21 +00:00
parent 767db2699e
commit 2bc84411e2
2 changed files with 17 additions and 1 deletions

View File

@ -113,6 +113,13 @@ class infolog_bo
* @var infolog_tracking * @var infolog_tracking
*/ */
var $tracking; var $tracking;
/**
* Variable used to tell read functions to ignore the acl
* used in async_notification;
*
* @var ignore_acl
*/
static $ignore_acl;
/** /**
* Maximum number of line characters (-_+=~) allowed in a mail, to not stall the layout. * Maximum number of line characters (-_+=~) allowed in a mail, to not stall the layout.
* Longer lines / biger number of these chars are truncated to that max. number or chars. * Longer lines / biger number of these chars are truncated to that max. number or chars.
@ -1580,12 +1587,18 @@ class infolog_bo
break; break;
} }
//error_log("notifiying $user($email) about $info[info_subject]: $info[message]"); //error_log("notifiying $user($email) about $info[info_subject]: $info[message]");
// ignore acl for further processing, needed to instruct bo->read to ignore the
// acl, when called for tracking -> get_signature -> merge to resolve possible
// infolog specific placeholders in infolog_egw_record
self::$ignore_acl = true;
$this->tracking->send_notification($info,null,$email,$user,$pref); $this->tracking->send_notification($info,null,$email,$user,$pref);
self::$ignore_acl = false;
$notified_info_ids[] = $info['info_id']; $notified_info_ids[] = $info['info_id'];
} }
} }
} }
$GLOBALS['egw_info']['user']['account_id'] = $save_account_id; $GLOBALS['egw_info']['user']['account_id'] = $save_account_id;
$GLOBALS['egw_info']['user']['preferences'] = $save_prefs; $GLOBALS['egw_info']['user']['preferences'] = $save_prefs;
} }

View File

@ -41,7 +41,10 @@ class infolog_egw_record implements importexport_iface_egw_record
$this->identifier = $_identifier; $this->identifier = $_identifier;
if(self::$bo == null) self::$bo = new infolog_bo(); if(self::$bo == null) self::$bo = new infolog_bo();
if($_identifier) { if($_identifier) {
$this->set_record(self::$bo->read($this->identifier)); $lia = false;
if (isset(infolog_bo::$ignore_acl)) $lia = infolog_bo::$ignore_acl;
$rec = self::$bo->read($this->identifier,true,'ts',$lia);
if (is_array($rec)) $this->set_record($rec);
} }
} }