adding files and images and dow to exports
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 3 Apr 2018 17:29:24 +0000 (13:29 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 3 Apr 2018 17:29:24 +0000 (13:29 -0400)
Add files 1 t o3
Add image
Add Days of Week to export

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

index a0e0223..487f42d 100644 (file)
@@ -90,6 +90,7 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
         $success        = false;
         $filterPending  = false;
         $filterArchived = false;
+        $filterFeatured = false;
         $haveFilter     = false;
         $numbDisplayed  = false;
         $lastDisplayed  = false;
@@ -105,11 +106,18 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
             'exportId'              => $this->checkFlag('exportId'),
             'exportName'            => $this->checkFlag('exportName'),
             'exportMember'          => $this->checkFlag('exportMember'),
+            'exportStarting'        => $this->checkFlag('exportStarting'),
+            'exportEnding'          => $this->checkFlag('exportEnding'),
+            'exportDaysow'          => $this->checkFlag('exportDaysow'),
             'exportStatus'          => $this->checkFlag('exportStatus'),
             'exportFeatured'        => $this->checkFlag('exportFeatured'),
             'exportCategories'      => $this->checkFlag('exportCategories'),
             'exportIntro'           => $this->checkFlag('exportIntro'),
             'exportDescr'           => $this->checkFlag('exportDescr'),
+            'exportImage'           => $this->checkFlag('exportImage'),
+            'exportFile1'           => $this->checkFlag('exportFile1'),
+            'exportFile2'           => $this->checkFlag('exportFile2'),
+            'exportFile3'           => $this->checkFlag('exportFile3'),
             'exportFree'            => $this->checkFlag('exportFree'),
             'exportCost'            => $this->checkFlag('exportCost'),
             'exportNotes'           => $this->checkFlag('exportNotes'),
@@ -243,10 +251,11 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
         $category_data = $this->wpdb->get_results( $sql, ARRAY_A );
 
         // Get a current list of events without paging
-        $orderBy                = "(select min(start_time) FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times WHERE T.id = event),name";
-        $this->postCategories   = true;
-        $this->postAddLocations = true;
-        $this->postAddTimes     = true;
+        $orderBy                  = "(select min(start_time) FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times WHERE T.id = event),name";
+        $this->postCategories     = true;
+        $this->postAddLocations   = true;
+        $this->postAddTimes       = true;
+        $this->postAddRecurrences = true;
 
         $list = $this->getList( $where, $orderBy, true );
 
@@ -283,7 +292,9 @@ class GlmMembersAdmin_ajax_eventsListExport extends GlmDataEvents
             'nextStart'      => $nextStart,
             'start'          => $start,
             'limit'          => $limit,
-            'namesList'      => $namesList
+            'namesList'      => $namesList,
+            'imageBaseUrl'   => '',
+            'fileBaseUrl'    => '',
         );
 
         $view = 'admin/ajax/eventsListExport.html';
index 14f41d7..fffa26c 100644 (file)
@@ -4,7 +4,7 @@
     <body>
 
         <span style="float: right;"><b>Total found: {$memberCount}&nbsp;&nbsp;</b></span>
-        <b>List&nbsp;of&nbsp;{$terms.term_member_cap} Profiles</b>
+        <b>List&nbsp;of&nbsp;Events</b>
         <br clear="all">
 
         <table>
                     {if $select.exportName}<th align="left">Event Name</th>{/if}
                     {if $select.exportMember}<th align="left">{$terms.term_member_cap} Name</th>{/if}
                     {if $select.exportStatus}<th align="left">Status</th>{/if}
-                    <th>Starting Date</th>
-                    <th>Ending Date</th>
+                    {if $select.exportStarting}<th>Starting Date</th>{/if}
+                    {if $select.exportEnding}<th>Ending Date</th>{/if}
+                    {if $select.exportDaysow}<th>Days of Week</th>{/if}
                     {if $select.exportFeatured}<th align="left">Featured</th>{/if}
                     {if $select.exportIntro}<th align="left">Intro</th>{/if}
                     {if $select.exportDescr}<th align="left">Description</th>{/if}
