From c34daabbae379a4174c37507be21220a292bd071 Mon Sep 17 00:00:00 2001 From: aheaphy Date: Tue, 6 Feb 2024 15:46:22 -0500 Subject: [PATCH] Fixed date filter on thanksiving and earth day submissions --TEMP FIX ONLY --- .../SenatorMicrositeSchoolFormSubmissions.php | 36 +++++++++++++------ .../nysenate-header/nysenate-header.js | 6 ++-- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/web/modules/custom/nys_school_forms/src/Plugin/Block/SenatorMicrositeSchoolFormSubmissions.php b/web/modules/custom/nys_school_forms/src/Plugin/Block/SenatorMicrositeSchoolFormSubmissions.php index 8ebb699f20..7b541ca692 100644 --- a/web/modules/custom/nys_school_forms/src/Plugin/Block/SenatorMicrositeSchoolFormSubmissions.php +++ b/web/modules/custom/nys_school_forms/src/Plugin/Block/SenatorMicrositeSchoolFormSubmissions.php @@ -107,16 +107,30 @@ public function build() { $form_type = $term->getName(); $senator_term = ($node->hasField('field_senator_multiref') && !$node->get('field_senator_multiref')->isEmpty()) ? $node->get('field_senator_multiref')->entity : []; - $last_year_params = $params = [ - 'form_type' => $form_type, - 'senator' => $senator_term->id(), - 'school' => NULL, - 'teacher_name' => NULL, - 'from_date' => strtotime('this year January 1st'), - 'to_date' => NULL, - 'sort_by' => NULL, - 'sort_order' => NULL, - ]; + if ($form_type == 'Thankful') { + $last_year_params = $params = [ + 'form_type' => $form_type, + 'senator' => $senator_term->id(), + 'school' => NULL, + 'teacher_name' => NULL, + 'from_date' => strtotime('September 1, 2023'), + 'to_date' => strtotime('December 31, 2023'), + 'sort_by' => NULL, + 'sort_order' => NULL, + ]; + } + elseif ($form_type == 'Earth Day') { + $last_year_params = $params = [ + 'form_type' => $form_type, + 'senator' => $senator_term->id(), + 'school' => NULL, + 'teacher_name' => NULL, + 'from_date' => strtotime('January 1, 2023'), + 'to_date' => strtotime('December 31, 2023'), + 'sort_by' => NULL, + 'sort_order' => NULL, + ]; + } $last_year_params['from_date'] = NULL; $last_year_params['to_date'] = strtotime('last year December 31st'); @@ -154,7 +168,7 @@ public function build() { 'panels' => [ [ 'tab_text' => 'Current Year', - 'title' => date('Y') . ' Poster Submissions', + 'title' => '2023 Poster Submissions', 'filter' => $filter, 'years' => $this->schoolFormsService->getResults($params, FALSE), ], diff --git a/web/themes/custom/nysenate_theme/src/patterns/components/nysenate-header/nysenate-header.js b/web/themes/custom/nysenate_theme/src/patterns/components/nysenate-header/nysenate-header.js index 3c10c058f6..1a8bf5b52e 100644 --- a/web/themes/custom/nysenate_theme/src/patterns/components/nysenate-header/nysenate-header.js +++ b/web/themes/custom/nysenate_theme/src/patterns/components/nysenate-header/nysenate-header.js @@ -3,9 +3,9 @@ Drupal.behaviors.nysenateHeader = { attach: function (context) { // If admin toolbar is present, abort and use static nav bar. - if ($('#toolbar-administration').length > 0) { - return; - } + //if ($('#toolbar-administration').length > 0) { + // return; + //} let self = this; let userScroll = 0;