diff --git a/config/vufind/Voyager.ini b/config/vufind/Voyager.ini index c911a165470716a7f38f1968b010f13e46d472ea..fac3b6b4c0928a62ade9b3c967290d7d89209a4f 100644 --- a/config/vufind/Voyager.ini +++ b/config/vufind/Voyager.ini @@ -91,6 +91,11 @@ login_field = LAST_NAME ; Uncomment this line to display the location where each loan was made ;display_borrowing_location = true +; Colon-separated list of loan intervals for which to display the time part of the +; due date. By default the time is always displayed. Normal interval types are +; H (hours), D (days) and T (term). +;display_due_time_only_for_intervals = H:D + ; This regular expression controls which status messages are displayed on the ; Checked Out Items list. show_statuses = "/lost|missing|claim/i" diff --git a/config/vufind/VoyagerRestful.ini b/config/vufind/VoyagerRestful.ini index 06beb4dc90bcbccde11f240dd47268a28a6dc913..ea1727d1488f5fc451e5e12df18e5e0ca5c31e34 100644 --- a/config/vufind/VoyagerRestful.ini +++ b/config/vufind/VoyagerRestful.ini @@ -299,6 +299,11 @@ disableAvailabilityCheckForRequestGroups = "15:19:21:32" ; Uncomment this line to display the location where each loan was made ;display_borrowing_location = true +; Colon-separated list of loan intervals for which to display the time part of the +; due date. By default the time is always displayed. Normal interval types are +; H (hours), D (days) and T (term). +;display_due_time_only_for_intervals = H:D + ; This regular expression controls which status messages are displayed on the ; Checked Out Items list. show_statuses = "/lost|missing|claim/i" diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php index 4f915b741354db7099eb4ccf36ad8759889c4deb..def6f4d681bd2a277765340b623bf12c1ec1d24e 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php @@ -90,6 +90,13 @@ class Voyager extends AbstractBase */ protected $useHoldingsSortGroups; + /** + * Loan interval types for which to display the due time (empty = all) + * + * @var array + */ + protected $displayDueTimeIntervals; + /** * Constructor * @@ -141,6 +148,12 @@ class Voyager extends AbstractBase $this->useHoldingsSortGroups = isset($this->config['Holdings']['use_sort_groups']) ? $this->config['Holdings']['use_sort_groups'] : true; + + $this->displayDueTimeIntervals + = isset($this->config['Loans']['display_due_time_only_for_intervals']) + ? explode( + ':', $this->config['Loans']['display_due_time_only_for_intervals'] + ) : []; } /** @@ -1310,7 +1323,8 @@ EOT; . "WITHIN GROUP (ORDER BY ITEM_STATUS_DESC) as status", "MAX(CIRC_TRANSACTIONS.RENEWAL_COUNT) AS RENEWAL_COUNT", "MAX(CIRC_POLICY_MATRIX.RENEWAL_COUNT) as RENEWAL_LIMIT", - "MAX(LOCATION.LOCATION_DISPLAY_NAME) as BORROWING_LOCATION" + "MAX(LOCATION.LOCATION_DISPLAY_NAME) as BORROWING_LOCATION", + "MAX(CIRC_POLICY_MATRIX.LOAN_INTERVAL) as LOAN_INTERVAL" ]; // From @@ -1420,7 +1434,6 @@ EOT; 'id' => $sqlRow['BIB_ID'], 'item_id' => $sqlRow['ITEM_ID'], 'duedate' => $dueDate, - 'dueTime' => $dueTime, 'dueStatus' => $dueStatus, 'volume' => str_replace("v.", "", utf8_encode($sqlRow['ITEM_ENUM'])), 'publication_year' => $sqlRow['YEAR'], @@ -1431,6 +1444,12 @@ EOT; 'message' => $this->pickTransactionStatus(explode(chr(9), $sqlRow['STATUS'])), ]; + // Display due time only if loan interval is not in days if configured + if (empty($this->displayDueTimeIntervals) + || in_array($sqlRow['LOAN_INTERVAL'], $this->displayDueTimeIntervals) + ) { + $transaction['dueTime'] = $dueTime; + } if (isset($this->config['Loans']['display_borrowing_location']) && $this->config['Loans']['display_borrowing_location'] ) {