当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Utils_PagerAToZ::getAToZBar方法代码示例

本文整理汇总了PHP中CRM_Utils_PagerAToZ::getAToZBar方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_PagerAToZ::getAToZBar方法的具体用法?PHP CRM_Utils_PagerAToZ::getAToZBar怎么用?PHP CRM_Utils_PagerAToZ::getAToZBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Utils_PagerAToZ的用法示例。


在下文中一共展示了CRM_Utils_PagerAToZ::getAToZBar方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pagerAtoZ

 function pagerAtoZ($whereClause, $whereParams)
 {
     require_once 'CRM/Utils/PagerAToZ.php';
     $query = "\n SELECT UPPER(LEFT(cp.title, 1)) as sort_name\n     FROM civicrm_pcp cp, civicrm_contribution_page cpp\n   WHERE cp.contribution_page_id = cpp.id {$whereClause}\n ORDER BY LEFT(cp.title, 1);\n        ";
     $dao = CRM_Core_DAO::executeQuery($query, $whereParams);
     $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, true);
     $this->assign('aToZ', $aToZBar);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:8,代码来源:PCP.php

示例2: postProcess

 /**
  * Common post processing.
  */
 public function postProcess()
 {
     /*
      * sometime we do a postProcess early on, so we dont need to repeat it
      * this will most likely introduce some more bugs :(
      */
     if ($this->_done) {
         return;
     }
     $this->_done = TRUE;
     //for prev/next pagination
     $crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
     if (array_key_exists($this->_searchButtonName, $_POST) || $this->_force && !$crmPID) {
         //reset the cache table for new search
         $cacheKey = "civicrm search {$this->controller->_key}";
         CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);
     }
     //get the button name
     $buttonName = $this->controller->getButtonName();
     if (isset($this->_ufGroupID) && empty($this->_formValues['uf_group_id'])) {
         $this->_formValues['uf_group_id'] = $this->_ufGroupID;
     }
     if (isset($this->_componentMode) && empty($this->_formValues['component_mode'])) {
         $this->_formValues['component_mode'] = $this->_componentMode;
     }
     if (isset($this->_operator) && empty($this->_formValues['operator'])) {
         $this->_formValues['operator'] = $this->_operator;
     }
     if (empty($this->_formValues['qfKey'])) {
         $this->_formValues['qfKey'] = $this->controller->_key;
     }
     if (!CRM_Core_Permission::check('access deleted contacts')) {
         unset($this->_formValues['deleted_contacts']);
     }
     $this->set('type', $this->_action);
     $this->set('formValues', $this->_formValues);
     $this->set('queryParams', $this->_params);
     $this->set('returnProperties', $this->_returnProperties);
     if ($buttonName == $this->_actionButtonName) {
         // check actionName and if next, then do not repeat a search, since we are going to the next page
         // hack, make sure we reset the task values
         $stateMachine = $this->controller->getStateMachine();
         $formName = $stateMachine->getTaskFormName();
         $this->controller->resetPage($formName);
         return;
     } else {
         $output = CRM_Core_Selector_Controller::SESSION;
         // create the selector, controller and run - store results in session
         $searchChildGroups = TRUE;
         if ($this->get('isAdvanced')) {
             $searchChildGroups = FALSE;
         }
         $setDynamic = FALSE;
         if (strpos(self::$_selectorName, 'CRM_Contact_Selector') !== FALSE) {
             $selector = new self::$_selectorName($this->_customSearchClass, $this->_formValues, $this->_params, $this->_returnProperties, $this->_action, FALSE, $searchChildGroups, $this->_context, $this->_contextMenu);
             $setDynamic = TRUE;
         } else {
             $selector = new self::$_selectorName($this->_params, $this->_action, NULL, FALSE, NULL, "search", "advanced");
         }
         $selector->setKey($this->controller->_key);
         // added the sorting  character to the form array
         $config = CRM_Core_Config::singleton();
         // do this only for contact search
         if ($setDynamic && $config->includeAlphabeticalPager) {
             // 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);
             }
         }
         $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));
         }
         $controller = new CRM_Contact_Selector_Controller($selector, $this->get(CRM_Utils_Pager::PAGE_ID), $sortID, CRM_Core_Action::VIEW, $this, $output);
         $controller->setEmbedded(TRUE);
         $controller->setDynamicAction($setDynamic);
         $controller->run();
     }
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:83,代码来源:Search.php

