diff --git a/fid/config/vufind/fid.ini b/fid/config/vufind/fid.ini index e4dc39af80b575f5187f5482d3398832567d246f..fd434cd589fa8a65605fcd57f7a053e40205f53d 100644 --- a/fid/config/vufind/fid.ini +++ b/fid/config/vufind/fid.ini @@ -36,4 +36,30 @@ user_list_export_file_prefix = 'export' ; provides a comma separated list of available options e.g. "0,2,1" will result ; in having options job_title_0, job_title_2, job_title_1 in that particular order ; of not given, options will be job_title_0, job_title_1 -;jobTitleOptions = "0,1" \ No newline at end of file +;jobTitleOptions = "0,1" + +; examples on configure admin order listings +;[OrderList] +;displayCols[] = 'type' +;displayCols[] = 'status' +;displayCols[] = 'dueDate' +;displayCols[] = 'edit' +;displayCols[] = 'delete' + +;examples on enabling order edit forms +;[pdaEdit] +;form = 'complete' +;first of statusOptions[] is assumed as default status +;statusOptions[] = 'open' +;statusOptions[] = 'processing' +;statusOptions[] = 'loan' +;statusOptions[] = 'completed' +;statusOptions[] = 'closed' + +;[digitizationEdit] +;form = 'basic' +;first of statusOptions[] is assumed as default status +;statusOptions[] = 'open' +;statusOptions[] = 'processing' +;statusOptions[] = 'completed' +;statusOptions[] = 'closed' \ No newline at end of file diff --git a/fid/config/vufind/permissions.ini b/fid/config/vufind/permissions.ini index c3bee6a1bf0a94cfd6e1bbbb32492ea96b83275e..b5978a3f5be74a7338e83ca37186137c194d40df 100644 --- a/fid/config/vufind/permissions.ini +++ b/fid/config/vufind/permissions.ini @@ -31,6 +31,11 @@ role[] = loggedin FidApiPermission[] = edit_user permission = fid.EditUser +[fid.EditOrder] +role[] = loggedin +FidApiPermission[] = edit_order +permission = fid.EditOrder + [fid.LimitedAccess] role[] = loggedin FidApiPermission[] = limited_access diff --git a/local/languages/de.ini b/local/languages/de.ini index 42b91c5cbb69bbbd43ffa91eb8e44e2278a77666..144a30c70ca1deeb25f86906093ba7b143947f42 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -720,7 +720,7 @@ errorcode_password_validation_error = "Das übergebene Password ist nicht korrek errorcode_old_password_validation_error = "Die Kombination aus Benutzernummer und Kennwort ist nicht gültig. Bitte überprüfen Sie Ihre Eingabe." errorcode_empty_req_param_error = "Um das Formular erfolgreich zu senden, müssen alle erforderlichen Felder ausgefüllt sein" exclude_newspapers = "Ohne Zeitungsartikel" -exclude_filter = "Filter "%%filter_name%%" ausschließen" +exclude_filter = "Filter '%%filter_name%%' ausschließen" export_download = "Datei herunterladen" export_exporting = "Exportdatei erstellen" export_fail = "Ihre Datensätze wurden nicht exportiert" @@ -885,6 +885,7 @@ create a new list = "erstellen Sie eine neue Liste" page_reload_hint = "Seite wird neu geladen" page_reload_on_select_hint = "Seite wird bei Auswahl des Filters '%%filter_name%%' neu geladen" page_reload_on_deselect_hint = "Seite wird neu geladen, wenn der Filter '%%filter_name%%' abgewählt wird" +page_reload_on_xclude_hint = "Seite wird neu geladen, wenn der Filter '%%filter_name%%' aus den Suchergebnissen ausgeschlossen wird" password_too_short = "Zu kurz" password_very_weak = "Sehr schwach" password_weak = "Schwach" @@ -1835,8 +1836,9 @@ Address-Contact-Hours = "Adresse, Kontakt" resolver_link_access_denied = "nicht verfügbar" resolver_link_access_limited = "Im Campusnetz verfügbar" resolver_link_access_open = "verfügbar" +resolver_link_access_unknown = "Titel ist beim Resolver-Service nicht bekannt" ; message to be shown upon empty resolver response -no_resolver_links = "Keine Online Links verfügbar." +no_resolver_links = "Keine Online-Links verfügbar." ; reset password reset_password_text = "Bitten füllen Sie dieses Formular aus, um Ihr Passwort zurücksetzen zu lassen. Sie erhalten an u.g. E-Mail-Adresse eine Benachrichtigung, nachdem wir das Passwort zurückgesetzt haben." @@ -1994,7 +1996,7 @@ Modal_description = "Sie befinden sich in einem Dialogfenster, das über dem Hau Skip_navigation_links = "Sprunglinks zur Suche und zum Inhalt" Skip to search = "Zum Suchbereich" Skip to content = "Zum Inhalt" -Skip to facet = "Zu ihrem ausgewählten Suchfilter "%%filter_name%%" springen" +Skip to facet = "Zu ihrem ausgewählten Suchfilter '%%filter_name%%' springen" skip-to = "Zu" ; Overwrite, only in de.ini necessary: @@ -2072,3 +2074,6 @@ toggle-dropdown = "Untermenü aufklappen" missing_record_redirect = "Der aufgerufene Titel ist nicht vorhanden. Stattdessen wurde eine Suche ausgelöst" missing_record_exception = "Der aufgerufene Titel (%%id%%) ist nicht vorhanden." + +; #18611 unknown resolver state 10 +Unknown Electronic = "Titel ist beim Resolver-Service nicht bekannt" diff --git a/local/languages/en.ini b/local/languages/en.ini index d994b121481c5f626a65b8161dad27f838500e2d..807e7d4350ab48baab9f48c06ec2fa6891b7f24f 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -704,7 +704,7 @@ errorcode_empty_password = "Some data was missing. No password was submitted" errorcode_member_not_found = "The member number does not exist" errorcode_password_validation_error = "Your passed password is not correct" errorcode_empty_req_param_error = "All required fields have to be filled to submit successfully the form" -exclude_filter = "Exclude filter "%%filter_name%%"" +exclude_filter = "Exclude filter '%%filter_name%%'" exclude_newspapers = "Exclude Newspaper Articles" export_download = "Download File" export_exporting = "Creating Export File" @@ -847,6 +847,7 @@ create a new list = "Create a New List" page_reload_hint = "Page will refresh immediately" page_reload_on_select_hint = "Page will refresh when filter '%%filter_name%%' is selected" page_reload_on_deselect_hint = "Page will refresh when filter '%%filter_name%%' is deselected" +page_reload_on_xclude_hint = "Page will refresh when filter '%%filter_name%%' is selected for exclusion from the search results" password_too_short = "Too short" password_very_weak = "Very weak" password_weak = "Weak" @@ -1944,9 +1945,11 @@ Address-Contact-Hours = "Address, Contact" resolver_link_access_denied = "not available" resolver_link_access_limited = "Available in Campus LAN" resolver_link_access_open = "available" +resolver_link_access_unknown = "Record unknown to resolver" ; message to be shown upon empty resolver response no_resolver_links = "No online links available." + ; reset password reset_password_text = "Please complete the form below to reset your password. You will receive an email after we have completed resetting your password." Reset Password = "Reset Password" @@ -2093,7 +2096,7 @@ Modal_description = "This is a dialog window which overlays the main content of Skip_navigation_links = "Skip navigation links" Skip to search = "Skip to search" skip-to = "Skip to " -Skip to facet = "Skip to your selected search filter "%%filter_name%%"" +Skip to facet = "Skip to your selected search filter '%%filter_name%%'" License = "License" @@ -2159,3 +2162,6 @@ toggle-dropdown = "Toggle Dropdown" missing_record_redirect = "Record unavailable. You have been redirected to a search." missing_record_exception = "Record %%id%% is unavailable." + +; #18611 unknown resolver state 10 +Unknown Electronic = "Record is unknown to the resolver service" diff --git a/module/fid/config/address-collection.php b/module/fid/config/address-collection.php index f94da88e9273a485df4c20b83a5601a7c7b57959..197008c1e4346ecf84b9b9022f6603bbbb5dd71e 100644 --- a/module/fid/config/address-collection.php +++ b/module/fid/config/address-collection.php @@ -51,6 +51,9 @@ return [ 'options' => [ 'label' => 'label_address_0_line_1', ], + 'attributes' => [ + 'autocomplete' => "street-address" + ], ], ], 'line2' => [ @@ -59,7 +62,7 @@ return [ 'type' => Text::class, 'options' => [ 'label' => 'label_address_0_line_2', - ] + ], ], ], 'zip' => [ @@ -69,6 +72,9 @@ return [ 'options' => [ 'label' => 'label_address_0_zip', ], + 'attributes' => [ + 'autocomplete' => "postal-code" + ], ], ], 'city' => [ @@ -78,6 +84,9 @@ return [ 'options' => [ 'label' => 'label_address_0_city', ], + 'attributes' => [ + 'autocomplete' => "address-level2" + ], ], ], 'country' => [ diff --git a/module/fid/config/module.config.php b/module/fid/config/module.config.php index 74b728b9c8cd91cf378cf6c3b389dc022150af7a..bca6c65dbd6880b3885dfb686d62f04ed1ef4eb0 100644 --- a/module/fid/config/module.config.php +++ b/module/fid/config/module.config.php @@ -73,6 +73,8 @@ $config = [ 'fid-acquisition-subito-partial-copy-form' => require 'fid-acquisition-subito-partial-copy-form.php', 'fid-acquisition-digitization-form' => require 'fid-acquisition-digitization-form.php', 'fid-acquisition-digitization-missing-record-form' => require 'fid-acquisition-digitization-missing-record-form.php', + 'order-edit-form-basic' => require 'order-edit-form-basic.php', + 'order-edit-form-complete' => require 'order-edit-form-complete.php', PasswordResetModel::class => require 'password-reset-form.php', PasswordChangeModel::class => require 'password-change-form.php', UsernameChangeModel::class => require 'username-change-form.php', @@ -402,6 +404,17 @@ $config = [ ], ], ], + 'editOrder' => [ + 'type' => 'Zend\Router\Http\Segment', + 'options' => [ + 'route' => '/editOrder/[:orderid]', + 'defaults' => [ + 'controller' => UserController::class, + 'action' => 'editOrder', + 'orderid' => null + ], + ], + ], ], ], ], diff --git a/module/fid/config/order-edit-form-basic.php b/module/fid/config/order-edit-form-basic.php new file mode 100644 index 0000000000000000000000000000000000000000..8f2e97fda941b2cfd7eda803991f7ef23b55e768 --- /dev/null +++ b/module/fid/config/order-edit-form-basic.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright (C) 2021 Leipzig University Library + * + * 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. + * + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ +use fid\Hydrator\OrderUpdateHydrator; +use Zend\Form\Element\Submit; +use Zend\Form\Element\Date; + +return [ + 'name' => 'order-edit-form-basic', + 'hydrator' => OrderUpdateHydrator::class, + 'elements' => [ + 'status' => [ + 'spec' => [ + 'name' => 'status', + 'type' => Select::class, + 'options' => [ + 'label' => 'order_label_status', + ], + ], + ], + 'submit' => [ + 'spec' => [ + 'name' => 'submit', + 'type' => Submit::class, + 'attributes' => [ + 'value' => 'label_submit', + ], + ], + ], + ], + 'input_filter' => [ + 'status' => [ + 'name' => 'format', + 'required' => true, + ], + 'submit' => [ + 'name' => 'submit', + 'required' => true, + ], + ], +]; diff --git a/module/fid/config/order-edit-form-complete.php b/module/fid/config/order-edit-form-complete.php new file mode 100644 index 0000000000000000000000000000000000000000..17ece4d8cf4ec61f363778f5c93be0af8e1c3aa9 --- /dev/null +++ b/module/fid/config/order-edit-form-complete.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright (C) 2021 Leipzig University Library + * + * 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. + * + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ +use Zend\Form\Element\Date; + +$main_config = require 'order-edit-form-basic.php'; +unset($main_config['name']); + +$additional_config = [ + 'name' => 'order-edit-form-complete', + 'elements' => [ + 'due_date' => [ + 'spec' => [ + 'name' => 'due_date', + 'type' => Date::class, + 'options' => [ + 'label' => 'order_label_due_date', + ], + ], + ], + ], + 'input_filter' => [ + 'due_date' => [ + 'name' => 'due_date', + 'required' => false, + ], + ], +]; + +return array_merge_recursive($main_config, $additional_config); diff --git a/module/fid/config/user-create-form.php b/module/fid/config/user-create-form.php index 9a32a6917aed5231d1a543329b1bde7b33cfa882..1966695a5d3b32f62634c07bcb08881478bc7254 100644 --- a/module/fid/config/user-create-form.php +++ b/module/fid/config/user-create-form.php @@ -115,6 +115,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "given-name" ], ], ], @@ -127,6 +128,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "family-name" ], ], ], @@ -156,6 +158,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => 'organization-title' ], ], ], diff --git a/module/fid/config/user-init-form.php b/module/fid/config/user-init-form.php index 5ab7b2f2bb041100a9a2a0fb2c4478f205d769a8..61202452f589404b7376d77c8e2f86bda8670012 100644 --- a/module/fid/config/user-init-form.php +++ b/module/fid/config/user-init-form.php @@ -38,6 +38,7 @@ return [ 'elements' => [ 'username' => [ 'spec' => [ + 'id' => 'username', 'name' => 'username', 'type' => Email::class, 'options' => [ @@ -45,11 +46,13 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => 'email' ], ], ], 'username_confirmation' => [ 'spec' => [ + 'id' => 'username_confirmation', 'name' => 'username_confirmation', 'type' => Email::class, 'options' => [ @@ -57,6 +60,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => 'email' ], ], ], @@ -69,6 +73,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "given-name" ], ], ], @@ -81,6 +86,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "family-name" ], ], ], diff --git a/module/fid/config/user-update-form.php b/module/fid/config/user-update-form.php index 067e4686eb64d314d61c8eee0e8fd5a546053b16..c4d653b86b5add96ffc4b2fc1ae9875cbd401e36 100644 --- a/module/fid/config/user-update-form.php +++ b/module/fid/config/user-update-form.php @@ -78,6 +78,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "given-name" ], ], ], @@ -90,6 +91,7 @@ return [ ], 'attributes' => [ 'required' => true, + 'autocomplete' => "family-name" ], ], ], @@ -111,7 +113,7 @@ return [ 'type' => Text::class, 'options' => [ 'label' => 'label_college', - ] + ], ], ], 'addresses' => require 'address-collection.php', diff --git a/module/fid/src/AjaxHandler/GetResolverLinks.php b/module/fid/src/AjaxHandler/GetResolverLinks.php index c32f4083aa68432c365e1327e2e8028851f638a4..fcf3cce5f6dc8b2987821d8313209e499205191a 100644 --- a/module/fid/src/AjaxHandler/GetResolverLinks.php +++ b/module/fid/src/AjaxHandler/GetResolverLinks.php @@ -180,7 +180,7 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks // Render the links using the view: $view = [ 'openUrlBase' => $base, 'openUrl' => $openUrl, - 'electronic' => $electronic, 'services' => $services, + 'electronic' => $electronic, 'unknown' => $unknown, 'services' => $services, 'searchClassId' => $searchClassId, 'resolver' => $requestedResolver, 'moreOptionsLink' => $moreOptionsLink ]; diff --git a/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php b/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php index cd7fff820a0cbfb9beec148a608f9d2063831a67..85832745a15ac0db4f92d909f70cee892920a21f 100644 --- a/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php +++ b/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php @@ -35,6 +35,7 @@ use fid\Validator\SubitoPartialCopyPageSelection; use finc\View\Helper\Root\Citation; use VuFind\Controller\AbstractBase; use VuFind\Exception\Forbidden as ForbiddenException; +use Zend\Config\Config; use Zend\Form\Form; /** @@ -112,6 +113,9 @@ trait FidAcquisitionTrait $driver = $this->loadRecord(); $recordId = $driver->tryMethod('getUniqueID'); + //store current url in session for multi-step form (edit address) + $this->followup()->store(); + /** @var Form $form */ $form = $this->serviceLocator->get($this->formConfig); @@ -123,7 +127,8 @@ trait FidAcquisitionTrait $url = $this->getRecordUrl($recordId); $label = $this->getOrderLabel($driver); $type = $this->type; - $hydratorData = compact('type', 'driver', 'user', 'url', 'label'); + $status = $this->getDefaultStatus(); + $hydratorData = compact('type', 'driver', 'user', 'url', 'label', 'status'); $hydratorData += $this->addTypeSpecificOrderInformation($form); $form->getHydrator()->hydrate($hydratorData, $order = new Order()); $this->client->requestOrderCreation($order); @@ -131,6 +136,7 @@ trait FidAcquisitionTrait $message = $this->translate('fid::acquisition_success'); $messenger = $this->flashMessenger(); $messenger->addSuccessMessage($message); + $this->clearFollowupUrl(); return $this->redirect()->toRoute('record', ['id' => $recordId]); } else { $this->handleOptionalErrorMessages($form); @@ -229,6 +235,13 @@ trait FidAcquisitionTrait ] ]; } + if ($this->type == self::PDA) { + $data += [ + 'pda' => [ + 'comment' => $form->getData()['comment'] + ] + ]; + } return $data; } @@ -236,6 +249,15 @@ trait FidAcquisitionTrait { } + protected function getDefaultStatus() { + /** @var Config $config */ + $config = $this->getConfig('fid'); + if (isset($config[$this->type.'Edit']['statusOptions'])) { + return $this->getConfig('fid')[$this->type . 'Edit']['statusOptions'][0]; + } + else return null; + } + protected function runDigitizationMissingRecord() { if (!($user = $this->getUser())) { diff --git a/module/fid/src/Controller/UserController.php b/module/fid/src/Controller/UserController.php index 096fa3fa6ea61b32d68ff215eda737b90c8e0ed4..63db4919009f0e511905549777a993f789af7806 100644 --- a/module/fid/src/Controller/UserController.php +++ b/module/fid/src/Controller/UserController.php @@ -29,6 +29,7 @@ use fid\FormModel\UsernameChangeModel; use fid\Service\Client; use fid\Service\ClientException; use fid\Service\DataTransferObject\Library; +use fid\Service\DataTransferObject\Order; use fid\Service\DataTransferObject\User; use fid\Service\UserNotAuthorizedException; use VuFind\Auth\Manager as AuthManager; @@ -289,6 +290,10 @@ class UserController extends AbstractBase $form->prepare(); $viewModel = $this->createViewModel(); + // set cancel target if coming from lightbox + if ($cancelUrl = $this->getFollowupUrl()) { + $viewModel->setVariable('cancelUrl', $cancelUrl); + } $viewModel->setVariables(compact('form')); $viewModel->setTemplate('fid/user/update'); @@ -312,7 +317,9 @@ class UserController extends AbstractBase $form->getHydrator()->hydrate($data, $user); $this->client->requestUserUpdate($user); $message = $this->translate('fid::user_update_success'); - $messenger->addSuccessMessage($message); + // use InfoMessage instead of SuccessMessage to prevent hiding + // rendered view (formular) in lightbox + $messenger->addInfoMessage($message); } catch (ClientException $exception) { if (in_array($exception->getCode(), [403])) { $message = $this->translate('fid::user_update_error_' @@ -325,6 +332,12 @@ class UserController extends AbstractBase } $this->client->flushUserList(); + + if ($followUp = $this->getFollowupUrl()) { + $this->clearFollowupUrl(); + return $this->redirect()->toUrl($followUp); + } + return $this->redirect()->toRoute($redirect, [], [ 'query' => ['redirect' => false] ]); @@ -778,9 +791,11 @@ class UserController extends AbstractBase return $this->forceLogin(); } try { - $user = $this->client->requestUserDetails(); + $user = $this->client->requestUserDetails(null, true); $viewModel = $this->createViewModel(); - $viewModel->setVariable('orders', $user->getOrders()); + $orders = $user->getOrders(); + $displayCols = $this->config['OrderList']['displayCols']; + $viewModel->setVariables(compact('orders','displayCols')); $viewModel->setTemplate('fid/user/orders'); return $viewModel; } catch (ClientException $exception) { @@ -797,7 +812,8 @@ class UserController extends AbstractBase try { $orders = $this->client->requestOrderList(); $viewModel = $this->createViewModel(); - $viewModel->setVariables(compact('orders')); + $displayCols = $this->config['OrderList']['displayCols']; + $viewModel->setVariables(compact('orders','displayCols')); $viewModel->setTemplate('fid/user/admin-orders'); return $viewModel; } catch (UserNotAuthorizedException $exception) { @@ -880,4 +896,92 @@ class UserController extends AbstractBase $jobTitleElement->setValueOptions($options); } } + + public function editOrderAction() + { + if (!$this->getUser()) { + return $this->forceLogin(); + } + + /** @var Request $request */ + $request = $this->getRequest(); + $orderId = $this->params()->fromRoute('orderid'); + if (empty($orderId)) { + // if no order ID is set the call is not valid + return $this->redirect()->toRoute('fid/admin/orders'); + } + + try { + $this->permission()->check('fid.EditOrder', 'exception'); + $order = $this->client->requestOrder($orderId); + } catch (\Exception $ex) { + $this->getMessenger() + ->addErrorMessage($this->translate('fid::edit_order_error')); + return $this->redirect()->toRoute('fid/admin/orders'); + } + + $recordId = $order->getRecordId(); + $driver = $recordId ? $this->getRecordLoader()->load($recordId) : null; + + /** @var Form $form */ + /** @var Select $statusElement */ + $form = $this->config[$order->getType()."Edit"]['form'] + ? $this->serviceLocator->get('order-edit-form-'.$this->config[$order->getType()."Edit"]['form']) + : null; + $this->applyStatusOptions($form,$order->getType()); + + if ($this->formWasSubmitted()) { + $form->setData($request->getPost()); + if ($form->isValid()) { + return $this->updateOrder($form, $order); + } + } else { + $form->setData($form->getHydrator()->extract($order)); + } + + $action = $this->url()->fromRoute('fid/admin/editOrder', [ + 'orderid' => $order->getId() + ]); + $form->setAttribute('action', $action); + $form->prepare(); + + $config = $this->config; + $viewModel = $this->createViewModel(); + $viewModel->setVariables(compact('config', 'form', 'order', 'driver')); + $viewModel->setTemplate('fid/order/order-edit'); + + return $viewModel; + } + + protected function applyStatusOptions($form, $type) + { + if ($statusOptions = $this->config["{$type}Edit"]['statusOptions'] ?? null) { + $options = []; + foreach ($statusOptions as $statusOption) { + $options[] = [ + 'value' => $statusOption, + 'label' => $this->translate('fid::status_'.$statusOption), + ]; + } + $statusElement = $form->get('status'); + $statusElement->setValueOptions($options); + } + } + + protected function updateOrder(Form $form, Order $order) { + $data = $form->getData(); + $messenger = $this->getMessenger(); + + try { + $form->getHydrator()->hydrate($data, $order); + $this->client->requestOrderUpdate($order); + $message = $this->translate('fid::order_update_success'); + $messenger->addSuccessMessage($message); + } catch (\Exception $ex) { + $message = $this->translate('fid::order_update_error'); + $messenger->addErrorMessage($message); + } + + return $this->redirect()->toRoute('fid/admin/orders'); + } } diff --git a/module/fid/src/Hydrator/OrderHydrator.php b/module/fid/src/Hydrator/OrderHydrator.php index 333c1367dfb70f9aa4b20cefc8ab3c0a81fabc9a..e1acefc7b887e929320100e5e3ba631aeff2698c 100644 --- a/module/fid/src/Hydrator/OrderHydrator.php +++ b/module/fid/src/Hydrator/OrderHydrator.php @@ -29,6 +29,7 @@ class OrderHydrator extends AbstractHydrator { $partialCopy = array_key_exists('subitoPartialCopy', $data) ? $data['subitoPartialCopy'] : null; $digitization = array_key_exists('digitization', $data) ? $data['digitization'] : null; + $pda = array_key_exists('pda', $data) ? $data['pda'] : null; /* Collect needed record data */ $id = $driver->tryMethod('getUniqueID'); @@ -70,7 +71,8 @@ class OrderHydrator extends AbstractHydrator { 'url' ); - $object->setData(compact('record','partialCopy','digitization')); + $object->setData(compact('record','partialCopy','digitization','pda')); + $object->setStatus($data['status']); $object->setLabel($data['label']); return; } diff --git a/module/fid/src/Hydrator/OrderMissingRecordHydrator.php b/module/fid/src/Hydrator/OrderMissingRecordHydrator.php index 87519536e79d6ce2f841389b2ba2a3a87c9169ce..5a53dbe855379fe2937e79ad43a3ace92fa4c9dc 100644 --- a/module/fid/src/Hydrator/OrderMissingRecordHydrator.php +++ b/module/fid/src/Hydrator/OrderMissingRecordHydrator.php @@ -25,9 +25,10 @@ class OrderMissingRecordHydrator extends AbstractHydrator { $digitization = array_key_exists('digitization', $data) ? $data['digitization'] : null; $partialCopy = null; + $pda = null; $record = null; - $object->setData(compact('record','partialCopy','digitization')); + $object->setData(compact('record','partialCopy','digitization','pda')); $object->setLabel($data['label']); return; } diff --git a/module/fid/src/Hydrator/OrderUpdateHydrator.php b/module/fid/src/Hydrator/OrderUpdateHydrator.php new file mode 100644 index 0000000000000000000000000000000000000000..8a28353c8b1f303c61c10b1ec3e5b3740c05f067 --- /dev/null +++ b/module/fid/src/Hydrator/OrderUpdateHydrator.php @@ -0,0 +1,31 @@ +<?php +namespace fid\Hydrator; + +use fid\Service\DataTransferObject\Order; +use Zend\Hydrator\AbstractHydrator; + +class OrderUpdateHydrator extends AbstractHydrator { + + const DATE_FORMAT = 'Y-m-d'; + + public function extract($object) + { + $retval['due_date'] = $object->getDueDate() ? $object->getDueDate()->format(self::DATE_FORMAT) : ''; + $retval['status'] = $object->getStatus() ?? 'open'; + return $retval; + } + + /** + * @param array $data + * @param Order|object $object + * @return Order|object|void + */ + public function hydrate(array $data, $object) + { + $data['status'] ? $object->setStatus($data['status']) : null; + !empty($data['due_date']) + ? $object->setDueDate(\DateTime::createFromFormat(self::DATE_FORMAT, $data['due_date'])) + : null; + return $object; + } +} diff --git a/module/fid/src/Service/Client.php b/module/fid/src/Service/Client.php index 531e760e3f96869f00cb708d3f68e14b0c67fdee..ca678cb2781eeaa67a2e0087990003ef8809b93b 100644 --- a/module/fid/src/Service/Client.php +++ b/module/fid/src/Service/Client.php @@ -287,6 +287,46 @@ class Client return array_combine($keys, $list); } + /** + * @return Order|null + * @throws ClientException + * @throws UserNotAuthorizedException + */ + public function requestOrder($orderId = null): ?Order + { + $request = $this->buildRequest('get', "orders/$orderId"); + $response = $this->sendAuthenticatedRequest($request); + + if ($response->getStatusCode() !== 200) { + $this->throwException($response); + } + + /** @var Order $order */ + $order = $this->serializer->deserialize((string)$response->getBody(), + Order::class, 'json'); + + return $order; + } + + /** + * @param Order $user + * @return bool + * @throws ClientException + */ + public function requestOrderUpdate(Order $order) : bool + { + $body = $this->serializer->serialize($order, 'json', ['groups' => ['order:update:request']]); + $request = $this->buildRequest('put', "orders/{$order->getId()}", $body); + $response = $this->sendAuthenticatedRequest($request); + + if ($response->getStatusCode() !== 200) { + $this->throwException($response); + return false; + } + + return true; + } + /** * @param string $baseUrl * @param string $username diff --git a/module/fid/src/Service/DataTransferObject/Address.php b/module/fid/src/Service/DataTransferObject/Address.php index 7ea09cd11bfb1493a6368b2c80d2c7bcb21097c7..b9fdf0c696d8be2ba2eb659d2959844a7f2b0184 100644 --- a/module/fid/src/Service/DataTransferObject/Address.php +++ b/module/fid/src/Service/DataTransferObject/Address.php @@ -217,4 +217,10 @@ class Address { return $this->id.': '. $this->line1.' '.$this->line2.'; '.$this->zip.' '.$this->city.'; '.$this->country; } + + public function isCompleteAddress () : bool { + return strlen($this->line1) > 0 + && strlen($this->zip) > 0 + && strlen($this->city) > 0; + } } diff --git a/module/fid/src/Service/DataTransferObject/Order.php b/module/fid/src/Service/DataTransferObject/Order.php index 51863f887a8ea3918357a8662023cfbd21177222..caf48778a971acf3b7f7e449259199a89cbcea08 100644 --- a/module/fid/src/Service/DataTransferObject/Order.php +++ b/module/fid/src/Service/DataTransferObject/Order.php @@ -32,6 +32,7 @@ class Order * @Groups({ * "order:creation:response", * "order:list:response", + * "order:update:request", * "user:details:response", * "user:creation:response", * "user:update:response" @@ -44,6 +45,7 @@ class Order * @Groups({ * "order:creation:request", * "order:creation:response", + * "order:update:request", * "order:list:response", * "user:details:response", * "user:creation:response", @@ -58,6 +60,7 @@ class Order * "order:creation:request", * "order:creation:response", * "order:list:response", + * "order:update:request", * "user:details:response", * "user:creation:response", * "user:update:response" @@ -71,6 +74,7 @@ class Order * "order:creation:request", * "order:creation:response", * "order:list:response", + * "order:update:request", * "user:details:response", * "user:creation:response", * "user:update:response" @@ -83,6 +87,7 @@ class Order * @Groups({ * "order:creation:request", * "order:creation:response", + * "order:update:request", * "order:list:response", * "user:details:response", * "user:creation:response", @@ -96,6 +101,7 @@ class Order * @Groups({ * "order:creation:response", * "order:list:response", + * "order:update:request", * "user:details:response", * "user:creation:response", * "user:update:response" @@ -103,6 +109,8 @@ class Order */ protected $createdAt; + const DATETIME_FORMAT = 'Y-m-d H:i:s'; + /** * @return string|null */ @@ -203,4 +211,60 @@ class Order { return $this->getLabel(); } + + public function getDueDate(): ? \DateTime + { + return (!empty($this->data['dueDate'])) + ? \DateTime::createFromFormat(self::DATETIME_FORMAT,$this->data['dueDate']) + : null; + } + + /** + * @param \DateTime $dueDate + */ + public function setDueDate(\DateTime $date) + { + $data = $this->getData(); + $data['dueDate'] = $date->format(self::DATETIME_FORMAT); + $this->setData($data); + } + + public function displayDueDate(): String + { + return $this->getDueDate() ? $this->getDueDate()->format('d.m.Y') : ''; + } + + public function isOverdue () : bool + { + if ($duedate = $this->getDueDate()) + { + $now = new \DateTime(); + return $now > $duedate ? true : false; + } + else { + return false; + } + } + + /** + * @return string + */ + public function getStatus(): ? string + { + return $this->data['status'] ?? null; + } + + /** + * @param string $status + */ + public function setStatus(?string $status): void + { + if($status != null) { + $this->data['status'] = $status; + } + } + + public function getRecordId() { + return $this->data['record']['id'] ?? null; + } } \ No newline at end of file diff --git a/module/finc/config/dds-form.php b/module/finc/config/dds-form.php index 1fcb1903776403d48a9eebca09448e08b83a3a72..3d081ae7e0a56aed9ab83d2dfb1ebbc9c5867e98 100644 --- a/module/finc/config/dds-form.php +++ b/module/finc/config/dds-form.php @@ -119,7 +119,7 @@ return [ 'disable_inarray_validator' => true, ], 'attributes' => [ - 'required' => false, + 'required' => true, 'id' => 'department', ], ], diff --git a/module/finc/src/finc/AjaxHandler/GetResolverLinks.php b/module/finc/src/finc/AjaxHandler/GetResolverLinks.php index ede2a0813fb502a8cf97cba198d2245d09ecf18f..fc94801bd8fe6483c199890a18fcc27874ec86e7 100644 --- a/module/finc/src/finc/AjaxHandler/GetResolverLinks.php +++ b/module/finc/src/finc/AjaxHandler/GetResolverLinks.php @@ -31,8 +31,9 @@ */ namespace finc\AjaxHandler; -use VuFind\Resolver\Driver\PluginManager as ResolverManager; use VuFind\Resolver\Connection; +use VuFind\Resolver\Driver\DriverInterface; +use VuFind\Resolver\Driver\PluginManager as ResolverManager; use VuFind\Session\Settings as SessionSettings; use Zend\Config\Config; use Zend\Mvc\Controller\Plugin\Params; @@ -62,7 +63,6 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks */ protected $resolverConfig; - /** * Constructor * @@ -70,7 +70,7 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks * @param ResolverManager $pm Resolver driver plugin manager * @param RendererInterface $renderer View renderer * @param Config $config Top-level VuFind configuration (config.ini) - * @param Config $resolver Top-level VuFind configuration (Resolver.ini) + * @param Config $resolver Link Resolver configuration (Resolver.ini) */ public function __construct( SessionSettings $ss, @@ -98,16 +98,17 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks { $this->disableSessionWrites(); // avoid session write timing bug $openUrl = $params()->fromQuery('openurl', ''); - $requestedResolver = $params()->fromQuery('resolvertype', ''); + $resolver = $params()->fromQuery('resolvertype', ''); $searchClassId = $params()->fromQuery('searchClassId', ''); //$config = $this->getConfig('Resolver'); $resolvers = explode(',', $this->resolverConfig->General->active_resolvers); - if (in_array($requestedResolver, $resolvers) - && isset($this->resolverConfig->$requestedResolver)) { - $resolverType = isset($this->resolverConfig->$requestedResolver->resolver) - ? $this->resolverConfig->$requestedResolver->resolver : 'generic'; + if (in_array($resolver, $resolvers) + && isset($this->resolverConfig->$resolver) + ) { + $resolverType = isset($this->resolverConfig->$resolver->resolver) + ? $this->resolverConfig->$resolver->resolver : 'generic'; if (!$this->pluginManager->has($resolverType)) { return $this->formatResponse( $this->translate("Could not load driver for $resolverType"), @@ -115,64 +116,81 @@ class GetResolverLinks extends \VuFind\AjaxHandler\GetResolverLinks ); } - $resolver = new Connection($this->pluginManager->get($resolverType)); - if (isset($this->resolverConfig->$requestedResolver->resolver_cache)) { - $resolver->enableCache( - $this->resolverConfig->$requestedResolver->resolver_cache + /** + * Loaded Resolver + * + * @var DriverInterface $resolverObject + */ + $resolverObject + = new Connection($this->pluginManager->get($resolverType)); + if (isset($this->resolverConfig->$resolver->resolver_cache)) { + $resolverObject->enableCache( + $this->resolverConfig->$resolver->resolver_cache ); } - $result = $resolver->fetchLinks($openUrl); + $result = $resolverObject->fetchLinks($openUrl); // Sort the returned links into categories based on service type: - $electronic = $print = $services = []; + $electronic = $print = $services = $unknown = []; foreach ($result as $link) { - switch (isset($link['service_type']) ? $link['service_type'] : '') { - case 'getHolding': - $print[] = $link; - break; - case 'getWebService': - $services[] = $link; - break; - case 'getDOI': - // Special case -- modify DOI text for special display: - $link['title'] = $this->translate('Get full text'); - $link['coverage'] = ''; - break; - case 'getFullTxt': - default: - $electronic[] = $link; - break; + switch ($link['service_type'] ?? '') { + case 'getHolding': + $print[] = $link; + break; + case 'getWebService': + $services[] = $link; + break; + case 'getDOI': + // Special case -- modify DOI text for special display: + $link['title'] = $this->translate('Get full text'); + $link['coverage'] = ''; + break; + case 'unknown': + $unknown[] = $link; + break; + case 'getFullTxt': + default: + $electronic[] = $link; + break; } } // Get the OpenURL base: - if (isset($this->resolverConfig->$requestedResolver) - && isset($this->resolverConfig->$requestedResolver->url) + if (isset($this->resolverConfig->$resolver) + && isset($this->resolverConfig->$resolver->url) ) { - // Trim off any parameters (for legacy compatibility -- default config - // used to include extraneous parameters): + // Trim off any parameters (for legacy compatibility + // -- default config used to include extraneous parameters): list($base) = explode( '?', - $this->resolverConfig->$requestedResolver->url + $this->resolverConfig->$resolver->url ); } else { $base = false; } - $moreOptionsLink = $resolver->supportsMoreOptionsLink() - ? $resolver->getResolverUrl($openUrl) : ''; + $moreOptionsLink = $resolverObject->supportsMoreOptionsLink() + ? $resolverObject->getResolverUrl($openUrl) : ''; // Render the links using the view: - $view = [ - 'openUrlBase' => $base, 'openUrl' => $openUrl, 'print' => $print, - 'electronic' => $electronic, 'services' => $services, - 'searchClassId' => $searchClassId, 'resolver' => $requestedResolver, - 'moreOptionsLink' => $moreOptionsLink - ]; + $html = $this->renderer->render( + 'ajax/resolverLinks.phtml', + compact( + 'openUrlBase', 'openUrl', 'print', + 'electronic', 'unknown', 'services', + 'searchClassId', 'resolver', + 'moreOptionsLink' + ) + ); + + // output HTML encoded in JSON object + return $this->formatResponse(compact('html')); } - $html = $this->renderer->render('ajax/resolverLinks.phtml', $view); - // output HTML encoded in JSON object - return $this->formatResponse(compact('html')); + // if we get here, the requested resolver is not configured + return $this->formatResponse( + $this->translate("Resolver $resolver not configured"), + self::STATUS_HTTP_ERROR + ); } } diff --git a/module/finc/src/finc/Controller/Admin/I18nController.php b/module/finc/src/finc/Controller/Admin/I18nController.php index 7052a038b9d04e14d16ef0be2e2c8b4e4e37eafd..b29ba1e16acb2fc1ad1e34c4f2f7eafd220b1345 100644 --- a/module/finc/src/finc/Controller/Admin/I18nController.php +++ b/module/finc/src/finc/Controller/Admin/I18nController.php @@ -62,6 +62,11 @@ class I18nController extends AbstractAdmin */ protected $translations; + /** + * @var string + */ + private $locale; + /** * I18nController constructor. * @@ -92,21 +97,21 @@ class I18nController extends AbstractAdmin { $params = $this->params(); $defaultLocale = array_keys($this->languages)[0]; - $locale = $params->fromQuery('locale', $defaultLocale); + $this->locale = $locale = $params->fromQuery('locale', $defaultLocale); $domain = $params->fromQuery('domain', 'default'); $translations = $this->getTranslations(); $defaultTranslations = $this->getDefaultTranslations(); - foreach (array_keys($translations[$locale]) as $name) { + foreach (array_keys($translations[$this->locale]) as $name) { $selected = $name === $domain; $domains[$name] = compact('name', 'selected'); } $languages = array_map( - function ($lang) use ($locale) { + function ($lang) { $langLocale = $lang['locale']; - $selected = $langLocale === $locale; + $selected = $langLocale === $this->locale; return $lang + compact('selected'); }, $this->languages @@ -135,11 +140,11 @@ class I18nController extends AbstractAdmin $params = $this->params(); $view->setVariables( [ - 'locale' => $locale = $params->fromPost('locale'), - 'language' => $this->languages[$locale]['name'], - 'domain' => $params->fromPost('domain'), - 'token' => $params->fromPost('token'), - 'value' => $params->fromPost('value'), + 'locale' => $locale = $params->fromPost('locale'), + 'language' => $this->languages[$locale]['name'], + 'domain' => $params->fromPost('domain'), + 'token' => $params->fromPost('token'), + 'value' => $params->fromPost('value'), 'defaultValue' => $params->fromPost('default_value') ] ); @@ -186,14 +191,12 @@ class I18nController extends AbstractAdmin protected function loadTranslations(array $dirs) { - foreach (array_keys($this->languages) as $locale) { - foreach ($this->getDomains() as $domain) { - $translations[$locale][$domain] = $this->loadMessages( - $dirs, - $domain, - $locale - ); - } + foreach ($this->getDomains() as $domain) { + $translations[$this->locale][$domain] = $this->loadMessages( + $dirs, + $domain, + $this->locale + ); } return $translations ?? []; diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index fd6dee3b7a9956b03b1e90bff2d47e4b69205f09..4dbb8c94e4b9546cae0e9e32304a6b741760f398 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -632,6 +632,14 @@ class FincILS extends PAIA implements LoggerAwareInterface (string)$vcard->{'X-LIBRARY-ILS-PATRON-EDIT-ALLOW'} ); } + if (isset($vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-INDICATOR'})) { + $statuscodeInd + = (string)$vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-INDICATOR'}; + } + if (isset($vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-DESCRIPTION'})) { + $statuscodeDesc + = (string)$vcard->{'X-LIBRARY-BORROWER-BLACK-LIST-DESCRIPTION'}; + } } catch (Exception $e) { throw $e; } diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 0be113ea6225f2a6dd7266abcc338b90ebedd313..ba947ac8b20434c701bdd108c0dce3e71c53ee69 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -192,6 +192,9 @@ trait SolrMarcFincTrait if (!empty($subresult)) { foreach ($subresult as $perIndicator2) { + if (empty($perIndicator2)) { + continue; + } foreach ($perIndicator2 as $current) { // If entry doesn't exist so far write // to return variable. @@ -401,6 +404,22 @@ trait SolrMarcFincTrait return $retval; } + public function getDOI () { + + $allIdentifiers = $this->getOtherIdentifiers(); + $dois = $allIdentifiers['doi'] ?? []; + if (!empty($dois)) { + return current($dois); + } + $urls = $this->getURLs(); + foreach ($urls as $url) { + if (strpos($url['url'],'https://doi.org/') === 0) { + return substr($url['url'],16); + } + } + return null; + } + /** * Get an array of instrumentation notes taken from the local data * of the Petrucci music library subfield 590b @@ -419,7 +438,11 @@ trait SolrMarcFincTrait */ public function getISSNs() { - return $this->getFieldArray('022', ['a']); + $fromMarc = $this->getFieldArray('022', ['a']); + if (empty($fromMarc)) { + return parent::getISSNs(); + } + return $fromMarc; } /** diff --git a/module/finc/src/finc/Resolver/Driver/Ezb.php b/module/finc/src/finc/Resolver/Driver/Ezb.php index 49010ca04e3bcf9c791a0fca8348f8aa7686333e..7af473597cbf46b43a116ae674bfc6d1def1f5b0 100644 --- a/module/finc/src/finc/Resolver/Driver/Ezb.php +++ b/module/finc/src/finc/Resolver/Driver/Ezb.php @@ -115,6 +115,15 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface $parsed[$tmp2[0]] = $tmp2[1]; } + // resolver only accepts date formats YYYY, YYYY-MM, and YYYY-MM-DD + // in case we have a date in another format, drop the date information + if ( + isset($parsed['rft.date']) + && !preg_match('/^\d{4}(-\d\d(-\d\d)?)?$/',$parsed['rft.date']) + ) { + unset($parsed['rft.date']); + } + // Downgrade 1.0 to 0.1 if ($parsed['ctx_ver'] == 'Z39.88-2004') { $openURL = $this->downgradeOpenUrl($parsed); @@ -122,16 +131,18 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface if (isset($this->config->bibid)) { - $openURL .= '&pid=' . - 'bibid%3D' . $this->config->bibid; + $pid = 'bibid=' . $this->config->bibid; } else { // use IP-based request as fallback - $openURL .= '&pid=client_ip%3D' . $_SERVER['REMOTE_ADDR']; + $pid = 'client_ip=' . $_SERVER['REMOTE_ADDR']; } - $openURL .= !isset($parsed['rft.issn']) && isset($parsed['zdbid']) ? + $pid .= !isset($parsed['rft.issn']) && isset($parsed['zdbid']) ? '&zdbid=' . $parsed['zdbid'] : ''; + $pid .= '&ezb=1'; + + $openURL .= '&pid=' . urlencode($pid); - $openURL .= urlencode('&ezb=1'); + $openURL .= isset($parsed['doi']) ? '&id=doi:' . $parsed['doi'] : ''; $url = $this->getResolverUrl($openURL); @@ -167,10 +178,12 @@ class Ezb extends AbstractBase implements TranslatorAwareInterface $this->getElectronicResults('2', 'Licensed', $records, $xpath); $this->getElectronicResults('3', 'Partially licensed', $records, $xpath); $this->getElectronicResults('4', 'Not free', $records, $xpath); + $this->getElectronicResults('10', 'Unknown Electronic', $records, $xpath); // get results for print, only if available $this->getPrintResults('2', 'Print available', $records, $xpath); $this->getPrintResults('3', 'Print partially available', $records, $xpath); + $this->getPrintResults('10', 'Unknown Print', $records, $xpath); return $records; } diff --git a/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_fullrecord.txt b/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_fullrecord.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f026ebd72b67266d4fe46891bc1e3b4c9c8e1ef --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_fullrecord.txt @@ -0,0 +1 @@ +03910nam a22009732 45000010013000000030007000130050017000200070015000370080041000520240039000930350023001320350026001550350022001810400031002030410008002340840043002421000030002852450247003152460014005622640009005763000037005853360026006223370032006483380037006805000057007175020058007745060106008325330104009385350015010425400083010575400104011405830068012446550091013127510074014037760214014778500007016918560114016988560119018129120016019319360192019479510007021398520032021468560065021788520031022439700007022749710010022819720010022919730007023019350009023088520016023178520018023338520017023518520017023688520018023858520016024038520018024198520018024378520018024558520017024738520017024908520018025078520017025258560065025428520031026079700007026389710010026459720010026559730007026659350009026728520016026818520018026978520017027158520017027328520018027498520016027678520018027838520018028018520018028198520017028378520017028548520018028718520017028899800030029060-1763648745DE-62720210719201444.0cr uuu---uuuuu210719s1965 xx |||||om 00| ||ger c7 aurn:nbn:de:bsz:15-0020-3325332urn a(DE-627)1763648745 a(DE-599)KXP1763648745 a(OCoLC)1260628169 aDE-627bgercDE-627erakwb ager aZX 70002rvk0(DE-625)rvk/158439:142571 aGöldner, Karl-Heinz4aut10aZum gegenseitigen Führen, Ein- und Unterordnen der Schüler im Sportunterrichtbein Beitrag zur Erziehung der Schüler zur Kollektivität im Sportunterricht; dargestellt auf der Grundlage eines pädagogischen ExperimentscKarl-Heinz Göldner30aEinordnen 1c1965 aIX, 200, XXVI Bl.bgraph. Darst. aTextbtxt2rdacontent aComputermedienbc2rdamedia aOnline-Ressourcebcr2rdacarrier aWahrnehmung der Rechte durch die VG Wort (§ 51 VGG) aLeipzig, Dt. Hochsch. für Körperkultur, Diss., 19650 qDE-15aOpen AccesseControlled Vocabulary for Access Rightsuhttp://purl.org/coar/access_right/c_abf2 aOnline-AusgabebLeipzigcUniversitätsbibliothek Leipzigd2020e1 Online-Ressource7|2020||||||||||1 aUB Leipzig qDE-15aUrheberrechtsschutz 1.02rsuhttp://rightsstatements.org/vocab/InC/1.0/ qDE-15aFreier Zugang - Rechte vorbehalten 1.0fUBL FZ-RV 1.0uhttps://www.ub.uni-leipzig.de/fz-rv-11 aArchivierung/Langzeitarchivierung gewährleistet2pdager5DE-15 7aHochschulschrift0(DE-588)4113937-90(DE-627)1058257780(DE-576)2094805802gnd-content aLeipzig0(DE-588)4035206-70(DE-627)1047989980(DE-576)2090112464uvp08iElektronische Reproduktion vonaGöldner, Karl-HeinztZum gegenseitigen Führen, Ein- und Unterordnen der Schüler im Sportunterrichtd1965hIX, 200, XXVI Bl.w(DE-627)142511671Xw(DE-576)355116715nUB Leipzig aaa40uhttp://nbn-resolving.org/urn:nbn:de:bsz:15-0020-332533xDigitalisierungyOnline-Zugriffzkostenfrei3Volltext42uhttps://iiif.ub.uni-leipzig.de/0000030933/manifest.jsonmB:DE-15qapplication/jsonxDigitalisierungyIIIF-Manifest aZDB-175-LHSrvaZX 7000bAllgemeines; EinführungenkSportkSportwissenschaftkTheorie des SportskAllgemeineskAllgemeines; Einführungen0(DE-627)139653542X0(DE-625)rvk/158439:142570(DE-576)32653542X aBO aDE-15z2021-07-19T00:00:00Z40uhttp://nbn-resolving.org/urn:nbn:de:bsz:15-0020-3325339LFER aLFERz2021-08-10T19:50:52Z cOD cEBOOK cEBOOK cEB alfer 2lferaDE-15 2lferaDE-Brt1 2lferaDE-Rs1 2lferaDE-Ch1 2lferaDE-L229 2lferaDE-14 2lferaDE-Pl11 2lferaDE-Gla1 2lferaDE-Zwi2 2lferaDE-Zi4 2lferaDE-Bn3 2lferaDE-D161 2lferaDE-10540uhttp://nbn-resolving.org/urn:nbn:de:bsz:15-0020-3325339LFER aLFERz2021-09-14T20:01:17Z cOD cEBOOK cEBOOK cEB alfer 2lferaDE-15 2lferaDE-Brt1 2lferaDE-Rs1 2lferaDE-Ch1 2lferaDE-L229 2lferaDE-14 2lferaDE-Pl11 2lferaDE-Gla1 2lferaDE-Zwi2 2lferaDE-Zi4 2lferaDE-Bn3 2lferaDE-D161 2lferaDE-105 a1763648745b0k1763648745 \ No newline at end of file diff --git a/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_result.json b/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_result.json new file mode 100644 index 0000000000000000000000000000000000000000..9d36b72bea9d58cd7b95cc97aa6aa4c4d07d15bf --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/IIIF_0-1763648745_result.json @@ -0,0 +1,12 @@ +[ + { + "url": "http://nbn-resolving.org/urn:nbn:de:bsz:15-0020-332533", + "desc": "Full Text", + "indicators": "40" + }, + { + "url": "https://iiif.ub.uni-leipzig.de/0000030933/manifest.json", + "desc": "IIIF-Manifest, Digitalisierung", + "indicators": "42" + } +] \ No newline at end of file diff --git a/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_fullrecord.txt b/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_fullrecord.txt new file mode 100644 index 0000000000000000000000000000000000000000..5275de52855b249f62aba0d672f13f65736ac6fc --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_fullrecord.txt @@ -0,0 +1 @@ +03104naa a2200997 45000010013000000030007000130050017000200070015000370080041000520240041000930350023001340350022001570350025001790400031002040410008002350820008002431000091002512450062003422640051004043000021004553360026004763370032005023380037005345910065005716500071006366500076007076500074007836510070008579510007009278560083009348520032010179500009010499500014010589500017010729500010010899500015010999500028011149500018011429500011011609500011011719500015011829500009011979500010012069500015012169500014012319500014012459500025012599500029012849500035013139500016013489500012013649500018013769500015013949500015014099500023014249500030014479500009014779500039014869500031015259500009015569500042015659500048016079500041016559500010016969500040017069500009017469500011017559500027017669500007017939500015018009500025018159500026018409500022018669500020018889500019019089500014019279500013019419500015019549500017019699500017019869500015020039510010020189510010020288520027020389800041020650-1497294835DE-62720150306122414.0cr uuu---uuuuu150306s2015 xx |||||o 00| ||eng c7 aurn:nbn:de:bsz:15-qucosa-1619432urn a(DE-627)1497294835 a(DE-576)427294835 a(DE-599)BSZ427294835 aDE-627bgercDE-627erakwb aeng0 a7911 aStoppe, Sebastiand1978-0(DE-588)13178076X0(DE-627)6633567330(DE-576)34640150X4aut10aHow predictable are the Academy Awards?cSebastian Stoppe 1aLeipzigbUniversitätsbibliothek Leipzigc2015 aOnline-Ressource aTextbtxt2rdacontent aComputermedienbc2rdamedia aOnline-Ressourcebcr2rdacarrier aworkingPaper ; IMD-Felder und 1131 maschinell ergänzt (SWB)070(DE-588)4017102-40(DE-627)1045596830(DE-576)208918531aFilm2gnd070(DE-588)4204337-20(DE-627)10514410X0(DE-576)210161345aFilmpreis2gnd070(DE-588)4005227-80(DE-627)1047680290(DE-576)208859845aUmfrage2gnd 70(DE-588)4078704-70(DE-627)1060766120(DE-576)209209682aUSA2gnd aAR4 uhttp://nbn-resolving.de/urn:nbn:de:bsz:15-qucosa-161943yOnline-Zugriff9DE-15 aDE-15z2015-03-06T12:24:14Z aKino aSpielfilm aFilmaufnahme aFilme aSpielfilme aAudiovisuelles Material aVideokassette a电影 a電影 aФильм aFilm aPreis aFilmpreise a电影奬 a電影奬 aÐšÐ¸Ð½Ð¾Ð¿Ñ€ÐµÐ¼Ð¸Ñ aUnited States of America aVereinigte Staaten von Amerika aNordamerika aAmerika aUnited States aEtats Unis aEtats-Unis aVereinigte Staaten aEstados Unidos de America aEEUU aVereinigte Staaten von Nordamerika aSoedinennye Å taty Ameriki aSÅ A aStany Zjednoczone Ameryki Północnej aHÄ“nÅmenai Politeiai tÄ“s Boreiu AmerikÄ“s aHÄ“nÅmenes Politeies tÄ“s AmerikÄ“s aHÄ“PA aÄ’nÅmenes Politeies tÄ“s AmerikÄ“s aÄ’PA aMeiguo aEtats-Unis d'Amérique aUS aAmerikaner aBevölkerungsumfrage aRepräsentativumfrage aMeinungsbefragung aMeinungsumfrage aVolksbefragung aBefragung aUmfragen aDemoskopie aæ°‘æ„调查 aæ°‘æ„調查 aÐžÐ¿Ñ€Ð¾Ñ aXD-US bXA-DE 2fincaFID-MEDIEN-DE-15 a1497294835b0k1497294835o427294835 \ No newline at end of file diff --git a/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_result.json b/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_result.json new file mode 100644 index 0000000000000000000000000000000000000000..199d5009e410306fff651d44e7944e83341086b1 --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/isil_with_DE-15_0-1497294835_result.json @@ -0,0 +1,7 @@ +[ + { + "url": "http://nbn-resolving.de/urn:nbn:de:bsz:15-qucosa-161943", + "desc": "Online-Zugriff", + "indicators": "4 " + } +] \ No newline at end of file diff --git a/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_fullrecord.txt b/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_fullrecord.txt new file mode 100644 index 0000000000000000000000000000000000000000..79c2b4b3541ca68917fa5a65e77a41e1dabec97c --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_fullrecord.txt @@ -0,0 +1 @@ +01725cam a2200397157450000100200000000700150002000800390003504100080007403700360008210000220011824500440014026000790018452005410026350000170080485600780082165000340089965000150093365000220094865000210097065000090099165000350100065000110103565000140104665000190106065000260107965000110110565000220111665000190113865000090115765000200116665000290118665000100121565000110122508200080123698000830124422-15-qucosa-161943cr |||||||||||150101s2015 xx eng aeng nurn:nbn:de:bsz:15-qucosa-161943 aStoppe, Sebastian aHow predictable are the Academy Awards? bUniversitätsbibliothek Leipzigc2015g(issued 2015-03-06)9(created 2015)3 aBy conducting an explorative study it is tried to determine whether a sample of film enthusiasts can produce a similar result in judging for the 87th Academy Awards for movies in 2014 like the actual Academy members or not. An online survey has been created and the votes cast by the participants have been tabulated. It can be shown that the results of the simulated awards voting in the survey are quite similar to the actual Academy decision. However, additional adjustments and further studies are recommended to ensure the results. aworkingPaper41uhttps://nbn-resolving.org/urn:nbn:de:bsz:15-qucosa-161943zOnline-Zugriff 4aAcademy Awards. Rangfolgewahl 4aWahlzettel 4aeinfache Mehrheit 4aVorhersagbarkeit 4aFilm 4aVereinigte Staaten von Amerika 4aStudie 4aBefragung 4aAcademy Awards 4ainstant runoff voting 4aballot 4arelative majority 4apredictability 4afilm 4amotion pictures 4aUnited States of America 4astudy 4asurvey0 a791 aurn:nbn:de:bsz:15-qucosa-161943b22csid-22-col-qucosa-adlrcsid-22-col-qucosa \ No newline at end of file diff --git a/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_result.json b/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_result.json new file mode 100644 index 0000000000000000000000000000000000000000..6f031148fd50c2bc1da67e1071d4fd0b6116eb38 --- /dev/null +++ b/module/finc/tests/fixtures/getUrls/no_isil_for_22-15-qucosa-161943_result.json @@ -0,0 +1,7 @@ +[ + { + "url": "https://nbn-resolving.org/urn:nbn:de:bsz:15-qucosa-161943", + "desc": "Online-Zugriff", + "indicators": "41" + } +] \ No newline at end of file diff --git a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php index 886eb7aecb2ba0bb3418ce78c8af9fa49a6523cd..1b5e7ec45dd969f10709e13e1aeaef9304dc1b5a 100644 --- a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php +++ b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php @@ -28,8 +28,9 @@ */ namespace fincTest\RecordDriver; -use VuFindTest\Unit\TestCase as VuFindTestCase; use finc\RecordDriver\SolrMarcFinc as SolrMarcFincDriver; +use finc\RecordDriver\SolrMarcFincTrait; +use VuFindTest\Unit\TestCase as VuFindTestCase; /** * SolrMarcTestCase @@ -38,6 +39,7 @@ use finc\RecordDriver\SolrMarcFinc as SolrMarcFincDriver; * @package finc * @author Guenter Hipler <guenter.hipler@unibas.ch> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @author Robert Lange <lange@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link http://vufind.org */ @@ -73,11 +75,62 @@ class SolrMarcFincTestCase extends VuFindTestCase * * @return array */ - protected function getFixtureData($file) + protected function getFixtureData($file, $decode = true) + { + $content = file_get_contents(realpath(FINC_TEST_FIXTURES . '/' . $file)); + return $decode ? json_decode($content, true) : $content; + } + + /** + * @return void + */ + public function testGetURLs() + { + // although not current isil, link for IIIF should be shown based on indicator 2 #20600 + $this->runGetURLsTestCase('IIIF_0-1763648745'); + $this->runGetURLsTestCase('IIIF_0-1763648745', ['DE-15']); + + // Record 0-1497294835 with isil of DE-15 in fullrecord (subfield 9) results in empty array for adlr #18915 + $this->runGetURLsTestCase('isil_with_DE-15_0-1497294835', ['DE-15-FID'], []); + $this->runGetURLsTestCase('isil_with_DE-15_0-1497294835', ['FID-MEDIEN-DE-15'], []); + // .. but is shown in DE-15 + $this->runGetURLsTestCase('isil_with_DE-15_0-1497294835', ['DE-15']); + + // Record 0-1497294835 has no given isil in fullrecord (subfield 9) => shown as default / fallback #18915 + $this->runGetURLsTestCase('no_isil_for_22-15-qucosa-161943', ['DE-15-FID']); + $this->runGetURLsTestCase('no_isil_for_22-15-qucosa-161943', ['DE-15']); + } + + protected function getDriverMock() + { + return new SolrMarcFincDriverMock(); + } + + /** + * @return void + */ + public function runGetURLsTestCase(string $testCase, array $isils = [], $expectedResult = null) + { + $driver = $this->getDriverMock(); + $driver->setFullRecord($this->getFixtureData("getUrls/{$testCase}_fullrecord.txt", false)); + $driver->setIsils($isils); + $actualResult = $driver->getURLs(); + $expectedResult = $expectedResult ?? $this->getFixtureData("/getUrls/{$testCase}_result.json"); + $this->assertEquals($expectedResult, $actualResult); + } +} + +class SolrMarcFincDriverMock extends SolrMarcFincDriver +{ + use SolrMarcFincTrait; + + public function setFullRecord(string $fullrecord) + { + $this->fields['fullrecord'] = $fullrecord; + } + + public function setIsils(array $isils) { - return json_decode( - file_get_contents(realpath(FINC_TEST_FIXTURES . '/' . $file)), - true - ); + $this->isil = $isils; } } diff --git a/themes/fid/languages/fid/de.ini b/themes/fid/languages/fid/de.ini index 0a3fee6dac272d902870c7d7531427e88eedd530..69dd4b1f2c967135d74704519c20b2ca0900a94b 100644 --- a/themes/fid/languages/fid/de.ini +++ b/themes/fid/languages/fid/de.ini @@ -183,4 +183,19 @@ acquisition_permission_denied = "Ihr Konto ist für Bestellungen zurzeit gesperr number_of_pages = "Seiten" -FID_services = "FID Services" \ No newline at end of file +FID_services = "FID Services" + +status_open = "offen" +status_processing = "wird bearbeitet" +status_loan = "ausgeliehen" +status_completed = "erfolgreich erledigt" +status_closed = "geschlossen" + +order_label_status = "Status" +order_label_due_date = "Leihfrist" + +order_list = "Liste aller Bestellungen" +edit_order_error = "Bestellung kann nicht bearbeitet werden" +order_update_success = "Bestellung aktualisiert" +order_update_error = "Fehler beim Aktualisierne der Bestellung" +order_type = "Typ" \ No newline at end of file diff --git a/themes/fid/languages/fid/en.ini b/themes/fid/languages/fid/en.ini index 01cd367904a8b26b3886d97ca5cca59e5ed3696b..6e12cc06afe719d7a3b7e4f6a71c2e0fb2e668b6 100644 --- a/themes/fid/languages/fid/en.ini +++ b/themes/fid/languages/fid/en.ini @@ -179,4 +179,19 @@ acquisition_permission_denied = "Your account is currently blocked for orders." number_of_pages = "Pages" -FID_services = "FID Services" \ No newline at end of file +FID_services = "FID Services" + +status_open = "open" +status_processing = "is processed" +status_loan = "lent" +status_completed = "successfully completed" +status_closed = "closed" + +order_label_status = "Status" +order_label_due_date = "Due date" + +order_list = "List of all orders" +edit_order_error = "Order cannot be processed" +order_update_success = "Order updated" +order_update_error = "Error on updating order" +order_type = "Type" \ No newline at end of file diff --git a/themes/fid/templates/fid/order/order-edit-form-basic.phtml b/themes/fid/templates/fid/order/order-edit-form-basic.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0f9decad5a4a0772b9e30ff8f5e7e5e69c0e7ed3 --- /dev/null +++ b/themes/fid/templates/fid/order/order-edit-form-basic.phtml @@ -0,0 +1,73 @@ +<!-- fid: fid - order - order-edit-form-basic --> +<?php +/** + * Copyright (C) 2021 Leipzig University Library + * + * 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. + * + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSubmit; + +/** @var Form $form */ +/** @var FormLabel $formLabel */ +/** @var FormSubmit $formSubmit */ +/** @var FormElementErrors $formElementErrors */ +$form = $this->form; +$formLabel = $this->formLabel(); +$formLabel->setTranslatorTextDomain('fid'); +$formSubmit = $this->formSubmit(); +$formSubmit->setTranslatorTextDomain('fid'); +$formElementErrors = $this->formElementErrors(); +$formElementErrors->setTranslatorTextDomain('fid'); +?> + +<?= $this->form()->openTag($form) ?> + +<?php /* status */ ?> +<?php +/** @var Element\Select $elemStatus */ +$elemStatus = $form->get('status'); +$elemStatus->setAttributes(['class' => 'form-control']); +?> + <div class="form-group"> + <?= $this->formElementErrors($elemStatus) ?> + <?= $this->formLabel($elemStatus) ?> + <?= $this->formSelect($elemStatus) ?> + </div> + +<?php /* submit button */ ?> +<?php +/** @var Element\Submit $elemSubmit */ +$elemSubmit = $form->get('submit'); +$elemSubmit->setAttributes(['class' => 'btn btn-primary']); +?> + <div class="form-group"> + <div class="col-lg-11 col-md-9 col-sm-11 col-xs-12"> + <?= $this->formSubmit($elemSubmit) ?> + <a href="<?= $this->url('fid/admin/orders') ?>" + class="btn btn-primary"> + <?= $this->transEsc('Cancel') ?> + </a> + </div> + </div> + +<?= $this->form()->closeTag($form) ?> +<!-- fid: fid - order - order-edit-form-basic -END --> diff --git a/themes/fid/templates/fid/order/order-edit-form-complete.phtml b/themes/fid/templates/fid/order/order-edit-form-complete.phtml new file mode 100644 index 0000000000000000000000000000000000000000..833487b43d235a882e7d4c37f9c2c7ae4b381142 --- /dev/null +++ b/themes/fid/templates/fid/order/order-edit-form-complete.phtml @@ -0,0 +1,85 @@ +<!-- fid: fid - order - order-edit-form-complete --> +<?php +/** + * Copyright (C) 2021 Leipzig University Library + * + * 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. + * + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSubmit; + +/** @var Form $form */ +/** @var FormLabel $formLabel */ +/** @var FormSubmit $formSubmit */ +/** @var FormElementErrors $formElementErrors */ +$form = $this->form; +$formLabel = $this->formLabel(); +$formLabel->setTranslatorTextDomain('fid'); +$formSubmit = $this->formSubmit(); +$formSubmit->setTranslatorTextDomain('fid'); +$formElementErrors = $this->formElementErrors(); +$formElementErrors->setTranslatorTextDomain('fid'); +?> + +<?= $this->form()->openTag($form) ?> + + <?php /* status */ ?> + <?php + /** @var Element\Select $elemStatus */ + $elemStatus = $form->get('status'); + $elemStatus->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?= $this->formElementErrors($elemStatus) ?> + <?= $this->formLabel($elemStatus) ?> + <?= $this->formSelect($elemStatus) ?> + </div> + + <?php /* due date */ ?> + <?php + /** @var Element\Date $elemDueDate */ + $elemDueDate = $form->get('due_date'); + $elemDueDate->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?= $this->formElementErrors($elemDueDate) ?> + <?= $this->formLabel($elemDueDate) ?> + <?= $this->formElement($elemDueDate) ?> + </div> + + <?php /* submit button */ ?> + <?php + /** @var Element\Submit $elemSubmit */ + $elemSubmit = $form->get('submit'); + $elemSubmit->setAttributes(['class' => 'btn btn-primary']); + ?> + <div class="form-group"> + <div class="col-lg-11 col-md-9 col-sm-11 col-xs-12"> + <?= $this->formSubmit($elemSubmit) ?> + <a href="<?= $this->url('fid/admin/orders') ?>" + class="btn btn-primary"> + <?= $this->transEsc('Cancel') ?> + </a> + </div> + </div> + +<?= $this->form()->closeTag($form) ?> +<!-- fid: fid - order - order-edit-form-complete --> diff --git a/themes/fid/templates/fid/order/order-edit.phtml b/themes/fid/templates/fid/order/order-edit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4b48b8ee68a0cb23d810342f33452436b840ed13 --- /dev/null +++ b/themes/fid/templates/fid/order/order-edit.phtml @@ -0,0 +1,66 @@ +<!-- fid: fid - order - order-edit --> +<?php +/** + * Copyright (C) 2011 Leipzig University Library + * + * 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. + * + * @author Alexander Purr <purr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSubmit; + +$driver = $this->driver; +$order = $this->order; +$this->user = $order->getUser(); +/** @var Form $form */ +$form = $this->form; +$this->headTitle($title = $this->translate("fid::acquisition_{$order->getType()}")); +?> +<h1><?= $title ?></h1> +<?= $this->flashmessages() ?> + +<?=$this->render('fid/record/acquisition-contact-details'); ?> + +<?php + $driver = $this->driver; + $formatter = $this->recordDataFormatter(); + $this->coreFields = $formatter->getData($driver, $formatter->getDefaults('fid-acquisition-general')); +?> +<?=$this->render('fid/record/acquisition-record-details'); ?> + +<h2><?=$this->translate("Status")?></h2> + + <div class="form-group"> + <label><?= $this->translate('Ordered on') ?></label> + <div class="form-control"><?= $this->escapeHtml($order->getCreatedAt()->format('d.m.Y')) ?></div> + </div> + +<?php if ($form instanceof Form): ?> + <?=$this->render("fid/order/{$form->getName()}"); ?> +<?php else: ?> + <div class="form-group"> + <a href="<?= $this->url('fid/admin/orders') ?>" + class="btn btn-primary"> + <?= $this->transEsc('Cancel') ?> + </a> + </div> + </div> +<?php endif; ?> +<!-- fid: fid - order - order-edit - END --> diff --git a/themes/fid/templates/fid/record/acquisition-contact-details.phtml b/themes/fid/templates/fid/record/acquisition-contact-details.phtml new file mode 100644 index 0000000000000000000000000000000000000000..86df40cd37ce0eb314b45cd41e87fe9449f6003a --- /dev/null +++ b/themes/fid/templates/fid/record/acquisition-contact-details.phtml @@ -0,0 +1,18 @@ +<!-- fid: fid - record - acquisition-contact-details --> +<?php +/** @var \fid\Service\DataTransferObject\User $user */ +?> +<h2><?=$this->translate("fid::acquisition_delivery_to")?></h2> +<table class="table table-striped"> + <tbody> + <tr> + <th><?= $this->translate("fid::acquisition_order_delivery_name") ?></th> + <td><?= $this->user->getFirstname() ?> <?= $this->user->getLastname() ?></td> + </tr> + <tr> + <th><?= $this->translate("Email Address") ?></th> + <td><?= $this->user->getUsername() ?></td> + </tr> + </tbody> +</table> +<!-- fid: fid - record - acquisition-contact-details - END --> diff --git a/themes/fid/templates/fid/user/admin-orders.phtml b/themes/fid/templates/fid/user/admin-orders.phtml index 3caca066e03db0a678264b53d1d15f7cab8c689b..69ecaa94b96fd61764d029916ea48eae0df1bfa8 100644 --- a/themes/fid/templates/fid/user/admin-orders.phtml +++ b/themes/fid/templates/fid/user/admin-orders.phtml @@ -1,26 +1,43 @@ -<!-- fid: fid - admin - order-list --> +<!-- fid: fid - admin - orders --> +<?php + use fid\Controller\RecordController; +?> + +<h1><?= $this->translate('fid::order_list') ?></h1> +<?= $this->flashmessages() ?> + <?php if (empty($orders)): ?> <?=$this->translate('fid::user_orders_empty')?> <?php else: ?> <table class="table"> + <tr> + <?= in_array('type',$this->displayCols) + ? "<th>{$this->translate('fid::order_type')}</th>" + : ''?> <th><?=$this->translate('Date')?></th> - - <!-- fid: fid - admin - order-list - additionals-headers --> <th><?=$this->translate('fid::order_record')?></th> <th><?=$this->translate('fid::order_user')?></th> - <!-- fid: fid - admin - order-list - additionals-headers - END --> - + <?= in_array('status',$this->displayCols) + ? "<th>{$this->translate('fid::order_label_status')}</th>" + : ''?> + <?= in_array('dueDate',$this->displayCols) + ? "<th>{$this->translate('fid::order_label_due_date')}</th>" + : '' ?> + <?= in_array('edit',$this->displayCols) + ? "<th></th>" + : ''?> </tr> + <?php foreach ($orders as $order): /** @var $order \fid\Service\DataTransferObject\Order */?> - <!-- fid: fid - admin - order-list - entry --> <tr name="order-<?=$this->escapeHtml($order->getId())?>"> + <?= in_array('status',$this->displayCols) + ? "<td>" . $this->translate("fid::acquisition_{$order->getType()}") . "</td>" + : '' ?> <td><?=$this->escapeHtml($order->getCreatedAt()->format('d.m.Y'))?></td> - <?php $data = $order->getData() ?> - <!-- fid: fid - admin - order-list - data --> <?=$this->render('fid/user/orders/additionals-data', compact('order'))?> <td> <?php @@ -31,12 +48,20 @@ <?= $this->translate('fid::user_deleted') ?> <?php endif; ?> </td> - <!-- fid: fid - admin - order-list - data - END --> - + <?= in_array('status',$this->displayCols) + ? "<td>" . ($order->getStatus() ? $this->translate('fid::status_'.$order->getStatus()) : '' . "</td>") + : '' ?> + <?php if(in_array('dueDate',$this->displayCols)): ?> + <?= ($order->getType() == RecordController::PDA) && ($order->isOverdue()) && ($order->getStatus() != 'completed') + ? "<td><div class=\"alert alert-danger\" role=\"alert\">{$this->icon('warning')}{$order->displayDueDate()}</div></td>" + : "<td>{$order->displayDueDate()}</td>" ?> + <?php endif; ?> + <?= in_array('edit',$this->displayCols) + ? "<td><a href=\"{$this->url('fid/admin/editOrder', ['orderid' => $order->getId()])}\">{$this->icon('pen')}</td>" + : '' ?> </tr> - <!-- fid: fid - admin - order-list - entry - END --> <?php endforeach; ?> </table> <?php endif; ?> -<!-- fid: fid - admin - order-list - END --> \ No newline at end of file +<!-- fid: fid - admin - orders - END --> \ No newline at end of file diff --git a/themes/fid/templates/fid/user/orders.phtml b/themes/fid/templates/fid/user/orders.phtml index b67efccf49ff82234e7c54ac1a542efe6f8a3d74..9c3448e863909d0770a1218aacb3f37b1d4c1d86 100644 --- a/themes/fid/templates/fid/user/orders.phtml +++ b/themes/fid/templates/fid/user/orders.phtml @@ -6,9 +6,12 @@ <tr> <th><?=$this->translate('Date')?></th> <?=$this->render('fid/user/orders/additionals-headers');?> + <?= in_array('status',$this->displayCols) + ? "<th>{$this->translate('fid::order_label_status')}</th>" + : ''?> </tr> <?php foreach ($orders as $order): ?> - <?=$this->render('fid/user/orders/entry', compact('order'))?> + <?=$this->render('fid/user/orders/entry', compact('order','displayCols'))?> <?php endforeach; ?> </table> <?php endif; ?> diff --git a/themes/fid/templates/fid/user/orders/entry.phtml b/themes/fid/templates/fid/user/orders/entry.phtml index 580b7b8b65a6662cdba5721a8e048155f08c6a23..daecf9de8e5104e2c4bca6451b0ad0ecb82a4878 100644 --- a/themes/fid/templates/fid/user/orders/entry.phtml +++ b/themes/fid/templates/fid/user/orders/entry.phtml @@ -2,5 +2,8 @@ <tr name="order-<?=$this->escapeHtml($this->order->getId())?>"> <td><?=$this->escapeHtml($this->order->getCreatedAt()->format('d.m.Y'))?></td> <?=$this->render('fid/user/orders/additionals-data', compact('order'))?> + <?= in_array('status',$this->displayCols) + ? "<td>" . ($order->getStatus() ? $this->translate('fid::status_'.$order->getStatus()) : '' . "</td>") + : '' ?> </tr> <!-- fid: fid - user - orders - entry - END --> \ No newline at end of file diff --git a/themes/fid/templates/fid/user/update.phtml b/themes/fid/templates/fid/user/update.phtml index 31d6932cf00a015c0bdf422e8473f619b2c2a67a..5a301f477779689c4b64a9da351e0ecb5ae088fd 100644 --- a/themes/fid/templates/fid/user/update.phtml +++ b/themes/fid/templates/fid/user/update.phtml @@ -146,7 +146,7 @@ $elemSubmit->setAttributes(['class' => 'btn btn-primary']); <div class="form-group"> <div class="col-lg-11 col-md-9 col-sm-11 col-xs-12"> <?= $this->formSubmit($elemSubmit) ?> - <a href="<?= $this->url('myresearch-profile') ?>" + <a href="<?= $this->cancelUrl ?? $this->url('myresearch-profile') ?>" class="btn btn-primary"> <?= $this->transEsc('Cancel') ?> </a> diff --git a/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7a7764f9287be9baa6b4dc3f3b3c83ababcf7843 --- /dev/null +++ b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml @@ -0,0 +1,22 @@ +<!-- finc-accessibility: auth - abstractbase - login.phtml --> +<?php $account = $this->auth()->getManager(); ?> +<?php $sessionInitiator = $account->getSessionInitiator($this->serverUrl($this->url('myresearch-home'))); ?> +<?php if (!$sessionInitiator): // display default login form if no login URL provided ?> + <form method="post" action="<?=$this->url('myresearch-home')?>" name="loginForm" class="form-login"> + <?=$this->auth()->getLoginFields()?> + <input type="hidden" name="auth_method" value="<?=$account->getAuthMethod()?>"> + <input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($account->getCsrfHash())?>" /> + <div class="form-group"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> + <?php if ($account->supportsCreation()): ?> + <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> + <?php endif; ?> + <?php if ($account->supportsRecovery()): ?> + <a class="btn btn-link" href="<?=$this->url('myresearch-recover') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Forgot Password')?></a> + <?php endif; ?> + </div> + </form> +<?php else: ?> + <a href="<?=$this->escapeHtmlAttr($sessionInitiator)?>" class="btn btn-link" data-lightbox-ignore><?=$this->transEsc("Institutional Login")?></a> +<?php endif; ?> +<!-- finc-accessibility: auth - abstractbase - login.phtml - END --> diff --git a/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml b/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml index a6715a36d31e45240fcad16d7b7390afe6b74ab6..37a20857e5d2718ae4d2362329bd7f7c8c8c7c77 100644 --- a/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml +++ b/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml @@ -8,9 +8,9 @@ <?php endif; ?> <?php if (isset($this->verifyold) && $this->verifyold || isset($this->oldpwd)): ?> <div class="form-group"> - <label class="control-label"><?=$this->transEsc('old_password') ?>:</label> - <input id="current-password" type="password" name="oldpwd" class="form-control" autocomplete="current-password"/> - <div class="help-block with-errors"></div> + <label for="current-password" class="control-label"><?=$this->transEsc('old_password') ?>:</label> + <input id="current-password" type="password" name="oldpwd" class="form-control" aria-describedby="current-password-error" autocomplete="current-password" required aria-required="true" /> + <div id="current-password-error" class="help-block with-errors"></div> </div> <?php endif; ?> <?php @@ -26,21 +26,22 @@ } ?> <div class="form-group"> - <label class="control-label"><?=$this->transEsc('new_password') ?>:</label> + <label for="password" class="control-label"><?=$this->transEsc('new_password') ?>:</label> <input type="password" id="password" name="password" class="form-control" required aria-required="true" <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : '' ?> <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : '' ?> <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?> autocomplete="new-password" + aria-describedby="password-error" /> <?php if ($this->passwordPolicy['hint']): ?> <div class="help-block"><?=$this->transEsc($this->passwordPolicy['hint']) ?></div> <?php endif; ?> - <div class="help-block with-errors"></div> + <div id="password-error" class="help-block with-errors"></div> </div> <div class="form-group"> - <label class="control-label"><?=$this->transEsc('confirm_new_password') ?>:</label> - <input type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>" autocomplete="new-password"/> - <div class="help-block with-errors"></div> + <label for="password2" class="control-label"><?=$this->transEsc('confirm_new_password') ?>:</label> + <input id="password2" type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>" autocomplete="new-password" aria-describedby="password2-error"/> + <div id="password2-error" class="help-block with-errors"></div> </div> <!-- finc-accessibility: Auth - AbstractBase - newpassword - END --> \ No newline at end of file diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml index b4099695aacfd3feb94bd97e67246300908d6a64..293af05732827251527ee22b281cc69fe25b3cae 100644 --- a/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml @@ -42,9 +42,11 @@ $moreUrl .= '&baseUriExtra=' . urlencode($this->baseUriExtra); } ?> + <li> <a class="facet narrow-toggle <?=$moreClass ?>" data-lightbox href="<?=$moreUrl ?>" rel="nofollow"> <span class="text"><?=$this->transEsc('see all')?> ...</span> </a> + </li> <?php endif; ?> <li class="facet narrow-toggle <?=$moreClass ?>"> <a class="text" href="#" onclick="event.stopImmediatePropagation(); return lessFacets('narrowGroupHidden-<?=$this->escapeHtmlAttr($this->title) ?>');"> diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml index 9f0ebf61886dbd8d670abb9459721b0277080a53..00a568ce1757f155394f0a9a0dfb49b78b4e6362 100644 --- a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -70,8 +70,11 @@ <?php if ($hasSubLinks): ?> <?php $excludeURL = $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], 'NOT'); ?> - <a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude" title="<?= $this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_hint') ?>"> + <a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude" title="<?= $this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_on_xclude_hint', ['%%filter_name%%' => $this->facet['displayText']]) ?>"> <i class="fa fa-times" aria-hidden="true"></i> + <span class="sr-only"> + <?= $this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_on_xclude_hint', ['%%filter_name%%' => $this->facet['displayText']]) ?> + </span> </a> <?php endif; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml index 3c1233c8b90ba4f5341f0a60d79e1a1bfa024bae..377e7ddf6a32d81a0bc92b694099ffb1713e1234 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml @@ -125,7 +125,7 @@ $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('list' <?php endforeach; ?> <?php endif; ?> - <?php if (count($this->lists) > 0): ?> + <?php if (!empty($this->lists)): ?> <strong><?=$this->transEsc('Saved in')?>:</strong> <?php $i = 0; foreach ($this->lists as $current): ?> diff --git a/themes/finc/templates/admin/i18n/home.phtml b/themes/finc/templates/admin/i18n/home.phtml index 1742553be46f6279e424f9c0e88134fbd2287e4d..0e634d2a26596a0f79e5e655361d82c0636d5a54 100644 --- a/themes/finc/templates/admin/i18n/home.phtml +++ b/themes/finc/templates/admin/i18n/home.phtml @@ -1,7 +1,7 @@ <!-- finc: admin - i18n - home --> <?php $this->headTitle($this->translate('admin_i18n_menu_entry')); ?> -<div class="<?= ($this->layoutClass('mainbody') . (!$this->config()->get('config')->Site->admin_enabled ? ' solo' : '')) ?>"> +<div class="<?= ($this->layoutClass('mainbody') . (!$this->config()->get('config')->Site->admin_enabled ? ' solo' : '')) ?>" style="width: 100%"> <h1><?= $this->transEsc('admin_i18n_menu_entry') ?></h1> <?= $this->flashmessages() ?> <div class="panel panel-info"> @@ -76,12 +76,6 @@ </table> </div> -<?php if ($this->config()->get('config')->Site->admin_enabled): ?> - <div class="<?= $this->layoutClass('sidebar') ?>"> - <?= $this->render("admin/menu.phtml") ?> - </div> -<?php endif; ?> - <?php $script = <<<JS $(document).ready(function () { diff --git a/themes/finc/templates/ajax/resolverLinks.phtml b/themes/finc/templates/ajax/resolverLinks.phtml index 9b46024cabfd134f762343dc09fb45b715ec86fe..d9b82875c17cd7e6184f08cc5721db62b1dcad85 100644 --- a/themes/finc/templates/ajax/resolverLinks.phtml +++ b/themes/finc/templates/ajax/resolverLinks.phtml @@ -25,7 +25,7 @@ <small><?=isset($link['coverage'])?$this->escapeHtml($link['coverage']):''?><?=isset($link['coverageHref'])?' <a href="'.$link['coverageHref'].'" target="_blank">'.$this->translate('Readme').'</a>':''?></small> <?php /* finc-specific change #5334 - END */ ?> <?php else: ?> - <?=isset($link['title'])?$this->escapeHtml($link['title']):''?> <?=isset($link['coverage'])?$this->escapeHtml($link['coverage']):''?> + <?=isset($link['title'])?$this->escapeHtml($link['title']):''?> <?=isset($link['coverage'])?$this->transEsc($link['coverage']):''?> <?php endif; ?> </li> <?php endforeach; ?> diff --git a/themes/finc/templates/header.phtml b/themes/finc/templates/header.phtml index 50d239b701eb65722cd1115f6bdc0c405fae1650..e5220854a619639dc3b6406eabb204102b6dce00 100644 --- a/themes/finc/templates/header.phtml +++ b/themes/finc/templates/header.phtml @@ -37,8 +37,8 @@ <?php $cart = $this->cart(); if ($cart->isActive()): ?> <li id="cartSummary"> - <a id="cartItems" class="btn" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>"> - <i class="fa fa-clipboard" aria-hidden="true"></i> <span role="status"><span class="sr-only"><?=$this->transEsc('Book Bag')?>:</span> <strong><?=count($cart->getItems())?></strong> <span class="cart-label"><?=$this->transEsc('items')?></span></span> + <a id="cartItems" class="btn" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>" aria-describedby="cartStatus"> + <i class="fa fa-clipboard" aria-hidden="true"></i> <span class="sr-only"><?=$this->transEsc('Book Bag')?>:</span> <strong><?=count($cart->getItems())?></strong> <span class="cart-label"><?=$this->transEsc('items')?></span> <span class="sr-only full<?=!$cart->isFull() ? ' hidden' : ''?>">(<?=$this->transEsc('bookbag_full')?>)</span> </a> </li> diff --git a/themes/finc/templates/myresearch/bulk-action-buttons.phtml b/themes/finc/templates/myresearch/bulk-action-buttons.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0f70b338fb60343c7e44a4ec998bba4c2c7538f0 --- /dev/null +++ b/themes/finc/templates/myresearch/bulk-action-buttons.phtml @@ -0,0 +1,26 @@ +<!-- finc: myresearch - bulk-action-buttons --> +<?php if (isset($list)): ?> + <input type="hidden" name="listID" value="<?=$this->escapeHtmlAttr($list->id)?>" /> + <input type="hidden" name="listName" value="<?=$this->escapeHtmlAttr($list->title)?>" /> +<?php endif; ?> +<?php $user = $this->auth()->isLoggedIn(); ?> +<div class="bulkActionButtons"> + <div class="bulk-checkbox"> + <input type="checkbox" name="selectAll" class="checkbox-select-all" id="myresearchCheckAll"/> + <label for="myresearchCheckAll"><?=$this->transEsc('select_page')?> | <?=$this->transEsc('with_selected')?>:</label> + </div> + <div class="btn-group"> + <input id="<?=$this->idPrefix?>ribbon-email" class="btn btn-default" type="submit" name="email" value="<?=$this->transEsc('Email')?>" title="<?=$this->transEsc('email_selected')?>"/> + <?php if ((null !== $this->list && $this->list->editAllowed($user)) || null === $this->list && $user): ?> + <input class="btn btn-default" id="<?=$this->idPrefix?>delete_list_items_<?=null !== $this->list ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" value="<?=$this->transEsc('Delete')?>" title="<?=$this->transEsc('delete_selected')?>"/> + <?php endif; ?> + <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?> + <input id="<?=$this->idPrefix?>ribbon-export" class="btn btn-default" type="submit" name="export" value="<?=$this->transEsc('Export')?>" title="<?=$this->transEsc('export_selected')?>"/> + <?php endif; ?> + <input id="<?=$this->idPrefix?>ribbon-print" class="btn btn-default" type="submit" name="print" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore/> + <?php if ($this->cart()->isActive()): ?> + <input class="btn btn-default" id="<?=$this->idPrefix?>updateCart" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> + <?php endif; ?> + </div> +</div> +<!-- finc: myresearch - bulk-action-buttons - END --> \ No newline at end of file diff --git a/themes/finc/templates/myresearch/cataloglogin.phtml b/themes/finc/templates/myresearch/cataloglogin.phtml index 65a755ab2d32f494b16a448504f5d443c16c5c67..1f89d9181e8f2d8788f28707721dfd0244ffc9fa 100644 --- a/themes/finc/templates/myresearch/cataloglogin.phtml +++ b/themes/finc/templates/myresearch/cataloglogin.phtml @@ -37,7 +37,7 @@ <input id="profile_cat_password" type="password" name="cat_password" value="" class="form-control" autocomplete="current-password"/> </div> <div class="form-group"> - <input class="btn btn-primary" type="submit" name="processLogin" value="<?=$this->transEsc('Login')?>"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> </div> </form> <?php endif; ?> diff --git a/themes/finc/templates/search/bulk-action-buttons.phtml b/themes/finc/templates/search/bulk-action-buttons.phtml index cc40884afe28ff37699faaf0e3e6d1483eb120b3..caa79a1ba818f44c22f100ed276a2323a0b07411 100644 --- a/themes/finc/templates/search/bulk-action-buttons.phtml +++ b/themes/finc/templates/search/bulk-action-buttons.phtml @@ -10,13 +10,13 @@ </div> <div class="btn-group"> <?php if (isset($this->showBulkOptions) && $this->showBulkOptions): ?> - <input id="ribbon-email" class="btn btn-transparent" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> + <input id="<?=$this->idPrefix?>ribbon-email" class="btn btn-transparent" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?> - <input id="ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> + <input id="<?=$this->idPrefix?>ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php endif; ?> - <input id="ribbon-print" class="btn btn-transparent" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> + <input id="<?=$this->idPrefix?>ribbon-print" class="btn btn-transparent" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <input id="ribbon-save" class="btn btn-transparent" type="submit" name="saveCart" title="<?=$this->transEsc('bookbag_save_selected')?>" value="<?=$this->transEsc('Save')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> + <input id="<?=$this->idPrefix?>ribbon-save" class="btn btn-transparent" type="submit" name="saveCart" title="<?=$this->transEsc('bookbag_save_selected')?>" value="<?=$this->transEsc('Save')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php endif; ?> <?php endif; ?> <?php if (isset($this->showCartControls) && $this->showCartControls): ?>