diff --git a/fid_bbi/alpha/config/vufind/FeedbackForms.yaml b/fid_bbi/alpha/config/vufind/FeedbackForms.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e0cb0e105d97caede5ce0e93b00870a740cc967 --- /dev/null +++ b/fid_bbi/alpha/config/vufind/FeedbackForms.yaml @@ -0,0 +1,94 @@ +--- +# Listing of configured forms. +# +# Configured forms are listed in the top level 'forms' array and can accessed via the URL: +# /Feedback/Form/<form-id> +# +# The main Feedback form (id: FeedbackSite) can be accessed with a shorter URL /Feedback +# +# Form supports the following options: +# +# enabled (boolean) Is the form enabled? (default = true) +# useCaptcha (boolean) Should the form use Captcha validation? Requires the "feedback" +# option to be turned on in the config.ini [Captcha] form setting. +# (default = true, if Captcha turned on for feedback overall). +# title (string) Form title (translation key) +# onlyForLoggedUsers (boolean) Require the user to be logged in to see the form +# (default = false) +# emailSubject (string) Email subject (translation key). (default = email_subject +# value from config.ini [Feedback] section, or 'VuFind Feedback') +# The subject may contain placeholders (for example %%receiver%%) +# that are replaced with submitted form values. +# recipient +# name (string) Recipient name (default = recipient_name setting from config.ini +# [Feedback] section) +# email (string) Recipient email address (default = recipient_email setting from +# config.ini [Feedback] section) +# response (string) Reponse after form submit (translation key) +# senderInfoRequired (boolean) Require sender to fill out name and email fields +# +# help +# pre (string) Help text displayed at the beginning of the form (translation key). +# post (string) Help text displayed at the end of the form (translation key) +# +# Help texts may contain HTML-formatting. +# +# fields (array) List of form elements with the following options: +# +# name (string) Element name +# label (string) Element label (translation key) +# required (boolean) Is the element required? +# settings (array) HTML attributes as key-value pairs, for example: +# - [class, "custom-css-class another-class"] +# type (string) Element type (text|textarea|email|url|select) +# help (string) Element help text (translation key) +# +# And for select elements one of: +# +# options (array) List of select values (translation keys) +# +# or +# +# optionGroups (array) List of option groups with keys: +# label (string) Group label (translation key) +# options (array) List of select values (translation keys) +# +#----------------------------------------------------------------------------------- + +forms: + + # Main Feedback form + + FeedbackSite: + title: Contact + enabled: true + useCaptcha: false + + recipient: + name: FID BBI + email: fid@hab.de + + onlyForLoggedUsers: false + + response: Thank you for your feedback. + senderInfoRequired: true + + fields: + - name: emailSubject + type: select + label: email_subject + options: + - Questions And Notes + - Book Suggestion + - Report an error + + - name: message + type: textarea + label: Message + required: true + + - name: confirmPrivacy + type: text #type needed + label: + required: true + diff --git a/fid_bbi/alpha/config/vufind/config.ini b/fid_bbi/alpha/config/vufind/config.ini index 9c5eb7a9dd7e640808d7832f3453f1ca03a430ad..b3d44db2526aab99c455fedb289f6b9ca98946b5 100644 --- a/fid_bbi/alpha/config/vufind/config.ini +++ b/fid_bbi/alpha/config/vufind/config.ini @@ -42,3 +42,7 @@ database = "mysql://vufind_fidbbi:i3lIPQTBmbSGmzipQHjOPrzmUfUuiDiA@localhost/vuf [Authentication] ; #14758 test login button hideLogin = false + +[Mail] +host = server1.rz.uni-leipzig.de +port = 25 diff --git a/fid_bbi/config/vufind/FeedbackForms.yaml b/fid_bbi/config/vufind/FeedbackForms.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e0cb0e105d97caede5ce0e93b00870a740cc967 --- /dev/null +++ b/fid_bbi/config/vufind/FeedbackForms.yaml @@ -0,0 +1,94 @@ +--- +# Listing of configured forms. +# +# Configured forms are listed in the top level 'forms' array and can accessed via the URL: +# /Feedback/Form/<form-id> +# +# The main Feedback form (id: FeedbackSite) can be accessed with a shorter URL /Feedback +# +# Form supports the following options: +# +# enabled (boolean) Is the form enabled? (default = true) +# useCaptcha (boolean) Should the form use Captcha validation? Requires the "feedback" +# option to be turned on in the config.ini [Captcha] form setting. +# (default = true, if Captcha turned on for feedback overall). +# title (string) Form title (translation key) +# onlyForLoggedUsers (boolean) Require the user to be logged in to see the form +# (default = false) +# emailSubject (string) Email subject (translation key). (default = email_subject +# value from config.ini [Feedback] section, or 'VuFind Feedback') +# The subject may contain placeholders (for example %%receiver%%) +# that are replaced with submitted form values. +# recipient +# name (string) Recipient name (default = recipient_name setting from config.ini +# [Feedback] section) +# email (string) Recipient email address (default = recipient_email setting from +# config.ini [Feedback] section) +# response (string) Reponse after form submit (translation key) +# senderInfoRequired (boolean) Require sender to fill out name and email fields +# +# help +# pre (string) Help text displayed at the beginning of the form (translation key). +# post (string) Help text displayed at the end of the form (translation key) +# +# Help texts may contain HTML-formatting. +# +# fields (array) List of form elements with the following options: +# +# name (string) Element name +# label (string) Element label (translation key) +# required (boolean) Is the element required? +# settings (array) HTML attributes as key-value pairs, for example: +# - [class, "custom-css-class another-class"] +# type (string) Element type (text|textarea|email|url|select) +# help (string) Element help text (translation key) +# +# And for select elements one of: +# +# options (array) List of select values (translation keys) +# +# or +# +# optionGroups (array) List of option groups with keys: +# label (string) Group label (translation key) +# options (array) List of select values (translation keys) +# +#----------------------------------------------------------------------------------- + +forms: + + # Main Feedback form + + FeedbackSite: + title: Contact + enabled: true + useCaptcha: false + + recipient: + name: FID BBI + email: fid@hab.de + + onlyForLoggedUsers: false + + response: Thank you for your feedback. + senderInfoRequired: true + + fields: + - name: emailSubject + type: select + label: email_subject + options: + - Questions And Notes + - Book Suggestion + - Report an error + + - name: message + type: textarea + label: Message + required: true + + - name: confirmPrivacy + type: text #type needed + label: + required: true + diff --git a/fid_bbi/config/vufind/config.ini b/fid_bbi/config/vufind/config.ini index 91b4d73e16e5bcf1df58bb686f296b0aefee5058..175fdb4e929e12fe295514761b14d08f70bba440 100644 --- a/fid_bbi/config/vufind/config.ini +++ b/fid_bbi/config/vufind/config.ini @@ -118,3 +118,12 @@ generalFormats = true ; nbn[replace] = nbn-resolving.de/urn:nbn: ; ***************** ; * EOF finc + +[Feedback] +tab_enabled = true +recipient_email = "fid@hab.de" +recipient_name = "BBI Admin" +email_subject = "%%emailSubject%%" +sender_name = "Katalog BBI" +sender_email = "noreply@hab.de" + diff --git a/fid_bbi/languages/de.ini b/fid_bbi/languages/de.ini index 2b5328d2a40c506d06748b79589933990fc88591..d9933157207df3d73a56fab42313b09acb72fc70 100644 --- a/fid_bbi/languages/de.ini +++ b/fid_bbi/languages/de.ini @@ -268,6 +268,7 @@ Cover Image = Buchumschlag Create New Account = "Neues Konto anlegen" Created = Erstellt Date = Datum +Data Collection = Datensammlung Date of birth = Geburtsdatum Date of issue = Bestelldatum Date of loan = Ausleihdatum @@ -451,6 +452,7 @@ Order Comments = "Kommentar" Orientwissenschaften, Ägyptologie = Orientwissenschaften, Ägyptologie other = Sonstige Questions = Fragen +Questions And Notes = allgemeine Fragen / Anmerkungen Parallel Editions = "Parallele Ausgaben" Partrelated = Buch Partnotrelated = Buch @@ -477,6 +479,7 @@ Please select the subject = "Bitte wählen Sie das Fachgebiet aus" Postcode = Postleitzahl Prev = Vorheriger Print = Drucken +Privacy Policy = "Datenschutzhinweise" Private = Privat Proceed browsing from here = Stöbern hier fortsetzen Provider = Provider @@ -508,6 +511,7 @@ Related Title = "Zugehörige Werke" Renew Login = "Bitte, erneut einloggen" Remove all Filters = "Alle Filter entfernen" Repeat your password = "Wiederhole das Passwort" +Report an error = "Fehler melden" Reserve = Vormerkbar Reserved = "Vorgemerkte Medien" Reserved on = "Vorgemerkt am" @@ -732,6 +736,8 @@ email_selected = "Ausgewähltes per E-Mail versenden" email_selected_favorites = "Ausgewählte Favoriten per E-Mail versenden" email_sending = "Nachricht wird gesendet..." email_success = "Nachricht versendet" +email_subject = "Betreff" +email_contact_policy = "Ich habe die %%policy_link%% gelesen und bin damit einverstanden." error_inconsistent_parameters = "Leider ist ein Fehler aufgetreten. Es wurden widersprüchliche Angaben entdeckt." errorcode_error = "Es ist ein Fehler aufgetreten" errorcode_http_status_error = "Kein Netzwerk vorhanden" diff --git a/fid_bbi/languages/en.ini b/fid_bbi/languages/en.ini index 4fd98858584b97f7eb988e521fb09b8bdd1ea17f..ff5995f645f3b2eab6609c215b03a80c55498f50 100644 --- a/fid_bbi/languages/en.ini +++ b/fid_bbi/languages/en.ini @@ -197,6 +197,7 @@ Portuguese = Portuguese Prev = Prev Print = Print Private = Private +Privacy Policy = "Privacy Policy" Profile = Profile Provider = Provider Public = Public @@ -213,6 +214,7 @@ Recall This = "Recall this" Recent acquisitions = "Recent Acquisitions" Region = Region Remove all Filters = "Remove all Filters" +Report an error = "Report an Error" Reserves = Reserves Results per page = "Results per Page" Reviews = Reviews @@ -385,6 +387,7 @@ email_selected = "E-mail Selected" email_selected_favorites = "E-mail Selected Favorites" email_sending = "Sending Message..." email_success = "Message Sent" +email_contact_policy = "I have read and agree to the %%policy_link%%." error_inconsistent_parameters = "Sorry, an error has occurred. Inconsistent parameters detected" errorcode_error = "Sorry, an error has occurred. Please try it again" errorcode_http_status_error = "No network available for the Integrated Library System" @@ -867,6 +870,7 @@ Confirm = Confirm Confirm with your password = Confirm with your password Contact = Contact Contains = Contains +Data Collection = Data Collection Date of birth = Date of birth Date of issue = Date of issue Date of loan = Date of loan @@ -937,6 +941,7 @@ Order Comments = Order Comments Orientwissenschaften, Ägyptologie = Orientwissenschaften, Ägyptologie other = other Questions = Questions +Questions And Notes = Questions and Notes Parallel Editions = Parallel Editions Partrelated = Partrelated Partnotrelated = Partnotrelated diff --git a/module/fid_bbi/src/fid_bbi/Controller/FeedbackController.php b/module/fid_bbi/src/fid_bbi/Controller/FeedbackController.php new file mode 100644 index 0000000000000000000000000000000000000000..89ea0c760cfe8e804247b48ed6847cc38ebb3833 --- /dev/null +++ b/module/fid_bbi/src/fid_bbi/Controller/FeedbackController.php @@ -0,0 +1,47 @@ +<?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 Robert Lange <lange@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +namespace fid_bbi\Controller; + +use VuFind\Controller\FeedbackController as BaseFeedbackController; + + +/** + * Redirects the user to the appropriate default VuFind action. + * + * @category VuFind + * @package Controller + * @author Robert Lange <lange@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class FeedbackController extends BaseFeedbackController +{ + /** + * Display Feedback home form. + * + * @return \Zend\View\Model\ViewModel + */ + public function emailAction() + { + return $this->forwardTo('Feedback', 'Form'); + } +} diff --git a/themes/fid_bbi/templates/feedback/form.phtml b/themes/fid_bbi/templates/feedback/form.phtml new file mode 100644 index 0000000000000000000000000000000000000000..98265c1d2be37920a29d8d740fa3adcc5f001ba7 --- /dev/null +++ b/themes/fid_bbi/templates/feedback/form.phtml @@ -0,0 +1,103 @@ +<?php + $form = $this->form; + $form->prepare(); + + $title = $form->getTitle(); + $title = !empty($title) + ? $this->transEsc($title) : null; + + $formUrl = $this->url('feedback-form', ['id' => $this->formId]); + $form->setAttribute('action', $formUrl); + $form->setAttribute('class', 'dynamic-form'); + $form->setAttribute('method', 'post'); + + $help = $form->getHelp(); + $helpPre = $helpPost = null; + $helpPre = isset($help['pre']) ? $this->translate($help['pre']) : null; + $helpPost = isset($help['post']) ? $this->translate($help['post']) : null; +?> +<div class="feedback-content"> + <?php if ($title): ?> + <?php $this->headTitle($title); ?> + <h1><?=$title?></h1> + <?php endif; ?> + <?=$this->flashmessages()?> + + <?php if ($form->showOnlyForLoggedUsers() && !$this->user): ?> + <div class="form-group"> + <p><?=$this->translate('feedback_login_required')?></p> + <a href="<?=$this->url('myresearch-userlogin') ?>" class="btn btn-primary" data-lightbox title="Login"><i class="fa fa-sign-in" aria-hidden="true" data-lightbox-onclose="window.location.href='<?=$this->escapeHtmlAttr($formUrl) ?>'"></i> <?=$this->transEsc("Login") ?></a> + </div> + <?php else: ?> + <?= $this->form()->openTag($form); ?> + <?php if ($helpPre): ?> + <div class="form-group"> + <div class="form-info pre"> + <?=$helpPre?> + </div> + </div> + <?php endif ?> + + <?php $currentGroup = null; ?> + <?php foreach($form->getElements() as $el): ?> + <? if($el['name'] == "confirmPrivacy") : ?> + <div class="form-group"> + <input id="confirmPrivacy" name="confirmPrivacy" type="checkbox" <?=isset($el['required']) && $el['required'] ? 'required' : ''?>> + <label for="confirmPrivacy"> + <?= + $this->translate( + 'email_contact_policy', + ['%%policy_link%%' => '<a href="' . $this->url('content-page', ['page' => 'privacy']) . '"">' . $this->transEsc('Privacy Policy') . '</a>'] + ); + ?>* + </label> + </div> + <?php else: ?> + <?php + $formElement = $form->get($el['name']); + + // Group form elements into field sets + $handleGroup = $group = null; + if (isset($el['group']) && !empty($el['group'])) { + $group = $el['group']; + } + if ($group && $currentGroup === null) { + $handleGroup = 'open'; + $currentGroup = $group; + } elseif ($currentGroup && !$group) { + $handleGroup = 'close'; + $currentGroup = null; + } elseif ($currentGroup !== $group) { + $handleGroup = 'openAndClose'; + $currentGroup = $group; + } + ?> + + <?php if (in_array($handleGroup, ['close', 'openAndClose'])): ?> + </div> + <?php endif ?> + <?php if (in_array($handleGroup, ['open', 'openAndClose'])): ?> + <div class="field-set"> + <?php endif ?> + + <div class="form-group"> + <?php if (!empty($el['help'])): ?> + <p class="info"><?= $this->transEsc($el['help']) ?></p> + <?php endif ?> + <?php if ($el['type'] !== 'submit'): ?> + <label for="<?=$this->escapeHtmlAttr($el['name'])?>" class="control-label<?=!empty($el['required']) ? ' required' : ''?>"><?=$this->transEsc($el['label'])?>:</label> + <?php else: ?> + <?php if ($helpPost): ?> + <div class="form-info post"> + <?=$helpPost?> + </div> + <?php endif ?> + <?=$this->recaptcha()->html($this->useRecaptcha) ?> + <?php endif ?> + <?= $this->formRow($formElement) ?> + </div> + <?php endif; ?> + <?php endforeach ?> + <?= $this->form()->closeTag() ?> + <?php endif ?> +</div> diff --git a/themes/fid_bbi/templates/footer.phtml b/themes/fid_bbi/templates/footer.phtml index a5ec72e2cc10cbdbed0ecf9f40a81a3165a759f8..36c78356a196015c19c834c5d3f82395172e94d3 100644 --- a/themes/fid_bbi/templates/footer.phtml +++ b/themes/fid_bbi/templates/footer.phtml @@ -4,18 +4,19 @@ <div class="footer-column"> <p><strong><?=$this->transEsc('Search Options')?></strong></p> <ul> - <li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li> - <li><a href="<?=$this->url('search-sources')?>"><?=$this->transEsc('Datensammlung')?></a></li> + <li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li> + <li><a href="<?=$this->url('search-sources')?>"><?=$this->transEsc('Data Collection')?></a></li> </ul> </div> <div class="footer-column"> <p><strong><?=$this->transEsc('More Information')?></strong></p> - <ul> - <li><a href="<?=$this->url('content-page', ['page' => 'about'])?>"><?=$this->transEsc('About Us')?></a></li> - <li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li> - <li><a href="<?=$this->url('content-page', ['page' => 'terms'])?>"><?=$this->transEsc('Terms of Use')?></a></li> - <li><a href="<?=$this->url('content-page', ['page' => 'privacy'])?>"><?=$this->transEsc('Privacy Policy')?></a></li> - </ul> + <ul> + <li><a href="<?=$this->url('content-page', ['page' => 'about'])?>"><?=$this->transEsc('About Us')?></a></li> + <li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li> + <li><a href="<?=$this->url('content-page', ['page' => 'terms'])?>"><?=$this->transEsc('Terms of Use')?></a></li> + <li><a href="<?=$this->url('content-page', ['page' => 'privacy'])?>"><?=$this->transEsc('Privacy Policy')?></a></li> + <li><a data-lightbox href="<?=$this->url('feedback-home')?>"><?=$this->transEsc('Contact')?></a></li> + </ul> </div> <div class="footer-column"> <p><strong><?=$this->transEsc('Contact')?></strong></p> diff --git a/themes/fid_bbi/templates/header.phtml b/themes/fid_bbi/templates/header.phtml index 40757e37ef5c07a7b4d3c0a921487e68a877987d..eba6613369c96efaccb46b6d31f6a59da5d52d34 100644 --- a/themes/fid_bbi/templates/header.phtml +++ b/themes/fid_bbi/templates/header.phtml @@ -33,14 +33,7 @@ but reverse it on anything but mobile */ ?> <nav> <ul class="nav navbar-nav navbar-right flip"> - <?php if ($this->feedback()->tabEnabled()): ?> - <li> - <a id="feedbackLink" data-lightbox class="btn" href="<?=$this->url('feedback-home')?>"> <i class="fa fa-envelope" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Feedback")?></span> - </a> - </li> - <?php endif; ?> - <?php $cart = $this->cart(); + <? $cart = $this->cart(); if ($cart->isActive()): ?> <li id="cartSummary"> <a id="cartItems" class="btn" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>">