2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
26 {* Report form criteria section *}
28 <div id="col-groups" class="civireport-criteria" >
29 {if $componentName eq 'Grant'}
30 <h3>{ts}Include these Statistics{/ts}</h3>
32 <h3>Display Columns</h3>
34 {foreach from=$colGroups item=grpFields key=dnc}
35 {assign var="count" value="0"}
36 {* Wrap custom field sets in collapsed accordion pane. *}
37 {if $grpFields.group_title}
38 <div class="crm-accordion-wrapper crm-accordion collapsed">
39 <div class="crm-accordion-header">
40 {$grpFields.group_title}
41 </div><!-- /.crm-accordion-header -->
42 <div class="crm-accordion-body">
44 <table class="criteria-group">
45 <tr class="crm-report crm-report-criteria-field crm-report-criteria-field-{$dnc}">
46 {foreach from=$grpFields.fields item=title key=field}
47 {assign var="count" value=`$count+1`}
48 <td width="25%">{$form.fields.$field.html}</td>
49 {if $count is div by 4}
50 </tr><tr class="crm-report crm-report-criteria-field crm-report-criteria-field_{$dnc}">
53 {if $count is not div by 4}
54 <td colspan="4 - ($count % 4)"></td>
58 {if $grpFields.group_title}
59 </div><!-- /.crm-accordion-body -->
60 </div><!-- /.crm-accordion-wrapper -->
67 <div id="group-by-elements" class="civireport-criteria" >
68 <h3>Group by Columns</h3>
69 {assign var="count" value="0"}
70 <table class="report-layout">
71 <tr class="crm-report crm-report-criteria-groupby">
72 {foreach from=$groupByElements item=gbElem key=dnc}
73 {assign var="count" value=`$count+1`}
74 <td width="25%" {if $form.fields.$gbElem}"{/if}>
75 {$form.group_bys[$gbElem].html}
76 {if $form.group_bys_freq[$gbElem].html}:<br>
77 {$form.group_bys_freq[$gbElem].label} {$form.group_bys_freq[$gbElem].html}
80 {if $count is div by 4}
81 </tr><tr class="crm-report crm-report-criteria-groupby">
84 {if $count is not div by 4}
85 <td colspan="4 - ($count % 4)"></td>
93 <div id="order-by-elements" class="civireport-criteria" >
94 <h3>Order by Columns</h3>
96 <table id="optionField">
101 <th> Section Header / Group By</th>
104 {section name=rowLoop start=1 loop=6}
105 {assign var=index value=$smarty.section.rowLoop.index}
106 <tr id="optionField_{$index}" class="form-item {cycle values="odd-row,even-row"}">
109 <a onclick="hideRow({$index}); return false;" name="orderBy_{$index}" href="#" class="form-link"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}hide field or section{/ts}"/></a>
112 <td> {$form.order_bys.$index.column.html}</td>
113 <td> {$form.order_bys.$index.order.html}</td>
114 <td> {$form.order_bys.$index.section.html}</td>
118 <div id="optionFieldLink" class="add-remove-link">
119 <a onclick="showHideRow(); return false;" name="optionFieldLink" href="#" class="form-link"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}show field or section{/ts}"/>{ts}another column{/ts}</a>
121 <script type="text/javascript">
122 var showRows = new Array({$showBlocks});
123 var hideBlocks = new Array({$hideBlocks});
126 if (navigator.appName == "Microsoft Internet Explorer") {
127 for ( var count = 0; count < hideBlocks.length; count++ ) {
128 var r = document.getElementById(hideBlocks[count]);
129 r.style.display = 'none';
133 // hide and display the appropriate blocks as directed by the php code
134 on_load_init_blocks( showRows, hideBlocks, '' );
136 function hideRow(i) {
138 // clear values on hidden field, so they're not saved
139 cj('select#order_by_column_'+ i).val('');
140 cj('select#order_by_order_'+ i).val('ASC');
141 cj('input#order_by_section_'+ i).attr('checked', false);
150 <div id="other-options" class="civireport-criteria" >
151 <h3>Other Options</h3>
152 <table class="report-layout">
153 {assign var="optionCount" value=0}
154 <tr class="crm-report crm-report-criteria-field">
155 {foreach from=$otherOptions item=optionField key=optionName}
156 {assign var="optionCount" value=`$optionCount+1`}
157 <td>{if $form.$optionName.label}{$form.$optionName.label} {/if}{$form.$optionName.html}</td>
158 {if $optionCount is div by 2}
159 </tr><tr class="crm-report crm-report-criteria-field">
162 {if $optionCount is not div by 2}
163 <td colspan="2 - ($count % 2)"></td>
171 <div id="set-filters" class="civireport-criteria" >
173 <table class="report-layout">
174 {assign var="counter" value=1}
175 {foreach from=$filters item=table key=tableName}
176 {assign var="filterCount" value=$table|@count}
177 {* Wrap custom field sets in collapsed accordion pane. *}
178 {if $colGroups.$tableName.group_title and $filterCount gte 1}
179 {* we should close table that contains other filter elements before we start building custom group accordian *}
182 {assign var="counter" value=0}
184 <div class="crm-accordion-wrapper crm-accordion collapsed">
185 <div class="crm-accordion-header">
186 {$colGroups.$tableName.group_title}
187 </div><!-- /.crm-accordion-header -->
188 <div class="crm-accordion-body">
189 <table class="report-layout">
191 {foreach from=$table item=field key=fieldName}
192 {assign var=fieldOp value=$fieldName|cat:"_op"}
193 {assign var=filterVal value=$fieldName|cat:"_value"}
194 {assign var=filterMin value=$fieldName|cat:"_min"}
195 {assign var=filterMax value=$fieldName|cat:"_max"}
196 {if $field.operatorType & 4}
197 <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}">
198 <td class="label report-contents">{$field.title}</td>
199 {include file="CRM/Core/DateRange.tpl" fieldName=$fieldName from='_from' to='_to'}
201 {elseif $form.$fieldOp.html}
202 <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}" {if $field.no_display} style="display: none;"{/if}>
203 <td class="label report-contents">{$field.title}</td>
204 <td class="report-contents">{$form.$fieldOp.html}</td>
206 <span id="{$filterVal}_cell">{$form.$filterVal.label} {$form.$filterVal.html}</span>
207 <span id="{$filterMin}_max_cell">{$form.$filterMin.label} {$form.$filterMin.html} {$form.$filterMax.label} {$form.$filterMax.html}</span>
212 {if $colGroups.$tableName.group_title}
214 </div><!-- /.crm-accordion-body -->
215 </div><!-- /.crm-accordion-wrapper -->
216 {assign var=closed value=1"} {*-- ie table tags are closed-- *}
218 {assign var=closed value=0"} {*-- ie table tags are not closed-- *}
222 {if $closed eq 0 }</table>{/if}
227 <script type="text/javascript">
229 {foreach from=$filters item=table key=tableName}
230 {foreach from=$table item=field key=fieldName}
231 {literal}var val = "dnc";{/literal}
232 {assign var=fieldOp value=$fieldName|cat:"_op"}
233 {if !($field.operatorType & 4) && !$field.no_display && $form.$fieldOp.html}
234 {literal}var val = document.getElementById("{/literal}{$fieldOp}{literal}").value;{/literal}
236 {literal}showHideMaxMinVal( "{/literal}{$fieldName}{literal}", val );{/literal}
241 function showHideMaxMinVal( field, val ) {
242 var fldVal = field + "_value_cell";
243 var fldMinMax = field + "_min_max_cell";
244 if ( val == "bw" || val == "nbw" ) {
245 cj('#' + fldVal ).hide();
246 cj('#' + fldMinMax ).show();
247 } else if (val =="nll" || val == "nnll") {
248 cj('#' + fldVal).hide() ;
249 cj('#' + field + '_value').val('');
250 cj('#' + fldMinMax ).hide();
252 cj('#' + fldVal ).show();
253 cj('#' + fldMinMax ).hide();
257 cj(document).ready(function(){
258 cj('.crm-report-criteria-groupby input:checkbox').click(function() {
259 cj('#fields_' + this.id.substr(10)).prop('checked', this.checked);
261 {/literal}{if $displayToggleGroupByFields}{literal}
262 cj('.crm-report-criteria-field input:checkbox').click(function() {
263 cj('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
265 {/literal}{/if}{literal}
270 <div>{$form.buttons.html}</div>