+                    {if $select.exportImage}<th align="left">Image</th>{/if}
+                    {if $select.exportFile1}<th align="left">File 1</th>{/if}
+                    {if $select.exportFile2}<th align="left">File 2</th>{/if}
+                    {if $select.exportFile3}<th align="left">File 3</th>{/if}
                     {if $select.exportFree}<th align="left">Free</th>{/if}
                     {if $select.exportNotes}<th align="left">Notes</th>{/if}
                     {if $select.exportLocationName}<th align="left">Location Name</th>{/if}
                     {if $select.exportName}<td>{$event.name}</td>{/if}
                     {if $select.exportMember}<td>{$event.ref_dest}</td>{/if}
                     {if $select.exportStatus}<td>{$event.status.name}</td>{/if}
-                    <td>{$event.starting_date}</td>
-                    <td>{$event.ending_date}</td>
+                    {if $select.exportStarting}<td>{$event.starting_date}</td>{/if}
+                    {if $select.exportEnding}<td>{$event.ending_date}</td>{/if}
+                    {if $select.exportDaysow}<td>{if $event.recurrences.0.recurring.value}{foreach $event.recurrences.0.day_of_week.names as $dow}{$dow} {/foreach}{/if}</td>{/if}
                     {if $select.exportFeatured}<td>{$event.featured.name}</td>{/if}
                     {if $select.exportIntro}<td>{$event.intro}</td>{/if}
                     {if $select.exportDescr}<td>{$event.descr}</td>{/if}
+                    {if $select.exportImage}<td>{if $event.image}{$glmPluginMediaUrl}/images/original/{$event.image}{/if}</td>{/if}
+                    {if $select.exportFile1}<td>{if $event.file1}{$glmPluginMediaUrl}/files/{$event.file1}{/if}</td>{/if}
+                    {if $select.exportFile2}<td>{if $event.file2}{$glmPluginMediaUrl}/files/{$event.file2}{/if}</td>{/if}
+                    {if $select.exportFile3}<td>{if $event.file3}{$glmPluginMediaUrl}/files/{$event.file3}{/if}</td>{/if}
                     {if $select.exportFree}<td>{$event.free.name}</td>{/if}
                     {if $select.exportNotes}<td>{$event.notes}</td>{/if}
 
index 75c0b9c..82578eb 100644 (file)
@@ -2,9 +2,17 @@
 {if $select.exportId}"ID",{/if}
 {if $select.exportName}"Event Name",{/if}
 {if $select.exportMember}"{$terms.term_member_cap} Name",{/if}
-{if $select.exportStatus}"Status",{/if} "Starting Date", "Ending Date", {if $select.exportFeatured}"Featured",{/if}
+{if $select.exportStatus}"Status",{/if}
+{if $select.exportStarting}"Starting Date",{/if}
+{if $select.exportEnding}"Ending Date",{/if}
+{if $select.exportDaysow}"Days of Week",{/if}
+{if $select.exportFeatured}"Featured",{/if}
 {if $select.exportIntro}"Intro",{/if}
 {if $select.exportDescr}"Description",{/if}
+{if $select.exportImage}"Image",{/if}
+{if $select.exportFile1}"File 1",{/if}
+{if $select.exportFile2}"File 2",{/if}
+{if $select.exportFile3}"File 3",{/if}
 {if $select.exportFree}"Free",{/if}
 {if $select.exportNotes}"Notes",{/if}
 {if $select.exportLocationName}"Location Name",{/if}
 {if $select.exportId}"{$event.id}",{/if}
 {if $select.exportName}"{$event.name}",{/if}
 {if $select.exportMember}"{$event.ref_dest}",{/if}
