1752171309 gFFBC%2BJB4H%3AphpDocumentor-projectDescriptor-files-14c55c21e4e52bfe85d34feaab034120 O:39:"phpDocumentor\Descriptor\FileDescriptor":23:{s:8:"*fqsen";N;s:7:"*name";s:33:"StorageRetrievalRequestsTrait.php";s:12:"*namespace";s:0:"";s:10:"*package";s:10:"Controller";s:10:"*summary";s:67:"Storage retrieval requests trait (for subclasses of AbstractRecord)";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:676:"PHP version 8 Copyright (C) Villanova University 2010. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:17:"*fileDescriptor";N;s:7:"*line";i:0;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:5:{s:8:"category";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:8:"category";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:6:"VuFind";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:10:"Controller";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"author";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\AuthorDescriptor":3:{s:7:"*name";s:6:"author";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:39:"Demian Katz ";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"license";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"license";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:69:"http://opensource.org/licenses/gpl-2.0.php GNU General Public License";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:4:"link";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:43:"phpDocumentor\Descriptor\Tag\LinkDescriptor":4:{s:7:"*name";s:4:"link";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:9:"Main Site";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:7:"*link";s:18:"https://vufind.org";}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:7:"*hash";s:32:"8a4f6ad24318f9debd7a24e40c5dc4a5";s:7:"*path";s:62:"VuFind/src/VuFind/Controller/StorageRetrievalRequestsTrait.php";s:9:"*source";s:7341:" * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ namespace VuFind\Controller; use function in_array; use function is_array; /** * Storage retrieval requests trait (for subclasses of AbstractRecord) * * @category VuFind * @package Controller * @author Demian Katz * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ trait StorageRetrievalRequestsTrait { /** * Action for dealing with storage retrieval requests. * * @return mixed */ public function storageRetrievalRequestAction() { $driver = $this->loadRecord(); // Stop now if the user does not have valid catalog credentials available: if (!is_array($patron = $this->catalogLogin())) { return $patron; } // If we're not supposed to be here, give up now! $catalog = $this->getILS(); $checkRequests = $catalog->checkFunction( 'StorageRetrievalRequests', [ 'id' => $driver->getUniqueID(), 'patron' => $patron, ] ); if (!$checkRequests) { return $this->redirectToRecord(); } // Do we have valid information? // Sets $this->logonURL and $this->gatheredDetails $gatheredDetails = $this->storageRetrievalRequests()->validateRequest( $checkRequests['HMACKeys'] ); if (!$gatheredDetails) { return $this->redirectToRecord(); } // Block invalid requests: $validRequest = $catalog->checkStorageRetrievalRequestIsValid( $driver->getUniqueID(), $gatheredDetails, $patron ); if ((is_array($validRequest) && !$validRequest['valid']) || !$validRequest) { $this->flashMessenger()->addErrorMessage( is_array($validRequest) ? $validRequest['status'] : 'storage_retrieval_request_error_blocked' ); return $this->redirectToRecord('#top'); } // Send various values to the view so we can build the form: $pickup = $catalog->getPickUpLocations($patron, $gatheredDetails); $extraFields = isset($checkRequests['extraFields']) ? explode(':', $checkRequests['extraFields']) : []; // Check that there are pick up locations to choose from if the field is // required: if (in_array('pickUpLocation', $extraFields) && !$pickup) { $this->flashMessenger() ->addErrorMessage('No pickup locations available'); return $this->redirectToRecord('#top'); } // Process form submissions if necessary: if (null !== $this->params()->fromPost('placeStorageRetrievalRequest')) { // If we made it this far, we're ready to place the hold; // if successful, we will redirect and can stop here. // Check that any pick up location is valid: $validPickup = $this->storageRetrievalRequests()->validatePickUpInput( $gatheredDetails['pickUpLocation'] ?? null, $extraFields, $pickup ); if (!$validPickup) { $this->flashMessenger() ->addErrorMessage('storage_retrieval_request_invalid_pickup'); } else { // Add Patron Data to Submitted Data $details = $gatheredDetails + ['patron' => $patron]; // Attempt to place the hold: $function = (string)$checkRequests['function']; $results = $catalog->$function($details); // Success: Go to Display Storage Retrieval Requests if (isset($results['success']) && $results['success'] == true) { $msg = [ 'html' => true, 'msg' => 'storage_retrieval_request_place_success_html', 'tokens' => [ '%%url%%' => $this->url() ->fromRoute('myresearch-storageretrievalrequests'), ], ]; $this->flashMessenger()->addMessage($msg, 'success'); $this->getViewRenderer()->plugin('session')->put('reset_account_status', true); return $this->redirectToRecord($this->inLightbox() ? '?layout=lightbox' : ''); } else { // Failure: use flash messenger to display messages, stay on // the current form. if (isset($results['status'])) { $this->flashMessenger()->addErrorMessage($results['status']); } if (isset($results['sysMessage'])) { $this->flashMessenger() ->addMessage($results['sysMessage'], 'error'); } } } } // Find and format the default required date: $defaultRequiredDate = $this->storageRetrievalRequests() ->getDefaultRequiredDate($checkRequests); $defaultRequiredDate = $this->serviceLocator->get(\VuFind\Date\Converter::class) ->convertToDisplayDate('U', $defaultRequiredDate); try { $defaultPickup = $catalog->getDefaultPickUpLocation($patron, $gatheredDetails); } catch (\Exception $e) { $defaultPickup = false; } $config = $this->getConfig(); $homeLibrary = ($config->Account->set_home_library ?? true) ? $this->getUser()->getHomeLibrary() : ''; // helpText is only for backward compatibility: $helpText = $helpTextHtml = $checkRequests['helpText']; $view = $this->createViewModel( compact( 'gatheredDetails', 'pickup', 'defaultPickup', 'homeLibrary', 'extraFields', 'defaultRequiredDate', 'helpText', 'helpTextHtml' ) ); $view->setTemplate('record/storageretrievalrequest'); return $view; } } ";s:19:"*namespaceAliases";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:18:"\VuFind\Controller";O:30:"phpDocumentor\Reflection\Fqsen":2:{s:37:"phpDocumentor\Reflection\Fqsenfqsen";s:18:"\VuFind\Controller";s:36:"phpDocumentor\Reflection\Fqsenname";s:10:"Controller";}}}s:11:"*includes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*constants";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:12:"*functions";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*classes";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:13:"*interfaces";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:9:"*traits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:48:"\VuFind\Controller\StorageRetrievalRequestsTrait";O:40:"phpDocumentor\Descriptor\TraitDescriptor":14:{s:8:"*fqsen";O:30:"phpDocumentor\Reflection\Fqsen":2:{s:37:"phpDocumentor\Reflection\Fqsenfqsen";s:48:"\VuFind\Controller\StorageRetrievalRequestsTrait";s:36:"phpDocumentor\Reflection\Fqsenname";s:29:"StorageRetrievalRequestsTrait";}s:7:"*name";s:29:"StorageRetrievalRequestsTrait";s:12:"*namespace";s:18:"\VuFind\Controller";s:10:"*package";s:10:"Controller";s:10:"*summary";s:67:"Storage retrieval requests trait (for subclasses of AbstractRecord)";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:0:"";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:17:"*fileDescriptor";r:1;s:7:"*line";i:44;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:5:{s:8:"category";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:8:"category";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:6:"VuFind";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"package";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"package";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:10:"Controller";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:6:"author";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\AuthorDescriptor":3:{s:7:"*name";s:6:"author";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:39:"Demian Katz ";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:7:"license";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:38:"phpDocumentor\Descriptor\TagDescriptor":3:{s:7:"*name";s:7:"license";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:69:"http://opensource.org/licenses/gpl-2.0.php GNU General Public License";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:4:"link";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:43:"phpDocumentor\Descriptor\Tag\LinkDescriptor":4:{s:7:"*name";s:4:"link";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:9:"Main Site";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:7:"*link";s:18:"https://vufind.org";}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:13:"*properties";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:10:"*methods";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:29:"storageRetrievalRequestAction";O:41:"phpDocumentor\Descriptor\MethodDescriptor":19:{s:8:"*fqsen";O:30:"phpDocumentor\Reflection\Fqsen":2:{s:37:"phpDocumentor\Reflection\Fqsenfqsen";s:81:"\VuFind\Controller\StorageRetrievalRequestsTrait::storageRetrievalRequestAction()";s:36:"phpDocumentor\Reflection\Fqsenname";s:29:"storageRetrievalRequestAction";}s:7:"*name";s:29:"storageRetrievalRequestAction";s:12:"*namespace";s:18:"\VuFind\Controller";s:10:"*package";N;s:10:"*summary";s:51:"Action for dealing with storage retrieval requests.";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:0:"";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:17:"*fileDescriptor";N;s:7:"*line";i:51;s:7:"*tags";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{s:6:"return";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:1:{i:0;O:45:"phpDocumentor\Descriptor\Tag\ReturnDescriptor":4:{s:7:"*name";s:6:"return";s:14:"*description";O:55:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptor":2:{s:68:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptordescription";O:45:"phpDocumentor\Reflection\DocBlock\Description":2:{s:59:"phpDocumentor\Reflection\DocBlock\DescriptionbodyTemplate";s:0:"";s:51:"phpDocumentor\Reflection\DocBlock\Descriptiontags";a:0:{}}s:67:"phpDocumentor\Descriptor\DocBlock\DescriptionDescriptorinlineTags";a:0:{}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:8:"*types";O:37:"phpDocumentor\Reflection\Types\Mixed_":0:{}}}}}}s:9:"*errors";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:19:"*inheritedElement";N;s:9:"*parent";r:95;s:11:"*abstract";b:0;s:8:"*final";b:0;s:9:"*static";b:0;s:13:"*visibility";s:6:"public";s:12:"*arguments";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:53:"phpDocumentor\Descriptor\MethodDescriptorreturnType";O:37:"phpDocumentor\Reflection\Types\Mixed_":0:{}s:63:"phpDocumentor\Descriptor\MethodDescriptorhasReturnByReference";b:0;}}}s:13:"*usedTraits";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}}}s:10:"*markers";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}s:46:"phpDocumentor\Descriptor\FileDescriptorenums";O:35:"phpDocumentor\Descriptor\Collection":1:{s:8:"*items";a:0:{}}}