Author: nathangray
New Revision: 56094
URL: http://svn.stylite.de/viewvc/egroupware?rev=56094&view=rev
Log:
Change filterheaders to extend taglist instead of select
Modified:
trunk/egroupware/api/js/etemplate/et2_extension_nextmatch.js
trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php
trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Accountfilter.php
trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Customfilter.php
trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Filterheader.php
trunk/egroupware/api/templates/default/etemplate2.css
— trunk/egroupware/api/js/etemplate/et2_extension_nextmatch.js (original)
+++ trunk/egroupware/api/js/etemplate/et2_extension_nextmatch.js Mon May 9 21:17:04 2016
@@ -26,8 +26,9 @@
// Include all widgets the nextmatch extension will create
et2_widget_template;
et2_widget_grid;
- et2_widget_selectbox;
- et2_widget_selectAccount;
-
et2_widget_taglist;
-
et2_widget_taglist_account;
-
et2_widget_link;
et2_extension_customfields;
// Include all nextmatch subclasses
@@ -3250,10 +3251,30 @@
et2_register_widget(et2_nextmatch_sortheader, [‘nextmatch-sortheader’]);
/**
-
-
@augments et2_taglist
*/
-var et2_nextmatch_filterheader = (function(){ “use strict”; return et2_selectbox.extend([et2_INextmatchHeader, et2_IResizeable],
+var et2_nextmatch_filterheader = (function(){ “use strict”; return et2_taglist.extend([et2_INextmatchHeader, et2_IResizeable],
{
- attributes: {
-
autocomplete_url: { default: ''},
-
multiple: { default: 'toggle'},
-
onchange: {
-
default: function(event) {
-
if(typeof this.nextmatch === 'undefined')
-
{
-
// Not fully set up yet
-
return;
-
}
-
var col_filter = {};
-
col_filter[this.id] = this.getValue();
-
// Set value so it's there for response (otherwise it gets cleared if options are updated)
-
//event.data.set_value(event.data.input.val());
-
-
this.nextmatch.applyFilters({col_filter: col_filter});
-
}
-
}
- },
- /**
- Override to add change handler
-
@@ -3266,21 +3287,6 @@
this.options.empty_label = this.options.label ? this.options.label : egw.lang(“All”);
}
this._super.apply(this, arguments);
-
this.input.change(this, function(event) {
-
if(typeof event.data.nextmatch == 'undefined')
-
{
-
// Not fully set up yet
-
return;
-
}
-
var col_filter = {};
-
col_filter[event.data.id] = event.data.input.val();
-
// Set value so it's there for response (otherwise it gets cleared if options are updated)
-
event.data.set_value(event.data.input.val());
-
-
event.data.nextmatch.applyFilters({col_filter: col_filter});
-
});
-
},
/**
@@ -3313,8 +3319,33 @@
/**
-
@augments et2_selectAccount
*/
-var et2_nextmatch_accountfilterheader = (function(){ “use strict”; return et2_selectAccount.extend([et2_INextmatchHeader, et2_IResizeable],
+var et2_nextmatch_accountfilterheader = (function(){ “use strict”; return et2_taglist_account.extend([et2_INextmatchHeader, et2_IResizeable],
{
- attributes: {
-
"multiple": {
-
default: 'toggle'
-
},
-
onchange: {
-
default: function(event) {
-
if(typeof this.nextmatch === 'undefined')
-
{
-
// Not fully set up yet
-
return;
-
}
-
var col_filter = {};
-
col_filter[this.id] = this.getValue();
-
if(!col_filter[this.id] || col_filter[this.id].length == 0)
-
{
-
col_filter[this.id] = null;
-
}
-
// Set value so it's there for response (otherwise it gets cleared if options are updated)
-
//event.data.set_value(event.data.input.val());
-
-
this.nextmatch.applyFilters({col_filter: col_filter});
-
}
-
}
- },
- /**
- Override to add change handler
-
@@ -3327,18 +3358,6 @@
this.options.empty_label = this.options.label ? this.options.label : egw.lang(“All”);
}
this._super.apply(this, arguments);
-
this.input.change(this, function(event) {
-
if(typeof event.data.nextmatch == 'undefined')
-
{
-
// Not fully set up yet
-
return;
-
}
-
var col_filter = {};
-
col_filter[event.data.id] = event.data.getValue();
-
event.data.nextmatch.applyFilters({col_filter: col_filter});
-
});
-
},
/**
— trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Nextmatch.php Mon May 9 21:17:04 2016
@@ -310,6 +310,14 @@
$template->run(‘validate’, array(’’, $expand, $expand[‘cont’], &$valid_filters), false); // $respect_disabled=false: as client may disable things, here we validate everything and leave it to the get_rows to interpret
$filters = $valid_filters[$form_name];
}
-
// Avoid empty arrays, they cause problems with db filtering
-
foreach($filters['col_filter'] as $col => &$val)
-
{
-
if(is_array($val) && count($val) == 0)
-
{
-
$val = null;
-
}
-
}
//error_log($this . " Valid filters: " . array2string($filters));
}
— trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Accountfilter.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Accountfilter.php Mon May 9 21:17:04 2016
@@ -18,7 +18,7 @@
/**
- Extend selectbox and change type so proper users / groups get loaded, according to preferences
/
-class Accountfilter extends Widget\Select
+class Accountfilter extends Widget\Taglist
{
/*
- Parse and set extra attributes from xml in template object
— trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Customfilter.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Customfilter.php Mon May 9 21:17:04 2016
@@ -59,5 +59,24 @@
}
parent::beforeSendToClient($cname, $expand);
}
+
+
- /**
-
-
-
-
@param string $cname current namespace
-
-
@param array $expand values for keys ‘c’, ‘row’, ‘c_’, ‘row_’, ‘cont’
-
-
-
@param array &$validated=array() validated content
- */
- public function validate($cname, array $expand, array $content, &$validated=array())
- {
-
$value = $value_in = self::get_array($content, $form_name);
-
-
$valid =& self::get_array($validated, $form_name, true);
-
// returning null instead of array(), as array() will be overwritten by etemplate_new::complete_array_merge()
-
// with preserved old content and therefore user can not empty a taglist
-
$valid = $value ? $value : null;
- }
}
Customfilter::registerWidget(NAMESPACE.’\Customfilter’, array(‘nextmatch-customfilter’));
— trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Filterheader.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Nextmatch/Filterheader.php Mon May 9 21:17:04 2016
@@ -18,7 +18,7 @@
/**
- Extend selectbox so select options get parsed properly before being sent to client
*/
-class Filterheader extends Widget\Select
+class Filterheader extends Widget\Taglist
{
}
— trunk/egroupware/api/templates/default/etemplate2.css (original)
+++ trunk/egroupware/api/templates/default/etemplate2.css Mon May 9 21:17:04 2016
@@ -1049,6 +1049,7 @@
}
/* Toggle single / multiple */
.et2_taglist_toggle {
- position: relative;
}
.et2_taglist_toggle > div.ms-ctn {
display: inline-block;
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs