From e3e801ff40cde4fe7bf0c9d1814ee9492393fb31 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Thu, 2 Aug 2012 20:07:58 +0000 Subject: [PATCH] fix call with empty xml and use own item search ajax method (which still uses the egw_link class) --- etemplate/inc/class.etemplate_widget_itempicker.inc.php | 7 +++++-- etemplate/js/et2_widget_itempicker.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.etemplate_widget_itempicker.inc.php b/etemplate/inc/class.etemplate_widget_itempicker.inc.php index 8adc9ab1e3..7c1cebaf04 100755 --- a/etemplate/inc/class.etemplate_widget_itempicker.inc.php +++ b/etemplate/inc/class.etemplate_widget_itempicker.inc.php @@ -24,13 +24,16 @@ class etemplate_widget_itempicker extends etemplate_widget * @param string|XMLReader $xml string with xml or XMLReader positioned on the element to construct * @throws egw_exception_wrong_parameter */ - public function __construct($xml) + public function __construct($xml = '') { - parent::__construct($xml); + if($xml) { + parent::__construct($xml); + } } /** * Find items that match the given parameters + * using the egw_link class */ public static function ajax_item_search($app, $type, $pattern, $options=array()) { $options['type'] = $type ? $type : $options['type']; diff --git a/etemplate/js/et2_widget_itempicker.js b/etemplate/js/et2_widget_itempicker.js index dda4149be3..e101c2412f 100755 --- a/etemplate/js/et2_widget_itempicker.js +++ b/etemplate/js/et2_widget_itempicker.js @@ -200,7 +200,7 @@ var et2_itempicker = et2_inputWidget.extend({ this.itemlist.addClass("loading"); this.clear.css("display", "inline-block"); - var request = new egw_json_request("etemplate_widget_link::ajax_link_search::etemplate", + var request = new egw_json_request("etemplate_widget_itempicker::ajax_item_search::etemplate", [this.current_app, '', request.term, request.options], this );