$customGroupStyle = array(
'Tab' => ts('Tab'),
'Inline' => ts('Inline'),
+ 'Tab with table' => ts('Tab with table')
);
}
return $customGroupStyle;
if (isset($dontShowLink)) {
$this->assign('dontShowLink', $dontShowLink);
}
+ if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple', 'id')) {
+ $defaults['in_selector'] = 1;
+ }
+
return $defaults;
}
' '
);
$sel->setOptions(array($dt, $it));
+
+ if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_multiple')) {
+ $this->add('checkbox', 'in_selector', ts('Display in Table?'));
+ }
+
if ($this->_action == CRM_Core_Action::UPDATE) {
$this->freeze('data_type');
}
$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']);
-- CRM-14183
INSERT INTO civicrm_state_province (country_id, abbreviation, name) VALUES (1157, "PL", "Plateau");
UPDATE civicrm_state_province SET name = "Abuja Federal Capital Territory" WHERE name = "Abuja Capital Territory";
+
+-- CRM-13992
+ALTER TABLE `civicrm_custom_field`
+ ADD COLUMN `in_selector` tinyint(4) DEFAULT '0' COMMENT 'Should the multi-record custom field values be displayed in tab table listing';
+UPDATE civicrm_custom_field cf
+ LEFT JOIN civicrm_custom_group cg
+ ON cf.custom_group_id = cg.id
+ SET cf.in_selector = 1
+ WHERE cg.is_multiple = 1 AND cf.html_type != 'TextArea';
\ No newline at end of file
{/if}
</td>
</tr>
- <tr class="crm-custom-field-form-block-text_length" id="textLength" {if !( $action eq 1 || $action eq 2 ) && ($form.data_type.value.0.0 != 0)}class="hide-block"{/if}>
+ <tr class='crm-custom-field-form-block-in_selector'>
+ <td class='label'>{$form.in_selector.label}</td>
+ <td class='html-adjust'>{$form.in_selector.html}</td>
+ </tr>
+ <tr class="crm-custom-field-form-block-text_length" id="textLength" {if !( $action eq 1 || $action eq 2 ) && ($form.data_type.value.0.0 != 0)}class="hide-block"{/if}>
<td class="label">{$form.text_length.label}</td>
<td class="html-adjust">{$form.text_length.html}</td>
</tr>
function showRange(onFormLoad) {
if(cj("#is_multiple :checked").length) {
cj("tr#multiple").show();
- cj("select#style option[value='Tab']").prop("selected", true);
+ cj('#collapse_display').prop('checked', '');
+ cj("select#style option[value='Tab with table']").prop("selected", true);
}
else {
+ cj('#collapse_display').prop('checked', 'checked');
cj("tr#multiple").hide();
if (!onFormLoad) {
cj("select#style option[value='Inline']").prop("selected", true);
<comment>Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.</comment>
<add>4.1</add>
</field>
+ <field>
+ <name>in_selector</name>
+ <type>boolean</type>
+ <default>0</default>
+ <comment>Should the multi-record custom field values be displayed in tab table listing</comment>
+ <add>4.5</add>
+ </field>
<index>
<name>UI_label_custom_group_id</name>
<fieldName>label</fieldName>
<field>
<name>style</name>
<type>varchar</type>
- <length>8</length>
+ <length>15</length>
<comment>Visual relationship between this form and its parent.</comment>
<pseudoconstant>
<callback>CRM_Core_SelectValues::customGroupStyle</callback>