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 {* Default template custom searches. This template is used automatically if templateFile() function not defined in
27 custom search .php file. If you want a different layout, clone and customize this file and point to new file using
28 templateFile() function.*}
29 <div class="crm-block crm-form-block crm-contact-custom-search-form-block">
30 <div class="crm-accordion-wrapper crm-custom_search_form-accordion {if $rows}collapsed{/if}">
31 <div class="crm-accordion-header crm-master-accordion-header">
32 {ts}Edit Search Criteria{/ts}
33 </div><!-- /.crm-accordion-header -->
34 <div class="crm-accordion-body">
35 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
36 <table class="form-layout-compressed">
37 {* Loop through all defined search criteria fields (defined in the buildForm() function). *}
38 {foreach from=$elements item=element}
39 <tr class="crm-contact-custom-search-form-row-{$element}">
40 <td class="label">{$form.$element.label}</td>
41 {if $element eq 'start_date'}
42 <td>{include file="CRM/common/jcalendar.tpl" elementName=start_date}</td>
43 {elseif $element eq 'end_date'}
44 <td>{include file="CRM/common/jcalendar.tpl" elementName=end_date}</td>
46 <td>{$form.$element.html}</td>
51 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
52 </div><!-- /.crm-accordion-body -->
53 </div><!-- /.crm-accordion-wrapper -->
54 </div><!-- /.crm-form-block -->
56 {if $rowsEmpty || $rows}
57 <div class="crm-content-block">
59 {include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
63 {$summary.summary}: {$summary.total}
67 <div class="crm-results-block">
68 {* Search request has returned 1 or more matching rows. Display results and collapse the search criteria fieldset. *}
69 {* This section handles form elements for action task select and submit *}
70 <div class="crm-search-tasks">
71 {include file="CRM/Contact/Form/Search/ResultTasks.tpl"}
73 {* This section displays the rows along and includes the paging controls *}
74 <div class="crm-search-results">
76 {include file="CRM/common/pager.tpl" location="top"}
78 {* Include alpha pager if defined. *}
80 {include file="CRM/common/pagerAToZ.tpl"}
84 <table class="selector" summary="{ts}Search results listings.{/ts}">
85 <thead class="sticky">
87 <th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th>
88 {foreach from=$columnHeaders item=header}
91 {assign var='key' value=$header.sort}
92 {$sort->_response.$key.link}
102 {counter start=0 skip=1 print=false}
103 {foreach from=$rows item=row}
104 <tr id='rowid{$row.contact_id}' class="{cycle values="odd-row,even-row"}">
105 {assign var=cbName value=$row.checkbox}
106 <td>{$form.$cbName.html}</td>
107 {foreach from=$columnHeaders item=header}
108 {assign var=fName value=$header.sort}
109 {if $fName eq 'sort_name'}
110 <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`"}">{$row.sort_name}</a></td>
112 <td>{$row.$fName}</td>
115 <td>{$row.action}</td>
121 {include file="CRM/common/pager.tpl" location="bottom"}
124 {* END Actions/Results section *}
134 <script type="text/javascript">
136 cj().crmAccordions();
139 function toggleContactSelection( name, qfKey, selection ){
140 var Url = "{/literal}{crmURL p='civicrm/ajax/markSelection' h=0}{literal}";
142 if ( selection == 'multiple' ) {
143 var rowArr = new Array( );
144 {/literal}{foreach from=$rows item=row key=keyVal}
145 {literal}rowArr[{/literal}{$keyVal}{literal}] = '{/literal}{$row.checkbox}{literal}';
146 {/literal}{/foreach}{literal}
147 var elements = rowArr.join('-');
149 if ( cj('#' + name).is(':checked') ){
150 cj.post( Url, { name: elements , qfKey: qfKey , variableType: 'multiple' } );
153 cj.post( Url, { name: elements , qfKey: qfKey , variableType: 'multiple' , action: 'unselect' } );
156 else if ( selection == 'single' ) {
157 if ( cj('#' + name).is(':checked') ){
158 cj.post( Url, { name: name , qfKey: qfKey } );
161 cj.post( Url, { name: name , qfKey: qfKey , state: 'unchecked' } );
164 else if ( name == 'resetSel' && selection == 'reset' ) {
165 cj.post( Url, { qfKey: qfKey , variableType: 'multiple' , action: 'unselect' } );
167 {foreach from=$rows item=row}{literal}
168 cj("#{/literal}{$row.checkbox}{literal}").prop('checked', false);{/literal}
171 cj("#toggleSelect").prop('checked', false);