From: Chuck Scott Date: Fri, 8 Sep 2017 14:30:35 +0000 (-0400) Subject: Removed copies of old admin registrations models that are no longer in use. X-Git-Tag: v1.0.0^2~423 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e776a7ceb48a6f36d49037fb1d50e9c44a607c69;p=WP-Plugins%2Fglm-member-db-registrations.git Removed copies of old admin registrations models that are no longer in use. Cleaned up a number of invalid parameter references in both models and views for registrations admin. --- diff --git a/css/admin.css b/css/admin.css index 59ae731..0cb0eab 100644 --- a/css/admin.css +++ b/css/admin.css @@ -3,4 +3,4 @@ text-align: center; margin-right: 5px; display: inline-block; -} \ No newline at end of file +} diff --git a/models/admin/registrations/dashboard-SAVE.php b/models/admin/registrations/dashboard-SAVE.php deleted file mode 100644 index 88678ed..0000000 --- a/models/admin/registrations/dashboard-SAVE.php +++ /dev/null @@ -1,280 +0,0 @@ - - * @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 - ); - - } - - -} diff --git a/models/admin/registrations/event-SAVE.php b/models/admin/registrations/event-SAVE.php deleted file mode 100644 index 32fc106..0000000 --- a/models/admin/registrations/event-SAVE.php +++ /dev/null @@ -1,385 +0,0 @@ - - * @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 "
".print_r($templateData,1)."
"; - - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/registrations/'.$template, - 'data' => $templateData - ); - - } - - -} diff --git a/models/admin/registrations/events-SAVE.php b/models/admin/registrations/events-SAVE.php deleted file mode 100644 index b1bbe7e..0000000 --- a/models/admin/registrations/events-SAVE.php +++ /dev/null @@ -1,264 +0,0 @@ - - * @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 - ); - - } - - -} diff --git a/models/admin/registrations/events.php b/models/admin/registrations/events.php index 589d7a0..8f8cc2a 100644 --- a/models/admin/registrations/events.php +++ b/models/admin/registrations/events.php @@ -33,13 +33,6 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent * @access public */ public $config; - /** - * Registrations Event ID - * - * @var $eventID - * @access public - */ - public $regEventID = false; /** * Constructor @@ -106,6 +99,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent $alphaSelected = false; $haveRegEvents = false; $regEventsCount = false; + $list = false; $namesList = false; $regEvent = false; $regEventID = false; @@ -118,6 +112,9 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent $regEventUpdateError = false; $regEventAdded = false; $reason = false; + $regEventSample = false; + $regEventJason = false; + $regClassJSON = false; // Get any provided option if (isset($_REQUEST['option'])) { @@ -147,6 +144,44 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent case 'configureEvent': +// This obviously still needs work - not really updated since stolen from front-end code + $scripts = array( + 'backbone-local' => 'js/lib/backbone.localStorage.min.js', + 'regApp' => 'js/regApp.js', + ); + foreach ( $scripts as $scriptName => $scriptPath ) { + wp_register_script( + $scriptName, + GLM_MEMBERS_REGISTRATIONS_PLUGIN_URL . $scriptPath, + array( 'jquery', 'backbone', 'underscore' ), + '1.0', + true + ); + } + wp_enqueue_script( array( 'backbone', 'jquery' ) ); + wp_enqueue_script( array_keys( $scripts ) ); + $regEvent = array(); + + // including test data for now + include GLM_MEMBERS_REGISTRATIONS_PLUGIN_PATH . '/data/event_setup.php'; + + $regClass = $regEventSample['reg_class']; + + // Find the regClass rate to be used + // There will only be one as this is based on the date. + //$regClassRate + + $eventData = array(); + + unset($regClass['reg_rate']); + + // Build the Class array of json objects for the classes. + $jsonClasses = array(); + foreach ( $regClass as $rClass ) { + $jsonClasses[] = json_encode( $rClass ); + } + $regClassJSON = '[' . implode( ',', $jsonClasses ) . ']'; + $view = 'eventEditLevels'; break; @@ -158,11 +193,11 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent if ($option == 'add') { // Verify that event is not already listed - $regEvent = $this->getEntry($eventID, 'event'); + $regEvent = $this->getEntry($regEventID, 'event'); if (!$regEvent) { // Get data on this event from events add-on - $eventData = apply_filters('glm-member-db-events-get-event', $eventID); + $eventData = apply_filters('glm-member-db-events-get-event', $regEventID); // Did we get event data? if ($eventData) { @@ -247,7 +282,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent $regEventUpdateError = true; } - $template = 'eventEdit'; + $view = 'eventEdit'; break; @@ -472,7 +507,13 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent 'regEventUpdated' => $regEventUpdated, 'regEventUpdateError' => $regEventUpdateError, 'regEventAdded' => $regEventAdded, - 'reason' => $reason + 'reason' => $reason, + + 'entry' => $regEventSample, + 'thisJsUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_URL . '/js', + 'regEventJSON' => json_encode( $regEventSample['reg_event'] ), + 'regClassJSON' => $regClassJSON, + ); // Return status, any suggested view, and any data to controller diff --git a/models/admin/registrations/index-SAVE.php b/models/admin/registrations/index-SAVE.php deleted file mode 100644 index 0e2fa5f..0000000 --- a/models/admin/registrations/index-SAVE.php +++ /dev/null @@ -1,105 +0,0 @@ - - * @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/dataRegistrations.php'; - -class GlmMembersAdmin_registrations_index // extends GlmDataRegistrations -{ - - /** - * 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) - { - - // Compile template data - $templateData = array( - ); - // Return status, any suggested view, and any data to controller - return array( - 'status' => true, - 'modelRedirect' => false, - 'view' => 'admin/registrations/index.html', - 'data' => $templateData - ); - - } - - -} diff --git a/models/admin/registrations/requests.php b/models/admin/registrations/requests.php index 376ecfa..9b510a1 100644 --- a/models/admin/registrations/requests.php +++ b/models/admin/registrations/requests.php @@ -159,7 +159,7 @@ class GlmMembersAdmin_registrations_requests extends GlmDataRegistrationsRequest $cart = $regCartSupport->getRegistrationCart($requestID); // If a valid cart was returned - if ($cart && $requestCart['status']) { + if ($cart && $cart['status']) { $haveRequest = true; } else { $errorMsg = $cart['errorMsg']; diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 78bd8bf..ba8faec 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -63,14 +63,14 @@ add_filter( if ($regEvent) { // Return link title and URL for this event in registrations - return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event®EventID=".$regEvent['id']); + return array('title' => 'Registrations', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=eventDashboard®EventID=".$regEvent['id']); } } // Since we must not have had a good event ID or didn't find the event in registrations, return title and url to add this event to registrations - return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-event&option=add&event=".$eventId); + return array('title' => 'Add Registrations To Event', 'url' => GLM_MEMBERS_PLUGIN_ADMIN_MENU_URL_BASE."registrations-events&option=eventDashboard&option=add&event=".$eventId); }, 10, diff --git a/views/admin/registrations/accountHeader.html b/views/admin/registrations/accountHeader.html index d89063d..45b55e1 100644 --- a/views/admin/registrations/accountHeader.html +++ b/views/admin/registrations/accountHeader.html @@ -2,6 +2,6 @@

