CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Find Participants Sorting should persist into a Batch Update By Profile
Pages: [1]

Author Topic: Find Participants Sorting should persist into a Batch Update By Profile  (Read 2555 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Find Participants Sorting should persist into a Batch Update By Profile
November 06, 2010, 11:38:45 am
When using "Find Participants" and then sorting the results (such as sort by Status, Name, etc), the sort doesn't persist into the Batch Update by Profile action.  It would be nice if either this sort could persist into the Batch Update screen or if that is too hard to do, it would be great if the Batch update screen itself had sortable columns.

Hopefully this can be done with less than 40 hours of work.   ;)  If so, let me know and maybe I can get someone to sponsor it.  Thanks.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Find Participants Sorting should persist into a Batch Update By Profile
November 06, 2010, 02:08:12 pm

can u try this patch:

Code: [Select]
Index: CRM/Event/Form/Task.php
===================================================================
--- CRM/Event/Form/Task.php (revision 30556)
+++ CRM/Event/Form/Task.php (working copy)
@@ -102,9 +102,14 @@
             }
         } else {
             $queryParams =  $form->get( 'queryParams' );
+            $sortOrder = null;
+            if ( $form->get( CRM_Utils_Sort::SORT_ORDER  ) ) {
+                $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
+            }
+
             $query       = new CRM_Contact_BAO_Query( $queryParams, null, null, false, false,
                                                        CRM_Contact_BAO_Query::MODE_EVENT);
-            $result = $query->searchQuery(0, 0, null);
+            $result = $query->searchQuery(0, 0, $sortOrder);
             while ($result->fetch()) {
                 $ids[] = $result->participant_id;
             }

if it works, please file an issue and link to this forum post. i'll commit for 3.3

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Find Participants Sorting should persist into a Batch Update By Profile
November 08, 2010, 03:35:10 pm
Thanks that's wonderful.  works.

http://issues.civicrm.org/jira/browse/CRM-7052


Try CiviTeacher: the online video tutorial CiviCRM learning library.

KarinG

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
  • CiviCRM version: 4+
  • CMS version: Drupal 6 / 7
  • MySQL version: MariaDB
  • PHP version: 5.3/5.4/5.5
Re: Find Participants Sorting should persist into a Batch Update By Profile
February 02, 2013, 11:08:39 am
This also works well to help keep the sort order of a Find Contributions search:

File to be edited:
CRM/Contribute/Form/Task.php

Patch:

Code: [Select]

--- Task.php.BEFORE     2012-12-03 07:01:57.000000000 -0700
+++ Task.php    2013-02-02 12:02:03.000000000 -0700
@@ -105,13 +105,21 @@
     }
     else {
       $queryParams = $form->get('queryParams');
+
+            $sortOrder = null;
+            if ( $form->get( CRM_Utils_Sort::SORT_ORDER  ) ) {
+                        $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
+            }
+
       $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE,
         CRM_Contact_BAO_Query::MODE_CONTRIBUTE
       );
       $query->_distinctComponentClause = " civicrm_contribution.id";
       $query->_groupByComponentClause = " GROUP BY civicrm_contribution.id ";
 
-      $result = $query->searchQuery(0, 0, NULL);
+      $result = $query->searchQuery(0, 0, $sortOrder);
+
       while ($result->fetch()) {
         $ids[] = $result->contribution_id;
       }

   

KarinG

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 9
  • CiviCRM version: 4+
  • CMS version: Drupal 6 / 7
  • MySQL version: MariaDB
  • PHP version: 5.3/5.4/5.5
Re: Find Participants Sorting should persist into a Batch Update By Profile
February 02, 2013, 11:22:54 am
Filed: http://issues.civicrm.org/jira/browse/CRM-11814

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Find Participants Sorting should persist into a Batch Update By Profile

This forum was archived on 2017-11-26.