Updates to event schedule entry/edit forms. Not all form changes functional yet.
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 6 Apr 2016 14:00:20 +0000 (10:00 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 6 Apr 2016 14:00:20 +0000 (10:00 -0400)
classes/data/dataLocations.php
views/admin/events/edit.html
views/admin/events/editFiles.html [new file with mode: 0644]
views/admin/events/editLocation.html
views/admin/events/editSchedule.html
views/admin/events/editStatus.html

index 1b4d90d..d6aac2d 100644 (file)
@@ -238,7 +238,7 @@ class GlmDataEventsLocations extends GlmDataAbstract
                 'field' => 'zip',
                 'type' => 'text',
                 'use' => 'a'
-            ),
+            )
 
             // Contact Reference Placeholder if no Contacts Add-On (see below)
 /* not currently in use
@@ -252,7 +252,7 @@ class GlmDataEventsLocations extends GlmDataAbstract
             /*
              * Using first and last name for compatibility with contacts add-on data
              */
-
+/*
             // Contact First Name
             'contact_fname' => array (
                 'field' => 'contact_fname',
@@ -280,7 +280,7 @@ class GlmDataEventsLocations extends GlmDataAbstract
                 'type' => 'text',
                 'use' => 'a'
             )
-
+*/
          );
 
     }
index 688c369..291c964 100644 (file)
@@ -40,8 +40,9 @@
             <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-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-calendar" data-show-table="glm-table-calendar" class="glm-event-tab nav-tab">Calendar</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}
             </tr>
         </table>
 
+        <!-- Files -->
+
+        {include file='admin/events/editFiles.html'}
+
         <!-- Admin Contact -->
 
         {include file='admin/events/editAdminContact.html'}
             </p>
         </div>
     </div>
-    <div id='occurrences' title="Occurence">
-         {foreach $times as $t}
-           
-          {/foreach}
-          <input type="button" value="Delete Recurrence"> 
-    </div>
     <script type="text/javascript">
         jQuery(document).ready(function($) {
 
                 var table = $(this).attr('data-show-table');
                 $('#' + table).removeClass('glm-hidden');
 
-
                 if (table == 'glm-table-recurrence' && !recurrencesInited) {
                     initRecurrence();
                     recurrencesInited = true;
                 }
 
-                if (table == 'glm-table-location' && !locationsInited) {
-
-                    // Make sure there's at least one location
-                    {if !$locations}
-                            addNewLocationForm();
-                    {/if}
-                    
-                    initLocations();
-                    initNewCity();
-                    locationsInited = true;
+                if (table == 'glm-table-location') { 
+                
+                    if (!locationsInited) {
+                
+                        // Make sure there's at least one location
+                        {if !$locations}
+                                addNewLocationForm();
+                        {/if}
+                        
+                        initLocations();
+                        initNewCity();
+                        locationsInited = true;
+    
+                    }
 
+                    // Check Use Member Location checkbox
+                    memberID = $('#memberSelect').val();
+                    if (memberID == '') {
+                        
+                        // No member selected - Clear checkbox, Dissable checkbox, Show location 
+                        $('#useMemberLocationCheckbox').prop('checked', false);
+                        $('#useMemberLocationCheckbox').prop('disabled', true);
+                        $('#locationContainer').removeClass('glm-hidden');
+                        
+                    } else {
+                        
+                        // Member set - Enable checkbox
+                        $('#useMemberLocationCheckbox').prop('disabled', false);
+                        
+                    }
                 }
-
+                
                 if (table == 'glm-table-calendar' && !fullCalendarLoaded) {
 
                     // **** Should probably move all this to a function and check if it's been initialized already
                     formatTime:'h:i a'
                 });
 
+                // 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 Only Pickers
                 $('.glm-date-input').datetimepicker({
                     format: 'm/d/Y',
 
                 // Delete a recurrence
                 $('.delete-recurrence').on( 'click', function() {
-alert(123);                    
                     recurID = $(this).attr('data-id');
                     $('#recurrence_' + recurID).remove();
                     $('#placeRecurDeletesHere').append('<input type="hidden" name="deleteRecur[' + recurID + ']" value="' + recurID + '">');
@@ -424,12 +450,10 @@ alert(123);
                     // Start Time only selection
                     $('.start-time-only-checkbox').click( function() {
                         recurID = $(this).attr('data-id');
-                        if ($("#startTimeOnly_" + recurID)[0].checked) {
-                            $(".start-time-only-" + recurID).addClass('glm-hidden');
+                        if ($(this)[0].checked) {
+                            $("#endTimeRow_" + recurID).addClass('glm-hidden');
                         } else {
-                            if (!$("#allDayEvent_" + recurID)[0].checked) {
-                                $(".start-time-only-" + recurID).removeClass('glm-hidden');
-                            }
+                            $("#endTimeRow_" + recurID).removeClass('glm-hidden');
                         }
                     });
                 }
@@ -472,17 +496,49 @@ alert(123);
                     tableID = $(this).attr('data-id');
                     $('#' + tableID + ' input:checkbox').attr('checked', false);
                  });
+                
+                // Initialize Calendar for date selection
+                $('.recur-calendar').on('click', function() {
+                    recurID = $(this).attr('data-id');
+                    recurName = $('#recurSchedName_' + recurID).val();
+                    $('#recurCalendarDialog_' + recurID).attr('title', 'Select Dates for ' + recurName);
 
-            }
+                    $('#recurCalendarDialog_' + recurID).dialog({
+                        minWidth: 600
+                    });
+                    $('#recurCalendar_' + recurID).fullCalendar({
+                        header : {
+                            left:   'title',
+                            center: '',
+                            right:  'today prevYear,prev,next,nextYear',
+                        },
+                        events: [
+                            // Place existing manually entered calendar dates here from template data 
+                        ],
+                        height : 350,
+//                        defaultDate : '{$firstTime.start_time.datetime}',
+                        timeFormat  : 'h:mma',
+                        fixedWeekCount : false,
+                        dayClick: function(date, allDay, jsEvent, view) {
+                            $(this).css('background-color', 'lightblue');
+                        }
+                    });
+                });
+                
+                
+                
 
 
+            }
+
+/* Not used anymore ????
             $('#addRecurrenceButton').click( function() {
                 $('#addRecurrenceDialog').dialog('open');
             });
             $('#addRecurrenceCancel').click( function() {
                 $("#addRecurrenceDialog").dialog("close");
             });
-
+*/
             /*
              * Category Selection
              */
@@ -840,7 +896,7 @@ alert(123);
                 }
             });
             
