using new historylog custom field stuff, storing custom fields now on a per field basis

This commit is contained in:
Ralf Becker 2011-04-20 06:31:45 +00:00
parent 0aac7e43a9
commit 5c47626dc5
2 changed files with 1 additions and 25 deletions

View File

@ -122,7 +122,7 @@ class infolog_tracking extends bo_tracking
*/
function __construct(&$infolog_bo)
{
parent::__construct(); // calling the constructor of the extended class
parent::__construct('infolog'); // add custom fields from infolog
$this->infolog =& $infolog_bo;
}
@ -301,29 +301,6 @@ class infolog_tracking extends bo_tracking
return $changes;
}
/**
* Save changes to the history log
*
* Reimplemented to store all customfields in a single field, as the history-log has only 2-char field-ids
*
* @param array $data current entry
* @param array $old=null old/last state of the entry or null for a new entry
* @param int number of log-entries made
*/
function save_history($data,$old)
{
$data_custom = $old_custom = array();
foreach($this->infolog->customfields as $name => $custom)
{
if (isset($data['#'.$name]) && (string)$data['#'.$name]!=='') $data_custom[] = $custom['label'].': '.$data['#'.$name];
if (isset($old['#'.$name]) && (string)$old['#'.$name]!=='') $old_custom[] = $custom['label'].': '.$old['#'.$name];
}
$data['custom'] = implode("\n",$data_custom);
$old['custom'] = implode("\n",$old_custom);
return parent::save_history($data,$old);
}
/**
* Get a notification-config value
*

View File

@ -1639,7 +1639,6 @@ class infolog_ui
),
);
$history_stati = array();
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php');
$tracking = new infolog_tracking($this);
foreach($tracking->field2history as $field => $history)
{