Restructure of event schedule pretty much done.
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 7 Apr 2016 18:09:11 +0000 (14:09 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 7 Apr 2016 18:09:11 +0000 (14:09 -0400)
classes/data/dataRecurrences.php
views/admin/events/edit.html
views/admin/events/editLocation.html
views/admin/events/editSchedule.html
views/admin/events/editStatus.html
views/admin/events/list.html

index eef4ca9..6c3e3c5 100644 (file)
@@ -141,7 +141,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract
             'start_time' => array (
                 'field' => 'start_time',
                 'type' => 'time',
-                'format' => 'h:i a',
+                'time_format' => 'h:i a',
                 'required' => true,
                 'use' => 'a'
             ),
@@ -166,7 +166,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract
             'end_time' => array (
                 'field' => 'end_time',
                 'type' => 'time',
-                'format' => 'h:i a',
+                'time_format' => 'h:i a',
                 'use' => 'a'
             ),
 
@@ -207,7 +207,7 @@ class GlmDataEventsRecurrences extends GlmDataAbstract
                     'field'    => 'month_of_year',
                     'type'     => 'bitmap',
                     'bitmap'    => $this->config['month'],
-                    'default'  => 0, // no months selected
+                    'default'  => 4095, // All months selected
                     'use'      => 'a'
             ),
 
index e74fe28..9eb0c36 100644 (file)
@@ -8,7 +8,7 @@
   {if $haveMember}
     <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=events&member={$memberID}" class="button button-primary glm-button glm-right">Return to Events List</a>
   {else}
-    <a href="{$thisUrl}?page={$thisPage}&glm_action=list" class="button button-primary glm-button glm-right">Return to Events List</a>
+    <a href="{$thisUrl}?page={$thisPage}&glm_action=list" class="button button-secondary glm-button glm-right">Return to Events List</a>
   {/if}
 
   {if $option == 'edit'}
@@ -18,7 +18,6 @@
     <h2>Add new Event</h2>
   {/if}
 
-
     <form action="{$thisUrl}?page={if $haveMember}glm-members-admin-menu-member{else}{$thisPage}{/if}" method="post" enctype="multipart/form-data">
         <input type="hidden" name="glm_action" value="{if $haveMember}events{else}list{/if}">
     {if $haveMember}
     {/if}
 
        <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
-            <a id="glm-event-descr" data-show-table="glm-table-descr" class="glm-event-tab nav-tab nav-tab-active">Status & Description</a>
+            <a id="glm-event-descr" data-show-table="glm-table-descr" class="glm-event-tab nav-tab nav-tab-active">Event Description</a>
             <a id="glm-event-location" data-show-table="glm-table-location" class="glm-event-tab nav-tab">Location</a>
-            <a id="glm-event-recurrence" data-show-table="glm-table-recurrence" class="glm-event-tab nav-tab">Event Schedule</a>
+            <a id="glm-event-recurrence" data-show-table="glm-table-recurrence" class="glm-event-tab nav-tab">Dates</a>
             <a id="glm-event-calendar" data-show-table="glm-table-calendar" class="glm-event-tab nav-tab">Summary Calendar</a>
             <a id="glm-event-settings" 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>
-            {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}
+            <input id="updateEvent" class="glm-right button button-primary" type="submit" value="{if $haveEvent}Update Event{else}Save New Event{/if}">
+            <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 -->
@@ -79,8 +81,6 @@
 
         {include file='admin/events/editAdminContact.html'}
 
