adding session checking for paging in the events list admin model
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 12 Jun 2017 18:58:16 +0000 (14:58 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 12 Jun 2017 18:58:16 +0000 (14:58 -0400)
adding another section that checks to see if the session search variables are set and if they are
use those for paging

models/admin/events/list.php

index a28942e..2a6a779 100644 (file)
@@ -643,7 +643,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
                 } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['prevStart'] ) ) {
                     unset( $_SESSION['search']['prevStart'] );
                 }
-
+  
                 // Check for Archived filter
                 if (isset($_REQUEST['filterArchived']) && $_REQUEST['filterArchived'] == 'on') {
                     $filterArchived = true;
@@ -779,7 +779,6 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
 
                 // Check if we're doing paging
                 if (isset($_REQUEST['pageSelect'])) {
-
                     // If request is for Next
                     if ($_REQUEST['pageSelect'][0] == 'N') {
                         $newStart = $_REQUEST['nextStart'] - 0;
@@ -793,6 +792,20 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
                         $start = $newStart;
                     }
                 }
+                
+                if( isset($_SESSION['search']['pageSelect']) ){
+                     // If request is for Next
+                    if ($_SESSION['search']['pageSelect'][0] == 'N') {
+                        $newStart = $_SESSION['search']['nextStart'] - 0;
+
+                    // Otherwise it must be Previous
+                    } else {
+                        $newStart = $_SESSION['search']['prevStart'] - 0;
+                    }
+                    if ($newStart > 0) {
+                        $start = $newStart;
+                    }
+                }
 
                 // Get the list of events and determine number of events in list
                 $saveFLT = $this->postFirstAndLastTimes;