CRM-16257 resolved regression caused by previous commit for issue CRM-16157
authoratif-shaikh <shaikh388@gmail.com>
Fri, 10 Apr 2015 14:05:40 +0000 (19:35 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Fri, 10 Apr 2015 14:05:40 +0000 (19:35 +0530)
----------------------------------------
* CRM-16257: "Sorry an error occurred and your information was not saved" if email contains an image or a table
  https://issues.civicrm.org/jira/browse/CRM-16257
* CRM-16157: Option Group - Paper Size Options lost edit ability
  https://issues.civicrm.org/jira/browse/CRM-16157

CRM/Admin/Form/Options.php
templates/CRM/Admin/Form/Options.tpl

index aed51b5186603eccf63ef9514a9ad86e5d61327b..3c92c0bcc95718f7ff5375a319aac36c1c2672a4 100644 (file)
@@ -171,6 +171,13 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       TRUE
     );
 
+    $this->add('text',
+      'value',
+      ts('Value'),
+      CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'),
+      TRUE
+    );
+
     if (!in_array($this->_gName, array(
         'email_greeting',
         'postal_greeting',
@@ -215,12 +222,6 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       $required = TRUE;
     }
     elseif ($this->_gName == 'redaction_rule' || $this->_gName == 'engagement_index') {
-      $this->add('text',
-        'value',
-        ts('Value'),
-        CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'value'),
-        TRUE
-      );
       if ($this->_gName == 'redaction_rule') {
         $this->add('checkbox',
           'filter',
index c1cc4d9fb9670abacbbe413bbcb38a744a1a9cee..eacc079b7c06a137999efc703fba5461de6f72ca 100644 (file)
                 <td>{$form.grouping.html}</td>
             </tr>
       {/if}
+
+      {if $form.value.html && $gName neq 'redaction_rule'}
+        <tr class="crm-admin-options-form-block-value">
+          <td class="label">{$form.value.label}</td>
+          <td>{$form.value.html}<br />
+              <span class="description"><div class="icon ui-icon-alert"></div>{ts}Changing the Value field will unlink records which have been marked with this option. This change can not be undone except by restoring the previous value.{/ts}</span>
+          </td>
+        </tr>
+      {/if}
+
         {if $gName eq 'custom_search'}
            <tr class="crm-admin-options-form-block-search_title">
              <td class="label">{ts}Search Title{/ts}</td>
              </td>
            </tr>
         {else}
-           {if $gName eq 'redaction_rule'}
-              <tr class="crm-admin-options-form-block-replacement">
-                 <td class="label">{ts}Replacement (prefix){/ts}</td>
-                 <td>{$form.value.html}<br />
-                   <span class="description">{ts}Matched values are replaced with this prefix plus a unique code. EX: If replacement prefix for &quot;Vancouver&quot; is <em>city_</em>, occurrences will be replaced with <em>city_39121</em>.{/ts}</span>
-                 </td>
-              </tr>
-            {elseif $form.value.html}
-              <tr class="crm-admin-options-form-block-value">
-                <td class="label">{$form.value.label}</td>
-                <td>{$form.value.html}<br />
-                    <span class="description"><div class="icon ui-icon-alert"></div>{ts}Changing the Value field will unlink records which have been marked with this option. This change can not be undone except by restoring the previous value.{/ts}</span>
-                </td>
-              </tr>
-            {/if}
+          {if $gName eq 'redaction_rule'}
+            <tr class="crm-admin-options-form-block-replacement">
+               <td class="label">{ts}Replacement (prefix){/ts}</td>
+               <td>{$form.value.html}<br />
+                 <span class="description">{ts}Matched values are replaced with this prefix plus a unique code. EX: If replacement prefix for &quot;Vancouver&quot; is <em>city_</em>, occurrences will be replaced with <em>city_39121</em>.{/ts}</span>
+               </td>
+            </tr>
+          {/if}
             {if $form.name.html} {* Get the name value also *}
               <tr class="crm-admin-options-form-block-name">
                 <td class="label">{$form.name.label}</td>