Updated event edit to add a bold notice at the top of the page if there was a reason...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Jan 2017 16:49:35 +0000 (11:49 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Jan 2017 16:49:35 +0000 (11:49 -0500)
Now setting page modified status to prevent user from being able to leave the page after a failed submit without answering a pop-up that they want to leave the page.
Sorted out problems with am/pm pick-list when editing start and end times. That was a fix to js/datetimepicker in glm-member-db plugin.

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

index 95d03c8..d2016e9 100644 (file)
@@ -123,6 +123,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
         $numbRecurrences  = 0;
         $times            = false;
         $haveTimes        = false;
+        $timesCount       = 0;
         $firstTime        = false;
         $lastTime         = false;
         $memberID         = false;
@@ -763,6 +764,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
 
                 if ($times && count($times) > 0) {
                     $haveTimes = true;
+                    $timesCount = count($times);
 
                     // Get the first event date/time
                     $firstTime = current($times);
@@ -807,6 +809,7 @@ class GlmMembersAdmin_events_list extends GlmDataEvents
             'newRecurrence'     => $newRecurrence,
             'times'             => $times,
             'haveTimes'         => $haveTimes,
+            'timesCount'        => $timesCount,
             'firstTime'         => $firstTime,
             'lastTime'          => $lastTime,
             'memberID'          => $memberID,
index 4fac70d..0ee0016 100644 (file)
 
   {if $option == 'edit' || $option == 'update'}
     <a id="deleteEventButton" class="button button-secondary glm-button glm-right">Delete this Event</a>
-    <h2>Edit Event</h2>
+    <h2>Edit Event
   {else}
-    <h2>Add new Event</h2>
+    <h2>Add new Event
   {/if}
-
+        &nbsp;&nbsp;&nbsp;
+        {if $eventUpdated}<span class="glm-notice glm-flash-updated">Event Updated</span>{/if}
+        {if $eventUpdateError}<span class="glm-error glm-flash-updated">Event Update Error</span>{/if}
+        {if $eventAdded}<span class="glm-notice glm-flash-updated">Event Added</span>{/if}
+        {if $eventAddError}<span class="glm-error glm-flash-updated">Event Add Error</span>{/if}
+    </h2>
+  
+  {if $eventUpdateError}
+    <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}
+    <h1 class="glm-error">NOTICE: Your event does not have any selected dates/times. Please check your schedule in the "Dates" tab below.</h1>
+    {/if}
+  {/if}
+    
   {if $haveMember && !$lockedToMember}
     <form action="{$thisUrl}?page=glm-members-admin-menu-member" method="post" enctype="multipart/form-data">
         <input type="hidden" name="glm_action" value="events">
             <a id="glm-event-calendar" data-show-table="glm-table-calendar" class="glm-event-tab nav-tab">Summary Calendar</a>
             <a id="glm-event-admin" data-show-table="glm-table-settings" class="glm-event-tab nav-tab">Administrative Contact</a>
             <a id="glm-event-files" data-show-table="glm-table-files" class="glm-event-tab nav-tab">Attach Files</a>
-            <div class="glm-right" style="padding-right: 1em;">
-                {if $eventUpdated}<span class="glm-notice glm-flash-updated glm-right">Event Updated</span>{/if}
-                {if $eventUpdateError}<span class="glm-error glm-flash-updated glm-right">Event Update Error</span>{/if}
-                {if $eventAdded}<span class="glm-notice glm-flash-updated glm-right">Event Added</span>{/if}
-                {if $eventAddError}<span class="glm-error glm-flash-updated glm-right">Event Add Error</span>{/if}
-            </div>
         </h2>
 
         <!-- Status and Description -->
              */
             var glmSubmitRequired = false;
 
+        {if $eventUpdateError}
+            glmPageUpdateRequired();
+        {/if}
             // Flag submit button when updates are required.
             function glmPageUpdateRequired() {
                 $('#updateEvent').addClass('glm-bad-input-area');
index 6b1fa5a..6e4768c 100644 (file)
@@ -4,6 +4,7 @@
 <table id="glm-table-recurrence" class="glm-admin-table glm-hidden glm-event-table">
     <tr>
         <td id="placeRecurDeletesHere" colspan="2">
+            <h2 {if !$haveTimes}class="glm-error"{/if}><b>Event Occurrences:</b> {$timesCount}</h2>
             <a id="addRecurrence" class="button button-secondary glm-button">Add an Event Schedule</a>
         </td>
     </tr>