Merge pull request #71 from colemanw/CRM-12038
[civicrm-core.git] / templates / CRM / Block / FullTextSearch.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
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<script type="text/javascript">
27 {literal}
28 function submitForm( ) {
29 var text = document.getElementById('text').value;
30 var table = document.getElementById('fulltext_table').value;
31 var url = {/literal}'{crmURL p="civicrm/contact/search/custom" h=0 q="csid=`$fullTextSearchID`&reset=1&force=1&text="}'{literal} + text;
32 if ( table ) {
33 url = url + '&table=' + table;
34 }
35 document.getElementById('id_fulltext_search').action = url;
36 }
37 {/literal}
38</script>
39
40<div class="block-crm crm-container">
41 <form method="post" id="id_fulltext_search">
42 <div style="margin-bottom: 8px;">
43 <input type="text" name="text" id='text' value="" style="width: 10em;" />&nbsp;<input type="submit" name="submit" id="fulltext_submit" value="{ts}Go{/ts}" class="form-submit"/ onclick='submitForm();'>
44 </div>
45 <select class="form-select" id="fulltext_table" name="fulltext_table">
46{if call_user_func(array('CRM_Core_Permission','giveMeAllACLs'))}
47 <option value="">{ts}All{/ts}</option>
48 <option value="Contact">{ts}Contacts{/ts}</option>
49{/if}
50 <option value="Activity">{ts}Activities{/ts}</option>
51{if call_user_func(array('CRM_Core_Permission','access'), 'CiviCase')}
52 <option value="Case">{ts}Cases{/ts}</option>
53{/if}
54{if call_user_func(array('CRM_Core_Permission','access'), 'CiviContribute')}
55 <option value="Contribution">{ts}Contributions{/ts}</option>
56{/if}
57{if call_user_func(array('CRM_Core_Permission','access'), 'CiviEvent')}
58 <option value="Participant">{ts}Participants{/ts}</option>
59{/if}
60{if call_user_func(array('CRM_Core_Permission','access'), 'CiviMember')}
61 <option value="Membership">{ts}Memberships{/ts}</option>
62{/if}
63 </select>{help id="id-fullText-block" file="CRM/Contact/Form/Search/Custom/FullText.hlp"}
64 </form>
65</div>