Commit 366247bb authored by m.stenta's avatar m.stenta
Browse files

Issue #2443745: Clone log items

parent 5647be7a
......@@ -377,6 +377,12 @@ function log_action_info() {
'configurable' => FALSE,
'triggers' => array('any'),
),
'log_clone_action' => array(
'type' => 'log',
'label' => t('Clone'),
'configurable' => TRUE,
'triggers' => array('any'),
),
'log_reschedule_action' => array(
'type' => 'log',
'label' => t('Reschedule'),
......@@ -466,6 +472,39 @@ function log_reschedule_action($log, $context = array()) {
_log_action_date_form_action($log, $context);
}
/**
* Log clone action configuration form.
*/
function log_clone_action_form($context, $form_state) {
return _log_action_date_form($context, $form_state, 'Clone');
}
/**
* Log clone action configuration form submit.
*/
function log_clone_action_submit($form, $form_state) {
return _log_action_date_form_submit($form, $form_state);
}
/**
* Action function for log_clone_action.
*
* Clones a log and gives it a new timestamp.
*
* @param object $log
* The log entity object.
* @param array $context
* Array with parameters for this action.
*/
function log_clone_action($log, $context = array()) {
// Clear the log id.
unset($log->id);
// Set the date and save.
_log_action_date_form_action($log, $context);
}
/**
* Log action form with date field (helper function).
*
......
......@@ -104,6 +104,13 @@ function log_plan_views_default_views() {
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['entity_load_capacity'] = '10';
$handler->display->display_options['fields']['views_bulk_operations']['vbo_settings']['skip_batching'] = 1;
$handler->display->display_options['fields']['views_bulk_operations']['vbo_operations'] = array(
'action::log_clone_action' => array(
'selected' => 1,
'postpone_processing' => 0,
'skip_confirmation' => 1,
'override_label' => 0,
'label' => '',
),
'action::views_bulk_operations_delete_item' => array(
'selected' => 0,
'postpone_processing' => 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment