Allow filtering on deleted participants.
authorMattias Michaux <mattias.michaux@gmail.com>
Tue, 17 Nov 2015 09:35:33 +0000 (10:35 +0100)
committerMattias Michaux <mattias.michaux@gmail.com>
Sat, 21 Nov 2015 19:13:55 +0000 (20:13 +0100)
CRM/Event/Form/Search.php
templates/CRM/Event/Form/Search.tpl

index 7f7384ca655a095b54b6f7754928f85aadb87d6c..c90d8277a0d17a43664ae9e4227175cb831f5f04 100644 (file)
@@ -170,6 +170,10 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
     parent::buildQuickForm();
     $this->addSortNameField();
 
+    if (CRM_Core_Permission::check('access deleted contacts') and CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete', NULL)) {
+      $this->addElement('checkbox', 'deleted_contacts', ts('Search deleted participants'));
+    }
+
     CRM_Event_BAO_Query::buildSearchForm($this);
 
     $rows = $this->get('rows');
index 6f110d6842c8c112b3cd718b2be69fbb09a2d4d0..eff497fdc7871c59ad2fc3643a9a2edc4bcea8f8 100644 (file)
         <tr class="crm-event-search-form-block-sort_name">
            <td class="font-size12pt" colspan="2">
                {$form.sort_name.label}&nbsp;&nbsp;{$form.sort_name.html|crmAddClass:'twenty'}&nbsp;&nbsp;&nbsp;{$form.buttons.html}
+               {if $form.deleted_contacts}
+                    <tr class="crm-event-search-form-block-deleted_contacts">
+                        <td colspan="2">
+                            {$form.deleted_contacts.html}&nbsp;&nbsp;{$form.deleted_contacts.label}
+                        </td>
+                    </tr>
+                {/if}
            </td>
         </tr>