From f3b3741e0306b78f216cce1d3ac37ee20e6773bc Mon Sep 17 00:00:00 2001
From: jpkanter <kanter@ub.uni-leipzig.de>
Date: Mon, 4 Dec 2023 12:31:41 +0100
Subject: [PATCH] refs #24919 [fid_bbi] changes to database description

* used a seperate template to encapsulate logic
* adjusted language token according to specs
* fixed a typo in databases.phtml
* inserted new template in original template
* stash save for less confusing button design
---
 fid_bbi/languages/de.ini                      |  9 +++--
 fid_bbi/languages/en.ini                      |  9 +++--
 .../myresearch/database-addon-en.phtml        | 12 ++++---
 .../templates/myresearch/database-addon.phtml | 12 ++++---
 .../templates/myresearch/database-link.phtml  | 35 +++++++++++++++++++
 .../templates/myresearch/databases.phtml      |  2 +-
 6 files changed, 62 insertions(+), 17 deletions(-)
 create mode 100644 themes/fid_bbi/templates/myresearch/database-link.phtml

diff --git a/fid_bbi/languages/de.ini b/fid_bbi/languages/de.ini
index 071c2494b63..cc498d0731b 100644
--- a/fid_bbi/languages/de.ini
+++ b/fid_bbi/languages/de.ini
@@ -584,12 +584,12 @@ licenses_proquest_lisc = Library & Information Science Collection (LISC) bei Pro
 ; # 21346
 licenses_neo_BookHistoryOnline = "Recherche starten"
 licenses_neo_name_BookHistoryOnline = "Book History Online (BHO) von Brill"
-licenses_neo_noaccess_BookHistoryOnline = "Book History Online (Produktinformation)"
+licenses_neo_noaccess_BookHistoryOnline = "Weitere Informationen zu BHO."
 licenses_neo_link_BookHistoryOnline = "https://brill.com/view/db/bho"
 licenses_neo_desc_BookHistoryOnline = "Book History Online (BHO) ist eine internationale Bibliographie zur Buch- und Bibliotheksgeschichte. Enthalten sind Monographien, Artikel und Rezensionen, die sich mit der Geschichte des gedruckten Buches, seiner Kunst, seinem Handwerk, seinen Techniken und seiner Ausstattung, seinem wirtschaftlichen, sozialen und kulturellen Umfeld sowie mit seiner Herstellung, Verbreitung, Bewahrung und Beschreibung befassen.Wenn Sie sich als Forschende*r oder als Berufspraktiker*in im Portal des FID BBI anmelden, können Sie die Nachweisdaten von BHO auch innerhalb des Portals des FID BBI recherchieren. "
 licenses_neo_proquest_lisc = "Recherche starten"
 licenses_neo_name_proquest_lisc = "Library and Information Science Collection (LISC) von Proquest"
-licenses_neo_noaccess_proquest_lisc = "Library and Information Science Collection (Produktinformation)"
+licenses_neo_noaccess_proquest_lisc = "Weitere Informationen zu LISC"
 licenses_neo_link_proquest_lisc = "https://about.proquest.com/en/products-services/Library-Information-Science-Collection/"
 licenses_neo_desc_proquest_lisc = "LISC gewährt den Zugriff auf  Volltexte hunderttausender Aufsätze, die in über 300 bibliotheks- und informationswissenschaftlichen Fachzeitschriften erschienen sind. Zeitschriften aus den Vereinigten Staaten und Europa sind besonders gut abgedeckt. Jeder Artikel ist mit einem Abstract versehen, auch gegenseitige Zitationen sind in Teilen erschlossen."
 
@@ -761,4 +761,7 @@ science-mathematics = "Mathematik"
 science-physics = "Physik, Astronomie"
 socialsciences = "Sozialwissenschaften, Soziologie"
 technology = "Technologie / Technik"
