Skip to content

Commit

Permalink
Merge pull request #10403 from yashodha/CRM-20624
Browse files Browse the repository at this point in the history
CRM-20624
  • Loading branch information
eileenmcnaughton authored Mar 19, 2018
2 parents 853863d + a51902b commit 8c00bf7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Core/BAO/CustomOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static public function getOptionListSelector(&$params) {
$options[$dao->id]['is_default'] = '';
}
}

$options[$dao->id]['description'] = $dao->description;
$options[$dao->id]['class'] = $dao->id . ',' . $class;
$options[$dao->id]['is_active'] = empty($dao->is_active) ? ts('No') : ts('Yes');
$options[$dao->id]['links'] = CRM_Core_Action::formLink($links,
Expand Down
2 changes: 2 additions & 0 deletions CRM/Custom/Form/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function buildQuickForm() {

$this->add('text', 'value', ts('Option Value'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'), TRUE);

$this->add('textarea', 'description', ts('Description'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description'));
// weight
$this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'weight'), TRUE);
$this->addRule('weight', ts('is a numeric field'), 'numeric');
Expand Down Expand Up @@ -406,6 +407,7 @@ public function postProcess() {
$customOption->label = $params['label'];
$customOption->name = CRM_Utils_String::titleToVar($params['label']);
$customOption->weight = $params['weight'];
$customOption->description = $params['description'];
$customOption->value = $params['value'];
$customOption->is_active = CRM_Utils_Array::value('is_active', $params, FALSE);

Expand Down
1 change: 1 addition & 0 deletions CRM/Custom/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static function getOptionList() {
$selectorElements = array(
'label',
'value',
'description',
'is_default',
'is_active',
'links',
Expand Down
3 changes: 3 additions & 0 deletions templates/CRM/Custom/Form/Option.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<tr class="crm-custom_option-form-block-value">
<td class="label">{$form.value.label}</td>
<td>{$form.value.html}</td>
<tr class="crm-custom_option-form-block-desc">
<td class="label">{$form.description.label}</td>
<td>{$form.description.html}</td>
<tr class="crm-custom_option-form-block-weight">
<td class="label">{$form.weight.label}</td>
<td>{$form.weight.html}</td>
Expand Down
2 changes: 2 additions & 0 deletions templates/CRM/Custom/Page/Option.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<tr class="columnheader">
<th class='crm-custom_option-label'>{ts}Label{/ts}</th>
<th class='crm-custom_option-value'>{ts}Value{/ts}</th>
<th class='crm-custom_option-description'>{ts}Description{/ts}</th>
<th class='crm-custom_option-default_value'>{ts}Default{/ts}</th>
<th class='crm-custom_option-is_active'>{ts}Enabled?{/ts}</th>
<th class='crm-custom_option-links'>&nbsp;</th>
Expand Down Expand Up @@ -70,6 +71,7 @@
{sClass:'crm-custom_option-label'},
{sClass:'crm-custom_option-value'},
{sClass:'crm-custom_option-default_value'},
{sClass:'crm-custom_option-default_description'},
{sClass:'crm-custom_option-is_active'},
{sClass:'crm-custom_option-links'},
{sClass:'hiddenElement'}
Expand Down

0 comments on commit 8c00bf7

Please sign in to comment.