From 2b85023a11dfce21ffa091ee934ebbda9f9f1f26 Mon Sep 17 00:00:00 2001
From: Eileen McNaughton <emcnaughton@wikimedia.org>
Date: Sat, 5 Feb 2022 14:23:10 +1300
Subject: [PATCH] Enotice fixes with datepicker

Datepicker requires some fields to be set to avoid enotices (at least with grumpy mode disabled).
---
 .../Form/Search/Custom/ContributionAggregate.tpl     |  2 +-
 templates/CRM/Activity/Form/Search/Common.tpl        |  2 +-
 templates/CRM/Case/Form/Search/Common.tpl            |  4 ++--
 .../CRM/Contact/Form/Search/Criteria/ChangeLog.tpl   |  4 ++--
 .../Contact/Form/Search/Criteria/Demographics.tpl    |  4 ++--
 .../Contact/Form/Search/Criteria/Relationship.tpl    |  6 +++---
 templates/CRM/Contribute/Form/Search/Common.tpl      |  4 ++--
 .../CRM/Contribute/Form/Search/ContributionRecur.tpl | 12 ++++++------
 templates/CRM/Core/DatePickerRangeWrapper.tpl        |  1 -
 templates/CRM/Custom/Form/Search.tpl                 |  2 +-
 templates/CRM/Event/Form/Search/Common.tpl           |  4 ++--
 templates/CRM/Mailing/Form/Search.tpl                |  2 +-
 templates/CRM/Mailing/Form/Search/Common.tpl         |  2 +-
 templates/CRM/Member/Form/Search/Common.tpl          |  6 +++---
 templates/CRM/Pledge/Form/Search/Common.tpl          |  8 ++++----
 templates/CRM/Report/Form/Tabs/Filters.tpl           |  2 +-
 16 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/ext/legacycustomsearches/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl b/ext/legacycustomsearches/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
index 68af3dd085fd..781088fa9c12 100644
--- a/ext/legacycustomsearches/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
+++ b/ext/legacycustomsearches/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl
@@ -26,7 +26,7 @@
               <td class="label" for="receive_date_relative">
                 <label>{ts}Contribution Dates{/ts}</label>
               </td>
-              {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="receive_date" colspan="2"}
+              {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="receive_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
             </tr>
             <tr class="crm-contact-custom-search-contributionDetails-form-block-financial_type">
                 <td class="label" for="financial_type_id">
diff --git a/templates/CRM/Activity/Form/Search/Common.tpl b/templates/CRM/Activity/Form/Search/Common.tpl
index 0759d8e2bb14..d34f2e3668f6 100644
--- a/templates/CRM/Activity/Form/Search/Common.tpl
+++ b/templates/CRM/Activity/Form/Search/Common.tpl
@@ -70,7 +70,7 @@
 {/if}
 
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="activity_date_time" colspan="2"}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="activity_date_time" to='' from='' colspan="2" hideRelativeLabel=0 class =''}
   <td>&nbsp;</td>
 </tr>
 <tr>
diff --git a/templates/CRM/Case/Form/Search/Common.tpl b/templates/CRM/Case/Form/Search/Common.tpl
index dc9d0121f242..a72011305116 100644
--- a/templates/CRM/Case/Form/Search/Common.tpl
+++ b/templates/CRM/Case/Form/Search/Common.tpl
@@ -22,10 +22,10 @@
   </tr>
 
   <tr>
-    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="case_start_date" hideRelativeLabel=0}
+    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="case_start_date" to='' from='' colspan='' class ='' hideRelativeLabel=0}
   </tr>
   <tr>
-    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="case_end_date" hideRelativeLabel=0}
+    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="case_end_date" to='' from='' colspan='' class ='' hideRelativeLabel=0 }
   </tr>
 
   <tr id='case_search_form'>
