bumping version number, excluding pending events from the calendar that are pending
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 11 Oct 2016 13:59:02 +0000 (09:59 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 11 Oct 2016 13:59:02 +0000 (09:59 -0400)
index.php
models/admin/ajax/eventsCalMonthAJAX.php

index 35e7845..c9fb3d0 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Events
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.4.4
+ * Version: 1.4.5
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -20,7 +20,7 @@
  * @package glmMembersDatabaseEventsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.4.4
+ * @version 1.4.5
  */
 
 /*
@@ -38,7 +38,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.4.4');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.4.5');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.22');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 8c2fdaf..2c0a594 100644 (file)
@@ -75,24 +75,34 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
      * @access public
      * @return array events
      */
+    
+    /*
+     * leaving sql query in the event it is needed in the future. It selects events 
+     * from within a given date range. Left out of the where statement because it is
+     * already performed by $this->dateRange
+     */
+    //                AND ET.id IN (
+    //                    SELECT event
+    //                    FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS DTR
+    //                    WHERE active
+    //                    AND " . $this->dateRange . "
+    //                )
     public function getModelTimesData(  )
     {
-
         $this->postAddTimes = true;
         $where = '';
 
 
-            $where .= "T.active = 1
-                AND T.event IN (
-                        SELECT event
-                          FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET
-                         WHERE active
-                           AND " . $this->dateRange . "
-                    )
-                ";
+        $where .= "T.active = 1
+            AND T.event IN (
+                SELECT ET.id 
+                FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events AS ET
+                WHERE ET.status = " . $this->config['status_numb']['Active'] . "
+            ) 
+        ";
+                               
+        $events = $this->getList( $where );
 
-            $events = $this->getList( $where );
-//            echo "<pre>", print_r($events), '</pre>';
         $this->postAddTimes = false;
         return $events;
     }
@@ -115,7 +125,8 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
      */
     public function modelAction ($actionData = false)
     {
-
+        
+        
         $event_data = [];
         $month = filter_var_array(
             $_REQUEST['month'],
@@ -135,6 +146,7 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
             SELECT id
               FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times
               WHERE DATE(start_time) BETWEEN '{$from}' AND '{$to}'
+
         )";
 
         $times = $this->getModelTimesData();
@@ -161,8 +173,8 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
 
         $return = array(
 //            'status' => false,       // Assume nothing works
-            'events' => $event_data      // Where our events list will go
-//            'message' => '',
+            'events' => $event_data  ,    // Where our events list will go
+            'message' => $message,
 //            'times'  => ''
         );