Nasty has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/336580 )
Change subject: BSApiGroupStore: Implemented use of "query" parameter
......................................................................
BSApiGroupStore: Implemented use of "query" parameter
... also minor bugfix in 'BS.form.field.ItemList': When 'reset' got called
on the fields a null value was provided to 'setValue'.
Change-Id: Ic646cfc435bb4f4c450e7f439e063315009033cb
(cherry picked from commit 8f596f410f00e736f4b7b34c13fda9ca50cde7ba)
---
M includes/api/BSApiGroupStore.php
M resources/bluespice.extjs/BS/form/field/ItemList.js
2 files changed, 23 insertions(+), 5 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation
refs/changes/80/336580/1
diff --git a/includes/api/BSApiGroupStore.php b/includes/api/BSApiGroupStore.php
index 1fda0d6..770f6e1 100644
--- a/includes/api/BSApiGroupStore.php
+++ b/includes/api/BSApiGroupStore.php
@@ -27,15 +27,16 @@
* Example request parameters of an ExtJS store
*/
class BSApiGroupStore extends BSApiExtJSStoreBase {
+
+ protected $sLcQuery = '';
+
/**
- * @param string $sQuery Potential query provided by ExtJS component.
- * This is some kind of preliminary filtering. Subclass has to decide if
- * and how to process it
- * @return array - Full list of of data objects. Filters, paging,
sorting
- * will be done by the base class
+ * @param string $sQuery
+ * @return array - List of of groups
*/
protected function makeData( $sQuery = '' ) {
global $wgAdditionalGroups, $wgImplicitGroups;
+ $this->sLcQuery = strtolower( $sQuery );
$aData = array();
foreach ( BsGroupHelper::getAvailableGroups() as $sGroup ) {
@@ -46,6 +47,10 @@
$oMsg = wfMessage( "group-$sGroup" );
if( $oMsg->exists() ) {
$sDisplayName = $oMsg->plain()." ($sGroup)";
+ }
+
+ if( !$this->queryApplies( $sGroup, $sDisplayName ) ) {
+ continue;
}
$aData[] = (object) array(
@@ -62,4 +67,16 @@
'wikiadmin'
);
}
+
+ protected function queryApplies( $sGroup, $sDisplayName ) {
+ if( empty( $this->sLcQuery ) ) {
+ return true;
+ }
+
+ $sLcGroup = strtolower( $sGroup );
+ $sLcDisplayname = strtolower( $sDisplayName );
+
+ return strpos( $sLcGroup, $this->sLcQuery ) !== false
+ || strpos( $sLcDisplayname, $this->sLcQuery ) !== false;
+ }
}
diff --git a/resources/bluespice.extjs/BS/form/field/ItemList.js
b/resources/bluespice.extjs/BS/form/field/ItemList.js
index 0a93fac..9c0ac67 100644
--- a/resources/bluespice.extjs/BS/form/field/ItemList.js
+++ b/resources/bluespice.extjs/BS/form/field/ItemList.js
@@ -180,6 +180,7 @@
},
setValue: function( data ) {
+ data = data || {};
this.gdItems.getStore().loadData( data );
}
});
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/336580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic646cfc435bb4f4c450e7f439e063315009033cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: REL1_27
Gerrit-Owner: Nasty <[email protected]>
Gerrit-Reviewer: Robert Vogel <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits