Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
53532066 | 10 | {* Template for to create a link between two cases. *} |
6a488035 | 11 | <div class="crm-block crm-form-block crm-case-linkcases-form-block"> |
f72119d9 CW |
12 | <tr class="crm-case-linkcases-form-block-link_to_case_id"> |
13 | <td class="label">{$form.link_to_case_id.label}</td> | |
14 | <td>{$form.link_to_case_id.html}</td> | |
6a488035 TO |
15 | </tr> |
16 | ||
17 | {literal} | |
18 | <script type="text/javascript"> | |
3cc60a06 | 19 | CRM.$(function($) { |
b50fdacc | 20 | var $form = $("form.{/literal}{$form.formClass}{literal}"); |
abd06efc | 21 | $('input[name=link_to_case_id]', $form).change(function() { |
f72119d9 CW |
22 | if ($(this).val()) { |
23 | var info = $(this).select2('data').extra; | |
24 | {/literal}{* Mix in variables and placeholders for clientside substitution *} | |
abd06efc | 25 | var subject = "{ts escape=js 1="%1" 2="%2" 3="%3" 4=$sortName 5=$caseTypeLabel 6=$caseID}Create link between %1 - %2 (CaseID: %3) and %4 - %5 (CaseID: %6){/ts}"; |
f72119d9 | 26 | {literal} |
abd06efc | 27 | $('#subject', $form).val(ts(subject, {1: info['contact_id.sort_name'], 2: info['case_id.case_type_id.title'], 3: $(this).val()})); |
f72119d9 CW |
28 | } |
29 | }); | |
30 | }); | |
6a488035 TO |
31 | </script> |
32 | {/literal} | |
232624b1 | 33 | </div> |