From: Chuck Scott Date: Tue, 8 Mar 2016 16:19:49 +0000 (-0500) Subject: Interim status of Events add-on X-Git-Tag: v1.0.0^2~170^2~4^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=bb10d1c925f7a7882f7fba69f03f7ab2f05c6b8e;p=WP-Plugins%2Fglm-member-db-events.git Interim status of Events add-on --- diff --git a/models/admin/events/list.php b/models/admin/events/list.php index 874cab9..c3d3fd3 100644 --- a/models/admin/events/list.php +++ b/models/admin/events/list.php @@ -108,6 +108,8 @@ class GlmMembersAdmin_events_list extends GlmDataEvents $eventDeleted = false; $eventDeleteError = false; $recurrences = false; + $times = false; + $haveTimes = false; // Get a list of categories $Categories = new GlmDataEventsCategories($this->wpdb, $this->config); @@ -141,6 +143,36 @@ class GlmMembersAdmin_events_list extends GlmDataEvents + /* + * PLACE TEMPORARY TEST DATA FOR CALENDARS HERE + */ + $haveTimes = true; + $times = array( + /* + * Place temp data here. It doesn't matter how you structure it. + * We can change the actual parameters in the calendar.html file + * later to match the actual data from the database. + */ + '1' => array( + 'id' => 1, + 'event' => 1, + 'custom_event' => false, + 'recur_id' => 1, + 'active' => true, + 'start_time' => array( + 'timestamp' => 123123123, + 'datetime' => '4/1/2015 17:00' + ), + 'end_time' => array( + 'timestamp' => 123123234, + 'datetime' => '4/1/2015 122:00' + ), + 'all_day' => false + ) + ); + + + // Do selected option switch ($option) { @@ -270,7 +302,9 @@ class GlmMembersAdmin_events_list extends GlmDataEvents 'eventDeleted' => $eventDeleted, 'eventDeleteError' => $eventDeleteError, 'recurrences' => $recurrences, - 'newRecurrence' => $newRecurrence + 'newRecurrence' => $newRecurrence, + 'times' => $times, + 'haveTimes' => $haveTimes, ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/events/calendar.html b/views/admin/events/calendar.html new file mode 100644 index 0000000..88098d4 --- /dev/null +++ b/views/admin/events/calendar.html @@ -0,0 +1,30 @@ + + +Place Calendar View HTML/Scripts here + +{if $haveTimes} + + {foreach $times as $v} + + Time ID: {$v.id}
+ Event ID: {$v.event}
+ Custom Event Data: {$v.custom_event}
+ Recurrence ID: {$v.recur_id}
+ Active: {$v.active}
+ Start Time - timestamp: {$v.start_time.timestamp}
+ Start Time - date time: {$v.start_time.datetime}
+ End Time - timestamp: {$v.end_time.timestamp}
+ End Time - date time: {$v.end_time.datetime}
+ {$v.all_day} + + {/foreach} + +{else} +

(no times listed)

+{/if} \ No newline at end of file diff --git a/views/admin/events/edit.html b/views/admin/events/edit.html index 1765c6d..007d01e 100644 --- a/views/admin/events/edit.html +++ b/views/admin/events/edit.html @@ -67,7 +67,7 @@ Status: @@ -142,7 +142,7 @@ - - -

First ocurrance of event

- - Start Date & Time: - - - {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} - - - - End Date & Time: - - - {if $newRecurrence.fieldFail.end_time}

{$newRecurrence.fieldFail.end_time}

{/if} - - - - - Event Date: - - - {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} - - - -

Date range over which recurring event can take place

- - From Date: - - - {if $newRecurrence.fieldFail.from_date}

{$newRecurrence.fieldFail.from_date}

{/if} - - - - To Date: - - - {if $newRecurrence.fieldFail.to_date}

{$newRecurrence.fieldFail.to_date}

{/if} - - -

When the event recurrs