diff --git a/templates/CRM/Contact/Form/Search/Criteria/ChangeLog.tpl b/templates/CRM/Contact/Form/Search/Criteria/ChangeLog.tpl
index 38da97e13b2f..f84cc732f07b 100644
--- a/templates/CRM/Contact/Form/Search/Criteria/ChangeLog.tpl
+++ b/templates/CRM/Contact/Form/Search/Criteria/ChangeLog.tpl
@@ -10,14 +10,14 @@
 <div id="changelog" class="form-item">
   <table class="form-layout">
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="modified_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="modified_date" to='' from='' class='' colspan='' hideRelativeLabel=0}
       <td>
         <span class="modifiedBy"><label>{ts}Modified By{/ts}</label></span></br>
         {$form.changed_by.html}<br><span class="description">{ts}Note this field just filters on who made a change no matter when that change happened, It doesn't have any link to the modified date field.{/ts}</span>
       </td>
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="created_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="created_date" to='' from='' colspan='' class='' hideRelativeLabel=0}
     </tr>
   </table>
 </div>
diff --git a/templates/CRM/Contact/Form/Search/Criteria/Demographics.tpl b/templates/CRM/Contact/Form/Search/Criteria/Demographics.tpl
index 41edbab14014..ad2858ea82aa 100644
--- a/templates/CRM/Contact/Form/Search/Criteria/Demographics.tpl
+++ b/templates/CRM/Contact/Form/Search/Criteria/Demographics.tpl
@@ -10,7 +10,7 @@
 <div id="demographics" class="form-item">
   <table class="form-layout">
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="birth_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="birth_date" to='' from='' colspan='' class='' hideRelativeLabel=0}
     </tr>
     <tr>
       <td>
@@ -27,7 +27,7 @@
       </td>
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="deceased_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="deceased_date"  to='' from='' colspan='' class='' hideRelativeLabel=0}
     </tr>
     <tr>
       <td>
diff --git a/templates/CRM/Contact/Form/Search/Criteria/Relationship.tpl b/templates/CRM/Contact/Form/Search/Criteria/Relationship.tpl
index 35a22fd9241b..2fe8f3c1d359 100644
--- a/templates/CRM/Contact/Form/Search/Criteria/Relationship.tpl
+++ b/templates/CRM/Contact/Form/Search/Criteria/Relationship.tpl
@@ -44,16 +44,16 @@
       </td>
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relationship_start_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relationship_start_date"  to='' from='' colspan='' class='' hideRelativeLabel=0}
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relationship_end_date"}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relationship_end_date"  to='' from='' colspan='' class='' hideRelativeLabel=0}
     </tr>
     <tr>
       <td colspan="2"><label>{ts}Active Period{/ts}</label> {help id="id-relationship-active-period" file="CRM/Contact/Form/Search/Advanced.hlp"}<br /></td>
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relation_active_period_date" hideRelativeLabel=1}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="relation_active_period_date" to='' from='' colspan='' class ='' hideRelativeLabel=1 }
     </tr>
     {if !empty($relationshipGroupTree)}
       <tr>
