当前位置: 首页>>代码示例>>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;未经允许,请勿转载。