- - Months - - - - - -
- {foreach from=$newRecurrence.fieldData.month_of_year.bitmap item=v} - {if $v.value == 6} {/if} - {$v.name}
- {/foreach} -
- - - - Select specific days of the month: - - - - - - Week of the Month - - {foreach from=$newRecurrence.fieldData.week_of_month.bitmap item=v} - {$v.name}   - {/foreach} - - - - Day of the Week - - - - - -
- {foreach from=$newRecurrence.fieldData.day_of_week.bitmap item=v} - {if $v.value == 4} {/if} - {$v.name}
- {/foreach} -
- - - - Day of the Month - - - - {foreach from=$newRecurrence.fieldData.day_of_month.bitmap item=v} - {if in_array($v.value, array(7, 14, 21, 28))} - - {/if} - - {/foreach} - - -
- {$v.name} - - Last day of the month -
- - - - - -

- Cancel Adding Schedule - -

- + + + + + + +

New Event Schedule

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

First ocurrence of event

All Day Event: + +
Start Date & Time: + + {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} +
End Date & Time: + + {if $newRecurrence.fieldFail.end_time}

{$newRecurrence.fieldFail.end_time}

{/if} +
Event Date: + + {if $newRecurrence.fieldFail.start_time}

{$newRecurrence.fieldFail.start_time}

{/if} +

Date range over which recurring event can take place

From Date: + + {if $newRecurrence.fieldFail.from_date}

{$newRecurrence.fieldFail.from_date}

{/if} +
To Date: + + {if $newRecurrence.fieldFail.to_date}

{$newRecurrence.fieldFail.to_date}

{/if} +
+
+ + + + + + + + + + + + + + + + + + + + + + + +

When the event recurrs

Months + + + {foreach $newRecurrence.fieldData.month_of_year.bitmap as $v} + {if $v.value==6} + + {/if} + + {/foreach} + +
{$v.name}  
+
Select by:
Days of month:
+ Check to select specific days of the month. +
Week of the Month + + + {foreach $newRecurrence.fieldData.week_of_month.bitmap as $v} + + {/foreach} + +
{$v.name}  
+
Day of the Week + + + {foreach $newRecurrence.fieldData.day_of_week.bitmap as $v} + + {/foreach} + +
{$v.name}
+
Day of the Month + + + {foreach $newRecurrence.fieldData.day_of_month.bitmap as $v} + {if in_array($v.value, array(7, 14, 21, 28))} + + {/if} + + {/foreach} + + +
+ {$v.name} + + Last day of the month +
+
+
@@ -533,21 +540,60 @@ /* * Recurrences */ - // Add Recurrence dialog - $("#addRecurrenceDialog").dialog({ - autoOpen: false, - minWidth: 800, - dialogClass: "glm-dialog-no-close" - }); - $('#addRecurrenceButton').click( function() { - $('#addRecurrenceDialog').dialog('open'); - }); - $('#addRecurrenceCancel').click( function() { - $("#addRecurrenceDialog").dialog("close"); - }); - $('#addRecurrenceSubmit').click( function() { - // window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=list&option=delete&event={$event.fieldData.id}"); - }); + var haveRecurrences = false; + {if $recurrences} + haveRecurrences = true; + {/if} + + /* + * Add recurrence using template + */ + + // New recurrence ID's start at 0 (have "n" for "new" appended to them in the template) + var newRecurID = 0; + + function addNewRecurrenceForm() { + + // Tick the new recurrence ID counter and build new HTML from the addRecurrenceTemplate + ++newRecurID; + + // If we already have at least one recurrence, we need to add a separator + var recurTemp = ''; + if (haveRecurrences) { + recurTemp = '
'; + + // Otherwise, we'll say we now have our first recurrence + } else { + haveRecurrences = true; + } + + recurTemp = recurTemp + $('#addRecurrenceTemplate').html(); + recurTemp = recurTemp.replace(/{ newRecurID }/g, newRecurID); + + // Append the new recurrence form to the container + $('#recurrenceTable').append(recurTemp); + + } + + // When adding a new recurrence is requested + $("#addRecurrence").click( function() { + addNewRecurrenceForm(); + }); + + // Also add a new one at the start if none exist + if (!haveRecurrences){ + addNewRecurrenceForm(); + } + + $('#addRecurrenceButton').click( function() { + $('#addRecurrenceDialog').dialog('open'); + }); + $('#addRecurrenceCancel').click( function() { + $("#addRecurrenceDialog").dialog("close"); + }); + $('#addRecurrenceSubmit').click( function() { + // window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=list&option=delete&event={$event.fieldData.id}"); + }); /*