Event Registrations

diff --git a/views/admin/registrations/eventEdit.html b/views/admin/registrations/eventEdit.html index a7ae558..2a6d6ab 100644 --- a/views/admin/registrations/eventEdit.html +++ b/views/admin/registrations/eventEdit.html @@ -26,7 +26,7 @@

(Items in red are required)

- + @@ -190,7 +190,7 @@ NEED TO ADD TESTS FOR CHANGES IN INPUT
-

+

diff --git a/views/admin/registrations/eventEditLevels.html b/views/admin/registrations/eventEditLevels.html index c6b8114..a2c93ca 100644 --- a/views/admin/registrations/eventEditLevels.html +++ b/views/admin/registrations/eventEditLevels.html @@ -18,15 +18,95 @@ Edit Registration Settings Registration Levels & Charges + + + + + {* Event Registration App - Backbone.js *} + {* Underscore Templates for the Event Registration App *} + {literal} + + + + + {/literal} +
+ +
+ {* Bootstrap the models needed on page load *} + {* Need to have RegEvent model created *} + {* And create the RegClasses collection *} + + + + + {/if} - {include file='admin/footer.html'} diff --git a/views/admin/registrations/eventHeader.html b/views/admin/registrations/eventHeader.html index 064bf70..43e10b5 100644 --- a/views/admin/registrations/eventHeader.html +++ b/views/admin/registrations/eventHeader.html @@ -2,6 +2,6 @@

Event Registrations

diff --git a/views/admin/registrations/requestDashboard.html b/views/admin/registrations/requestDashboard.html index 686505d..6fd6326 100644 --- a/views/admin/registrations/requestDashboard.html +++ b/views/admin/registrations/requestDashboard.html @@ -43,7 +43,7 @@
{$cart.request.bill_addr1}
- {if $cart.request.addr2} + {if $cart.request.bill_addr2}
{$cart.request.bill_addr2}
diff --git a/views/admin/registrations/requestHeader.html b/views/admin/registrations/requestHeader.html index 4b33685..271097a 100644 --- a/views/admin/registrations/requestHeader.html +++ b/views/admin/registrations/requestHeader.html @@ -2,6 +2,6 @@

Event Registrations