From: Steve Sutton Date: Wed, 20 Apr 2016 14:58:02 +0000 (-0400) Subject: Update locations output and the all_day event sorting. X-Git-Tag: v1.0.0^2~96 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e7b10c9f8e28bf6151bda4eeceef9cb7c9787348;p=WP-Plugins%2Fglm-member-db-events.git Update locations output and the all_day event sorting. 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. --- diff --git a/classes/data/dataEvents.php b/classes/data/dataEvents.php index 06a6fc6..cbfa4b6 100644 --- a/classes/data/dataEvents.php +++ b/classes/data/dataEvents.php @@ -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']); diff --git a/models/front/events/list.php b/models/front/events/list.php index 10654eb..6f1747f 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -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; diff --git a/views/front/events/detail.html b/views/front/events/detail.html index bd248b8..680c67e 100644 --- a/views/front/events/detail.html +++ b/views/front/events/detail.html @@ -44,12 +44,14 @@ {/if} {/if} - {if $event.hide_address.name == 'No' } + {if $event.hide_address.name == 'No'}
- {if !$event.use_member_location.value} + {if !$event.use_member_location.value && $event.locations} {if $event.locations.name}{$event.locations.name}
{/if} - {$event.locations.address}
- {$event.locations.city.name}, {$event.locations.state.value} {$event.locations.zip} + {if $event.locations.address} + {$event.locations.address}
+ {$event.locations.city.name}, {$event.locations.state.value} {$event.locations.zip} + {/if} {else} {$event.member.member}
{$event.member.addr1}