Merge pull request #17841 from seamuslee001/eventcart_setting
[civicrm-core.git] / templates / CRM / Core / DateRange.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
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 |
8 +--------------------------------------------------------------------+
9 *}
10 {*this is included inside a table row*}
11 {assign var=relativeName value=$fieldName|cat:"_relative"}
12 <td colspan=2>
13 {if $label}
14 {ts}{$label}{/ts}<br />
15 {/if}
16 {$form.$relativeName.html}<br />
17 <span class="crm-absolute-date-range">
18 <span class="crm-absolute-date-from">
19 {assign var=fromName value=$fieldName|cat:$from}
20 {$form.$fromName.label}
21 {include file="CRM/common/jcalendar.tpl" elementName=$fromName}
22 </span>
23 <span class="crm-absolute-date-to">
24 {assign var=toName value=$fieldName|cat:$to}
25 {$form.$toName.label}
26 {include file="CRM/common/jcalendar.tpl" elementName=$toName}
27 </span>
28 </span>
29 {literal}
30 <script type="text/javascript">
31 cj("#{/literal}{$relativeName}{literal}").change(function() {
32 var n = cj(this).parent().parent();
33 if (cj(this).val() == "0") {
34 cj(".crm-absolute-date-range", n).show();
35 } else {
36 cj(".crm-absolute-date-range", n).hide();
37 cj(':text', n).val('');
38 }
39 }).change();
40 </script>
41 {/literal}
42 </td>