From 1822e2a8bb646d4576f2aad413d6e6f221263c79 Mon Sep 17 00:00:00 2001
From: Vaclav Rosecky <xrosecky@gmail.com>
Date: Tue, 13 Aug 2013 09:05:02 +0200
Subject: [PATCH] use default patron id for getHolding when user is not logged
 in

---
 config/vufind/Aleph.ini                       | 4 ++++
 module/VuFind/src/VuFind/ILS/Driver/Aleph.php | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/config/vufind/Aleph.ini b/config/vufind/Aleph.ini
index c70181f6d08..7e81c375520 100644
--- a/config/vufind/Aleph.ini
+++ b/config/vufind/Aleph.ini
@@ -46,6 +46,10 @@ quick_availability = true
 ; Comma-separated list of pickup locations sorted by preference
 preferred_pick_up_locations = "PICK1,PICK2"
 
+; default patron id that will be used to decide if an item is available for loan
+; when user is not logged in, optional
+default_patron_id  = PATRON_ID
+
 ; adm-lib / sub-library array
 ; This is a list of patron home libraries and the ADM the library belongs to
 [sublibadm]
diff --git a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
index a1ffe29a20f..c0a74128bde 100644
--- a/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
+++ b/module/VuFind/src/VuFind/ILS/Driver/Aleph.php
@@ -453,6 +453,9 @@ class Aleph extends AbstractBase implements \Zend\Log\LoggerAwareInterface,
                 ',', $this->config['Catalog']['preferred_pick_up_locations']
             );
         }
+        if (isset($this->config['Catalog']['default_patron_id'])) {
+            $this->defaultPatronId = $this->config['Catalog']['default_patron_id'];
+        }
     }
 
     /**
@@ -751,6 +754,8 @@ class Aleph extends AbstractBase implements \Zend\Log\LoggerAwareInterface,
         $params = array('view' => 'full');
         if ($patron) {
             $params['patron'] = $patron['id'];
+        } else if (isset($this->defaultPatronId)) {
+            $params['patron'] = $this->defaultPatronId;
         }
         try {
             $xml = $this->doRestDLFRequest(
-- 
GitLab