fix call with empty xml and use own item search ajax method (which still uses the egw_link class)

This commit is contained in:
Christian Binder 2012-08-02 20:07:58 +00:00
parent 6123e479b2
commit e3e801ff40
2 changed files with 6 additions and 3 deletions

View File

@ -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'];

View File

@ -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
);