Merge pull request #17144 from lcdservices/dev-core-1716
[civicrm-core.git] / templates / CRM / Activity / Form / Search.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 4 | |
1188c7a8
TO
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
6a488035
TO
8 +--------------------------------------------------------------------+
9*}
10{* Search form and results for Activities *}
11<div class="crm-form-block crm-search-form-block">
79d954ae 12 <div class="crm-accordion-wrapper crm-advanced_search_form-accordion {if $rows}collapsed{/if}">
13 <div class="crm-accordion-header crm-master-accordion-header">
14 {ts}Edit Search Criteria{/ts}
15 </div>
16 <!-- /.crm-accordion-header -->
17 <div class="crm-accordion-body">
18 <div id="searchForm" class="form-item">
19 {strip}
20 <table class="form-layout">
21 <tr>
f212d37d 22 <td class="font-size12pt" colspan="2">
79d954ae 23 {$form.sort_name.label}&nbsp;&nbsp;{$form.sort_name.html|crmAddClass:'twenty'}
79d954ae 24 <div>
adb76693 25 <div class="description font-italic">{ts}Complete OR Partial Name{/ts}
79d954ae 26 <span class="contact-name-option option-1">{ts} of the Source Contact{/ts}</span>
27 <span class="contact-name-option option-2">{ts} of the Assignee Contact{/ts}</span>
28 <span class="contact-name-option option-3">{ts} of the Target Contact{/ts}</span>
29 </div>
30 </div>
31 </td>
f212d37d 32 <td>{include file="CRM/common/formButtons.tpl" location="top"}</td>
79d954ae 33 </tr>
6a488035 34
79d954ae 35 {include file="CRM/Activity/Form/Search/Common.tpl"}
6a488035 36
79d954ae 37 <tr>
f212d37d 38 <td colspan="3">{include file="CRM/common/formButtons.tpl" location="botton"}</td>
79d954ae 39 </tr>
40 </table>
41 {/strip}
42 </div>
43 </div>
6a488035
TO
44 </div>
45</div>
6a488035
TO
46
47{if $rowsEmpty || $rows }
637ca83b 48 <div class="crm-content-block">
49 {if $rowsEmpty}
50 <div class="crm-results-block crm-results-block-empty">
51 {include file="CRM/Activity/Form/Search/EmptyResults.tpl"}
52 </div>
53 {/if}
6a488035 54
637ca83b 55 {if $rows}
56 <div class="crm-results-block">
57 {* Search request has returned 1 or more matching rows. *}
6a488035 58
637ca83b 59 {* This section handles form elements for action task select and submit *}
60 <div class="crm-search-tasks">
61 {include file="CRM/common/searchResultTasks.tpl"}
62 </div>
63 {* This section displays the rows along and includes the paging controls *}
64 <div class="crm-search-results">
65 {include file="CRM/Activity/Form/Selector.tpl" context="Search"}
66 </div>
67 {* END Actions/Results section *}
68 </div>
69 {/if}
70 </div>
6a488035
TO
71{/if}
72{literal}
637ca83b 73 <script type="text/javascript">
3cc60a06 74 CRM.$(function($) {
b50fdacc
CW
75 var $form = $('form.{/literal}{$form.formClass}{literal}'),
76 roleId = $('input[name=activity_role]:checked', $form).val();
6645771e 77 if (roleId) {
ae8f569f 78 $('.description .option-' + roleId).show();
6645771e 79 }
80
ae8f569f
CW
81 $('[name=activity_role]:input').change(function() {
82 $('.description .contact-name-option').hide();
83 if ($(this).is(':checked')) {
84 $('.description .option-' + $(this).val()).show();
85 }
86 }).change();
637ca83b 87 });
88
637ca83b 89
637ca83b 90 </script>
6a488035 91{/literal}