From edfd5fd24d78d3338bb7e9bed2a79fb28ec55b50 Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 14 May 2019 16:43:15 -0600 Subject: [PATCH] Etemplate - also submit action data --- admin/inc/class.admin_customfields.inc.php | 8 +++++++- api/js/egw_action/egw_action.js | 11 +++++++++++ api/js/etemplate/et2_extension_nextmatch_actions.js | 5 ++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/admin/inc/class.admin_customfields.inc.php b/admin/inc/class.admin_customfields.inc.php index ae18b3705e..f43600b1f0 100644 --- a/admin/inc/class.admin_customfields.inc.php +++ b/admin/inc/class.admin_customfields.inc.php @@ -184,7 +184,12 @@ class admin_customfields { if(in_array($data['id'],$content['nm']['selected'])) { - $cmd = new admin_cmd_customfield($this->appname, array('id' => $data['id'],'name' => $name)); + $cmd = new admin_cmd_customfield( + $this->appname, + array('id' => $data['id'],'name' => $name), + null, + $content['nm']['admin_cmd'] + ); $cmd->run(); unset($this->fields[$name]); } @@ -520,6 +525,7 @@ class admin_customfields 'caption' => 'Delete', 'confirm' => 'Delete this entry', 'confirm_multiple' => 'Delete these entries', + 'policy_confirmation' => 'Oh yeah', 'group' => ++$group, 'disableClass' => 'rowNoDelete', ), diff --git a/api/js/egw_action/egw_action.js b/api/js/egw_action/egw_action.js index befb74a8fd..5040ad4601 100644 --- a/api/js/egw_action/egw_action.js +++ b/api/js/egw_action/egw_action.js @@ -683,6 +683,17 @@ egwAction.prototype._check_confirm = function(_senders, _target) var self = this; if(msg.trim().length > 0) { + if(this.data.policy_confirmation && egw.app('policy')) + { + egw.includeJS(egw.link('/policy/js/app.js'), function() { + if(typeof app.policy === 'undefined' || typeof app.policy.confirm === 'undefined') + { + app.policy = new app.classes.policy(); + } + app.policy.confirm(self, _senders, _target); + }); + return; + } et2_dialog.show_dialog(function(_button) { if (_button == et2_dialog.YES_BUTTON) diff --git a/api/js/etemplate/et2_extension_nextmatch_actions.js b/api/js/etemplate/et2_extension_nextmatch_actions.js index b603a592c1..0dc8f1cff8 100644 --- a/api/js/etemplate/et2_extension_nextmatch_actions.js +++ b/api/js/etemplate/et2_extension_nextmatch_actions.js @@ -231,13 +231,16 @@ function nm_action(_action, _senders, _target, _ids) // Fake a getValue() function var old_value = nextmatch.getValue; var value = nextmatch.getValue(); - jQuery.extend(value, this.activeFilters, { + jQuery.extend(value, _action.data, this.activeFilters, { "selected": idsArr, "select_all": _ids.all, "checkboxes": checkbox_values }); value[nextmatch.options.settings.action_var]= _action.id; + // Don't try to send the nextmatch + delete value['nextmatch']; + nextmatch.getValue = function() { return value; };