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


PHP CRM_PCP_BAO_PCP::thermoMeter方法代码示例

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


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

示例1: run


//.........这里部分代码省略.........
         CRM_Core_DAO::commonRetrieveAll($page_class, 'id', $pcpInfo['page_id'], $default, array('start_date', 'end_date'));
     }
     $pageInfo = $default[$pcpInfo['page_id']];
     if ($pcpInfo['contact_id'] == $session->get('userID')) {
         $owner = $pageInfo;
         $owner['status'] = CRM_Utils_Array::value($pcpInfo['status_id'], $pcpStatus);
         $this->assign('owner', $owner);
         $link = CRM_PCP_BAO_PCP::pcpLinks();
         $hints = array(CRM_Core_Action::UPDATE => ts('Change the content and appearance of your page'), CRM_Core_Action::DETACH => ts('Send emails inviting your friends to support your campaign!'), CRM_Core_Action::VIEW => ts('Copy this link to share directly with your network!'), CRM_Core_Action::BROWSE => ts('Update your personal contact information'), CRM_Core_Action::DISABLE => ts('De-activate the page (you can re-activate it later)'), CRM_Core_Action::ENABLE => ts('Activate the page (you can de-activate it later)'), CRM_Core_Action::DELETE => ts('Remove the page (this cannot be undone!)'));
         $replace = array('id' => $this->_id, 'block' => $pcpBlock->id, 'pageComponent' => $this->_component);
         if (!$pcpBlock->is_tellfriend_enabled || CRM_Utils_Array::value('status_id', $pcpInfo) != $approvedId) {
             unset($link['all'][CRM_Core_Action::DETACH]);
         }
         switch ($pcpInfo['is_active']) {
             case 1:
                 unset($link['all'][CRM_Core_Action::ENABLE]);
                 break;
             case 0:
                 unset($link['all'][CRM_Core_Action::DISABLE]);
                 break;
         }
         $this->assign('links', $link['all']);
         $this->assign('hints', $hints);
         $this->assign('replace', $replace);
     }
     $honor = CRM_PCP_BAO_PCP::honorRoll($this->_id);
     $entityFile = CRM_Core_BAO_File::getEntityFile('civicrm_pcp', $this->_id);
     if (!empty($entityFile)) {
         $fileInfo = reset($entityFile);
         $fileId = $fileInfo['fileID'];
         $image = '<img src="' . CRM_Utils_System::url('civicrm/file', "reset=1&id={$fileId}&eid={$this->_id}") . '" />';
         $this->assign('image', $image);
     }
     $totalAmount = CRM_PCP_BAO_PCP::thermoMeter($this->_id);
     $achieved = round($totalAmount / $pcpInfo['goal_amount'] * 100, 2);
     if ($pcpBlock->is_active == 1) {
         $linkTextUrl = CRM_Utils_System::url('civicrm/contribute/campaign', "action=add&reset=1&pageId={$pcpInfo['page_id']}&component={$pcpInfo['page_type']}", TRUE, NULL, TRUE, TRUE);
         $this->assign('linkTextUrl', $linkTextUrl);
         $this->assign('linkText', $pcpBlock->link_text);
     }
     $this->assign('honor', $honor);
     $this->assign('total', $totalAmount ? $totalAmount : '0.0');
     $this->assign('achieved', $achieved <= 100 ? $achieved : 100);
     if ($achieved <= 100) {
         $this->assign('remaining', 100 - $achieved);
     }
     // make sure that we are between contribution page start and end dates OR registration start date and end dates if they are set
     if ($pcpBlock->entity_table == 'civicrm_event') {
         $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_start_date', $pageInfo));
         $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_end_date', $pageInfo));
     } else {
         $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('start_date', $pageInfo));
         $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $pageInfo));
     }
     $now = time();
     $validDate = TRUE;
     if ($startDate && $startDate >= $now) {
         $validDate = FALSE;
     }
     if ($endDate && $endDate < $now) {
         $validDate = FALSE;
     }
     $this->assign('validDate', $validDate);
     // form parent page url
     if ($action == CRM_Core_Action::PREVIEW) {
         $parentUrl = CRM_Utils_System::url($urlBase, "id={$pcpInfo['page_id']}&reset=1&action=preview", TRUE, NULL, TRUE, TRUE);
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:67,代码来源:PCPInfo.php

示例2: getEventPcps

 static function getEventPcps($eventId)
 {
     if (empty($eventId)) {
         return null;
     }
     $return = array();
     $eventDetails = civicrm_api('Pcpteams', 'getallpagesbyevent', array('version' => 3, 'page_id' => $eventId));
     $return['pcp_count'] = $eventDetails['count'];
     if ($eventDetails['count'] > 0) {
         foreach ($eventDetails['values'] as $pcps) {
             $pcpAmounts[$pcps['id']] = CRM_PCP_BAO_PCP::thermoMeter($pcps['id']);
         }
     }
     $maxAmoutnRaisedPcp = array_search(max($pcpAmounts), $pcpAmounts);
     $return['rank'] = $maxAmoutnRaisedPcp;
     $return['rankHolder'] = $eventDetails['values'][$maxAmoutnRaisedPcp]['title'];
     return $return;
 }
开发者ID:eruraindil,项目名称:uk.co.vedaconsulting.pcpteams,代码行数:18,代码来源:Utils.php


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