From 1c90d6bc6975df0e3d9c494868aea4050825592f Mon Sep 17 00:00:00 2001
From: Alexander Purr <purr@ub.uni-leipzig.de>
Date: Tue, 7 Jan 2020 16:56:39 +0100
Subject: [PATCH] refs #16680 [fid_adlr] adjust several forms

* adjust reset password form
* add translation to username change form
* adjust send search mail form and record mail form
** changed config for senders email address as default
** adjust templates
** add translations
** remove textarea height limitation
* use the correct language key
* adjust translation
---
 fid_adlr/config/vufind/config.ini            |  5 ++++-
 themes/fid_adlr/languages/de.ini             |  9 ++++++++-
 themes/fid_adlr/languages/en.ini             |  9 ++++++++-
 themes/fid_adlr/languages/fid/de.ini         |  6 +++++-
 themes/fid_adlr/languages/fid/en.ini         |  6 +++++-
 themes/fid_adlr/scss/_customForms.scss       |  3 +++
 themes/fid_adlr/templates/record/email.phtml | 19 +++++++++++++++++++
 themes/fid_adlr/templates/search/email.phtml | 17 +++++++++++++++++
 8 files changed, 69 insertions(+), 5 deletions(-)
 create mode 100644 themes/fid_adlr/templates/record/email.phtml
 create mode 100644 themes/fid_adlr/templates/search/email.phtml

diff --git a/fid_adlr/config/vufind/config.ini b/fid_adlr/config/vufind/config.ini
index a97e666af77..28e5e49cc83 100644
--- a/fid_adlr/config/vufind/config.ini
+++ b/fid_adlr/config/vufind/config.ini
@@ -138,4 +138,7 @@ sender_email="noreply@adlr.link"
 new_releases="?filter%5B%5D=~de15fid_date%3A%5BNOW-30DAY%2FDAY+TO+NOW%5D&type=AllFields&filter%5B%5D=mega_collection%3A%22PDA+Print+VUB%22&sort=title&view=list"
 
 [Collections]
-collections = true
\ No newline at end of file
+collections = true
+
+[Mail]
+user_email_in_from = true
\ No newline at end of file
diff --git a/themes/fid_adlr/languages/de.ini b/themes/fid_adlr/languages/de.ini
index 3bcd32ccdb8..f48c29eed74 100644
--- a/themes/fid_adlr/languages/de.ini
+++ b/themes/fid_adlr/languages/de.ini
@@ -77,4 +77,11 @@ resource_not_found = "Ich habe eine Ressource nicht gefunden."
 purchase_request = "Ich habe einen Anschaffungswunsch."
 
 Your search terms = "Ihre erweiterte Suche"
-Edit this Advanced Search = "Suche bearbeiten"
\ No newline at end of file
+Edit this Advanced Search = "Suche bearbeiten"
+
+; sending card, record or search by mail
+From = "Von (E-Mail-Adresse)"
+To = "An (E-Mail-Adresse)"
+Email Record = "Diesen Eintrag als E-Mail versenden"
+email_record_information = "Sie können diesen Datensatz hier per E-Mail versenden. Optional können Sie eine Nachricht hinzufügen."
+email_search_information = "Sie können hier die aktuelle Suche per E-Mail versenden. Optional können Sie eine Nachricht hinzufügen."
\ No newline at end of file
diff --git a/themes/fid_adlr/languages/en.ini b/themes/fid_adlr/languages/en.ini
index f3914000860..b161bb7b8c9 100644
--- a/themes/fid_adlr/languages/en.ini
+++ b/themes/fid_adlr/languages/en.ini
@@ -79,4 +79,11 @@ resource_not_found = "I didn't find a resource."
 purchase_request = "I have a purchase request."
 
 Your search terms = "Your advanced search"
-Edit this Advanced Search = "Edit search"
\ No newline at end of file
+Edit this Advanced Search = "Edit search"
+
+; sending card, record or search by mail
+From = "From (Email address)"
+To = "To (Email address)"
+Email Record = "E-Mail this Record"
+email_record_information = "Here you can send the current record by e-mail. Optionally you can add a message."
+email_search_information = "Here you can send the current search by e-mail. Optionally you can add a message."
\ No newline at end of file
diff --git a/themes/fid_adlr/languages/fid/de.ini b/themes/fid_adlr/languages/fid/de.ini
index a2c903d25f5..095e6207100 100644
--- a/themes/fid_adlr/languages/fid/de.ini
+++ b/themes/fid_adlr/languages/fid/de.ini
@@ -50,4 +50,8 @@ permission_extended_access = "Zugriff auf alle Dienstleistungen, Lizenzen und In
 Edit Account = Persönliche Angaben ändern
 
 acquisition_fid_name = "adlr.link"