-        <input id="updateEvent" type="submit" value="{if $haveEvent}Update Event{else}Add New Event{/if}">
-
     </form>
 
 {else} <!-- Can just display -->
                 // If we already have at least one location, we need to add a separator
                 var locTemp = '';
                 if (numbLocations) {
-                    locTemp = '<tbody class="location_{ newLocID }"><tr><td colspan="2"><hr></td></tr></tbody>';
-
+//                    locTemp = '<tbody class="location_{ newLocID }"><tr><td colspan="2"><hr></td></tr></tbody>';
                 // Otherwise, we'll say we now have our first location
                 } else {
                     numbLocations++;
                 // If we already have at least one recurrence, we need to add a separator
                 var recurTemp = '';
                 if (numbRecurrences) {
-                    recurTemp = '<tbody class="recurrence_{ newRecurID }"><tr><td colspan="2"><hr></td></tr></tbody>';
+//                    recurTemp = '<tbody class="recurrence_{ newRecurID }"><tr><td colspan="2"><hr></td></tr></tbody>';
 
                 // Otherwise, we'll say we now have our first recurrence
                 } else {
 
                 // Date / Time Pickers
                 $('.glm-datetime-input').datetimepicker({
-                    format: 'm/d/Y h:i a',
-                    lang: 'en',
-                    step: 15,
-                    closeOnWithoutClick: true,
-                    pick12HourFormat: true,
-                    formatTime:'h:i a'
-                });
-
-                // Date / Time Pickers
-                $('.glm-datetime-input').datetimepicker({
-                    format: 'm/d/Y h:i a',
+                    format: 'm/d/Y h:m a',
                     lang: 'en',
                     step: 15,
                     closeOnWithoutClick: true,
 
                 // Time Only Pickers
                 $('.glm-time-input').datetimepicker({
-                    format: 'h:i A',
+                    format: 'h:i a',
                     lang: 'en',
                     step: 15,
                     closeOnWithoutClick: true,
                     pick12HourFormat: true,
-                    formatTime:'h:i A',
+                    formatTime:'h:i a',
                     datepicker: false
                 });
 
                 $('.all-dates-checkbox').click( function() {
                     recurID = $(this).attr('data-id');
                     if ($("#allDatesEvent_" + recurID)[0].checked) {
-                        $("#allDatesExclude_" + recurID).addClass('glm-hidden');
-                    } else {
                         $("#allDatesExclude_" + recurID).removeClass('glm-hidden');
+                    } else {
+                        $("#allDatesExclude_" + recurID).addClass('glm-hidden');
                     }
                 });
 
index 74df300..efd3ef8 100644 (file)
                                     <input id="name_{$loc.id}" type="text" name="Loc{$loc.id}_name" value="{$loc.name}" class="glm-form-text-input-medium">
                                 </td>
                             </tr>
-                    <tr>
-                        <th>Hide Location Address:</th>
-                        <td>
-                            <input type="checkbox" name="hide_address" {if $event.fieldData.hide_address.value} checked{/if}>
-                            Don't show location address to site visitors.
-                        </td>
-                    </tr>
+                            <tr>
+                                <th>Hide Location Address:</th>
+                                <td>
+                                    <input type="checkbox" name="Loc{$loc.id}_hide_address" {if $event.fieldData.hide_address.value} checked{/if}>
+                                    Don't show location address to site visitors.
+                                </td>
+                            </tr>
                             <tr>
                                 <th>Address:</th>
                                 <td>
                         <input id="name_{ newLocID }" type="text" name="{ newLocID }_name" value="{$newLocation.fieldData.name}" class="glm-form-text-input-medium">
                     </td>
                 </tr>
+                <tr>
+                    <th>Hide Location Address:</th>
+                    <td>
+                        <input type="checkbox" name="{ newLocID }_hide_address">
+                        Don't show location address to site visitors.
+                    </td>
+                </tr>
                 <tr>
                     <th>Address:</th>
                     <td>
index 38fe85a..efc3759 100644 (file)
@@ -4,7 +4,7 @@
 <table id="glm-table-recurrence" class="glm-admin-table glm-hidden glm-event-table">
     <tr>
         <td id="placeRecurDeletesHere" colspan="2">
-            <a id="addRecurrence" class="button button-primary glm-button glm-right">Add an Event Schedule</a>
+            <a id="addRecurrence" class="button button-secondary glm-button glm-right">Add an Event Schedule</a>
         </td>
     </tr>
     <tr>
@@ -13,8 +13,8 @@
                 <!-- Recurrence forms go here. -->
 {if $recurrences}
     {foreach $recurrences as $r}
-                <tr class="recurrence_{$r.id}"><td colspan="2"><hr></td></tr>
-                <tr id="recurrence_{$r.id}" class="recurrence_{$r.id} recurrence-form">
+                <tbody id="recurrence_{$r.id}" class="recurrence_{$r.id} recurrence-form">
+                <tr><td colspan="2"><hr></td></tr>
                     <td>
                         <input type="hidden" name="recurID[{$r.id}]" value="{$r.id}">
                         <input type="hidden" name="Recur{$r.id}_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
                                 <td><input data-id="{$r.id}" type="text" name="Recur{$r.id}_end_time" value="{trim($r.end_time.time)}" class="glm-form-text-input-veryshort glm-time-input recurrence-input"></td>
                             </tr>
                             <tr><td colspan="2">&nbsp;</td></tr>
-                            <tr><th colspan="2">Date range over which recurring event can take place</p></th></tr>
                             <tr>
-                                <th>From Date:</th>
+                                <th>Start Date:</th>
                                 <td>
                                     <input data-id="{$r.id}" type="text" name="Recur{$r.id}_from_date" value="{$r.from_date.date}" class="glm-form-text-input-small glm-date-input recurrence-input" placeholder="Click to Select Date/Time">
                                 </td>
                             </tr>
                             <tr>
-                                <th>To Date:</th>
+                                <th>End Date:</th>
                                 <td>
                                     <input data-id="{$r.id}" type="text" name="Recur{$r.id}_to_date" value="{$r.to_date.date}" class="glm-form-text-input-small glm-date-input recurrence-input" placeholder="Click to Select Date/Time">
                                 </td>
                             </tr>
-
+                            <tr>
+                                <th>Recurring Event:</th>
+                                <td width="90%">
+                                    <input id="allDatesEvent_{$r.id}" data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_all_dates" class="all-dates-checkbox recurrence-input" {if $r.all_dates.value} checked{/if}>
+                                    Setup a detailed schedule.
+                                </td>
+                            </tr>
                         </table>
                     </td>
                     <td>
                             <tr>
                                 <th></th>
                                 <th>
-                                    <a id="deleteRecurrence_{$r.id}" data-id="{$r.id}" class="button button-primary glm-button glm-right delete-recurrence all_dates-checkbox">Delete this Event Schedule</a>
-                                    When the event recurrs
+                                    <a id="deleteRecurrence_{$r.id}" data-id="{$r.id}" class="button button-secondary glm-button glm-right delete-recurrence all_dates-checkbox">Delete this Event Schedule</a>
                                 </th>
                             </tr>
-                            <tr>
-                                <th>Ongoing Event:</th>
-                                <td width="90%">
-                                    <input id="allDatesEvent_{$r.id}" data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_all_dates" class="all-dates-checkbox recurrence-input" {if $r.all_dates.value} checked{/if}>
-                                    Check to have event recurr every day from the "From Date" through the "To Date".
-                                </td>
-                            </tr>
-                            <tbody id="allDatesExclude_{$r.id}"{if $r.all_dates.value} class="glm-hidden"{/if}>
+                            <tbody id="allDatesExclude_{$r.id}"{if !$r.all_dates.value} class="glm-hidden"{/if}>
                                 <tr>
                                     <th>Months</th>
                                     <td>
                                         <div id="recurCalendarDialog_{$r.id}" class="glm-dialog-box" title="">
                                             <p>Click on Dates to select/remove those dates for this schedule.</p>
                                             <div id="recurCalendar_{$r.id}"></div>
+                                            <p><div data-id="closeRecurCalendar_{$r.id}" class="button button-primary glm-set-none glm-right">Save</div></p>
                                         </div>
                                         Use to add specific dates to the schedule. Does not show other scheduled dates.
                                     </td>
                     </td>
                 </tr>
 
-
+                </tbody>
 
     {/foreach}
 {else}
 <!-- Add Recurrence Template -->
 
 <table id="addRecurrenceTemplate" class="glm-hidden">
-    <tr id="recurrence_{ newRecurID }">
+    <tbody id="recurrence_{ newRecurID }">
+        <tr><td colspan="2"><hr></td></tr>
+        <tr>
         <td>
             <input type="hidden" name="recurID[{ newRecurID }]" value="{ newRecurID }">
     {if $haveEvent}
                     </td>
                 </tr>
                 <tr><td colspan="2">&nbsp;</td></tr>
-                <tr><th colspan=2">Date range over which recurring event can take place</th></tr>
                 <tr>
-                    <th>From Date:</th>
+                    <th>Start Date:</th>
                     <td>
                         <input type="text" name="{ newRecurID }_from_date" value="{$newRecurrence.fieldData.from_date.date}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time">
                     </td>
                 </tr>
                 <tr>
-                    <th>To Date:</th>
+                    <th>End Date:</th>
                     <td>
                         <input type="text" name="{ newRecurID }_to_date" value="{$newRecurrence.fieldData.to_date.date}" class="glm-form-text-input-small glm-date-input" placeholder="Click to Select Date/Time">
                     </td>
                 </tr>
-
+                <tr>
+                    <th>Recurring Event:</th>
+                    <td width="90%">
+                        <input id="allDatesEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_all_dates" class="all-dates-checkbox recurrence-input">
+                        Setup a detailed schedule;
+                    </td>
+                </tr>
             </table>
         </td>
         <td>
                 <tr>
                     <th></th>
                     <th>
-                        <a id="deleteRecurrence_{ newRecurID }" data-id="{ newRecurID }" class="button button-primary glm-button glm-right delete-recurrence">Delete this Event Schedule</a>
-                        When the event recurrs
+                        <a id="deleteRecurrence_{ newRecurID }" data-id="{ newRecurID }" class="button button-secondary glm-button glm-right delete-recurrence">Delete this Event Schedule</a>
                     </th>
                 </tr>
-                <tr>
-                    <th>Ongoing Event:</th>
-                    <td width="90%">
-                        <input id="allDatesEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_all_dates" class="all-dates-checkbox recurrence-input">
-                        Check to have event recurr every day from the "From Date" through the "To Date".
-                    </td>
-                </tr>
-                <tbody id="allDatesExclude_{ newRecurID }">
+                <tbody id="allDatesExclude_{ newRecurID }" class="glm-hidden">
                     <tr>
                         <th>Months</th>
                         <td>
                             </table>
                         </td>
                     </tr>
+                     <tr>
+                        <th>Select with Calendar</th>
+                        <td>
+                            <div data-id="{ newRecurID }" class="button glm-button-small glm-set-none recur-calendar">Show Calendar</div>
+                            <div id="recurCalendarDialog_{ newRecurID }}" class="glm-dialog-box" title="">
+                                <p>Click on Dates to select/remove those dates for this schedule.</p>
+                                <div id="recurCalendar_{ newRecurID }"></div>
+                                <div data-id="closeRecurCalendar_{ newRecurID }" class="button button-primary glm-set-none">Done</div>
+                            </div>
+                            Use to add specific dates to the schedule. Does not show other scheduled dates.
+                        </td>
+                    </tr>
                 </tbody>
             </table>
         </td>
     </tr>
+    </tbody>
 </table>
 
index cc52ed1..fbc99fb 100644 (file)
@@ -58,7 +58,7 @@
                         <td>
                             <input type="checkbox" name="featured" {if $event.fieldData.featured.value} checked{/if}>&nbsp;Featured Event&nbsp;&nbsp;
                             <input type="checkbox" name="slideshow" {if $event.fieldData.slideshow.value} checked{/if}>&nbsp;Include in Slideshow&nbsp;&nbsp;
-                            <input type="checkbox" name="major" {if $event.fieldData.major.value} checked{/if}>&nbsp;Major Event
+                            <!-- <input type="checkbox" name="major" {if $event.fieldData.major.value} checked{/if}>&nbsp;Major Event -->
                         </td>
                     </tr>
 
             <td {if $event.fieldFail.descr}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
                 {php} 
                     wp_editor('{$event.fieldData.descr|escape:quotes}', 'glm_descr', array(
-                        // 'media_buttons' => true,
+                        'media_buttons' => false,
                         // 'quicktags' => false,
                         // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
                         'textarea_name' => 'descr',
                 {if $event.fieldFail.image}<p>{$event.fieldFail.image}</p>{/if}
             </td>
         </tr>
+<!--
         <tr>
             <th {if $event.fieldRequired.contact_phone}class="glm-required"{/if}>Event Phone #:</th>
             <td {if $event.fieldFail.contact_phone}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
                 {if $event.fieldFail.contact_phone}<p>{$event.fieldFail.contact_phone}</p>{/if}<br>
             </td>
         </tr>
+-->
         <tr>
             <th {if $event.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
             <td {if $event.fieldFail.url}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
index 341fbd0..4bbc513 100644 (file)
@@ -8,9 +8,9 @@
 {if apply_filters('glm_members_permit_admin_events_index_add_event', true)}
     <h2 style="margin-bottom: 1em;">
       {if $haveMember} {* This is if we're processing events for a specific member *}
-        <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=events&option=add&member={$memberID}" class="button button-primary glm-button glm-right">Add A New Event</a>
+        <a href="{$thisUrl}?page=glm-members-admin-menu-member&glm_action=events&option=add&member={$memberID}" class="button button-secondary glm-button glm-right">Add A New Event</a>
       {else}
-        <a href="{$thisUrl}?page={$thisPage}&glm_action=list&option=add" class="button button-primary glm-button glm-right">Add A New Event</a>
+        <a href="{$thisUrl}?page={$thisPage}&glm_action=list&option=add" class="button button-secondary glm-button glm-right">Add A New Event</a>
       {/if}
         {if $eventDeleted}<span class="glm-notice glm-flash-updated glm-right">Event Deleted</span>{/if}
         {if $eventDeleteError}<span class="glm-error glm-flash-updated glm-right">Event Delete Error</span>{/if}