本文整理汇总了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());
}
示例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;
}