Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316492

Change subject: Add pager back to damaged message form
......................................................................

Add pager back to damaged message form

Bulk checkboxes are still there, but seem to require clicking delete
twice. Checking to see if this was an issue in the initial draft.

Bug: T142058
Change-Id: Ib5e07153a52273f3b0f1b111e473b9c68051008d
---
M sites/all/modules/wmf_common/wmf_common.module
1 file changed, 17 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/92/316492/1

diff --git a/sites/all/modules/wmf_common/wmf_common.module 
b/sites/all/modules/wmf_common/wmf_common.module
index bbb5a64..19b7ed6 100644
--- a/sites/all/modules/wmf_common/wmf_common.module
+++ b/sites/all/modules/wmf_common/wmf_common.module
@@ -354,7 +354,7 @@
                '#maxlength' => 256,
        );
 
-       $form['queue'] = array(
+       $form['original_queue'] = array(
                '#type' => 'textfield',
                '#title' => 'Queue',
                '#maxlength' => 256,
@@ -394,21 +394,26 @@
 function wmf_common_damaged_perform_query( $form, &$form_state ) {
        $query = Database::getConnection( 'default', 'smashpig' )
                ->select( 'damaged', 'd' )
-               ->fields( 'd', array(
+               ->extend( 'PagerDefault' );
+
+       $query->fields( 'd', array(
                        'id', 'original_date', 'damaged_date', 'original_queue',
                        'gateway', 'order_id', 'gateway_txn_id', 'error'
                ) )
                ->orderBy( 'damaged_date', 'DESC' )
                ->condition( 'retry_date', null );
 
-       if ( !empty( $form_state['input']['gateway'] ) ) {
-               $query->condition( 'gateway', $form_state['input']['gateway'] );
+       $allowedFields = array( 'gateway', 'original_queue' );
+       $parameters = array();
+
+       foreach( $allowedFields as $field ) {
+               if ( !empty( $form_state['input'][$field] ) ) {
+                       $query->condition( $field, $form_state['input'][$field] 
);
+                       $parameters[$field] = $form_state['input'][$field];
+               }
        }
 
-       if ( !empty( $form_state['input']['queue'] ) ) {
-               $query->condition( 'original_queue', 
$form_state['input']['queue'] );
-       }
-
+       $query->limit( 10 );
        $rows = $query
                ->execute()
                ->fetchAllAssoc( 'id', PDO::FETCH_ASSOC );
@@ -433,6 +438,10 @@
                '#options' => $rows,
                '#empty' => 'Nothing in the damaged message table!  Be very 
suspicious...',
        );
+       $form['pager'] = array(
+               '#theme' => 'pager',
+               '#parameters' => $parameters
+       );
 
        $form['resend'] = array(
                '#type' => 'submit',

-- 
To view, visit https://gerrit.wikimedia.org/r/316492
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5e07153a52273f3b0f1b111e473b9c68051008d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to