示例3: pagerAtoZ

 /**
  * @param $whereClause
  * @param array $whereParams
  */
 public function pagerAtoZ($whereClause, $whereParams)
 {
     $query = "\nSELECT DISTINCT UPPER(LEFT(title, 1)) as sort_name\nFROM civicrm_contribution_page\nWHERE {$whereClause}\nORDER BY LEFT(title, 1)\n";
     $dao = CRM_Core_DAO::executeQuery($query, $whereParams);
     $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, TRUE);
     $this->assign('aToZ', $aToZBar);
 }
开发者ID:nyimbi,项目名称:civicrm-core,代码行数:11,代码来源:ContributionPage.php

示例4: postProcess

 /**
  * Common post processing
  *
  * @return void
  * @access public
  */
 function postProcess()
 {
     /*
      * sometime we do a postProcess early on, so we dont need to repeat it
      * this will most likely introduce some more bugs :(
      */
     if ($this->_done) {
         return;
     }
     $this->_done = true;
     //get the button name
     $buttonName = $this->controller->getButtonName();
     if (isset($this->_ufGroupID) && !CRM_Utils_Array::value('uf_group_id', $this->_formValues)) {
         $this->_formValues['uf_group_id'] = $this->_ufGroupID;
     }
     $this->set('type', $this->_action);
     $this->set('formValues', $this->_formValues);
     $this->set('queryParams', $this->_params);
     $this->set('returnProperties', $this->_returnProperties);
     if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) {
         // check actionName and if next, then do not repeat a search, since we are going to the next page
         // hack, make sure we reset the task values
         $stateMachine =& $this->controller->getStateMachine();
         $formName = $stateMachine->getTaskFormName();
         $this->controller->resetPage($formName);
         return;
     } else {
         $output = CRM_Core_Selector_Controller::SESSION;
         // create the selector, controller and run - store results in session
         $searchChildGroups = true;
         $session =& CRM_Core_Session::singleton();
         if ($session->get('isAdvanced')) {
             $searchChildGroups = false;
         }
         eval('$selector =& new ' . $this->_selectorName . '( $this->_customSearchClass,
                  $this->_formValues,
                  $this->_params,
                  $this->_returnProperties,
                  $this->_action,
                  false,
                  $searchChildGroups,
                  $this->_context,
                  $this->_contextMenu );');
         // 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();
         if ($config->includeAlphabeticalPager) {
             if ($this->_reset || !$this->_sortByCharacter) {
                 $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($selector, $this->_sortByCharacter);
                 $this->set('AToZBar', $aToZBar);
             }
         }
         $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));
         }
         $controller =& new CRM_Contact_Selector_Controller($selector, $this->get(CRM_Utils_Pager::PAGE_ID), $sortID, CRM_Core_Action::VIEW, $this, $output);
         $controller->setEmbedded(true);
         $controller->run();
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:69,代码来源:Search.php

示例5: pagerAtoZ

 /**
  * @param $whereClause
  * @param array $whereParams
  *
  * @return string
  */
 public function pagerAtoZ($whereClause, $whereParams)
 {
     $query = "\n        SELECT DISTINCT UPPER(LEFT(groups.title, 1)) as sort_name\n        FROM  civicrm_group groups\n        WHERE {$whereClause}\n        ORDER BY LEFT(groups.title, 1)\n            ";
     $dao = CRM_Core_DAO::executeQuery($query, $whereParams);
     return CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, TRUE);
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:12,代码来源:Group.php

