From 139f5f764cf531ff700d1932250c257bea805281 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Fri, 28 Jul 2017 10:56:28 +0530 Subject: [PATCH] CRM-20979 - help for price fields not exposed to UI --- CRM/Price/Form/Field.php | 6 +++++- templates/CRM/Price/Form/Field.tpl | 11 ++++++++++- templates/CRM/Price/Form/PriceSet.tpl | 7 ++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index f17e11ad16..d694510d1d 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -322,8 +322,12 @@ class CRM_Price_Form_Field extends CRM_Core_Form { $this->add('text', 'options_per_line', ts('Options Per Line')); $this->addRule('options_per_line', ts('must be a numeric value'), 'numeric'); + $this->add('textarea', 'help_pre', ts('Pre Field Help'), + CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'help_post') + ); + // help post, mask, attributes, javascript ? - $this->add('textarea', 'help_post', ts('Field Help'), + $this->add('textarea', 'help_post', ts('Post Field Help'), CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceField', 'help_post') ); diff --git a/templates/CRM/Price/Form/Field.tpl b/templates/CRM/Price/Form/Field.tpl index d21821485a..cddc9e0a35 100644 --- a/templates/CRM/Price/Form/Field.tpl +++ b/templates/CRM/Price/Form/Field.tpl @@ -158,11 +158,20 @@ + + {$form.help_pre.label} + {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field' field='help_pre' id=$fid}{/if}{$form.help_pre.html|crmAddClass:huge}  + {if $action neq 4} +
{ts}Explanatory text displayed to users at the beginning of this field.{/ts}
+ {/if} + + + {$form.help_post.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field' field='help_post' id=$fid}{/if}{$form.help_post.html|crmAddClass:huge}  {if $action neq 4} -
{ts}Explanatory text displayed to users for this field.{/ts}
+
{ts}Explanatory text displayed to users below this field.{/ts}
{/if} diff --git a/templates/CRM/Price/Form/PriceSet.tpl b/templates/CRM/Price/Form/PriceSet.tpl index ad741fe9db..a7afef8971 100644 --- a/templates/CRM/Price/Form/PriceSet.tpl +++ b/templates/CRM/Price/Form/PriceSet.tpl @@ -42,6 +42,9 @@ {assign var="element_name" value="price_"|cat:$field_id}
{$form.$element_name.label}
+ {if $element.help_pre} +
{$element.help_pre}
+ {/if} {assign var="elementCount" value="0"} {assign var="optionCount" value="0"} {assign var="rowCount" value="0"} @@ -69,7 +72,9 @@ {assign var="element_name" value="price_"|cat:$field_id}
{$form.$element_name.label}
-
{$form.$element_name.html} +
+ {if $element.help_pre}{$element.help_pre}
{/if} + {$form.$element_name.html} {if $element.html_type eq 'Text'} {if $element.is_display_amounts} -- 2.25.1