Added better formatted date to getRegistrationCart() data.
Staging regRequestEvent.php for deletion.
Added admin hook to display a link to an event from registrations.
Added links between Events and Registrations on vaious tables and dashboards.
Added cart data to admin requests dashboard.
Various other minor appearance issues.
// Get list of registrants requested for this rate
$this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] = $RequestRegistrant->getList("T.reg_request_rate = ".$rate['id']);
- // For each rate selected for this class
+ // For each registrant under this rate
if ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants']) {
foreach ($this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'] as $registrantKey => $registrant) {
+ $this->cart['events'][$eventKey]['classes'][$classKey]['rates'][$rateKey]['registrants'][$registrantKey]['timeReformatted'] = date('l m/d/Y g:i A', strtotime($registrant['event_time']));
+
// Add registrant account to accounts table
$this->addAccountToCart($registrant['account']);
margin-top: 1em;
margin-left: 2em;
}
+
$return = false;
$option = filter_var( $_REQUEST['option'], FILTER_SANITIZE_STRING );
- trigger_error(print_r($_REQUEST,E_USER_NOTICE));
+ // trigger_error(print_r($_REQUEST,E_USER_NOTICE));
switch ( $option ) {
case 'register':
--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database
+ * Admin Registrations AJAX processing for Registration Request Events
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @release regRequestEvent.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_ajax_regClasses extends GlmDataRegistrationsRequestEvent
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /**
+ * 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($modelData)
+ {
+
+trigger_error(print_r($modelData,1));
+
+ // Perform specified action
+ switch ($modelData['option']) {
+
+ case 'add':
+ break;
+
+ case 'get':
+ break;
+
+ case 'update':
+ break;
+
+ case 'delete':
+ break;
+
+ default:
+ die(); // should never get here
+ break;
+
+ }
+
+ wp_die();
+
+
+
+ }
+
+
+}
+++ /dev/null
-<?php
-/**
- * Gaslight Media Members Database
- * Admin Registrations AJAX processing for Registration Request Events
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release regRequestEvent.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_ajax_regClasses extends GlmDataRegistrationsRequestEvent
-{
-
- /**
- * WordPress Database Object
- *
- * @var $wpdb
- * @access public
- */
- public $wpdb;
- /**
- * Plugin Configuration Data
- *
- * @var $config
- * @access public
- */
- public $config;
-
- /**
- * 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($modelData)
- {
-
-trigger_error(print_r($modelData,1));
-
- // Perform specified action
- switch ($modelData['option']) {
-
- case 'add':
- break;
-
- case 'get':
- break;
-
- case 'update':
- break;
-
- case 'delete':
- break;
-
- default:
- die(); // should never get here
- break;
-
- }
-
- wp_die();
-
-
-
- }
-
-
-}
{
$validated = false;
- trigger_error(print_r($modelData,1));
+ // trigger_error(print_r($modelData,1));
if ( !isset( $modelData['option'] ) ) {
$option = null;
wp_die();
}
-trigger_error("1111",E_USER_NOTICE);
// Get the reg_time entry id
if (!isset($_REQUEST['reg_time'])) {
wp_die();
wp_die();
}
-trigger_error("regTimeId = $regTimeId",E_USER_NOTICE);
// Try to get the reg_time entry
$regTime = $this->getEntry($regTimeId);
if (!$regTime) {
wp_die();
}
-trigger_error("3333",E_USER_NOTICE);
// re-calculate the total
$avail = $max - $regTime['attendee_count'] - $regTime['attendees_pending'];
-trigger_error("max = $max, avail = $avail", E_USER_NOTICE);
// Try to update the reg_time entry
$this->wpdb->update(
$this->table,
update_option('glmMembersDatabaseRegistrationsRequestID', $requestID);
}
+ // echo "<pre>".print_r($cart,1)."</pre>";
+
// Compile template data
$templateData = array(
'haveRequests' => $haveRequests,
'cart' => $cart,
'haveCart' => $haveCart,
'errorMsg' => $errorMsg,
- 'option' => $option
+ 'option' => $option,
+ 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/'
);
// Return status, any suggested view, and any data to controller
return array(
</div>
{if apply_filters('glm_members_menu_members', true)}
<div class="glm-small-4 glm-right">
+ {$r_link = apply_filters('glm_members_add_link_to_registrations_event_list_entry', $regEvent.event)}
+ {if is_array($r_link)}
+ <a class="button button-secondary glm-button glm-right" href="{$r_link.url|escape:'string'}">Edit {$r_link.title}</a>
+ {/if}
<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}
<tr>
<th>ID</th>
<th>Event Name</th>
+ <th> </th>
</tr>
</thead>
<tbody>
<a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$r.id}">{$r.id}</a>
</td>
<td>
- <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$r.id}">{$r.event_name}</a>
+ <a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$r.id}">{$r.event_name}</a>
+ </td>
+ <td>
+ {$r_link = apply_filters('glm_members_add_link_to_registrations_event_list_entry', $r.event)}
+ {if is_array($r_link)}
+ <a class="button button-secondary glm-button-small" href="{$r_link.url|escape:'string'}">{$r_link.title}</a>
+ {/if}
</td>
</tr>
{/foreach}
<div class="glm-admin-table-inner glm-admin-table">
<a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&glm_action=requests&option=edit&account={$acct}" class="button button-secondary glm-button glm-right">Edit Request</a>
- <h3>Request</h3>
+ <h1>Request</h1>
<div id="glm-admin-member-registrations-request-overview" class="glm-admin-table">
<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">
+ <h3>Request ID:</h3>
+ </div>
+ <div class="glm-small-12 glm-column">
+ {$cart.request.id}
+ </div>
+ </div>
+
<div class="glm-row">
<div class="glm-small-12 glm-column">
<h3>Account Submitting Request:</h3>
<h3>Checkout Summary:</h3>
</div>
<div class="glm-small-12 glm-column" style="margin-top: .5em;">
+ {if $cart.request.summary}
<a id="viewSummaryButton" class="button button-secondary glm-button">View</a>
<div id="viewSummaryDialog" class="glm-dialog-box" title="Registration Request Checkout Summary">
{$cart.request.summary}
</div>
+ {/if}
</div>
</div>
</div>
<div class="glm-admin-table-inner glm-admin-table">
- <h3>Request Cart</h3>
+ <h1>Current Cart Contents</h1>
+
+ <div>
+
+{if $haveCart && !$cart.request.summary}
+
+
+ <div>
+ <a href="{$regUrl}?page=cart&cartId={$cart.request.id}" class="button button-secondary glm-button">Show Front-End Cart Page</a>
+ </div>
+
+ <table class="glm-admin-table" width="100%" style="background-color: #fff; border: 1px black solid; margin-top: 2rem;">
+
+ <thead>
+
+ <tr>
+ <th>Registering</th>
+ <th>Registrant</th>
+ <th>Date/Time</th>
+ <th>Discount</th>
+ <th>Rate</th>
+ </tr>
+
+
+ </thead>
+ <tbody>
+ {foreach $cart.events as $event}
+ <tr>
+ <th colspan="5">Event: {$event.event_name}</th>
+ </tr>
+ {foreach $event.classes as $class}
+ <tr>
+ <td colspan="5"> {$class.class_name}</td>
+ </tr>
+ {foreach $class.rates as $rate}
+ {if $rate.base_rate || $rate.registrant_credits}
+ <tr>
+ <td colspan="4">
+ {$rate.rate_name}
+ - Base Rate ({$rate.registrant_credits} registrants included)
+ </td>
+ <td style="text-align: right;">
+ {if $rate.base_rate}{$rate.base_rate_money}{/if}
+ </td>
+ </tr>
+ {/if}
+ {foreach $rate.registrants as $registrant}
+ <tr>
+ <td> </td>
+ <td>{$registrant.fname} {$registrant.lname}</td>
+ <td>{$registrant.timeReformatted}</td>
+ <td style="text-align: right;">
+ {if $registrant.registrantDiscounts > 0}
+ {$registrant.registrantDiscounts|number_format:2}
+ {else}
+
+ {/if}
+ </td>
+ <td style="text-align: right;">
+ {if $registrant.registrantRate > 0}
+ {$registrant.registrantRate|number_format:2}
+ {else}
+ (included)
+ {/if}
+ </td>
+ </tr>
+ {assign var="acct" value=$cart.accounts.{$registrant.account}}
+ {if $acct.validated.value}
+ <tr>
+ <td colspan="2"> </td>
+ <td colspan="3">
+ {if $acct.email != ''}E-Mail: {$acct.email}<br>{/if}
+ (Account information is restricted)
+ </td>
+ </tr>
+ {else}
+ {if $acct.addr1 != '' || $acct.phone != '' || $acct.email != ''}
+ <tr>
+ <td colspan="2"> </td>
+ <td colspan="3">
+ {if $acct.org != ''} {$acct.title}, {$acct.org}<br> {/if}
+ {if $acct.addr1 != ''} {$acct.addr1}<br> {/if}
+ {if $acct.addr2 != ''} {$acct.addr2}<br> {/if}
+ {if $acct.city != ''} {$acct.city}, {$acct.state.value} {$acct.zip}<br> {/if}
+ {if $acct.country.name != ''} {$acct.country.name}<br> {/if}
+ {if $acct.phone != ''} Phone: {$acct.phone}<br> {/if}
+ {if $acct.fax != ''} Fax: {$acct.fax}<br> {/if}
+ {if $acct.email != ''} E-Mail: {$acct.email} {/if}
+ </td>
+ </tr>
+ {/if}
+ {/if}
+ {/foreach}
+ {/foreach}
+ {/foreach}
+ {/foreach}
+ </tbody>
+ <tfoot>
+ <td colspan="2"> </td>
+ <td>Total registrants: {$cart.totalRegistrants}</td>
+ <td style="text-align: right;">
+ {if $cart.totalDiscounts > 0}
+ ${$cart.totalDiscounts|number_format:2}
+ {else}
+
+ {/if}
+ </td>
+ <td style="text-align: right;">${$cart.totalCharges|number_format:2}</td>
+ </tfoot>
+ </table>
+{/if} {* / if have cart *}
+ </div>
+</div>
+
- (awaiting page development)
+
</div>
<th>Org</th>
<th>City</th>
<th>State</th>
+ <th>Country</th>
+ <th>Phone</th>
+ <th>E-mail</th>
+ <th>Status</th>
</tr>
</thead>
<tbody>
{if $haveRequests}
{foreach $requests as $r}
<tr>
- <td>{$r.id}<a href="">show</a></td>
- <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}">{$r.bill_fname}</td>
- <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}">{$r.bill_lname}</td>
- <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}">{$r.bill_org}</td>
+ <td><a href="{$thisUrl}?page=glm-members-admin-menu-registrations-requests&option=requestDashboard&requestID={$r.id}">{$r.id}</a></td>
+ <td>{$r.bill_fname}</td>
+ <td>{$r.bill_lname}</td>
+ <td>{$r.bill_org}</td>
<td>{$r.bill_city}</td>
<td>{$r.bill_state}</td>
+ <td>{$r.bill_country}</td>
+ <td>{$r.bill_phone}</td>
+ <td>{$r.bill_email}</td>
+ <td>{$r.status.name}</td>
</tr>
{/foreach}
{else}
</td>
</tr>
{else}
- {if $acct.addr != '' || $acct.phone != '' || $acct.email != ''}
+ {if $acct.addr1 != '' || $acct.phone != '' || $acct.email != ''}
<tr>
<td colspan="2"> </td>
<td colspan="3">
<h2><%= event_name %></h2>
<div>
<% if ( this.getClassCount() == 0 ) { %>
- <p> Registrations for this event not currently available at this time. </p>
+ <p> Registrations not available at this time. </p>
<% } else { %>
<% if ( !time_specific ) { %>
<p>Attend any time during event</p>