/**
* Constants for number of options for data types of multiple option.
*/
- CONST NUM_OPTION = 11;
+ const NUM_OPTION = 11;
/**
* The custom group id saved to the session for an update
*
* @var int
- * @access protected
*/
protected $_gid;
* The field id, used when editing the field
*
* @var int
- * @access protected
*/
protected $_id;
* The default custom data/input types, when editing the field
*
* @var array
- * @access protected
*/
protected $_defaultDataType;
* @param null
*
* @return void
- * @access public
*/
public function preProcess() {
if (!(self::$_dataTypeKeys)) {
if (self::$_dataToLabels == NULL) {
self::$_dataToLabels = array(
- array('Text' => ts('Text'), 'Select' => ts('Select'),
- 'Radio' => ts('Radio'), 'CheckBox' => ts('CheckBox'), 'Multi-Select' => ts('Multi-Select'),
+ array(
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
+ 'Radio' => ts('Radio'),
+ 'CheckBox' => ts('CheckBox'),
+ 'Multi-Select' => ts('Multi-Select'),
'AdvMulti-Select' => ts('Adv Multi-Select (obsolete)'),
'Autocomplete-Select' => ts('Autocomplete-Select'),
),
- array('Text' => ts('Text'), 'Select' => ts('Select'),
+ array(
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
- array('Text' => ts('Text'), 'Select' => ts('Select'),
+ array(
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
- array('Text' => ts('Text'), 'Select' => ts('Select'),
+ array(
+ 'Text' => ts('Text'),
+ 'Select' => ts('Select'),
'Radio' => ts('Radio'),
),
array('TextArea' => ts('TextArea'), 'RichTextEditor' => ts('Rich Text Editor')),
* @param null
*
* @return array array of default values
- * @access public
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
$defaults = $this->_values;
if ($this->_id) {
* @param null
*
* @return void
- * @access public
*/
public function buildQuickForm() {
if ($this->_gid) {
$optionTypes = array('1' => ts('Create a new set of options'));
}
else {
- $optionTypes = array('1' => ts('Create a new set of options'),
+ $optionTypes = array(
+ '1' => ts('Create a new set of options'),
'2' => ts('Reuse an existing set'),
);
'onclick' => "showOptionSelect();"), '<br/>'
);
-
$contactGroups = CRM_Core_PseudoConstant::group();
asort($contactGroups);
/**
* Global validation rules for the form
*
- * @param array $fields posted values of the form
+ * @param array $fields
+ * Posted values of the form.
*
* @param $files
* @param $self
* @return array if errors then list of errors to be posted back to the form,
* true otherwise
* @static
- * @access public
*/
- static function formRule($fields, $files, $self) {
+ public static function formRule($fields, $files, $self) {
$default = CRM_Utils_Array::value('default_value', $fields);
$errors = array();
$name = CRM_Utils_String::munge($title, '_', 64);
$gId = $self->_gid; // CRM-7564
$query = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4';
- $fldCnt = CRM_Core_DAO::singleValueQuery($query, array(1 => array($name, 'String'),
+ $fldCnt = CRM_Core_DAO::singleValueQuery($query, array(
+ 1 => array($name, 'String'),
2 => array($title, 'String'),
- 3 => array((int)$self->_id, 'Integer'),
+ 3 => array((int) $self->_id, 'Integer'),
4 => array($gId, 'Integer'),
));
if ($fldCnt) {
* @param null
*
* @return void
- * @access public
*/
public function postProcess() {
// store the submitted values in an array
$this->ajaxResponse['customField'] = $customField->toArray();
}
}
-