changing events data to times , to get separate event instances instead of spanning
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 24 Aug 2016 19:59:37 +0000 (15:59 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 24 Aug 2016 19:59:37 +0000 (15:59 -0400)
models/admin/ajax/eventsCalMonthAJAX.php
views/front/events/agenda.html

index e357ebf..3b1cc70 100644 (file)
@@ -23,7 +23,7 @@ require_once GLM_MEMBERS_EVENTS_PLUGIN_PATH . '/models/front/events/baseAction.p
  * an AJAX call that goes through the WorPress AJAX Handler.
  *
  */
-class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEvents
+class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEventsTimes
 {
 
     /**
@@ -115,8 +115,8 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEvents
         $where = '';
 
         
-            $where .= "T.status = " . $this->config['status_numb']['Active'] . "
-                AND T.id IN (
+            $where .= "T.active = 1
+                AND T.event IN (
                         SELECT event
                           FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET
                          WHERE active 
@@ -161,13 +161,13 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEvents
 //        var_dump($events);
         foreach ($events as $e=>$val){
 //            $times[] = ($val['times']);
-            $event_data[$e]['title'] = $val['name'];
+            $event_data[$e]['title'] = $val['event_name'];
             $event_data[$e]['url'] = GLM_MEMBERS_EVENTS_SITE_BASE_URL . "event-detail/" . $val['name_slug'] . "/";
             
-            $start = date('Y-m-d h:i:s', strtotime($val['starting_date']));
-            $last = date('Y-m-d h:i:s', strtotime($val['ending_date']));
+            $start = date('Y-m-d h:i:s', strtotime($val['start_time']['datetime']));
+            $last = date('Y-m-d h:i:s', strtotime($val['end_time']['datetime']));
             
-            $all_day = $val['all_day'];
+            $all_day = $val['all_day']['value'];
             
             $event_data[$e]['all_day'] = ($all_day === "0" ? false : true);
             $event_data[$e]['start'] = ($start);
@@ -178,7 +178,7 @@ class GlmMembersAdmin_ajax_eventsCalMonthAJAX extends GlmDataEvents
         $return = array(
             'status' => false,       // Assume nothing works
             'events' => $event_data,       // Where our events list will go
-            'message' => '',
+            'message' => $to,
             'times'  => ''
         );
 
index d8fd540..9b08aea 100644 (file)
@@ -68,7 +68,7 @@
         var event_search = $(".glm-search-icon");
         var main_content = $("#main-content");
         
-        calendar.hide();
+//        calendar.hide();
         
 //        event_search.on("click", function (){
 //            
                 data: dat,
                 cache: false,
                 success: function (response){
-//                    console.log(response);
+                    console.log(response);
                     var buildingEvents = [];
                     var events_obj = jQuery.parseJSON(response);
                     var events = events_obj.events;
+//                    console.log(events);
 
-                    buildingEvents = $.map(events, function(i, val) {   
+                    buildingEvents = $.map(events, function(i, val) { 
+                        console.log(i.title);
+                    
                         return {   
                             title:   i.title,
                             start:   i.start,
             editable: true,
             lazyFetching: true,
             eventClick : function (event){
-                location.href = event.url;
+//                location.href = event.url;
             },
-            nextDayThreshold: '00:00:00',
             eventLimit: true,
             views: {
                 month: {