-acquisition_library = "Universitätsbibliothek Leipzig"
\ No newline at end of file
+acquisition_library = "Universitätsbibliothek Leipzig"
+
+password_reset_form_title = "Passwort ändern"
+password_reset_form_information = "Bitte geben Sie die E-Mail-Adresse ein, mit der Sie sich bei adlr.link registriert haben. Wir senden Ihnen einen Link per E-Mail, über den Sie Ihr Passwort ändern können."
+username_change_form_information = "Bitte geben Sie Ihre neue E-Mail-Adresse ein. Wir senden Ihnen einen Link per E-Mail, über den Sie Ihre neue E-Mail-Adresse bestätigen müssen. Danach können Sie sich mit Ihrer neuen E-Mail-Adresse bei adlr.link anmelden."
\ No newline at end of file
diff --git a/themes/fid_adlr/languages/fid/en.ini b/themes/fid_adlr/languages/fid/en.ini
index 92e14c29f2c..091c1673b18 100644
--- a/themes/fid_adlr/languages/fid/en.ini
+++ b/themes/fid_adlr/languages/fid/en.ini
@@ -51,4 +51,8 @@ permission_full_access = "Access to services and licenses"
 permission_extended_access = "Access to all services and licenses and staff view"
 
 acquisition_fid_name = "adlr.link"
-acquisition_library = "Leipzig University Library"
\ No newline at end of file
+acquisition_library = "Leipzig University Library"
+
+password_reset_form_title = "Change password"
+password_reset_form_information = "Please enter the e-mail address by which you registered your user account at adlr.link. We will send you a link to change your password."
+username_change_form_information = "Please enter your new e-mail address. We will send you a link to confirm your new email address. Then you can login to adlr.link with your new e-mail address."
\ No newline at end of file
diff --git a/themes/fid_adlr/scss/_customForms.scss b/themes/fid_adlr/scss/_customForms.scss
index 4d2c56827e2..7b4f43505d8 100644
--- a/themes/fid_adlr/scss/_customForms.scss
+++ b/themes/fid_adlr/scss/_customForms.scss
@@ -10,6 +10,9 @@ input.form-control:not(.search-query), select.form-control, textarea.form-contro
   border: 3px solid $black;
   border-radius: 2px;
   color: $black;
+}
+
+input.form-control:not(.search-query), select.form-control, input.form-control:not(.search-query){
   height: em(60px);
 }
 
diff --git a/themes/fid_adlr/templates/record/email.phtml b/themes/fid_adlr/templates/record/email.phtml
new file mode 100644
index 00000000000..d176a863fb1
--- /dev/null
+++ b/themes/fid_adlr/templates/record/email.phtml
@@ -0,0 +1,19 @@
+<!-- adlr-record - EMAIL.phtml -->
+<?
+  // Set page title.
+  $this->headTitle($this->translate('Email Record'));
+
+  // Set up breadcrumbs:
+  $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ')
+    . '<li>' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> '
+    . '<li class="active">' . $this->transEsc('Email Record') . '</li>';
+?>
+<h2><?=$this->transEsc('Email Record') ?>: <span class="title-in-heading"><?=$this->escapeHtml($this->driver->getBreadcrumb())?></span></h2>
+<form method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" name="emailRecord">
+  <?=$this->flashmessages()?>
+  <?=$this->transEsc('email_record_information')?>
+  <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" />
+  <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" />
+  <?=$this->render('Helpers/email-form-fields.phtml')?>
+</form>
+<!-- adlr-record - EMAIL.phtml end -->
\ No newline at end of file
diff --git a/themes/fid_adlr/templates/search/email.phtml b/themes/fid_adlr/templates/search/email.phtml
new file mode 100644
index 00000000000..5c5229e3775
--- /dev/null
+++ b/themes/fid_adlr/templates/search/email.phtml
@@ -0,0 +1,17 @@
+<!-- adlr-search - EMAIL.phtml -->
+<?
+  // Set page title.
+  $this->headTitle($this->translate('Email this Search'));
+
+  // Set up breadcrumbs:
+  $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') .
+    '<li class="active">' . $this->transEsc('Email this Search') . '</li>';
+?>
+<h2><?=$this->transEsc('Email this Search') ?></h2>
+<?=$this->flashmessages()?>
+<?=$this->transEsc('email_search_information')?>
+<form method="post" name="emailSearch">
+  <input type="hidden" name="url" value="<?=$this->escapeHtmlAttr($this->url)?>" />
+  <?=$this->render('Helpers/email-form-fields.phtml')?>
+</form>
+<!-- adlr-search - EMAIL.phtml end -->
\ No newline at end of file
-- 
GitLab