-            // Hide description of cost if Free is checked
+            // Hide location if use member location checked
             $('#useMemberLocationCheckbox').on('click', function() {
                 if ($(this)[0].checked) {
                     $('#locationContainer').addClass('glm-hidden');
diff --git a/views/admin/events/editFiles.html b/views/admin/events/editFiles.html
new file mode 100644 (file)
index 0000000..49fddfe
--- /dev/null
@@ -0,0 +1,41 @@
+
+<!-- File Upload -->
+
+    <table id="glm-table-files" class="glm-admin-table glm-event-table glm-hidden">
+        <tr>
+            <td>
+                <table>
+                    <tr><td>&nbsp;</td><th>Attach Files to Event</th></tr>
+<!-- 
+                    <tr>
+                        <th>Admin Contact Name:</th>
+                        <td>
+                            <input type="text" name="admin_name" value="{$event.fieldData.admin_name}" class="glm-form-text-input-medium">
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>Admin Contact Organization:</th>
+                        <td>
+                            <input type="text" name="admin_org" value="{$event.fieldData.admin_org}" class="glm-form-text-input-medium">
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>Admin Contact E-Mail:</th>
+                        <td>
+                            <input type="text" name="admin_email" value="{$event.fieldData.admin_email}" class="glm-form-text-input-medium">
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>Admin Contact Phone:</th>
+                        <td>
+                            <input type="text" name="admin_phone" value="{$event.fieldData.admin_phone}" class="glm-form-text-input-medium">
+                        </td>
+                    </tr>
+ -->                    
+                </table>
+            </td>
+            <td width="50%">
+                &nbsp;
+            </td>
+        </tr>
+    </table>
index 84771af..74df300 100644 (file)
@@ -39,7 +39,8 @@
                     <th>Use Member location:</th>
                     <td>
                         <input id="useMemberLocationCheckbox" type="checkbox" name="use_member_location" {if $event.fieldData.use_member_location.value} checked{/if}>
-                        Uses location data from the selected member rather than location data from here.
+                        <span id="useMemberMessage">Uses location data from the selected member rather than location data from here.</span>
+                        <span id="notUseMemberMessage" class="glm-hidden">To use member information select a member for the event in the "Status & Desription" tab.</span>
                     </td>
                 </tr>
             </table>
                         <input type="text" name="{ newLocID }_email" value="{$newLocation.fieldData.email}" class="glm-form-text-input-medium">
                     </td>
                 </tr>
-                <tr>
-                    <th>Contact Name:</th>
-                    <td>
-                        First: <input type="text" name="{ newLocID }_contact_fname" value="{$newLocation.fieldData.contact_fname}" class="glm-form-text-input-small">
-                        Last:  <input type="text" name="{ newLocID }_contact_lname" value="{$newLocation.fieldData.contact_lname}" class="glm-form-text-input-small">
-                    </td>
-                </tr>
-                <tr>
-                    <th>Contact Phone:</th>
-                    <td>
-                        <input type="text" name="{ newLocID }_contact_phone" value="{$newLocation.fieldData.contact_phone}" class="glm-form-text-input-medium">
-                    </td>
-                </tr>
-                <tr>
-                    <th>Contact Email:</th>
-                    <td>
-                        <input type="text" name="{ newLocID }_contact_email" value="{$newLocation.fieldData.contact_email}" class="glm-form-text-input-medium">
-                    </td>
-                </tr>
             </table>
         </td>
         <td>
index 12c9648..890b44b 100644 (file)
@@ -9,7 +9,7 @@
     </tr>
     <tr>
         <td colspan="2">
-            <table id="recurrenceTable" width="100%">                    
+            <table id="recurrenceTable" width="100%">
                 <!-- Recurrence forms go here. -->
 {if $recurrences}
     {foreach $recurrences as $r}
                             <tr>
                                 <th>Schedule Name:</th>
                                 <td>
-                                    <input data-id="{$r.id}" type="text" name="Recur{$r.id}_name" value="{$r.name}" class="glm-form-text-input-small recurrence-input">
+                                    <input id="recurSchedName_{$r.id}" data-id="{$r.id}" type="text" name="Recur{$r.id}_name" value="{$r.name}" class="glm-form-text-input-small recurrence-input">
                                 </td>
                             </tr>
-                            <tr><th colspan="2">First occurrence for this schedule</th></tr>
+<!--                            <tr><th colspan="2">First occurrence for this schedule</th></tr>  --> 
                             <tr>
                                 <th>All Day Event:</th>
                                 <td>
                                 </td>
                             </tr>
                             <tr class="not-all-day-{$r.id}{if $r.all_day.value} glm-hidden{/if}">
-                                <th>Start Date & Time:</th>
+                                <th>Start Time:</th>
                                 <td>
-                                    <input data-id="{$r.id}" type="text" name="Recur{$r.id}_start_time" value="{$r.start_time.datetime}" class="glm-form-text-input-small glm-datetime-input recurrence-input" placeholder="Click to Select Date/Time">
+                                    <input data-id="{$r.id}" type="text" name="Recur{$r.id}_start_time" value="09:00 AM" class="glm-form-text-input-veryshort glm-time-input recurrence-input">
+                                    <input data-id="{$r.id}" type="checkbox" name="Recur{$r.id}_start_time_only" class="start-time-only-checkbox recurrence-input" {if $r.start_time_only.value} checked{/if}> Start time only
                                 </td>
                             </tr>
+                            <tr id="endTimeRow_{$r.id}" class="not-all-day-{$r.id}{if $r.all_day.value} glm-hidden{/if}">
+                                <th>End Time:</th>
+                                <td><input data-id="{$r.id}" type="text" name="Recur{$r.id}_end_time" value="08:00 PM" class="glm-form-text-input-veryshort glm-time-input recurrence-input"></td>
+                            </tr>
+<!-- 
                             <tr class="not-all-day-{$r.id} {if $r.all_day.value} glm-hidden{/if}">
                                 <th>Start Date & Time Only</th>
                                 <td>
@@ -57,6 +63,7 @@
                                     <input data-id="{$r.id}" type="text" name="Recur{$r.id}_start_date" value="{$r.start_date.date}" class="glm-form-text-input-small glm-date-input recurrence-input" placeholder="Click to Select Date/Time">
                                 </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>
                                     <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>
-                
+
                         </table>
                     </td>
                     <td>
                         <table width="100%">
-                
+
                             <tr>
                                 <th></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
                                 </th>
@@ -87,7 +94,7 @@
                             <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}> 
+                                    <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>
                                         </table>
                                     </td>
                                 </tr>
-                            </tbody>                                   
+                                <tr>
+                                    <th>Select with Calendar</th>
+                                    <td>
+                                        <div data-id="{$r.id}" class="button glm-button-small glm-set-none recur-calendar">Show Calendar</div>
+                                        <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>
+                                        </div>
+                                        Use to add specific dates to the schedule. Does not show other scheduled dates.
+                                    </td>
+                                </tr>
+                            </tbody>
                         </table>
                     </td>
                 </tr>
         </td>
     </tr>
 </table>
-        
+
 <!-- Add Recurrence Template -->
-    
+
 <table id="addRecurrenceTemplate" class="glm-hidden">
-    <tr class="recurrence_{ newRecurID }">
+    <tr id="recurrence_{ newRecurID }">
         <td>
             <input type="hidden" name="recurID[{ newRecurID }]" value="{ newRecurID }">
-    {if $haveEvent}   
+    {if $haveEvent}
             <input type="hidden" name="{ newRecurID }_event" value="{$event.fieldData.id}"> <!-- required to have event id with prefix -->
-    {/if}            
+    {/if}
             <table width="100%">
                 <tr>
                     <th>Schedule Name:</th>
                         <input type="text" name="{ newRecurID }_end_time" value="{$newRecurrence.fieldData.end_time.datetime}" class="glm-form-text-input-small glm-datetime-input" placeholder="Click to Select Date/Time">
                     </td>
                 </tr>
-    
+
                 <tr class="all-day-{ newRecurID } glm-hidden">
                     <th>Event 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>
-    
+
             </table>
         </td>
         <td>
             <table width="100%">
-    
+
                 <tr>
                     <th></th>
                     <th>
                 <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"> 
+                        <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>
                             </table>
                         </td>
                     </tr>
-                </tbody> 
+                </tbody>
             </table>
         </td>
     </tr>
 </table>
 
-        
\ No newline at end of file
index f69a246..cc52ed1 100644 (file)
@@ -15,7 +15,7 @@
         {if $haveMember}
                 {$memberData.member_name}
         {else}
-                <select name="ref_dest">
+                <select id="memberSelect" name="ref_dest">
     {foreach $event.fieldData.ref_dest.list as $v}
                     <option value="{$v.value}"{if $v.default} selected{/if}>{$v.name}</option>
     {/foreach}
             </td>
         </tr>
         <tr>
-            <th {if $event.fieldRequired.phone}class="glm-required"{/if}>Event Phone #:</th>
-            <td {if $event.fieldFail.phone}class="glm-form-bad-input" data-tabid="glm-event-descr"{/if}>
-                <input type="text" name="phone" value="{$event.fieldData.phone}" class="glm-form-text-input-medium" placeholder="ex: 123-123-1234">
-                {if $event.fieldFail.phone}<p>{$event.fieldFail.phone}</p>{/if}<br>
+            <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}>
+                <input type="text" name="phone" value="{$event.fieldData.contact_phone}" class="glm-form-text-input-medium" placeholder="ex: 123-123-1234">
+                {if $event.fieldFail.contact_phone}<p>{$event.fieldFail.contact_phone}</p>{/if}<br>
             </td>
         </tr>
         <tr>
                             <tr>
                                 <th>Contact Name:</th>
                                 <td>
-                                    First: <input type="text" name="Loc{$loc.id}_contact_fname" value="{$loc.contact_fname}" class="glm-form-text-input-small">
-                                    Last:  <input type="text" name="Loc{$loc.id}_contact_lname" value="{$loc.contact_lname}" class="glm-form-text-input-small">
+                                    <input type="text" name="contact_name" value="{$event.fieldData.contact_name}" class="glm-form-text-input-small">
                                 </td>
                             </tr>
                             <tr>
                                 <th>Contact Phone:</th>
                                 <td>
-                                    <input type="text" name="Loc{$loc.id}_contact_phone" value="{$loc.contact_phone}" class="glm-form-text-input-medium">
+                                    <input type="text" name="contact_phone" value="{$event.fieldData.contact_phone}" class="glm-form-text-input-medium">
                                 </td>
                             </tr>
                             <tr>
                                 <th>Contact Email:</th>
                                 <td>
-                                    <input type="text" name="Loc{$loc.id}_contact_email" value="{$loc.contact_email}" class="glm-form-text-input-medium">
+                                    <input type="text" name="contact_email" value="{$event.fieldData.contact_email}" class="glm-form-text-input-medium">
                                 </td>
                             </tr>