Testing changes in frontHooks.php to correct intermittant event detail pages.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 30 Aug 2016 16:12:50 +0000 (12:12 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 30 Aug 2016 16:14:50 +0000 (12:14 -0400)
Added commentary to event date sesection page to better describe how to use it.

setup/frontHooks.php
views/admin/events/edit.html
views/admin/events/editSchedule.html

index 205dd5a..c40c2f7 100644 (file)
  *  *** Also note that parameters will be in the context of the main front controller constructor. ***
  */
 
+// Setup rewrite for member detail pages
+add_filter('rewrite_rules_array', function($rules) {
+
+    // Check if rule is not set
+    if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$'] ) ) {
+
+        // Add the new rule
+        $newrules = array();
+        $newrules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$']='index.php?pagename=$matches[1]&eventslug=$matches[2]';
+        return $newrules + $rules;
+    }
+
+    // If already set, just return the rules unchanged.
+    return $rules;
+
+});
+
+/* This code is being replace for testing by the above to avoid intermittent 404's on the detail pages.
 // Check if the canonical event page rewrite rule is not currently in place.
 $rules = get_option( 'rewrite_rules' );
 if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$'] ) ) {
@@ -44,6 +62,7 @@ if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([
     });
 
 }
+*/
 
 /*
  * Event Detail Page Canonical URL Fix
index 254c8d6..ee39850 100644 (file)
                     $('#recurCalendarDialog_' + recurID).attr('title', 'Select Dates for ' + recurName);
     
                     $('#recurCalendarDialog_' + recurID).dialog({
-                        position: { my: 'top+75', of: '#recurSpecDates_' + recurID},
+                        position: { my: 'right bottom-15', at: 'left top', of: '#recurSpecDates_' + recurID},
                         minWidth: 600
                     });
                     // Color to change calendar cell to (in rgb so it compares to our test below)
index 1974422..17a3b27 100644 (file)
@@ -61,7 +61,7 @@
                                 <th>Recurring Event:</th>
                                 <td width="90%">
                                     <input id="recurringEvent_{$r.id}" data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_recurring" class="recurring-checkbox recurrence-input" {if $r.recurring.value} checked{/if}>
-                                    Setup a detailed schedule.
+                                    Setup a detailed schedule.<br>Leave this un-checked for events that occur<br>every day from Start Date to End Date.
                                 </td>
                             </tr>
                         </table>
@@ -76,6 +76,9 @@
                                 </th>
                             </tr>
                             <tbody id="recurringExclude_{$r.id}"{if !$r.recurring.value} class="glm-hidden"{/if}>
+                                <tr><td colspan="2"><h2 style="text-align: center;">Recurring Schedule for Event</h2></td></tr>
+                                <tr><td colspan="2">Use the fields below to establish a recurring monthly, weekly, or daily schedule for your event. If any event dates don't fit this recurring schedule, use the "Add Specific Dates..." section below.</td></tr>
+                                <tr><td colspan="2">&nbsp;</td></tr>
                                 <tr>
                                     <th>Months</th>
                                     <td>
                                     </td>
                                 </tr>
                                 <tr><td colspan="2">&nbsp;</td></tr>
+                                <tr><td colspan="2"><hr width="50%"></td></tr>
+                                <tr><td colspan="2"><h2 style="text-align: center;">Add Specific Dates that Don't Fit Schedule Above</h2></td></tr>
+                                <tr><td colspan="2">Use this section to enter specific additional dates that don't fit into a regular monthly, weekly or daily schedule above. 
+                                    If all your dates don't fit a recurring schedule above, you may click "None" for all of the options above and select all specific dates for your event here.</td></tr>
+                                <tr><td colspan="2">&nbsp;</td></tr>
                                 <tr>
                                     <th>Select with Calendar</th>
                                     <td>
     <tbody id="recurrence_{ newRecurID }">
         <tr><td colspan="2"><hr></td></tr>
         <tr>
-        <td>
+          <td style="width: 2%;">
             <input type="hidden" name="recurID[{ newRecurID }]" value="{ newRecurID }">
     {if $haveEvent}
             <input type="hidden" name="{ newRecurID }_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
                         <input  id="recurSchedName_{ newRecurID }" data-id="{ newRecurID }" type="text" name="{ newRecurID }_name" value="" class="glm-form-text-input-small recurrence-input">
                     </td>
                 </tr>
+                <tr><td colspan="2">&nbsp;</td></tr>
                 <tr>
                     <th class="glm-notice">New Schedule</th>
                     <th>&nbsp</th>
                 </tr>
                 <tr class="not-all-day-{ newRecurID }">
                     <th>Start Time:</th>
-                    <td>
+                    <td style="white-space: nowrap;">
                         <input data-id="{ newRecurID }" type="text" name="{ newRecurID }_start_time" value="{$newRecurrence.fieldData.start_time.time}" class="glm-form-text-input-veryshort glm-time-input recurrence-input">
                         <input data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_start_time_only" class="start-time-only-checkbox recurrence-input"> Start time only
                     </td>
                 </tr>
                 <tr>
                     <th>Recurring Event:</th>
-                    <td width="90%">
+                    <td width="90%" style="white-space: nowrap;">
                         <input id="recurringEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_recurring" class="recurring-checkbox recurrence-input">
-                        Setup a detailed schedule;
+                        Setup a detailed schedule.<br>Leave this un-checked for events that occur<br>every day from Start Date to End Date.
                     </td>
                 </tr>
             </table>
-        </td>
-        <td>
-            <table width="100%">
-
+          </td>
+          <td style="width: 80%">
+            <table width="100%" style="margin-left: 2em;">
                 <tr>
                     <th></th>
                     <th>
                     </th>
                 </tr>
                 <tbody id="recurringExclude_{ newRecurID }" class="glm-hidden">
+                    <tr><td colspan="2"><h2 style="text-align: center;">Recurring Schedule for Event</h2></td></tr>
+                    <tr><td colspan="2">Use the fields below to establish a recurring monthly, weekly, or daily schedule for your event. If any event dates don't fit this recurring schedule, use the "Add Specific Dates..." section below.</td></tr>
+                    <tr><td colspan="2">&nbsp;</td></tr>
                     <tr>
                         <th>Months</th>
                         <td>
                         </td>
                     </tr>
                     <tr><td colspan="2">&nbsp;</td></tr>
-                     <tr>
+                    <tr><td colspan="2"><hr width="50%"></td></tr>
+                    <tr><td colspan="2"><h2 style="text-align: center;">Add Specific Dates that Don't Fit Schedule Above</h2></td></tr>
+                    <tr><td colspan="2">Use this section to enter specific additional dates that don't fit into a regular monthly, weekly or daily schedule above. 
+                        If all your dates don't fit a recurring schedule above, you may click "None" for all of the options above and select all specific dates for your event here.</td></tr>
+                    <tr><td colspan="2">&nbsp;</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>