2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {* this template is used for adding/editing/deleting case *}
28 {include file="CRM/Contact/Form/AddContact.tpl"}
33 <legend>{ts}New Case{/ts}</legend>
35 <legend>{ts}Edit Case{/ts}</legend>
36 {elseif $action eq 8 and !$context}
37 <legend>{ts}Delete Case{/ts}</legend>
38 {elseif $action eq 8 and $context}
39 <legend>{ts}Detach Activity From Case{/ts}</legend>
41 <div class="form-item">
42 <table class="form-layout-compressed">
44 {if $action eq 8 and $context}
45 <div class="status">{ts}Are you sure you want to detach this case from Activity?{/ts}</div>
46 {elseif $action eq 8 and !$context}
47 <div class="status">{ts}Are you sure you want to delete this case?{/ts} {ts}This action cannot be undone.{/ts}</div>
49 <tr><td class="label">{$form.subject.label}</td><td>{$form.subject.html}</td></tr>
50 <tr><td class="label"> </td><td class="description">{ts}Enter the case subject{/ts}</td></tr>
51 <tr><td class="label">{$form.status_id.label}</td><td>{$form.status_id.html}</td></tr>
52 <tr><td class="label"> </td><td class="description">{ts}Select the status for this case{/ts}</td></tr>
55 {if $action neq 4 and $search eq false}
56 <td class="label">{ts}Add To {/ts}</td><td class="view-value">{$currentlyViewedContact}</td></tr>
58 <td class="label">{ts}Add More {/ts}</td>
60 <span id="case_contact_1"></span>
61 {edit}<span class="description">{ts}You can optionally add this case to someone. Added case will appear in their Contact Dashboard.{/ts}</span>{/edit}
64 <td class="label">{ts}Add To {/ts}</td><td class="view-value">{$caseContacts}</td>
67 <tr><td class="label">{$form.case_type_id.label}</td><td>{$form.case_type_id.html}</td></tr>
68 <tr><td class="label"> </td><td class="description">{ts}Select the appropriate type of the case {/ts}</td></tr>
69 <tr><td class="label">{$form.start_date.label}</td><td>{$form.start_date.html}
70 {include file="CRM/common/calendar/desc.tpl" trigger=trigger_case_1}
71 {include file="CRM/common/calendar/body.tpl" dateVar=start_date offset=10 trigger=trigger_case_1}
74 <tr><td class="label">{$form.end_date.label}</td><td>{$form.end_date.html}
75 {include file="CRM/common/calendar/desc.tpl" trigger=trigger_case_2}
76 {include file="CRM/common/calendar/body.tpl" dateVar=end_date offset=10 trigger=trigger_case_2}
79 <tr><td class="label">{$form.details.label}</td><td>{$form.details.html}</td></tr>
81 <tr> {* <tr> for add / edit form buttons *}
82 <td> </td><td>{$form.buttons.html}</td>
88 {* Build add contact *}
90 <script type="text/javascript">
94 buildContact( 1, 'case_contact' );
99 var caseContactCount = {/literal}"{$caseContactCount}"{literal}
101 if ( caseContactCount ) {
102 for ( var i = 1; i <= caseContactCount; i++ ) {
103 buildContact( i, 'case_contact' );
107 function buildContact( count, pref )
110 prevCount = count - 1;
112 {if $action eq 1 OR $action eq 2}
114 cj('#' + pref + '_' + prevCount + '_show').hide();
120 var dataUrl = {/literal}"{crmURL h=0 q='snippet=4&count='}"{literal} + count + '&' + pref + '=1';
122 var result = dojo.xhrGet({
126 timeout: 5000, //Time in milliseconds
127 handle: function(response, ioArgs) {
128 if (response instanceof Error) {
129 if (response.dojoType == "cancel") {
130 //The request was canceled by some other JavaScript code.
131 console.debug("Request canceled.");
132 } else if (response.dojoType == "timeout") {
133 //The request took over 5 seconds to complete.
134 console.debug("Request timed out.");
136 //Some other error happened.
137 console.error(response);
141 dojo.byId( pref + '_' + count).innerHTML = response;
142 dojo.parser.parse( pref + '_' + count );