CiviCase tpl cleanup
authorColeman Watts <coleman@civicrm.org>
Wed, 26 Feb 2014 16:50:31 +0000 (11:50 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 26 Feb 2014 16:50:31 +0000 (11:50 -0500)
templates/CRM/Case/Form/CaseView.tpl
templates/CRM/Case/Form/ViewRelatedCases.tpl [new file with mode: 0644]

index a73e207a53694628820e24f24e1b68cf1a7855c2..94892a5ba4bcea5278931d67a74de1599069953f 100644 (file)
 *}
 {* CiviCase -  view case screen*}
 
-{* here we are showing related cases w/ jquery dialog *}
 <div class="crm-block crm-form-block crm-case-caseview-form-block">
-{if $showRelatedCases}
-<table class="report">
-  <tr class="columnheader">
-    <th>{ts}Client Name{/ts}</th>
-    <th>{ts}Case Type{/ts}</th>
-    <th></th>
-  </tr>
 
-  {foreach from=$relatedCases item=row key=caseId}
-    <tr>
-      <td class="crm-case-caseview-client_name label">{$row.client_name}</td>
-      <td class="crm-case-caseview-case_type label">{$row.case_type}</td>
-      <td class="label">{$row.links}</td>
-    </tr>
-  {/foreach}
-</table>
+{* here we are showing related cases w/ jquery dialog *}
+{if $showRelatedCases}
+  {include file="CRM/Case/Form/ViewRelatedCases.tpl"}
 
-  {else}
+{* Main case view *}
+{else}
 
 <h3>{ts}Summary{/ts}</h3>
 <table class="report">
     cj("#dialog").show( );
 
     cj("#dialog").dialog({
-      title: "Add Client to the Case",
+      title: "{/literal}{ts escape="js"}Add Client to the Case{/ts}{literal}",
       modal: true,
       bgiframe: true,
       close  : function(event, ui) { cj("#rel_contact").unautocomplete( ); },
         var contactID = cj("#rel_contact_id").val( );
 
         if ( !cj("#rel_contact").val( ) || !contactID ) {
-          cj("#rel_contact").crmError('{/literal}{ts escape="js"}Select valid contact from the list{/ts}{literal}.');
+          cj("#rel_contact").crmError('{/literal}{ts escape="js"}Select valid contact from the list.{/ts}{literal}');
           return false;
         }
         cj.post( postUrl, {contactID: contactID,caseID: caseID,
diff --git a/templates/CRM/Case/Form/ViewRelatedCases.tpl b/templates/CRM/Case/Form/ViewRelatedCases.tpl
new file mode 100644 (file)
index 0000000..c867d49
--- /dev/null
@@ -0,0 +1,41 @@
+{*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4                                                |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+*}
+{* Ajax-loaded list of related cases *}
+<table class="report">
+  <tr class="columnheader">
+    <th>{ts}Client Name{/ts}</th>
+    <th>{ts}Case Type{/ts}</th>
+    <th></th>
+  </tr>
+
+  {foreach from=$relatedCases item=row key=caseId}
+    <tr>
+      <td class="crm-case-caseview-client_name label">{$row.client_name}</td>
+      <td class="crm-case-caseview-case_type label">{$row.case_type}</td>
+      <td class="label">{$row.links}</td>
+    </tr>
+  {/foreach}
+</table>