Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-08-21-20-13-45
[civicrm-core.git] / templates / CRM / Case / Form / Activity / LinkCases.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
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. |
12 | |
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. |
17 | |
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 +--------------------------------------------------------------------+
25 *}
26 {* Template for to create a link between two cases. *}
27 <div class="crm-block crm-form-block crm-case-linkcases-form-block">
28 <tr class="crm-case-linkcases-form-block-link_to_case">
29 <td class="label">{$form.link_to_case.label}</td>
30 <td>{$form.link_to_case.html}</td>
31 </tr>
32
33 {literal}
34 <script type="text/javascript">
35 var unclosedCaseUrl = {/literal}"{crmURL p='civicrm/case/ajax/unclosed' h=0 q='excludeCaseIds='}{$excludeCaseIds}{literal}";
36 cj( "#link_to_case").autocomplete( unclosedCaseUrl, { width : 250, selectFirst : false, matchContains:true
37 }).result( function(event, data, formatted) {
38 cj( "#link_to_case_id" ).val( data[1] );
39 var subject = {/literal}"Create link between {$client_name} - {$caseTypeLabel} (CaseID: {$caseId})"{literal} + ' AND ' + data[4] + ' - ' + data[3] + ' (CaseID: ' + data[1] + ')';
40 cj( "#subject" ).val( subject );
41 }).bind( 'click', function( ) {
42 cj( "#link_to_case_id" ).val('');
43 cj( "#subject" ).val( '' );
44 });
45 </script>
46 {/literal}
47 </div>