File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
Koha/Plugin/Fi/KohaSuomi/DI
openapi/definitions/availability Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -567,5 +567,18 @@ sub _pickup_location_allowed {
567567 return $context_cache -> {items_available_by_location }-> {$location } ? 0 : 1;
568568}
569569
570+ =head3 recalled
571+
572+ Returns Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item::Recalled if item has been recalled.
573+
574+ =cut
575+
576+ sub recalled {
577+ my ($self ) = @_ ;
578+
579+ if ($self -> item-> recall) {
580+ return Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item::Recalled-> new;
581+ }
582+ }
570583
5715841;
Original file line number Diff line number Diff line change @@ -87,6 +87,10 @@ use Exception::Class (
8787 ' Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item::Withdrawn' => {
8888 isa => ' Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item' ,
8989 description => " Item is marked as withdrawn." ,
90+ },
91+ ' Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item::Recalled' => {
92+ isa => ' Koha::Plugin::Fi::KohaSuomi::DI::Koha::Exceptions::Item' ,
93+ description => " Item has been recalled." ,
9094 }
9195
9296);
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package Koha::Plugin::Fi::KohaSuomi::DI::Koha::Item::Availability::Search;
1919# along with Koha; if not, see <http://www.gnu.org/licenses>.
2020
2121use Modern::Perl;
22+ use C4::Context;
2223
2324use base qw( Koha::Plugin::Fi::KohaSuomi::DI::Koha::Item::Availability) ;
2425
@@ -58,6 +59,9 @@ sub in_opac {
5859 if (!$params -> {' ignore_transfer' }) {
5960 $self -> unavailable($reason ) if $reason = $itemcalc -> transfer;
6061 }
62+ if (C4::Context-> preference(' UseRecalls' )) {
63+ $self -> unavailable($reason ) if $reason = $itemcalc -> recalled;
64+ }
6165
6266 return $self ;
6367}
Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ properties:
281281 - integer
282282 - " null"
283283 type : object
284+ Item::Recalled :
285+ description : Item has been recalled.
286+ properties : {}
287+ type : object
284288 Patron::AgeRestricted :
285289 description : An age restriction applies for this patron.
286290 properties :
You can’t perform that action at this time.
0 commit comments