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


PHP CRM_Core_PseudoConstant::getBatchType方法代码示例

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


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

示例1: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->applyFilter('__ALL__', 'trim');
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Batch');
     $this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE);
     $type = $this->add('select', 'type_id', ts('Type'), CRM_Core_PseudoConstant::getBatchType());
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $type->freeze();
     }
     $this->add('textarea', 'description', ts('Description'), $attributes['description']);
     $this->add('text', 'item_count', ts('Number of items'), $attributes['item_count'], TRUE);
     $this->add('text', 'total', ts('Total Amount'), $attributes['total'], TRUE);
     $this->add('select', 'status_id', ts('Status'), CRM_Core_PseudoConstant::getBatchStatus());
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:Batch.php

示例2: getBatchList

 /**
  * This function to get list of batches
  *
  * @param  array   $params associated array for params
  * @access public
  */
 static function getBatchList(&$params)
 {
     $config = CRM_Core_Config::singleton();
     $whereClause = self::whereClause($params, FALSE);
     if (!empty($params['rowCount']) && $params['rowCount'] > 0) {
         $limit = " LIMIT {$params['offset']}, {$params['rowCount']} ";
     }
     $orderBy = ' ORDER BY batch.id desc';
     if (CRM_Utils_Array::value('sort', $params)) {
         $orderBy = ' ORDER BY ' . CRM_Utils_Array::value('sort', $params);
     }
     $query = "\n      SELECT batch.*, c.sort_name created_by \n      FROM  civicrm_batch batch \n      INNER JOIN civicrm_contact c ON batch.created_id = c.id\n    WHERE {$whereClause}\n    {$orderBy}\n    {$limit}";
     $object = CRM_Core_DAO::executeQuery($query, $params, TRUE, 'CRM_Core_DAO_Batch');
     $links = self::links();
     $batchTypes = CRM_Core_PseudoConstant::getBatchType();
     $batchStatus = CRM_Core_PseudoConstant::getBatchStatus();
     $values = array();
     $creatorIds = array();
     while ($object->fetch()) {
         $newLinks = $links;
         $values[$object->id] = array();
         CRM_Core_DAO::storeValues($object, $values[$object->id]);
         $action = array_sum(array_keys($newLinks));
         if ($values[$object->id]['status_id'] == 2) {
             $newLinks = array();
         }
         $values[$object->id]['batch_type'] = $batchTypes[$values[$object->id]['type_id']];
         $values[$object->id]['batch_status'] = $batchStatus[$values[$object->id]['status_id']];
         $values[$object->id]['created_by'] = $object->created_by;
         $values[$object->id]['action'] = CRM_Core_Action::formLink($newLinks, $action, array('id' => $object->id));
     }
     return $values;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:39,代码来源:Batch.php


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