From c24196109354a551690831d45530188cd26f1152 Mon Sep 17 00:00:00 2001
From: Alexander Purr <purr@ub.uni-leipzig.de>
Date: Mon, 9 Nov 2020 13:27:52 +0100
Subject: [PATCH] refs #18436 [fid_adlr] move getItBox notice into a separate
 template

* add new translations
---
 fid_adlr/languages/de.ini                        |  2 ++
 fid_adlr/languages/en.ini                        |  2 ++
 .../templates/RecordTab/acquisitionpda.phtml     |  5 +----
 .../templates/RecordTab/holdingsils.phtml        |  9 +++------
 .../fid_adlr/templates/get-it-box/notice.phtml   | 16 ++++++++++++++++
 5 files changed, 24 insertions(+), 10 deletions(-)
 create mode 100644 themes/fid_adlr/templates/get-it-box/notice.phtml

diff --git a/fid_adlr/languages/de.ini b/fid_adlr/languages/de.ini
index 735cf4654bc..2cf33481506 100644
--- a/fid_adlr/languages/de.ini
+++ b/fid_adlr/languages/de.ini
@@ -105,6 +105,8 @@ getit_text_10 = "Weitere Informationen sehen Sie, wenn Sie angemeldet sind.<br /
 getit_text_11 = "Dieser Titel ist ein mehrbändiges Werk. Einzeltitel sind unter "%%hierarchy_tree%%" aufgeführt."
 getit_text_12 = "Bestellen Sie ein Leihexemplar dieser Neuerscheinung auf Kosten von adlr.link. Das Buch wird direkt an Sie geschickt.<br/><br/>"
 getit_text_13 = "Dieses E-Book ist für Sie über eine adlr.link-Lizenz freigeschaltet."
+getit_text_13b_1 = "Ihr Konto ist für einen Zugriff auf diese Ressource zurzeit gesperrt. Bitte nehmen Sie mit uns %s auf, um eine Entsperrung vorzunehmen."
+getit_text_13b_2 = "Kontakt"
 getit_text_14 = "Einige Medientypen (wie z. B. Manuskripte, Schallplatten, CDs, Videos) können von der Fernleihe ausgeschlossen sein."
 getit_text_15 = "Wenn dieses E-Book bei Ihrer Heimatbibliothek als vorhanden gekennzeichnet ist, sollte der direkte Zugang über den obigen Link ohne weiteres möglich sein."
 
diff --git a/fid_adlr/languages/en.ini b/fid_adlr/languages/en.ini
index fcbae71fca5..262baca883f 100644
--- a/fid_adlr/languages/en.ini
+++ b/fid_adlr/languages/en.ini
@@ -102,6 +102,8 @@ getit_text_10 = "You will see more information when you are logged in.<br/><br/>
 getit_text_11 = "This title is a multi-volume work. Individual titles are listed under "%%hierarchy_tree%%"."
 getit_text_12 = "Order a loan copy of this new publication at the expense of adlr.link. The book will be sent directly to you.<br/><br/>"
 getit_text_13 = "This e-book is free to access for you via an adlr.link license."
+getit_text_13b_1 = "Your account is currently blocked for access to this resource. Please %s us to request an unblocking."
+getit_text_13b_2 = "contact"
 getit_text_14 = "Some media types (e.g. manuscripts, records, CDs, videos) may be excluded from interlibrary loan."
 getit_text_15 = "If this e-book is marked as available in your home library, you should be able to access it directly via the link above."
 
diff --git a/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml b/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml
index 4b2659bee88..402670746fc 100644
--- a/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml
+++ b/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml
@@ -63,10 +63,7 @@ $isRecordOrdered = $this->getit($this->driver)->isRecordOrdered();
 
 <?php if (!empty($getitConfig['notice']) && !$isRecordOrdered): ?>
   <div class="getitbox-notices">
-      <?php
-      $url = '<a href="'.$this->url('myresearch-account').'?auth_method='.$account->getAuthMethod().'" target="_blank" data-lightbox>'.$this->transEsc('getit_text_3_2').'</a>';
-      ?>
-      <?=sprintf($getitConfig['notice'], $url)?>
+      <?= $this->render('get-it-box/notice.phtml', compact('getitConfig', 'account')); ?>
       <?php if ($user && !empty($this->driver->getDeliveryStatus())): ?>
           <?=$this->transEsc('getit_availability')?>: <?=$this->driver->getDeliveryStatus()?>
       <?php endif; ?>
diff --git a/themes/fid_adlr/templates/RecordTab/holdingsils.phtml b/themes/fid_adlr/templates/RecordTab/holdingsils.phtml
index 41dc233596d..b7983c30fa6 100644
--- a/themes/fid_adlr/templates/RecordTab/holdingsils.phtml
+++ b/themes/fid_adlr/templates/RecordTab/holdingsils.phtml
@@ -117,15 +117,12 @@ JS;
 
     <?php if ($user && $getitConfig['bossData']): ?>
       <div class="boss-data-false"></div>
-<?php if (!$getitConfig['hideNotice']): ?><br/><?php endif; ?>
+      <?php if (!$getitConfig['hideNotice']): ?><br/><?php endif; ?>
     <?php endif; ?>
 
-    <?php
-    $url = '<a href="'.$this->url('myresearch-account').'?auth_method='.$account->getAuthMethod().'" target="_blank" data-lightbox>'.$this->transEsc('getit_text_3_2').'</a>';
-    ?>
     <?php if ($getitConfig['hideNotice']): ?><div class="boss-notice"><?php endif; ?>
-        <?=sprintf($getitConfig['notice'], $url)?>
-        <?php if ($getitConfig['hideNotice']): ?></div><?php endif; ?>
+    <?= $this->render('get-it-box/notice.phtml', compact('getitConfig', 'account')); ?>
+    <?php if ($getitConfig['hideNotice']): ?></div><?php endif; ?>
 </div>
 <?php elseif (!$getitConfig['isAiSidRecord']): ?>
 <div class="getitbox-notices resolver">
diff --git a/themes/fid_adlr/templates/get-it-box/notice.phtml b/themes/fid_adlr/templates/get-it-box/notice.phtml
new file mode 100644
index 00000000000..1aae85a596a
--- /dev/null
+++ b/themes/fid_adlr/templates/get-it-box/notice.phtml
@@ -0,0 +1,16 @@
+<!-- fid_adlr: get-it-box - notice -->
+<?php if(empty($getitConfig['noticeLinkType'])): ?>
+    <?= $getitConfig['notice'] ?>
+<?php else:
+    switch ($getitConfig['noticeLinkType']) {
+        case "register":
+            $url = '<a href="'.$this->url('myresearch-account').'?auth_method='.$account->getAuthMethod().'" target="_blank" data-lightbox>'.$this->transEsc('getit_text_3_2').'</a>';
+            break;
+        case "contact":
+            $url = '<a href="'.$this->url('feedback-home').'" target="_blank" data-lightbox>'.$this->transEsc('getit_text_13b_2').'</a>';
+            break;
+    }
+?>
+    <?=sprintf($getitConfig['notice'], $url)?>
+<?php endif; ?>
+<!-- fid_adlr: get-it-box - notice - END -->
\ No newline at end of file
-- 
GitLab