diff --git a/etemplate/js/et2_extension_itempicker_actions.js b/etemplate/js/et2_extension_itempicker_actions.js new file mode 100644 index 0000000000..3aa0fd3dc6 --- /dev/null +++ b/etemplate/js/et2_extension_itempicker_actions.js @@ -0,0 +1,10 @@ +function itempickerDocumentAction(context, data) { + var formid = "itempicker_action_form"; + var form = "
"; + $j("body").append(form); + $j("#" + formid).submit().remove(); +} \ No newline at end of file diff --git a/etemplate/js/et2_widget_itempicker.js b/etemplate/js/et2_widget_itempicker.js index 0c4aa82f0a..afd2736062 100755 --- a/etemplate/js/et2_widget_itempicker.js +++ b/etemplate/js/et2_widget_itempicker.js @@ -19,6 +19,7 @@ jquery.jquery; et2_core_inputWidget; et2_core_valueWidget; + et2_extension_itempicker_actions; egw_action.egw_action_common; */ @@ -52,6 +53,12 @@ var et2_itempicker = et2_inputWidget.extend({ "default": et2_no_init, "description": "This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text." }, + "value": { + "name": "value", + "type": "any", + "default": "", + "description": "Optional itempicker value(s) - can be used for e.g. environmental information" + }, "query": { "name": "Query callback", "type": "any", @@ -185,7 +192,8 @@ var et2_itempicker = et2_inputWidget.extend({ { var data = {}; data.app = this.current_app; - data.items = this.getSelectedItems(); + data.value = this.options.value; + data.checked = this.getSelectedItems(); return this.action.exec(this, data); } @@ -194,7 +202,7 @@ var et2_itempicker = et2_inputWidget.extend({ getSelectedItems: function() { - var items = {}; + var items = []; $j(this.itemlist).children("ul").children("li.selected").each(function(index) { items[index] = $j(this).attr("id"); });