-{if $select.exportStatus}"{$event.status.name}",{/if} "{$event.starting_date}", "{$event.ending_date}", {if $select.exportFeatured}"{$event.featured.name}",{/if}
+{if $select.exportStatus}"{$event.status.name}",{/if}
+{if $select.exportStarting}"{$event.starting_date}",{/if}
+{if $select.exportEnding}"{$event.ending_date}",{/if}
+{if $select.exportDaysow}"{if $event.recurrences.0.recurring.value}{foreach $event.recurrences.0.day_of_week.names as $dow}{$dow} {/foreach}{/if}",{/if}
+{if $select.exportFeatured}"{$event.featured.name}",{/if}
 {if $select.exportIntro}"{$event.intro}",{/if}
 {if $select.exportDescr}"{$event.descr}",{/if}
+{if $select.exportImage}"{if $event.image}{$glmPluginMediaUrl}/images/original/{$event.image}{/if}",{/if}
+{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.exportNotes}"{$event.notes}",{/if}
 {if $select.exportLocationName}"{if $event.locations.name}{$event.locations.name}{/if}",{/if}
index f665d1d..d4a83ff 100644 (file)
                                 <input type="checkbox" name="exportId"> Account ID<br>
                                 <input type="checkbox" name="exportName" checked> Event Name<br>
                                 <input type="checkbox" name="exportMember" checked> {$terms.term_member_cap} Name<br>
+                                <input type="checkbox" name="exportStarting" checked> Start Date<br>
+                                <input type="checkbox" name="exportEnding" checked> End Date<br>
+                                <input type="checkbox" name="exportDaysow" checked> Days of Week<br>
                                 <input type="checkbox" name="exportStatus" checked> Status<br>
                                 <input type="checkbox" name="exportFeatured" checked> Featured <br>
                                 <input type="checkbox" name="exportCategories" checked> Categories <br>
                                 <input type="checkbox" name="exportIntro" checked> Intro <br>
                                 <input type="checkbox" name="exportDescr" checked> Description <br>
+                                <input type="checkbox" name="exportImage" checked> Image <br>
+                                <input type="checkbox" name="exportFile1" checked> File 1 <br>
+                            </td>
+                            <td class="exportFieldsTd">
+                                <input type="checkbox" name="exportFile2" checked> File 2 <br>
+                                <input type="checkbox" name="exportFile3" checked> File 3 <br>
                                 <input type="checkbox" name="exportFree" checked> Free <br>
                                 <input type="checkbox" name="exportCost" checked> Cost <br>
                                 <input type="checkbox" name="exportNotes" checked> Notes <br>
-                            </td>
-                            <td class="exportFieldsTd">
                                 <input type="checkbox" name="exportLocationName" checked> Location Name <br>
                                 <input type="checkbox" name="exportAddress" checked> Address <br>
                                 <input type="checkbox" name="exportCity" checked> City <br>
                                 <input type="checkbox" name="exportZip" checked> ZIP / Postal Code <br>
                                 <input type="checkbox" name="exportCountry" checked> Country <br>
                                 <input type="checkbox" name="exportRegion" checked> Region <br>
+                            </td>
+                            <td class="exportFieldsTd">
                                 <input type="checkbox" name="exportWebUrl" checked> Web URL <br>
                                 <input type="checkbox" name="exportTicketingUrl" checked> Ticketing URL <br>
                                 <input type="checkbox" name="exportRegistrationUrl" checked> Registration URL <br>
-                            </td>
-                            <td class="exportFieldsTd">
                                 <input type="checkbox" name="exportContactName" checked> Contact Name <br>
                                 <input type="checkbox" name="exportContactPhone" checked> Contact Phone <br>
                                 <input type="checkbox" name="exportContactEmail" checked> Contact Email <br>
@@ -74,7 +81,6 @@
                                 <input type="checkbox" name="exportAdminOrg" checked> Admin Contact Organization <br>
                                 <input type="checkbox" name="exportAdminEmail" checked> Admin Contact Email <br>
                                 <input type="checkbox" name="exportAdminPhone" checked> Admin Contact Phone <br>
-
                             </td>
                         </tr>
                     </table>