Use now page for editing the attendee notices.
Incorporate calendar for showing the notification date compared to the
event date.
Show notifications as a list view.
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * PDF Output by admin-ajax
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+// Load Members data abstract
+// require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH . '/data/dataAccount.php';
+
+/**
+ * This class performs the work of handling images passed to it via
+ * an AJAX call that goes through the WorPress AJAX Handler.
+ *
+ */
+class GlmMembersAdmin_ajax_setupEventRegQueue //extends GlmDataRegistrationsAccount
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /*
+ * Constructor
+ *
+ * This contructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ // Run constructor for data class
+ // parent::__construct(false, false);
+
+ }
+
+ /*
+ * Perform Model Action
+ *
+ * This model checks to see if the creditials passed in are correct.
+ *
+ * This model action does not return, it simply does it's work then calls die();
+ *
+ * @param $actionData
+ *
+ * Echos JSON string as response and does not return
+ */
+ public function modelAction( $actionData = false )
+ {
+ $return = false;
+
+ echo '<p>From the admin ajax setupEventRegQueue in Event Registrations.</p>';
+
+ exit();
+ }
+}
$registrants = false;
$completed = false;
$errorMsg = false;
+ $newEntry = false;
+ $when = false;
// Register the masked input script that we need for input controls
wp_dequeue_script('glm-members-admin-maskedinput');
'registrants' => $registrants,
'completed' => $completed,
'errorMsg' => $errorMsg,
+ 'newEntry' => $newEntry,
+ 'when' => $when,
);
// echo "<pre>".print_r($templateData,1)."</pre>";
require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegNotification.php';
$Notifications = new GlmDataRegistrationsRegNotification($this->wpdb, $this->config);
-$regNotifications = $Notifications->getList("T.reg_event = $regEventID", 'notification_days');
-
$regEvent = $this->getEntry($regEventID);
-$view = 'eventNotifications';
+if ( isset( $_REQUEST['delete'] ) && filter_var( $_REQUEST['delete'], FILTER_VALIDATE_BOOLEAN ) ) {
+ $view = 'eventNotifications';
+} else if ( isset( $_REQUEST['id'] ) && $notice_id = filter_var( $_REQUEST['id'], FILTER_VALIDATE_INT ) ) {
+ $regNotifications = $Notifications->editEntry( $notice_id );
+ $view = 'eventEditNotification';
+ $days = $regNotifications['notification_days'];
+ echo '<pre>$days: ' . print_r( $days, true ) . '</pre>';
+ $when = ( $days > 0 ) ? 'after' : 'before';
+ echo '<pre>$when: ' . print_r( $when, true ) . '</pre>';
+} else if ( isset( $_REQUEST['new'] ) && filter_var( $_REQUEST['new'], FILTER_VALIDATE_BOOLEAN ) ) {
+ $regNotifications = $Notifications->newEntry();
+ $view = 'eventEditNotification';
+ $newEntry = true;
+} else {
+ $regNotifications = $Notifications->getList("T.reg_event = $regEventID", 'notification_days');
+ $view = 'eventNotifications';
+}
+
+// echo '<pre>$regNotifications: ' . print_r( $regNotifications, true ) . '</pre>';
*/
// New and updated notifications
-if (isset($_REQUEST['name']) && is_array($_REQUEST['name'])) {
+if ( isset( $_REQUEST['name'] ) && is_array( $_REQUEST['name'] ) ) {
- foreach ($_REQUEST['name'] as $key=>$val) {
+ foreach ( $_REQUEST['name'] as $key => $val ) {
// Make sure key is positive integer
- $id = ($key-0);
- if ($id > 0) {
+ $id = ( $key - 0 );
+ if ( $id > 0 ) {
// Update existing entry
$this->wpdb->update(
array( 'id' => $id ),
array( '%s', '%d', '%s' ),
array( '%d' )
- );
+ );
// Otherwise if the id is less than 0 it must be a new one
- } elseif ($id < 0) {
+ } elseif ( $id < 0 ) {
// Insert a new entry
$this->wpdb->insert(
- GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX.'reg_notification',
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_notification',
array(
'reg_event' => $regEventID,
'name' => $_REQUEST['name'][$id],
'message' => $_REQUEST['message'][$id]
),
array( '%d', '%s', '%d', '%s' )
- );
+ );
}
}
}
// Delete Notifications
-if (isset($_REQUEST['delete']) && is_array($_REQUEST['delete'])) {
-
- $ids = '';
- foreach ($_REQUEST['delete'] as $key=>$val) {
-
- // Make sure key is positive integer
- $id = ($key-0);
- if ($id > 0) {
- $this->wpdb->delete( GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX.'reg_notification', array( 'ID' => $id ), array( '%d' ) );
- }
+if ( isset( $_REQUEST['delete'] ) && filter_var( $_REQUEST['delete'], FILTER_VALIDATE_BOOLEAN ) ) {
+ // Make sure key is positive integer
+ $id = ( $_REQUEST['id'] - 0 );
+ if ( $id > 0 ) {
+ $this->wpdb->delete(
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_notification',
+ array( 'ID' => $id ),
+ array( '%d' )
+ );
}
}
$regNotifyUpdated = true;
// Fall through to get the data again
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH.'/models/admin/registrations/events_notifications.php';
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . '/models/admin/registrations/events_notifications.php';
CREATE TABLE {prefix}reg_notification (
id INT NOT NULL AUTO_INCREMENT,
reg_event INT NULL, -- Pointer to reg_event table
- name TINYTEXT NULL, -- Namme of this notification
+ name TINYTEXT NULL, -- Name of this notification
notification_days INT NULL, -- # of days before or after event that notification takes place (- before, + after)
message TEXT NULL, -- Content of message (uses template parameters to merge event/attendee data)
PRIMARY KEY (id),
'summaryContent' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'updateAvailability' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'registrantsListExport' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+ 'setupEventRegQueue' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
),
'registrations' => array(
'index' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
{include file='admin/registrations/eventHeader.html'}
{include file='admin/registrations/eventSubTabs.html'}
-
- <div id="glm-admin-member-dashboard" class="glm-admin-table">
+
+ <div id="glm-admin-member-dashboard" class="glm-admin-table">
{if $haveRegEvent}
<div class="glm-row">
<div class="glm-small-12 glm-medium-4 glm-left">
{$regEvent.total}
</div>
</div>
- {/if}
+ {/if}
<div class="glm-row">
<div class="glm-small-12 glm-column">
<h3>Registered:</h3>
{$regEvent.totalAvail}
</div>
</div>
- {/if}
+ {/if}
</div>
</div>
{if apply_filters('glm_members_menu_members', true)}
-
+
<div class="glm-small-12 glm-medium-4 glm-left">
<div class="glm-admin-table">
<div class="glm-row">
</div>
<div class="glm-row">
<div class="glm-small-12 glm-column">
- <div id="regEventAddTimesButton" class="button button-secondary glm-button">Add Registration Dates/Times from Event</div>
+ <div id="regEventAddTimesButton" class="button button-secondary glm-button">Add Registration Dates/Times from Event</div>
<div id="regEventAddTimesDialog" class="glm-dialog-box" title="Add Registration Dates/Times from Event">
<p>
This action looks for dates and time specified for the associated event in the event schedules. If there are any dates and times that are
not already included for registrations, this action will add them using the defaults set for this event. You may set those
defaults by clicking the "Edit Registration Event" button on this page. This action will not modify or remove date and times already
added to registrations for this event.
- </p>
+ </p>
<p>
- The primary purpose of this action is to assist with initial setup of registrations for an event when there are a number of
+ The primary purpose of this action is to assist with initial setup of registrations for an event when there are a number of
dates and times specified in the schedules for the event and you wish to make most or all of those dates and times available for registration.
</p>
<p>
- <span class="glm-warning">NOTE:</span> If the event covers a large number of dates, this action may add a large number of dates
+ <span class="glm-warning">NOTE:</span> If the event covers a large number of dates, this action may add a large number of dates
and times to registrations for this event. To deactivate or remove those dates you will be required to click on each date/time
and either deactivate it or demove it.
</p>
<input type="hidden" name="option" value="eventDashboard">
<input type="hidden" name="regEventID" value="{$regEvent.id}">
<input type="hidden" name="getTimesFromEvent" value="yes">
-
+
<center>
- <h3>Event: <span class="glm-warning">{$regEvent.event_name}</span></h3>
+ <h3>Event: <span class="glm-warning">{$regEvent.event_name}</span></h3>
<p>To add dates and times from the event schedules<br>enter exactly "ADD" in the field below.</p>
<input type="text" name="addConfirmation" value="" placeholder="Enter 'ADD' here." required>
<p>Then click this button</p>
- <input type="submit" class="button button-primary glm-button" value="Add Dates and Times to Registrations from the Event">
+ <input type="submit" class="button button-primary glm-button" value="Add Dates and Times to Registrations from the Event">
</center>
</form>
</div>
</div>
<div class="glm-row">
<div class="glm-small-12 glm-column">
- <div id="regEventDeleteButton" class="button button-secondary glm-button">Delete Registration Event</div>
+ <div id="regEventDeleteButton" class="button button-secondary glm-button">Delete Registration Event</div>
<div id="regEventDeleteDialog" class="glm-dialog-box" title="Delete Registrations for this Event">
<center>
<h1 class="glm-error">WARNING!</h1>
</center>
<p>
Continuing with this action will permanently remove this event from registrations including all configuration associated with it.
- This will not remove the event listing, only the information on registrations for this event.
+ This will not remove the event listing, only the information on registrations for this event.
</p>
<p>
- This action is
- <span class="glm-error">NOT REVERSABLE</span>! After deletion, you will be required to re-enter all registration related
+ This action is
+ <span class="glm-error">NOT REVERSABLE</span>! After deletion, you will be required to re-enter all registration related
configuration information in order to have registrations for this event.
</p>
{if $regEvent.registered > 0}
<center>
<h3 class="glm-warning">ALSO NOTE!</h3>
<p class="glm-error">There have been {$regEvent.registered} registrations submitted for this event.</p>
- </center>
+ </center>
<p>
Continuing with this action <span class="glm-error">will delete all registrations for this event</span>.
This will also remove these registrations from all reports. It's important that you print all reports and other information
<input type="hidden" name="page" value="glm-members-admin-menu-registrations-events">
<input type="hidden" name="option" value="delete">
<input type="hidden" name="regEventID" value="{$regEvent.id}">
-
+
<center>
- <h3>Event: <span class="glm-warning">{$regEvent.event_name}</span></h3>
+ <h3>Event: <span class="glm-warning">{$regEvent.event_name}</span></h3>
<p>To delete registrations for this event, enter exactly "DELETE" in the field below.</p>
<input type="text" name="deleteConfirmation" value="" placeholder="Enter 'DELETE' here." required>
<p>Then click this button</p>
- <input type="submit" class="button button-primary glm-button" value="Remove this Event from Registrations">
+ <input type="submit" class="button button-primary glm-button" value="Remove this Event from Registrations">
</center>
</form>
</div>
{/if}
</div>
</div>
-
+
</div>
</div>
{/if}
<tr><th id="availabilityTitle" colspan="2"><!-- item date / time goes here --></th></tr>
<tr><th style="text-align: left">Active:</th><td><input id="dialogRegActive" type="checkbox" value=""></td></tr>
<tr id="dialogAllDayLine"><th style="text-align: left">All Day:</th><td><input id="dialogTimeAllDay" type="checkbox" value=""></td></tr>
- {if $regEvent.time_specific.value}
+ {if $regEvent.time_specific.value}
<tr id="dialogTrackLine"><th style="text-align: left">Track Attendees:</th><td><input id="dialogAttendees" type="checkbox" value=""></td></tr>
{/if}
<tr id="dialogStartTimeLine"><th style="text-align: left" class="glm-required">Start Time:</th><td><input id="dialogStartTime" class="glm-form-text-input-short time-input not-all-day" type="text" value=""></td></tr>
<tr id="dialogEndTimeLine"><th style="text-align: left" class="glm-required">End Time:</th><td><input id="dialogEndTime" class="glm-form-text-input-short time-input not-all-day" type="text" value=""></td></tr>
- {if $regEvent.time_specific.value}
+ {if $regEvent.time_specific.value}
<tr><th style="text-align: left" class="glm-required">Maximum Attendees:</th><td><input class="glm-form-text-input-veryshort availabilityInput" type="text" id="dialogMaxAtt" value=""> 0 = Unlimited</td></tr>
<tr id="dialogRegLine"><th style="text-align: left">Registered Attendees:</th><td id="dialogRegAtt"></td></tr>
<tr id="dialogPendLine"><th style="text-align: left">Pending in Carts:</th><td id="dialogPendAtt"></td></tr>
<tr id="dialogAvailLine"><th style="text-align: left">Available for Registration:</th><td id="dialogAvailAtt"></td></tr>
{else}
<tr><th style="text-align: left" colspan="2">Use form above calendar to adjust attendee availability.</td></tr>
- {/if}
+ {/if}
<tr><td style="text-align: right">
<div id="dialogAvailSubmit" class="button-primary" data-timeid="">Upate</div>
</td></tr>
width: 600,
resizable: true
});
-
+
// Delete Event Registrations Button
$('#regEventDeleteButton').on('click', function() {
$('#regEventDeleteDialog').dialog('open');
});
-
+
// Summary Dialog Box
var timeMaskSet = false;
$("#availabilityEditDialog").dialog({
// On open set the time input mask
if (!timeMaskSet) {
- $(".time-input").mask("X0:Y0 ZM", {
+ $(".time-input").mask("X0:Y0 ZM", {
translation: {
'X': { // Force 1st hour digit to 0 or 1
pattern: /[01]/, optional: false
- },
+ },
'Y': { // force first minute digit to 0 through 5
pattern: /[012345]/, optional: false
},
pattern: /[AaPp]/, optional: false
}
},
- placeholder: "00:00 AM"
+ placeholder: "00:00 AM"
});
- timeMaskSet = true;
+ timeMaskSet = true;
}
}
});
/*
* Initialize the Full Calendar
*/
-
+
function initFullCalendar(){
$('#eventCalendar').fullCalendar({
timezone: 'local',
// Clicking on a date cell (not an existing event time) Brings up the new date dialog
dayClick: function(date, allDay, jsEvent, view) {
- $('#dialogAvailSubmit').off('click');
+ $('#dialogAvailSubmit').off('click');
$('#availabilityTitle').html('Create New: '+date.format('MM/DD/YYYY'));
$('#availabilityEditDialog').dialog('open');
$('#dialogRegActive').prop('checked', false);
if ($('#dialogStartTime').val() == '' || $('#dialogEndTime').val() == '') {
alert('Both start and end times are required!');
- } else {
+ } else {
- // Submit clicked
- {if $regEvent.time_specific.value}
+ // Submit clicked
+ {if $regEvent.time_specific.value}
var max = $('#dialogMaxAtt').val();
- {else}
+ {else}
var max = 0;
{/if}
var startDate = new Date($('#dialogStartTime').val());
if (newTimeActive) {
newTimeBackgroundColor = 'light-blue';
}
-
-
- // Initialize the event data object with submitted data
+
+
+ // Initialize the event data object with submitted data
var newEvent = {
{if $regEvent.time_specific.value}
title: ' unlimited',
active: newTimeActive,
backgroundColor: newTimeBackgroundColor,
allDay: $('#dialogTimeAllDay').is(':checked'),
- {if $regEvent.time_specific.value}
+ {if $regEvent.time_specific.value}
attendees: $('#dialogAttendees').is(':checked'),
- {else}
+ {else}
attendees: 0,
{/if}
max: max,
count: 0,
pending: 0,
available: max,
- timeId: false
+ timeId: false
};
{if $regEvent.time_specific.value}
{/if}
// Try to send the data via AJAX
var newTime = $.ajax({
-
+
url: "{$ajaxUrl}",
method: "POST",
data: {
max: newEvent.max
},
dataType: "text"
-
+
}).done( function(newTimeId) {
// If response was not a possible time ID
// Should have good time ID, so add it to the calendar
$('#eventCalendar').fullCalendar('renderEvent', newEvent, true);
}
-
- $('#availabilityEditDialog').dialog('close');
- $('#dialogAvailSubmit').off('click');
-
+
+ $('#availabilityEditDialog').dialog('close');
+ $('#dialogAvailSubmit').off('click');
+
});
}
// Click on an event in the calendar
eventClick: function(calEvent, jsEvent, view) {
- $('#dialogAvailSubmit').off('click');
-
+ $('#dialogAvailSubmit').off('click');
+
$("#occurrences").dialog();
$(this).css('border-color', 'red');
$('#dialogTimeAllDay').show();
$('#dialogStartTimeLine').show();
$('#dialogEndTimeLine').show();
-
+
$('#availabilityTitle').html(calEvent.datetime);
$('#dialogRegActive').prop('checked', calEvent.active);
if(calEvent.start) {
$('#dialogAvailAtt').html(available);
$('#dialogMaxAtt').off('change');
});
-
+
$('#dialogAvailSubmit').on('click', function() {
var checked = $('#dialogRegActive').is(":checked");
var start = calEvent.start.format('YYYY/MM/DD') + ' ' + $('#dialogStartTime').val();
var end = calEvent.start.format('YYYY/MM/DD') + ' ' + $('#dialogEndTime').val();
-
+
var max = $('#dialogMaxAtt').val();
var timeId = $('#dialogAvailSubmit').attr('data-timeid');
return false;
}
-
+
$.ajax({
url: "{$ajaxUrl}",
method: "POST",
},
dataType: "text"
});
- $('#availabilityEditDialog').dialog('close');
- $('#dialogAvailSubmit').off('click');
+ $('#availabilityEditDialog').dialog('close');
+ $('#dialogAvailSubmit').off('click');
// Update times
calEvent.start = start;
calEvent.end = end;
-
+
{if $regEvent.time_specific.value}
calEvent.title = max + '-' + calEvent.count + '-' + calEvent.pending + '-' + calEvent.available;
{else}
calEvent.title = '';
{/if}
- $('#eventCalendar').fullCalendar('updateEvent', calEvent);
+ $('#eventCalendar').fullCalendar('updateEvent', calEvent);
});
-
+
}
{/if}
});
// If not date/time specific then we need to add the data for the non-date-specific time entry.
if (!{$regEvent.time_specific.value}) {
-
+
// Not date specific so do one counts update form
$('#maxAtt').on('change', function() {
var max = $('#maxAtt').val();
}
$('#availAtt').html(available);
});
-
+
$('#availSubmit').on('click', function() {
var max = $('#maxAtt').val();
var time = $('#availSubmit').attr('data-timeid');
-
+
$.ajax({
url: "{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=updateAvailability&newTime=false&active=true&max=" + max + "®_time=" + time
});
$("#submit-flash").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
});
-
+
}
-
+
// Flash certain elements for a short time after display
$(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
-
+
});
</script>
--- /dev/null
+{include file='admin/registrations/eventHeader.html'}
+{include file='admin/registrations/eventSubTabs.html'}
+
+<div style="margin-bottom: 1em;">
+ <a
+ id="regNotificationAdd"
+ class="button button-secondary glm-button glm-right"
+ href="{$thisUrl}?page={$thisPage}&option=notifications®EventID={$regEventID}&new=1">Add a Notification</a>
+ <h1>Registrant E-Mail Notifications</h1>
+</div>
+
+<h1>
+ {if $regNotifyUpdated}<span class="glm-notice glm-flash-updated">Notifications Updated</span>{/if}
+</h1>
+
+
+<hr>
+
+<form action="{$thisUrl}?page={$thisPage}" method="post">
+ <input type="hidden" name="option" value="notificationsUpdate">
+ <input type="hidden" name="regEventID" value="{$regEvent.id}">
+ <div id="notificationsContainer">
+ <div class="glm-row"> </div>
+ <div id="notificationContainer_{$regNotifications.fieldData.id}" class="glm-row">
+ <div class="glm-small-12 glm-large-3 glm-column">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <h2>Subject</h2>
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <input
+ required
+ type="text"
+ name="name[{if $newEntry}-1{else}{$regNotifications.fieldData.id}{/if}]"
+ value="{if !$newEntry}{$regNotifications.fieldData.name}{/if}"
+ class="glm-form-text-input-medium-long">
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column ">
+ <h2>Day to Send</h2>
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <input
+ type="number"
+ min="0"
+ name="notification_days[{if $newEntry}-1{else}{$regNotifications.fieldData.id}{/if}]"
+ value="{if $newEntry}0{else}{$regNotifications.fieldData.notification_days}{/if}"
+ class="glm-form-text-input-veryshort">
+ <select name="when">
+ <option value="before"{if $when === 'before'} selected{/if}>Before</option>
+ <option value="after"{if $when === 'after'} selected{/if}>After</option>
+ </select>
+ </div>
+ <div class="glm-small-12 glm-column">
+ <div id="datepicker"></div>
+ </div>
+ </div>
+ </div>
+ <div class="glm-small-12 glm-large-8 glm-column">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column ">
+ <h2>E-Mail Message Content</h2>
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ {php}
+ wp_editor(
+ '{if !$newEntry}{$regNotifications.fieldData.message|escape:quotes}{/if}',
+ 'message',
+ array(
+ 'media_buttons' => false,
+ 'textarea_name' => 'message[{if $newEntry}-1{else}{$regNotifications.fieldData.id}{/if}]',
+ 'editor_height' => 300,
+ )
+ );
+ {/php}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="glm-row"> </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-3 glm-column">
+ <input type="submit" value="{if $newEntry}Add{else}Update{/if} Notification">
+ </div>
+ </div>
+</form>
+
+{literal}
+<hr>
+<div id="mergeTags">
+ <div class="glm-row"> </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-12 glm-column">
+ <h2>Merge Tags</h2>
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-12 glm-column">
+ The "merge tags" listed below may be using in the E-Mail message content to include certain information about the event and attendee. Be sure to include the "{" and "}" and "$" characters exactly as shown.
+ </div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.name}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">Name of the event.</div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.date}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">Date for which the attendee has registered.</div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event.time}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">Time for which the attendee has registered.</div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$registration.level}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">Registration Level</div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$last.name}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">Last name of attendee.</div>
+ </div>
+ <div class="glm-row">
+ <div class="glm-small-12 glm-large-2 glm-column"><h3>{$first.name}</h3></div>
+ <div class="glm-small-12 glm-large-9 glm-column">First name of attendee.</div>
+ </div>
+</div>
+{/literal}
+
+<script type="text/javascript">
+ jQuery(document).ready(function($) {
+ var calendar;
+ var regEvent = {
+ id: 'regEvent',
+ title: 'regEvent',
+ start: '01/27/2018',
+ end: '01/27/2018',
+ allDay: true,
+ };
+
+ function initFullCalendar(){
+ calendar = $('#datepicker').fullCalendar({
+ timezone: 'local',
+ events: [
+ regEvent
+ ],
+ defaultDate: '01/27/2018',
+ dayClick: function( date, allDay, jsEvent, view ){
+ // console.log( 'jsEvent: ', jsEvent );
+ console.log( 'date: ', date );
+ calendar.fullCalendar('removeEvents', 'selected');
+ var newEvent = {
+ id: 'selected',
+ title: 'selected',
+ start: date.format(),
+ end: date.format(),
+ allDay: true,
+ };
+ calendar.fullCalendar('renderEvent', newEvent, true);
+ },
+ });
+ // console.log( 'cal:', calendar );
+ }
+
+ initFullCalendar();
+
+ // Flash certain elements for a short time after display
+ $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+ });
+</script>
+
+{include file='admin/footer.html'}
+
{include file='admin/registrations/eventSubTabs.html'}
<div style="margin-bottom: 1em;">
- <a id="regNotificationAdd" class="button button-secondary glm-button glm-right">Add a Notification</a>
+ <a
+ id="regNotificationAdd"
+ class="button button-secondary glm-button glm-right"
+ href="{$thisUrl}?page={$thisPage}&option=notifications®EventID={$regEventID}&new=1">Add a Notification</a>
<h1>Registrant E-Mail Notifications</h1>
</div>
<hr>
-{literal}
-<div id="notificationTemplate" class="glm-hidden">
- <div id="notificationContainer_{newFieldId}" class="glm-row">
- <div class="glm-small-12 glm-large-3 glm-column">
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>Name</h2>
- For reference. Not sent to attendee.
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <input type="text" name="{nameFieldName}" value="" class="glm-form-text-input-medium-long">
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>Day to Send</h2>
- Negative for days before event.<br>
- Positive for days after event.
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column ">
- <input type="text" name="{daysFieldName}" value="" class="glm-form-text-input-veryshort">
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <a data-notificationId="{newFieldId}" class="regNotificationDelete button button-secondary glm-button">Delete this Notification</a>
- </div>
- </div>
- </div>
- <div class="glm-small-12 glm-large-8 glm-column">
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>E-Mail Message Content</h2>
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <textarea name="{messageFieldName}" style="width: 100%" rows="10"></textarea>
- </div>
- </div>
- </div>
- </div>
- <div class="glm-row"> </div>
-</div>
-{/literal}
-
-<form action="{$thisUrl}?page={$thisPage}" method="post">
- <input type="hidden" name="option" value="notificationsUpdate">
- <input type="hidden" name="regEventID" value="{$regEvent.id}">
- <div id="deleteNotificationsContainer"></div>
- <div id="notificationsContainer">
-{if $regNotifications}
- <div class="glm-row"> </div>
- {foreach $regNotifications as $n}
- <div id="notificationContainer_{$n.id}" class="glm-row">
- <div class="glm-small-12 glm-large-3 glm-column">
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>Name</h2>
- For reference. Not sent to attendee.
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <input type="text" name="name[{$n.id}]" value="{$n.name}" class="glm-form-text-input-medium-long">
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>Day to Send</h2>
- Negative for days before event.<br>
- Positive for days after event.
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column ">
- <input type="text" name="notification_days[{$n.id}]" value="{$n.notification_days}" class="glm-form-text-input-veryshort">
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <a data-notificationId="{$n.id}" class="regNotificationDelete button button-secondary glm-button">Delete this Notification</a>
- </div>
- </div>
- </div>
- <div class="glm-small-12 glm-large-8 glm-column">
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <h2>E-Mail Message Content</h2>
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-column ">
- <textarea name="message[{$n.id}]" style="width: 100%" rows="10">{$n.message}</textarea>
- </div>
- </div>
- </div>
- </div>
- <div class="glm-row"> </div>
- {/foreach}
-{else}
- <div class="glm-row glm-reg-cart-event-class">
- <div class="glm-small-12 glm-column">No notifications listed</div>
- </div>
-{/if}
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-3 glm-column">
- <input type="submit" value="Update all Notifications">
- </div>
- </div>
-</form>
-
-{literal}
-<hr>
-<div id="mergeTags">
- <div class="glm-row"> </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-12 glm-column">
- <h2>Merge Tags</h2>
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-12 glm-column">
- The "merge tags" listed below may be using in the E-Mail message content to include certain information about the event and attendee. Be sure to include the "{" and "}" and "$" characters exactly as shown.
- </div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event-name}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">Name of the event.</div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event-date}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">Date for which the attendee has registered.</div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$event-time}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">Time for which the attendee has registered.</div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$registration-level}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">Registration Level</div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$last-name}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">Last name of attendee.</div>
- </div>
- <div class="glm-row">
- <div class="glm-small-12 glm-large-2 glm-column"><h3>{$first-name}</h3></div>
- <div class="glm-small-12 glm-large-9 glm-column">First name of attendee.</div>
- </div>
-</div>
-{/literal}
+<table class="wp-list-table widefat fixed posts glm-admin-table">
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Subject</th>
+ <th>Notification</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ {if $regNotifications}
+ {foreach $regNotifications as $n}
+ <tr class="{if $r@iteration is div by 2}alternate{/if}">
+ <td>{$n.id}</td>
+ <td>
+ <a
+ class=""
+ href="{$thisUrl}?page={$thisPage}&option=notifications®EventID={$regEventID}&id={$n.id}">{$n.name}</a>
+ </td>
+ <td>When?</td>
+ <td>
+ <a
+ class="button button-secondary glm-button-small glm-right delete-notice"
+ href="{$thisUrl}?page={$thisPage}&option=notificationsUpdate®EventID={$regEventID}&id={$n.id}&delete=1">Delete</a>
+ </td>
+ </tr>
+ {/foreach}
+ {else}
+ <tr>
+ <th colspan="4">No Notifications found.</th>
+ </tr>
+ {/if}
+ </tbody>
+</table>
<script type="text/javascript">
jQuery(document).ready(function($) {
- var newFieldId = 0;
-
- // Add a notification
- $('#regNotificationAdd').click( function() {
-
- // Bump temporary field ID (negative numbers)
- newFieldId--;
-
- // Get a copy of the template and update it with the new ID
- var template = $('#notificationTemplate').html();
-{literal}
- template = template.replace(/{newFieldId}/g, newFieldId)
- template = template.replace(/{nameFieldName}/g, 'name[' + newFieldId + ']')
- template = template.replace(/{daysFieldName}/g, 'notification_days[' + newFieldId + ']')
- template = template.replace(/{messageFieldName}/g, 'message[' + newFieldId + ']')
-{/literal}
- $('#notificationsContainer').append(template);
+ $('.delete-notice').click(function(e){
+ return confirm('Are you sure!');
});
- // Delete notification - removes notification form and adds a hidden input field to have it deleted on submit.
- $('.regNotificationDelete').click( function() {
- var fieldId = $(this).attr('data-notificationId');
- if (fieldId > 0) {
- $('#deleteNotificationsContainer').append('<input type="hidden" name="delete[' + fieldId + ']" value="delete">');
- }
- $('#notificationContainer_' + fieldId).remove();
- });
-
// Flash certain elements for a short time after display
$(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
</script>
{include file='admin/footer.html'}
-
{if apply_filters('glm-members-customfields-plugin-active', false)}
<a {if $option=="eventCustomFields"}onClick="return false;" class="nav-tab nav-tab-active"{else}href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventCustomFields®EventID={$regEventID}" class="nav-tab"{/if}>Additional Fields</a>
{/if}
- <a {if $option=="notifications" || $option=="notificationsUpdate"}onClick="return false;" class="nav-tab nav-tab-active"{else}href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=notifications®EventID={$regEventID}" class="nav-tab"{/if}>Attendee Notification</a>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=notifications®EventID={$regEventID}" class="nav-tab{if $option=="notifications" || $option=="notificationsUpdate"} nav-tab-active{/if}">Attendee Notification</a>
<a {if $option=="paymentCodes"}onClick="return false;" class="nav-tab nav-tab-active"{else}href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=paymentCodes®EventID={$regEventID}" class="nav-tab"{/if}>Comp Codes</a>
<!-- <a {if $option=="registrants"}onClick="return false;" class="nav-tab nav-tab-active"{else}href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=registrants&regEventID={$regEventID}" class="nav-tab"{/if}>{$terms.reg_term_attendee_plur_cap}</a> -->
<a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=registrants®EventID={$regEventID}" class="nav-tab{if $option=='registrants'} nav-tab-active{/if}">{$terms.reg_term_attendee_plur_cap}</a>