From: Chuck Scott Date: Tue, 17 Jan 2017 16:49:35 +0000 (-0500) Subject: Updated event edit to add a bold notice at the top of the page if there was a reason... X-Git-Tag: v1.6.5^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=74506cd392a03b91c36d318edb195481edd8a964;p=WP-Plugins%2Fglm-member-db-events.git Updated event edit to add a bold notice at the top of the page if there was a reason the event edit could not be submitted. 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. --- diff --git a/models/admin/events/list.php b/models/admin/events/list.php index 95d03c8..d2016e9 100644 --- a/models/admin/events/list.php +++ b/models/admin/events/list.php @@ -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, diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index 4fac70d..0ee0016 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -14,11 +14,25 @@ {if $option == 'edit' || $option == 'update'} Delete this Event -

Edit Event

+

Edit Event {else} -

Add new Event

+

Add new Event {/if} - +     + {if $eventUpdated}Event Updated{/if} + {if $eventUpdateError}Event Update Error{/if} + {if $eventAdded}Event Added{/if} + {if $eventAddError}Event Add Error{/if} +

+ + {if $eventUpdateError} +

NOTICE: Your event has not yet been submitted.
Please select the tabs indicating a problem, correct the indicated fields and resubmit.

+ {else} + {if !$haveTimes} +

NOTICE: Your event does not have any selected dates/times. Please check your schedule in the "Dates" tab below.

+ {/if} + {/if} + {if $haveMember && !$lockedToMember}
@@ -50,12 +64,6 @@ Summary Calendar Administrative Contact Attach Files -
- {if $eventUpdated}Event Updated{/if} - {if $eventUpdateError}Event Update Error{/if} - {if $eventAdded}Event Added{/if} - {if $eventAddError}Event Add Error{/if} -
@@ -967,6 +975,9 @@ */ var glmSubmitRequired = false; + {if $eventUpdateError} + glmPageUpdateRequired(); + {/if} // Flag submit button when updates are required. function glmPageUpdateRequired() { $('#updateEvent').addClass('glm-bad-input-area'); diff --git a/views/admin/events/editSchedule.html b/views/admin/events/editSchedule.html index 6b1fa5a..6e4768c 100644 --- a/views/admin/events/editSchedule.html +++ b/views/admin/events/editSchedule.html @@ -4,6 +4,7 @@
+

Event Occurrences: {$timesCount}

Add an Event Schedule