-theatre-dance-film = "Theater, Tanz, Film"
\ No newline at end of file
+theatre-dance-film = "Theater, Tanz, Film"
+
+#24919
+scientist_account_prompt = Für den Zugriff müssen Forschende sich anmelden. Noch keinen Account?
\ No newline at end of file
diff --git a/fid_bbi/languages/en.ini b/fid_bbi/languages/en.ini
index e457f254c90..22d851c026a 100644
--- a/fid_bbi/languages/en.ini
+++ b/fid_bbi/languages/en.ini
@@ -557,12 +557,12 @@ licenses_proquest_lisc = Library & Information Science Collection (LISC) at ProQ
 ; # 21346
 licenses_neo_BookHistoryOnline = "Start research"
 licenses_neo_name_BookHistoryOnline = "Book History Online (BHO) by Brill"
-licenses_neo_noaccess_BookHistoryOnline = "Book History Online (product information)"
+licenses_neo_noaccess_BookHistoryOnline = "Further information about Book History Online"
 licenses_neo_link_BookHistoryOnline = "https://brill.com/view/db/bho"
 licenses_neo_desc_BookHistoryOnline = "Book History Online (BHO) is an international bibliography in the field of book and library history. Included are monographs, articles and reviews dealing with the history of the printed book, its arts, crafts, techniques and equipment, its economic, social and cultural environment, as well as its production, distribution, preservation and description. If you have logged in to the FID BBI as a researcher or professional practitioner, you can also search the record data of BHO within the portal of the FID BBI."
 licenses_neo_proquest_lisc = "Start research"
 licenses_neo_name_proquest_lisc = "Library and Information Science Collection (LISC) by Proquest"
-licenses_neo_noaccess_proquest_lisc = " Library and Information Science Collection (product information)"
+licenses_neo_noaccess_proquest_lisc = "Further information about LISC"
 licenses_neo_link_proquest_lisc = "https://about.proquest.com/en/products-services/Library-Information-Science-Collection/"
 licenses_neo_desc_proquest_lisc = "LISC provides access to the full text of hundreds of thousands of articles published in over 300 library and information science journals. Journals from the United States and Europe are particularly well covered. Each article is provided with an abstract, and reciprocal citations are also indexed."
 
@@ -741,4 +741,7 @@ science-mathematics = "Mathematics"
 science-physics = "Physics, Astronomy"
 socialsciences = "Social sciences, Sociology"
 technology = "Technology"
-theatre-dance-film = "Theatre, Dance, Film"
\ No newline at end of file
+theatre-dance-film = "Theatre, Dance, Film"
+
+#24919
+scientist_account_prompt = Researchers must register for access. No account yet?
diff --git a/themes/fid_bbi/templates/myresearch/database-addon-en.phtml b/themes/fid_bbi/templates/myresearch/database-addon-en.phtml
index 6ffafbcf3a5..5dbaf4d8632 100644
--- a/themes/fid_bbi/templates/myresearch/database-addon-en.phtml
+++ b/themes/fid_bbi/templates/myresearch/database-addon-en.phtml
@@ -109,11 +109,13 @@
             <p>
               <?=$this->translate('licenses_neo_desc_' . $license['name'])?>
             </p>
-            <?php if ($this->permission()->allowDisplay('access.Licenses')) : ?>
-              <?=$this->externalLink($this->proxyUrl($license['url']), $this->translate('licenses_neo_' . $license['name']))?>
-            <?php else: ?>
-              <?=$this->externalLink($this->translate('licenses_neo_link_' . $license['name']), $this->translate('licenses_neo_noaccess_' . $license['name']))?>
-            <?php endif ?>
+            <p>
+              <?=$this->render("myresearch/database-link",
+                ["link"=>$this->proxyUrl($license['url']),
+                 "text"=>$this->translate('licenses_neo_' . $license['name']),
+                 "db_fallback_link"=>$this->translate('licenses_neo_link_' . $license['name']),
+                 "db_fallback_text"=>$this->translate('licenses_neo_noaccess_' . $license['name'])]);?>
+            </p>
           </div>
         </div>
       </li>
