From 82937dc59ba80f10b56ddb0a5a5ab279e6be4144 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Thu, 24 Oct 2019 09:41:26 +0200
Subject: [PATCH] refs #16223 [fid_adlr] book orders in user menu

* adds book orders entry in profile side menu
* some code cleanup due to unused functionality
---
 .../fid_adlr/templates/myresearch/menu.phtml  | 56 ++-----------------
 1 file changed, 4 insertions(+), 52 deletions(-)

diff --git a/themes/fid_adlr/templates/myresearch/menu.phtml b/themes/fid_adlr/templates/myresearch/menu.phtml
index 8dac0d52427..30b2667c0da 100644
--- a/themes/fid_adlr/templates/myresearch/menu.phtml
+++ b/themes/fid_adlr/templates/myresearch/menu.phtml
@@ -13,8 +13,6 @@
 <!-- fid-adlr myresearch - menu -->
 <?php
   $user = $this->auth()->isLoggedIn();
-  $patron = $user ? $this->auth()->getILSPatron() : false;
-  $capabilityParams = $patron ? ['patron' => $patron] : [];
 ?>
 <?php /* Offcanvas closing button missing in BS3! CK*/ ?>
 <button class="close-offcanvas btn btn-link" data-toggle="offcanvas"><?=$this->transEsc('navigate_back') ?></button>
@@ -23,76 +21,35 @@
   <h4><?=$this->transEsc('Your Account')?></h4>
   <div class="myresearch-menu account-menu">
     <?php if ('ils-none' !== $this->ils()->getOfflineMode()): ?>
-      <?php if ($this->ils()->checkCapability('getMyTransactions', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-checkedout')?>" class="flex checkedout<?=$this->active == 'checkedout' ? ' active' : ''?>">
-          <span class="flex-col"><i class="fa fa-fw fa-book" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Checked Out Items')?></span>
-          <span class="checkedout-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
-        </a>
-      <?php endif; ?>
-      <?php if ($this->ils()->checkFunction('getMyTransactionHistory', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active"' : ''?>>
-          <i class="fa fa-fw fa-history" aria-hidden="true"></i> <?=$this->transEsc('Loan History')?>
-        </a>
-      <?php endif; ?>
-      <?php if ($this->ils()->checkCapability('getMyHolds', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>">
-          <span class="flex-col"><i class="fa fa-fw fa-flag" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Holds and Recalls')?></span>
-          <span class="holds-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
-        </a>
-      <?php endif; ?>
-      <?php if ($this->ils()->checkFunction('StorageRetrievalRequests', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>">
-          <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>
-        </a>
-      <?php endif; ?>
-      <?php if ($this->ils()->checkFunction('ILLRequests', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>">
-          <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>
-        </a>
-      <?php endif; ?>
-      <?php if ($this->ils()->checkCapability('getMyFines', $capabilityParams)): ?>
-        <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>">
-          <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Fines')?></span>
-          <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
-        </a>
-      <?php endif; ?>
       <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?>>
         <i class="icon icon-user" aria-hidden="true"></i>
         <?=$this->transEsc('Profile')?>
       </a>
 
       <?php /* refs #15480 add password change to fid profile */ ?>
-      <?php if ($this->auth()->isLoggedIn()): ?>
+
         <a href="<?=$this->url('fid/user/reset-password')?>" data-lightbox>
           <span class="no-padding">
             <i class="icon icon-lock" aria-hidden="true"></i>
           </span>
           <?=$this->transEsc('Change Password')?>
         </a>
-      <? endif; ?>
 
-      <?php if ($this->auth()->isLoggedIn()): ?>
         <a href="<?=$this->url('fid/user/change-username')?>" data-lightbox>
           <span class="no-padding">
             <i class="icon icon-edit-3" aria-hidden="true"></i>
           </span>
           <?=$this->transEsc('fid::username_change_link')?>
         </a>
-      <? endif; ?>
 
       <?php /* refs #16033 contact link */ ?>
-      <?php if ($this->auth()->isLoggedIn()): ?>
         <a data-lightbox>
           <span class="no-padding">
             <i class="icon icon-mail" aria-hidden="true"></i>
           </span>
           <?=$this->transEsc('contact_adlr')?>
         </a>
-      <? endif; ?>
 
-      <?php if ($user = $this->auth()->isLoggedIn()): ?>
         <span class="logout-button">
           <a href="<?=$this->url('myresearch-logout')?>">
             <span class="no-padding">
@@ -101,9 +58,8 @@
             <?=$this->transEsc("Logout")?>
           </a>
         </span>
-      <? endif; ?>
 
-      <?php if ($user && $user->libraryCardsEnabled()): ?>
+      <?php if ($user->libraryCardsEnabled()): ?>
         <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?>>
           <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?>
         </a>
@@ -112,7 +68,7 @@
   </div>
 
   <br />
-  <?php if ($user && $this->userlist()->getMode() !== 'disabled'): ?>
+  <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
     <h4><?=$this->transEsc('Your Lists')?></h4>
 
     <div class="myresearch-menu">
@@ -139,14 +95,12 @@
       <?php endif; ?>
 
       <?php /* refs #16033 order list page link */ ?>
-      <?php if ($this->auth()->isLoggedIn()): ?>
-        <a data-lightbox>
+        <a data-lightbox href="<?=$this->url('fid/user/orders')?>">
           <span class="no-padding">
             <i class="icon icon-package" aria-hidden="true"></i>
           </span>
           <?=$this->transEsc('Your Orders')?>
         </a>
-      <? endif; ?>
 
       <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?>
         <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?>>
@@ -155,14 +109,12 @@
       <?php endif; ?>
 
       <?php /* refs #16033 new print publications page link */ ?>
-      <?php if ($this->auth()->isLoggedIn()): ?>
         <a data-lightbox>
           <span class="no-padding">
             <i class="icon icon-book" aria-hidden="true"></i>
           </span>
           <?=$this->transEsc('new_print_publications')?>
         </a>
-      <? endif; ?>
     </div>
   <?php endif ?>
 
-- 
GitLab