$selector->setKey($this->controller->_key);
// added the sorting character to the form array
- // lets recompute the aToZ bar without the sortByCharacter
- // we need this in most cases except when just pager or sort values change, which
- // we'll ignore for now
$config = CRM_Core_Config::singleton();
// do this only for contact search
if ($setDynamic && $config->includeAlphabeticalPager) {
- if ($this->_reset ||
- ($this->_sortByCharacter === NULL || $this->_sortByCharacter == '')
- ) {
+ // Don't recompute if we are just paging/sorting
+ if ($this->_reset || (empty($_GET['crmPID']) && empty($_GET['crmSID']) && !$this->_sortByCharacter)) {
$aToZBar = CRM_Utils_PagerAToZ::getAToZBar($selector, $this->_sortByCharacter);
$this->set('AToZBar', $aToZBar);
}
// we dont want to store the sortByCharacter in the formValue, it is more like
// a filter on the result set
// this filter is reset if we click on the search button
- if ($this->_sortByCharacter !== NULL
- && empty($_POST)
- ) {
+ if ($this->_sortByCharacter !== NULL && empty($_POST)) {
if (strtolower($this->_sortByCharacter) == 'all') {
$this->_formValues['sortByCharacter'] = NULL;
}
$this->_formValues['sortByCharacter'] = $this->_sortByCharacter;
}
}
+ else {
+ $this->_sortByCharacter = NULL;
+ }
CRM_Core_BAO_CustomValue::fixFieldValueOfTypeMemo($this->_formValues);
// we dont want to store the sortByCharacter in the formValue, it is more like
// a filter on the result set
// this filter is reset if we click on the search button
- if ($this->_sortByCharacter !== NULL
- && empty($_POST)
- ) {
+ if ($this->_sortByCharacter !== NULL && empty($_POST)) {
if (strtolower($this->_sortByCharacter) == 'all') {
$this->_formValues['sortByCharacter'] = NULL;
}
$this->_formValues['sortByCharacter'] = $this->_sortByCharacter;
}
}
+ else {
+ $this->_sortByCharacter = NULL;
+ }
$this->_params = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$this->_returnProperties = &$this->returnProperties();
$this->_formValues['sortByCharacter'] = $this->_sortByCharacter;
}
}
+ else {
+ $this->_sortByCharacter = NULL;
+ }
$this->_params = &$this->convertFormValues($this->_formValues);
$this->_returnProperties = &$this->returnProperties();