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 | *} | |
10 | {*this is included inside a table row*} | |
11 | {assign var=relativeName value=$fieldName|cat:"_relative"} | |
d0a3d029 | 12 | <td colspan=2> |
49d4d222 | 13 | {if $label} |
a6d192c8 | 14 | {ts}{$label}{/ts}<br /> |
49d4d222 | 15 | {/if} |
d0a3d029 | 16 | {$form.$relativeName.html}<br /> |
6a488035 | 17 | <span class="crm-absolute-date-range"> |
59941634 CW |
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> | |
6a488035 TO |
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> |