diff --git a/themes/fid_bbi/templates/myresearch/database-addon.phtml b/themes/fid_bbi/templates/myresearch/database-addon.phtml
index 46e08611f27..aeed56159a7 100644
--- a/themes/fid_bbi/templates/myresearch/database-addon.phtml
+++ b/themes/fid_bbi/templates/myresearch/database-addon.phtml
@@ -107,11 +107,13 @@
           <p>
             <?=$this->translate('licenses_neo_desc_' . $license['name'])?>
           </p>
-          <?php if ($this->permission()->allowDisplay('access.Licenses')) : ?>
-            <?=$this->externalLink($this->proxyUrl($license['url']), $this->translate('licenses_neo_' . $license['name']))?>
-          <?php else: ?>
-            <?=$this->externalLink($this->translate('licenses_neo_link_' . $license['name']), $this->translate('licenses_neo_noaccess_' . $license['name']))?>
-          <?php endif ?>
+          <p>
+            <?=$this->render("myresearch/database-link",
+              ["link"=>$this->proxyUrl($license['url']),
+               "text"=>$this->translate('licenses_neo_' . $license['name']),
+               "db_fallback_link"=>$this->translate('licenses_neo_link_' . $license['name']),
+               "db_fallback_text"=>$this->translate('licenses_neo_noaccess_' . $license['name'])]);?>
+          </p>
         </div>
       </div>
     </li>
diff --git a/themes/fid_bbi/templates/myresearch/database-link.phtml b/themes/fid_bbi/templates/myresearch/database-link.phtml
new file mode 100644
index 00000000000..050efc6a76d
--- /dev/null
+++ b/themes/fid_bbi/templates/myresearch/database-link.phtml
@@ -0,0 +1,35 @@
+<?php
+/**
+ * origin: fid bbi
+ *
+ * called by view helper/controller: MyResearchController->databasesAction()
+ *
+ * usage:
+ * - displays the correct kind of link for databases
+ * - url: /myresearch/databases
+ *
+ * parent template: database-addon-[lang].phtml
+ *
+ * modified for fid bbi: --
+ *
+ * configured in: --
+ */
+?>
+
+<?php if($this->permission()->allowDisplay('access.Licenses')):?>
+  <?php if(isset($db_prefix) && !empty($db_prefix)):?>
+    <?=$db_prefix?>
+  <?php endif;?>
+  <?=$this->externalLink($link, $text);?>
+  <?php if(isset($db_suffix) && !empty($db_suffix)):?>
+    <?=$db_suffix?>
+  <?php endif;?>
+<?php else:?>
+  <?=$this->translate('scientist_account_prompt')?>
+  <a href="<?=$this->url('myresearch-account',[],['query'=>['auth_method'=>'fid']])?>"><?=$this->translate('getit_text_req_now')?></a>
+  <?php if(isset($db_fallback_link) && !empty($db_fallback_link)):?>
+    <br>
+    <?=$this->externalLink($db_fallback_link, $db_fallback_text);?>
+  <?php endif;?>
+<?php endif;?>
+
diff --git a/themes/fid_bbi/templates/myresearch/databases.phtml b/themes/fid_bbi/templates/myresearch/databases.phtml
index ce43abf69c8..eb6f441f304 100644
--- a/themes/fid_bbi/templates/myresearch/databases.phtml
+++ b/themes/fid_bbi/templates/myresearch/databases.phtml
@@ -15,7 +15,7 @@
 $this->headTitle($this->translate('dbis_licenses_name'));
 
 $lang = $this->layout()->userLang;
-$page = "database-addon"
+$page = "database-addon";
 ?>
 <h1><?=$this->translate('dbis_licenses_name')?></h1>
 
-- 
GitLab