| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 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 | <div class="crm-form crm-form-block crm-file-on-case-form-block"> |
| 27 | <div class="help"> |
| 28 | {ts}File on Case{/ts} |
| 29 | </div> |
| 30 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> |
| 31 | <table class="form-layout-compressed"> |
| 32 | <tr class="crm-file-on-case-form-block-unclosed_cases"> |
| 33 | <td class="label"> |
| 34 | {$form.unclosed_case_id.label} |
| 35 | </td> |
| 36 | <td> |
| 37 | {$form.unclosed_case_id.html}<br /> |
| 38 | </td> |
| 39 | </tr> |
| 40 | <tr> |
| 41 | {include file="CRM/Activity/Form/Task.tpl"} |
| 42 | </tr> |
| 43 | </table> |
| 44 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> |
| 45 | </div> |
| 46 | {literal} |
| 47 | <script type="text/javascript"> |
| 48 | CRM.$(function($) { |
| 49 | var $form = $("form.{/literal}{$form.formClass}{literal}"); |
| 50 | $('input[name=unclosed_case_id]', $form).crmSelect2({ |
| 51 | placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal}, |
| 52 | minimumInputLength: 1, |
| 53 | formatResult: CRM.utils.formatSelect2Result, |
| 54 | formatSelection: function(row) { |
| 55 | return row.label; |
| 56 | }, |
| 57 | ajax: { |
| 58 | url: {/literal}"{crmURL p='civicrm/case/ajax/unclosed' h=0}"{literal}, |
| 59 | data: function(term) { |
| 60 | return {term: term}; |
| 61 | }, |
| 62 | results: function(response) { |
| 63 | return {results: response}; |
| 64 | } |
| 65 | } |
| 66 | }); |
| 67 | }); |
| 68 | {/literal} |
| 69 | </script> |