<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
/**
* Function to build the form
*
- * @return None
+ * @return void
* @access public
*/
public function buildQuickForm() {
$attributes = CRM_Core_DAO::getAttribute('CRM_Batch_DAO_Batch');
$this->add('text', 'title', ts('Batch Name'), $attributes['name'], TRUE);
- $batchTypes = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'type_id');
+ $batchTypes = CRM_Batch_BAO_Batch::buildOptions('type_id');
// unset non-related types
unset($batchTypes[3]);
}
$this->add('textarea', 'description', ts('Description'), $attributes['description']);
- $this->add('text', 'item_count', ts('Number of items'), $attributes['item_count'], TRUE);
+ $this->add('text', 'item_count', ts('Number of Items'), $attributes['item_count'], TRUE);
$this->add('text', 'total', ts('Total Amount'), $attributes['total'], TRUE);
}
*
* @access public
*
- * @return None
+ * @return void
*/
function setDefaultValues() {
$defaults = array();
else {
$defaults = $this->_values;
}
-
-
return $defaults;
}
*
* @access public
*
- * @return None
+ * @return void
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
}
// always create with data entry status
- $params['status_id'] = 3;
+ $params['status_id'] = CRM_Core_OptionGroup::getValue('batch_status','Data Entry', 'name');
$batch = CRM_Batch_BAO_Batch::create($params);
// redirect to batch entry page.