示例6: pagerAtoZ

 function pagerAtoZ()
 {
     require_once 'CRM/Utils/PagerAToZ.php';
     $params = array();
     $whereClause = $this->whereClause($params, false);
     $query = "\n   SELECT DISTINCT UPPER(LEFT(name, 1)) as sort_name\n     FROM civicrm_mailing\nLEFT JOIN civicrm_mailing_job ON (civicrm_mailing_job.mailing_id = civicrm_mailing.id)\nLEFT JOIN civicrm_contact createdContact ON ( civicrm_mailing.created_id = createdContact.id )\nLEFT JOIN civicrm_contact scheduledContact ON ( civicrm_mailing.scheduled_id = scheduledContact.id ) \n      AND {$whereClause}\n ORDER BY LEFT(name, 1)\n";
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_parent->_sortByCharacter, true);
     $this->_parent->assign('aToZ', $aToZBar);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:10,代码来源:Browse.php

示例7: pagerAtoZ

 /**
  * @param $whereClause
  * @param $whereParams
  */
 function pagerAtoZ($whereClause, $whereParams)
 {
     $where = '';
     if ($whereClause) {
         if (strpos($whereClause, ' AND') == 0) {
             $whereClause = substr($whereClause, 4);
         }
         $where = 'WHERE ' . $whereClause;
     }
     $query = "\n SELECT UPPER(LEFT(cp.title, 1)) as sort_name\n FROM civicrm_pcp cp\n   " . $where . "\n ORDER BY LEFT(cp.title, 1);\n        ";
     $dao = CRM_Core_DAO::executeQuery($query, $whereParams);
     $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($dao, $this->_sortByCharacter, TRUE);
     $this->assign('aToZ', $aToZBar);
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:18,代码来源:PCP.php

示例8: postProcessCommon

 /**
  * Common post processing
  *
  * @return void
  * @access public
  */
 function postProcessCommon()
 {
     /*
      * sometime we do a postProcess early on, so we dont need to repeat it
      * this will most likely introduce some more bugs :(
      */
     if ($this->_done) {
         return;
     }
     $this->_done = true;
     //get the button name
     $buttonName = $this->controller->getButtonName();
     // 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 && $buttonName != $this->_searchButtonName) {
         if ($this->_sortByCharacter == 1) {
             $this->_formValues['sortByCharacter'] = null;
         } else {
             $this->_formValues['sortByCharacter'] = $this->_sortByCharacter;
         }
     }
     $this->set('type', $this->_action);
     $this->set('formValues', $this->_formValues);
     if ($buttonName == $this->_actionButtonName || $buttonName == $this->_printButtonName) {
         // check actionName and if next, then do not repeat a search, since we are going to the next page
         // hack, make sure we reset the task values
         $stateMachine =& $this->controller->getStateMachine();
         $formName = $stateMachine->getTaskFormName();
         $this->controller->resetPage($formName);
         return;
     } else {
         // do export stuff
         if ($buttonName == $this->_exportButtonName) {
             //$output = CRM_Core_Selector_Controller::EXPORT;
             return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/export/contact'));
         } else {
             $output = CRM_CORE_SELECTOR_CONTROLLER_SESSION;
         }
         // create the selector, controller and run - store results in session
         $selector =& new CRM_Contact_Selector($this->_formValues, $this->_action);
         // 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
         $query =& $selector->getQuery();
         $aToZBar = CRM_Utils_PagerAToZ::getAToZBar($query, $this->_sortByCharacter);
         $this->set('AToZBar', $aToZBar);
         $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));
         }
         $controller =& new CRM_Contact_Selector_Controller($selector, $this->get(CRM_UTILS_PAGER_PAGE_ID), $sortID, CRM_CORE_ACTION_VIEW, $this, $output);
         $controller->setEmbedded(true);
         $controller->run();
     }
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:63,代码来源:Search.php


注:本文中的CRM_Utils_PagerAToZ::getAToZBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。