Add a config setting 'assigned' to allow extending classes to provide assigned users in a way other than a specific entry field.

This commit is contained in:
Nathan Gray 2014-05-07 20:54:53 +00:00
parent 01011c7349
commit 3230554c01

View File

@ -263,6 +263,7 @@ abstract class bo_tracking
* Need to be implemented in your extended tracking class! * Need to be implemented in your extended tracking class!
* *
* @param string $what possible values are: * @param string $what possible values are:
* - 'assigned' array of users to use instead of a field in the data
* - 'copy' array of email addresses notifications should be copied too, can depend on $data * - 'copy' array of email addresses notifications should be copied too, can depend on $data
* - 'lang' string lang code for copy mail * - 'lang' string lang code for copy mail
* - 'subject' string subject line for the notification of $data,$old, defaults to link-title * - 'subject' string subject line for the notification of $data,$old, defaults to link-title
@ -562,10 +563,11 @@ abstract class bo_tracking
} }
// assigned / responsible users // assigned / responsible users
if ($this->assigned_field) if ($this->assigned_field || $assigned = $this->get_config('assigned', $data))
{ {
//error_log("bo_tracking::do_notifications() data[$this->assigned_field]=".print_r($data[$this->assigned_field],true).", old[$this->assigned_field]=".print_r($old[$this->assigned_field],true)); //error_log("bo_tracking::do_notifications() data[$this->assigned_field]=".print_r($data[$this->assigned_field],true).", old[$this->assigned_field]=".print_r($old[$this->assigned_field],true));
$assignees = $old_assignees = array(); $assignees = $old_assignees = array();
$assignees = $assigned ? $assigned : $assignees;
if ($data[$this->assigned_field]) // current assignments if ($data[$this->assigned_field]) // current assignments
{ {
$assignees = is_array($data[$this->assigned_field]) ? $assignees = is_array($data[$this->assigned_field]) ?