From: Chuck Scott Date: Fri, 28 Sep 2018 18:08:19 +0000 (-0400) Subject: Added list of requests needing attention to Reg Events Dashboard with edit of status. X-Git-Tag: v1.0.22^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9888520a318b8fc5d01f3b9de4fa88d10bbd13fd;p=WP-Plugins%2Fglm-member-db-registrations.git Added list of requests needing attention to Reg Events Dashboard with edit of status. Removd a couple request status values that are not currently needed. --- diff --git a/classes/data/dataRegRequest.php b/classes/data/dataRegRequest.php old mode 100644 new mode 100755 index e8725e0..5228eaa --- a/classes/data/dataRegRequest.php +++ b/classes/data/dataRegRequest.php @@ -466,10 +466,12 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract * * @param string $where Where clause to filter list * @param boolean $getStats Flag to get additional stats for cart + * @param string $orderBy ORDER BY clause for results + * @param boolean $includeSummary Include HTML summary of submitted request if true * * @return object Class object */ - public function getRegRequestListSimplified($where = false, $getStats = false) + public function getRegRequestListSimplified($where = false, $getStats = false, $orderBy = '', $includeSummary = false) { $savedFields = $this->fields; @@ -485,10 +487,15 @@ class GlmDataRegistrationsRegRequest extends GlmDataAbstract 'account_lname' => $savedFields['account_lname'], 'status' => $savedFields['status'], 'date_created' => $savedFields['date_created'], - 'last_update' => $savedFields['last_update'] + 'last_update' => $savedFields['last_update'], + 'total' => $savedFields['total'] ); - $requestsSimplified = $this->getList($where); + if ($includeSummary) { + $this->fields['summary'] = $savedFields['summary']; + } + + $requestsSimplified = $this->getList($where, $orderBy); $this->fields = $savedFields; $this->postProcRegRequest = $savedPostProcess; diff --git a/config/plugin.ini b/config/plugin.ini old mode 100644 new mode 100755 index b68e8f8..23e5d86 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -202,9 +202,9 @@ billing_field_numb['FAX'] = 12 ; submission_status[0] = 'In Cart' submission_status[10] = 'Complete' -submission_status[20] = 'Unpaid' +; submission_status[20] = 'Unpaid' submission_status[30] = 'Card Pending' -submission_status[40] = 'Card Declined' +; submission_status[40] = 'Card Declined' submission_status[50] = 'Payment Pending' submission_status[60] = 'Pay On Arrival' submission_status[70] = 'Administrative Hold' diff --git a/models/admin/registrations/events_dashboard.php b/models/admin/registrations/events_dashboard.php old mode 100644 new mode 100755 index 48a8e78..c905d25 --- a/models/admin/registrations/events_dashboard.php +++ b/models/admin/registrations/events_dashboard.php @@ -25,12 +25,13 @@ $paging = true; $prevStart = false; $nextStart = false; $start = 1; -$limit = 20; // Set to the number of listings per page +$limit = 10; // Set to the number of listings per page $namesList = false; $textSearch = false; $haveRegEvent = false; $alphaWhere = ''; $where = ' TRUE '; +$haveRequests = false; @@ -98,9 +99,97 @@ if ($list !== false) { } } + // Get full list of event names matching the current where clause for text search box $namesList = $this->getSimpleRegEventsList($where); +/* + * Build list of status options for display of request reccords. + */ +$statusSelected = $this->config['submission_status_numb']['PAYMENT_PEND']; +if (isset($_REQUEST['request_status_select'])) { + $statusSelected = $_REQUEST['request_status_select']; +} + +/** + * ******* TEMPORARY - USE SAME FUNCTION IN MAIN PLUGIN WHEN THAT'S UPDATED (less the number 2 at the end) ************* + */ +// require_once GLM_MEMBERS_REGISTRATIONS_MAIN_PLUGIN_PATH.'/classes/glmPluginSupport.php'; +function glmMembersConfigArraySetup2( $configTable, $configNumbTable = false, $configSelectedArray = false) +{ + + // Check if config table array exits + if (!is_array($configTable) || count($configTable) == 0) { + return false; + } + + // Build base array + $conf = array(); + foreach ($configTable as $key=>$descr) { + $conf[$key] = array( + 'id' => $key, + 'descr' => $descr, + 'name' => false, + 'selected' => false + ); + } + + // If name->number array add that data + if (is_array($configNumbTable) && count($configNumbTable) > 0) { + foreach ($configNumbTable as $name=>$key) { + if (isset($conf[$key])) { + $conf[$key]['name'] = $name; + } + } + } + + // If a selected array is provided, add that data + if (is_array($configSelectedArray) && count($configSelectedArray) > 0) { + foreach ($configSelectedArray as $key) { + if (isset($conf[$key])) { + $conf[$key]['selected'] = true; + } + } + } + + return $conf; + +} + +// Check for an update to the status of a request +if (isset($_REQUEST['option2']) && $_REQUEST['option2'] == 'updateStatus' && isset($_REQUEST['requestId']) && isset($_REQUEST['status'])) { + + // Make sure we have the required parameters + $requestId = ($_REQUEST['requestId']-0); + $status = ($_REQUEST['status']-0); + if ($requestId > 0 && $status > 0) { + $sql = " + UPDATE ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . "reg_request + SET status = $status + WHERE id = $requestId + "; + $this->wpdb->query($sql); + } + +} + +// Get list of request status options for selection except certain ones. - Save a copy with all options for edit. +$requestStatusSelect = glmMembersConfigArraySetup($this->config['submission_status'], $this->config['submission_status_numb']); +$requestStatusEditSelect = $requestStatusSelect; +unset($requestStatusSelect[$this->config['submission_status_numb']['CART']]); +unset($requestStatusEditSelect[$this->config['submission_status_numb']['CART']]); +unset($requestStatusSelect[$this->config['submission_status_numb']['COMPLETE']]); +unset($requestStatusSelect[$this->config['submission_status_numb']['FAILED']]); +unset($requestStatusSelect[$this->config['submission_status_numb']['CANCELED']]); + +// Get list of requests matching selection status +require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegRequest.php'; +$Requests = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config); +$requests = $Requests->getRegRequestListSimplified("status = $statusSelected", false, 'bill_lname, bill_fname', true); +if (is_array($requests) && count($requests) > 0) { + $haveRequests = true; +} + $templateData = array( 'regEventsCount' => $regEventsCount, 'haveRegEvents' => $haveRegEvents, @@ -117,7 +206,12 @@ $templateData = array( 'namesList' => $namesList, 'textSearch' => $textSearch, 'regEvent' => $regEvent, - 'haveRegEvent' => $haveRegEvent + 'haveRegEvent' => $haveRegEvent, + 'requestStatusEditSelect' => $requestStatusEditSelect, + 'requestStatusSelect' => $requestStatusSelect, + 'statusSelected' => $statusSelected, + 'haveRequests' => $haveRequests, + 'requests' => $requests ); $view = 'eventsDashboard'; diff --git a/views/admin/registrations/eventRegistrants.html b/views/admin/registrations/eventRegistrants.html index 59753d1..db4523b 100755 --- a/views/admin/registrations/eventRegistrants.html +++ b/views/admin/registrations/eventRegistrants.html @@ -40,7 +40,7 @@ Time Selected  {$s.descr}    + {/foreach} + + + + + + + + + + + + + + +{if $haveRequests} + {assign var="i" value="0"} + {foreach $requests as $r} + {if $i++ is odd by 1} + + {else} + + {/if} + + + + + + + + + + + + + {/foreach} +{else} + +{/if} + +
Request IDRequested ByStatusTotalDate CreatedLast Update
+ {$r.id} + {$r.account_fname} {$r.account_lname}{$r.status.nameEsc}{$r.total} + {$r.date_created.datetime}{$r.last_update.datetime}
+
+

Edit This Request

+ Set Status To:   + {foreach $requestStatusEditSelect as $s} +  {$s.descr}    + {/foreach} +
+ Save + Cancel Edit +

+

+
+ NOTE: The summary below is a copy from when the request was submitted. Any changes to {$terms.reg_term_attendee_plur} after that are not shown here.
+ {$r.summary} +
+
(no requests with selected status)
+ +