[REF] Refactor Activity Search to use parent getSortID function
authorSeamus Lee <seamuslee001@gmail.com>
Mon, 9 Dec 2019 03:47:55 +0000 (14:47 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Mon, 9 Dec 2019 03:47:55 +0000 (14:47 +1100)
CRM/Activity/Form/Search.php

index 37509894b7936ca56673818310611e2f7164491d..57a35aef82d10cf22fe386bb9978daccdeb1f74b 100644 (file)
@@ -85,13 +85,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
       }
     }
 
-    $sortID = NULL;
-    if ($this->get(CRM_Utils_Sort::SORT_ID)) {
-      $sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID),
-        $this->get(CRM_Utils_Sort::SORT_DIRECTION)
-      );
-    }
-
     $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
     $selector = new CRM_Activity_Selector_Search($this->_queryParams,
       $this->_action,
@@ -110,7 +103,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
 
     $controller = new CRM_Core_Selector_Controller($selector,
       $this->get(CRM_Utils_Pager::PAGE_ID),
-      $sortID,
+      $this->getSortID(),
       CRM_Core_Action::VIEW,
       $this,
       CRM_Core_Selector_Controller::TRANSFER,
@@ -206,13 +199,6 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
       return;
     }
 
-    $sortID = NULL;
-    if ($this->get(CRM_Utils_Sort::SORT_ID)) {
-      $sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID),
-        $this->get(CRM_Utils_Sort::SORT_DIRECTION)
-      );
-    }
-
     $this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
 
     $selector = new CRM_Activity_Selector_Search($this->_queryParams,
@@ -231,7 +217,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
 
     $controller = new CRM_Core_Selector_Controller($selector,
       $this->get(CRM_Utils_Pager::PAGE_ID),
-      $sortID,
+      $this->getSortID(),
       CRM_Core_Action::VIEW,
       $this,
       CRM_Core_Selector_Controller::SESSION,