diff --git a/composer.local.0.finc.json b/composer.local.0.finc.json index 4bc3bf8c419127ef97648a6a49be4b036b869eb8..76e927c42a02757ea1c8e17f33987c5f8038384b 100644 --- a/composer.local.0.finc.json +++ b/composer.local.0.finc.json @@ -17,6 +17,11 @@ "extra": { "vufind": { "modules": [ + "Zend\\Filter", + "Zend\\Hydrator", + "Zend\\Validator", + "Zend\\Serializer", + "Zend\\InputFilter", "finc" ] } diff --git a/local/languages/DDS/de.ini b/local/languages/DDS/de.ini index 9bcc3f8b5be5a42205e89ff27801a685aa160250..fc735434269263d722f16de3da3a8790f14fda6b 100644 --- a/local/languages/DDS/de.ini +++ b/local/languages/DDS/de.ini @@ -21,4 +21,10 @@ dds_text_mandatory_fields = "Pflichtfelder" ; Flashmessages dds_order_success = "Ihre Bestellung wurde erfolgreich an die Universitätsbibliothek Leipzig übermittelt." -dds_restriction_text = "Dieser Dienst steht nur Mitarbeiterinnen und Mitarbeitern der Universität sowie der Medizinischen Fakultät (Universitätsklinikum) zur Verfügung." \ No newline at end of file +dds_restriction_text = "Dieser Dienst steht nur Mitarbeiterinnen und Mitarbeitern der Universität sowie der Medizinischen Fakultät (Universitätsklinikum) zur Verfügung." +dds_issn = "Bitte eine korrekte ISSN-10 oder ISSN-13 angeben." +dds_error_publishdate_too_short = "Mindestens ein zweistelliges Erscheinungsjahr angeben." +dds_error_publishdate_too_long = "Maximal ein vierstelliges Erscheinungsjahr angeben." +acquisition_error_publishdate_pattern = "Bitte ein korrektes Jahr eingeben." +dds_error_pages_too_short = "Mindestens einstellige Seitenzahlen angeben." +acquisition_error_pages_pattern = "Bitte einen Seitenzahl (z.B. 20 oder 20-29) angeben." \ No newline at end of file diff --git a/local/languages/DDS/en.ini b/local/languages/DDS/en.ini index d4d3d579790d193b58ee6134fbfe1d9b6e6a3602..f5f96b23225173a5ee4773c3d2eec5d6c5122cfe 100644 --- a/local/languages/DDS/en.ini +++ b/local/languages/DDS/en.ini @@ -21,4 +21,10 @@ dds_text_mandatory_fields = "Mandatory fields" ; Flashmessages dds_order_success = "Your order has been sent successfully." -dds_restriction_text = "This service is only available for members of Leipzig University and department of medicine (Universitätsklinikum)." \ No newline at end of file +dds_restriction_text = "This service is only available for members of Leipzig University and department of medicine (Universitätsklinikum)." +dds_issn = "Only correct ISSN-10 or ISSN-13" +dds_error_publishdate_too_short = "min. a two digit publishdate" +dds_error_publishdate_too_long = "max. a four digit publishdate" +acquisition_error_publishdate_pattern = "Please enter a correct year." +dds_error_pages_too_short = "min. page 1" +acquisition_error_pages_pattern = "Please specify a number of pages (e.g. 20 or 20-29). " \ No newline at end of file diff --git a/local/languages/de.ini b/local/languages/de.ini index 9966a9252f8fa4037da669a2f6e18a43f682b66a..948159a37bc3c7690fe079f2f4d7c847c9ab8acd 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -732,6 +732,8 @@ export_selected_favorites = "Ausgewählte Favoriten exportieren" export_success = "Export abgeschlossen" export_unsupported_format = "Nichtunterstütztes Exportformat" external = "außer Haus" +facet_select_hint = "Zum Einschränken der Ergebnisse können Sie unter folgenden Filtern wählen:" +facet_deselect_hint = "Zum Aufheben der Filterfunktion wählen Sie einen oder alle der folgenden Filtern ab:" fav_delete = "Ausgewählte Favoriten löschen" fav_delete_deleting = "Ihre ausgewählten Favoriten werden gelöscht." fav_delete_fail = "Leider ist ein Fehler aufgetreten. Ihre ausgewählten Favoriten wurden nicht gelöscht." @@ -881,8 +883,8 @@ online_resources = "Sonstige" or = "oder" 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_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" password_too_short = "Zu kurz" password_very_weak = "Sehr schwach" password_weak = "Schwach" diff --git a/local/languages/en.ini b/local/languages/en.ini index 41cfa27c921739f7f16f908576d7cda3348d5101..9ff0abdf9d9e408e5278184e8fa36ccbc8b32e56 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -716,6 +716,8 @@ export_selected = "Export Selected" export_selected_favorites = "Export Selected Favorites" export_success = "Export Complete" export_unsupported_format = "Unsupported Export Format" +facet_select_hint = "Please select from the following filters to narrow down search results:" +facet_deselect_hint = "Please de-select one or all of the following filters to widen search results:" fav_delete = "Delete Selected Favorites" fav_delete_deleting = "Your favorite(s) are being deleted." fav_delete_fail = "Sorry, an error has occurred. Your favorite(s) were not deleted." @@ -843,8 +845,8 @@ on_reserve = "Reserves - Please contact staff" online_resources = "Online Resources" 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_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" password_too_short = "Too short" password_very_weak = "Very weak" password_weak = "Weak" diff --git a/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php b/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php index cd7fff820a0cbfb9beec148a608f9d2063831a67..8316015bc9293cd5c91939cd3908d8b95bf2822c 100644 --- a/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php +++ b/module/fid/src/Controller/CustomTraits/FidAcquisitionTrait.php @@ -112,6 +112,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); @@ -131,6 +134,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 +233,13 @@ trait FidAcquisitionTrait ] ]; } + if ($this->type == self::PDA) { + $data += [ + 'pda' => [ + 'comment' => $form->getData()['comment'] + ] + ]; + } return $data; } diff --git a/module/fid/src/Controller/UserController.php b/module/fid/src/Controller/UserController.php index 096fa3fa6ea61b32d68ff215eda737b90c8e0ed4..a8abdbb83ec6692d5c3792fd45291bd359b95f4b 100644 --- a/module/fid/src/Controller/UserController.php +++ b/module/fid/src/Controller/UserController.php @@ -289,6 +289,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 +316,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 +331,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] ]); diff --git a/module/fid/src/Hydrator/OrderHydrator.php b/module/fid/src/Hydrator/OrderHydrator.php index 333c1367dfb70f9aa4b20cefc8ab3c0a81fabc9a..43c1dbc3e729be596e86e6d629cfad5b8b63cb33 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,7 @@ class OrderHydrator extends AbstractHydrator { 'url' ); - $object->setData(compact('record','partialCopy','digitization')); + $object->setData(compact('record','partialCopy','digitization','pda')); $object->setLabel($data['label']); return; } 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/finc/config/dds-form.php b/module/finc/config/dds-form.php new file mode 100644 index 0000000000000000000000000000000000000000..1fcb1903776403d48a9eebca09448e08b83a3a72 --- /dev/null +++ b/module/finc/config/dds-form.php @@ -0,0 +1,403 @@ +<?php +/** + * Copyright (C) 2019 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 Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use fid\Hydrator\UserHydrator; +use Zend\Filter\Boolean; +use Zend\Filter\PregReplace; +use Zend\Filter\StringTrim; +use Zend\Form\Element\Checkbox; +use Zend\Form\Element\Email; +use Zend\Form\Element\Select; +use Zend\Form\Element\Submit; +use Zend\Form\Element\Text; +use Zend\Form\Element\Textarea; +use Zend\Validator\EmailAddress; +use Zend\Validator\Identical; +use Zend\Validator\Isbn; +use Zend\Validator\NotEmpty; +use Zend\Validator\Regex; +use Zend\Validator\StringLength; + +return [ + 'name' => 'dds-form', + 'elements' => [ + 'username' => [ + 'spec' => [ + 'name' => 'username', + 'type' => Text::class, + 'options' => [ + 'label' => 'Name', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'username', + 'readonly' => true, + ], + ], + ], + 'phone' => [ + 'spec' => [ + 'name' => 'phone', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_phone', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'phone', + 'readonly' => true, + ], + ], + ], + 'email' => [ + 'spec' => [ + 'name' => 'email', + 'type' => Email::class, + 'options' => [ + 'label' => 'form_field_email', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'email', + 'readonly' => true, + ], + ], + ], + 'userid' => [ + 'spec' => [ + 'name' => 'userid', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_library_id', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'userid', + 'readonly' => true, + ], + ], + ], + 'division' => [ + 'spec' => [ + 'name' => 'division', + 'type' => Select::class, + 'options' => [ + 'label' => 'form_field_division', + 'disable_inarray_validator' => true, + 'empty_option' => '', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'division', + ], + ], + ], + 'department' => [ + 'spec' => [ + 'name' => 'department', + 'type' => Select::class, + 'options' => [ + 'label' => 'form_field_department', + 'disable_inarray_validator' => true, + ], + 'attributes' => [ + 'required' => false, + 'id' => 'department', + ], + ], + ], + 'inputdepartment' => [ + 'spec' => [ + 'name' => 'inputdepartment', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_department', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'inputdepartment', + ], + ], + ], + 'author' => [ + 'spec' => [ + 'name' => 'author', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_author', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'author', + ], + ], + ], + 'article' => [ + 'spec' => [ + 'name' => 'article', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_title', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'article', + ], + ], + ], + 'journal' => [ + 'spec' => [ + 'name' => 'journal', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_journal', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'journal', + ], + ], + ], + 'issn' => [ + 'spec' => [ + 'name' => 'issn', + 'type' => Text::class, + 'options' => [ + 'label' => 'ISSN', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'issn', + ], + ], + ], + 'publishdate' => [ + 'spec' => [ + 'name' => 'publishdate', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_publishing_date', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'publishdate', + ], + ], + ], + 'number' => [ + 'spec' => [ + 'name' => 'number', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_volume', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'number', + ], + ], + ], + 'pages' => [ + 'spec' => [ + 'name' => 'pages', + 'type' => Text::class, + 'options' => [ + 'label' => 'form_field_pages', + ], + 'attributes' => [ + 'required' => true, + 'id' => 'pages', + ], + ], + ], + 'remarks' => [ + 'spec' => [ + 'name' => 'remarks', + 'type' => Textarea::class, + 'options' => [ + 'label' => 'form_fields_remarks', + ], + 'attributes' => [ + 'required' => false, + 'id' => 'remarks', + ], + ], + ], + 'submit' => [ + 'spec' => [ + 'name' => 'submit', + 'type' => Submit::class, + 'attributes' => [ + 'value' => 'form_button_submit', + 'id' => 'submit', + ], + ], + ], + ], + 'input_filter' => [ + 'division' => [ + 'name' => 'division', + 'required' => true, + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + ], + 'validators' => [ + NotEmpty::class => [ + 'name' => NotEmpty::class, + 'options' => [ + NotEmpty::INTEGER => 'dds_division', + NotEmpty::IS_EMPTY => 'dds_division', + NotEmpty::NULL => 'dds_division' + ] + ] + ], + ], + 'journal' => [ + 'name' => 'journal', + 'required' => false, + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + ], + 'validators' => [ + StringLength::class => [ + 'name' => StringLength::class, + 'options' => [ + 'max' => 255 + ] + ] + ], + ], + 'issn' => [ + 'name' => 'issn', + 'required' => false, + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + ], + 'validators' => [ + StringLength::class => [ + 'name' => StringLength::class, + 'options' => [ + 'max' => 255 + ] + ], + ], + ], + 'email' => [ + 'name' => 'email', + 'required' => true, + 'validators' => [ + EmailAddress::class => [ + 'name' => EmailAddress::class, + ], + ], + ], + 'publishdate' => [ + 'name' => 'publishdate', + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + ], + 'validators' => [ + StringLength::class => [ + 'name' => StringLength::class, + 'options' => [ + 'min' => 2, + 'max' => 4, + 'messages' => [ + StringLength::TOO_SHORT => 'dds_error_publishdate_too_short', + StringLength::TOO_LONG => 'dds_error_publishdate_too_long', + ], + ], + ], + Regex::class => [ + 'name' => Regex::class, + 'break_chain_on_failure' => true, + 'options' => [ + 'pattern' => '/^(0|[1-9]\d*)$/', + 'messages' => [ + Regex::NOT_MATCH => 'acquisition_error_publishdate_pattern', + ], + ], + ], + ], + ], + 'pages' => [ + 'name' => 'pages', + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + PregReplace::class => [ + 'name' => PregReplace::class, + 'options' => [ + 'pattern' => '/(-|–|—|−)/', + 'replacement' => '-' + ] + ], + ], + 'validators' => [ + StringLength::class => [ + 'name' => StringLength::class, + 'options' => [ + 'min' => 1, + 'messages' => [ + StringLength::TOO_SHORT => 'dds_error_pages_too_short', + ], + ], + ], + Regex::class => [ + 'name' => Regex::class, + 'break_chain_on_failure' => true, + 'options' => [ + 'pattern' => '/^(((0|[1-9]\d*)(-([1-9]\d*)|)|,|;)*)$/', + 'messages' => [ + Regex::NOT_MATCH => 'acquisition_error_pages_pattern', + ], + ], + ], + ], + ], + 'remarks' => [ + 'name' => 'remarks', + 'required' => false, + 'filters' => [ + StringTrim::class => [ + 'name' => StringTrim::class, + ], + ], + 'validators' => [ + StringLength::class => [ + 'name' => StringLength::class, + 'options' => [ + 'max' => 5000 + ] + ], + ], + ], + ], +]; \ No newline at end of file diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index 7673bcd88c9a4de514c7e6cf031600f08fd18083..a5dfdc532872e3cdaab10332afa88f79cfe23231 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -2,6 +2,9 @@ namespace finc\Module\Configuration; $config = [ + 'forms' => [ + 'dds-form' => require 'dds-form.php', + ], 'listeners' => [ 'finc\Listener\I18nDataDirListener', ], diff --git a/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php b/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php index 5393de813a48a1bea286c161a2db546d1390a008..23d91a76fd2b71f3d99fd9731d5a900dabd6f4cf 100644 --- a/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php +++ b/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php @@ -31,6 +31,9 @@ namespace finc\Controller; use VuFind\Exception\Mail as MailException; use finc\Exception\DDS as DDSException; use finc\Mailer\Mailer as Mailer; +use Zend\Form\Element\Select; +use Zend\Form\Form; +use Zend\Http\PhpEnvironment\Request; use Zend\Mail\Address as Address; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\Validator as Validator; @@ -172,7 +175,7 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase /** * Display Feedback home form. * - * @return \Zend\View\Model\ViewModel + * @return mixed * @access public * @throws MailException * @throws DDSException @@ -181,31 +184,17 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase { $content = $this->getContent(); - // Validation - $isError = false; - $fields = ['author', 'division', 'email', 'journal', 'username', - 'number', 'publishdate','pages' - ]; - $departmentfield = ($content['division'] == '15') - ? 'inputdepartment' : 'department'; - array_push($fields, $departmentfield); - - $validator = new Validator\NotEmpty(); - foreach ($fields as $field) { - if (false === $validator->isValid($content[$field])) { - $isError = true; - $error[$field] = ucfirst($field) . ' should not be blank'; + /** @var Form $form */ + /** @var Request $request */ + + //$request = $this->getRequest(); + $form = $this->serviceLocator->get('dds-form'); + if ($this->formWasSubmitted()) { + $form->setData($content); + if (!$form->isValid()) { + return $this->createDDSViewModel($content); } } - $validator = new Validator\EmailAddress(); - if (false === $validator->isValid($content['email'])) { - $isError = true; - $error['email'] = 'The email is not valid '; - } - if (true === $isError) { - $content['error'] = (object) $error; - return $this->createDDSViewModel($content); - } // Prepare Email Template $body = $this->buildEmailTemplates($content); @@ -406,9 +395,8 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase // Define obligated fields // obligated at least one of ss or jt if (empty($fields['issn']) && empty($fields['journal'])) { - throw new DDSException( - 'At least issn or title of journal is necessary for an order at - Subito service.' + $this->flashMessenger()->addMessage( + 'DDS::dds_issn_journal', 'error' ); } // all fields of vol, apy, pg @@ -416,8 +404,8 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase empty($fields['publishdate']) || empty($fields['pages']) ) { - throw new DDSException( - 'Pages, publish date and volume are binding statements., ' + $this->flashMessenger()->addMessage( + 'DDS::dds_binding_statements', 'error' ); } // build subito url @@ -443,14 +431,24 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase */ protected function createDDSViewModel($params = null) { - $view = $this->createViewModel(); - // Assign vars to view. + /** @var Form $form */ + $form = $this->serviceLocator->get('dds-form'); + foreach ($params as $key => $value) { - $view->$key = $value; + $elem = $form->get($key); + $elem->setValue($value); } + + $action = $this->url()->fromRoute('dds-email'); + $form->setAttribute('action', $action); + $form->prepare(); + + $view = $this->createViewModel(); + $view->setVariables(compact('form')); // Assign vars for select menu to view. + $elemSdivision = $form->get('division'); + $elemSdivision->setValueOptions($this->getDivisions()); $view->departments = $this->getDepartments(); - $view->divisions = $this->getDivisions(); $view->loadForm = true; $view->setTemplate('documentdeliveryservice/home'); return $view; @@ -485,7 +483,7 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase $post = []; if ($this->getRequest()->isPost()) { $getPost = $this->getRequest()->getPost()->toArray(); - $post = isset($getPost['subito']) ? $getPost['subito'] : []; + $post = !empty($getPost) ? $getPost : []; } // populate the view with data given by User catalog account @@ -698,7 +696,7 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase foreach ($t as $arr) { // Build and normalize dataset of division if (false === array_key_exists($arr['fakultaetid'], $this->division)) { - $this->division[$arr['fakultaetid']] = $arr['fakultaet']; + $this->division[$arr['fakultaetid']] = html_entity_decode($arr['fakultaet']); } // Build options dataset $this->department[$arr['fakultaetid']][$arr['institutid']] @@ -966,13 +964,15 @@ class DocumentDeliveryServiceController extends \VuFind\Controller\AbstractBase } $responseArray = $this->parseJsonAsArray($response->getContent()); - if (array_key_exists('error', $responseArray)) { + if ($responseArray !== null && array_key_exists('error', $responseArray)) { $message = $responseArray['error']; } } else { $message = 'HTTP status ' . $response->getStatusCode() . ' received'; } - throw new DDSException($message); + if (!empty($message)) { + throw new DDSException($message); + } } return $this->parseJsonAsArray($response->getBody()); diff --git a/module/finc/src/finc/ILS/Driver/FincLibero.php b/module/finc/src/finc/ILS/Driver/FincLibero.php index 8c552e7387710567d5bbd0afafb0fb8b81e6b827..85a3a419e41bc0758579e7d6e4fe9a37502d986e 100644 --- a/module/finc/src/finc/ILS/Driver/FincLibero.php +++ b/module/finc/src/finc/ILS/Driver/FincLibero.php @@ -356,19 +356,6 @@ class FincLibero extends FincILS implements TranslatorAwareInterface { $return = parent::getItemStatus($item); - $return['awlRecordId'] = $this->getBoundItemId($item); - // is this item bound with another item? - if ($return['awlRecordId'] != null) { - // overwrite any existing link settings as we need to order this item - // via the bound item - $return['addLink'] = - $return['addStorageRetrievalRequestLink'] = - $return['addILLRequestLink'] = - $return['addEmailHoldLink'] = false; - $return['awlRecordStatus'] = - current($this->getStatus($return['awlRecordId'])); - } - // add all item specific information from DAIA field about to item_notes // (https://intern.finc.info/issues/7863) $about = (isset($item['about'])) ? [$item['about']] : []; @@ -380,6 +367,28 @@ class FincLibero extends FincILS implements TranslatorAwareInterface $about ) ); + + $return['awlRecordId'] = $this->getBoundItemId($item); + // is this item bound with another item? + if ($return['awlRecordId'] != null) { + static $awlStatuses = []; + // overwrite any existing link settings as we need to order this item + // via the bound item + $return['addLink'] = + $return['addStorageRetrievalRequestLink'] = + $return['addILLRequestLink'] = + $return['addEmailHoldLink'] = false; + if (isset($awlStatuses[$return['awlRecordId']])) { + $return['awlRecordStatus'] = $awlStatuses[$return['awlRecordId']]; + } else { + // fix for infinite recursion due to circularly bound items + $awlStatuses[$return['awlRecordId']] = 'pending'; + $return['awlRecordStatus'] = + $awlStatuses[$return['awlRecordId']] = + current($this->getStatus($return['awlRecordId'])); + } + } + return $return; } diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index c5ca36fcf7ea41d05ac033bde79e118a30388583..0be113ea6225f2a6dd7266abcc338b90ebedd313 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -127,7 +127,7 @@ trait SolrMarcFincTrait foreach ($fieldsToCheck as $field => $subfields) { $urls = $this->getMarcRecord()->getFields($field); - $resultsPerIsil = []; + $resultsPerIndicator2 = []; if ($urls) { foreach ($urls as $url) { $isil = $url->getSubfield('9'); @@ -172,7 +172,7 @@ trait SolrMarcFincTrait } } - $resultsPerIsil[$isil][] = [ + $resultsPerIndicator2[$indicator2][$isil][] = [ 'url' => $address, 'desc' => $desc, 'indicators' => $indicator1 . $indicator2, @@ -188,14 +188,16 @@ trait SolrMarcFincTrait } } - $subresult = $this->extractUrls($resultsPerIsil); + $subresult = array_map([$this, 'extractUrls'], $resultsPerIndicator2); if (!empty($subresult)) { - foreach ($subresult as $current) { - // If entry doesn't exist so far write - // to return variable. - if (!in_array($current, $retVal)) { - $retVal[] = $current; + foreach ($subresult as $perIndicator2) { + foreach ($perIndicator2 as $current) { + // If entry doesn't exist so far write + // to return variable. + if (!in_array($current, $retVal)) { + $retVal[] = $current; + } } } } diff --git a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php index 372032924f2c49ace68fa61226e0660a22dbcf41..4b8ae4866d25c59f90f315af5305f28e94578535 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php @@ -71,6 +71,10 @@ class RecordDataFormatterFactory 'description', [$this, 'getDefaultDescriptionSpecs'] ); + $helper->setDefaults( + 'toc', + [$this, 'getTOCSpecs'] + ); $helper->setDefaults( 'core-ai', [$this, 'getAiCoreSpecs'] @@ -893,4 +897,20 @@ class RecordDataFormatterFactory ? 'rda_original_title' : 'non_rda_original_title'; } + + /** + * Get marc specifications for displaying table of contents. + * + * @return array + */ + public function getTOCSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Table of Contents', + 'getTOC', + 'data-toc.phtml' + ); + return $spec->getArray(); + } } 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/js/vendor/bootstrap-accessibility-de.min.js b/themes/finc-accessibility/js/vendor/bootstrap-accessibility-de.min.js index e10770a83219ba52528d475215ee4a0c8b96d175..43f5fe0175e2f59b7456f6ae7d5439be1dc7a39e 100644 --- a/themes/finc-accessibility/js/vendor/bootstrap-accessibility-de.min.js +++ b/themes/finc-accessibility/js/vendor/bootstrap-accessibility-de.min.js @@ -1,4 +1,313 @@ /*! bootstrap-accessibility-plugin - v1.0.6 - 2020-05-07 * https://github.com/paypal/bootstrap-accessibility-plugin * Copyright (c) 2020 PayPal Accessibility Team; Licensed BSD */ -!function($){"use strict";var uniqueId=function(prefix){return(prefix||"ui-id")+"-"+Math.floor(1e3*Math.random()+1)},focusable=function(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(map=element.parentNode,mapName=map.name,element.href&&mapName&&"map"===map.nodeName.toLowerCase()?(img=$("img[usemap='#"+mapName+"']")[0],!!img&&visible(img)):!1):(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element)},visible=function(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length};$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN)}}),$(".modal-dialog").attr({role:"document"});var modalhide=$.fn.modal.Constructor.prototype.hide;$.fn.modal.Constructor.prototype.hide=function(){modalhide.apply(this,arguments),$(document).off("keydown.bs.modal")};var modalfocus=$.fn.modal.Constructor.prototype.enforceFocus;$.fn.modal.Constructor.prototype.enforceFocus=function(){var $content=this.$element.find(".modal-content"),focEls=$content.find(":tabbable"),$lastEl=$(focEls[focEls.length-1]),$firstEl=$(focEls[0]);$lastEl.on("keydown.bs.modal",$.proxy(function(ev){9!==ev.keyCode||ev.shiftKey|ev.ctrlKey|ev.metaKey|ev.altKey||(ev.preventDefault(),$firstEl.focus())},this)),$firstEl.on("keydown.bs.modal",$.proxy(function(ev){9===ev.keyCode&&ev.shiftKey&&(ev.preventDefault(),$lastEl.focus())},this)),modalfocus.apply(this,arguments)};var $par,firstItem,toggle="[data-toggle=dropdown]",focusDelay=200,menus=$(toggle).parent().find("ul").attr("role","menu"),lis=menus.find("li").attr("role","presentation");lis.find("a").attr({role:"menuitem",tabIndex:"-1"}),$(toggle).attr({"aria-haspopup":"true","aria-expanded":"false"}),$(toggle).parent().on("shown.bs.dropdown",function(e){$par=$(this);var $toggle=$par.find(toggle);$toggle.attr("aria-expanded","true"),$toggle.on("keydown.bs.dropdown",$.proxy(function(ev){setTimeout(function(){firstItem=$(".dropdown-menu [role=menuitem]:visible",$par)[0];try{firstItem.focus()}catch(ex){}},focusDelay)},this))}).on("hidden.bs.dropdown",function(e){$par=$(this);var $toggle=$par.find(toggle);$toggle.attr("aria-expanded","false")}),$(document).on("focusout.dropdown.data-api",".dropdown-menu",function(e){var $this=$(this),that=this;$this.parent().hasClass("open")&&setTimeout(function(){$.contains(that,document.activeElement)||$this.parent().find("[data-toggle=dropdown]").dropdown("toggle")},150)}).on("keydown.bs.dropdown.data-api",toggle+", [role=menu]",$.fn.dropdown.Constructor.prototype.keydown);var $tablist=$(".nav-tabs, .nav-pills"),$lis=$tablist.children("li"),$tabs=$tablist.find('[data-toggle="tab"], [data-toggle="pill"]');$tabs&&($tablist.attr("role","tablist"),$lis.attr("role","presentation"),$tabs.attr("role","tab")),$tabs.each(function(index){var tabpanel=$($(this).attr("href")),tab=$(this),tabid=tab.attr("id")||uniqueId("ui-tab");tab.attr("id",tabid),tab.parent().hasClass("active")?(tab.attr({tabIndex:"0","aria-selected":"true","aria-controls":tab.attr("href").substr(1)}),tabpanel.attr({role:"tabpanel",tabIndex:"0","aria-hidden":"false","aria-labelledby":tabid})):(tab.attr({tabIndex:"-1","aria-selected":"false","aria-controls":tab.attr("href").substr(1)}),tabpanel.attr({role:"tabpanel",tabIndex:"-1","aria-hidden":"true","aria-labelledby":tabid}))}),$.fn.tab.Constructor.prototype.keydown=function(e){var $items,index,$this=$(this),$ul=$this.closest("ul[role=tablist] "),k=e.which||e.keyCode;if($this=$(this),/(37|38|39|40)/.test(k)){$items=$ul.find("[role=tab]:visible"),index=$items.index($items.filter(":focus")),(38==k||37==k)&&index--,(39==k||40==k)&&index++,0>index&&(index=$items.length-1),index==$items.length&&(index=0);var nextTab=$items.eq(index);"tab"===nextTab.attr("role")&&nextTab.tab("show").focus(),e.preventDefault(),e.stopPropagation()}},$(document).on("keydown.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',$.fn.tab.Constructor.prototype.keydown);var tabactivate=$.fn.tab.Constructor.prototype.activate;$.fn.tab.Constructor.prototype.activate=function(element,container,callback){var $active=container.find("> .active");$active.find("[data-toggle=tab], [data-toggle=pill]").attr({tabIndex:"-1","aria-selected":!1}),$active.filter(".tab-pane").attr({"aria-hidden":!0,tabIndex:"-1"}),tabactivate.apply(this,arguments),element.addClass("active"),element.find("[data-toggle=tab], [data-toggle=pill]").attr({tabIndex:"0","aria-selected":!0}),element.filter(".tab-pane").attr({"aria-hidden":!1,tabIndex:"0"})};var $colltabs=$('[data-toggle="collapse"]');$colltabs.each(function(index){var colltab=$(this),collpanel=$(colltab.attr("data-target")?colltab.attr("data-target"):colltab.attr("href")),parent=colltab.attr("data-parent"),collparent=parent&&$(parent),collid=colltab.attr("id")||uniqueId("ui-collapse"),parentpanel=collpanel.parent(),parentfirstchild=collparent?collparent.find(".panel.panel-default:first-child"):null,hasopenpanel=collparent?collparent.find(".panel-collapse.in").length>0:!1;colltab.attr("id",collid),collparent&&(colltab.attr({"aria-controls":collpanel.attr("id"),role:"tab","aria-selected":"false","aria-expanded":"false"}),$(collparent).find("div:not(.collapse,.panel-body), h4").attr("role","presentation"),collparent.attr({role:"tablist","aria-multiselectable":"true"}),collpanel.attr({role:"tabpanel","aria-labelledby":collid}),!hasopenpanel&&parentpanel.is(parentfirstchild)?(colltab.attr({tabindex:"0"}),collpanel.attr({tabindex:"-1"})):collpanel.hasClass("in")?(colltab.attr({"aria-selected":"true","aria-expanded":"true",tabindex:"0"}),collpanel.attr({tabindex:"0","aria-hidden":"false"})):(colltab.attr({tabindex:"-1"}),collpanel.attr({tabindex:"-1","aria-hidden":"true"})))});var collToggle=$.fn.collapse.Constructor.prototype.toggle;$.fn.collapse.Constructor.prototype.toggle=function(){var href,prevTab=this.$parent&&this.$parent.find('[aria-expanded="true"]');if(prevTab){var curTab,prevPanel=prevTab.attr("data-target")||(href=prevTab.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),$prevPanel=$(prevPanel),$curPanel=this.$element;this.$parent;this.$parent&&(curTab=this.$parent.find('[data-toggle=collapse][href="#'+this.$element.attr("id")+'"]')),collToggle.apply(this,arguments),$.support.transition&&this.$element.one($.support.transition.end,function(){prevTab.attr({"aria-selected":"false","aria-expanded":"false",tabIndex:"-1"}),$prevPanel.attr({"aria-hidden":"true",tabIndex:"-1"}),curTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:"0"}),$curPanel.hasClass("in")?$curPanel.attr({"aria-hidden":"false",tabIndex:"0"}):(curTab.attr({"aria-selected":"false","aria-expanded":"false"}),$curPanel.attr({"aria-hidden":"true",tabIndex:"-1"}))})}else collToggle.apply(this,arguments)},$.fn.collapse.Constructor.prototype.keydown=function(e){var $items,index,$this=$(this),$tablist=$this.closest("div[role=tablist] "),k=e.which||e.keyCode;$this=$(this),/(32|37|38|39|40)/.test(k)&&(32==k&&$this.click(),$items=$tablist.find("[role=tab]"),index=$items.index($items.filter(":focus")),(38==k||37==k)&&index--,(39==k||40==k)&&index++,0>index&&(index=$items.length-1),index==$items.length&&(index=0),$items.eq(index).focus(),e.preventDefault(),e.stopPropagation())},$(document).on("keydown.collapse.data-api",'[data-toggle="collapse"]',$.fn.collapse.Constructor.prototype.keydown),$(".carousel").each(function(index){function setTablistHighlightBox(){var $tab,offset,height,width,highlightBox={};highlightBox.top=0,highlightBox.left=32e3,highlightBox.height=0,highlightBox.width=0;for(var i=0;i<$tabs.length;i++){$tab=$tabs[i],offset=$($tab).offset(),height=$($tab).height(),width=$($tab).width(),highlightBox.top<offset.top&&(highlightBox.top=Math.round(offset.top)),highlightBox.height<height&&(highlightBox.height=Math.round(height)),highlightBox.left>offset.left&&(highlightBox.left=Math.round(offset.left));var w=offset.left-highlightBox.left+Math.round(width);highlightBox.width<w&&(highlightBox.width=w)}$tablistHighlight.style.top=highlightBox.top-2+"px",$tablistHighlight.style.left=highlightBox.left-2+"px",$tablistHighlight.style.height=highlightBox.height+7+"px",$tablistHighlight.style.width=highlightBox.width+8+"px"}var $tabpanel,$tablistHighlight,$pauseCarousel,$complementaryLandmark,$tab,i,$this=$(this),$prev=$this.find('[data-slide="prev"]'),$next=$this.find('[data-slide="next"]'),$tablist=$this.find(".carousel-indicators"),$tabs=$this.find(".carousel-indicators li"),$tabpanels=$this.find(".item"),$is_paused=!1,id_title="id_title",id_desc="id_desc";for($tablist.attr("role","tablist"),$tabs.focus(function(){$this.carousel("pause"),$is_paused=!0,$pauseCarousel.innerHTML="Bilderkarussel starten",$(this).parent().addClass("active"),setTablistHighlightBox(),$($tablistHighlight).addClass("focus"),$(this).parents(".carousel").addClass("contrast")}),$tabs.blur(function(event){$(this).parent().removeClass("active"),$($tablistHighlight).removeClass("focus"),$(this).parents(".carousel").removeClass("contrast")}),i=0;i<$tabpanels.length;i++)$tabpanel=$tabpanels[i],$tabpanel.setAttribute("role","tabpanel"),$tabpanel.setAttribute("id","tabpanel-"+index+"-"+i),$tabpanel.setAttribute("aria-labelledby","tab-"+index+"-"+i);for("string"!=typeof $this.attr("role")&&($this.attr("role","complementary"),$this.attr("aria-labelledby",id_title),$this.attr("aria-describedby",id_desc),$this.prepend('<p id="'+id_desc+'" class="sr-only">Dieser Bilderkarussell können Sie über Tastatur oder Maus steuern. Mit den Tabs bzw. den Vorher- und Nachher-Schaltflächen können Sie zwischen den Bildern wechseln.</p>'),$this.prepend('<h2 id="'+id_title+'" class="sr-only">Bilderkarussel mit '+$tabpanels.length+" Bildern.</h2>")),i=0;i<$tabs.length;i++){$tab=$tabs[i],$tab.setAttribute("role","tab"),$tab.setAttribute("id","tab-"+index+"-"+i),$tab.setAttribute("aria-controls","tabpanel-"+index+"-"+i);var tpId="#tabpanel-"+index+"-"+i,caption=$this.find(tpId).find("h1").text();("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h3").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h4").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h5").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h6").text()),("string"!=typeof caption||0===caption.length)&&(caption="no title");var tabName=document.createElement("span");tabName.setAttribute("class","sr-only"),tabName.innerHTML="Slide "+(i+1),caption&&(tabName.innerHTML+=": "+caption),$tab.appendChild(tabName)}$tablistHighlight=document.createElement("div"),$tablistHighlight.className="carousel-tablist-highlight",document.body.appendChild($tablistHighlight),$complementaryLandmark=document.createElement("aside"),$complementaryLandmark.setAttribute("class","carousel-aside-pause"),$complementaryLandmark.setAttribute("aria-label","Stopp- und Startsteuerung für Bildkarussel"),$this.prepend($complementaryLandmark),$pauseCarousel=document.createElement("button"),$pauseCarousel.className="carousel-pause-button",$pauseCarousel.innerHTML="Bilderkarussel stoppen",$pauseCarousel.setAttribute("title","Sie können diese Schaltfläche nutzen, um die Karussellanimationen zu stoppen."),$($complementaryLandmark).append($pauseCarousel),$($pauseCarousel).click(function(){$is_paused?($pauseCarousel.innerHTML="Karussel anhalten",$this.carousel("cycle"),$is_paused=!1):($pauseCarousel.innerHTML="Bilderkarussel starten",$this.carousel("pause"),$is_paused=!0)}),$($pauseCarousel).focus(function(){$(this).addClass("focus")}),$($pauseCarousel).blur(function(){$(this).removeClass("focus")}),setTablistHighlightBox(),$(window).resize(function(){setTablistHighlightBox()}),$prev.attr("aria-label","Vorheriges Bild"),$prev.keydown(function(e){var k=e.which||e.keyCode;/(13|32)/.test(k)&&(e.preventDefault(),e.stopPropagation(),$prev.trigger("click"))}),$prev.focus(function(){$(this).parents(".carousel").addClass("contrast")}),$prev.blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$next.attr("aria-label","Nächstes Bild"),$next.keydown(function(e){var k=e.which||e.keyCode;/(13|32)/.test(k)&&(e.preventDefault(),e.stopPropagation(),$next.trigger("click"))}),$next.focus(function(){$(this).parents(".carousel").addClass("contrast")}),$next.blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$(".carousel-inner a").focus(function(){$(this).parents(".carousel").addClass("contrast")}),$(".carousel-inner a").blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$tabs.each(function(){var item=$(this);item.hasClass("active")?item.attr({"aria-selected":"true",tabindex:"0"}):item.attr({"aria-selected":"false",tabindex:"-1"})})});var slideCarousel=$.fn.carousel.Constructor.prototype.slide;$.fn.carousel.Constructor.prototype.slide=function(type,next){var $id,$element=this.$element,$active=$element.find("[role=tabpanel].active"),$next=next||$active[type](),$tab_count=$element.find("[role=tabpanel]").length,$prev_side=$element.find('[data-slide="prev"]'),$next_side=$element.find('[data-slide="next"]'),$index=0,$prev_index=$tab_count-1,$next_index=1;$next&&$next.attr("id")&&($id=$next.attr("id"),$index=$id.lastIndexOf("-"),$index>=0&&($index=parseInt($id.substring($index+1),10)),$prev_index=$index-1,1>$prev_index&&($prev_index=$tab_count-1),$next_index=$index+1,$next_index>=$tab_count&&($next_index=0)),$prev_side.attr("aria-label","Zeige Bild "+($prev_index+1)+" von "+$tab_count),$next_side.attr("aria-label","Zeige Bild "+($next_index+1)+" von "+$tab_count),slideCarousel.apply(this,arguments),$active.one("bsTransitionEnd",function(){var $tab;$tab=$element.find('li[aria-controls="'+$active.attr("id")+'"]'),$tab&&$tab.attr({"aria-selected":!1,tabIndex:"-1"}),$tab=$element.find('li[aria-controls="'+$next.attr("id")+'"]'),$tab&&$tab.attr({"aria-selected":!0,tabIndex:"0"})})};var $this;$.fn.carousel.Constructor.prototype.keydown=function(e){function selectTab(index){index>=$tabs.length||0>index||($carousel.carousel(index),setTimeout(function(){$tabs[index].focus()},150))}$this=$this||$(this),this instanceof Node&&($this=$(this));var index,$carousel=$(e.target).closest(".carousel"),$tabs=$carousel.find("[role=tab]"),k=e.which||e.keyCode;/(37|38|39|40)/.test(k)&&(index=$tabs.index($tabs.filter(".active")),(37==k||38==k)&&(index--,selectTab(index)),(39==k||40==k)&&(index++,selectTab(index)),e.preventDefault(),e.stopPropagation())},$(document).on("keydown.carousel.data-api","li[role=tab]",$.fn.carousel.Constructor.prototype.keydown)}(jQuery); \ No newline at end of file +!function ($) { + "use strict"; + var uniqueId = function (prefix) { + return (prefix || "ui-id") + "-" + Math.floor(1e3 * Math.random() + 1) + }, focusable = function (element, isTabIndexNotNaN) { + var map, mapName, img, nodeName = element.nodeName.toLowerCase(); + return "area" === nodeName ? (map = element.parentNode, mapName = map.name, element.href && mapName && "map" === map.nodeName.toLowerCase() ? (img = $("img[usemap='#" + mapName + "']")[0], !!img && visible(img)) : !1) : (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element) + }, visible = function (element) { + return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function () { + return "hidden" === $.css(this, "visibility") + }).length + }; + $.extend($.expr[":"], { + data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) { + return function (elem) { + return !!$.data(elem, dataName) + } + }) : function (elem, i, match) { + return !!$.data(elem, match[3]) + }, focusable: function (element) { + return focusable(element, !isNaN($.attr(element, "tabindex"))) + }, tabbable: function (element) { + var tabIndex = $.attr(element, "tabindex"), isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN) + } + }), $(".modal-dialog").attr({role: "document"}); + var modalhide = $.fn.modal.Constructor.prototype.hide; + $.fn.modal.Constructor.prototype.hide = function () { + modalhide.apply(this, arguments), $(document).off("keydown.bs.modal") + }; + var modalfocus = $.fn.modal.Constructor.prototype.enforceFocus; + $.fn.modal.Constructor.prototype.enforceFocus = function () { + var $content = this.$element.find(".modal-content"), focEls = $content.find(":tabbable"), + $lastEl = $(focEls[focEls.length - 1]), $firstEl = $(focEls[0]); + $lastEl.on("keydown.bs.modal", $.proxy(function (ev) { + 9 !== ev.keyCode || ev.shiftKey | ev.ctrlKey | ev.metaKey | ev.altKey || (ev.preventDefault(), $firstEl.focus()) + }, this)), $firstEl.on("keydown.bs.modal", $.proxy(function (ev) { + 9 === ev.keyCode && ev.shiftKey && (ev.preventDefault(), $lastEl.focus()) + }, this)), modalfocus.apply(this, arguments) + }; + var $par, firstItem, toggle = "[data-toggle=dropdown]", focusDelay = 200, + menus = $(toggle).parent().find("ul").attr("role", "menu"), lis = menus.find("li").attr("role", "presentation"); + lis.find("a").attr({role: "menuitem", tabIndex: "-1"}), $(toggle).attr({ + "aria-haspopup": "true", + "aria-expanded": "false" + }), $(toggle).parent().on("shown.bs.dropdown", function (e) { + $par = $(this); + var $toggle = $par.find(toggle); + $toggle.attr("aria-expanded", "true"), $toggle.on("keydown.bs.dropdown", $.proxy(function (ev) { + setTimeout(function () { + firstItem = $(".dropdown-menu [role=menuitem]:visible", $par)[0]; + try { + firstItem.focus() + } catch (ex) { + } + }, focusDelay) + }, this)) + }).on("hidden.bs.dropdown", function (e) { + $par = $(this); + var $toggle = $par.find(toggle); + $toggle.attr("aria-expanded", "false") + }), $(document).on("focusout.dropdown.data-api", ".dropdown-menu", function (e) { + var $this = $(this), that = this; + $this.parent().hasClass("open") && setTimeout(function () { + $.contains(that, document.activeElement) || $this.parent().find("[data-toggle=dropdown]").dropdown("toggle") + }, 150) + }).on("keydown.bs.dropdown.data-api", toggle + ", [role=menu]", $.fn.dropdown.Constructor.prototype.keydown); + var $tablist = $(".nav-tabs, .nav-pills"), $lis = $tablist.children("li"), + $tabs = $tablist.find('[data-toggle="tab"], [data-toggle="pill"]'); + $tabs && ($tablist.attr("role", "tablist"), $lis.attr("role", "presentation"), $tabs.attr("role", "tab")), $tabs.each(function (index) { + var tabpanel = $($(this).attr("href")), tab = $(this), tabid = tab.attr("id") || uniqueId("ui-tab"); + tab.attr("id", tabid), tab.parent().hasClass("active") ? (tab.attr({ + tabIndex: "0", + "aria-selected": "true", + "aria-controls": tab.attr("href").substr(1) + }), tabpanel.attr({ + role: "tabpanel", + tabIndex: "0", + "aria-hidden": "false", + "aria-labelledby": tabid + })) : (tab.attr({ + tabIndex: "-1", + "aria-selected": "false", + "aria-controls": tab.attr("href").substr(1) + }), tabpanel.attr({role: "tabpanel", tabIndex: "-1", "aria-hidden": "true", "aria-labelledby": tabid})) + }), $.fn.tab.Constructor.prototype.keydown = function (e) { + var $items, index, $this = $(this), $ul = $this.closest("ul[role=tablist] "), k = e.which || e.keyCode; + if ($this = $(this), /(37|38|39|40)/.test(k)) { + $items = $ul.find("[role=tab]:visible"), index = $items.index($items.filter(":focus")), (38 == k || 37 == k) && index--, (39 == k || 40 == k) && index++, 0 > index && (index = $items.length - 1), index == $items.length && (index = 0); + var nextTab = $items.eq(index); + "tab" === nextTab.attr("role") && nextTab.tab("show").focus(), e.preventDefault(), e.stopPropagation() + } + }, $(document).on("keydown.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', $.fn.tab.Constructor.prototype.keydown); + var tabactivate = $.fn.tab.Constructor.prototype.activate; + $.fn.tab.Constructor.prototype.activate = function (element, container, callback) { + var $active = container.find("> .active"); + $active.find("[data-toggle=tab], [data-toggle=pill]").attr({ + tabIndex: "-1", + "aria-selected": !1 + }), $active.filter(".tab-pane").attr({ + "aria-hidden": !0, + tabIndex: "-1" + }), tabactivate.apply(this, arguments), element.addClass("active"), element.find("[data-toggle=tab], [data-toggle=pill]").attr({ + tabIndex: "0", + "aria-selected": !0 + }), element.filter(".tab-pane").attr({"aria-hidden": !1, tabIndex: "0"}) + }; + var $colltabs = $('[data-toggle="collapse"]'); + $colltabs.each(function (index) { + var colltab = $(this), + collpanel = $(colltab.attr("data-target") ? colltab.attr("data-target") : colltab.attr("href")), + parent = colltab.attr("data-parent"), collparent = parent && $(parent), + collid = colltab.attr("id") || uniqueId("ui-collapse"), parentpanel = collpanel.parent(), + parentfirstchild = collparent ? collparent.find(".panel.panel-default:first-child") : null, + hasopenpanel = collparent ? collparent.find(".panel-collapse.in").length > 0 : !1; + colltab.attr("id", collid), collparent && (colltab.attr({ + "aria-controls": collpanel.attr("id"), + role: "tab", + "aria-selected": "false", + "aria-expanded": "false" + }), $(collparent).find("div:not(.collapse,.panel-body), h4").attr("role", "presentation"), collparent.attr({ + role: "tablist", + "aria-multiselectable": "true" + }), collpanel.attr({ + role: "tabpanel", + "aria-labelledby": collid + }), !hasopenpanel && parentpanel.is(parentfirstchild) ? (colltab.attr({tabindex: "0"}), collpanel.attr({tabindex: "-1"})) : collpanel.hasClass("in") ? (colltab.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabindex: "0" + }), collpanel.attr({ + tabindex: "0", + "aria-hidden": "false" + })) : (colltab.attr({tabindex: "-1"}), collpanel.attr({tabindex: "-1", "aria-hidden": "true"}))) + }); + var collToggle = $.fn.collapse.Constructor.prototype.toggle; + $.fn.collapse.Constructor.prototype.toggle = function () { + var href, prevTab = this.$parent && this.$parent.find('[aria-expanded="true"]'); + if (prevTab) { + var curTab, + prevPanel = prevTab.attr("data-target") || (href = prevTab.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, ""), + $prevPanel = $(prevPanel), $curPanel = this.$element; + this.$parent; + this.$parent && (curTab = this.$parent.find('[data-toggle=collapse][href="#' + this.$element.attr("id") + '"]')), collToggle.apply(this, arguments), $.support.transition && this.$element.one($.support.transition.end, function () { + prevTab.attr({ + "aria-selected": "false", + "aria-expanded": "false", + tabIndex: "-1" + }), $prevPanel.attr({"aria-hidden": "true", tabIndex: "-1"}), curTab.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: "0" + }), $curPanel.hasClass("in") ? $curPanel.attr({ + "aria-hidden": "false", + tabIndex: "0" + }) : (curTab.attr({ + "aria-selected": "false", + "aria-expanded": "false" + }), $curPanel.attr({"aria-hidden": "true", tabIndex: "-1"})) + }) + } else collToggle.apply(this, arguments) + }, $.fn.collapse.Constructor.prototype.keydown = function (e) { + var $items, index, $this = $(this), $tablist = $this.closest("div[role=tablist] "), k = e.which || e.keyCode; + $this = $(this), /(32|37|38|39|40)/.test(k) && (32 == k && $this.click(), $items = $tablist.find("[role=tab]"), index = $items.index($items.filter(":focus")), (38 == k || 37 == k) && index--, (39 == k || 40 == k) && index++, 0 > index && (index = $items.length - 1), index == $items.length && (index = 0), $items.eq(index).focus(), e.preventDefault(), e.stopPropagation()) + }, $(document).on("keydown.collapse.data-api", '[data-toggle="collapse"]', $.fn.collapse.Constructor.prototype.keydown), $(".carousel").each(function (index) { + function setTablistHighlightBox() { + var $tab, offset, height, width, highlightBox = {}; + highlightBox.top = 0, highlightBox.left = 32e3, highlightBox.height = 0, highlightBox.width = 0; + for (var i = 0; i < $tabs.length; i++) { + $tab = $tabs[i], offset = $($tab).offset(), height = $($tab).height(), width = $($tab).width(), highlightBox.top < offset.top && (highlightBox.top = Math.round(offset.top)), highlightBox.height < height && (highlightBox.height = Math.round(height)), highlightBox.left > offset.left && (highlightBox.left = Math.round(offset.left)); + var w = offset.left - highlightBox.left + Math.round(width); + highlightBox.width < w && (highlightBox.width = w) + } + $tablistHighlight.style.top = highlightBox.top - 2 + "px", $tablistHighlight.style.left = highlightBox.left - 2 + "px", $tablistHighlight.style.height = highlightBox.height + 7 + "px", $tablistHighlight.style.width = highlightBox.width + 8 + "px" + } + + var $tabpanel, $tablistHighlight, $pauseCarousel, $complementaryLandmark, $tab, i, $this = $(this), + $prev = $this.find('[data-slide="prev"]'), $next = $this.find('[data-slide="next"]'), + $tablist = $this.find(".carousel-indicators"), $tabs = $this.find(".carousel-indicators li"), + $tabpanels = $this.find(".item"), $is_paused = !1, id_title = "id_title", id_desc = "id_desc"; + for ($tablist.attr("role", "tablist"), $tabs.focus(function () { + $this.carousel("pause"), $is_paused = !0, $pauseCarousel.innerHTML = "Bilderkarussel starten", $(this).parent().addClass("active"), setTablistHighlightBox(), $($tablistHighlight).addClass("focus"), $(this).parents(".carousel").addClass("contrast") + }), $tabs.blur(function (event) { + $(this).parent().removeClass("active"), $($tablistHighlight).removeClass("focus"), $(this).parents(".carousel").removeClass("contrast") + }), i = 0; i < $tabpanels.length; i++) $tabpanel = $tabpanels[i], $tabpanel.setAttribute("role", "tabpanel"), $tabpanel.setAttribute("id", "tabpanel-" + index + "-" + i), $tabpanel.setAttribute("aria-labelledby", "tab-" + index + "-" + i); + for ("string" != typeof $this.attr("role") && ($this.attr("role", "complementary"), $this.attr("aria-labelledby", id_title), $this.attr("aria-describedby", id_desc), $this.prepend('<p id="' + id_desc + '" class="sr-only">Dieser Bilderkarussell können Sie über Tastatur oder Maus steuern. Mit den Tabs bzw. den Vorher- und Nachher-Schaltflächen können Sie zwischen den Bildern wechseln.</p>'), $this.prepend('<h2 id="' + id_title + '" class="sr-only">Bilderkarussel mit ' + $tabpanels.length + " Bildern.</h2>")), i = 0; i < $tabs.length; i++) { + $tab = $tabs[i], $tab.setAttribute("role", "tab"), $tab.setAttribute("id", "tab-" + index + "-" + i), $tab.setAttribute("aria-controls", "tabpanel-" + index + "-" + i); + var tpId = "#tabpanel-" + index + "-" + i, caption = $this.find(tpId).find("h1").text(); + ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h3").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h4").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h5").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h6").text()), ("string" != typeof caption || 0 === caption.length) && (caption = "no title"); + var tabName = document.createElement("span"); + tabName.setAttribute("class", "sr-only"), tabName.innerHTML = "Slide " + (i + 1), caption && (tabName.innerHTML += ": " + caption), $tab.appendChild(tabName) + } + $tablistHighlight = document.createElement("div"), $tablistHighlight.className = "carousel-tablist-highlight", document.body.appendChild($tablistHighlight), $complementaryLandmark = document.createElement("aside"), $complementaryLandmark.setAttribute("class", "carousel-aside-pause"), $complementaryLandmark.setAttribute("aria-label", "Stopp- und Startsteuerung für Bildkarussel"), $this.prepend($complementaryLandmark), $pauseCarousel = document.createElement("button"), $pauseCarousel.className = "carousel-pause-button", $pauseCarousel.innerHTML = "Bilderkarussel stoppen", $pauseCarousel.setAttribute("title", "Sie können diese Schaltfläche nutzen, um die Karussellanimationen zu stoppen."), $($complementaryLandmark).append($pauseCarousel), $($pauseCarousel).click(function () { + $is_paused ? ($pauseCarousel.innerHTML = "Karussel anhalten", $this.carousel("cycle"), $is_paused = !1) : ($pauseCarousel.innerHTML = "Bilderkarussel starten", $this.carousel("pause"), $is_paused = !0) + }), $($pauseCarousel).focus(function () { + $(this).addClass("focus") + }), $($pauseCarousel).blur(function () { + $(this).removeClass("focus") + }), setTablistHighlightBox(), $(window).resize(function () { + setTablistHighlightBox() + }), $prev.attr("aria-label", "Vorheriges Bild"), $prev.keydown(function (e) { + var k = e.which || e.keyCode; + /(13|32)/.test(k) && (e.preventDefault(), e.stopPropagation(), $prev.trigger("click")) + }), $prev.focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $prev.blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $next.attr("aria-label", "Nächstes Bild"), $next.keydown(function (e) { + var k = e.which || e.keyCode; + /(13|32)/.test(k) && (e.preventDefault(), e.stopPropagation(), $next.trigger("click")) + }), $next.focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $next.blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $(".carousel-inner a").focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $(".carousel-inner a").blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $tabs.each(function () { + var item = $(this); + item.hasClass("active") ? item.attr({ + "aria-selected": "true", + tabindex: "0" + }) : item.attr({"aria-selected": "false", tabindex: "-1"}) + }) + }); + var slideCarousel = $.fn.carousel.Constructor.prototype.slide; + $.fn.carousel.Constructor.prototype.slide = function (type, next) { + var $id, $element = this.$element, $active = $element.find("[role=tabpanel].active"), + $next = next || $active[type](), $tab_count = $element.find("[role=tabpanel]").length, + $prev_side = $element.find('[data-slide="prev"]'), $next_side = $element.find('[data-slide="next"]'), + $index = 0, $prev_index = $tab_count - 1, $next_index = 1; + $next && $next.attr("id") && ($id = $next.attr("id"), $index = $id.lastIndexOf("-"), $index >= 0 && ($index = parseInt($id.substring($index + 1), 10)), $prev_index = $index - 1, 1 > $prev_index && ($prev_index = $tab_count - 1), $next_index = $index + 1, $next_index >= $tab_count && ($next_index = 0)), $prev_side.attr("aria-label", "Zeige Bild " + ($prev_index + 1) + " von " + $tab_count), $next_side.attr("aria-label", "Zeige Bild " + ($next_index + 1) + " von " + $tab_count), slideCarousel.apply(this, arguments), $active.one("bsTransitionEnd", function () { + var $tab; + $tab = $element.find('li[aria-controls="' + $active.attr("id") + '"]'), $tab && $tab.attr({ + "aria-selected": !1, + tabIndex: "-1" + }), $tab = $element.find('li[aria-controls="' + $next.attr("id") + '"]'), $tab && $tab.attr({ + "aria-selected": !0, + tabIndex: "0" + }) + }) + }; + $.fn.collapse.Constructor.prototype.show = function () { + if (!this.transitioning && !this.$element.hasClass("in")) { + var t, e = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); + if (!(e && e.length && (t = e.data("bs.collapse")) && t.transitioning)) { + var i = $.Event("show.bs.collapse"); + if (this.$element.trigger(i), !i.isDefaultPrevented()) { + e && e.length && (l.call(e, "hide"), t || e.data("bs.collapse", null)); + var o = this.dimension(); + this.$element.removeClass("collapse").addClass("collapsing")[o](0); + // don't add aria-expanded to collapsing element in side facets + if (this.$element.attr('id') === undefined || !this.$element.attr('id').startsWith("side-collapse")) { + this.$element.attr("aria-expanded", !0) + } + this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; + var n = function () { + this.$element.removeClass("collapsing").addClass("collapse in")[o](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") + }; + if (!$.support.transition) return n.call(this); + var s = $.camelCase(["scroll", o].join("-")); + this.$element.one("bsTransitionEnd", $.proxy(n, this)).emulateTransitionEnd(350)[o](this.$element[0][s]) + } + } + } + }; + $.fn.collapse.Constructor.prototype.hide = function () { + if (!this.transitioning && this.$element.hasClass("in")) { + var t = $.Event("hide.bs.collapse"); + if (this.$element.trigger(t), !t.isDefaultPrevented()) { + var e = this.dimension(); + this.$element[e](this.$element[e]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in"); + + // don't add aria-expanded to collapsing element in side facets + if (this.$element.attr('id') === undefined || !this.$element.attr('id').startsWith("side-collapse")) { + this.$element.attr("aria-expanded", !1) + } + + this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; + var i = function () { + this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") + }; + if (!$.support.transition) return i.call(this); + this.$element[e](0).one("bsTransitionEnd", $.proxy(i, this)).emulateTransitionEnd(350) + } + } + }; + $.fn.collapse.Constructor.prototype.addAriaAndCollapsedClass = function (t, e) { + // don't add aria-expanded to collapsing element in side facets + if (t.attr('id') === undefined || !t.attr('id').startsWith("side-collapse")) { + var i = t.hasClass("in"); + t.attr("aria-expanded", i); + } + e.toggleClass("collapsed", !i).attr("aria-expanded", i); + }; + var $this; + $.fn.carousel.Constructor.prototype.keydown = function (e) { + function selectTab(index) { + index >= $tabs.length || 0 > index || ($carousel.carousel(index), setTimeout(function () { + $tabs[index].focus() + }, 150)) + } + + $this = $this || $(this), this instanceof Node && ($this = $(this)); + var index, $carousel = $(e.target).closest(".carousel"), $tabs = $carousel.find("[role=tab]"), + k = e.which || e.keyCode; + /(37|38|39|40)/.test(k) && (index = $tabs.index($tabs.filter(".active")), (37 == k || 38 == k) && (index--, selectTab(index)), (39 == k || 40 == k) && (index++, selectTab(index)), e.preventDefault(), e.stopPropagation()) + }, $(document).on("keydown.carousel.data-api", "li[role=tab]", $.fn.carousel.Constructor.prototype.keydown) +}(jQuery); \ No newline at end of file diff --git a/themes/finc-accessibility/js/vendor/bootstrap-accessibility-en.min.js b/themes/finc-accessibility/js/vendor/bootstrap-accessibility-en.min.js index 423c963b4fd7b5fe345689b89a3c94233085d8e4..630f112aed7e6a0149687a95215c623908bf0404 100644 --- a/themes/finc-accessibility/js/vendor/bootstrap-accessibility-en.min.js +++ b/themes/finc-accessibility/js/vendor/bootstrap-accessibility-en.min.js @@ -1,4 +1,314 @@ /*! bootstrap-accessibility-plugin - v1.0.6 - 2020-05-07 * https://github.com/paypal/bootstrap-accessibility-plugin * Copyright (c) 2020 PayPal Accessibility Team; Licensed BSD */ -!function($){"use strict";console.log('en');var uniqueId=function(prefix){return(prefix||"ui-id")+"-"+Math.floor(1e3*Math.random()+1)},focusable=function(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(map=element.parentNode,mapName=map.name,element.href&&mapName&&"map"===map.nodeName.toLowerCase()?(img=$("img[usemap='#"+mapName+"']")[0],!!img&&visible(img)):!1):(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element)},visible=function(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length};$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN)}}),$(".modal-dialog").attr({role:"document"});var modalhide=$.fn.modal.Constructor.prototype.hide;$.fn.modal.Constructor.prototype.hide=function(){modalhide.apply(this,arguments),$(document).off("keydown.bs.modal")};var modalfocus=$.fn.modal.Constructor.prototype.enforceFocus;$.fn.modal.Constructor.prototype.enforceFocus=function(){var $content=this.$element.find(".modal-content"),focEls=$content.find(":tabbable"),$lastEl=$(focEls[focEls.length-1]),$firstEl=$(focEls[0]);$lastEl.on("keydown.bs.modal",$.proxy(function(ev){9!==ev.keyCode||ev.shiftKey|ev.ctrlKey|ev.metaKey|ev.altKey||(ev.preventDefault(),$firstEl.focus())},this)),$firstEl.on("keydown.bs.modal",$.proxy(function(ev){9===ev.keyCode&&ev.shiftKey&&(ev.preventDefault(),$lastEl.focus())},this)),modalfocus.apply(this,arguments)};var $par,firstItem,toggle="[data-toggle=dropdown]",focusDelay=200,menus=$(toggle).parent().find("ul").attr("role","menu"),lis=menus.find("li").attr("role","presentation");lis.find("a").attr({role:"menuitem",tabIndex:"-1"}),$(toggle).attr({"aria-haspopup":"true","aria-expanded":"false"}),$(toggle).parent().on("shown.bs.dropdown",function(e){$par=$(this);var $toggle=$par.find(toggle);$toggle.attr("aria-expanded","true"),$toggle.on("keydown.bs.dropdown",$.proxy(function(ev){setTimeout(function(){firstItem=$(".dropdown-menu [role=menuitem]:visible",$par)[0];try{firstItem.focus()}catch(ex){}},focusDelay)},this))}).on("hidden.bs.dropdown",function(e){$par=$(this);var $toggle=$par.find(toggle);$toggle.attr("aria-expanded","false")}),$(document).on("focusout.dropdown.data-api",".dropdown-menu",function(e){var $this=$(this),that=this;$this.parent().hasClass("open")&&setTimeout(function(){$.contains(that,document.activeElement)||$this.parent().find("[data-toggle=dropdown]").dropdown("toggle")},150)}).on("keydown.bs.dropdown.data-api",toggle+", [role=menu]",$.fn.dropdown.Constructor.prototype.keydown);var $tablist=$(".nav-tabs, .nav-pills"),$lis=$tablist.children("li"),$tabs=$tablist.find('[data-toggle="tab"], [data-toggle="pill"]');$tabs&&($tablist.attr("role","tablist"),$lis.attr("role","presentation"),$tabs.attr("role","tab")),$tabs.each(function(index){var tabpanel=$($(this).attr("href")),tab=$(this),tabid=tab.attr("id")||uniqueId("ui-tab");tab.attr("id",tabid),tab.parent().hasClass("active")?(tab.attr({tabIndex:"0","aria-selected":"true","aria-controls":tab.attr("href").substr(1)}),tabpanel.attr({role:"tabpanel",tabIndex:"0","aria-hidden":"false","aria-labelledby":tabid})):(tab.attr({tabIndex:"-1","aria-selected":"false","aria-controls":tab.attr("href").substr(1)}),tabpanel.attr({role:"tabpanel",tabIndex:"-1","aria-hidden":"true","aria-labelledby":tabid}))}),$.fn.tab.Constructor.prototype.keydown=function(e){var $items,index,$this=$(this),$ul=$this.closest("ul[role=tablist] "),k=e.which||e.keyCode;if($this=$(this),/(37|38|39|40)/.test(k)){$items=$ul.find("[role=tab]:visible"),index=$items.index($items.filter(":focus")),(38==k||37==k)&&index--,(39==k||40==k)&&index++,0>index&&(index=$items.length-1),index==$items.length&&(index=0);var nextTab=$items.eq(index);"tab"===nextTab.attr("role")&&nextTab.tab("show").focus(),e.preventDefault(),e.stopPropagation()}},$(document).on("keydown.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',$.fn.tab.Constructor.prototype.keydown);var tabactivate=$.fn.tab.Constructor.prototype.activate;$.fn.tab.Constructor.prototype.activate=function(element,container,callback){var $active=container.find("> .active");$active.find("[data-toggle=tab], [data-toggle=pill]").attr({tabIndex:"-1","aria-selected":!1}),$active.filter(".tab-pane").attr({"aria-hidden":!0,tabIndex:"-1"}),tabactivate.apply(this,arguments),element.addClass("active"),element.find("[data-toggle=tab], [data-toggle=pill]").attr({tabIndex:"0","aria-selected":!0}),element.filter(".tab-pane").attr({"aria-hidden":!1,tabIndex:"0"})};var $colltabs=$('[data-toggle="collapse"]');$colltabs.each(function(index){var colltab=$(this),collpanel=$(colltab.attr("data-target")?colltab.attr("data-target"):colltab.attr("href")),parent=colltab.attr("data-parent"),collparent=parent&&$(parent),collid=colltab.attr("id")||uniqueId("ui-collapse"),parentpanel=collpanel.parent(),parentfirstchild=collparent?collparent.find(".panel.panel-default:first-child"):null,hasopenpanel=collparent?collparent.find(".panel-collapse.in").length>0:!1;colltab.attr("id",collid),collparent&&(colltab.attr({"aria-controls":collpanel.attr("id"),role:"tab","aria-selected":"false","aria-expanded":"false"}),$(collparent).find("div:not(.collapse,.panel-body), h4").attr("role","presentation"),collparent.attr({role:"tablist","aria-multiselectable":"true"}),collpanel.attr({role:"tabpanel","aria-labelledby":collid}),!hasopenpanel&&parentpanel.is(parentfirstchild)?(colltab.attr({tabindex:"0"}),collpanel.attr({tabindex:"-1"})):collpanel.hasClass("in")?(colltab.attr({"aria-selected":"true","aria-expanded":"true",tabindex:"0"}),collpanel.attr({tabindex:"0","aria-hidden":"false"})):(colltab.attr({tabindex:"-1"}),collpanel.attr({tabindex:"-1","aria-hidden":"true"})))});var collToggle=$.fn.collapse.Constructor.prototype.toggle;$.fn.collapse.Constructor.prototype.toggle=function(){var href,prevTab=this.$parent&&this.$parent.find('[aria-expanded="true"]');if(prevTab){var curTab,prevPanel=prevTab.attr("data-target")||(href=prevTab.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),$prevPanel=$(prevPanel),$curPanel=this.$element;this.$parent;this.$parent&&(curTab=this.$parent.find('[data-toggle=collapse][href="#'+this.$element.attr("id")+'"]')),collToggle.apply(this,arguments),$.support.transition&&this.$element.one($.support.transition.end,function(){prevTab.attr({"aria-selected":"false","aria-expanded":"false",tabIndex:"-1"}),$prevPanel.attr({"aria-hidden":"true",tabIndex:"-1"}),curTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:"0"}),$curPanel.hasClass("in")?$curPanel.attr({"aria-hidden":"false",tabIndex:"0"}):(curTab.attr({"aria-selected":"false","aria-expanded":"false"}),$curPanel.attr({"aria-hidden":"true",tabIndex:"-1"}))})}else collToggle.apply(this,arguments)},$.fn.collapse.Constructor.prototype.keydown=function(e){var $items,index,$this=$(this),$tablist=$this.closest("div[role=tablist] "),k=e.which||e.keyCode;$this=$(this),/(32|37|38|39|40)/.test(k)&&(32==k&&$this.click(),$items=$tablist.find("[role=tab]"),index=$items.index($items.filter(":focus")),(38==k||37==k)&&index--,(39==k||40==k)&&index++,0>index&&(index=$items.length-1),index==$items.length&&(index=0),$items.eq(index).focus(),e.preventDefault(),e.stopPropagation())},$(document).on("keydown.collapse.data-api",'[data-toggle="collapse"]',$.fn.collapse.Constructor.prototype.keydown),$(".carousel").each(function(index){function setTablistHighlightBox(){var $tab,offset,height,width,highlightBox={};highlightBox.top=0,highlightBox.left=32e3,highlightBox.height=0,highlightBox.width=0;for(var i=0;i<$tabs.length;i++){$tab=$tabs[i],offset=$($tab).offset(),height=$($tab).height(),width=$($tab).width(),highlightBox.top<offset.top&&(highlightBox.top=Math.round(offset.top)),highlightBox.height<height&&(highlightBox.height=Math.round(height)),highlightBox.left>offset.left&&(highlightBox.left=Math.round(offset.left));var w=offset.left-highlightBox.left+Math.round(width);highlightBox.width<w&&(highlightBox.width=w)}$tablistHighlight.style.top=highlightBox.top-2+"px",$tablistHighlight.style.left=highlightBox.left-2+"px",$tablistHighlight.style.height=highlightBox.height+7+"px",$tablistHighlight.style.width=highlightBox.width+8+"px"}var $tabpanel,$tablistHighlight,$pauseCarousel,$complementaryLandmark,$tab,i,$this=$(this),$prev=$this.find('[data-slide="prev"]'),$next=$this.find('[data-slide="next"]'),$tablist=$this.find(".carousel-indicators"),$tabs=$this.find(".carousel-indicators li"),$tabpanels=$this.find(".item"),$is_paused=!1,id_title="id_title",id_desc="id_desc";for($tablist.attr("role","tablist"),$tabs.focus(function(){$this.carousel("pause"),$is_paused=!0,$pauseCarousel.innerHTML="Start Image Carousel",$(this).parent().addClass("active"),setTablistHighlightBox(),$($tablistHighlight).addClass("focus"),$(this).parents(".carousel").addClass("contrast")}),$tabs.blur(function(event){$(this).parent().removeClass("active"),$($tablistHighlight).removeClass("focus"),$(this).parents(".carousel").removeClass("contrast")}),i=0;i<$tabpanels.length;i++)$tabpanel=$tabpanels[i],$tabpanel.setAttribute("role","tabpanel"),$tabpanel.setAttribute("id","tabpanel-"+index+"-"+i),$tabpanel.setAttribute("aria-labelledby","tab-"+index+"-"+i);for("string"!=typeof $this.attr("role")&&($this.attr("role","complementary"),$this.attr("aria-labelledby",id_title),$this.attr("aria-describedby",id_desc),$this.prepend('<p id="'+id_desc+'" class="sr-only">You can control this image carousel using your keyboard or pointing device. Use the tabs or the previous and next buttons to change the image displayed.</p>'),$this.prepend('<h2 id="'+id_title+'" class="sr-only">Carousel with '+$tabpanels.length+" images.</h2>")),i=0;i<$tabs.length;i++){$tab=$tabs[i],$tab.setAttribute("role","tab"),$tab.setAttribute("id","tab-"+index+"-"+i),$tab.setAttribute("aria-controls","tabpanel-"+index+"-"+i);var tpId="#tabpanel-"+index+"-"+i,caption=$this.find(tpId).find("h1").text();("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h3").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h4").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h5").text()),("string"!=typeof caption||0===caption.length)&&(caption=$this.find(tpId).find("h6").text()),("string"!=typeof caption||0===caption.length)&&(caption="no title");var tabName=document.createElement("span");tabName.setAttribute("class","sr-only"),tabName.innerHTML="Slide "+(i+1),caption&&(tabName.innerHTML+=": "+caption),$tab.appendChild(tabName)}$tablistHighlight=document.createElement("div"),$tablistHighlight.className="carousel-tablist-highlight",document.body.appendChild($tablistHighlight),$complementaryLandmark=document.createElement("aside"),$complementaryLandmark.setAttribute("class","carousel-aside-pause"),$complementaryLandmark.setAttribute("aria-label","Carousel pause/start control"),$this.prepend($complementaryLandmark),$pauseCarousel=document.createElement("button"),$pauseCarousel.className="carousel-pause-button",$pauseCarousel.innerHTML="Pause Carousel",$pauseCarousel.setAttribute("title","Use the pause/start carousel button to stop/start carousel animations."),$($complementaryLandmark).append($pauseCarousel),$($pauseCarousel).click(function(){$is_paused?($pauseCarousel.innerHTML="Pause Carousel",$this.carousel("cycle"),$is_paused=!1):($pauseCarousel.innerHTML="Start Carousel",$this.carousel("pause"),$is_paused=!0)}),$($pauseCarousel).focus(function(){$(this).addClass("focus")}),$($pauseCarousel).blur(function(){$(this).removeClass("focus")}),setTablistHighlightBox(),$(window).resize(function(){setTablistHighlightBox()}),$prev.attr("aria-label","Previous image"),$prev.keydown(function(e){var k=e.which||e.keyCode;/(13|32)/.test(k)&&(e.preventDefault(),e.stopPropagation(),$prev.trigger("click"))}),$prev.focus(function(){$(this).parents(".carousel").addClass("contrast")}),$prev.blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$next.attr("aria-label","Next Slide"),$next.keydown(function(e){var k=e.which||e.keyCode;/(13|32)/.test(k)&&(e.preventDefault(),e.stopPropagation(),$next.trigger("click"))}),$next.focus(function(){$(this).parents(".carousel").addClass("contrast")}),$next.blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$(".carousel-inner a").focus(function(){$(this).parents(".carousel").addClass("contrast")}),$(".carousel-inner a").blur(function(){$(this).parents(".carousel").removeClass("contrast")}),$tabs.each(function(){var item=$(this);item.hasClass("active")?item.attr({"aria-selected":"true",tabindex:"0"}):item.attr({"aria-selected":"false",tabindex:"-1"})})});var slideCarousel=$.fn.carousel.Constructor.prototype.slide;$.fn.carousel.Constructor.prototype.slide=function(type,next){var $id,$element=this.$element,$active=$element.find("[role=tabpanel].active"),$next=next||$active[type](),$tab_count=$element.find("[role=tabpanel]").length,$prev_side=$element.find('[data-slide="prev"]'),$next_side=$element.find('[data-slide="next"]'),$index=0,$prev_index=$tab_count-1,$next_index=1;$next&&$next.attr("id")&&($id=$next.attr("id"),$index=$id.lastIndexOf("-"),$index>=0&&($index=parseInt($id.substring($index+1),10)),$prev_index=$index-1,1>$prev_index&&($prev_index=$tab_count-1),$next_index=$index+1,$next_index>=$tab_count&&($next_index=0)),$prev_side.attr("aria-label","Show image "+($prev_index+1)+" of "+$tab_count),$next_side.attr("aria-label","Show image "+($next_index+1)+" of "+$tab_count),slideCarousel.apply(this,arguments),$active.one("bsTransitionEnd",function(){var $tab;$tab=$element.find('li[aria-controls="'+$active.attr("id")+'"]'),$tab&&$tab.attr({"aria-selected":!1,tabIndex:"-1"}),$tab=$element.find('li[aria-controls="'+$next.attr("id")+'"]'),$tab&&$tab.attr({"aria-selected":!0,tabIndex:"0"})})};var $this;$.fn.carousel.Constructor.prototype.keydown=function(e){function selectTab(index){index>=$tabs.length||0>index||($carousel.carousel(index),setTimeout(function(){$tabs[index].focus()},150))}$this=$this||$(this),this instanceof Node&&($this=$(this));var index,$carousel=$(e.target).closest(".carousel"),$tabs=$carousel.find("[role=tab]"),k=e.which||e.keyCode;/(37|38|39|40)/.test(k)&&(index=$tabs.index($tabs.filter(".active")),(37==k||38==k)&&(index--,selectTab(index)),(39==k||40==k)&&(index++,selectTab(index)),e.preventDefault(),e.stopPropagation())},$(document).on("keydown.carousel.data-api","li[role=tab]",$.fn.carousel.Constructor.prototype.keydown)}(jQuery); \ No newline at end of file +!function ($) { + "use strict"; + console.log('en'); + var uniqueId = function (prefix) { + return (prefix || "ui-id") + "-" + Math.floor(1e3 * Math.random() + 1) + }, focusable = function (element, isTabIndexNotNaN) { + var map, mapName, img, nodeName = element.nodeName.toLowerCase(); + return "area" === nodeName ? (map = element.parentNode, mapName = map.name, element.href && mapName && "map" === map.nodeName.toLowerCase() ? (img = $("img[usemap='#" + mapName + "']")[0], !!img && visible(img)) : !1) : (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element) + }, visible = function (element) { + return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function () { + return "hidden" === $.css(this, "visibility") + }).length + }; + $.extend($.expr[":"], { + data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) { + return function (elem) { + return !!$.data(elem, dataName) + } + }) : function (elem, i, match) { + return !!$.data(elem, match[3]) + }, focusable: function (element) { + return focusable(element, !isNaN($.attr(element, "tabindex"))) + }, tabbable: function (element) { + var tabIndex = $.attr(element, "tabindex"), isTabIndexNaN = isNaN(tabIndex); + return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN) + } + }), $(".modal-dialog").attr({role: "document"}); + var modalhide = $.fn.modal.Constructor.prototype.hide; + $.fn.modal.Constructor.prototype.hide = function () { + modalhide.apply(this, arguments), $(document).off("keydown.bs.modal") + }; + var modalfocus = $.fn.modal.Constructor.prototype.enforceFocus; + $.fn.modal.Constructor.prototype.enforceFocus = function () { + var $content = this.$element.find(".modal-content"), focEls = $content.find(":tabbable"), + $lastEl = $(focEls[focEls.length - 1]), $firstEl = $(focEls[0]); + $lastEl.on("keydown.bs.modal", $.proxy(function (ev) { + 9 !== ev.keyCode || ev.shiftKey | ev.ctrlKey | ev.metaKey | ev.altKey || (ev.preventDefault(), $firstEl.focus()) + }, this)), $firstEl.on("keydown.bs.modal", $.proxy(function (ev) { + 9 === ev.keyCode && ev.shiftKey && (ev.preventDefault(), $lastEl.focus()) + }, this)), modalfocus.apply(this, arguments) + }; + var $par, firstItem, toggle = "[data-toggle=dropdown]", focusDelay = 200, + menus = $(toggle).parent().find("ul").attr("role", "menu"), lis = menus.find("li").attr("role", "presentation"); + lis.find("a").attr({role: "menuitem", tabIndex: "-1"}), $(toggle).attr({ + "aria-haspopup": "true", + "aria-expanded": "false" + }), $(toggle).parent().on("shown.bs.dropdown", function (e) { + $par = $(this); + var $toggle = $par.find(toggle); + $toggle.attr("aria-expanded", "true"), $toggle.on("keydown.bs.dropdown", $.proxy(function (ev) { + setTimeout(function () { + firstItem = $(".dropdown-menu [role=menuitem]:visible", $par)[0]; + try { + firstItem.focus() + } catch (ex) { + } + }, focusDelay) + }, this)) + }).on("hidden.bs.dropdown", function (e) { + $par = $(this); + var $toggle = $par.find(toggle); + $toggle.attr("aria-expanded", "false") + }), $(document).on("focusout.dropdown.data-api", ".dropdown-menu", function (e) { + var $this = $(this), that = this; + $this.parent().hasClass("open") && setTimeout(function () { + $.contains(that, document.activeElement) || $this.parent().find("[data-toggle=dropdown]").dropdown("toggle") + }, 150) + }).on("keydown.bs.dropdown.data-api", toggle + ", [role=menu]", $.fn.dropdown.Constructor.prototype.keydown); + var $tablist = $(".nav-tabs, .nav-pills"), $lis = $tablist.children("li"), + $tabs = $tablist.find('[data-toggle="tab"], [data-toggle="pill"]'); + $tabs && ($tablist.attr("role", "tablist"), $lis.attr("role", "presentation"), $tabs.attr("role", "tab")), $tabs.each(function (index) { + var tabpanel = $($(this).attr("href")), tab = $(this), tabid = tab.attr("id") || uniqueId("ui-tab"); + tab.attr("id", tabid), tab.parent().hasClass("active") ? (tab.attr({ + tabIndex: "0", + "aria-selected": "true", + "aria-controls": tab.attr("href").substr(1) + }), tabpanel.attr({ + role: "tabpanel", + tabIndex: "0", + "aria-hidden": "false", + "aria-labelledby": tabid + })) : (tab.attr({ + tabIndex: "-1", + "aria-selected": "false", + "aria-controls": tab.attr("href").substr(1) + }), tabpanel.attr({role: "tabpanel", tabIndex: "-1", "aria-hidden": "true", "aria-labelledby": tabid})) + }), $.fn.tab.Constructor.prototype.keydown = function (e) { + var $items, index, $this = $(this), $ul = $this.closest("ul[role=tablist] "), k = e.which || e.keyCode; + if ($this = $(this), /(37|38|39|40)/.test(k)) { + $items = $ul.find("[role=tab]:visible"), index = $items.index($items.filter(":focus")), (38 == k || 37 == k) && index--, (39 == k || 40 == k) && index++, 0 > index && (index = $items.length - 1), index == $items.length && (index = 0); + var nextTab = $items.eq(index); + "tab" === nextTab.attr("role") && nextTab.tab("show").focus(), e.preventDefault(), e.stopPropagation() + } + }, $(document).on("keydown.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', $.fn.tab.Constructor.prototype.keydown); + var tabactivate = $.fn.tab.Constructor.prototype.activate; + $.fn.tab.Constructor.prototype.activate = function (element, container, callback) { + var $active = container.find("> .active"); + $active.find("[data-toggle=tab], [data-toggle=pill]").attr({ + tabIndex: "-1", + "aria-selected": !1 + }), $active.filter(".tab-pane").attr({ + "aria-hidden": !0, + tabIndex: "-1" + }), tabactivate.apply(this, arguments), element.addClass("active"), element.find("[data-toggle=tab], [data-toggle=pill]").attr({ + tabIndex: "0", + "aria-selected": !0 + }), element.filter(".tab-pane").attr({"aria-hidden": !1, tabIndex: "0"}) + }; + var $colltabs = $('[data-toggle="collapse"]'); + $colltabs.each(function (index) { + var colltab = $(this), + collpanel = $(colltab.attr("data-target") ? colltab.attr("data-target") : colltab.attr("href")), + parent = colltab.attr("data-parent"), collparent = parent && $(parent), + collid = colltab.attr("id") || uniqueId("ui-collapse"), parentpanel = collpanel.parent(), + parentfirstchild = collparent ? collparent.find(".panel.panel-default:first-child") : null, + hasopenpanel = collparent ? collparent.find(".panel-collapse.in").length > 0 : !1; + colltab.attr("id", collid), collparent && (colltab.attr({ + "aria-controls": collpanel.attr("id"), + role: "tab", + "aria-selected": "false", + "aria-expanded": "false" + }), $(collparent).find("div:not(.collapse,.panel-body), h4").attr("role", "presentation"), collparent.attr({ + role: "tablist", + "aria-multiselectable": "true" + }), collpanel.attr({ + role: "tabpanel", + "aria-labelledby": collid + }), !hasopenpanel && parentpanel.is(parentfirstchild) ? (colltab.attr({tabindex: "0"}), collpanel.attr({tabindex: "-1"})) : collpanel.hasClass("in") ? (colltab.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabindex: "0" + }), collpanel.attr({ + tabindex: "0", + "aria-hidden": "false" + })) : (colltab.attr({tabindex: "-1"}), collpanel.attr({tabindex: "-1", "aria-hidden": "true"}))) + }); + var collToggle = $.fn.collapse.Constructor.prototype.toggle; + $.fn.collapse.Constructor.prototype.toggle = function () { + var href, prevTab = this.$parent && this.$parent.find('[aria-expanded="true"]'); + if (prevTab) { + var curTab, + prevPanel = prevTab.attr("data-target") || (href = prevTab.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, ""), + $prevPanel = $(prevPanel), $curPanel = this.$element; + this.$parent; + this.$parent && (curTab = this.$parent.find('[data-toggle=collapse][href="#' + this.$element.attr("id") + '"]')), collToggle.apply(this, arguments), $.support.transition && this.$element.one($.support.transition.end, function () { + prevTab.attr({ + "aria-selected": "false", + "aria-expanded": "false", + tabIndex: "-1" + }), $prevPanel.attr({"aria-hidden": "true", tabIndex: "-1"}), curTab.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: "0" + }), $curPanel.hasClass("in") ? $curPanel.attr({ + "aria-hidden": "false", + tabIndex: "0" + }) : (curTab.attr({ + "aria-selected": "false", + "aria-expanded": "false" + }), $curPanel.attr({"aria-hidden": "true", tabIndex: "-1"})) + }) + } else collToggle.apply(this, arguments) + }, $.fn.collapse.Constructor.prototype.keydown = function (e) { + var $items, index, $this = $(this), $tablist = $this.closest("div[role=tablist] "), k = e.which || e.keyCode; + $this = $(this), /(32|37|38|39|40)/.test(k) && (32 == k && $this.click(), $items = $tablist.find("[role=tab]"), index = $items.index($items.filter(":focus")), (38 == k || 37 == k) && index--, (39 == k || 40 == k) && index++, 0 > index && (index = $items.length - 1), index == $items.length && (index = 0), $items.eq(index).focus(), e.preventDefault(), e.stopPropagation()) + }, $(document).on("keydown.collapse.data-api", '[data-toggle="collapse"]', $.fn.collapse.Constructor.prototype.keydown), $(".carousel").each(function (index) { + function setTablistHighlightBox() { + var $tab, offset, height, width, highlightBox = {}; + highlightBox.top = 0, highlightBox.left = 32e3, highlightBox.height = 0, highlightBox.width = 0; + for (var i = 0; i < $tabs.length; i++) { + $tab = $tabs[i], offset = $($tab).offset(), height = $($tab).height(), width = $($tab).width(), highlightBox.top < offset.top && (highlightBox.top = Math.round(offset.top)), highlightBox.height < height && (highlightBox.height = Math.round(height)), highlightBox.left > offset.left && (highlightBox.left = Math.round(offset.left)); + var w = offset.left - highlightBox.left + Math.round(width); + highlightBox.width < w && (highlightBox.width = w) + } + $tablistHighlight.style.top = highlightBox.top - 2 + "px", $tablistHighlight.style.left = highlightBox.left - 2 + "px", $tablistHighlight.style.height = highlightBox.height + 7 + "px", $tablistHighlight.style.width = highlightBox.width + 8 + "px" + } + + var $tabpanel, $tablistHighlight, $pauseCarousel, $complementaryLandmark, $tab, i, $this = $(this), + $prev = $this.find('[data-slide="prev"]'), $next = $this.find('[data-slide="next"]'), + $tablist = $this.find(".carousel-indicators"), $tabs = $this.find(".carousel-indicators li"), + $tabpanels = $this.find(".item"), $is_paused = !1, id_title = "id_title", id_desc = "id_desc"; + for ($tablist.attr("role", "tablist"), $tabs.focus(function () { + $this.carousel("pause"), $is_paused = !0, $pauseCarousel.innerHTML = "Start Image Carousel", $(this).parent().addClass("active"), setTablistHighlightBox(), $($tablistHighlight).addClass("focus"), $(this).parents(".carousel").addClass("contrast") + }), $tabs.blur(function (event) { + $(this).parent().removeClass("active"), $($tablistHighlight).removeClass("focus"), $(this).parents(".carousel").removeClass("contrast") + }), i = 0; i < $tabpanels.length; i++) $tabpanel = $tabpanels[i], $tabpanel.setAttribute("role", "tabpanel"), $tabpanel.setAttribute("id", "tabpanel-" + index + "-" + i), $tabpanel.setAttribute("aria-labelledby", "tab-" + index + "-" + i); + for ("string" != typeof $this.attr("role") && ($this.attr("role", "complementary"), $this.attr("aria-labelledby", id_title), $this.attr("aria-describedby", id_desc), $this.prepend('<p id="' + id_desc + '" class="sr-only">You can control this image carousel using your keyboard or pointing device. Use the tabs or the previous and next buttons to change the image displayed.</p>'), $this.prepend('<h2 id="' + id_title + '" class="sr-only">Carousel with ' + $tabpanels.length + " images.</h2>")), i = 0; i < $tabs.length; i++) { + $tab = $tabs[i], $tab.setAttribute("role", "tab"), $tab.setAttribute("id", "tab-" + index + "-" + i), $tab.setAttribute("aria-controls", "tabpanel-" + index + "-" + i); + var tpId = "#tabpanel-" + index + "-" + i, caption = $this.find(tpId).find("h1").text(); + ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h3").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h4").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h5").text()), ("string" != typeof caption || 0 === caption.length) && (caption = $this.find(tpId).find("h6").text()), ("string" != typeof caption || 0 === caption.length) && (caption = "no title"); + var tabName = document.createElement("span"); + tabName.setAttribute("class", "sr-only"), tabName.innerHTML = "Slide " + (i + 1), caption && (tabName.innerHTML += ": " + caption), $tab.appendChild(tabName) + } + $tablistHighlight = document.createElement("div"), $tablistHighlight.className = "carousel-tablist-highlight", document.body.appendChild($tablistHighlight), $complementaryLandmark = document.createElement("aside"), $complementaryLandmark.setAttribute("class", "carousel-aside-pause"), $complementaryLandmark.setAttribute("aria-label", "Carousel pause/start control"), $this.prepend($complementaryLandmark), $pauseCarousel = document.createElement("button"), $pauseCarousel.className = "carousel-pause-button", $pauseCarousel.innerHTML = "Pause Carousel", $pauseCarousel.setAttribute("title", "Use the pause/start carousel button to stop/start carousel animations."), $($complementaryLandmark).append($pauseCarousel), $($pauseCarousel).click(function () { + $is_paused ? ($pauseCarousel.innerHTML = "Pause Carousel", $this.carousel("cycle"), $is_paused = !1) : ($pauseCarousel.innerHTML = "Start Carousel", $this.carousel("pause"), $is_paused = !0) + }), $($pauseCarousel).focus(function () { + $(this).addClass("focus") + }), $($pauseCarousel).blur(function () { + $(this).removeClass("focus") + }), setTablistHighlightBox(), $(window).resize(function () { + setTablistHighlightBox() + }), $prev.attr("aria-label", "Previous image"), $prev.keydown(function (e) { + var k = e.which || e.keyCode; + /(13|32)/.test(k) && (e.preventDefault(), e.stopPropagation(), $prev.trigger("click")) + }), $prev.focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $prev.blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $next.attr("aria-label", "Next Slide"), $next.keydown(function (e) { + var k = e.which || e.keyCode; + /(13|32)/.test(k) && (e.preventDefault(), e.stopPropagation(), $next.trigger("click")) + }), $next.focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $next.blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $(".carousel-inner a").focus(function () { + $(this).parents(".carousel").addClass("contrast") + }), $(".carousel-inner a").blur(function () { + $(this).parents(".carousel").removeClass("contrast") + }), $tabs.each(function () { + var item = $(this); + item.hasClass("active") ? item.attr({ + "aria-selected": "true", + tabindex: "0" + }) : item.attr({"aria-selected": "false", tabindex: "-1"}) + }) + }); + var slideCarousel = $.fn.carousel.Constructor.prototype.slide; + $.fn.carousel.Constructor.prototype.slide = function (type, next) { + var $id, $element = this.$element, $active = $element.find("[role=tabpanel].active"), + $next = next || $active[type](), $tab_count = $element.find("[role=tabpanel]").length, + $prev_side = $element.find('[data-slide="prev"]'), $next_side = $element.find('[data-slide="next"]'), + $index = 0, $prev_index = $tab_count - 1, $next_index = 1; + $next && $next.attr("id") && ($id = $next.attr("id"), $index = $id.lastIndexOf("-"), $index >= 0 && ($index = parseInt($id.substring($index + 1), 10)), $prev_index = $index - 1, 1 > $prev_index && ($prev_index = $tab_count - 1), $next_index = $index + 1, $next_index >= $tab_count && ($next_index = 0)), $prev_side.attr("aria-label", "Show image " + ($prev_index + 1) + " of " + $tab_count), $next_side.attr("aria-label", "Show image " + ($next_index + 1) + " of " + $tab_count), slideCarousel.apply(this, arguments), $active.one("bsTransitionEnd", function () { + var $tab; + $tab = $element.find('li[aria-controls="' + $active.attr("id") + '"]'), $tab && $tab.attr({ + "aria-selected": !1, + tabIndex: "-1" + }), $tab = $element.find('li[aria-controls="' + $next.attr("id") + '"]'), $tab && $tab.attr({ + "aria-selected": !0, + tabIndex: "0" + }) + }) + }; + $.fn.collapse.Constructor.prototype.show = function () { + if (!this.transitioning && !this.$element.hasClass("in")) { + var t, e = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); + if (!(e && e.length && (t = e.data("bs.collapse")) && t.transitioning)) { + var i = $.Event("show.bs.collapse"); + if (this.$element.trigger(i), !i.isDefaultPrevented()) { + e && e.length && (l.call(e, "hide"), t || e.data("bs.collapse", null)); + var o = this.dimension(); + this.$element.removeClass("collapse").addClass("collapsing")[o](0); + // don't add aria-expanded to collapsing element in side facets + if (this.$element.attr('id') === undefined || !this.$element.attr('id').startsWith("side-collapse")) { + this.$element.attr("aria-expanded", !0) + } + this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; + var n = function () { + this.$element.removeClass("collapsing").addClass("collapse in")[o](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") + }; + if (!$.support.transition) return n.call(this); + var s = $.camelCase(["scroll", o].join("-")); + this.$element.one("bsTransitionEnd", $.proxy(n, this)).emulateTransitionEnd(350)[o](this.$element[0][s]) + } + } + } + }; + $.fn.collapse.Constructor.prototype.hide = function () { + if (!this.transitioning && this.$element.hasClass("in")) { + var t = $.Event("hide.bs.collapse"); + if (this.$element.trigger(t), !t.isDefaultPrevented()) { + var e = this.dimension(); + this.$element[e](this.$element[e]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in"); + + // don't add aria-expanded to collapsing element in side facets + if (this.$element.attr('id') === undefined || !this.$element.attr('id').startsWith("side-collapse")) { + this.$element.attr("aria-expanded", !1) + } + + this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; + var i = function () { + this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") + }; + if (!$.support.transition) return i.call(this); + this.$element[e](0).one("bsTransitionEnd", $.proxy(i, this)).emulateTransitionEnd(350) + } + } + }; + $.fn.collapse.Constructor.prototype.addAriaAndCollapsedClass = function (t, e) { + // don't add aria-expanded to collapsing element in side facets + if (t.attr('id') === undefined || !t.attr('id').startsWith("side-collapse")) { + var i = t.hasClass("in"); + t.attr("aria-expanded", i); + } + e.toggleClass("collapsed", !i).attr("aria-expanded", i); + }; + var $this; + $.fn.carousel.Constructor.prototype.keydown = function (e) { + function selectTab(index) { + index >= $tabs.length || 0 > index || ($carousel.carousel(index), setTimeout(function () { + $tabs[index].focus() + }, 150)) + } + + $this = $this || $(this), this instanceof Node && ($this = $(this)); + var index, $carousel = $(e.target).closest(".carousel"), $tabs = $carousel.find("[role=tab]"), + k = e.which || e.keyCode; + /(37|38|39|40)/.test(k) && (index = $tabs.index($tabs.filter(".active")), (37 == k || 38 == k) && (index--, selectTab(index)), (39 == k || 40 == k) && (index++, selectTab(index)), e.preventDefault(), e.stopPropagation()) + }, $(document).on("keydown.carousel.data-api", "li[role=tab]", $.fn.carousel.Constructor.prototype.keydown) +}(jQuery); \ No newline at end of file diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml index 2abcc73899ebf11bd294537db651a089cf64b21d..3957f6ba12e6ac722e65ea77266a15df592e7e73 100644 --- a/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml @@ -1,7 +1,7 @@ <!-- finc-accessibility - Recommend - SideFacets - filter-list.phtml --> <?php /* #18509 copied from bootstrap for adding language tags to displayText */ ?> <div class="facet-group active-filters"> - <div class="title"><?=$this->transEsc('Remove Filters')?></div> + <div class="title"><?=$this->transEsc('Remove Filters')?> <span class="sr-only"><?=$this->transEsc('facet_deselect_hint') ?></div> <ul> <?php foreach ($filterList as $field => $filters): ?> <?php foreach ($filters as $i => $filter): ?> diff --git a/themes/finc-accessibility/templates/RecordTab/toc.phtml b/themes/finc-accessibility/templates/RecordTab/toc.phtml deleted file mode 100644 index 6e71822f85068fe2a473bbc3071afd496220f6f5..0000000000000000000000000000000000000000 --- a/themes/finc-accessibility/templates/RecordTab/toc.phtml +++ /dev/null @@ -1,35 +0,0 @@ -<!-- finc-accessibility: RecordTab - toc --> -<?php /** - * copy of VuFind-version, adds empty lang-attribute to <li>s - */ -?> -?> -<?php - // Set page title. - $this->headTitle($this->translate('Table of Contents') . ': ' . $this->driver->getBreadcrumb()); - - $toc = $this->tab->getContent(); - if (empty($toc)) { - $driverToc = $this->driver->getTOC(); - if (!empty($driverToc)) { - $toc['RecordDriver'] = $driverToc; - } - } -?> -<?php if (!empty($toc)): ?> - <strong><?=$this->transEsc('Table of Contents')?>: </strong> - <?php foreach ($toc as $provider => $content): ?> - <?php if (!is_array($content)): // treat non-array content as raw HTML ?> - <?=$content?> - <?php else: ?> - <ul class="toc"> - <?php foreach ($content as $line): ?> - <li lang=""><?=$this->escapeHtml($line)?></li> - <?php endforeach; ?> - </ul> - <?php endif; ?> - <?php endforeach; ?> -<?php else: ?> - <?=$this->transEsc('Table of Contents unavailable')?>. -<?php endif; ?> -<!-- finc-accessibility: RecordTab - toc - END --> \ No newline at end of file diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index a7fbd375f82075f348503611d72770e940b5b340..7b324eb9c6768c30ea9fc2a22f7d654a92f50f31 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -3305,3 +3305,14 @@ input { } } // CHANNELS - END + +// ZEND-FORMS + +#dds-form { + + label[data-required="true"][for]::after { + content: ' *'; + } +} + +// ZEND-FORMS - END diff --git a/themes/finc/templates/Recommend/SideFacets.phtml b/themes/finc/templates/Recommend/SideFacets.phtml index 361ead35a1593f0ee60b1fa94c71b399d30b988a..8c7fff5acfa902339f2eaf28c3f5376178d00a96 100644 --- a/themes/finc/templates/Recommend/SideFacets.phtml +++ b/themes/finc/templates/Recommend/SideFacets.phtml @@ -55,8 +55,8 @@ if ($hierarchicalFacets) { <?php if (!empty($sideFacetSet) && $results->getResultTotal() > 0): ?> <?php foreach ($sideFacetSet as $title => $cluster): ?> <div class="facet-group" id="side-panel-<?=$this->escapeHtmlAttr($title)?>"> - <button class="title<?php if(in_array($title, $collapsedFacets)): ?> collapsed<?php endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($title) ?>" > - <?=$this->transEsc($cluster['label'])?> + <button <?php if(in_array($title, $collapsedFacets)): ?>class="title collapsed" aria-expanded="false"<?php else: ?>class="title" aria-expanded="true"<?php endif ?> data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($title) ?>" > + <?=$this->transEsc($cluster['label'])?> <span class="sr-only"><?=$this->transEsc('facet_select_hint') ?></span> </button> <ul id="side-collapse-<?=$this->escapeHtmlAttr($title)?>" class="collapse<?php if (!in_array($title, $collapsedFacets)): ?> in<?php endif ?>"> <?=$this->context($this)->renderInContext( diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml index d82632dc70a58abc9da86952b4c25f8a07029149..9f0ebf61886dbd8d670abb9459721b0277080a53 100644 --- a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -52,10 +52,13 @@ data-count="<?=$this->facet['count'] ?>" title="<?php if($this->facet['isApplied']): ?><?=$this->transEsc('applied_filter')?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $this->facet['displayText']])?> <?=$this->escapeHtmlAttr($this->facet['displayText']) ?><?php else: ?><?=$this->transEsc('page_reload_on_select_hint', ['%%filter_name%%' => $this->facet['displayText']])?><?php endif;?>"> <?=$displayText ?> + <span class="sr-only"> + <?php if($this->facet['isApplied']): ?>(<?=$this->transEsc('applied_filter')?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $this->facet['displayText']])?> <?=$this->escapeHtmlAttr($this->facet['displayText']) ?>)<?php else: ?>(<?=$this->transEsc('page_reload_on_select_hint', ['%%filter_name%%' => $this->facet['displayText']])?>)<?php endif;?> + </span> </a> <?php else: ?> <span class="text"> - <?=$displayText ?> + <?=$displayText ?><span class="sr-only"><?php if($this->facet['isApplied']): ?>(<?=$this->transEsc('applied_filter')?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $this->facet['displayText']])?>)<?php else: ?>(<?=$this->transEsc('page_reload_on_select_hint', ['%%filter_name%%' => $this->facet['displayText']])?>)<?php endif;?></span> </span> <?php endif; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-toc.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-toc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e2c53a3d900f0d10a657f91ebf98844d159259af --- /dev/null +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-toc.phtml @@ -0,0 +1,7 @@ +<!-- finc: RecordDriver - DefaultRecord - data-toc --> +<ul class="toc"> +<?php foreach ($data as $item): ?> + <li lang=""><?=$this->escapeHtml($item)?></li> +<?php endforeach; ?> +</ul> +<!-- finc: RecordDriver - DefaultRecord - data-toc - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordTab/toc.phtml b/themes/finc/templates/RecordTab/toc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..eb89dc704ee6e9e182599bac1de1076753b76bf9 --- /dev/null +++ b/themes/finc/templates/RecordTab/toc.phtml @@ -0,0 +1,16 @@ +<!-- finc: RecordTab - toc --> +<?php + // Set page title. + $this->headTitle($this->translate('Table of Contents') . ': ' . $this->driver->getBreadcrumb()); + $formatter = $this->recordDataFormatter(); + $mainFields = $formatter->getData($this->driver, $formatter->getDefaults('toc')); +?> +<?php if (!empty($mainFields)): ?> + <?php foreach ($mainFields as $current): ?> + <strong><?=$this->transEsc($current['label'])?>: </strong> + <?=$current['value']?> + <?php endforeach; ?> +<?php else: ?> + <?=$this->transEsc('Table of Contents unavailable')?>. +<?php endif; ?> +<!-- finc: RecordTab - toc - END --> \ No newline at end of file diff --git a/themes/finc/templates/documentdeliveryservice/form.phtml b/themes/finc/templates/documentdeliveryservice/form.phtml deleted file mode 100644 index c724f5e2ef1f34f051d9680157cf0242cedf9759..0000000000000000000000000000000000000000 --- a/themes/finc/templates/documentdeliveryservice/form.phtml +++ /dev/null @@ -1,302 +0,0 @@ -<!-- finc - documentdeliveryservice - form --> -<div class="<?=$this->layoutClass('mainbody')?>"> - <h1><?=$this->transEsc('DDS::dds_form_headline')?></h1> - <?=$this->flashmessages()?> - <form method="post" action="<?=$this->url('dds-email')?>" name="docdelisForm"> - <?php if ($this->department): ?> - <input type="hidden" name="subito[hdepartment]" value="<?=$this->department?>"/> - <?php endif; ?> - <legend><?=$this->transEsc("DDS::dds_form_delivery_data")?>:</legend> - <!-- name --> - <div class="form-group"> - <label for="sname" class="control-label"><?=$this->transEsc("Name")?>:*</label> - <?php if (isset($this->error->username)): ?> - <div class="error-field"> - <?=$this->error->username;?> - </div> - <?php endif; ?> - - <input type="text" id="sname" name="subito[username]" class="form-control" <?=(!empty($this->username) ? 'value="' . $this->username . '"' : '')?>/> - - </div> - <!-- phone --> - <div class="form-group"> - <label class="inline control-label" for="sphone"><?=$this->transEsc("DDS::form_field_phone")?>:</label> - <?php if (isset($this->error->phone)): ?> - <div class="error-field"> - <?=$this->error->phone;?> - </div> - <?php endif; ?> - <input type="text" id="sphone" name="subito[phone]" class="form-control" <?=(!empty($this->phone) ? 'value="' . $this->phone . '"' : '')?>/> - </div> - <!-- email --> - <div class="form-group"> - <label class="inline control-label" for="semail"><?=$this->transEsc("DDS::form_field_email")?>:*</label> - <?php if (isset($this->error->email)): ?> - <div class="error-field"> - <?=$this->error->email;?> - </div> - <?php endif; ?> - <input type="text" id="semail" name="subito[email]" class="form-control" <?=(!empty($this->email) ? 'value="' . $this->email . '"' : '')?>/> - </div> - <!-- user id --> - <div class="form-group"> - <label class="inline control-label" for="suserid"><?=$this->transEsc("DDS::form_field_library_id")?>:*</label> - <?php if (isset($this->error->userid)): ?> - <div class="error-field"> - <?=$this->error->userid;?> - </div> - <?php endif; ?> - <input type="text" id="suserid" name="subito[userid]" class="form-control" <?=(!empty($this->userid) ? 'value="' . $this->userid . '"' : '')?>/> - </div> - <!-- division --> - <div class="form-group"> - <label class="inline control-label" for="sdivision"><?=$this->transEsc("DDS::form_field_division")?>:*</label> - <?php if (isset($this->error->division)): ?> - <div class="error-field"> - <?=$this->error->division;?> - </div> - <?php endif; ?> - <select id="sdivision" name="subito[division]" size="1" class="form-control"/> - <option value=""></option> - <?php foreach ($this->divisions as $cat => $division): ?> - <option value="<?=$cat?>" <?=($this->division == $cat) ? 'selected="selected"' : ''?>><?=$division?></option> - <?php endforeach; ?> - </select> - </div> - <!-- department --> - <div class="form-group input-sdepartment"> - <label class="inline control-label" for="sdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> - <?php if (isset($this->error->department)): ?> - <div class="error-field"> - <?=$this->error->department;?> - </div> - <?php endif; ?> - <select id="sdepartment" name="subito[department]" size="1" class="form-control"/> - <option value=""></option> - </select> - </div> - <!-- department medicine --> - <div class="form-group input-department"> - <label class="inline control-label" for="smdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> - <input type="text" id="smdepartment" name="subito[inputdepartment]" class="form-control" <?=(!empty($this->inputdepartment) ? 'value="' . $this->inputdepartment . '"' : '')?>/> - </div> - - <legend><?=$this->transEsc("DDS::dds_form_details_ordered_title")?>:</legend> - <!-- author --> - <div class="form-group"> - <label class="inline control-label" for="sauthor"><?=$this->transEsc("DDS::form_field_author")?>:*</label> - <?php if (isset($this->error->author)): ?> - <div class="error-field"> - <?=$this->error->author;?> - </div> - <?php endif; ?> - <input type="text" id="sauthor" name="subito[author]" class="form-control" <?=(!empty($this->author) ? 'value="' . $this->author . '"' : '')?>/> - </div> - <!-- title of issue --> - <div class="form-group"> - <label class="inline control-label" for="sarticle"><?=$this->transEsc("DDS::form_field_title")?>:</label> - <?php if (isset($this->error->article)): ?> - <div class="error-field"> - <?=$this->error->article;?> - </div> - <?php endif; ?> - <input type="text" id="sarticle" name="subito[article]" class="form-control" <?=(!empty($this->article) ? 'value="' . $this->article . '"' : '')?>/> - </div> - <!-- title of journal --> - <div class="form-group"> - <label class="inline control-label" for="sjournal"><?=$this->transEsc("DDS::form_field_journal")?>:*</label> - <?php if (isset($this->error->journal)): ?> - <div class="error-field"> - <?=$this->error->journal;?> - </div> - <?php endif; ?> - <input type="text" id="sjournal" name="subito[journal]" class="form-control" <?=(!empty($this->journal) ? 'value="' . $this->journal . '"' : '')?>/> - </div> - <!-- issn --> - <div class="form-group"> - <label class="inline control-label" for="sjournal"><?=$this->transEsc("ISSN")?>:</label> - <?php if (isset($this->error->issn)): ?> - <div class="error-field"> - <?=$this->error->issn;?> - </div> - <?php endif; ?> - <input type="text" id="sissn" name="subito[issn]" class="form-control" <?=(!empty($this->issn) ? 'value="' . $this->issn . '"' : '')?>/> - </div> - <!-- publish date --> - <div class="form-group"> - <label class="inline control-label" for="spublishdate"><?=$this->transEsc("DDS::form_field_publishing_date")?>:*</label> - <?php if (isset($this->error->publishdate)): ?> - <div class="error-field"> - <?=$this->error->publishdate;?> - </div> - <?php endif; ?> - <input type="text" id="spublishdate" name="subito[publishdate]" class="form-control" <?=(!empty($this->publishdate) ? 'value="' . $this->publishdate . '"' : '')?>/> - </div> - <!-- journal number --> - <div class="form-group"> - <label class="inline control-label" for="snumber"><?=$this->transEsc("DDS::form_field_volume")?>:*</label> - <?php if (isset($this->error->number)): ?> - <div class="error-field"> - <?=$this->error->number;?> - </div> - <?php endif; ?> - <input type="text" id="snumber" name="subito[number]" class="form-control" <?=(!empty($this->number) ? 'value="' . $this->number . '"' : '')?>/> - </div> - <!-- pages --> - <div class="form-group"> - <label class="inline control-label" for="spages"><?=$this->transEsc("DDS::form_field_pages")?>:*</label> - <?php if (isset($this->error->pages)): ?> - <div class="error-field"> - <?=$this->error->pages;?> - </div> - <?php endif; ?> - <input type="text" id="spages" name="subito[pages]" class="form-control" <?=(!empty($this->pages) ? 'value="' . $this->pages . '"' : '')?>/> - </div> - <!-- remarks --> - <div class="form-group"> - <label class="inline control-label" for="sremarks"><?=$this->transEsc("DDS::form_fields_remarks")?>:</label> - <?php if (isset($this->error->remarks)): ?> - <div class="error-field"> - <?=$this->error->remarks;?> - </div> - <?php endif; ?> - <textarea id="sremarks" name="subito[remarks]" class="form-control"><?=(!empty($this->remarks) ? $this->remarks : '')?></textarea> - </div> - <input role="button" type="submit" class="btn btn-primary" value="<?=$this->transEsc("DDS::form_button_submit")?>"/> - - </form> - <div class="subito-pg margin-t"> - <?=$this->transEsc("DDS::dds_text_questions")?> - <a href="mailto:info@ub.uni-leipzig.de?subject=<?=$this->transEsc("Dokumentenlieferdienst")?>">info@ub.uni-leipzig.de</a> - </div> - - <div class="input-department subito-pg"> - <div><?=$this->transEsc("Bei eventuellen Rückfragen wenden Sie sich bitte an die Abteilung Fernleihe der Medizin")?>:</div> - <div><?=$this->transEsc("Phone")?>: +49 (0)341 - 97 14014</div> - <div><?=$this->transEsc("Email")?>: <a href="mailto:zbmed.fernleihe@medizin.uni-leipzig.de?subject=<?=$this->transEsc("Dokumentenlieferdienst")?>">zbmed.fernleihe@medizin.uni-leipzig.de</a> - </div> - </div> - <div class="subito-pg"> - <p class="required"> - * <?=$this->transEsc("DDS::dds_text_mandatory_fields")?></p> - </div> -</div> - -<?php -$this->inlineScript()->captureStart(); -echo <<<JS - $(document).ready(function(){ - // if department already selected and post request failed then - // rebuild select menu - if ( $('input:hidden[name="subito\\[hdepartment\\]"]').val() != 'undefined') { - department.addDepartmentSelect( - $('input[name="subito\\[hdepartment\\]"]').val(), - $('select[name="subito\\[division\\]"]').val() - ); - } - $('select[name="subito\\[division\\]"]').change(function() { - department.init($(this).val()); - }); - $('.form-group input').focus(function() { - $(this).parent().prev('.error-field').hide(200); - }); - $('.form-group select').focus(function() { - $(this).parent().prev('.error-field').hide(200); - }); - /*if ( $('#loginOptions a.login').length ) { - var loginUrl = { - followup: true, - followupModule: 'Subito', - followupAction: 'Subito' - }; - $('#loginOptions a.login').attr('href', function ( index, value ) { - return value + '?' + $.param( loginUrl ); - }); - // console.log($('#loginOptions a.login').attr('href')); - }*/ - }); -/** -* Show & hide of subito form elements regarding select menu status. -* Add options for department select menu -* -* @author Frank Morgner<morgnerf@ub.uni-leipzig.de> -* @see https://katalog.ub.uni-leipzig.de/Subito/Subito -**/ - -var department = { - init: function ( divisionid ) { - addOptions = false; - var elements = []; - if ( divisionid == '15') { - elements = { - "department":"show", - "costcentre":"show", - "sdepartment":"hide" - } - } else if (divisionid == '') { - elements = { - "department":"hide", - "costcentre":"hide", - "sdepartment":"hide" - } - } else { - elements = { - "department":"hide", - "costcentre":"hide", - "sdepartment":"show" - } - var addOptions = true; - } - department.showHideElements(elements); - if (addOptions == true) { - department.addDepartmentOptions( divisionid ); - } - }, - addDepartmentOptions: function ( divisionid ) { - $('select[name="subito\\[department\\]"]').empty(); - var departments = $this->departments; - department.addOptionElement('',''); - $.each(departments[divisionid], function (index, value) { - department.addOptionElement(value,index); - }); - }, - addDepartmentSelect: function (departmentid, divisionid) { - department.init ( divisionid ); - department.addSelectElement ( departmentid ); - }, - addOptionElement: function ( text, value ) { - jQuery('<option/>', { - text: department.htmlEntitiesDecode(text), - value: value - }).appendTo('select[name="subito\\[department\\]"]'); - }, - addSelectElement: function ( departmentid ) { - $('select[name="subito\\[department\\]"] option').filter(function () { - //console.log($(this).val() + ' == ' + departmentid); - return $(this).val() == departmentid; - }).prop('selected', true); - }, - htmlEntitiesDecode: function ( value ) { - if (value) { - return jQuery('<div/>').html(value).text(); - } - return value; - }, - showHideElements: function ( elements ) { - $.each(elements, function (index, value) { - if (value == 'show') { - $('.input-' + index).show(200); - } - if (value == 'hide') { - $('.input-' + index).hide(200); - } - }); - } -} -JS; -$this->inlineScript()->captureEnd(); - -echo $this->inlineScript(); -?> -<!-- finc - documentdeliveryservice - form - END --> diff --git a/themes/finc/templates/documentdeliveryservice/home.phtml b/themes/finc/templates/documentdeliveryservice/home.phtml index 7b19271a9f9f214eeaeef98e26773e261fb945ed..d92c526dd57cddd74c48d8f4bb696bbdbf4b6f47 100644 --- a/themes/finc/templates/documentdeliveryservice/home.phtml +++ b/themes/finc/templates/documentdeliveryservice/home.phtml @@ -3,4 +3,4 @@ $this->headTitle($this->translate('Delivery service for documents') . ' | ' . $this->translate("LibraryName")); ?> -<?=($this->loadForm ? $this->render('documentdeliveryservice/form.phtml') : $this->flashmessages());?> \ No newline at end of file +<?=($this->loadForm ? $this->render('documentdeliveryservice/zform.phtml') : $this->flashmessages());?> \ No newline at end of file diff --git a/themes/finc/templates/documentdeliveryservice/zform.phtml b/themes/finc/templates/documentdeliveryservice/zform.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4f9481ef1576f6cae903b6ae234e8eecb731d49a --- /dev/null +++ b/themes/finc/templates/documentdeliveryservice/zform.phtml @@ -0,0 +1,390 @@ +<!-- finc - documentdeliveryservice - form --> +<?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 Gregor Gawol <gawol@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Element\Submit; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSelect; +use Zend\Form\View\Helper\FormSubmit; + +/** @var Form $form */ +/** @var FormLabel $formLabel */ +/** @var FormSelect $formSelect */ +/** @var FormSubmit $formSubmit */ +/** @var FormElementErrors $formElementErrors */ +$form = $this->form; +$formLabel = $this->formLabel(); +$formSelect = $this->formSelect(); +$formSubmit = $this->formSubmit(); +$formElementErrors = $this->formElementErrors(); +$formLabel->setTranslatorTextDomain('DDS'); +$formSelect->setTranslatorTextDomain('DDS'); +$formSubmit->setTranslatorTextDomain('DDS'); +$formElementErrors->setTranslatorTextDomain('DDS'); +?> +<div class="<?=$this->layoutClass('mainbody')?>"> + <h1><?=$this->transEsc('DDS::dds_form_headline')?></h1> + <?=$this->flashmessages()?> + <?=$this->form()->openTag($form)?> + <?php if ($this->department): ?> + <input type="hidden" name="subito[hdepartment]" value="<?=$this->department?>"/> + <?php endif; ?> + <? /* name */ ?> + <?php + /** @var Element\Text $elemName */ + $elemName = $form->get('username'); + $elemName->setLabelAttributes(['class' => 'control-label']); + $elemName->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemName)?> + <?=$this->formElement($elemName)?> + <?=$this->formElementErrors($elemName)?> + </div> + + <? /* phone */ ?> + <?php + /** @var Element\Text $elemPhone */ + $elemPhone = $form->get('phone'); + $elemPhone->setLabelAttributes(['class' => 'control-label']); + $elemPhone->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemPhone)?> + <?=$this->formElement($elemPhone)?> + </div> + + <? /* email */ ?> + <?php + /** @var Element\Email $elemEmail */ + $elemEmail = $form->get('email'); + $elemEmail->setLabelAttributes(['class' => 'control-label']); + $elemEmail->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemEmail)?> + <?=$this->formElement($elemEmail)?> + <?=$this->formElementErrors($elemEmail)?> + </div> + + <? /* userid */ ?> + <?php + /** @var Element\Text $elemUserid */ + $elemUserid = $form->get('userid'); + $elemUserid->setLabelAttributes(['class' => 'control-label']); + $elemUserid->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemUserid)?> + <?=$this->formElement($elemUserid)?> + <?=$this->formElementErrors($elemUserid)?> + </div> + + <? /* division */ ?> + <?php + /** @var Element\Select $elemDivision */ + $elemDivision = $form->get('division'); + $elemDivision->setLabelAttributes(['class' => 'inline control-label']); + $elemDivision->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemDivision)?> + <?=$this->formSelect($elemDivision)?> + <?=$this->formElementErrors($elemDivision)?> + </div> + + <? /* department */ ?> + <?php + /** @var Element\Select $elemDepartment */ + $elemDepartment = $form->get('department'); + $elemDepartment->setLabelAttributes(['class' => 'inline control-label']); + $elemDepartment->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group input-sdepartment"> + <?=$this->formLabel($elemDepartment)?> + <?=$this->formSelect($elemDepartment)?> + <?=$this->formElementErrors($elemDepartment)?> + </div> + + <? /* department medicine */ ?> + <?php + /** @var Element\Text $elemMdepartment */ + $elemMdepartment = $form->get('inputdepartment'); + $elemMdepartment->setLabelAttributes(['class' => 'control-label']); + $elemMdepartment->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group input-department"> + <?=$this->formLabel($elemMdepartment)?> + <?=$this->formElement($elemMdepartment)?> + <?=$this->formElementErrors($elemMdepartment)?> + </div> + + <? /* author */ ?> + <?php + /** @var Element\Text $elemAuthor */ + $elemAuthor = $form->get('author'); + $elemAuthor->setLabelAttributes(['class' => 'control-label']); + $elemAuthor->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemAuthor)?> + <?=$this->formElement($elemAuthor)?> + <?=$this->formElementErrors($elemAuthor)?> + </div> + + <? /* title of issue */ ?> + <?php + /** @var Element\Text $elemArticle */ + $elemArticle = $form->get('article'); + $elemArticle->setLabelAttributes(['class' => 'control-label']); + $elemArticle->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemArticle)?> + <?=$this->formElement($elemArticle)?> + <?=$this->formElementErrors($elemArticle)?> + </div> + + <? /* title of journal */ ?> + <?php + /** @var Element\Text $elemJournal */ + $elemJournal = $form->get('journal'); + $elemJournal->setLabelAttributes(['class' => 'control-label']); + $elemJournal->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemJournal)?> + <?=$this->formElement($elemJournal)?> + <?=$this->formElementErrors($elemJournal)?> + </div> + + <? /* issn */ ?> + <?php + /** @var Element\Text $elemIssn */ + $elemIssn = $form->get('issn'); + $elemIssn->setLabelAttributes(['class' => 'control-label']); + $elemIssn->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemIssn)?> + <?=$this->formElement($elemIssn)?> + <?=$this->formElementErrors($elemIssn)?> + </div> + + <? /* publish date */ ?> + <?php + /** @var Element\Text $elemPublishdate */ + $elemPublishdate = $form->get('publishdate'); + $elemPublishdate->setLabelAttributes(['class' => 'control-label']); + $elemPublishdate->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemPublishdate)?> + <?=$this->formElement($elemPublishdate)?> + <?=$this->formElementErrors($elemPublishdate)?> + </div> + + <? /* journal number */ ?> + <?php + /** @var Element\Text $elemNumber */ + $elemNumber = $form->get('number'); + $elemNumber->setLabelAttributes(['class' => 'control-label']); + $elemNumber->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemNumber)?> + <?=$this->formElement($elemNumber)?> + <?=$this->formElementErrors($elemNumber)?> + </div> + + <? /* pages */ ?> + <?php + /** @var Element\Text $elemPages */ + $elemPages = $form->get('pages'); + $elemPages->setLabelAttributes(['class' => 'control-label']); + $elemPages->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemPages)?> + <?=$this->formElement($elemPages)?> + <?=$this->formElementErrors($elemPages)?> + </div> + + <? /* remarks */ ?> + <?php + /** @var Element\Textarea $elemRemarks */ + $elemRemarks = $form->get('remarks'); + $elemRemarks->setLabelAttributes(['class' => 'control-label']); + $elemRemarks->setAttributes(['class' => 'form-control']); + ?> + <div class="form-group"> + <?=$this->formLabel($elemRemarks)?> + <?=$this->formElement($elemRemarks)?> + <?=$this->formElementErrors($elemRemarks)?> + </div> + + <? /* submit button */ ?> + <?php + /** @var Submit $elemSubmit */ + $elemSubmit = $form->get('submit'); + $elemSubmit->setAttributes(['class' => 'btn btn-primary']); + ?> + + <div class="form-group"><?= $this->formSubmit($elemSubmit) ?></div> + <?= $this->form()->closeTag($form)?> + + <div class="subito-pg margin-t"> + <?=$this->transEsc("DDS::dds_text_questions")?> + <a href="mailto:info@ub.uni-leipzig.de?subject=<?=$this->transEsc("Dokumentenlieferdienst")?>">info@ub.uni-leipzig.de</a> + </div> + + <div class="input-department subito-pg"> + <div><?=$this->transEsc("Bei eventuellen Rückfragen wenden Sie sich bitte an die Abteilung Fernleihe der Medizin")?>:</div> + <div><?=$this->transEsc("Phone")?>: +49 (0)341 - 97 14014</div> + <div><?=$this->transEsc("Email")?>: <a href="mailto:zbmed.fernleihe@medizin.uni-leipzig.de?subject=<?=$this->transEsc("Dokumentenlieferdienst")?>">zbmed.fernleihe@medizin.uni-leipzig.de</a> + </div> + </div> + <div class="subito-pg"> + <p class="required"> + * <?=$this->transEsc("DDS::dds_text_mandatory_fields")?></p> + </div> +</div> + +<?php +$this->inlineScript()->captureStart(); +echo <<<JS + $(document).ready(function(){ + // if department already selected and post request failed then + // rebuild select menu + if ( $('input:hidden[name="department"]').val() != 'undefined') { + department.addDepartmentSelect( + $('input[name="department"]').val(), + $('select[name="division"]').val() + ); + } + $('select[name="division"]').change(function() { + department.init($(this).val()); + }); + // $('.form-group input').focus(function() { + // $(this).parent().prev('.error-field').hide(200); + // }); + // $('.form-group select').focus(function() { + // $(this).parent().prev('.error-field').hide(200); + // }); + /*if ( $('#loginOptions a.login').length ) { + var loginUrl = { + followup: true, + followupModule: 'Subito', + followupAction: 'Subito' + }; + $('#loginOptions a.login').attr('href', function ( index, value ) { + return value + '?' + $.param( loginUrl ); + }); + // console.log($('#loginOptions a.login').attr('href')); + }*/ + }); +/** +* Show & hide of subito form elements regarding select menu status. +* Add options for department select menu +* +* @author Frank Morgner<morgnerf@ub.uni-leipzig.de> +* @see https://katalog.ub.uni-leipzig.de/Subito/Subito +**/ + +var department = { + init: function ( divisionid ) { + addOptions = false; + var elements = []; + if ( divisionid == '15') { + elements = { + "department":"show", + "costcentre":"show", + "sdepartment":"hide" + } + } else if (divisionid == '') { + elements = { + "department":"hide", + "costcentre":"hide", + "sdepartment":"hide" + } + } else { + elements = { + "department":"hide", + "costcentre":"hide", + "sdepartment":"show" + } + var addOptions = true; + } + department.showHideElements(elements); + if (addOptions == true) { + department.addDepartmentOptions( divisionid ); + } + }, + addDepartmentOptions: function ( divisionid ) { + $('select[name="department"]').empty(); + var departments = $this->departments; + department.addOptionElement('',''); + $.each(departments[divisionid], function (index, value) { + department.addOptionElement(value,index); + }); + }, + addDepartmentSelect: function (departmentid, divisionid) { + department.init ( divisionid ); + department.addSelectElement ( departmentid ); + }, + addOptionElement: function ( text, value ) { + jQuery('<option/>', { + text: department.htmlEntitiesDecode(text), + value: value + }).appendTo('select[name="department"]'); + }, + addSelectElement: function ( departmentid ) { + $('select[name="department"] option').filter(function () { + //console.log($(this).val() + ' == ' + departmentid); + return $(this).val() == departmentid; + }).prop('selected', true); + }, + htmlEntitiesDecode: function ( value ) { + if (value) { + return jQuery('<div/>').html(value).text(); + } + return value; + }, + showHideElements: function ( elements ) { + $.each(elements, function (index, value) { + if (value == 'show') { + $('.input-' + index).show(200); + } + if (value == 'hide') { + $('.input-' + index).hide(200); + } + }); + } +} +JS; +$this->inlineScript()->captureEnd(); + +echo $this->inlineScript(); +?> +<!-- finc - documentdeliveryservice - form - END --> diff --git a/themes/finc/templates/footer.phtml b/themes/finc/templates/footer.phtml index e0e0eae30b028c7913c59d682515273782a6d5ad..301b47e88a484d27332358c9a3aea934023687ec 100644 --- a/themes/finc/templates/footer.phtml +++ b/themes/finc/templates/footer.phtml @@ -38,7 +38,7 @@ <?= $this->transEsc("Footer-Powered-By-Text") ?> </span> <?= $this->externalLink("https://vufind.org", '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')]) ?> - <?= $this->externalLink("https://finc.info", '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title'), 'aria-hidden' => 'true']) ?> + <?= $this->externalLink("https://finc.info", '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title')]) ?> </div> </div> </footer> diff --git a/themes/finc/templates/myresearch/menu.phtml b/themes/finc/templates/myresearch/menu.phtml index a2348fc565404adbfdcaae793f20c57a52d8b1f2..65978bf3e042238e103e089fd5d9d4765117cd78 100644 --- a/themes/finc/templates/myresearch/menu.phtml +++ b/themes/finc/templates/myresearch/menu.phtml @@ -12,7 +12,7 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>> + <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active" aria-current="page"' : ''?>> <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?> </a> </li> @@ -22,7 +22,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkCapability('getMyTransactions', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-checkedout')?>" class="flex checkedout<?=$this->active == 'checkedout' ? ' active' : ''?>"> + <a href="<?=$this->url('myresearch-checkedout')?>" class="flex checkedout<?=$this->active == 'checkedout' ? ' active' : ''?>" + <?=$this->active == 'checkedout' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-book" aria-hidden="true"></i> <?=$this->transEsc('Checked Out Items')?></span> <span class="checkedout-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -32,7 +34,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php endif; ?> <?php if ($this->ils()->checkFunction('getMyTransactionHistory', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active"' : ''?>> + <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active"' : ''?> + <?=$this->active == 'historicloans' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-history" aria-hidden="true"></i> <?=$this->transEsc('Loan History')?> </a> </li> @@ -40,7 +44,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkCapability('getMyHolds', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>"> + <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>" + <?=$this->active == 'holds' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?></span> <span class="holds-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -51,7 +57,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkFunction('StorageRetrievalRequests', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>"> + <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>" + <?=$this->active == 'storageRetrievalRequests' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?></span> <span class="storageretrievalrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -62,7 +70,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkFunction('ILLRequests', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>"> + <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>" + <?=$this->active == 'ILLRequests' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?></span> <span class="illrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> <?php /* nxt line finc specific - CK */ ?> @@ -73,20 +83,26 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php if ($this->ils()->checkCapability('getMyFines', $capabilityParams)): ?> <li class="facet"> - <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>"> + <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>" + <?=$this->active == 'fines' ? ' aria-current="page"' : ''?> + > <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i> <?=$this->transEsc('Fines')?></span> <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> </a> </li> <?php endif; ?> <li class="facet"> - <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?>> + <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?> + <?=$this->active == 'profile' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?> </a> </li> <?php if ($user && $user->libraryCardsEnabled()): ?> <li class="facet"> - <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?>> + <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?> + <?=$this->active == 'librarycards' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> </a> </li> @@ -94,7 +110,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php endif; ?> <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> <li class="facet"> - <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?>> + <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?> + <?=$this->active == 'history' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> </a> </li> @@ -112,7 +130,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <h3><?=$this->transEsc('Preferences')?></h3> <ul class="myresearch-menu facet-group"> <li class="facet"> - <a href="<?=$this->url('myresearch-changepassword')?>"<?=$this->active == 'newpassword' ? ' class="active"' : ''?>> + <a href="<?=$this->url('myresearch-changepassword')?>"<?=$this->active == 'newpassword' ? ' class="active"' : ''?> + <?=$this->active == 'newpassword' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=$this->transEsc('Change Password')?> </a> </li> @@ -123,7 +143,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <h3><?=$this->transEsc('Your Lists')?></h3> <ul class="myresearch-menu facet-group"> <li class="facet"> - <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>> + <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?> + <?=$this->active == 'favorites' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?> </a> </li> @@ -132,7 +154,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php foreach ($lists as $list): ?> <?php /* finc: keep icon inside + keep braces in badge!; CK*/ ?> <li class="facet"> - <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?>> + <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?> + <?=$this->active == 'list' . $list['id'] ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-star-o" aria-hidden="true"></i> <?=$this->escapeHtml($list['title'])?> <span class="badge">(<?=$list->cnt?>)</span> </a> @@ -140,7 +164,9 @@ $capabilityParams = $patron ? ['patron' => $patron] : []; <?php endforeach; ?> <li class="facet"> - <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"<?=$this->active == 'editlist/NEW' ? ' class="active"' : ''?>> + <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"<?=$this->active == 'editlist/NEW' ? ' class="active"' : ''?> + <?=$this->active == 'editlist/NEW' ? ' aria-current="page"' : ''?> + > <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List')?> </a> </li> diff --git a/themes/finc/templates/record/cover.phtml b/themes/finc/templates/record/cover.phtml index e557d2210f79a7de886fcd9fde892f794e09b6af..6ee4c1314def4f1e730897354bd89f36958b8d40 100644 --- a/themes/finc/templates/record/cover.phtml +++ b/themes/finc/templates/record/cover.phtml @@ -3,7 +3,13 @@ <?php /* If you want to load covers in lightbox use .recordcover; the class .nocover prevents nocover images from loading in lightbox or can be used to hide the images */ ?> <?php $alt = $alt ?? $this->transEsc('Cover Image')?> -<?php $coverId = "cover-" . $driver->getUniqueID() . "-" . time(); ?> +<?php $id = $driver->getUniqueID() ?> +<?php if ($id) { + $coverId = "cover-$id-" . time(); +} else { + $cover = false; +} +?> <?php if ($cover): ?> <?php if ($this->link): ?><a id="<?=$coverId?>" href="<?=$this->escapeHtmlAttr($this->link)?>" tabindex="-1" aria-hidden="true"><?php endif; ?> <img alt="<?=$alt?>" <?php if ($linkPreview): ?>data-linkpreview="true" <?php endif; ?>class="recordcover" src="<?=$this->escapeHtmlAttr($cover); ?>" /> diff --git a/themes/finc/templates/search/advanced/layout.phtml b/themes/finc/templates/search/advanced/layout.phtml index 05624b555ebda60dc6b7a34a6ffc7af25a5d524c..a4e70ff5492cf39cdeac32fda623cb86ecd2e3a5 100644 --- a/themes/finc/templates/search/advanced/layout.phtml +++ b/themes/finc/templates/search/advanced/layout.phtml @@ -123,12 +123,12 @@ if (isset($searchDetails) && is_object($searchDetails)) { <label for="search_lookfor<?=$group . '_' . $search?>"> <?=$this->transEsc("search_terms")?>: </label> - <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?> aria-label="<?=$this->transEsc("search_terms")?>"> + <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?>> </div> <div class="adv-select"> <label for="type<?=$group . '_' . $search?>"><?=$this->transEsc("Search type")?>:</label> - <select id="type<?=$group . '_' . $search?>" class="adv-term-type form-control" name="type<?=$group?>[]" aria-label="<?=$this->transEsc("Search type")?>"> + <select id="type<?=$group . '_' . $search?>" class="adv-term-type form-control" name="type<?=$group?>[]"> <?php foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?> <option value="<?=$this->escapeHtml($searchVal)?>"<?php if(isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()):?> selected<?php endif;?>><?=$this->transEsc($searchDesc)?></option> <?php endforeach; ?> @@ -157,7 +157,7 @@ if (isset($searchDetails) && is_object($searchDetails)) { </div> <div class="adv-group-match"> <label class="search_bool" for="search_bool<?=$group ?>"><?=$this->transEsc("search_match")?>: </label> - <select id="search_bool<?=$group?>" name="bool<?=$group?>[]" class="form-control"> + <select id="search_bool<?=$group?>" name="bool<?=$group?>[]" class="form-control"> <option value="AND"<?php if(isset($setSearchGroups[$group]) && 'AND' == $setSearchGroups[$group]):?> selected<?php endif;?>><?=$this->transEsc("search_AND")?></option> <option value="OR"<?php if(isset($setSearchGroups[$group]) && 'OR' == $setSearchGroups[$group]):?> selected<?php endif;?>><?=$this->transEsc("search_OR")?></option> <option value="NOT"<?php if(isset($setSearchGroups[$group]) && 'NOT' == $setSearchGroups[$group]):?> selected<?php endif;?>><?=$this->transEsc("search_NOT")?></option>