Skip to content
Snippets Groups Projects
Commit e05d4568 authored by Ere Maijala's avatar Ere Maijala Committed by Robert Lange
Browse files

KohaRest: Add support for mapping different "Lost" statuses. (#1771)

parent 78b87f13
Branches
Tags
No related merge requests found
...@@ -89,11 +89,12 @@ acceptTermsText = "I accept the terms in any language." ...@@ -89,11 +89,12 @@ acceptTermsText = "I accept the terms in any language."
; VuFind item statuses ; VuFind item statuses
[ItemStatusMappings] [ItemStatusMappings]
;Item::Held = "Held" ;Item::Held = "Held"
; Custom "Not For Loan" statuses can be mapped by appending the authorized value to ; "Not For Loan" or "Lost" statuses can be mapped by appending the authorized value
; the status key like this (first one is negative authorized value, second one is ; to the status key like this (first one is a negative authorized value, next ones
; positive): ; are positive):
;Item::NotForLoan-1 = "Ordered" ;Item::NotForLoan-1 = "Ordered"
;Item::NotForLoan4 = "At Bindery" ;Item::NotForLoan4 = "At Bindery"
;Item::Lost4 = "Lost--Library Applied"
; Also "Not For Loan" item types can be mapped by appending the authorized value to ; Also "Not For Loan" item types can be mapped by appending the authorized value to
; the status key like this: ; the status key like this:
;ItemType::NotForLoan1 = "Reference Desk" ;ItemType::NotForLoan1 = "Reference Desk"
......
...@@ -182,7 +182,6 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements ...@@ -182,7 +182,6 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements
*/ */
protected $itemStatusMappings = [ protected $itemStatusMappings = [
'Item::Held' => 'On Hold', 'Item::Held' => 'On Hold',
'Item::Lost' => 'Lost--Library Applied',
'Item::Waiting' => 'On Holdshelf', 'Item::Waiting' => 'On Holdshelf',
]; ];
...@@ -194,10 +193,11 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements ...@@ -194,10 +193,11 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements
*/ */
protected $itemStatusMappingMethods = [ protected $itemStatusMappingMethods = [
'Item::CheckedOut' => 'getStatusCodeItemCheckedOut', 'Item::CheckedOut' => 'getStatusCodeItemCheckedOut',
'Item::NotForLoan' => 'getStatusCodeItemNotForLoan', 'Item::Lost' => 'getStatusCodeItemNotForLoanOrLost',
'Item::NotForLoanForcing' => 'getStatusCodeItemNotForLoan', 'Item::NotForLoan' => 'getStatusCodeItemNotForLoanOrLost',
'Item::NotForLoanForcing' => 'getStatusCodeItemNotForLoanOrLost',
'Item::Transfer' => 'getStatusCodeItemTransfer', 'Item::Transfer' => 'getStatusCodeItemTransfer',
'ItemType::NotForLoan' => 'getStatusCodeItemNotForLoan', 'ItemType::NotForLoan' => 'getStatusCodeItemNotForLoanOrLost',
]; ];
/** /**
...@@ -1823,7 +1823,7 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements ...@@ -1823,7 +1823,7 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements
} }
/** /**
* Get item status code for NotForLoan status * Get item status code for NotForLoan or Lost status
* *
* @param string $code Status code * @param string $code Status code
* @param array $data Status data * @param array $data Status data
...@@ -1833,9 +1833,9 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements ...@@ -1833,9 +1833,9 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements
* *
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function getStatusCodeItemNotForLoan($code, $data, $item) protected function getStatusCodeItemNotForLoanOrLost($code, $data, $item)
{ {
// NotForLoan is special: status has a library-specific // NotForLoan and Lost are special: status has a library-specific
// status number. Allow mapping of different status numbers // status number. Allow mapping of different status numbers
// separately (e.g. Item::NotForLoan with status number 4 // separately (e.g. Item::NotForLoan with status number 4
// is mapped with key Item::NotForLoan4): // is mapped with key Item::NotForLoan4):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment