From b4d1cb73006242aa362415b37cb46f467da28416 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 5 Apr 2016 16:57:00 -0400 Subject: [PATCH] Update for the fields and the free flag --- models/front/events/list.php | 48 ++++++++++++++++------------------ views/front/events/detail.html | 13 ++++----- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/models/front/events/list.php b/models/front/events/list.php index e4781d5..cad09ce 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -272,40 +272,36 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction $location->setText(implode(', ', $address)); $location->draw($page->getCanvas(), self::PDF_LFT_COL_X, $pdfY); $pdfY -= self::LINE_HEIGHT * $lineCount; + } - // check for phone, url or email to output - $contactInfo = array(); - if ( $event['locations']['phone'] ) { - $contactInfo[] = $event['locations']['phone']; - } - if ( $event['locations']['email'] ) { - $contactInfo[] = $event['locations']['email']; - } - if ( $event['locations']['url'] ) { - $contactInfo[] = $event['locations']['url']; - } - if ( !empty($contactInfo) ) { - $contact = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE ); - $contact->setText( implode( ' - ', $contactInfo ) ); - $contact->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY ); - $pdfY -= self::LINE_HEIGHT * $lineCount; - } + // check for phone, url or email to output + $contactInfo = array(); + if ( $event['contact_phone'] ) { + $contactInfo[] = $event['contact_phone']; + } + if ( $event['contact_email'] ) { + $contactInfo[] = $event['contact_email']; } - if ( $event['url'] ) { - $url = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE ); - $website = ( strpos('http://', $event['url']) ) - ? $event['url'] - : 'http://' . $event['url']; - $url->setText( $website ); - $url->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY ); - $pdfY -= self::LINE_HEIGHT; + $contactInfo[] = $event['url']; + } + if ( !empty($contactInfo) ) { + $contact = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE ); + $contact->setText( implode( ' - ', $contactInfo ) ); + $contact->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY ); + $pdfY -= self::LINE_HEIGHT * $lineCount; } - if ( $event['cost'] ) { + + if ( $event['cost'] && !$event['free'] ) { $cost = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE ); $cost->setText( $event['cost'] ); $cost->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY ); $pdfY -= self::LINE_HEIGHT; + } else if ( $event['free'] ) { + $cost = new SetaPDF_Core_Text_Block( $font, self::PDF_FONT_SIZE ); + $cost->setText( 'FREE' ); + $cost->draw( $page->getCanvas(), self::PDF_LFT_COL_X, $pdfY ); + $pdfY -= self::LINE_HEIGHT; } $pdfY -= self::LINE_HEIGHT * 2; diff --git a/views/front/events/detail.html b/views/front/events/detail.html index a58f48c..5a32db2 100644 --- a/views/front/events/detail.html +++ b/views/front/events/detail.html @@ -43,13 +43,14 @@ {if $event.cost}
Cost
{$event.cost}
{/if} + {if $event.free} +
Cost
FREE
+ {/if}
Contact & More Info
- {if $event.url} - {$event.url}
- {/if} - {if $event.email} - Email: {$event.email} - {/if} + {if $event.url}{$event.url}
{/if} + {if $event.contact_name}Contact: {$event.contact_name}
{/if} + {if $event.contact_email}Email: {$event.contact_email}
{/if} + {if $event.contact_phone}Phone: {$event.contact_phone}
{/if}
-- 2.17.1