CRM-17439 layout changes for advanced search panes
authoreileen <emcnaughton@wikimedia.org>
Sun, 10 Jan 2016 23:11:11 +0000 (12:11 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 10 Jan 2016 23:15:07 +0000 (12:15 +1300)
CRM/Contact/Form/Search/Criteria.php
templates/CRM/Contact/Form/Search/Advanced.hlp
templates/CRM/Contact/Form/Search/AdvancedCriteria.tpl
templates/CRM/Contact/Form/Search/Criteria/Basic.tpl
templates/CRM/Contact/Form/Search/Criteria/DisplaySettings.tpl [new file with mode: 0644]
templates/CRM/Contact/Form/Search/Criteria/SearchSettings.tpl [new file with mode: 0644]

index 37cd6c4274fc744c405e1d42bb8ad2ddc13198c6..2bb9f0a919e7d88c5b50b66e2b82fcf8a7eef47c 100644 (file)
@@ -149,7 +149,7 @@ class CRM_Contact_Form_Search_Criteria {
 
     $form->add('select',
       'uf_group_id',
-      ts('Search Views'),
+      ts('Views For Display Contacts'),
       array(
         '0' => ts('- default view -'),
       ) + $searchProfiles,
index 5e5d9e5ae3f3678910bcf37b919782c29bccdea6..23430f3106b3abfb8700a2fe7e9e8aedc445b2b5 100644 (file)
@@ -27,8 +27,9 @@
 {ts}Advanced Search{/ts}
 {/htxt}
 {htxt id='id-advanced-intro'}
-    <p>{ts}Use <strong>&#37;</strong> wildcard(s) for partial matches. EXAMPLE: Enter 'Volunteer&#37;' as your Activity Type to match any activity whose type is 'Volunteer' + any other words (e.g. Volunteer for Open House).{/ts}</p>
-    <p>{ts}If multiple boxes are checked for Contact Types, Groups, Tags and Location Types, the selections are combined as <strong>OR</strong> criteria (e.g. checking 'Group A' and 'Group B' will find contacts who are either in 'Group A' OR 'Group B'). All other search fields are combined as <strong>AND</strong> criteria (e.g. selecting Tag is 'Age' AND Country is 'Canada' returns only those contacts who meet both criteria).{/ts}</p>
+  <p>{ts}Use <strong>&#37;</strong> wildcard(s) for partial matches. EXAMPLE: Enter 'Volunteer&#37;' as your Activity Type to match any activity whose type is 'Volunteer' + any other words (e.g. Volunteer for Open House).{/ts}</p>
+  <p>{ts}When multiple options are selected within a search field the selections are combined using <strong>OR</strong> criteria (e.g. selecting both 'Group A' and 'Group B' will find contacts who are either in 'Group A' OR 'Group B' or in both).</p>
+  <p>By default the different search fields are combined using the <strong>AND</strong> Search Operator (e.g. selecting Tag is 'Age' AND Country is 'Canada' returns only those contacts who meet both criteria). You can override the Search Operator default for combining different fields in the Search Settings.{/ts}</p>
 {/htxt}
 
 {htxt id='id-advanced-smart-title'}
 {/htxt}
 
 {htxt id="id-search-views-title"}
-{ts}Search Views{/ts}
+{ts}Views For Display Contacts{/ts}
 {/htxt}
 {htxt id="id-search-views"}
-    <p>{ts}You can modify the columns displayed in your search results by creating a Profile containing a different set of contact fields and then selecting that Profile here. For example you may want to include columns for Gender and Date of Birth, while eliminating Country.{/ts} {docURL page="user/current/organising-your-data/profiles"}</p>
+    <p>{ts}If you are displaying the search results as contacts, you can modify the columns displayed by creating a Profile containing a different set of contact fields and then selecting that Profile here. For example you may want to include columns for Gender and Date of Birth, while eliminating Country.{/ts} {docURL page="user/current/organising-your-data/profiles"}</p>
 {/htxt}
 
 {htxt id="id-search-operator-title"}
index 4b505736106bd3ee43f0ed79ac3255230c4feae8..67b507c4007427078f6131f03d7165a45d8f3ce5 100644 (file)
@@ -109,6 +109,22 @@ CRM.$(function($) {
 {/if}
 
 {strip}
+  <div class="crm-accordion-wrapper crm-search_criteria_basic-accordion ">
+    <div class="crm-accordion-header">
+      {ts}Display Settings For Results{/ts}
+    </div>
+    <div class="crm-accordion-body">
+      {include file="CRM/Contact/Form/Search/Criteria/DisplaySettings.tpl"}
+    </div>
+  </div>
+  <div class="crm-accordion-wrapper crm-search_criteria_basic-accordion ">
+    <div class="crm-accordion-header">
+      {ts}Search Settings{/ts}
+    </div>
+    <div class="crm-accordion-body">
+      {include file="CRM/Contact/Form/Search/Criteria/SearchSettings.tpl"}
+    </div>
+  </div>
   <div class="crm-accordion-wrapper crm-search_criteria_basic-accordion ">
     <div class="crm-accordion-header">
       {ts}Basic Criteria{/ts}
index 141bbd0e73e3c08e411d42defabca40d7773ec96..97a7d1eeb7d92197c19ae97969b57b06ac392be1 100644 (file)
       <label>{ts}Complete OR Partial Email{/ts}</label><br />
       {$form.email.html}
     </td>
-    <td class="adv-search-top-submit" colspan="2">
-      <div class="crm-submit-buttons">
-        {include file="CRM/common/formButtons.tpl" location="top"}
-      </div>
-      <div class="crm-submit-buttons reset-advanced-search">
-        <a href="{crmURL p='civicrm/contact/search/advanced' q='reset=1'}" id="resetAdvancedSearch" class="crm-hover-button css_right" title="{ts}Clear all search criteria{/ts}">
-          <i class="crm-i fa-undo"></i>
-          {ts}Reset Form{/ts}
-        </a>
-      </div>
-    </td>
+    {if $form.contact_type}
+      <td><label>{ts}Contact Type(s){/ts}</label><br />
+        {$form.contact_type.html}
+      </td>
+    {else}
+      <td>&nbsp;</td>
+    {/if}
   </tr>
   <tr>
-  {if $form.contact_type}
-    <td><label>{ts}Contact Type(s){/ts}</label><br />
-      {$form.contact_type.html}
-    </td>
-  {else}
-    <td>&nbsp;</td>
-  {/if}
   {if $form.group}
     <td>
       <div id='groupselect'><label>{ts}Group(s){/ts} <span class="description">(<a href="#" id='searchbygrouptype'>{ts}search by group type{/ts}</a>)</span></label>
@@ -95,8 +84,6 @@
   {else}
     <td>&nbsp;</td>
   {/if}
-  </tr>
-  <tr>
     {if $form.contact_tags}
       <td><label>{ts}Select Tag(s){/ts}</label>
         {$form.contact_tags.html}
       {$form.contact_source.label} {help id="id-source" file="CRM/Contact/Form/Contact"}<br />
       {$form.contact_source.html}
     </td>
-    <td>
-      {if $form.uf_user}
-          {$form.uf_user.label} {$form.uf_user.html}
-          <div class="description font-italic">
-              {ts 1=$config->userFramework}Does the contact have a %1 Account?{/ts}
-          </div>
-      {else}
-          &nbsp;
-      {/if}
-    </td>
     <td>
       {$form.job_title.label}<br />
       {$form.job_title.html}
     </td>
+    <td colspan="3">
+      {$form.preferred_language.label}<br />
+      {$form.preferred_language.html}
+    </td>
   </tr>
   <tr>
     <td>
        {$form.external_identifier.label} {help id="id-external-id" file="CRM/Contact/Form/Contact"}<br />
        {$form.external_identifier.html}
     </td>
-    <td colspan="3">
-      {$form.preferred_language.label}<br />
-      {$form.preferred_language.html}
-    </td>
-  </tr>
-  <tr>
-    <td colspan="5">
-      <fieldset>
-        <legend>{ts}Search Settings{/ts}</legend>
-        <table>
-          <tr>
-            <td>
-              {$form.uf_group_id.label} {help id="id-search-views"}<br />{$form.uf_group_id.html}
-            </td>
-            <td>
-              {if $form.component_mode}
-                {$form.component_mode.label} {help id="id-display-results"}
-                <br />
-                {$form.component_mode.html}
-                {if $form.display_relationship_type}
-                  <div id="crm-display_relationship_type">{$form.display_relationship_type.html}</div>
-                {/if}
-              {else}
-                &nbsp;
-              {/if}
-            </td>
-            <td>{$form.operator.label} {help id="id-search-operator"}<br />{$form.operator.html}</td>
-            <td>
-              {if $form.deleted_contacts}{$form.deleted_contacts.html} {$form.deleted_contacts.label}{/if}
-            </td>
-          </tr>
-        </table>
-      </fieldset>
+    <td>
+      {if $form.uf_user}
+        {$form.uf_user.label} {$form.uf_user.html}
+        <div class="description font-italic">
+          {ts 1=$config->userFramework}Does the contact have a %1 Account?{/ts}
+        </div>
+      {else}
+        &nbsp;
+      {/if}
     </td>
   </tr>
 </table>
diff --git a/templates/CRM/Contact/Form/Search/Criteria/DisplaySettings.tpl b/templates/CRM/Contact/Form/Search/Criteria/DisplaySettings.tpl
new file mode 100644 (file)
index 0000000..9979570
--- /dev/null
@@ -0,0 +1,21 @@
+<div id="display-settings" class="form-item">
+  <table>
+    <tr>
+      <td>
+        {if $form.component_mode}
+          {$form.component_mode.label} {help id="id-display-results"}
+          <br />
+          {$form.component_mode.html}
+          {if $form.display_relationship_type}
+            <div id="crm-display_relationship_type">{$form.display_relationship_type.html}</div>
+          {/if}
+        {else}
+          &nbsp;
+        {/if}
+      </td>
+      <td>
+        {$form.uf_group_id.label} {help id="id-search-views"}<br />{$form.uf_group_id.html}
+      </td>
+    </tr>
+  </table>
+</div>
diff --git a/templates/CRM/Contact/Form/Search/Criteria/SearchSettings.tpl b/templates/CRM/Contact/Form/Search/Criteria/SearchSettings.tpl
new file mode 100644 (file)
index 0000000..47a34fc
--- /dev/null
@@ -0,0 +1,21 @@
+<div id="search-settings" class="form-item">
+  <table>
+    <tr>
+      <td>{$form.operator.label} {help id="id-search-operator"}<br />{$form.operator.html}</td>
+      <td>
+        {if $form.deleted_contacts}{$form.deleted_contacts.html} {$form.deleted_contacts.label}{/if}
+      </td>
+      <td class="adv-search-top-submit" colspan="2">
+        <div class="crm-submit-buttons">
+          {include file="CRM/common/formButtons.tpl" location="top"}
+        </div>
+        <div class="crm-submit-buttons reset-advanced-search">
+          <a href="{crmURL p='civicrm/contact/search/advanced' q='reset=1'}" id="resetAdvancedSearch" class="crm-hover-button css_right" title="{ts}Clear all search criteria{/ts}">
+            <i class="crm-i fa-undo"></i>
+            {ts}Reset Form{/ts}
+          </a>
+        </div>
+      </td>
+    </tr>
+  </table>
+</div>