Update locations output and the all_day event sorting.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Apr 2016 14:58:02 +0000 (10:58 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Apr 2016 14:58:02 +0000 (10:58 -0400)
For locations with no address hide the address commas
For all_day events use the date without the time to make them goto the
top of each day.

classes/data/dataEvents.php
models/front/events/list.php
views/front/events/detail.html

index 06a6fc6..cbfa4b6 100644 (file)
@@ -512,7 +512,7 @@ class GlmDataEvents extends GlmDataAbstract
         }
         if ($this->postAddLocations) {
             $r['locations'] = array();
-            if ($r['use_member_location'] ) {
+            if ($r['use_member_location']['value'] ) {
                 include_once  GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataMemberInfo.php';
                 $memberData = new GlmDataMemberInfo( $this->wpdb, $this->config );
                 $member = $memberData->getActiveInfoForMember((int)$r['ref_dest_id']);
index 10654eb..6f1747f 100644 (file)
@@ -304,10 +304,12 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
                     if ( isset($event['locations']) && !empty($event['locations']) && $event['hide_address']['name'] == 'No' ) {
                         $address   = array();
                         $address[] = $event['locations']['name'];
-                        $address[] = $event['locations']['address'];
-                        $address[] = $event['locations']['city']['name'];
-                        $address[] = $event['locations']['state']['name'];
-                        $address[] = $event['locations']['zip'];
+                        if ( $event['locations']['address'] ) {
+                            $address[] = $event['locations']['address'];
+                            $address[] = $event['locations']['city']['name'];
+                            $address[] = $event['locations']['state']['name'];
+                            $address[] = $event['locations']['zip'];
+                        }
                         $location  = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE );
 
                         $location->setText(implode(', ', $address));
@@ -453,7 +455,11 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
                     $event['starting_date'] = $eventTime['start_time']['timestamp'];
                     $event['ending_date']   = $eventTime['end_time']['timestamp'];
                     //$eventsByDate[$eventDateTime][$eventTime['start_time']['timestamp']][] = $event;
-                    $eventsByDate[$eventDateTime][][$event['starting_date'] . '-' . $event['id']] = $event;
+                    if ( $event['all_day'] ) {
+                        $eventsByDate[$eventDateTime][][$eventDateTime . '-' . $event['id']] = $event;
+                    } else {
+                        $eventsByDate[$eventDateTime][][$event['starting_date'] . '-' . $event['id']] = $event;
+                    }
                     // if there's a name search stop for the first occurrence of that event
                     if ( $action == 'event-list-name' ) {
                         break;
index bd248b8..680c67e 100644 (file)
                             {/if}
                         {/if}
                         </div>
-                        {if $event.hide_address.name == 'No' }
+                        {if $event.hide_address.name == 'No'}
                             <div class="small-12 column">
-                            {if !$event.use_member_location.value}
+                            {if !$event.use_member_location.value && $event.locations}
                                 {if $event.locations.name}{$event.locations.name}<br>{/if}
-                                {$event.locations.address}<br>
-                                {$event.locations.city.name}, {$event.locations.state.value} {$event.locations.zip}
+                                {if $event.locations.address}
+                                    {$event.locations.address}<br>
+                                    {$event.locations.city.name}, {$event.locations.state.value} {$event.locations.zip}
+                                {/if}
                             {else}
                                 {$event.member.member}<br>
                                 {$event.member.addr1}<br>