• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CRM_Utils_PagerAToZ类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: 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


示例3: 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


示例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


示例9: createLinks

 /**
  * create the links 
  *
  * @param array  $query          The form values for search
  * @param string $sortByCharacter The character that we are potentially sorting on
  *
  * @return array with links
  * @access private
  * @static
  */
 function createLinks(&$query, $sortByCharacter)
 {
     $AToZBar = CRM_Utils_PagerAToZ::getStaticCharacters();
     $dynamicAlphabets = CRM_Utils_PagerAToZ::getDynamicCharacters($query);
     $AToZBar = array_merge($AToZBar, $dynamicAlphabets);
     $AToZBar = array_unique($AToZBar);
     //get the current path
     $path = CRM_Utils_System::currentPath();
     $aToZBar = array();
     foreach ($AToZBar as $key => $link) {
         if (!$link) {
             continue;
         }
         $element = array();
         if (in_array($link, $dynamicAlphabets)) {
             $klass = '';
             if ($link == $sortByCharacter) {
                 $element['class'] = "active";
                 $klass = 'class="active"';
             }
             $element['item'] = sprintf('<a href="%s" %s>%s</a>', CRM_Utils_System::url($path, "q={$path}&force=1&sortByCharacter={$link}", true, null, false), $klass, $link);
         } else {
             $element['item'] = $link;
         }
         $aToZBar[] = $element;
     }
     $url = sprintf('<a href="%s">%s</a>', CRM_Utils_System::url($path, "q={$path}&force=1&sortByCharacter=1"), 'All');
     $aToZBar[] = array('item' => $url);
     return $aToZBar;
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:40,代码来源:PagerAToZ.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CRM_Utils_Recent类代码示例发布时间:2022-05-20
下一篇:
PHP CRM_Utils_PDF_Utils类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap