template cleanup
authorKurund Jalmi <kurund@civicrm.org>
Wed, 29 May 2013 09:27:12 +0000 (14:57 +0530)
committerKurund Jalmi <kurund@civicrm.org>
Wed, 29 May 2013 09:27:12 +0000 (14:57 +0530)
templates/CRM/Contact/Form/Edit/CustomData.tpl

index 1f8aa892ebb6cba657ac0eae3488052491206304..5de1f626a5606de0d0177c030f33f54d59b8a6b0 100644 (file)
@@ -24,7 +24,7 @@
  +--------------------------------------------------------------------+
 *}
 
-<script type="text/javascript">var showTab = Array( );</script>
+<script type="text/javascript">var showTab = Array();</script>
 
 {foreach from=$groupTree item=cd_edit key=group_id}
 
   {assign var=tableID value=$cd_edit.table_id}
   {assign var=divName value=$group_id|cat:"_$tableID"}
   <div></div>
-  <div id="{$cd_edit.name|cat:'_$divName'}" class="crm-accordion-wrapper crm-custom-accordion {if $cd_edit.collapse_display and !$skipTitle}collapsed{/if}">
+  <div id="{$cd_edit.name|cat:'_$divName'}"
+       class="crm-accordion-wrapper crm-custom-accordion {if $cd_edit.collapse_display and !$skipTitle}collapsed{/if}">
 {else}
-  <div id="{$cd_edit.name}" class="crm-accordion-wrapper crm-custom-accordion {if $cd_edit.collapse_display}collapsed{/if}">
+  <div id="{$cd_edit.name}"
+       class="crm-accordion-wrapper crm-custom-accordion {if $cd_edit.collapse_display}collapsed{/if}">
 {/if}
     <div class="crm-accordion-header">
       {$cd_edit.title}
     </div>
 
-          <div id="customData{$group_id}" class="crm-accordion-body">
-       {if $cd_edit.is_multiple eq 1}
-         {if $cd_edit.table_id}
+    <div id="customData{$group_id}" class="crm-accordion-body">
+      {if $cd_edit.is_multiple eq 1}
+        {if $cd_edit.table_id}
           <table class="no-border">
-     <tr id="statusmessg_{$group_id|cat:"_$tableID"}" class="hiddenElement">
-     <td><span class="success-status"></span></td>
-               </tr>
-               <tr>
-               <div class="crm-submit-buttons">
-               <a href="#" onclick="showDelete( {$tableID}, '{$cd_edit.name}_{$group_id|cat:"_$tableID"}', {$group_id}, {$contactId} ); return false;" class="button delete-button" title="{ts 1=$cv_edit.title}Delete this %1 record{/ts}">
-        <span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span>
-                   </a>
-                        </div>  <!-- crm-submit-buttons -->
-              </tr>
-              </table>
-                 {/if}
-             {/if}
-    {include file="CRM/Custom/Form/CustomData.tpl" formEdit=true}
-        </div><!-- crm-accordion-body-->
-</div><!-- crm-accordion-wrapper -->
-<div id="custom_group_{$group_id}_{$cgCount}"></div>
-{/foreach}
+            <tr id="statusmessg_{$group_id|cat:"_$tableID"}" class="hiddenElement">
+              <td><span class="success-status"></span></td>
+            </tr>
+            <tr>
+              <div class="crm-submit-buttons">
+                <a href="#"
+                   onclick="showDelete( {$tableID}, '{$cd_edit.name}_{$group_id|cat:"_$tableID"}', {$group_id}, {$contactId} ); return false;"
+                   class="button delete-button" title="{ts 1=$cv_edit.title}Delete this %1 record{/ts}">
+                  <span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span>
+                </a>
+              </div>
+              <!-- crm-submit-buttons -->
+            </tr>
+          </table>
+        {/if}
+      {/if}
+      {include file="CRM/Custom/Form/CustomData.tpl" formEdit=true}
+    </div>
+    <!-- crm-accordion-body-->
+  </div>
+  <!-- crm-accordion-wrapper -->
+  <div id="custom_group_{$group_id}_{$cgCount}"></div>
+  {/foreach}
 
-{include file="CRM/common/customData.tpl"}
- <script type="text/javascript">
-  {literal}
+  {include file="CRM/common/customData.tpl"}
 <script type="text/javascript">
+    {literal}
 
-     function hideStatus( valueID, groupID ) {
-         cj( '#statusmessg_'  + groupID + '_' + valueID ).hide( );
-     }
+    function hideStatus(valueID, groupID) {
+      cj('#statusmessg_' + groupID + '_' + valueID).hide();
+    }
 
-     function showDelete( valueID, elementID, groupID, contactID ) {
-         var confirmMsg = '{/literal}{ts escape='js'}Are you sure you want to delete this record?{/ts}{literal} &nbsp; <a href="#" onclick="deleteCustomValue( ' + valueID + ',\'' + elementID + '\',' + groupID + ',' + contactID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}Yes{/ts}{literal}</a>&nbsp;&nbsp;&nbsp;<a href="#" onclick="hideStatus( ' + valueID + ', ' +  groupID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}No{/ts}{literal}</a>';
-         cj( 'tr#statusmessg_' + groupID + '_' + valueID ).show( ).children().find('span').html( confirmMsg );
-     }
+    function showDelete(valueID, elementID, groupID, contactID) {
+      var confirmMsg = '{/literal}{ts escape='js'}Are you sure you want to delete this record?{/ts}{literal} &nbsp; <a href="#" onclick="deleteCustomValue( ' + valueID + ',\'' + elementID + '\',' + groupID + ',' + contactID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}Yes{/ts}{literal}</a>&nbsp;&nbsp;&nbsp;<a href="#" onclick="hideStatus( ' + valueID + ', ' + groupID + ' ); return false;" style="text-decoration: underline;">{/literal}{ts escape='js'}No{/ts}{literal}</a>';
+      cj('tr#statusmessg_' + groupID + '_' + valueID).show().children().find('span').html(confirmMsg);
+    }
 
-     function deleteCustomValue( valueID, elementID, groupID, contactID ) {
-         var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
-         cj.ajax({
-           type: "POST",
-           data:  "valueID=" + valueID + "&groupID=" + groupID +"&contactId=" + contactID + "&key={/literal}{crmKey name='civicrm/ajax/customvalue'}{literal}",
-           url: postUrl,
-           success: function(html){
-            cj('#'+ elementID).hide();
-            hideStatus(valueID, groupID);
-            CRM.alert('', '{/literal}{ts escape="js"}Record Deleted{/ts}{literal}', 'success');
-            var element = cj( '.ui-tabs-nav #tab_custom_' + groupID + ' a' );
-            cj(element).html(cj(element).attr('title') + ' ('+ html+') ');
-           }
-         });
-     }
+    function deleteCustomValue(valueID, elementID, groupID, contactID) {
+      var postUrl = {/literal}"{crmURL p='civicrm/ajax/customvalue' h=0 }"{literal};
+      cj.ajax({
+        type: "POST",
+        data: "valueID=" + valueID + "&groupID=" + groupID + "&contactId=" + contactID + "&key={/literal}{crmKey name='civicrm/ajax/customvalue'}{literal}",
+        url: postUrl,
+        success: function (html) {
+          cj('#' + elementID).hide();
+          hideStatus(valueID, groupID);
+          CRM.alert('', '{/literal}{ts escape="js"}Record Deleted{/ts}{literal}', 'success');
+          var element = cj('.ui-tabs-nav #tab_custom_' + groupID + ' a');
+          cj(element).html(cj(element).attr('title') + ' (' + html + ') ');
+        }
+      });
+    }
 
-  {/literal}
- </script>
+    {/literal}
 </script>
 
-{include file="CRM/Form/attachmentjs.tpl"}
+  {include file="CRM/Form/attachmentjs.tpl"}