From d8d8074b59fd4f707405118f2edb6039ce932ae2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Lahmann?= <lahmann@ub.uni-leipzig.de>
Date: Wed, 26 Oct 2016 16:38:28 +0200
Subject: [PATCH] refs #8959: * changed getAdditionalFeeData to always map
 fee.about to vufind.fee.title

---
 module/finc/src/finc/ILS/Driver/FincILS.php | 33 +++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php
index e2c75cf9a7b..5519ef758ab 100644
--- a/module/finc/src/finc/ILS/Driver/FincILS.php
+++ b/module/finc/src/finc/ILS/Driver/FincILS.php
@@ -443,6 +443,39 @@ class FincILS extends PAIA implements LoggerAwareInterface
      * Custom PAIA methods
      *********************************************/
 
+    /**
+     * Gets additional array fields for the item.
+     * Override this method in your custom PAIA driver if necessary.
+     *
+     * @param array $fee The fee array from PAIA
+     *
+     * @return array Additional fee data for the item
+     */
+    protected function getAdditionalFeeData($fee, $patron = null)
+    {
+        $additionalData = [];
+        // The title is always displayed to the user in fines view if no record can
+        // be found for current fee. So always populate the title with content of
+        // about field.
+        if (isset($fee['about'])) {
+            $additionalData['title'] = $fee['about'];
+        }
+
+        // custom PAIA fields
+        // fee.about 	0..1 	string 	textual information about the fee
+        // fee.item 	0..1 	URI 	item that caused the fee
+        // fee.feeid 	0..1 	URI 	URI of the type of service that
+        // caused the fee
+        $additionalData['feeid']      = (isset($fee['feeid'])
+            ? $fee['feeid'] : null);
+        $additionalData['about']      = (isset($fee['about'])
+            ? $fee['about'] : null);
+        $additionalData['item']       = (isset($fee['item'])
+            ? $fee['item'] : null);
+
+        return $additionalData;
+    }
+
     /**
      * Patron Login
      *
-- 
GitLab