Cleanup ui.dialog params and css
[civicrm-core.git] / templates / CRM / Report / Form / Case / Detail.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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 {if $section eq 1}
27 <div class="crm-block crm-content-block crm-report-layoutGraph-form-block">
28 {*include the graph*}
29 {include file="CRM/Report/Form/Layout/Graph.tpl"}
30 </div>
31 {elseif $section eq 2}
32 <div class="crm-block crm-content-block crm-report-layoutTable-form-block">
33 {*include the table layout*}
34 {include file="CRM/Report/Form/Layout/Table.tpl"}
35 </div>
36 {else}
37 <div class="crm-block crm-form-block crm-report-field-form-block">
38
39 {if !$printOnly} {* NO print section starts *}
40 <div {if !$criteriaForm}style="display: none;"{/if}> {* criteria section starts *}
41 <div class="crm-accordion-wrapper crm-report_criteria-accordion {if $rows}collapsed{/if}">
42 <div class="crm-accordion-header">
43 {ts}Report Criteria{/ts}
44 </div><!-- /.crm-accordion-header -->
45 <div class="crm-accordion-body">
46 <div id="id_{$formTpl}"> {* search section starts *}
47
48 {if $colGroups}
49 {if $componentName eq 'Grant'}
50 <h3>{ts}Include these Statistics{/ts}</h3>
51 {else}
52 <h3>Display Columns</h3>
53 {/if}
54 {foreach from=$colGroups item=grpFields key=dnc}
55 {assign var="count" value="0"}
56 {* Wrap custom field sets in collapsed accordion pane. *}
57 {if $grpFields.group_title}
58 <div class="crm-accordion-wrapper crm-accordion collapsed">
59 <div class="crm-accordion-header">
60 {$grpFields.group_title}
61 </div><!-- /.crm-accordion-header -->
62 <div class="crm-accordion-body">
63 {/if}
64 <table class="criteria-group">
65 <tr class="crm-report crm-report-criteria-field crm-report-criteria-field-{$dnc}">
66 {foreach from=$grpFields.fields item=title key=field}
67 {assign var="count" value=`$count+1`}
68 <td width="25%">{$form.fields.$field.html}</td>
69 {if $count is div by 4}
70 </tr><tr class="crm-report crm-report-criteria-field crm-report-criteria-field_{$dnc}">
71 {/if}
72 {/foreach}
73 {if $count is not div by 4}
74 <td colspan="4 - ($count % 4)"></td>
75 {/if}
76 </tr>
77 </table>
78 {if $grpFields.group_title}
79 </div><!-- /.crm-accordion-body -->
80 </div><!-- /.crm-accordion-wrapper -->
81 {/if}
82 {/foreach}
83
84 <table class="criteria-group">
85 {foreach from=$caseDetailExtra key=field item=fieldDetail}
86 <tr class="crm-report crm-report-criteria-field crm-report-criteria-field-{$field}">
87 <td width="25%">{$fieldDetail.title}</td><td> {$form.case_detail_extra.$field.html}</td>
88 </tr>
89 {/foreach}
90 </table>
91 {/if}
92
93 {if $groupByElements}
94 <h3>Group by Columns</h3>
95 {assign var="count" value="0"}
96 <table class="report-layout">
97 <tr class="crm-report crm-report-criteria-groupby">
98 {foreach from=$groupByElements item=gbElem key=dnc}
99 {assign var="count" value=`$count+1`}
100 <td width="25%" {if $form.fields.$gbElem} onClick="selectGroupByFields('{$gbElem}');"{/if}>
101 {$form.group_bys[$gbElem].html}
102 {if $form.group_bys_freq[$gbElem].html}:<br>
103 &nbsp;&nbsp;{$form.group_bys_freq[$gbElem].label}&nbsp;{$form.group_bys_freq[$gbElem].html}
104 {/if}
105 </td>
106 {if $count is div by 4}
107 </tr><tr class="crm-report crm-report-criteria-groupby">
108 {/if}
109 {/foreach}
110 {if $count is not div by 4}
111 <td colspan="4 - ($count % 4)"></td>
112 {/if}
113 </tr>
114 </table>
115 {/if}
116
117 {if $form.options.html || $form.options.html}
118 <h3>Other Options</h3>
119 <table class="report-layout">
120 <tr class="crm-report crm-report-criteria-groupby">
121 <td>{$form.options.html}</td>
122 {if $form.blank_column_end}
123 <td>{$form.blank_column_end.label}&nbsp;&nbsp;{$form.blank_column_end.html}</td>
124 {/if}
125 </tr>
126 </table>
127 {/if}
128
129 {if $filters}
130 <h3>Set Filters</h3>
131 <table class="report-layout">
132 {assign var="counter" value=1}
133 {foreach from=$filters item=table key=tableName}
134 {assign var="filterCount" value=$table|@count}
135 {* Wrap custom field sets in collapsed accordion pane. *}
136 {if $colGroups.$tableName.group_title and $filterCount gte 1}
137 {* we should close table that contains other filter elements before we start building custom group accordian *}
138 {if $counter eq 1}
139 </table>
140 {assign var="counter" value=0}
141 {/if}
142 <div class="crm-accordion-wrapper crm-accordion collapsed">
143 <div class="crm-accordion-header">
144 {$colGroups.$tableName.group_title}
145 </div><!-- /.crm-accordion-header -->
146 <div class="crm-accordion-body">
147 <table class="report-layout">
148 {/if}
149 {foreach from=$table item=field key=fieldName}
150 {assign var=fieldOp value=$fieldName|cat:"_op"}
151 {assign var=filterVal value=$fieldName|cat:"_value"}
152 {assign var=filterMin value=$fieldName|cat:"_min"}
153 {assign var=filterMax value=$fieldName|cat:"_max"}
154 {if $field.operatorType & 4}
155 <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}">
156 <td class="label report-contents">{$field.title}</td>
157 {include file="CRM/Core/DateRange.tpl" fieldName=$fieldName from='_from' to='_to'}
158 </tr>
159 {elseif $form.$fieldOp.html}
160 <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}" {if $field.no_display} style="display: none;"{/if}>
161 <td class="label report-contents">{$field.title}</td>
162 <td class="report-contents">{$form.$fieldOp.html}</td>
163 <td>
164 <span id="{$filterVal}_cell">{$form.$filterVal.label}&nbsp;{$form.$filterVal.html}</span>
165 <span id="{$filterMin}_max_cell">{$form.$filterMin.label}&nbsp;{$form.$filterMin.html}&nbsp;&nbsp;{$form.$filterMax.label}&nbsp;{$form.$filterMax.html}</span>
166 </td>
167 </tr>
168 {/if}
169 {/foreach}
170 {if $colGroups.$tableName.group_title}
171 </table>
172 </div><!-- /.crm-accordion-body -->
173 </div><!-- /.crm-accordion-wrapper -->
174 {assign var=closed value=1"} {*-- ie table tags are closed-- *}
175 {else}
176 {assign var=closed value=0"} {*-- ie table tags are not closed-- *}
177 {/if}
178
179 {/foreach}
180 {if $closed eq 0 }</table>{/if}
181 {/if}
182
183 {literal}
184 <script type="text/javascript">
185 {/literal}
186 {foreach from=$filters item=table key=tableName}
187 {foreach from=$table item=field key=fieldName}
188 {literal}var val = "dnc";{/literal}
189 {if !($field.operatorType == 4) && !$field.no_display}
190 {literal}var val = document.getElementById("{/literal}{$fieldName}_op{literal}").value;{/literal}
191 {/if}
192 {literal}showHideMaxMinVal( "{/literal}{$fieldName}{literal}", val );{/literal}
193 {/foreach}
194 {/foreach}
195
196 {literal}
197 function showHideMaxMinVal( field, val ) {
198 var fldVal = field + "_value_cell";
199 var fldMinMax = field + "_min_max_cell";
200 if ( val == "bw" || val == "nbw" ) {
201 cj('#' + fldVal ).hide();
202 cj('#' + fldMinMax ).show();
203 } else if (val =="nll" || val == "nnll") {
204 cj('#' + fldVal).hide() ;
205 cj('#' + field + '_value').val('');
206 cj('#' + fldMinMax ).hide();
207 } else {
208 cj('#' + fldVal ).show();
209 cj('#' + fldMinMax ).hide();
210 }
211 }
212
213 function selectGroupByFields(id) {
214 var field = 'fields\['+ id+'\]';
215 var group = 'group_bys\['+ id+'\]';
216 var groups = document.getElementById( group ).checked;
217 if ( groups == 1 ) {
218 document.getElementById( field ).checked = true;
219 } else {
220 document.getElementById( field ).checked = false;
221 }
222 }
223 </script>
224 {/literal}
225
226 <div>{$form.buttons.html}</div>
227 </div> {* search div section ends *}
228 </div><!-- /.crm-accordion-body -->
229 </div><!-- /.crm-accordion-wrapper -->
230 </div> {* criteria section ends *}
231
232 {if $instanceForm OR $instanceFormError} {* settings section starts *}
233 <div class="crm-accordion-wrapper crm-report_setting-accordion {if $rows}collapsed{/if}">
234 <div class="crm-accordion-header" {if $updateReportButton} onclick="cj('#update-button').hide(); return false;" {/if} >
235 {if $mode eq 'template'}{ts}Create Report{/ts}{else}{ts}Report Settings{/ts}{/if}
236 </div><!-- /.crm-accordion-header -->
237 <div class="crm-accordion-body">
238 <div id="id_{$instanceForm}">
239 <div id="instanceForm">
240 {include file="CRM/Report/Form/Instance.tpl"}
241 {assign var=save value="_qf_"|cat:$form.formName|cat:"_submit_save"}
242 <div class="crm-submit-buttons">
243 {$form.$save.html}
244 </div>
245 </div>
246 </div>
247 </div><!-- /.crm-accordion-body -->
248 </div><!-- /.crm-accordion-wrapper -->
249 {if $updateReportButton}
250 <div id='update-button' class="crm-submit-buttons">
251 {$form.$save.html}
252 </div>
253 {/if}
254 {/if} {* settings section ends *}
255
256 {literal}
257 <script type="text/javascript">
258 cj(function() {
259 cj().crmAccordions();
260 });
261 </script>
262 {/literal}
263
264 {/if} {* NO print section ends *}
265
266
267 </div>
268
269 <div class="crm-block crm-content-block crm-report-form-block">
270 {*include actions*}
271 {include file="CRM/Report/Form/Actions.tpl"}
272
273 {*Statistics at the Top of the page*}
274 {include file="CRM/Report/Form/Statistics.tpl" top=true}
275
276 {*include the graph*}
277 {include file="CRM/Report/Form/Layout/Graph.tpl"}
278
279 {*include the table layout*}
280 {include file="CRM/Report/Form/Layout/Table.tpl"}
281 <br />
282 {*Statistics at the bottom of the page*}
283 {include file="CRM/Report/Form/Statistics.tpl" bottom=true}
284
285 {include file="CRM/Report/Form/ErrorMessage.tpl"}
286 </div>
287 {/if}
288
289 <div id="casedetails"></div>
290 {literal}
291 <script type="text/javascript">
292 function viewCase( caseId ,contactId ) {
293 cj("#casedetails").dialog({
294 title: "Case Details",
295 modal: true,
296 width : 700,
297 height: 400,
298 open:function() {
299 var dataUrl = {/literal}"{crmURL p='civicrm/case/ajax/details' h=0 q="snippet=4" }"{literal};
300 dataUrl = dataUrl + '&caseId=' +caseId + '&contactId=' +contactId ;
301 cj.ajax({
302 url : dataUrl,
303 dataType: "html",
304 timeout : 5000, //Time in milliseconds
305 success : function( data ){
306 cj( "#casedetails").html( data ).trigger('crmLoad');
307 },
308 });
309 },
310
311 buttons: { "Done": function() { cj(this).dialog("destroy"); }}
312 });
313 }
314 </script>
315 {/literal}