mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Log history of custom fields also
This commit is contained in:
parent
989bba917f
commit
fb50bee888
@ -46,6 +46,14 @@ class addressbook_tracking extends bo_tracking
|
||||
*/
|
||||
var $field2history = array(
|
||||
);
|
||||
|
||||
/**
|
||||
* Translate field name to label
|
||||
*/
|
||||
public $field2label = array(
|
||||
// Custom fields added in constructor
|
||||
);
|
||||
|
||||
/**
|
||||
* Should the user (passed to the track method or current user if not passed) be used as sender or get_config('sender')
|
||||
*
|
||||
@ -79,6 +87,13 @@ class addressbook_tracking extends bo_tracking
|
||||
unset($this->field2history['modifier']);
|
||||
unset($this->field2history['etag']);
|
||||
}
|
||||
$custom = config::get_customfields('addressbook', true);
|
||||
if(is_array($custom)) {
|
||||
foreach($custom as $name => $settings) {
|
||||
$this->field2history['#'.$name] = '#'.$name;
|
||||
$this->field2label['#'.$name] = $settings['label'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -241,4 +256,4 @@ class addressbook_tracking extends bo_tracking
|
||||
}
|
||||
return $details;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2158,5 +2158,22 @@ class addressbook_ui extends addressbook_bo
|
||||
$content['history']['status-widgets']['tid'][$id] = $settings['name'];
|
||||
}
|
||||
$sel_options['status'] = $this->contact_fields;
|
||||
foreach($this->tracking->field2label as $field => $label) {
|
||||
$sel_options['status'][$field] = lang($label);
|
||||
}
|
||||
|
||||
// Get custom field options
|
||||
$custom = config::get_customfields('addressbook', true);
|
||||
if(is_array($custom)) {
|
||||
foreach($custom as $name => $settings) {
|
||||
if(!is_array($settings['values'])) {
|
||||
$content['history']['status-widgets']['#'.$name] = $settings['type'];
|
||||
} elseif($settings['values']['@']) {
|
||||
$content['history']['status-widgets']['#'.$name] = customfields_widget::_get_options_from_file($settings['values']['@']);
|
||||
} else {
|
||||
$content['history']['status-widgets']['#'.$name] = $settings['values'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user