Update the link from the event list page.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 17 Aug 2017 17:36:55 +0000 (13:36 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 17 Aug 2017 17:40:24 +0000 (13:40 -0400)
Correcting the link for add reg or registration from event list.

setup/adminHooks.php

index 54e529f..78bd8bf 100644 (file)
@@ -47,30 +47,30 @@ add_filter('glm-member-db-admin-management-hooksHelp', function($content) {
 add_filter(
     'glm_members_add_link_to_event_list_entry',
     function( $content ){
-        
+
         // Check if there's an existing reg_event record for the supplied event ID.
         require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
         $RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config);
-        
+
         // If we were passed a valid Event ID
         $eventId = $content-0;
         if ($eventId > 0) {
 
             // Try to get get the registrations data for this event
             $regEvent = $RegEvent->getEntry($eventId, 'event');
-            
-            // If we received valid registrations data for this event then it's already in registrations 
+
+            // If we received valid registrations data for this event then it's already in registrations
             if ($regEvent) {
-                
+
                 // Return link title and URL for this event in registrations
-                return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=dashboard&event=".$eventId);
-                
+                return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event&regEventID=".$regEvent['id']);
+
             }
-            
+
         }
-        
+
         // Since we must not have had a good event ID or didn't find the event in registrations, return title and url to add this event to registrations
-        return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=add&event=".$eventId);
+        return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event&option=add&event=".$eventId);
 
     },
     10,