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


PHP CRM_Contribute_PseudoConstant::pcpstatus方法代码示例

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


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

示例1: browse

 /**
  * Browse all custom data groups.
  *  
  * 
  * @return void
  * @access public
  * @static
  */
 function browse($action = null)
 {
     require_once 'CRM/Contact/BAO/GroupNesting.php';
     $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
     if ($this->_sortByCharacter == 1 || !empty($_POST)) {
         $this->_sortByCharacter = '';
     }
     require_once 'CRM/Contribute/PseudoConstant.php';
     $status = CRM_Contribute_PseudoConstant::pcpstatus();
     $contribution_page = CRM_Contribute_PseudoConstant::contributionPage();
     $pcpSummary = $params = array();
     $whereClause = null;
     if (!empty($_POST)) {
         if ($_POST['status_id'] != 0) {
             $whereClause = ' AND cp.status_id = %1';
             $params['1'] = array($_POST['status_id'], 'Integer');
         }
         if ($_POST['contibution_page_id'] != 0) {
             $whereClause .= ' AND cp.contribution_page_id = %2';
             $params['2'] = array($_POST['contibution_page_id'], 'Integer');
         }
         if ($_POST['status_id'] != 0 || $_POST['contibution_page_id'] != 0) {
             $this->set('whereClause', $whereClause);
             $this->set('params', $params);
         } else {
             $this->set('whereClause', null);
             $this->set('params', null);
         }
     }
     $approvedId = CRM_Core_OptionGroup::getValue('pcp_status', 'Approved', 'name');
     //check for delete CRM-4418
     require_once 'CRM/Core/Permission.php';
     $allowToDelete = CRM_Core_Permission::check('delete in CiviContribute');
     $params = $this->get('params') ? $this->get('params') : array();
     $title = ' AND cp.title LIKE %3';
     $params['3'] = array($this->_sortByCharacter . '%', 'String');
     $query = "\n        SELECT cp.id as id, contact_id , status_id, cp.title as title, contribution_page_id, start_date, end_date, cp.is_active as active\n        FROM civicrm_pcp cp, civicrm_contribution_page cpp\n        WHERE cp.contribution_page_id = cpp.id {$title}" . $this->get('whereClause') . " ORDER BY status_id";
     $dao = CRM_Core_DAO::executeQuery($query, $params, true, 'CRM_Contribute_DAO_PCP');
     while ($dao->fetch()) {
         $pcpSummary[$dao->id] = array();
         $action = array_sum(array_keys($this->links()));
         CRM_Core_DAO::storeValues($dao, $pcpSummary[$dao->id]);
         require_once 'CRM/Contact/BAO/Contact.php';
         $contact = CRM_Contact_BAO_Contact::getDisplayAndImage($dao->contact_id);
         $class = '';
         if ($dao->status_id != $approvedId || $dao->active != 1) {
             $class = 'disabled';
         }
         switch ($dao->status_id) {
             case 2:
                 $action -= CRM_Core_Action::RENEW;
                 break;
             case 3:
                 $action -= CRM_Core_Action::REVERT;
                 break;
         }
         if (!$allowToDelete) {
             $action -= CRM_Core_Action::DELETE;
         }
         $pcpSummary[$dao->id]['id'] = $dao->id;
         $pcpSummary[$dao->id]['start_date'] = $dao->start_date;
         $pcpSummary[$dao->id]['end_date'] = $dao->end_date;
         $pcpSummary[$dao->id]['supporter'] = $contact['0'];
         $pcpSummary[$dao->id]['supporter_id'] = $dao->contact_id;
         $pcpSummary[$dao->id]['status_id'] = $status[$dao->status_id];
         $pcpSummary[$dao->id]['contribution_page_id'] = $dao->contribution_page_id;
         $pcpSummary[$dao->id]['contribution_page_title'] = $contribution_page[$dao->contribution_page_id];
         $pcpSummary[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $dao->id));
         $pcpSummary[$dao->id]['class'] = $class;
     }
     $this->search();
     $this->pagerAToZ($this->get('whereClause'), $params);
     if ($pcpSummary) {
         $this->assign('rows', $pcpSummary);
     }
     // Let template know if user has run a search or not
     if ($this->get('whereClause')) {
         $this->assign('isSearch', 1);
     } else {
         $this->assign('isSearch', 0);
     }
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:90,代码来源:PCP.php

示例2: buildQuickForm

 /**
  * Function to actually build the form
  * 
  * @param null
  * 
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete Campaign'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
     } else {
         require_once 'CRM/Contribute/PseudoConstant.php';
         $status = array_merge(array(ts('- select -')), CRM_Contribute_PseudoConstant::pcpstatus());
         $contribution_page = array_merge(array(ts('- select -')), CRM_Contribute_PseudoConstant::contributionPage());
         $this->addElement('select', 'status_id', ts('Personal Campaign Pages Status'), $status);
         $this->addElement('select', 'contibution_page_id', ts('Contribution Page'), $contribution_page);
         $this->addButtons(array(array('type' => 'refresh', 'name' => ts('Show'), 'spacing' => '         ', 'isDefault' => true)));
         parent::buildQuickForm();
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:22,代码来源:PCP.php


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