當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_BAO_MessageTemplate::find方法代碼示例

本文整理匯總了PHP中CRM_Core_BAO_MessageTemplate::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_MessageTemplate::find方法的具體用法?PHP CRM_Core_BAO_MessageTemplate::find怎麽用?PHP CRM_Core_BAO_MessageTemplate::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_BAO_MessageTemplate的用法示例。


在下文中一共展示了CRM_Core_BAO_MessageTemplate::find方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: preProcess

 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 static function preProcess(&$form)
 {
     $messageText = array();
     $messageSubject = array();
     $dao = new CRM_Core_BAO_MessageTemplate();
     $dao->is_active = 1;
     $dao->find();
     while ($dao->fetch()) {
         $messageText[$dao->id] = $dao->msg_text;
         $messageSubject[$dao->id] = $dao->msg_subject;
     }
     $form->assign('message', $messageText);
     $form->assign('messageSubject', $messageSubject);
 }
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:20,代碼來源:PDFLetterCommon.php

示例2: findAllTemplates

 /**
  * Returns an array of all templates that can be used
  * to create donation receipts
  * @return array of template objects
  */
 public static function findAllTemplates()
 {
     $messageTemplate = new CRM_Core_BAO_MessageTemplate();
     $messageTemplate->orderBy('msg_title' . ' asc');
     $messageTemplate->find();
     $results = array();
     $workflowId = CRM_Donrec_DataStructure::getFirstUsedOptionValueId();
     while ($messageTemplate->fetch()) {
         if ($messageTemplate->workflow_id == $workflowId) {
             CRM_Core_DAO::storeValues($messageTemplate, $results[$messageTemplate->id]);
         }
     }
     return empty($results) ? NULL : $results;
 }
開發者ID:systopia,項目名稱:de.systopia.donrec,代碼行數:19,代碼來源:Template.php

示例3: preProcess

 /**
  * Build all the data structures needed to build the form.
  *
  * @param CRM_Core_Form $form
  *
  * @return void
  */
 public static function preProcess(&$form)
 {
     $messageText = array();
     $messageSubject = array();
     $dao = new CRM_Core_BAO_MessageTemplate();
     $dao->is_active = 1;
     $dao->find();
     while ($dao->fetch()) {
         $messageText[$dao->id] = $dao->msg_text;
         $messageSubject[$dao->id] = $dao->msg_subject;
     }
     $form->assign('message', $messageText);
     $form->assign('messageSubject', $messageSubject);
     CRM_Utils_System::setTitle('Create Printable Letters (PDF)');
 }
開發者ID:BorislavZlatanov,項目名稱:civicrm-core,代碼行數:22,代碼來源:PDFLetterCommon.php

示例4: browse

 /**
  * browse all entities.
  *
  * @internal param int $action
  *
  * @return void
  * @access public
  */
 function browse()
 {
     $action = func_num_args() ? func_get_arg(0) : NULL;
     if ($this->_action & CRM_Core_Action::ADD) {
         return;
     }
     $links = $this->links();
     if ($action == NULL) {
         if (!empty($links)) {
             $action = array_sum(array_keys($links));
         }
     }
     if ($action & CRM_Core_Action::DISABLE) {
         $action -= CRM_Core_Action::DISABLE;
     }
     if ($action & CRM_Core_Action::ENABLE) {
         $action -= CRM_Core_Action::ENABLE;
     }
     $messageTemplate = new CRM_Core_BAO_MessageTemplate();
     $messageTemplate->orderBy('msg_title' . ' asc');
     $userTemplates = array();
     $workflowTemplates = array();
     // find all objects
     $messageTemplate->find();
     while ($messageTemplate->fetch()) {
         $values[$messageTemplate->id] = array();
         CRM_Core_DAO::storeValues($messageTemplate, $values[$messageTemplate->id]);
         // populate action links
         $this->action($messageTemplate, $action, $values[$messageTemplate->id], $links, CRM_Core_Permission::EDIT);
         if (!$messageTemplate->workflow_id) {
             $userTemplates[$messageTemplate->id] = $values[$messageTemplate->id];
         } elseif (!$messageTemplate->is_reserved) {
             $workflowTemplates[$messageTemplate->id] = $values[$messageTemplate->id];
         }
     }
     $rows = array('userTemplates' => $userTemplates, 'workflowTemplates' => $workflowTemplates);
     $this->assign('rows', $rows);
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:46,代碼來源:MessageTemplates.php

示例5: revert

 /**
  * Revert a message template to its default subject+text+HTML state.
  *
  * @param int $id id of the template
  */
 public static function revert($id)
 {
     $diverted = new CRM_Core_BAO_MessageTemplate();
     $diverted->id = (int) $id;
     $diverted->find(1);
     if ($diverted->N != 1) {
         CRM_Core_Error::fatal(ts('Did not find a message template with id of %1.', array(1 => $id)));
     }
     $orig = new CRM_Core_BAO_MessageTemplate();
     $orig->workflow_id = $diverted->workflow_id;
     $orig->is_reserved = 1;
     $orig->find(1);
     if ($orig->N != 1) {
         CRM_Core_Error::fatal(ts('Message template with id of %1 does not have a default to revert to.', array(1 => $id)));
     }
     $diverted->msg_subject = $orig->msg_subject;
     $diverted->msg_text = $orig->msg_text;
     $diverted->msg_html = $orig->msg_html;
     $diverted->pdf_format_id = is_null($orig->pdf_format_id) ? 'null' : $orig->pdf_format_id;
     $diverted->save();
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:26,代碼來源:MessageTemplate.php


注:本文中的CRM_Core_BAO_MessageTemplate::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。