forked from extern/egroupware
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(
|
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')
|
* 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['modifier']);
|
||||||
unset($this->field2history['etag']);
|
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;
|
return $details;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2158,5 +2158,22 @@ class addressbook_ui extends addressbook_bo
|
|||||||
$content['history']['status-widgets']['tid'][$id] = $settings['name'];
|
$content['history']['status-widgets']['tid'][$id] = $settings['name'];
|
||||||
}
|
}
|
||||||
$sel_options['status'] = $this->contact_fields;
|
$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