Added time_specific to getSimpleRegEventsList() to have to reg events dashboard.
Added time_specific output to reg events dashboard list.
Fixed problem with reg event attendee totals after converting an event between time-specific and non-time-specific
Fixed problem with non-time-specific time entry not being created when switching even from time-specific to non-time-specific
Added AJAX process to display Authorize.net Verified Seal to avoid XXS complaint problem with Chrome.
// If we're asked to get registrant counts
if ($this->postProcAddRegistrantsCount) {
- $counts = $this->getEventRegistrantCounts($result_data['id']);
+ $counts = $this->getEventRegistrantCounts($result_data['id'], $result_data['time_specific']);
// If we have counts, add them to the result
if ($counts && is_array($counts)) {
* Get registrant count summary for an event
*
* @param integer $eventId ID of the reg_event record
+ * @param boolean $time_specific Flag for time-specific event
*
* @return array Summary array of event counts
*
*/
- public function getEventRegistrantCounts($eventId = false)
+ public function getEventRegistrantCounts($eventId = false, $time_specific = false)
{
+ if ($time_specific['value']) {
+trigger_error("**** Time SPecific",E_USER_NOTICE);
+ $sql = "
+ SELECT SUM(attendee_max) AS total, SUM(attendee_count) AS registered, SUM(attendees_pending) AS cartHold, SUM(attendees_available) AS curAvail
+ FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time
+ WHERE active
+ AND reg_event = $eventId
+ AND non_time_specific = false
+ ";
+ } else {
+trigger_error("**** Not Time SPecific",E_USER_NOTICE);
+ $sql = "
+ SELECT SUM(attendee_max) AS total, SUM(attendee_count) AS registered, SUM(attendees_pending) AS cartHold, SUM(attendees_available) AS curAvail
+ FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time
+ WHERE active
+ AND reg_event = $eventId
+ AND non_time_specific = true
+ ";
+ }
+
// Get sum of all attendee counts
- $countsData = $this->wpdb->get_row("
- SELECT SUM(attendee_max) AS total, SUM(attendee_count) AS registered, SUM(attendees_pending) AS cartHold, SUM(attendees_available) AS curAvail
- FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_time
- WHERE reg_event = $eventId
- ;", ARRAY_A);
+ $countsData = $this->wpdb->get_row($sql, ARRAY_A);
$counts = array(
'total' => $countsData['total'],
'id' => $savedFields['id'],
'event_name' => $savedFields['event_name'],
'notify_email' => $savedFields['notify_email'],
- 'blabla' => 1,
'descr' => $savedFields['descr'],
'first_datetime' => $savedFields['first_datetime'],
'last_datetime' => $savedFields['last_datetime']
'id' => $fSave['id'],
'event' => $fSave['event'],
'event_name' => $fSave['event_name'],
+ 'time_specific' => $fSave['time_specific'],
'first_datetime' => $fSave['first_datetime'],
'last_datetime' => $fSave['last_datetime']
);
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Registration add-on admin AJAX Get Authorize.net Verified MErchqant Seal
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+class GlmMembersAdmin_ajax_getAuthorizeNetSeal
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /*
+ * Constructor
+ *
+ * This contructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ // Run constructor for data class
+ // parent::__construct(false, false);
+
+ }
+
+ /*
+ * Perform Model Action
+ *
+ * This model returns the correct code to display the Verified Merchant Seal for Authorize.net
+ *
+ * This is to avoid the XSS Auditor in Chrome
+ *
+ * @param $actionData
+ *
+ * Echos Seal Code
+ */
+ public function modelAction( $actionData = false )
+ {
+
+ $seal = $this->wpdb->get_var( "
+ SELECT reg_authorize_net_merchant_seal
+ FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "management
+ WHERE id = 1;
+ ");
+ echo html_entity_decode("<center>".$seal."<p>Click Seal to Test Verification.</p></center>");
+
+ wp_die();
+
+ }
+
+
+}
}
}
+// echo "<pre>".print_r($regEvent,1)."</pre>";
$view = 'eventDashboard';
* @link http://dev.gaslightmedia.com/
*/
+// Get the current reg event type to check for change
+$timeSpecific = $this->wpdb->get_var("
+ SELECT time_specific
+ FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_event
+ WHERE id = $regEventID
+");
// 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;
+
+ // Now check to see if the type has been changed from Time specific to Non-Time specific
+ if ($timeSpecific && !$regEvent['fieldData']['time_specific']['value']) {
+
+ // Changing to non-time=specific, so check if we need to create a time entry for that
+ $timeEntry = $this->wpdb->get_row("
+ SELECT id
+ FROM ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_time
+ WHERE reg_event = $regEventID
+ AND non_time_specific
+ ");
+
+ // If there isn't a non-time-specific time entry
+ if ($timeEntry === null) {
+
+ // Create that now
+ $this->wpdb->insert(
+ GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'reg_time',
+ array(
+ 'reg_event' => $regEventID,
+ 'event_time' => 0,
+ 'all_day' => false,
+ 'attendees' => true,
+ 'attendee_max' => $regEvent['fieldData']['attendee_max'],
+ 'attendee_count' => 0,
+ 'attendees_pending' => 0,
+ 'attendees_available' => $regEvent['fieldData']['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,
+ 'active' => true,
+ 'non_time_specific' => true
+ ),
+ array(
+ '%d',
+ '%d',
+ '%d',
+ '%d',
+ '%d',
+ '%d',
+ '%d',
+ '%d',
+ '%f',
+ '%f',
+ '%f',
+ '%f',
+ '%f',
+ '%f',
+ '%f',
+ '%d',
+ '%d'
+ )
+ );
+
+ // Now get the event data again so it will have the new time entry
+ $regEvent = $this->editEntry($regEventID);
+
+ }
+ }
+
+
} else {
$regEventUpdateError = true;
}
'updateAvailability' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'registrantsListExport' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
'setupEventRegQueue' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
- 'runEventRegQueue' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
+ 'runEventRegQueue' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+ 'getAuthorizeNetSeal' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG
),
'registrations' => array(
'index' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
<tr class="authorize-net">
<th class="glm-nowrap-left-align{if $regSettings.fieldRequired.reg_authorize_net_merchant_seal} glm-required{/if}">Verified Merchant Seal HTML:</th>
<td {if $regSettings.fieldFail.reg_authorize_net_merchant_seal}class="glm-form-bad-input"{/if}>
- <div class="glm-left" style="width: 100px">
- {$regSettings.fieldData.reg_authorize_net_merchant_seal|unescape}
- </div>
+ {if $regSettings.fieldData.reg_authorize_net_merchant_seal != ''}<div><a id="verifiedAuthorizeNetMerchantSeal" class="button">Click to test Seal</a></div>{/if}
<div style="max-width: 700px">
This field is for HTML code that will display an authorized seal for the merchant's Authorized.net account.
Once the correct HTML code is entered above, the seal should show to the left of this text. If that does not happen,
$( document ).ready(function() {
showSelectedCardProcessor();
});
+
+ $('#verifiedAuthorizeNetMerchantSeal').on('click', function() {
+ var sealUrl = '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=getAuthorizeNetSeal';
+ window.open(sealUrl, '_blank', "width=300,height=200,menubar=no,scrollbars=no,location=no");
+ return false;
+ });
});
</script>
<tr>
<th>ID</th>
<th>{$terms.reg_term_event_cap} Name</th>
+ <th>Date Specific?</th>
<th>Maximum<br>{$terms.reg_term_attendee_plur_cap}</th>
<th>{$terms.reg_term_registered_cap}</th>
<th>Cart<br>Hold</th>
<td>
<a href="{$thisUrl}?page=glm-members-admin-menu-registrations-events&option=eventDashboard®EventID={$r.id}">{$r.event_name}</a>
</td>
+ <td>{if $r.time_specific.value}Yes{/if}</td>
<td>{$r.total}</td>
<td>{$r.registered}</td>
<td>{$r.cartHold}</td>