*/
// Load Registrations data abstract
-// require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegistrations.php';
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
-class GlmMembersAdmin_registrations_events // extends GlmDataRegistrations
+class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
{
/**
* 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);
+ parent::__construct(false, false, true);
}
public function modelAction($actionData = false)
{
+// $registrations = $this->getList();
+
+// // Load registrations support class
+// require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/registrationsSupport.php';
+// $regSupport = new GlmRegistrationsSupport($this->wpdb, $this->config);
+
+
+ /* Test data */
+
+ /* Uncomment to create one complete sample registration registration each time this action is called */
+// $regSupport->addTestData();
+
+
+ /////////////////////////////////////
+
+ $haveRegistrations = false;
+ $registrations = false;
+ $haveRegistration = false;
+ $registrationId = false;
+ $registrationCart = false;
+ $option = 'list';
+ $errorMsg = false;
+
+ // Load registrations support class
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/registrationsSupport.php';
+ $regSupport = new GlmRegistrationsSupport($this->wpdb, $this->config);
+
+
+ /* Test data */
+
+ /* Uncomment to create one complete sample registration registration each time this action is called */
+ // $regSupport->addTestData();
+
+ /* Uncomment to remove all registration data - *** WARNING - REMOVES ALL REQUEST DATA - NOT JUST TEST DATA *** */
+ // $regSupport->removeRegistrationRegistrationData();
+
+ // Check for option submitted
+ if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
+ $option = $_REQUEST['option'];
+ }
+
+ // Check for registration registration ID submitted
+ if (isset($_REQUEST['registrationID']) && $_REQUEST['registrationID'] != '') {
+ $registrationId = ($_REQUEST['registrationID'] - 0);
+ }
+
+ // Perform selected option
+ switch ($option) {
+
+ // Check registration and update holds
+ case 'check':
+
+// $registrationCart = $regSupport->checkRegistrationRegistration($registrationId);
+
+ // Display/Edit a registration registration
+ case 'edit':
+
+ // If a registration ID has been supplied
+// if ($registrationId) {
+
+ // Try to get the complete cart for this registration
+// $registrationCart = $regSupport->getRegistrationCart($registrationId);
+//
+// // If a valid cart was returned
+// if ($registrationCart && $registrationCart['status']) {
+// $haveRegistration = true;
+// } else {
+// $errorMsg = $registrationCart['errorMsg'];
+// }
+//
+// $view = 'editRegistration.html';
+//
+// break;
+//
+// } else {
+// $errorMsg = 'Invalid Registration Registration ID supplied. Unable to view/edit selected registration.';
+// }
+
+ // Fall through to list if no registrationID submitted
+
+ // Default is to list registrations
+ default:
+
+ // Get list of registrations
+ $registrations = $this->getList();
+ if ($registrations) {
+ $haveRegistrations = true;
+ }
+
+ break;
+
+ }
+// echo "<pre>". print_r($registrations, true) . "</pre>";
+
// Compile template data
$templateData = array(
+ 'haveRegistrations' => $haveRegistrations,
+ 'registrations' => $registrations,
+ 'haveRegistration' => $haveRegistration,
+ 'errorMsg' => $errorMsg,
+ 'option' => $option
);
+
+ /////////////////////////////////////
// Return status, any suggested view, and any data to controller
return array(
'status' => true,