diff --git a/etemplate/doc/reference.html b/etemplate/doc/reference.html index 9cdd7dc510..bdbc7aeb63 100644 --- a/etemplate/doc/reference.html +++ b/etemplate/doc/reference.html @@ -886,14 +886,15 @@ function index($content = 0) - Nextmatch-
SortHeader

Nextmatch-
FilterHeader

Nextmatch-
AccountFilter
+ Nextmatch-
SortHeader

Nextmatch-
FilterHeader

Nextmatch-
Custom FilterHeader

Nextmatch-
AccountFilter
<nextmatch type="nextmatch-sortheader" id="col-name" options="DESC" label="ColLabel"/>

<nextmatch type="nextmatch-filterheader" id="col-name"/>

+ <nextmatch type="nextmatch-customfilter" id="col-name" options="select-precent"/>

<nextmatch type="nextmatch-accountfilter" id="col-name"/> no - nextmatch-
sortheader

nextmatch-
filterheader

nextmatch-
accountfilter + nextmatch-
sortheader

nextmatch-
filterheader

nextmatch-
customfilter

nextmatch-
accountfilter These widget are an optional part of the nextmatch widget.

nextmatch-sortheader
@@ -907,10 +908,13 @@ function index($content = 0) (xml:id), the options of the displayed selectbox need to be set as for an ordinary selectbox (eg. in the options parameter to the uietemplate::exec function). If no extra-label is given in options, lang('all') will be used for the empty value, which means no filter activ. An (optional) label can be given.

+ nextmatch-customfilter
+ The custom filterheader allows to use other (select-)widgets to filter by them. They have to be specified as the first + parameter in the comma-separated options attribute. In all other aspects it is identical to the filterheader.

nextmatch-accountfilter
- The Accountfilter allows to select users (via the prefered user-selection-method) to filter by them. In all other aspects - it is identical to the filterheader.

- Note: All three widgets interoperate with the nextmatch-widget which passes the set values as part if + The Accountfilter allows to select users (via the prefered user-selection-method) to filter by them. + It's identical to a nextmatch-customfilter with options="select-account".

+ Note: All four widgets interoperate with the nextmatch-widget which passes the set values as part if the query-parameter to its get_rows function, they are not returned in the rows sub-array. diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 3dc405a346..7ea8e20f03 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -66,10 +66,11 @@ * @var array */ var $human_name = array( - 'nextmatch' => 'Nextmatch', - 'nextmatch-sortheader' => 'Nextmatch Sortheader', - 'nextmatch-filterheader' => 'Nextmatch Filterheader', + 'nextmatch' => 'Nextmatch', + 'nextmatch-sortheader' => 'Nextmatch Sortheader', + 'nextmatch-filterheader' => 'Nextmatch Filterheader', 'nextmatch-accountfilter' => 'Nextmatch Accountfilter', + 'nextmatch-customfilter' => 'Nextmatch Custom Filterheader', ); /** @@ -139,8 +140,15 @@ } return True; + case 'nextmatch-accountfilter': // Option: as for selectbox: [extra-label(default ALL)[,#lines(default 1)]] + $cell['size'] = 'select-account,'.$cell['size']; + // fall through + case 'nextmatch-customfilter': // Option: widget-name, options as for selectbox + list($type,$cell['size']) = explode(',',$cell['size'],2); + // fall through case 'nextmatch-filterheader': // Option: as for selectbox: [extra-label(default ALL)[,#lines(default 1)]] - $cell['type'] = 'select'; + if (!$type) $type = 'select'; + $cell['type'] = $type; if (!$cell['size']) { $cell['size'] = 'All'; @@ -152,21 +160,6 @@ $cell['onchange'] = $cell['noprint'] = True; $extension_data['old_value'] = $value = $nm_global['col_filter'][$this->last_part($name)]; return True; - - case 'nextmatch-accountfilter': // Option: as for selectbox: [extra-label(default ALL)[,#lines(default 1)]] - $cell['type'] = 'select-account'; - $cell['name'] .= '[account]'; - if (!$cell['size']) - { - $cell['size'] = 'All'; - } - if (!$cell['help']) - { - $cell['help'] = 'select which accounts to show'; - } - $cell['onchange'] = $cell['noprint'] = True; - $extension_data['old_value'] = $value = $nm_global['col_filter'][$this->last_part($name)]; - return True; } if (!$value['filter_onchange']) $value['filter_onchange'] = 'this.form.submit();'; if (!$value['filter2_onchange']) $value['filter2_onchange'] = 'this.form.submit();'; @@ -365,6 +358,9 @@ //echo "

nextmatch_widget.post_process(type='$extension_data[type]', name='$name',value_in=".print_r($value_in,true).",order='$nm_global[order]'): value = "; _debug_array($value); switch($extension_data['type']) { + case 'nextmatch': + break; + case 'nextmatch-sortheader': if ($value_in) { @@ -373,9 +369,10 @@ } return False; // dont report value back, as it's in the wrong location (rows) + default: case 'select-account': // used by nextmatch-accountfilter case 'nextmatch-filterheader': - if ($value_in != $extension_data['old_value'] && !(!$value_in && !$extension_data['old_value'])) + if ((string)$value_in != (string)$extension_data['old_value']) { //echo "

setting nm_global[filter][".$this->last_part($name)."]='$value_in' (was '$extension_data[old_value]')

\n"; $nm_global['filter'][$this->last_part($name)] = $value_in;