Update for the fields and the free flag
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 5 Apr 2016 20:57:00 +0000 (16:57 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 5 Apr 2016 20:57:20 +0000 (16:57 -0400)
models/front/events/list.php
views/front/events/detail.html

index e4781d5..cad09ce 100644 (file)
@@ -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;
 
index a58f48c..5a32db2 100644 (file)
                         {if $event.cost}
                         <div class="small-12 column"><strong>Cost</strong><br> {$event.cost}</div>
                         {/if}
+                        {if $event.free}
+                        <div class="small-12 column"><strong>Cost</strong><br> FREE</div>
+                        {/if}
                         <div class="small-12 column"><strong>Contact & More Info</strong><br>
-                            {if $event.url}
-                            <a href="{$event.url}" target="_blank">{$event.url}</a><br>
-                            {/if}
-                            {if $event.email}
-                            Email: <a href="mailto: {$event.email}">{$event.email}</a>
-                            {/if}
+                            {if $event.url}<a href="{$event.url}" target="_blank">{$event.url}</a><br>{/if}
+                            {if $event.contact_name}Contact: {$event.contact_name}<br>{/if}
+                            {if $event.contact_email}Email: <a href="mailto: {$event.contact_email}">{$event.contact_email}</a><br>{/if}
+                            {if $event.contact_phone}Phone: {$event.contact_phone}<br>{/if}
                         </div>
                     </div>
                 </div>