Update the add event page for notice of no times.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 29 Mar 2018 19:32:36 +0000 (15:32 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 29 Mar 2018 19:32:36 +0000 (15:32 -0400)
Show this notice only when they have no times (update)

models/admin/events/list.php
views/admin/events/edit.html

index 5cfd116..fcedeaf 100644 (file)
@@ -126,6 +126,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
         $numbRecurrences  = 0;
         $times            = false;
         $haveTimes        = false;
+        $newEvent         = false;
         $timesCount       = 0;
         $firstTime        = false;
         $lastTime         = false;
@@ -256,6 +257,9 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
         case 'add':
 
             $event = $this->newEntry();
+            // Assume the event has times.
+            // This will be true if they do not goto the dates tab.
+            $newEvent = true;
 
             $view = 'edit';
 
@@ -991,6 +995,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
             'newRecurrence'     => $newRecurrence,
             'times'             => $times,
             'haveTimes'         => $haveTimes,
+            'newEvent'          => $newEvent,
             'timesCount'        => $timesCount,
             'firstTime'         => $firstTime,
             'lastTime'          => $lastTime,
index b918b19..1964a09 100644 (file)
@@ -42,7 +42,7 @@
   {if $eventUpdateError || $eventAddError}
     <h1 class="glm-error">NOTICE: Your event has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
   {else}
-      {if !$haveTimes}
+      {if !$haveTimes && !$newEvent}
     <h4 class="glm-error">NOTICE: Your event does not have any selected dates/times. Please check your schedule in the "Dates" tab below.</h4>
     {/if}
   {/if}
@@ -77,7 +77,6 @@
             <a id="glm-event-location" data-show-table="glm-table-location" class="glm-event-tab nav-tab{if $currentTab == 'glm-table-location'} nav-tab-active{/if}">Location</a>
             <a id="glm-event-recurrence" data-show-table="glm-table-recurrence" class="glm-event-tab nav-tab{if $currentTab == 'glm-table-recurrence'} nav-tab-active{/if}">Dates</a>
             <a id="glm-event-calendar" data-show-table="glm-table-calendar" class="glm-event-tab nav-tab{if $currentTab == 'glm-table-calendar'} nav-tab-active{/if}">Summary Calendar</a>
-            <!-- <a id="glm&#45;event&#45;admin" data&#45;show&#45;table="glm&#45;table&#45;settings" class="glm&#45;event&#45;tab nav&#45;tab{if $currentTab == 'glm&#45;table&#45;settings'} nav&#45;tab&#45;active{/if}">Administrative Contact</a> -->
             <a id="glm-event-files" data-show-table="glm-table-files" class="glm-event-tab nav-tab{if $currentTab == 'glm-table-files'} nav-tab-active{/if}">Attach Files</a>
         </h2>