Fix notices from php
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 3 Apr 2018 17:47:39 +0000 (13:47 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 3 Apr 2018 17:47:39 +0000 (13:47 -0400)
Getting rid of php notices where template variables were undefined.

models/admin/ajax/eventsListExport.php
views/admin/ajax/eventsListExport.html
views/admin/ajax/eventsListExportCsv.html

index 487f42d..dd4ca25 100644 (file)
@@ -143,28 +143,22 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
         // Check for Archived filter
         if (isset($_REQUEST['filterArchived']) && $_REQUEST['filterArchived'] == 'on') {
             $filterArchived = true;
-            $_SESSION['search']['archived'] = true;
             $where .= " AND status = " . $this->config['status_numb']['Archived'];
         } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['filterArchived'] ) ) {
-            unset( $_SESSION['search']['archived'] );
         }
 
         // Check for Pending filter
         if (isset($_REQUEST['filterPending']) && $_REQUEST['filterPending'] == 'on') {
             $filterPending = true;
-            $_SESSION['search']['pending'] = true;
             $where .= " AND status = " . $this->config['status_numb']['Pending'];
         } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['filterPending'] ) ) {
-            unset( $_SESSION['search']['pending'] );
         }
 
         // Check for Featured filter
         if (isset($_REQUEST['filterFeatured']) && $_REQUEST['filterFeatured'] == 'on') {
             $filterFeatured = true;
-            $_SESSION['search']['featured'] = true;
             $where .= " AND featured = true";
         } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['filterFeatured'] ) ) {
-            unset( $_SESSION['search']['featured'] );
         }
 
         // Check if there is a category filter (multi-select)
@@ -179,7 +173,6 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
                 $catsSep = ',';
                 $categories[$c]['selected'] = true;
             }
-            $_SESSION['search']['cats'] = $cats;
 
             $where .= " AND id in (
                     SELECT DISTINCT(EC.event)
@@ -191,7 +184,6 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
                            )
             )";
         } else if ( isset( $_REQUEST['searched'] ) && !isset( $_REQUEST['filterCategories'] ) ) {
-            unset( $_SESSION['search']['cats'] );
         }
 
         // If we have a From date
@@ -200,13 +192,11 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
             $fromDate = date('m/d/Y', strtotime($_REQUEST['fromDate']));
             $fromMYSQL = date('Y-m-d', strtotime($fromDate));
             $dateWhere = " end_time >= '$fromMYSQL' ";
-            $_SESSION['search']['fromDate'] = $fromDate;
         } else if ( !isset( $_REQUEST['searched'] ) ) {
             $fromDate = date('m/d/Y');
             $fromMYSQL = date('Y-m-d', strtotime($fromDate));
             $dateWhere = " end_time >= '$fromMYSQL' ";
         } else if ( isset( $_REQUEST['searched'] ) && trim($_REQUEST['fromDate']) == '' ) {
-            unset( $_SESSION['search']['fromDate'] );
         }
 
         // If we have a to Date
@@ -223,9 +213,7 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
             } else {
                 $dateWhere = " start_time <= '$toMYSQL' ";
             }
-            $_SESSION['search']['toDate'] = $toDate;
         } else if ( isset( $_REQUEST['searched'] ) && trim($_REQUEST['toDate']) == '' ) {
-            unset( $_SESSION['search']['toDate'] );
         }
 
         // If we have from and to dates, do search for those inclusive
index fffa26c..8de7cf5 100644 (file)
                 </tr>
                 {/foreach}
             {else}
-                <tr class="alternate"><td colspan="2">(no {$terms.term_member} profiles listed)</td></tr>
+                <tr class="alternate"><td colspan="2">(no events listed)</td></tr>
             {/if}
             </tbody>
         </table>
index 82578eb..c61ccac 100644 (file)
 {if $select.exportFile1}"{if $event.file1}{$glmPluginMediaUrl}/files/{$event.file1}{/if}",{/if}
 {if $select.exportFile2}"{if $event.file2}{$glmPluginMediaUrl}/files/{$event.file2}{/if}",{/if}
 {if $select.exportFile3}"{if $event.file3}{$glmPluginMediaUrl}/files/{$event.file3}{/if}",{/if}
-{if $select.exportFree}"{$event.free}",{/if}
+{if $select.exportFree}"{$event.free.name}",{/if}
 {if $select.exportNotes}"{$event.notes}",{/if}
-{if $select.exportLocationName}"{if $event.locations.name}{$event.locations.name}{/if}",{/if}
-{if $select.exportAddress}"{if $event.locations.address}{$event.locations.address}{/if}",{/if}
-{if $select.exportCity}"{if $event.locations.city.name}{$event.locations.city.name}{/if}",{/if}
-{if $select.exportState}"{if $event.locations.state.name}{$event.locations.state.name}{/if}",{/if}
-{if $select.exportZip}"{if $event.locations.zip}{$event.locations.zip}{/if}",{/if}
-{if $select.exportCountry}"{if $event.locations.country.name}{$event.locations.country.name}{/if}",{/if}
-{if $select.exportRegion}"{if $event.locations.region.name}{$event.locations.region.name}{/if}",{/if}
+{if $select.exportLocationName}"{if $event.locations && $event.locations.name}{$event.locations.name}{/if}",{/if}
+{if $select.exportAddress}"{if $event.locations && $event.locations.address}{$event.locations.address}{/if}",{/if}
+{if $select.exportCity}"{if $event.locations && $event.locations.city.name}{$event.locations.city.name}{/if}",{/if}
+{if $select.exportState}"{if $event.locations && $event.locations.state.name}{$event.locations.state.name}{/if}",{/if}
+{if $select.exportZip}"{if $event.locations && $event.locations.zip}{$event.locations.zip}{/if}",{/if}
+{if $select.exportCountry}"{if $event.locations && $event.locations.country.name}{$event.locations.country.name}{/if}",{/if}
+{if $select.exportRegion}"{if $event.locations && $event.locations.region.name}{$event.locations.region.name}{/if}",{/if}
 {if $select.exportWebUrl}"{$event.url}",{/if}
 {if $select.exportTicketingUrl}"{$event.ticket_url}",{/if}
 {if $select.exportRegistrationUrl}"{$event.registration_url}",{/if}
@@ -71,4 +71,4 @@
 {if $select.exportCategories} {if $category_data} {foreach $category_data as $cat} {$cat_exists='""'} {foreach $event.categories as $t} {if $t.id == $cat.id}{$cat_exists='"Yes"'}{/if} {/foreach} {$cat_exists} {if !$cat@last},{/if} {/foreach} {/if} {/if}
 
 {/foreach}
-{else}No {$terms.term_member_plur_cap} Selected{/if}
+{else}No Events Selected{/if}