diff --git a/templates/CRM/Contribute/Form/Search/Common.tpl b/templates/CRM/Contribute/Form/Search/Common.tpl
index c585ac38dea7..4101c7aca307 100644
--- a/templates/CRM/Contribute/Form/Search/Common.tpl
+++ b/templates/CRM/Contribute/Form/Search/Common.tpl
@@ -9,7 +9,7 @@
 *}
 
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="receive_date" colspan="2"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="receive_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td><label>{ts}Contribution Amounts{/ts}</label> <br />
@@ -159,7 +159,7 @@
   </td>
 </tr>
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_cancel_date" colspan="2"}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_cancel_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td>
diff --git a/templates/CRM/Contribute/Form/Search/ContributionRecur.tpl b/templates/CRM/Contribute/Form/Search/ContributionRecur.tpl
index 0988205710b0..1eb1679a8af8 100644
--- a/templates/CRM/Contribute/Form/Search/ContributionRecur.tpl
+++ b/templates/CRM/Contribute/Form/Search/ContributionRecur.tpl
@@ -20,27 +20,27 @@
       </tr>
       <tr>
         <td><label for="contribution_recur_start_date_relative">{$form.contribution_recur_start_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_start_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_start_date" to='' from='' colspan="2" hideRelativeLabel=1 class =''}
       </tr>
       <tr>
         <td><label for="contribution_recur_end_date_relative">{$form.contribution_recur_end_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_end_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_end_date" to='' from='' colspan="2" hideRelativeLabel=1 class =''}
       </tr>
       <tr>
         <td><label for="contribution_recur_modified_date_relative">{$form.contribution_recur_modified_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_modified_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_modified_date" to='' from='' colspan="2" class ='' hideRelativeLabel=1}
       </tr>
       <tr>
         <td><label for="contribution_recur_next_sched_contribution_date_relative">{$form.contribution_recur_next_sched_contribution_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_next_sched_contribution_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_next_sched_contribution_date" to='' from='' colspan="2" hideRelativeLabel=1 class=''}
       </tr>
       <tr>
         <td><label for="contribution_recur_failure_rety_date_relative">{$form.contribution_recur_failure_retry_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_failure_retry_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_failure_retry_date" to='' from='' colspan="2" hideRelativeLabel=1 class=''}
       </tr>
       <tr>
         <td><label for="contribution_recur_cancel_date_relative">{$form.contribution_recur_cancel_date_relative.label}</label></td>
-        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_cancel_date" colspan="2" hideRelativeLabel=1}
+        {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="contribution_recur_cancel_date" to='' from='' colspan="2" hideRelativeLabel=1 class=''}
       </tr>
       <tr>
         <td>{ts}Status{/ts}</td>
diff --git a/templates/CRM/Core/DatePickerRangeWrapper.tpl b/templates/CRM/Core/DatePickerRangeWrapper.tpl
index f43499bd1308..1a0139cfa87a 100644
--- a/templates/CRM/Core/DatePickerRangeWrapper.tpl
+++ b/templates/CRM/Core/DatePickerRangeWrapper.tpl
@@ -9,7 +9,6 @@
 *}
 {* Wrapper around DatePickerRange TPL file *}
 <td {if !empty($colspan)} colspan="{$colspan}" {else} colspan="2" {/if} {if !empty($class)} class="{$class}" {/if}>
-  {assign var='hideRelativeLabel' value=$hideRelativeLabel|default:0}
   {assign var='from' value=$from|default:'_low'}
   {assign var='to' value=$to|default:'_high'}
   {include file="CRM/Core/DatePickerRange.tpl" fieldName=$fieldName hideRelativeLabel=$hideRelativeLabel to=$to from=$from}
diff --git a/templates/CRM/Custom/Form/Search.tpl b/templates/CRM/Custom/Form/Search.tpl
index 8bf00efc5b67..5e593598218c 100644
--- a/templates/CRM/Custom/Form/Search.tpl
+++ b/templates/CRM/Custom/Form/Search.tpl
@@ -29,7 +29,7 @@
                     {$form.$element_name_from.html|crmAddClass:six}
                     &nbsp;&nbsp;{$form.$element_name_to.label}&nbsp;&nbsp;{$form.$element_name_to.html|crmAddClass:six}
                   {elseif empty($element.skip_calendar)}
-                    {include file="CRM/Core/DatePickerRangeCustomField.tpl" fieldName=$element_name hideRelativeLabel=0}<td>
+                    {include file="CRM/Core/DatePickerRangeCustomField.tpl" fieldName=$element_name to='' from='' colspan='' class='' hideRelativeLabel=0}<td>
                   {/if}
             {else}
                 <td class="label">{$form.$element_name.label}</td><td>
diff --git a/templates/CRM/Event/Form/Search/Common.tpl b/templates/CRM/Event/Form/Search/Common.tpl
index b3b7e87b95aa..1081d1e137d9 100644
--- a/templates/CRM/Event/Form/Search/Common.tpl
+++ b/templates/CRM/Event/Form/Search/Common.tpl
@@ -17,9 +17,9 @@
   <td class="crm-event-form-block-event_type_id"> {$form.event_type_id.label}<br />{$form.event_type_id.html} </td>
 </tr>
 <tr>
-    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="event" colspan="2"}</tr>
+    {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="event" to='' from='' colspan="2" class='' hideRelativeLabel=0}</tr>
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="participant_register_date" colspan="2"}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="participant_register_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td class="crm-event-form-block-participant_status"><label>{$form.participant_status_id.label}</label>
diff --git a/templates/CRM/Mailing/Form/Search.tpl b/templates/CRM/Mailing/Form/Search.tpl
index a355ca7ed776..91d681a68c11 100644
--- a/templates/CRM/Mailing/Form/Search.tpl
+++ b/templates/CRM/Mailing/Form/Search.tpl
@@ -15,7 +15,7 @@
       </td>
     </tr>
     <tr>
-      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="mailing" colspan='2'}
+      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="mailing" to='' from='' colspan='2' class='' hideRelativeLabel=0}
     </tr>
     <tr>
       <td colspan="1">{$form.sort_name.label} {help id="id-create_sort_name"}<br />
