$view = 'edit';
+ // echo '<pre>$newRecurrence: ' . print_r( $newRecurrence, true ) . '</pre>';
break;
case 'insert':
$event = $this->insertEntry();
+ if ($event['status']) {
+ // echo '<pre>$event: ' . print_r( $event, true ) . '</pre>';
- $this->eventID = $event['fieldData']['id'];
+ $this->eventID = $event['fieldData']['id'];
- $this->updateCategories();
- $categories = $Categories->getListSortedParentChild(false);
+ $this->updateCategories();
+ $categories = $Categories->getListSortedParentChild(false);
- if ( $this->config['settings']['use_event_amenities'] ) {
- $this->updateAmenities();
- $amenities = $Amenities->getList(false);
- }
+ if ( $this->config['settings']['use_event_amenities'] ) {
+ $this->updateAmenities();
+ $amenities = $Amenities->getList(false);
+ }
- if ($event['status']) {
$haveEvent = true;
$eventAdded = true;
glmClearShortcodeCache();
} else {
+ // echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
+ // echo '<pre>$event: ' . print_r( $event, true ) . '</pre>';
+ // echo '<pre>$newRecurrence: ' . print_r( $newRecurrence, true ) . '</pre>';
$option = 'add';
$eventAddError = true;
// Add any recurrence data that may have been submitted
- // if (isset($_REQUEST[''])) {
- // NOT COMPLETED
- // }
+ $newRecurSetup = array(
+ 'name',
+ 'start_time',
+ 'end_time',
+ 'from_date',
+ 'to_date',
+ 'month_of_year',
+ 'week_of_month',
+ 'day_of_week',
+ 'all_day',
+ 'start_time_only',
+ );
+
+ if ( isset( $_REQUEST['recurID'] ) ) {
+ foreach ( $_REQUEST['recurID'] as $recur ) {
+ foreach ( $newRecurSetup as $rec ) {
+ $rec_name = $recur . '_' . $rec;
+ if ( $_REQUEST[$rec_name] ) {
+ switch ( $rec ) {
+ case 'start_time':
+ case 'end_time':
+ $newRecurrence['fieldData'][$rec]['time'] = $_REQUEST[$rec_name];
+ break;
+ case 'from_date':
+ case 'to_date':
+ $newRecurrence['fieldData'][$rec]['date'] = $_REQUEST[$rec_name];
+ break;
+ case 'name':
+ case 'month_of_year':
+ case 'week_of_month':
+ case 'day_of_week':
+ case 'all_day':
+ case 'start_time_only':
+ $newRecurrence['fieldData'][$rec]['value'] = $_REQUEST[$rec_name];
+ break;
+ }
+ }
+ }
+ }
+ }
}
+ // echo '<pre>$newRecurrence: ' . print_r( $newRecurrence, true ) . '</pre>';
$view = 'edit';
<tr>
<th>All Day Event:</th>
<td>
- <input id="allDayEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_all_day" class="all-day-checkbox">
+ <input {if $newRecurrence.fieldData.all_day.value}checked{/if} id="allDayEvent_{ newRecurID }" data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_all_day" class="all-day-checkbox">
</td>
</tr>
<tr class="not-all-day-{ newRecurID }">
<th {if $newRecurrence.fieldRequired.start_time}class="glm-required"{/if}>Start Time:</th>
<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
+ <input {if $newRecurrence.fieldData.start_time_only.value}checked{/if} data-id="{ newRecurID }" type="checkbox" name="{ newRecurID }_start_time_only" class="start-time-only-checkbox recurrence-input"> Start time only
</td>
</tr>
<tr id="endTimeRow_{ newRecurID }" class="not-all-day-{ newRecurID }">