* InfoLog: query custom-fields for notifications

and remove static $ignore_acl parameter, as it is only used in no longer necessary read
This commit is contained in:
Ralf Becker 2014-01-28 15:18:56 +00:00
parent 8156367b57
commit 8cca1e3536
5 changed files with 20 additions and 18 deletions

View File

@ -113,13 +113,6 @@ class infolog_bo
* @var infolog_tracking
*/
var $tracking;
/**
* Variable used to tell read function 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.
* Longer lines / biger number of these chars are truncated to that max. number or chars.
@ -599,7 +592,7 @@ class infolog_bo
}
$info_id = $data['info_id']; // in case the uid was specified
if (!(self::$ignore_acl || $ignore_acl) && !$this->check_access($data,EGW_ACL_READ)) // check behind read, to prevent a double read
if (!$ignore_acl && !$this->check_access($data,EGW_ACL_READ)) // check behind read, to prevent a double read
{
return False;
}
@ -1555,7 +1548,7 @@ class infolog_bo
$filter .= date('Y-m-d',time()+24*60*60*(int)$pref_value);
//error_log(__METHOD__."() checking with filter '$filter' ($pref_value) for user $user ($email)");
$params = array('filter' => $filter);
$params = array('filter' => $filter, 'custom_fields' => true);
foreach($this->so->search($params) as $info)
{
// check if we already send a notification for that infolog entry, eg. starting and due on same day
@ -1589,12 +1582,7 @@ class infolog_bo
break;
}
//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);
self::$ignore_acl = false;
$notified_info_ids[] = $info['info_id'];
}

View File

@ -21,7 +21,7 @@ class infolog_customfields
/**
* Instance of the infolog BO class
*
* @var boinfolog
* @var infolog_bo
*/
var $bo;
/**

View File

@ -670,6 +670,7 @@ class infolog_so
* @param int $query[num_rows] number of rows to return if $query[start] is set, default is to use the value from the general prefs
* @param string|array $query[cols]=null what to query, if set the recordset / iterator get's returned
* @param string $query[append]=null get's appended to sql query, eg. for GROUP BY
* @param boolean $query['custom_fields']=false query custom-fields too, default not
* @return array|iterator with id's as key of the matching log-entries or recordset/iterator if cols is set
*/
function search(&$query)

View File

@ -6,13 +6,13 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @subpackage setup
* @copyright (c) 2003-11 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2003-14 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
$setup_info['infolog']['name'] = 'infolog';
$setup_info['infolog']['version'] = '1.9.004';
$setup_info['infolog']['version'] = '1.9.005';
$setup_info['infolog']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1;

View File

@ -6,7 +6,7 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog
* @subpackage setup
* @copyright (c) 2003-11 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2003-14 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@ -703,6 +703,8 @@ WHERE parent.caldav_name=sub.caldav_name',__LINE__,__FILE__) as $row)
}
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.003';
}
function infolog_upgrade1_9_003()
{
$GLOBALS['egw_setup']->oProc->AlterColumn('egw_infolog','caldav_name',array(
@ -714,3 +716,14 @@ function infolog_upgrade1_9_003()
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.004';
}
/**
* Change infolog async job method from infolog.boinfolog.async_notification to infolog_bo
*/
function infolog_upgrade1_9_004()
{
$GLOBALS['egw_setup']->db->query("UPDATE egw_async SET async_method='infolog.infolog_bo.async_notification'".
" WHERE async_method='infolog.boinfolog.async_notification'", __LINE__, __FILE__);
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.9.005';
}