diff --git a/templates/CRM/Mailing/Form/Search/Common.tpl b/templates/CRM/Mailing/Form/Search/Common.tpl
index 8392543a3921..a29908a4c0a4 100644
--- a/templates/CRM/Mailing/Form/Search/Common.tpl
+++ b/templates/CRM/Mailing/Form/Search/Common.tpl
@@ -11,7 +11,7 @@
 </td>
 </tr>
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="mailing_job_start_date"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="mailing_job_start_date" to='' from='' colspan='' class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td>
diff --git a/templates/CRM/Member/Form/Search/Common.tpl b/templates/CRM/Member/Form/Search/Common.tpl
index f816ea63bce8..c34e451edd2b 100644
--- a/templates/CRM/Member/Form/Search/Common.tpl
+++ b/templates/CRM/Member/Form/Search/Common.tpl
@@ -47,13 +47,13 @@
   <td>{$form.member_is_override.label}{help id="id-member_is_override" file="CRM/Member/Form/Search.hlp"}{$form.member_is_override.html}</td>
 </tr>
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_join_date" colspan='2'}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_join_date" to='' from='' colspan='2' class='' hideRelativeLabel=0}
 </tr>
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_start_date" colspan='2'}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_start_date" to='' from='' colspan='2' class='' hideRelativeLabel=0}
 </tr>
 <tr>
-  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_end_date" colspan='2'}
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="membership_end_date" to='' from='' colspan='2' class='' hideRelativeLabel=0}
 </tr>
 
 {* campaign in membership search *}
diff --git a/templates/CRM/Pledge/Form/Search/Common.tpl b/templates/CRM/Pledge/Form/Search/Common.tpl
index a073fa0c5b25..34bdc059a4ef 100644
--- a/templates/CRM/Pledge/Form/Search/Common.tpl
+++ b/templates/CRM/Pledge/Form/Search/Common.tpl
@@ -9,7 +9,7 @@
 *}
 
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_payment_scheduled_date" colspan="2"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_payment_scheduled_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td colspan="2">
@@ -29,13 +29,13 @@
   </td>
 </tr>
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_create_date" colspan="2"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_create_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_start_date" colspan="2"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_start_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
-{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_end_date" colspan="2"}
+{include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="pledge_end_date" to='' from='' colspan="2" class='' hideRelativeLabel=0}
 </tr>
 <tr>
   <td>
diff --git a/templates/CRM/Report/Form/Tabs/Filters.tpl b/templates/CRM/Report/Form/Tabs/Filters.tpl
index 5324ca33af7e..aab5a09470eb 100644
--- a/templates/CRM/Report/Form/Tabs/Filters.tpl
+++ b/templates/CRM/Report/Form/Tabs/Filters.tpl
@@ -30,7 +30,7 @@
                 {if !empty($field.operatorType) && $field.operatorType & 4}
                   <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}">
                     <td class="label report-contents">{if !empty($field.title)}{$field.title}{/if}</td>
-                      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName=$fieldName hideRelativeLabel=1 from='_from' to='_to'}
+                      {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName=$fieldName hideRelativeLabel=1 from='_from' to='_to' class='' colspan=''}
                   </tr>
                 {elseif $form.$fieldOp.html}
                   <tr class="report-contents crm-report crm-report-criteria-filter crm-report-criteria-filter-{$tableName}" {if !empty($field.no_display)} style="display: none;"{/if}>