Removed old view files.
Removed saved versions of models.
Minor changes to hawe the registrations admin menus show.
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations Dashboard
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+echo "NOT UPDATED";exit;
+// Load Registrations data abstract
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Registrations Event ID
+ *
+ * @var $eventID
+ * @access public
+ */
+ public $regEventID = false;
+
+ /**
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the REgistrations data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $option = 'list';
+ $template = 'list';
+ $haveEvent = false;
+ $eventID = false;
+ $haveRegEvent = false;
+ $regEventID = false;
+ $regEventUpdated = false;
+ $regEventUpdateError = false;
+ $regEventAdded = false;
+ $reason = false;
+
+ // Get any provided option
+ if (isset($_REQUEST['option'])) {
+ $option = $_REQUEST['option'];
+ }
+
+ // Check for a supplied regEvent record ID
+ if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
+ $regEventID = ($_REQUEST['regEventID'] - 0);
+ if ($regEventID > 0) {
+ $regEvent = $this->getEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+ }
+
+ // If we don't have a reg event ID, then check for an event ID and make sure it's a positive integer
+ if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
+ $eventID = ($_REQUEST['event']-0);
+ }
+
+ // If we don't have a regEvent or likely event ID, force option to a list
+ if (!$haveRegEvent && !$eventID) {
+ $option = 'list';
+ }
+
+ switch( $option ) {
+
+ case 'update':
+
+ // Try to update the reg event
+ $regEvent = $this->updateEntry($regEventID);
+
+ // If there's some type of failure, flag that for the view file
+ if ($regEvent['status']) {
+ $regEventUpdated = true;
+ } else {
+ $regEventUpdateError = true;
+ }
+
+ $template = 'eventEdit';
+
+ break;
+
+
+ case 'add':
+ case 'edit':
+
+ if ($option == 'add') {
+
+ // Verify that event is not already listed
+ $regEvent = $this->getEntry($eventID, 'event');
+ if (!$regEvent) {
+
+ // Get data on this event from events add-on
+ $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
+
+ // Did we get event data?
+ if ($eventData) {
+
+ // Add event to registrations
+ $sql = "
+ INSERT INTO ".$this->table."
+ (
+ event,
+ event_name,
+ event_code,
+ notify_email,
+ admin_active,
+ active,
+ attendees,
+ attendee_max,
+ attendee_max_per_reg,
+ reg_hold_minutes,
+ cart_hold_days,
+ registration_account_options,
+ payment_methods,
+ restricted_payment_methods,
+ terms
+ )
+ VALUES
+ (
+ ".$eventData['id'].",
+ '".$eventData['name']."',
+ '".$eventData['name_slug']."',
+ '".$eventData['admin_email']."',
+ false,
+ false,
+ true,
+ 0,
+ 0,
+ 60,
+ 10,
+ 0,
+ 0,
+ 0,
+ ''
+ )
+ ;";
+ $this->wpdb->query($sql);
+ $regEventID = $this->wpdb->insert_id;
+
+ if ($regEventID) {
+ $regEventUpdated = true;
+ }
+
+ }
+
+ } else {
+ $reason = "Trying to add an event that is already listed in Registrations.";
+ }
+
+ }
+
+ // If there's no problem yet, try to get the regEvent data for edit
+ if ($reason == '') {
+ if ($regEventID) {
+ $regEvent = $this->editEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+ }
+
+ $template = 'eventEdit';
+ break;
+
+ case 'dashboard':
+
+ if ($regEventID) {
+ $regEvent = $this->editEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+
+ if (!$haveRegEvent) {
+ $reason = 'Unable to load registration event data.';
+ }
+
+ $template = 'eventDashboard';
+ break;
+
+ case 'list':
+ default:
+
+ $regEventList = $this->getList();
+
+ $template = 'eventList';
+ break;
+
+ }
+
+
+ // Compile template data
+ $templateData = array(
+ 'haveEvent' => $haveEvent,
+ 'eventID' => $eventID,
+ 'haveRegEvent' => $haveRegEvent,
+ 'regEventID' => $regEventID,
+ 'regEvent' => $regEvent,
+ 'regEventUpdated' => $regEventUpdated,
+ 'regEventUpdateError' => $regEventUpdateError,
+ 'regEventAdded' => $regEventAdded ,
+ 'reason' => $reason
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/registrations/'.$template.'.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Admin Registrations Dashboard
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-echo "NOT UPDATED";exit;
-// Load Registrations data abstract
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
-class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * Registrations Event ID
- *
- * @var $eventID
- * @access public
- */
- public $regEventID = false;
-
- /**
- * Constructor
- *
- * This contructor performs the work for this model. This model returns
- * an array containing the following.
- *
- * 'status'
- *
- * True if successfull and false if there was a fatal failure.
- *
- * 'view'
- *
- * A suggested view name that the contoller should use instead of the
- * default view for this model or false to indicate that the default view
- * should be used.
- *
- * 'data'
- *
- * Data that the model is returning for use in merging with the view to
- * produce output.
- *
- * @wpdb object WordPress database object
- *
- * @return array Array containing status, suggested view, and any data
- */
- public function __construct ($wpdb, $config)
- {
-
- // Save WordPress Database object
- $this->wpdb = $wpdb;
-
- // Save plugin configuration object
- $this->config = $config;
-
- /*
- * Run constructor for the REgistrations data class
- *
- * Note, the third parameter is a flag that indicates to the Contacts
- * data class that it should flag a group of fields as 'view_only'.
- */
- parent::__construct(false, false, true);
-
- }
-
- public function modelAction($actionData = false)
- {
-
- $option = 'list';
- $template = 'list.html';
- $haveEvent = false;
- $eventID = false;
- $haveRegEvent = false;
- $regEventID = false;
- $regEventUpdated = false;
- $regEventUpdateError = false;
- $regEventAdded = false;
- $reason = false;
-
- // Get any provided option
- if (isset($_REQUEST['option'])) {
- $option = $_REQUEST['option'];
- }
-
- // Check for a supplied regEvent record ID
- if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
- $regEventID = ($_REQUEST['regEventID'] - 0);
- if ($regEventID > 0) {
- $regEvent = $this->getEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
- }
-
- // If we don't have a reg event ID, then check for an event ID and make sure it's a positive integer
- if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
- $eventID = ($_REQUEST['event']-0);
- }
-
- // If we don't have a regEvent or likely event ID, force option to a list
- if (!$haveRegEvent && !$eventID) {
- $option = 'list';
- }
-
- switch( $option ) {
-
- case 'update':
-
- // Try to update the reg event
- $regEvent = $this->updateEntry($regEventID);
-
- // If there's some type of failure, flag that for the view file
- if ($regEvent['status']) {
- $regEventUpdated = true;
- } else {
- $regEventUpdateError = true;
- }
-
- $template = 'eventEdit.html';
-
- break;
-
-
- case 'add':
- case 'edit':
-
- if ($option == 'add') {
-
- // Verify that event is not already listed
- $regEvent = $this->getEntry($eventID, 'event');
- if (!$regEvent) {
-
- // Get data on this event from events add-on
- $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
-
- // Did we get event data?
- if ($eventData) {
-
- // Add event to registrations
- $sql = "
- INSERT INTO ".$this->table."
- (
- event,
- event_name,
- event_code,
- notify_email,
- admin_active,
- active,
- attendees,
- attendee_max,
- attendee_max_per_reg,
- reg_hold_minutes,
- cart_hold_days,
- registration_account_options,
- payment_methods,
- restricted_payment_methods,
- terms
- )
- VALUES
- (
- ".$eventData['id'].",
- '".$eventData['name']."',
- '".$eventData['name_slug']."',
- '".$eventData['admin_email']."',
- false,
- false,
- true,
- 0,
- 0,
- 60,
- 10,
- 0,
- 0,
- 0,
- ''
- )
- ;";
- $this->wpdb->query($sql);
- $regEventID = $this->wpdb->insert_id;
-
- if ($regEventID) {
- $regEventUpdated = true;
- }
-
- }
-
- } else {
- $reason = "Trying to add an event that is already listed in Registrations.";
- }
-
- }
-
- // If there's no problem yet, try to get the regEvent data for edit
- if ($reason == '') {
- if ($regEventID) {
- $regEvent = $this->editEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
- }
-
- $template = 'eventEdit.html';
- break;
-
- case 'dashboard':
-
- if ($regEventID) {
- $regEvent = $this->editEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
-
- if (!$haveRegEvent) {
- $reason = 'Unable to load registration event data.';
- }
-
- $template = 'eventDashboard.html';
- break;
-
- case 'list':
- default:
-
- $regEventList = $this->getList();
-
- $template = 'eventList.html';
- break;
-
- }
-
-
- // Compile template data
- $templateData = array(
- 'haveEvent' => $haveEvent,
- 'eventID' => $eventID,
- 'haveRegEvent' => $haveRegEvent,
- 'regEventID' => $regEventID,
- 'regEvent' => $regEvent,
- 'regEventUpdated' => $regEventUpdated,
- 'regEventUpdateError' => $regEventUpdateError,
- 'regEventAdded' => $regEventAdded ,
- 'reason' => $reason
- );
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/registrations/'.$template,
- 'data' => $templateData
- );
-
- }
-
-
-}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations Event Dashboard
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Registrations data abstract
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+class GlmMembersAdmin_registrations_event extends GlmDataRegistrationsRegEvent
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Registrations Event ID
+ *
+ * @var $eventID
+ * @access public
+ */
+ public $regEventID = false;
+
+ /**
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the REgistrations data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $option = 'list';
+ $regEvent = false;
+ $haveEvent = false;
+ $haveRegEventRecurrences = false;
+ $haveRegEventTimes = false;
+ $regEventFirstTime = false;
+ $regEventLastTime = false;
+ $eventID = 0;
+ $haveRegEvent = false;
+ $regEventID = 0;
+ $regEventUpdated = false;
+ $regEventUpdateError = false;
+ $regEventAdded = false;
+ $reason = false;
+
+ // Get any provided option
+ if (isset($_REQUEST['option'])) {
+ $option = $_REQUEST['option'];
+ }
+
+ // Check for a supplied regEvent record ID and make sure it's and integer
+ if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
+ $regEventID = ($_REQUEST['regEventID'] - 0);
+ }
+
+ // If no ID was supplied try to get last used reg event ID
+ if ($regEventID <= 0) {
+ $regEventID = get_option('glmMembersDatabaseLastUsedRegEventID');
+ }
+
+ // If we have a positive Int reg event ID, try to get the reg event data
+ if ($regEventID > 0) {
+ $regEvent = $this->getEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+
+ // If we don't have a reg event ID, then check for an event ID to create new reg event
+ if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
+ $eventID = ($_REQUEST['event']-0);
+ }
+
+ switch( $option ) {
+
+ case 'update':
+
+ // Try to update the reg event
+ $regEvent = $this->updateEntry($regEventID);
+
+ // If there's some type of failure, flag that for the view file
+ if ($regEvent['status']) {
+ $regEventUpdated = true;
+ } else {
+ $regEventUpdateError = true;
+ }
+
+ $template = 'eventEdit.html';
+
+ break;
+
+
+ case 'add':
+ case 'edit':
+
+ // If we're adding a new reg event
+ if ($option == 'add') {
+
+ // Verify that event is not already listed
+ $regEvent = $this->getEntry($eventID, 'event');
+ if (!$regEvent) {
+
+ // Get data on this event from events add-on
+ $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
+
+ // Did we get event data?
+ if ($eventData) {
+
+ // Add event to registrations
+ $sql = "
+ INSERT INTO ".$this->table."
+ (
+ event,
+ event_name,
+ event_code,
+ notify_email,
+ admin_active,
+ active,
+ attendees,
+ attendee_max,
+ attendee_max_per_reg,
+ reg_hold_minutes,
+ cart_hold_days,
+ registration_account_options,
+ payment_methods,
+ restricted_payment_methods,
+ terms
+ )
+ VALUES
+ (
+ ".$eventData['id'].",
+ '".$eventData['name']."',
+ '".$eventData['name_slug']."',
+ '".$eventData['admin_email']."',
+ false,
+ false,
+ true,
+ 0,
+ 0,
+ 60,
+ 10,
+ 0,
+ 0,
+ 0,
+ ''
+ )
+ ;";
+ $this->wpdb->query($sql);
+ $regEventID = $this->wpdb->insert_id;
+
+ if ($regEventID) {
+ $regEventUpdated = true;
+ }
+
+ }
+
+ } else {
+ $reason = "Trying to add an event that is already listed in Registrations.";
+ }
+
+ }
+
+ // If there's no problem yet, try to get the regEvent data for edit
+ if ($reason == '') {
+ if ($regEventID) {
+ $regEvent = $this->editEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+ }
+
+ $template = 'eventEdit.html';
+ break;
+
+ case 'dashboard':
+ default:
+
+ // If we have an event ID
+ if ($regEventID) {
+
+ // Try to get the event configuration including recurrences and times
+ $this->postProcAddedEventData = true;
+ $regEvent = $this->getEventConfig($regEventID, true, true, true);
+
+ // If we have the event data
+ if ($regEvent) {
+
+ $haveRegEvent = true;
+
+ // If event is time_specific and we have recurrences for the event
+ if ($regEvent['time_specific']['value'] && is_array($regEvent['recurrences']) && count($regEvent['recurrences']) > 0) {
+
+ $haveRegEventRecurrences = true;
+
+ // For each recurrence
+ foreach ($regEvent['recurrences'] as $k=>$v) {
+
+ $regEvent['recurrences'][$k]['haveTimes'] = false;
+
+ // If we have times for this recuirrence
+ if ($v['times'] && count($v['times']) > 0) {
+
+ $regEvent['recurrences'][$k]['haveTimes'] = false;
+ $haveRegEventTimes = true;
+
+ // Get the first event date/time
+ $first = current($v['times']);
+ $last = end($v['times']);
+ $regEvent['recurrences'][$k]['first_time'] = $first;
+ $regEvent['recurrences'][$k]['lastTime'] = $last;
+
+ // Set event first and last times
+ if (!$regEventFirstTime || $regEventFirstTime['timestamp'] < $first ) {
+ $regEventFirstTime = $first;
+ }
+ if (!$regEventLastTime || $regEventLastTime['timestamp'] > $last ) {
+ $regEventLastTime = $last;
+ }
+
+ // Check all event times for matching reg event times
+ foreach ($v['times'] as $tk=>$tv) {
+
+ // If time doesn't exist in reg_times
+ if (!isset($regEvent['reg_times'][$tk])) {
+
+ $sTime = date('Y-m-d H:i:s',strtotime($tv['start_time']['datetime']));
+ $eTime = date('Y-m-d H:i:s',strtotime($tv['end_time']['datetime']));
+
+ // Add reg event time
+ $this->wpdb->insert(
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time",
+ array(
+ 'reg_event' => $regEvent['event'],
+ 'event_time' => $tk,
+ 'start_datetime' => $sTime,
+ 'end_datetime' => $eTime,
+ 'all_day' => $tv['all_day']['value'],
+ 'attendees' => $regEvent['attendees']['value'],
+ 'attendee_max' => $regEvent['attendee_max'],
+ 'attendee_count' => 0,
+ 'attendees_pending' => 0,
+ 'attendees_available' => $regEvent['attendee_max'],
+ 'total_base_charge' => 0,
+ 'total_per_attendee' => 0,
+ 'total_other' => 0,
+ 'total_taxes' => 0,
+ 'total_charges' => 0,
+ 'total_discounts' => 0,
+ 'total_payments' => 0
+ ),
+ array(
+ '%d', // reg_event
+ '%d', // event_time record ID
+ '%s', // start_datetime
+ '%s', // end_datetime
+ '%d', // all_day flag
+ '%d', // attendees flag
+ '%d', // attendee_max
+ '%d', // attendee_count
+ '%d', // attendees_pending
+ '%d', // attendees_available
+ '%f', // total_base__charge
+ '%f', // total_per_attendee
+ '%f', // total_other
+ '%f', // total_taxes
+ '%f', // total_charges
+ '%f', // total_discounts
+ '%f' // total_payments
+ )
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!$haveRegEvent) {
+ $reason = 'Unable to load registration event data or registration event not selected.';
+ }
+
+ $template = 'event.html';
+ break;
+
+ } // switch
+
+ // If we have a reg event, then save it as last accessed
+ if ($haveRegEvent) {
+ update_option('glmMembersDatabaseLastUsedRegEventID', $regEventID);
+ }
+
+ // Compile template data
+ $templateData = array(
+ 'option' => $option,
+ 'haveEvent' => $haveEvent,
+ 'eventID' => $eventID,
+ 'haveRegEvent' => $haveRegEvent,
+ 'haveRegEventRecurrences' => $haveRegEventRecurrences,
+ 'haveRegEventTimes' => $haveRegEventTimes,
+ 'regEventFirstTime' => $regEventFirstTime,
+ 'regEventLastTime' => $regEventLastTime,
+ 'regEventID' => $regEventID,
+ 'regEvent' => $regEvent,
+ 'regEventUpdated' => $regEventUpdated,
+ 'regEventUpdateError' => $regEventUpdateError,
+ 'regEventAdded' => $regEventAdded ,
+ 'reason' => $reason
+ );
+
+ // echo "<pre>".print_r($templateData,1)."</pre>";
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/registrations/'.$template,
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Admin Registrations Event Dashboard
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Registrations data abstract
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
-class GlmMembersAdmin_registrations_event extends GlmDataRegistrationsRegEvent
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * Registrations Event ID
- *
- * @var $eventID
- * @access public
- */
- public $regEventID = false;
-
- /**
- * Constructor
- *
- * This contructor performs the work for this model. This model returns
- * an array containing the following.
- *
- * 'status'
- *
- * True if successfull and false if there was a fatal failure.
- *
- * 'view'
- *
- * A suggested view name that the contoller should use instead of the
- * default view for this model or false to indicate that the default view
- * should be used.
- *
- * 'data'
- *
- * Data that the model is returning for use in merging with the view to
- * produce output.
- *
- * @wpdb object WordPress database object
- *
- * @return array Array containing status, suggested view, and any data
- */
- public function __construct ($wpdb, $config)
- {
-
- // Save WordPress Database object
- $this->wpdb = $wpdb;
-
- // Save plugin configuration object
- $this->config = $config;
-
- /*
- * Run constructor for the REgistrations data class
- *
- * Note, the third parameter is a flag that indicates to the Contacts
- * data class that it should flag a group of fields as 'view_only'.
- */
- parent::__construct(false, false, true);
-
- }
-
- public function modelAction($actionData = false)
- {
-
- $option = 'list';
- $template = 'list.html';
- $regEvent = false;
- $haveEvent = false;
- $haveRegEventRecurrences = false;
- $haveRegEventTimes = false;
- $regEventFirstTime = false;
- $regEventLastTime = false;
- $eventID = 0;
- $haveRegEvent = false;
- $regEventID = 0;
- $regEventUpdated = false;
- $regEventUpdateError = false;
- $regEventAdded = false;
- $reason = false;
-
- // Get any provided option
- if (isset($_REQUEST['option'])) {
- $option = $_REQUEST['option'];
- }
-
- // Check for a supplied regEvent record ID and make sure it's and integer
- if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
- $regEventID = ($_REQUEST['regEventID'] - 0);
- }
-
- // If no ID was supplied try to get last used reg event ID
- if ($regEventID <= 0) {
- $regEventID = get_option('glmMembersDatabaseLastUsedRegEventID');
- }
-
- // If we have a positive Int reg event ID, try to get the reg event data
- if ($regEventID > 0) {
- $regEvent = $this->getEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
-
- // If we don't have a reg event ID, then check for an event ID to create new reg event
- if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
- $eventID = ($_REQUEST['event']-0);
- }
-
- switch( $option ) {
-
- case 'update':
-
- // Try to update the reg event
- $regEvent = $this->updateEntry($regEventID);
-
- // If there's some type of failure, flag that for the view file
- if ($regEvent['status']) {
- $regEventUpdated = true;
- } else {
- $regEventUpdateError = true;
- }
-
- $template = 'eventEdit.html';
-
- break;
-
-
- case 'add':
- case 'edit':
-
- // If we're adding a new reg event
- if ($option == 'add') {
-
- // Verify that event is not already listed
- $regEvent = $this->getEntry($eventID, 'event');
- if (!$regEvent) {
-
- // Get data on this event from events add-on
- $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
-
- // Did we get event data?
- if ($eventData) {
-
- // Add event to registrations
- $sql = "
- INSERT INTO ".$this->table."
- (
- event,
- event_name,
- event_code,
- notify_email,
- admin_active,
- active,
- attendees,
- attendee_max,
- attendee_max_per_reg,
- reg_hold_minutes,
- cart_hold_days,
- registration_account_options,
- payment_methods,
- restricted_payment_methods,
- terms
- )
- VALUES
- (
- ".$eventData['id'].",
- '".$eventData['name']."',
- '".$eventData['name_slug']."',
- '".$eventData['admin_email']."',
- false,
- false,
- true,
- 0,
- 0,
- 60,
- 10,
- 0,
- 0,
- 0,
- ''
- )
- ;";
- $this->wpdb->query($sql);
- $regEventID = $this->wpdb->insert_id;
-
- if ($regEventID) {
- $regEventUpdated = true;
- }
-
- }
-
- } else {
- $reason = "Trying to add an event that is already listed in Registrations.";
- }
-
- }
-
- // If there's no problem yet, try to get the regEvent data for edit
- if ($reason == '') {
- if ($regEventID) {
- $regEvent = $this->editEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
- }
-
- $template = 'eventEdit.html';
- break;
-
- case 'dashboard':
- default:
-
- // If we have an event ID
- if ($regEventID) {
-
- // Try to get the event configuration including recurrences and times
- $this->postProcAddedEventData = true;
- $regEvent = $this->getEventConfig($regEventID, true, true, true);
-
- // If we have the event data
- if ($regEvent) {
-
- $haveRegEvent = true;
-
- // If event is time_specific and we have recurrences for the event
- if ($regEvent['time_specific']['value'] && is_array($regEvent['recurrences']) && count($regEvent['recurrences']) > 0) {
-
- $haveRegEventRecurrences = true;
-
- // For each recurrence
- foreach ($regEvent['recurrences'] as $k=>$v) {
-
- $regEvent['recurrences'][$k]['haveTimes'] = false;
-
- // If we have times for this recuirrence
- if ($v['times'] && count($v['times']) > 0) {
-
- $regEvent['recurrences'][$k]['haveTimes'] = false;
- $haveRegEventTimes = true;
-
- // Get the first event date/time
- $first = current($v['times']);
- $last = end($v['times']);
- $regEvent['recurrences'][$k]['first_time'] = $first;
- $regEvent['recurrences'][$k]['lastTime'] = $last;
-
- // Set event first and last times
- if (!$regEventFirstTime || $regEventFirstTime['timestamp'] < $first ) {
- $regEventFirstTime = $first;
- }
- if (!$regEventLastTime || $regEventLastTime['timestamp'] > $last ) {
- $regEventLastTime = $last;
- }
-
- // Check all event times for matching reg event times
- foreach ($v['times'] as $tk=>$tv) {
-
- // If time doesn't exist in reg_times
- if (!isset($regEvent['reg_times'][$tk])) {
-
- $sTime = date('Y-m-d H:i:s',strtotime($tv['start_time']['datetime']));
- $eTime = date('Y-m-d H:i:s',strtotime($tv['end_time']['datetime']));
-
- // Add reg event time
- $this->wpdb->insert(
- GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time",
- array(
- 'reg_event' => $regEvent['event'],
- 'event_time' => $tk,
- 'start_datetime' => $sTime,
- 'end_datetime' => $eTime,
- 'all_day' => $tv['all_day']['value'],
- 'attendees' => $regEvent['attendees']['value'],
- 'attendee_max' => $regEvent['attendee_max'],
- 'attendee_count' => 0,
- 'attendees_pending' => 0,
- 'attendees_available' => $regEvent['attendee_max'],
- 'total_base_charge' => 0,
- 'total_per_attendee' => 0,
- 'total_other' => 0,
- 'total_taxes' => 0,
- 'total_charges' => 0,
- 'total_discounts' => 0,
- 'total_payments' => 0
- ),
- array(
- '%d', // reg_event
- '%d', // event_time record ID
- '%s', // start_datetime
- '%s', // end_datetime
- '%d', // all_day flag
- '%d', // attendees flag
- '%d', // attendee_max
- '%d', // attendee_count
- '%d', // attendees_pending
- '%d', // attendees_available
- '%f', // total_base__charge
- '%f', // total_per_attendee
- '%f', // total_other
- '%f', // total_taxes
- '%f', // total_charges
- '%f', // total_discounts
- '%f' // total_payments
- )
- );
- }
- }
- }
- }
- }
- }
- }
-
- if (!$haveRegEvent) {
- $reason = 'Unable to load registration event data or registration event not selected.';
- }
-
- $template = 'event.html';
- break;
-
- } // switch
-
- // If we have a reg event, then save it as last accessed
- if ($haveRegEvent) {
- update_option('glmMembersDatabaseLastUsedRegEventID', $regEventID);
- }
-
- // Compile template data
- $templateData = array(
- 'option' => $option,
- 'haveEvent' => $haveEvent,
- 'eventID' => $eventID,
- 'haveRegEvent' => $haveRegEvent,
- 'haveRegEventRecurrences' => $haveRegEventRecurrences,
- 'haveRegEventTimes' => $haveRegEventTimes,
- 'regEventFirstTime' => $regEventFirstTime,
- 'regEventLastTime' => $regEventLastTime,
- 'regEventID' => $regEventID,
- 'regEvent' => $regEvent,
- 'regEventUpdated' => $regEventUpdated,
- 'regEventUpdateError' => $regEventUpdateError,
- 'regEventAdded' => $regEventAdded ,
- 'reason' => $reason
- );
-
- // echo "<pre>".print_r($templateData,1)."</pre>";
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/registrations/'.$template,
- 'data' => $templateData
- );
-
- }
-
-
-}
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations Dashboard
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
+ * @link http://dev.gaslightmedia.com/
+ */
+
+// Load Registrations data abstract
+require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+ /**
+ * Registrations Event ID
+ *
+ * @var $eventID
+ * @access public
+ */
+ public $regEventID = false;
+
+ /**
+ * Constructor
+ *
+ * This contructor performs the work for this model. This model returns
+ * an array containing the following.
+ *
+ * 'status'
+ *
+ * True if successfull and false if there was a fatal failure.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ * @wpdb object WordPress database object
+ *
+ * @return array Array containing status, suggested view, and any data
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ /*
+ * Run constructor for the REgistrations data class
+ *
+ * Note, the third parameter is a flag that indicates to the Contacts
+ * data class that it should flag a group of fields as 'view_only'.
+ */
+ parent::__construct(false, false, true);
+
+ }
+
+ public function modelAction($actionData = false)
+ {
+
+ $option = 'list';
+ $template = 'list.html';
+ $haveEvent = false;
+ $eventID = false;
+ $haveRegEvent = false;
+ $regEventID = false;
+ $regEventUpdated = false;
+ $regEventUpdateError = false;
+ $regEventAdded = false;
+ $reason = false;
+
+ // Get any provided option
+ if (isset($_REQUEST['option'])) {
+ $option = $_REQUEST['option'];
+ }
+
+ // Check for a supplied regEvent record ID
+ if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
+ $regEventID = ($_REQUEST['regEventID'] - 0);
+ if ($regEventID > 0) {
+ $regEvent = $this->getEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+ }
+
+ // If we don't have a reg event ID, then check for an event ID and make sure it's a positive integer
+ if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
+ $eventID = ($_REQUEST['event']-0);
+ }
+
+ // If we don't have a regEvent or likely event ID, force option to a list
+ if (!$haveRegEvent && !$eventID) {
+ $option = 'list';
+ }
+
+ switch( $option ) {
+
+ case 'update':
+
+ // Try to update the reg event
+ $regEvent = $this->updateEntry($regEventID);
+
+ // If there's some type of failure, flag that for the view file
+ if ($regEvent['status']) {
+ $regEventUpdated = true;
+ } else {
+ $regEventUpdateError = true;
+ }
+
+ $template = 'eventEdit.html';
+
+ break;
+
+
+ case 'add':
+ case 'edit':
+
+ if ($option == 'add') {
+
+ // Verify that event is not already listed
+ $regEvent = $this->getEntry($eventID, 'event');
+ if (!$regEvent) {
+
+ // Get data on this event from events add-on
+ $eventData = apply_filters('glm-member-db-events-get-event', $eventID);
+
+ // Did we get event data?
+ if ($eventData) {
+
+ // Add event to registrations
+ $sql = "
+ INSERT INTO ".$this->table."
+ (
+ event,
+ event_name,
+ event_code,
+ notify_email,
+ admin_active,
+ active,
+ attendees,
+ attendee_max,
+ attendee_max_per_reg,
+ reg_hold_minutes,
+ cart_hold_days,
+ registration_account_options,
+ payment_methods,
+ restricted_payment_methods,
+ terms
+ )
+ VALUES
+ (
+ ".$eventData['id'].",
+ '".$eventData['name']."',
+ '".$eventData['name_slug']."',
+ '".$eventData['admin_email']."',
+ false,
+ false,
+ true,
+ 0,
+ 0,
+ 60,
+ 10,
+ 0,
+ 0,
+ 0,
+ ''
+ )
+ ;";
+ $this->wpdb->query($sql);
+ $regEventID = $this->wpdb->insert_id;
+
+ if ($regEventID) {
+ $regEventUpdated = true;
+ }
+
+ }
+
+ } else {
+ $reason = "Trying to add an event that is already listed in Registrations.";
+ }
+
+ }
+
+ // If there's no problem yet, try to get the regEvent data for edit
+ if ($reason == '') {
+ if ($regEventID) {
+ $regEvent = $this->editEntry($regEventID);
+ if ($regEvent) {
+ $haveRegEvent = true;
+ }
+ }
+ }
+
+ $template = 'eventEdit.html';
+ break;
+
+ default:
+
+ echo "OOOPPPPSSSSS! Should not get here.....";
+ exit;
+
+ break;
+
+
+ }
+
+ echo "---------------------------------------------------";
+ // Compile template data
+ $templateData = array(
+ 'haveEvent' => $haveEvent,
+ 'eventID' => $eventID,
+ 'haveRegEvent' => $haveRegEvent,
+ 'regEventID' => $regEventID,
+ 'regEvent' => $regEvent,
+ 'regEventUpdated' => $regEventUpdated,
+ 'regEventUpdateError' => $regEventUpdateError,
+ 'regEventAdded' => $regEventAdded ,
+ 'reason' => $reason
+ );
+
+ // Return status, any suggested view, and any data to controller
+ return array(
+ 'status' => true,
+ 'modelRedirect' => false,
+ 'view' => 'admin/registrations/'.$template,
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
<?php
/**
* Gaslight Media Members Database
- * Admin Registrations Dashboard
+ * Admin Registrations Events Dashboard
*
* PHP version 5.5
*
public function modelAction($actionData = false)
{
-
- $option = 'list';
- $template = 'list.html';
- $haveEvent = false;
- $eventID = false;
- $haveRegEvent = false;
- $regEventID = false;
- $regEventUpdated = false;
- $regEventUpdateError = false;
- $regEventAdded = false;
- $reason = false;
+
+ $option = 'dashboard';
+ $view = false;
+ $where = ' true ';
+ $alphaWhere = ' true ';
+ $numbDisplayed = false;
+ $lastDisplayed = false;
+ $paging = true;
+ $prevStart = false;
+ $nextStart = false;
+ $start = 1;
+ $limit = 20; // Set to the number of listings per page
+ $textSearch = false;
+ $where = "TRUE";
+ $alphaList = false;
+ $alphaWhere = '';
+ $alphaSelected = false;
+ $haveRegEvents = false;
+ $regEventsCount = false;
+ $namesList = false;
+ $regEvent = false;
+ $regEventID = false;
+ $haveRegEvent = false;
+ $haveRegEventRecurrences = false;
+ $haveRegEventTimes = false;
+ $regEventFirstTime = false;
+ $regEventLastTime = false;
+ $regEventUpdated = false;
+ $regEventUpdateError = false;
+ $regEventAdded = false;
+ $reason = false;
// Get any provided option
if (isset($_REQUEST['option'])) {
$option = $_REQUEST['option'];
}
-
- // Check for a supplied regEvent record ID
- if (isset($_REQUEST['regEventID']) && $_REQUEST['regEventID'] != '') {
+
+ // Get registration event ID if supplied
+ if (isset($_REQUEST['regEventID'])) {
+
+ // Make sure it's numeric
$regEventID = ($_REQUEST['regEventID'] - 0);
- if ($regEventID > 0) {
- $regEvent = $this->getEntry($regEventID);
- if ($regEvent) {
- $haveRegEvent = true;
- }
- }
+
+ } else {
+
+ // Try to get saved
+ $regEventID = get_option('glmMembersDatabaseRegistrationsRegEventID');
+
}
- // If we don't have a reg event ID, then check for an event ID and make sure it's a positive integer
- if (!$haveRegEvent && isset($_REQUEST['event']) && $_REQUEST['event'] != '') {
- $eventID = ($_REQUEST['event']-0);
+ if (!$regEventID || $regEventID <= 0) {
+ $regEventID = false;
}
- // If we don't have a regEvent or likely event ID, force option to a list
- if (!$haveRegEvent && !$eventID) {
- $option = 'list';
- }
-
- switch( $option ) {
-
- case 'update':
-
- // Try to update the reg event
- $regEvent = $this->updateEntry($regEventID);
+
+
+ switch ($option) {
+
+ case 'configureEvent':
- // If there's some type of failure, flag that for the view file
- if ($regEvent['status']) {
- $regEventUpdated = true;
- } else {
- $regEventUpdateError = true;
- }
-
- $template = 'eventEdit.html';
+ $view = 'eventEditLevels';
break;
-
case 'add':
case 'edit':
-
+
+ // If we're adding a new reg event
if ($option == 'add') {
-
+
// Verify that event is not already listed
$regEvent = $this->getEntry($eventID, 'event');
if (!$regEvent) {
// Get data on this event from events add-on
$eventData = apply_filters('glm-member-db-events-get-event', $eventID);
-
+
// Did we get event data?
if ($eventData) {
// Add event to registrations
$sql = "
- INSERT INTO ".$this->table."
+ INSERT INTO ".$this->table."
(
event,
event_name,
0,
0,
''
- )
+ )
;";
$this->wpdb->query($sql);
$regEventID = $this->wpdb->insert_id;
if ($regEventID) {
$regEventUpdated = true;
}
-
+
}
} else {
}
}
-
+
// If there's no problem yet, try to get the regEvent data for edit
if ($reason == '') {
if ($regEventID) {
}
}
- $template = 'eventEdit.html';
+ $view = 'eventEdit';
+
break;
- default:
+ case 'update':
+
+ // Try to update the reg event
+ $regEvent = $this->updateEntry($regEventID);
+
+ // If there's some type of failure, flag that for the view file
+ if ($regEvent['status']) {
+ $regEventUpdated = true;
+ } else {
+ $regEventUpdateError = true;
+ }
+
+ $template = 'eventEdit';
+
+ break;
+
+
+ case 'eventDashboard':
+
+ // If we have an event ID
+ if ($regEventID) {
+
+ $regEvent = $this->getEntry($regEventID);
+ if ($regEvent) {
- echo "OOOPPPPSSSSS! Should not get here.....";
- exit;
+ $haveRegEvent = true;
+
+ // Try to get the event configuration including recurrences and times
+ $this->postProcAddedEventData = true;
+ $regEvent = $this->getEventConfig($regEventID, true, true, true);
+
+ // If we have the event data
+ if ($regEvent) {
+
+ $haveRegEvent = true;
+
+ // If event is time_specific and we have recurrences for the event
+ if ($regEvent['time_specific']['value'] && is_array($regEvent['recurrences']) && count($regEvent['recurrences']) > 0) {
+
+ $haveRegEventRecurrences = true;
+
+ // For each recurrence
+ foreach ($regEvent['recurrences'] as $k=>$v) {
+
+ $regEvent['recurrences'][$k]['haveTimes'] = false;
+
+ // If we have times for this recurrence
+ if ($v['times'] && count($v['times']) > 0) {
+
+ $regEvent['recurrences'][$k]['haveTimes'] = false;
+ $haveRegEventTimes = true;
+
+ // Get the first event date/time
+ $first = current($v['times']);
+ $last = end($v['times']);
+ $regEvent['recurrences'][$k]['first_time'] = $first;
+ $regEvent['recurrences'][$k]['lastTime'] = $last;
+
+ // Set event first and last times
+ if (!$regEventFirstTime || $regEventFirstTime['timestamp'] < $first ) {
+ $regEventFirstTime = $first;
+ }
+ if (!$regEventLastTime || $regEventLastTime['timestamp'] > $last ) {
+ $regEventLastTime = $last;
+ }
+
+ // Check all event times for matching reg event times
+ foreach ($v['times'] as $tk=>$tv) {
+
+ // If time doesn't exist in reg_times
+ if (!isset($regEvent['reg_times'][$tk])) {
+
+ $sTime = date('Y-m-d H:i:s',strtotime($tv['start_time']['datetime']));
+ $eTime = date('Y-m-d H:i:s',strtotime($tv['end_time']['datetime']));
+
+ // Add reg event time
+ $this->wpdb->insert(
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time",
+ array(
+ 'reg_event' => $regEvent['event'],
+ 'event_time' => $tk,
+ 'start_datetime' => $sTime,
+ 'end_datetime' => $eTime,
+ 'all_day' => $tv['all_day']['value'],
+ 'attendees' => $regEvent['attendees']['value'],
+ 'attendee_max' => $regEvent['attendee_max'],
+ 'attendee_count' => 0,
+ 'attendees_pending' => 0,
+ 'attendees_available' => $regEvent['attendee_max'],
+ 'total_base_charge' => 0,
+ 'total_per_attendee' => 0,
+ 'total_other' => 0,
+ 'total_taxes' => 0,
+ 'total_charges' => 0,
+ 'total_discounts' => 0,
+ 'total_payments' => 0
+ ),
+ array(
+ '%d', // reg_event
+ '%d', // event_time record ID
+ '%s', // start_datetime
+ '%s', // end_datetime
+ '%d', // all_day flag
+ '%d', // attendees flag
+ '%d', // attendee_max
+ '%d', // attendee_count
+ '%d', // attendees_pending
+ '%d', // attendees_available
+ '%f', // total_base__charge
+ '%f', // total_per_attendee
+ '%f', // total_other
+ '%f', // total_taxes
+ '%f', // total_charges
+ '%f', // total_discounts
+ '%f' // total_payments
+ )
+ );
+
+ } // If time isn't in reg_times
+ } // each recurrence times
+ } // have times for recurrence
+ } // each recurrence
+ } // Time specific and have times
+ } // have event data
+ } // have reg event ID
+
+ } else {
+ $reason = 'Unable to load registration event data or registration event not selected.';
+ }
+
+ $view = 'eventDashboard';
+
+ break;
+
+ case 'dashboard':
+ default:
+
+ // If doing alpha list
+ if (isset($_REQUEST['alpha'])) {
+ $actionData['request']['alpha'] = $_REQUEST['alpha'];
+ }
+
+ // If user clicked a page request then we need to check the savedAlpha value
+ if (isset($_REQUEST['savedAlpha']) && isset($_REQUEST['pageSelect'])) {
+ $actionData['request']['alpha'] = $_REQUEST['savedAlpha'];
+ }
+
+ if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) {
+ $alphaSelected = strtoupper($actionData['request']['alpha']);
+ $alphaWhere .= " AND T.event_name LIKE '$alphaSelected%'";
+ }
+
+ // Get full list for all other filters, but not filtered by alpha (that would be silly)
+ $alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected);
+
+ // Get count of reg event listed
+ $regEventsCount = $this->getStats($where);
+
+ // Get stats for number of registration events found matching current selection criteria (includes alpha selection)
+ $filteredRegEventsFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
+
+ // Get a current list of reg events
+ $listResult = $this->getSimpleRegEventsList($where.$alphaWhere, 'event_name', true, 'id', $start, $limit, true);
+
+ // Get paging results
+ $numbDisplayed = $listResult['returned'];
+ $lastDisplayed = $listResult['last'];
+ if ($start == 1) {
+ $prevStart = false;
+ } else {
+ $prevStart = $start - $limit;
+ if ($start < 1) {
+ $start = 1;
+ }
+ }
+ if ($listResult['returned'] == $limit) {
+ $nextStart = $start + $limit;
+ }
+
+ // since we're doing paging, we have to break out just the event data
+ $list = $listResult['list'];
+ unset($listResult);
+
+ // If we have list entries - even if it's an empty list
+ $success = true;
+ $haveRegEvents = false;
+ if ($list !== false) {
+
+ $success = true;
+
+ // If we have any entries
+ if (count($list) > 0) {
+ $haveRegEvents = true;
+ }
+ }
+
+ // Get full list of event names matching the current where clause for text search box
+ $namesList = $this->getSimpleRegEventsList($where);
+
+ $view = 'eventsDashboard';
break;
-
}
+ // If we have a valid account ID, save that for future use
+ if ($regEventID > 0) {
+ update_option('glmMembersDatabaseRegistrationsRegEventID', $regEventID);
+ }
// Compile template data
$templateData = array(
- 'haveEvent' => $haveEvent,
- 'eventID' => $eventID,
- 'haveRegEvent' => $haveRegEvent,
- 'regEventID' => $regEventID,
- 'regEvent' => $regEvent,
- 'regEventUpdated' => $regEventUpdated,
- 'regEventUpdateError' => $regEventUpdateError,
- 'regEventAdded' => $regEventAdded ,
- 'reason' => $reason
+ 'option' => $option,
+ 'regEventsCount' => $regEventsCount,
+ 'haveRegEvents' => $haveRegEvents,
+ 'regEvents' => $list,
+ 'alphaList' => $alphaList,
+ 'alphaSelected' => $alphaSelected,
+ 'numbDisplayed' => $numbDisplayed,
+ 'lastDisplayed' => $lastDisplayed,
+ 'paging' => $paging,
+ 'prevStart' => $prevStart,
+ 'nextStart' => $nextStart,
+ 'start' => $start,
+ 'limit' => $limit,
+ 'namesList' => $namesList,
+ 'textSearch' => $textSearch,
+ 'regEventID' => $regEventID,
+ 'regEvent' => $regEvent,
+ 'haveRegEvent' => $haveRegEvent,
+ 'haveRegEventRecurrences' => $haveRegEventRecurrences,
+ 'haveRegEventTimes' => $haveRegEventTimes,
+ 'regEventFirstTime' => $regEventFirstTime,
+ 'regEventLastTime' => $regEventLastTime,
+ 'regEventUpdated' => $regEventUpdated,
+ 'regEventUpdateError' => $regEventUpdateError,
+ 'regEventAdded' => $regEventAdded,
+ 'reason' => $reason
);
-
+
// Return status, any suggested view, and any data to controller
return array(
'status' => true,
'modelRedirect' => false,
- 'view' => 'admin/registrations/'.$template,
+ 'view' => 'admin/registrations/'.$view.'.html',
'data' => $templateData
);
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Admin Registrations Events Dashboard
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release index.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Registrations data abstract
-require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-
-class GlmMembersAdmin_registrations_index extends GlmDataRegistrationsRegEvent
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
- /**
- * Registrations Event ID
- *
- * @var $eventID
- * @access public
- */
- public $regEventID = false;
-
- /**
- * Constructor
- *
- * This contructor performs the work for this model. This model returns
- * an array containing the following.
- *
- * 'status'
- *
- * True if successfull and false if there was a fatal failure.
- *
- * 'view'
- *
- * A suggested view name that the contoller should use instead of the
- * default view for this model or false to indicate that the default view
- * should be used.
- *
- * 'data'
- *
- * Data that the model is returning for use in merging with the view to
- * produce output.
- *
- * @wpdb object WordPress database object
- *
- * @return array Array containing status, suggested view, and any data
- */
- public function __construct ($wpdb, $config)
- {
-
- // Save WordPress Database object
- $this->wpdb = $wpdb;
-
- // Save plugin configuration object
- $this->config = $config;
-
- /*
- * Run constructor for the REgistrations data class
- *
- * Note, the third parameter is a flag that indicates to the Contacts
- * data class that it should flag a group of fields as 'view_only'.
- */
- parent::__construct(false, false, true);
-
- }
-
- public function modelAction($actionData = false)
- {
-
- $where = ' true ';
- $alphaWhere = ' true ';
- $numbDisplayed = false;
- $lastDisplayed = false;
- $paging = true;
- $prevStart = false;
- $nextStart = false;
- $start = 1;
- $limit = 20; // Set to the number of listings per page
- $textSearch = false;
- $where = "TRUE";
- $alphaList = false;
- $alphaWhere = '';
- $alphaSelected = false;
- $haveRegEvents = false;
- $regEventsCount = false;
- $namesList = false;
-
- // If doing alpha list
- if (isset($_REQUEST['alpha'])) {
- $actionData['request']['alpha'] = $_REQUEST['alpha'];
- }
-
- // If user clicked a page request then we need to check the savedAlpha value
- if (isset($_REQUEST['savedAlpha']) && isset($_REQUEST['pageSelect'])) {
- $actionData['request']['alpha'] = $_REQUEST['savedAlpha'];
- }
-
- if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) {
- $alphaSelected = strtoupper($actionData['request']['alpha']);
- $alphaWhere .= " AND T.event_name LIKE '$alphaSelected%'";
- }
-
- // Get full list for all other filters, but not filtered by alpha (that would be silly)
- $alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected);
-
- // Get count of reg event listed
- $regEventsCount = $this->getStats($where);
-
- // Get stats for number of registration events found matching current selection criteria (includes alpha selection)
- $filteredRegEventsFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
-
- // Get a current list of reg events
- $listResult = $this->getSimpleRegEventsList($where.$alphaWhere, 'event_name', true, 'id', $start, $limit, true);
-
- // Get paging results
- $numbDisplayed = $listResult['returned'];
- $lastDisplayed = $listResult['last'];
- if ($start == 1) {
- $prevStart = false;
- } else {
- $prevStart = $start - $limit;
- if ($start < 1) {
- $start = 1;
- }
- }
- if ($listResult['returned'] == $limit) {
- $nextStart = $start + $limit;
- }
-
- // since we're doing paging, we have to break out just the event data
- $list = $listResult['list'];
- unset($listResult);
-
- // If we have list entries - even if it's an empty list
- $success = true;
- $haveRegEvents = false;
- if ($list !== false) {
-
- $success = true;
-
- // If we have any entries
- if (count($list) > 0) {
- $haveRegEvents = true;
- }
- }
-
- // Get full list of event names matching the current where clause for text search box
- $namesList = $this->getSimpleRegEventsList($where);
-
-
-
- $template = 'index.html';
-
-/*
-
- // Check for a text search
- if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search']) != '') {
-
- $textSearch = addslashes(filter_input(INPUT_POST, 'text_search', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
- $where .= " AND T.id in (
- SELECT DISTINCT(member)
- FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info
- WHERE member_name like '%$textSearch%'
- )";
- }
-
- // Check for "Pending Only
- if (isset($_REQUEST['filterPending'])) {
-
- // Refine search only to members with pending Info data
- $where .= " AND (
- SELECT COUNT(id)
- FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info I
- WHERE I.status = ".$this->config['status_numb']['Pending']."
- AND I.member = T.id
- )";
-
- $filterPending = true;
- $haveFilter = true;
- }
-
- // Check for "Featured Only
- if (isset($_REQUEST['filterFeatured'])) {
-
- // Refine search only to members with pending Info data
- $where .= " AND (
- SELECT COUNT(id)
- FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members I
- WHERE I.featured = 1
- AND I.id = T.id
-
- )";
- $filterFeatured = true;
- $haveFilter = true;
- }
-
- // If doing alpha list
- if (isset($_REQUEST['alpha'])) {
- $actionData['request']['alpha'] = $_REQUEST['alpha'];
- }
-
- $alphaList = false;
- $alphaWhere = '';
-
- $alphaSelected = false;
-
- // If user clicked a page request then we need to check the savedAlpha value
- if (isset($_REQUEST['savedAlpha']) && isset($_REQUEST['pageSelect'])) {
- $actionData['request']['alpha'] = $_REQUEST['savedAlpha'];
- }
-
- if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) {
- $alphaSelected = strtoupper($actionData['request']['alpha']);
- $alphaWhere .= " AND T.name LIKE '$alphaSelected%'";
- }
-
- // Get full list for all other filters, but not filtered by alpha (that would be silly)
- $alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected);
-
- $whereParts = apply_filters('glm-member-db-admin-search-query', $where);
- if ( is_array( $whereParts ) && count( $whereParts ) > 0 ) {
- $where .= ' AND '.implode(" AND ", $whereParts);
- $whereSep = ' AND ';
- }
-
- // Get count of members listed
- $memberCount = $this->getStats($where);
-
- // If the number of members is less than a page, don't do paging
- if ($memberCount <= $limit) {
- $paging = false;
- }
-
- // Get full list of names matching this where clause for search box
- $namesList = $this->getIdName($where);
-
- // Check if we're doing paging
- if (isset($_REQUEST['pageSelect'])) {
-
- // If request is for Next
- if ($_REQUEST['pageSelect'][0] == 'N') {
- $newStart = $_REQUEST['nextStart'] - 0;
-
- // Otherwise it must be Previous
- } else {
- $newStart = $_REQUEST['prevStart'] - 0;
- }
-
- if ($newStart > 0) {
- $start = $newStart;
- }
- }
-
- // Get stats for number of members found matching current selection criteria (includes alpha selection)
- $filteredMembersFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
-
- // Get a current list of members
- $listResult = $this->getSimpleMembersList($where.$alphaWhere, 'name', true, 'id', $start, $limit);
-
- // Get paging results
- $numbDisplayed = $listResult['returned'];
- $lastDisplayed = $listResult['last'];
- if ($start == 1) {
- $prevStart = false;
- } else {
- $prevStart = $start - $limit;
- if ($start < 1) {
- $start = 1;
- }
- }
- if ($listResult['returned'] == $limit) {
- $nextStart = $start + $limit;
- }
-
- // since we're doing paging, we have to break out just the member data
- $list = $listResult['list'];
- unset($listResult);
-
- // If we have list entries - even if it's an empty list
- $success = true;
- $haveMembers = false;
- if ($list !== false) {
-
- $success = true;
-
- // If we have any entries
- if (count($list) > 0) {
- $haveMembers = true;
- }
- }
-
- // Determine if current user can add, edit, delete member data
- // $canEdit = current_user_can('glm_members_edit');
-
- // Add a url for each member
- if ( isset( $list) && is_array( $list ) ) {
- foreach ($list as $member) {
- $list[$member['id']]['member_slug'] = sanitize_title($member['name']);
- }
- }
-
- // Compile template data
- $templateData = array(
- 'enable_members' => $enable_members,
- 'haveMembers' => $haveMembers,
- 'members' => $list,
- 'memberCount' => $memberCount,
- 'categories' => $categories,
- 'haveFilter' => $haveFilter,
- 'filterArchived' => $filterArchived,
- 'filterFeatured' => $filterFeatured,
- 'filterPending' => $filterPending,
- 'catSelected' => $catSelected,
- 'catSearchSelected' => $catSelectedString,
- 'alphaList' => $alphaList,
- 'alphaSelected' => $alphaSelected,
- 'numbDisplayed' => $numbDisplayed,
- 'lastDisplayed' => $lastDisplayed,
- 'paging' => $paging,
- 'prevStart' => $prevStart,
- 'nextStart' => $nextStart,
- 'start' => $start,
- 'limit' => $limit,
- 'namesList' => $namesList,
- 'textSearch' => $textSearch
- );
-*/
-
- // Compile template data
- $templateData = array(
- 'regEventsCount' => $regEventsCount,
- 'haveRegEvents' => $haveRegEvents,
- 'regEvents' => $list,
- 'alphaList' => $alphaList,
- 'alphaSelected' => $alphaSelected,
- 'numbDisplayed' => $numbDisplayed,
- 'lastDisplayed' => $lastDisplayed,
- 'paging' => $paging,
- 'prevStart' => $prevStart,
- 'nextStart' => $nextStart,
- 'start' => $start,
- 'limit' => $limit,
- 'namesList' => $namesList,
- 'textSearch' => $textSearch
- );
-
- // Return status, any suggested view, and any data to controller
- return array(
- 'status' => true,
- 'modelRedirect' => false,
- 'view' => 'admin/registrations/'.$template,
- 'data' => $templateData
- );
-
- }
-
-
-}
'Registrations',
'glm_members_members',
'glm-members-admin-menu-registrations-index',
- function() {$this->controller('registrations');}
+ function() {$this->controller('registrations', 'events');}
);
-/*
-add_submenu_page(
- 'glm-members-admin-menu-members',
- 'Registration Events Dashboard',
- ' Dashboard',
- 'glm_members_members',
- 'glm-members-admin-menu-registrations-index',
- function() {$this->controller('registrations', 'index');}
-);
-*/
add_submenu_page(
'glm-members-admin-menu-members',
'Selected Event',
- ' Selected Event',
+ ' Events',
'glm_members_members',
- 'glm-members-admin-menu-registrations-event',
- function() {$this->controller('registrations', 'event');}
+ 'glm-members-admin-menu-registrations-events',
+ function() {$this->controller('registrations', 'events');}
);
add_submenu_page(
),
'registrations' => array(
'index' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
- 'event' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+ 'events' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'requests' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'accounts' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
),
<tr class="alternate">
{/if}
<td>
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-event&option=requestDashboard&requestID={$req.id}">
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$req.id}">
{$reg.event_name}
</td>
<td>{$reg.event_datetime.datetime}</td>
+++ /dev/null
-{include file='admin/registrations/header.html'}
-
-<h1>Selected Event Dashboard</h1>
-
-<div class="glm-admin-table-inner glm-admin-table">
-
- {if $reason}
- <p class="glm-error">{$reason}</p>
- {/if}
-
- <h3>Event</h3>
- <div id="glm-admin-member-dashboard" class="glm-admin-table">
- {if $haveRegEvent}
-
- <div class="glm-row">
- <div class="glm-small-4 glm-left">
- <div class="glm-admin-table">
- <div class="glm-row">
- <div class="glm-small-12 glm-column">
- {$regEvent.event_name}
- </div>
- </div>
- </div>
- <div class="glm-admin-table">
- <div class="glm-row">
- <div class="glm-small-12 glm-column">
- <h4>Earliest Event Date:</h4>
- </div>
- <div class="glm-small-12 glm-column">
- {$regEventFirstTime.start_time.datetime}
- </div>
- </div>
- </div>
- <div class="glm-admin-table">
- <div class="glm-row">
- <div class="glm-small-12 glm-column">
- <h4>Latest Event Date:</h4>
- </div>
- <div class="glm-small-12 glm-column">
- {$regEventLastTime.start_time.datetime}
- </div>
- </div>
- </div>
- </div>
- <div class="glm-small-4 glm-left">
- <div class="glm-admin-table">
- <div class="glm-row">
- <div class="glm-small-12 glm-column">
- <h4>Event Code:</h4>
- </div>
- <div class="glm-small-12 glm-column">
- {$regEvent.event_code}
- </div>
- </div>
- </div>
- </div>
- {if apply_filters('glm_members_menu_members', true)}
- <div class="glm-small-4 glm-right">
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-event&option=edit®EventID={$regEvent.id}" class="button button-secondary glm-button glm-right">Edit Registration Event</a>
- </div>
- {/if}
- </div>
- {else}
- <h3>Did not find selected event.</h3>
- {/if}
- </div>
-</div>
-
-<div class="glm-admin-table-inner glm-admin-table">
- {if $haveRegEvent}
- <p><h3>Dates and Availability</h3></p>
- <table id="glm-table-calendar" class="glm-admin-table glm-event-table">
- <tr>
- <td>
- <div id="eventCalendar">(calendar loads here)</div>
- </td>
- </tr>
- </table>
- {else}
- <h3>Did not find selected event.</h3>
- {/if}
-
-</div>
-
-</div>
- <script type="text/javascript">
- jQuery(document).ready(function($) {
-
- var fullCalendarLoaded = false;
-
- /*
- * Initialize the Full Calendar
- */
- function initFullCalendar(){
- $('#eventCalendar').fullCalendar({
- {if $haveRegEventTimes}
- events: [
- {$sep = ''}
- {foreach $regEvent.recurrences as $r}
- {foreach $r['times'] as $t}
- {$sep}{
- title : 'Event Calendar',
- start : '{$t.start_time.datetime}',
- end : '{$t.end_time.datetime}',
- allday : {$t.all_day.value}
- }
- {$sep = ','}
- {/foreach}
- {/foreach}
- ],
- defaultDate : '{$regEventFirstTime.start_time.datetime}',
- timeFormat : 'h:mma',
- fixedWeekCount : false,
- eventClick: function(calEvent, jsEvent, view) {
- $("#occurrences").dialog();
- $(this).css('border-color', 'red');
- }
- {/if}
- });
- }
-
- 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).fadeIn(500).fadeOut(500);
-
- });
- </script>
-
-{include file='admin/footer.html'}
-
--- /dev/null
+{include file='admin/registrations/eventHeader.html'}
+
+<h1>Selected Event Dashboard</h1>
+
+<div class="glm-admin-table-inner glm-admin-table">
+
+ {if $reason}
+ <p class="glm-error">{$reason}</p>
+ {/if}
+
+ <h3>Event</h3>
+ <div id="glm-admin-member-dashboard" class="glm-admin-table">
+ {if $haveRegEvent}
+
+ <div class="glm-row">
+ <div class="glm-small-4 glm-left">
+ <div class="glm-admin-table">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ {$regEvent.event_name}
+ </div>
+ </div>
+ </div>
+ <div class="glm-admin-table">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <h4>Earliest Event Date:</h4>
+ </div>
+ <div class="glm-small-12 glm-column">
+ {$regEventFirstTime.start_time.datetime}
+ </div>
+ </div>
+ </div>
+ <div class="glm-admin-table">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <h4>Latest Event Date:</h4>
+ </div>
+ <div class="glm-small-12 glm-column">
+ {$regEventLastTime.start_time.datetime}
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="glm-small-4 glm-left">
+ <div class="glm-admin-table">
+ <div class="glm-row">
+ <div class="glm-small-12 glm-column">
+ <h4>Event Code:</h4>
+ </div>
+ <div class="glm-small-12 glm-column">
+ {$regEvent.event_code}
+ </div>
+ </div>
+ </div>
+ </div>
+ {if apply_filters('glm_members_menu_members', true)}
+ <div class="glm-small-4 glm-right">
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=edit®EventID={$regEvent.id}" class="button button-secondary glm-button glm-right">Edit Registration Event</a>
+ </div>
+ {/if}
+ </div>
+ {else}
+ <h3>Did not find selected event.</h3>
+ {/if}
+ </div>
+</div>
+
+<div class="glm-admin-table-inner glm-admin-table">
+ {if $haveRegEvent}
+ <p><h3>Dates and Availability</h3></p>
+ <table id="glm-table-calendar" class="glm-admin-table glm-event-table">
+ <tr>
+ <td>
+ <div id="eventCalendar">(calendar loads here)</div>
+ </td>
+ </tr>
+ </table>
+ {else}
+ <h3>Did not find selected event.</h3>
+ {/if}
+
+</div>
+
+</div>
+ <script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+ var fullCalendarLoaded = false;
+
+ /*
+ * Initialize the Full Calendar
+ */
+ function initFullCalendar(){
+ $('#eventCalendar').fullCalendar({
+ {if $haveRegEventTimes}
+ events: [
+ {$sep = ''}
+ {foreach $regEvent.recurrences as $r}
+ {foreach $r['times'] as $t}
+ {$sep}{
+ title : 'Event Calendar',
+ start : '{$t.start_time.datetime}',
+ end : '{$t.end_time.datetime}',
+ allday : {$t.all_day.value}
+ }
+ {$sep = ','}
+ {/foreach}
+ {/foreach}
+ ],
+ defaultDate : '{$regEventFirstTime.start_time.datetime}',
+ timeFormat : 'h:mma',
+ fixedWeekCount : false,
+ eventClick: function(calEvent, jsEvent, view) {
+ $("#occurrences").dialog();
+ $(this).css('border-color', 'red');
+ }
+ {/if}
+ });
+ }
+
+ 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).fadeIn(500).fadeOut(500);
+
+ });
+ </script>
+
+{include file='admin/footer.html'}
+
-{include file='admin/registrations/header.html'}
+{include file='admin/registrations/eventHeader.html'}
<h2>
Registrations Event Edit
{else}
<h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
- <a id="glm-registrations-settings" data-show-table="glm-table-settings" class="glm-registrations-tab nav-tab">Event Registration Settings</a>
- <a id="glm-registrations-levels" data-show-table="glm-table-levels" class="glm-registrations-tab nav-tab">Registration Levels & Charges</a>
+ <a onClick="return false;" class="nav-tab nav-tab-active">Edit Registration Settings</a>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=configureEvent®EventID={$regEventID}" class="nav-tab">Registration Levels & Charges</a>
</h2>
NEED TO ADD TESTS FOR CHANGES IN INPUT<br>
- {**** General Settings for Event ****}
- {include file='admin/registrations/eventEditSettings.html'}
-
- {**** Registration Levels and Charges for Event ****}
- {include file='admin/registrations/eventEditLevels.html'}
+ <table id="glm-table-settings" class="glm-registrations-table">
+
+ <tr>
+ <th {if $regEvent.fieldRequired.event_name}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Name</th>
+ <td {if $regEvent.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
+ <input type="text" name="event_name" value="{$regEvent.fieldData.event_name}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.event_name}<p>{$regEvent.fieldFail.event_name}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.event_code}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Registration Code</th>
+ <td {if $regEvent.fieldFail.event_code}class="glm-form-bad-input" data-tabid="glm-event_code"{/if}>
+ <input type="text" name="event_code" value="{$regEvent.fieldData.event_code}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.event_code}<p>{$regEvent.fieldFail.event_code}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.notify_email}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notify E-Mail Address</th>
+ <td {if $regEvent.fieldFail.notify_email}class="glm-form-bad-input" data-tabid="glm-notify_email"{/if}>
+ <input type="text" name="notify_email" value="{$regEvent.fieldData.notify_email}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.notify_email}<p>{$regEvent.fieldFail.notify_email}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.admin_active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Admin Active</th>
+ <td {if $regEvent.fieldFail.admin_active}class="glm-form-bad-input" data-tabid="glm-admin_active"{/if}>
+ <input type="checkbox" name="active" {if $regEvent.fieldData.admin_active.value} checked{/if}>
+ {if $regEvent.fieldFail.admin_active}<p>{$regEvent.fieldFail.admin_active}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.time_specific}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Date/Time Specific Registrations</th>
+ <td {if $regEvent.fieldFail.time_specific}class="glm-form-bad-input" data-tabid="glm-time_specific"{/if}>
+ <input type="checkbox" name="time_specific" {if $regEvent.fieldData.time_specific.value} checked{/if}>
+ Check this box for events where registrations are for specific dates and times.
+ {if $regEvent.fieldFail.time_specific}<p>{$regEvent.fieldFail.time_specific}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Registrations Active</th>
+ <td {if $regEvent.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
+ <input type="checkbox" name="active" {if $regEvent.fieldData.active.value} checked{/if}>
+ {if $regEvent.fieldFail.active}<p>{$regEvent.fieldFail.active}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.attendees}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Multiple Attendees per Submission</th>
+ <td {if $regEvent.fieldFail.attendees}class="glm-form-bad-input" data-tabid="glm-attendees"{/if}>
+ <input type="checkbox" name="active" {if $regEvent.fieldData.attendees.value} checked{/if}>
+ {if $regEvent.fieldFail.attendees}<p>{$regEvent.fieldFail.attendees}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.attendee_max}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees</th>
+ <td {if $regEvent.fieldFail.attendee_max}class="glm-form-bad-input" data-tabid="glm-attendee_max"{/if}>
+ Set to 0 to permit an unlimited number of attendees for this event.<br>
+ <input type="text" name="attendee_max" value="{$regEvent.fieldData.attendee_max}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.attendee_max}<p>{$regEvent.fieldFail.attendee_max}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.attendee_max_per_reg}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees Per Submission</th>
+ <td {if $regEvent.fieldFail.attendee_max_per_reg}class="glm-form-bad-input" data-tabid="glm-attendee_max_per_reg"{/if}>
+ Set to 0 for to permit a user to register an unlimited number of attendees for this event at one time.<br>
+ <input type="text" name="attendee_max_per_reg" value="{$regEvent.fieldData.attendee_max_per_reg}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.attendee_max_per_reg}<p>{$regEvent.fieldFail.attendee_max_per_reg}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.reg_hold_minutes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Attendees Hold Time (minutes)</th>
+ <td {if $regEvent.fieldFail.reg_hold_minutes}class="glm-form-bad-input" data-tabid="glm-reg_hold_minutes"{/if}>
+ When an attendee is added to a registration request, the system will hold that attendee "slot" for this number of minutes
+ before releasing it for others to register. After the attendee slot is released, the slot will be requested again each
+ time the selection, cart, or checkout pages are loaded. If there is a slot available at that time, it will again be held
+ for this amount of time.<br>
+ <input type="text" name="reg_hold_minutes" value="{$regEvent.fieldData.reg_hold_minutes}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.cart_hold_days}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Cart Hold (days)</th>
+ <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
+ If the user has registrations entered but has not yet checked out, their "cart" will be maintained for this number of days.
+ After that time, the card will be deleted. If a user has established a registrations account (entered registrations or
+ have been registered before, the user will be able log in and continue with the cart up to this number of days.<br>
+ <input type="text" name="cart_hold_days" value="{$regEvent.fieldData.cart_hold_days}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.registration_account_options}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Account Options</th>
+ <td {if $regEvent.fieldFail.registration_account_options}class="glm-form-bad-input" data-tabid="glm-registration_account_options"{/if}>
+ {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v}
+ <input type="checkbox" name="registration_account_options[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+ {/foreach}
+ {if $regEvent.fieldFail.registration_account_options}<p>{$regEvent.fieldFail.registration_account_options}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Payment Methods</th>
+ <td {if $regEvent.fieldFail.payment_methods}class="glm-form-bad-input" data-tabid="glm-payment_methods"{/if}>
+ Checking a payment method makes it available for use by regular users at checkout.<br>
+ {foreach from=$regEvent.fieldData.payment_methods.bitmap item=v}
+ <input type="checkbox" name="payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+ {/foreach}
+ {if $regEvent.fieldFail.payment_methods}<p>{$regEvent.fieldFail.payment_methods}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.restricted_payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Restricted Payment Methods</th>
+ <td {if $regEvent.fieldFail.restricted_payment_methods}class="glm-form-bad-input" data-tabid="glm-restricted_payment_methods"{/if}>
+ Restricted payment methods are those only available to logged in administrative users. For example, selecting "No Charge" here
+ will allow administrative users to check out without having to provide any payment information.<br>
+ {foreach from=$regEvent.fieldData.restricted_payment_methods.bitmap item=v}
+ <input type="checkbox" name="restricted_payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
+ {/foreach}
+ {if $regEvent.fieldFail.restricted_payment_methods}<p>{$regEvent.fieldFail.restricted_payment_methods}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.terms}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Terms and Conditions for Registration</th>
+ <td {if $regEvent.fieldFail.terms}class="glm-form-bad-input" data-tabid="glm-terms"{/if}>
+ <textarea name="terms" class="glm-form-textarea">{$regEvent.fieldData.terms}</textarea>
+ {if $regEvent.fieldFail.terms}
+ <p>{$regEvent.fieldFail.terms}</p>
+ {/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.reg_file}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File</th>
+ <td {if $regEvent.fieldFail.reg_file}class="glm-form-bad-input"{/if}>
+ {if $regEvent.fieldData.reg_file}
+ <span class="glm-right">Replace this file:</b> <input type="file" name="reg_file_new"></span>
+ <a href="{$glmPluginMediaUrl}/files/{$regEvent.fieldData.reg_file}" target="event_file">{$regEvent.fieldData.reg_file}</a>
+ <input type="checkbox" name="reg_file_delete"> Delete File<br>
+ {else}
+ New file:</b> <input type="file" name="reg_file_new">
+ {/if}
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.reg_file_title}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File Title</th>
+ <td {if $regEvent.fieldFail.reg_file_title}class="glm-form-bad-input" data-tabid="glm-reg_file_title"{/if}>
+ <input type="text" name="reg_file_title" value="{$regEvent.fieldData.reg_file_title}" class="glm-form-text-input-medium">
+ {if $regEvent.fieldFail.reg_file_title}<p>{$regEvent.fieldFail.reg_file_title}</p>{/if}<br>
+ </td>
+ </tr>
+ <tr>
+ <th {if $regEvent.fieldRequired.notes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notes</th>
+ <td {if $regEvent.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
+ <textarea name="notes" class="glm-form-textarea">{$regEvent.fieldData.notes}</textarea>
+ {if $regEvent.fieldFail.notes}
+ <p>{$regEvent.fieldFail.notes}</p>
+ {/if}<br>
+ </td>
+ </tr>
+ </table>
<p><input id="updateRegEvent" type="submit" value="Update Registrations for this event"></p>
<script type="text/javascript">
jQuery(document).ready(function($) {
- /*
- * Edit area tabs
- */
- $('.glm-registrations-tab').click( function() {
- glmSetupAreaTab($(this));
- });
-
- // Do inital setup on load for first tab
- glmSetupAreaTab($('#glm-registrations-settings'));
-
- // Setup edit area selected
- function glmSetupAreaTab(t) {
-
- // Clear table highlights and hide all tables
- $('.glm-registrations-tab').removeClass('nav-tab-active');
- $('.glm-registrations-table').addClass('glm-hidden');
-
- // Highlight selected tab
- t.addClass('nav-tab-active');
-
- // Show selected table
- var table = t.attr('data-show-table');
- $('#' + table).removeClass('glm-hidden');
-
-
- if ({$settings.memb_info_location}) {
-
- if (table == 'glm-table-profile') {
- initMap();
- }
-
- }
-
- }
-
// 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);
+{include file='admin/registrations/eventHeader.html'}
+
+ <h2>
+ Registrations Event Edit
+
+
+ {if $regEventUpdated}<span class="glm-notice glm-flash-updated">Registration Event Updated</span>{/if}
+ {if $regEventUpdateError}<span class="glm-error glm-flash-updated">Registration Event Update Error</span>{/if}
+ {if $regEventAdded}<span class="glm-notice glm-flash-updated">Registration Event Added</span>{/if}
+
+ </h2>
-{**** Registration Levels and Charges for Event ****}
+{if $reason}
+ <p class="glm-error">{$reason}</p>
+{else}
- <table id="glm-table-levels" class="glm-registrations-table">
+ <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=edit®EventID={$regEventID}" class="nav-tab">Edit Registration Settings</a>
+ <a onClick="return false;" class="nav-tab nav-tab-active">Registration Levels & Charges</a>
+ </h2>
-{* Event Registration App - Backbone.js *}
-<div id="eventapp"></div>
-{* Underscore Templates for the Event Registration App *}
-{literal}
-<script type="text/template" id="regEvent-template">
- <h2><%= event_name %></h2>
- <div class="glm-reg-compcode-entry">
- <input type="text" placeholder="Enter Comp Code Here" />
- </div>
- <p> - event description - </p>
- <div class="glm-reg-entryforms clearfix">
- <div class="glm-reg-dates">
- <h4>Pick your registration dates</h4>
- <input type="date" placeholder="Enter Date" />
- <input type="text" placeholder="Enter Time" />
- </div>
- <div class="glm-reg-submit">
- <input type="submit" value="Continue to Cart" />
- </div>
- </div>
-</script>
-<script type="text/template" id="regClass-template">
- <h3><%= name %></h3>
- <p><%= descr %></p>
- <div class="registrant-add clearfix">
- <input type="text" class="addName" placeholder="Enter Name">
- <input type="text" class="addEmail" placeholder="Enter Email Address">
- <input type="submit" class="addRegistrant" value="Add">
- </div>
-</script>
-{/literal}
-<div class="glm-reg-event-list" id="regApp">
- <div class="glm-reg-account">
- <a class="glm-reg-account-login" id="appLogin">Login</a>
- </div>
-</div>
-{* Bootstrap the models needed on page load *}
-{* Need to have RegEvent model created *}
-{* And create the RegClasses collection *}
-<script>
-var app = {
- Models: {},
- Collections: {},
- Views: {}
-};
-jQuery(function($){
-// app.Models.regEvent = new app.Models.RegEvent;
-// app.Models.regEvent.set( {$regEventJSON} );
-// app.Models.regEvent.setClasses( {$regClassesJSON} );
-// new app.Views.App();
-});
-</script>
+{/if} <!-- no problem reasons -->
+
+ <script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+
+ });
+ </script>
+
+{include file='admin/footer.html'}
+++ /dev/null
-
-{**** General Settings for Event ****}
-
- <table id="glm-table-settings" class="glm-registrations-table">
-
- <tr>
- <th {if $regEvent.fieldRequired.event_name}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Name</th>
- <td {if $regEvent.fieldFail.event_name}class="glm-form-bad-input" data-tabid="glm-event_name"{/if}>
- <input type="text" name="event_name" value="{$regEvent.fieldData.event_name}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.event_name}<p>{$regEvent.fieldFail.event_name}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.event_code}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Event Registration Code</th>
- <td {if $regEvent.fieldFail.event_code}class="glm-form-bad-input" data-tabid="glm-event_code"{/if}>
- <input type="text" name="event_code" value="{$regEvent.fieldData.event_code}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.event_code}<p>{$regEvent.fieldFail.event_code}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.notify_email}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notify E-Mail Address</th>
- <td {if $regEvent.fieldFail.notify_email}class="glm-form-bad-input" data-tabid="glm-notify_email"{/if}>
- <input type="text" name="notify_email" value="{$regEvent.fieldData.notify_email}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.notify_email}<p>{$regEvent.fieldFail.notify_email}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.admin_active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Admin Active</th>
- <td {if $regEvent.fieldFail.admin_active}class="glm-form-bad-input" data-tabid="glm-admin_active"{/if}>
- <input type="checkbox" name="active" {if $regEvent.fieldData.admin_active.value} checked{/if}>
- {if $regEvent.fieldFail.admin_active}<p>{$regEvent.fieldFail.admin_active}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.time_specific}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Date/Time Specific Registrations</th>
- <td {if $regEvent.fieldFail.time_specific}class="glm-form-bad-input" data-tabid="glm-time_specific"{/if}>
- <input type="checkbox" name="time_specific" {if $regEvent.fieldData.time_specific.value} checked{/if}>
- Check this box for events where registrations are for specific dates and times.
- {if $regEvent.fieldFail.time_specific}<p>{$regEvent.fieldFail.time_specific}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.active}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Registrations Active</th>
- <td {if $regEvent.fieldFail.active}class="glm-form-bad-input" data-tabid="glm-active"{/if}>
- <input type="checkbox" name="active" {if $regEvent.fieldData.active.value} checked{/if}>
- {if $regEvent.fieldFail.active}<p>{$regEvent.fieldFail.active}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.attendees}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Multiple Attendees per Submission</th>
- <td {if $regEvent.fieldFail.attendees}class="glm-form-bad-input" data-tabid="glm-attendees"{/if}>
- <input type="checkbox" name="active" {if $regEvent.fieldData.attendees.value} checked{/if}>
- {if $regEvent.fieldFail.attendees}<p>{$regEvent.fieldFail.attendees}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.attendee_max}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees</th>
- <td {if $regEvent.fieldFail.attendee_max}class="glm-form-bad-input" data-tabid="glm-attendee_max"{/if}>
- Set to 0 to permit an unlimited number of attendees for this event.<br>
- <input type="text" name="attendee_max" value="{$regEvent.fieldData.attendee_max}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.attendee_max}<p>{$regEvent.fieldFail.attendee_max}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.attendee_max_per_reg}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Maximum # of Attendees Per Submission</th>
- <td {if $regEvent.fieldFail.attendee_max_per_reg}class="glm-form-bad-input" data-tabid="glm-attendee_max_per_reg"{/if}>
- Set to 0 for to permit a user to register an unlimited number of attendees for this event at one time.<br>
- <input type="text" name="attendee_max_per_reg" value="{$regEvent.fieldData.attendee_max_per_reg}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.attendee_max_per_reg}<p>{$regEvent.fieldFail.attendee_max_per_reg}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.reg_hold_minutes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Attendees Hold Time (minutes)</th>
- <td {if $regEvent.fieldFail.reg_hold_minutes}class="glm-form-bad-input" data-tabid="glm-reg_hold_minutes"{/if}>
- When an attendee is added to a registration request, the system will hold that attendee "slot" for this number of minutes
- before releasing it for others to register. After the attendee slot is released, the slot will be requested again each
- time the selection, cart, or checkout pages are loaded. If there is a slot available at that time, it will again be held
- for this amount of time.<br>
- <input type="text" name="reg_hold_minutes" value="{$regEvent.fieldData.reg_hold_minutes}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.reg_hold_minutes}<p>{$regEvent.fieldFail.reg_hold_minutes}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.cart_hold_days}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Cart Hold (days)</th>
- <td {if $regEvent.fieldFail.cart_hold_days}class="glm-form-bad-input" data-tabid="glm-cart_hold_days"{/if}>
- If the user has registrations entered but has not yet checked out, their "cart" will be maintained for this number of days.
- After that time, the card will be deleted. If a user has established a registrations account (entered registrations or
- have been registered before, the user will be able log in and continue with the cart up to this number of days.<br>
- <input type="text" name="cart_hold_days" value="{$regEvent.fieldData.cart_hold_days}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.cart_hold_days}<p>{$regEvent.fieldFail.cart_hold_days}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.registration_account_options}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Account Options</th>
- <td {if $regEvent.fieldFail.registration_account_options}class="glm-form-bad-input" data-tabid="glm-registration_account_options"{/if}>
- {foreach from=$regEvent.fieldData.registration_account_options.bitmap item=v}
- <input type="checkbox" name="registration_account_options[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
- {/foreach}
- {if $regEvent.fieldFail.registration_account_options}<p>{$regEvent.fieldFail.registration_account_options}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Payment Methods</th>
- <td {if $regEvent.fieldFail.payment_methods}class="glm-form-bad-input" data-tabid="glm-payment_methods"{/if}>
- Checking a payment method makes it available for use by regular users at checkout.<br>
- {foreach from=$regEvent.fieldData.payment_methods.bitmap item=v}
- <input type="checkbox" name="payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
- {/foreach}
- {if $regEvent.fieldFail.payment_methods}<p>{$regEvent.fieldFail.payment_methods}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.restricted_payment_methods}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Restricted Payment Methods</th>
- <td {if $regEvent.fieldFail.restricted_payment_methods}class="glm-form-bad-input" data-tabid="glm-restricted_payment_methods"{/if}>
- Restricted payment methods are those only available to logged in administrative users. For example, selecting "No Charge" here
- will allow administrative users to check out without having to provide any payment information.<br>
- {foreach from=$regEvent.fieldData.restricted_payment_methods.bitmap item=v}
- <input type="checkbox" name="restricted_payment_methods[{$v.value}]" value="{$v.value}"{if $v.default} checked{/if}> {$v.name}<br>
- {/foreach}
- {if $regEvent.fieldFail.restricted_payment_methods}<p>{$regEvent.fieldFail.restricted_payment_methods}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.terms}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Terms and Conditions for Registration</th>
- <td {if $regEvent.fieldFail.terms}class="glm-form-bad-input" data-tabid="glm-terms"{/if}>
- <textarea name="terms" class="glm-form-textarea">{$regEvent.fieldData.terms}</textarea>
- {if $regEvent.fieldFail.terms}
- <p>{$regEvent.fieldFail.terms}</p>
- {/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.reg_file}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File</th>
- <td {if $regEvent.fieldFail.reg_file}class="glm-form-bad-input"{/if}>
- {if $regEvent.fieldData.reg_file}
- <span class="glm-right">Replace this file:</b> <input type="file" name="reg_file_new"></span>
- <a href="{$glmPluginMediaUrl}/files/{$regEvent.fieldData.reg_file}" target="event_file">{$regEvent.fieldData.reg_file}</a>
- <input type="checkbox" name="reg_file_delete"> Delete File<br>
- {else}
- New file:</b> <input type="file" name="reg_file_new">
- {/if}
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.reg_file_title}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>File Title</th>
- <td {if $regEvent.fieldFail.reg_file_title}class="glm-form-bad-input" data-tabid="glm-reg_file_title"{/if}>
- <input type="text" name="reg_file_title" value="{$regEvent.fieldData.reg_file_title}" class="glm-form-text-input-medium">
- {if $regEvent.fieldFail.reg_file_title}<p>{$regEvent.fieldFail.reg_file_title}</p>{/if}<br>
- </td>
- </tr>
- <tr>
- <th {if $regEvent.fieldRequired.notes}class="glm-required-nowrap"{else}class="glm-nowrap"{/if}>Notes</th>
- <td {if $regEvent.fieldFail.notes}class="glm-form-bad-input" data-tabid="glm-notes"{/if}>
- <textarea name="notes" class="glm-form-textarea">{$regEvent.fieldData.notes}</textarea>
- {if $regEvent.fieldFail.notes}
- <p>{$regEvent.fieldFail.notes}</p>
- {/if}<br>
- </td>
- </tr>
- </table>
--- /dev/null
+<div class="wrap">
+<h2>Event Registrations</h2>
+<h2 class="nav-tab-wrapper">
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events" class="nav-tab{if $option==dashboard} nav-tab-active{/if}">Dashboard</a>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard" class="nav-tab{if $option==eventDashboard} nav-tab-active{/if}">Selected Event</a>
+</h2>
+<div id="glm-admin-content-container">
--- /dev/null
+{include file='admin/registrations/eventHeader.html'}
+
+<h1 class="glm-admin-table-header">Registrations Dashboard</h1>
+
+<div class="glm-admin-table-inner glm-admin-table">
+ <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
+ <input type="hidden" name="glm_action" value="list">
+ <input type="hidden" name="prevStart" value="{$prevStart}">
+ <input type="hidden" name="nextStart" value="{$nextStart}">
+ <input type="hidden" name="limit" value="{$limit}">
+ <input type="hidden" name="savedAlpha" value="{$alphaSelected}">
+
+ <p><h2 class="glm-admin-table-header">List of Registration Events</h2></p>
+
+ <div class="glm-row">
+ <b>Text Search: </b><input class="glmRegEventsSearch" type="text" name="text_search" id="autoTest">
+ <input type="submit" value="Submit" style="margin-right: 2em;">
+ </div>
+
+ <p><b>Total found:</b> {$regEventsCount} </p>
+
+ <br clear="all">
+
+ <!-- Add Reg Event Type Button and Dialog Box -->
+
+ {if $paging}
+ <input type="Submit" name="pageSelect" value="Previous {$limit} Registration Events" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+ <input type="Submit" name="pageSelect" value="Next {$limit} Registration Events" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+ {/if}
+
+ <div class="glm-alpha-links">
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-list&glm_action=list&textSearch={$textSearch}" class="glm-alpha-link{if !$alphaSelected} glm-alpha-link-selected{/if}">All</a>
+ {foreach $alphaList as $a}
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-list&glm_action=list&alpha={$a.alpha}&textSearch={$textSearch}" class="glm-alpha-link{if $a.default} glm-alpha-link-selected{/if}">{$a.alpha}</a>
+ {/foreach}
+ </div>
+
+ <table class="wp-list-table striped glm-admin-table-single">
+ <thead>
+ <tr>
+ <th>ID</th>
+ <th>Event Name</th>
+ </tr>
+ </thead>
+ <tbody>
+ {if $haveRegEvents}
+ {assign var="i" value="0"}
+ {foreach $regEvents as $r}
+ {if $i++ is odd by 1}
+ <tr>
+ {else}
+ <tr class="alternate">
+ {/if}
+ <td style="width: 50px;">
+ {$r.id}
+ </td>
+ <td>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$r.id}">{$r.event_name}</a>
+ </td>
+ </tr>
+ {/foreach}
+ {else}
+ <tr class="alternate"><td colspan="2">(no registration events listed)</td></tr>
+ {/if}
+ </tbody>
+ </table>
+
+ {if $paging}
+ <input type="Submit" name="pageSelect" value="Previous {$limit} Events" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
+ <input type="Submit" name="pageSelect" value="Next {$limit} Events" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
+ {/if}
+
+ </form>
+</div>
+<script type="text/javascript">
+ jQuery(document).ready(function($) {
+
+ // Filter triggers
+ $(".listFilter" ).change( function() {
+
+ var filter = '';
+
+ // Check for archived filter
+ if ($("#filterArchived").attr('checked')) {
+ filter += '&filterArchived=true';
+ }
+
+ // Check for pending data filter
+ if ($("#filterPending").attr('checked')) {
+ filter += '&filterPending=true';
+ }
+
+ // Check for featured data filter
+ if ($("#filterFeatured").attr('checked')) {
+ filter += '&filterFeatured=true';
+ }
+
+ window.location.href = "{$thisUrl}?page={$thisPage}&glm_action=list" + filter;
+
+ return false;
+ });
+
+ /*
+ *
+ * Do autocomplete search for registration events
+ * label: What will be searched
+ * value: What will be displayed when selected
+ * id: Member id added so we can go to the member while showing what was selected
+ * Also note that autocomplete does not properly render HTML codes, so we
+ * "unescape" them for HTML in Smarty.
+ */
+
+ var availableTags = [
+ {foreach $namesList as $m}
+ { label: "{$m.event_name|unescape:'html'|replace:'"':''}", value: "{$m.event_name|unescape:'html'|replace:'"':''}", id: '{$m.id}' },
+ {/foreach}
+ ];
+
+ // Autocomplete for list Text Search
+ $( ".glmRegEventsSearch" ).autocomplete({
+
+ source: availableTags,
+ html: true,
+ position: { my : "right top", at: "right bottom" },
+ select: function( event, ui ) {
+ var regEventID = ui.item.id;
+ window.location.replace("{$adminUrl}?page=glm-members-admin-menu-registrations-event®EventID=" + regEventID );
+ },
+ response: function(event, ui) {
+ if (!ui.content.length) {
+ var noResult = { value:"",label:"No results found" };
+ ui.content.push(noResult);
+ }
+ }
+ });
+
+ // Restrict autocomplete list to a certain height with scrollbar
+ $('.ui-autocomplete').css('height','200px').css('overflow-y','scroll');
+
+ // Expand multi-select on hover
+ $('#filterCategories').multiselect();
+ $('#exportFilterCategories').multiselect();
+
+ });
+</script>
+
+
+{include file='admin/footer.html'}
+++ /dev/null
-<div class="wrap">
- <h2>Event Registrations</h2>
- <div id="glm-admin-content-container">
-
-
+++ /dev/null
-{include file='admin/registrations/header.html'}
-
-<h1 class="glm-admin-table-header">Registrations Dashboard</h1>
-
-<div class="glm-admin-table-inner glm-admin-table">
- <form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
- <input type="hidden" name="glm_action" value="list">
- <input type="hidden" name="prevStart" value="{$prevStart}">
- <input type="hidden" name="nextStart" value="{$nextStart}">
- <input type="hidden" name="limit" value="{$limit}">
- <input type="hidden" name="savedAlpha" value="{$alphaSelected}">
-
- <p><h2 class="glm-admin-table-header">List of Registration Events</h2></p>
-
- <div class="glm-row">
- <b>Text Search: </b><input class="glmRegEventsSearch" type="text" name="text_search" id="autoTest">
- <input type="submit" value="Submit" style="margin-right: 2em;">
- </div>
-
- <p><b>Total found:</b> {$regEventsCount} </p>
-
- <br clear="all">
-
- <!-- Add Reg Event Type Button and Dialog Box -->
-
- {if $paging}
- <input type="Submit" name="pageSelect" value="Previous {$limit} Registration Events" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
- <input type="Submit" name="pageSelect" value="Next {$limit} Registration Events" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
- {/if}
-
- <div class="glm-alpha-links">
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-list&glm_action=list&textSearch={$textSearch}" class="glm-alpha-link{if !$alphaSelected} glm-alpha-link-selected{/if}">All</a>
- {foreach $alphaList as $a}
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-list&glm_action=list&alpha={$a.alpha}&textSearch={$textSearch}" class="glm-alpha-link{if $a.default} glm-alpha-link-selected{/if}">{$a.alpha}</a>
- {/foreach}
- </div>
-
- <table class="wp-list-table striped glm-admin-table-single">
- <thead>
- <tr>
- <th>ID</th>
- <th>Event Name</th>
- </tr>
- </thead>
- <tbody>
- {if $haveRegEvents}
- {assign var="i" value="0"}
- {foreach $regEvents as $r}
- {if $i++ is odd by 1}
- <tr>
- {else}
- <tr class="alternate">
- {/if}
- <td style="width: 50px;">
- {$r.id}
- </td>
- <td>
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-event®EventID={$r.id}">{$r.event_name}</a>
- </td>
- </tr>
- {/foreach}
- {else}
- <tr class="alternate"><td colspan="2">(no registration events listed)</td></tr>
- {/if}
- </tbody>
- </table>
-
- {if $paging}
- <input type="Submit" name="pageSelect" value="Previous {$limit} Events" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
- <input type="Submit" name="pageSelect" value="Next {$limit} Events" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
- {/if}
-
- </form>
-</div>
-<script type="text/javascript">
- jQuery(document).ready(function($) {
-
- // Filter triggers
- $(".listFilter" ).change( function() {
-
- var filter = '';
-
- // Check for archived filter
- if ($("#filterArchived").attr('checked')) {
- filter += '&filterArchived=true';
- }
-
- // Check for pending data filter
- if ($("#filterPending").attr('checked')) {
- filter += '&filterPending=true';
- }
-
- // Check for featured data filter
- if ($("#filterFeatured").attr('checked')) {
- filter += '&filterFeatured=true';
- }
-
- window.location.href = "{$thisUrl}?page={$thisPage}&glm_action=list" + filter;
-
- return false;
- });
-
- /*
- *
- * Do autocomplete search for registration events
- * label: What will be searched
- * value: What will be displayed when selected
- * id: Member id added so we can go to the member while showing what was selected
- * Also note that autocomplete does not properly render HTML codes, so we
- * "unescape" them for HTML in Smarty.
- */
-
- var availableTags = [
- {foreach $namesList as $m}
- { label: "{$m.event_name|unescape:'html'|replace:'"':''}", value: "{$m.event_name|unescape:'html'|replace:'"':''}", id: '{$m.id}' },
- {/foreach}
- ];
-
- // Autocomplete for list Text Search
- $( ".glmRegEventsSearch" ).autocomplete({
-
- source: availableTags,
- html: true,
- position: { my : "right top", at: "right bottom" },
- select: function( event, ui ) {
- var regEventID = ui.item.id;
- window.location.replace("{$adminUrl}?page=glm-members-admin-menu-registrations-event®EventID=" + regEventID );
- },
- response: function(event, ui) {
- if (!ui.content.length) {
- var noResult = { value:"",label:"No results found" };
- ui.content.push(noResult);
- }
- }
- });
-
- // Restrict autocomplete list to a certain height with scrollbar
- $('.ui-autocomplete').css('height','200px').css('overflow-y','scroll');
-
- // Expand multi-select on hover
- $('#filterCategories').multiselect();
- $('#exportFilterCategories').multiselect();
-
- });
-</script>
-
-
-{include file='admin/footer.html'}