<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$errors['title'] = ts('Custom group \'%1\' already exists in Database.', array(1 => $title));
}
- if (CRM_Utils_Array::value(1, $fields['extends'])) {
+ if (!empty($fields['extends'][1])) {
if (in_array('', $fields['extends'][1]) && count($fields['extends'][1]) > 1) {
$errors['extends'] = ts("Cannot combine other option with 'Any'.");
}
$self->assign('showStyle', TRUE);
}
- if (CRM_Utils_Array::value('is_multiple', $fields)) {
+ if (!empty($fields['is_multiple'])) {
$self->assign('showMultiple', TRUE);
}
$sel2['ParticipantRole'] = $participantRole;
$sel2['ParticipantEventName'] = CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$sel2['ParticipantEventType'] = $eventType;
- $sel2['Contribution'] = CRM_Contribute_PseudoConstant::financialType( );
+ $sel2['Contribution'] = CRM_Contribute_PseudoConstant::financialType();
$sel2['Relationship'] = $allRelationshipType;
$sel2['Individual'] = CRM_Contact_BAO_ContactType::subTypePairs('Individual', FALSE, NULL);
'extends',
ts('Used For'),
array(
- 'onClick' => 'showHideStyle();',
'name' => 'extends[0]',
- 'style' => 'vertical-align: top;',
+ 'style' => 'vertical-align: top;'
),
TRUE
);
$this->addElement('checkbox', 'is_active', ts('Is this Custom Data Set active?'));
// does this set have multiple record?
- $multiple = $this->addElement('checkbox',
- 'is_multiple',
- ts('Does this Custom Field Set allow multiple records?'),
- NULL,
- array('onclick' => "showRange();")
- );
+ $multiple = $this->addElement('checkbox', 'is_multiple',
+ ts('Does this Custom Field Set allow multiple records?'), NULL);
// $min_multiple = $this->add('text', 'min_multiple', ts('Minimum number of multiple records'), $attributes['min_multiple'] );
// $this->addRule('min_multiple', ts('is a numeric field') , 'numeric');
$defaults['is_active'] = $defaults['collapse_display'] = 1;
$defaults['style'] = 'Inline';
}
- elseif (!CRM_Utils_Array::value('max_multiple', $defaults) && !$this->_isGroupEmpty) {
+ elseif (empty($defaults['max_multiple']) && !$this->_isGroupEmpty) {
$this->assign('showMaxMultiple', FALSE);
}
+ if (($this->_action & CRM_Core_Action::UPDATE) && $defaults['is_multiple']) {
+ $defaults['collapse_display'] = 0;
+ }
+
if (isset($defaults['extends'])) {
$extends = $defaults['extends'];
unset($defaults['extends']);
/*
* Function to return a formatted list of relationship name.
* @param $list array array of relationship name.
- * @static
+ * @static
* return array array of relationship name.
*/
static function getFormattedList(&$list) {