Update copyright date in comments
[civicrm-core.git] / templates / CRM / Report / Form / Criteria.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
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 {* Report form criteria section *}
27
28 {foreach from=$tabs item=tab}
29 {assign var = 'region' value = "report-tab"|cat:$tab.div_label}
30 {assign var = 'fileName' value = "CRM/Report/Form/Tabs/"|cat:$tab.tpl|cat:".tpl"}
31 {crmRegion name=$region}
32 {include file=$fileName}
33 {/crmRegion}
34 {/foreach}
35
36 {literal}
37 <script type="text/javascript">
38 {/literal}
39 {foreach from=$filters item=table key=tableName}
40 {foreach from=$table item=field key=fieldName}
41 {literal}var val = "dnc";{/literal}
42 {assign var=fieldOp value=$fieldName|cat:"_op"}
43 {if !($field.operatorType & 4) && !$field.no_display && $form.$fieldOp.html}
44 {literal}var val = document.getElementById("{/literal}{$fieldOp}{literal}").value;{/literal}
45 {/if}
46 {literal}showHideMaxMinVal( "{/literal}{$fieldName}{literal}", val );{/literal}
47 {/foreach}
48 {/foreach}
49
50 {literal}
51 function showHideMaxMinVal( field, val ) {
52 var fldVal = field + "_value_cell";
53 var fldMinMax = field + "_min_max_cell";
54 if ( val == "bw" || val == "nbw" ) {
55 cj('#' + fldVal ).hide();
56 cj('#' + fldMinMax ).show();
57 } else if (val =="nll" || val == "nnll") {
58 cj('#' + fldVal).hide() ;
59 cj('#' + field + '_value').val('');
60 cj('#' + fldMinMax ).hide();
61 } else {
62 cj('#' + fldVal ).show();
63 cj('#' + fldMinMax ).hide();
64 }
65 }
66
67 CRM.$(function($) {
68 $('.crm-report-criteria-groupby input:checkbox').click(function() {
69 $('#fields_' + this.id.substr(10)).prop('checked', this.checked);
70 });
71 {/literal}{if $displayToggleGroupByFields}{literal}
72 $('.crm-report-criteria-field input:checkbox').click(function() {
73 $('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
74 });
75 {/literal}{/if}{literal}
76 });
77 </script>
78 {/literal}