@@ -, +, @@ a. the intranet document request page b. the intranet borrower holds tab c. the item list where the document is listed on the bibliographic details d. the borrower's OPAC holds tab. --- C4/Reserves.pm | 6 +++--- Koha/Hold.pm | 19 ++++++++++++++++++- Koha/Template/Plugin/Desks.pm | 4 ++-- circ/returns.pl | 5 +++-- .../intranet-tmpl/prog/en/includes/holds_table.inc | 3 ++- .../intranet-tmpl/prog/en/includes/waiting_holds.inc | 3 ++- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 3 ++- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/holds.js | 8 +++++++- .../opac-tmpl/bootstrap/en/includes/holds-table.inc | 3 ++- reserve/request.pl | 1 + svc/holds | 1 + 12 files changed, 45 insertions(+), 15 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -1076,7 +1076,7 @@ sub ModReserveStatus { =head2 ModReserveAffect - &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id); + &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend,$reserve_id, $desk); This function affect an item and a status for a given reserve, either fetched directly by record_id, or by borrowernumber and itemnumber or biblionumber. If only biblionumber @@ -1090,7 +1090,7 @@ take care of the waiting status =cut sub ModReserveAffect { - my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id ) = @_; + my ( $itemnumber, $borrowernumber, $transferToDo, $reserve_id, $desk_id ) = @_; my $dbh = C4::Context->dbh; # we want to attach $itemnumber to $borrowernumber, find the biblionumber @@ -1115,7 +1115,7 @@ sub ModReserveAffect { my $already_on_shelf = $hold->found && $hold->found eq 'W'; $hold->itemnumber($itemnumber); - $hold->set_waiting($transferToDo); + $hold->set_waiting($transferToDo, $desk_id); _koha_notify_reserve( $hold->reserve_id ) if ( !$transferToDo && !$already_on_shelf ); --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -156,7 +156,7 @@ sub delete { =cut sub set_waiting { - my ( $self, $transferToDo ) = @_; + my ( $self, $transferToDo, $desk_id ) = @_; $self->priority(0); @@ -169,8 +169,11 @@ sub set_waiting { my $values = { found => 'W', waitingdate => $today->ymd, + desk_id => $desk_id, }; + if (defined $desk_id) { $values->{'desk_id'} = $desk_id }; + my $requested_expiration; if ($self->expirationdate) { $requested_expiration = dt_from_string($self->expirationdate); @@ -310,6 +313,20 @@ sub branch { return $self->{_branch}; } +=head3 desk + +Returns the related Koha::Library object for this Hold + +=cut + +sub desk { + my ($self) = @_; + + $self->{_desk} ||= Koha::Desks->find( $self->desk_id() ); + + return $self->{_desk}; +} + =head3 borrower Returns the related Koha::Patron object for this Hold --- a/Koha/Template/Plugin/Desks.pm +++ a/Koha/Template/Plugin/Desks.pm @@ -28,8 +28,8 @@ use Koha::Desks; sub GetName { my ( $self, $desk_id ) = @_; - my $d = Koha::Desks->search( { desk_id => $desk_id} )->unblessed; - return @$d ? $d->{'desk_name'} : q{}; + my $d = Koha::Desks->find( $desk_id ); + return (defined $d) ? $d->unblessed->{'desk_name'} : q{}; } sub GetLoggedInDeskId { --- a/circ/returns.pl +++ a/circ/returns.pl @@ -75,6 +75,7 @@ if ($session->param('branch') eq 'NO_LIBRARY_SET'){ print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl"); exit; } +my $desk_id = C4::Context->userenv->{"desk_id"} || ''; # Print a reserve slip on this page if ( $query->param('print_slip') ) { @@ -166,7 +167,7 @@ if ( $query->param('reserve_id') ) { my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; # diffBranchSend tells ModReserveAffect whether document is expected in this library or not, # i.e., whether to apply waiting status - ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id ); + ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); } # check if we have other reserves for this document, if we have a return send the message of transfer my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); @@ -423,7 +424,7 @@ if ( $messages->{'ResFound'}) { my $biblio = $item->biblio; my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; - ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id} ); + ModReserveAffect( $reserve->{itemnumber}, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber}); my $patron = Koha::Patrons->find( $nextreservinfo ); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE Desks %] [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] @@ -119,7 +120,7 @@ [% IF ( hold.found ) %] [% IF ( hold.atdestination ) %] [% IF ( hold.found ) %] - Item waiting at [% hold.wbrname | html %] since [% hold.waiting_date | $KohaDates %] + Item waiting at [% hold.wbrname | html %][% IF hold.desk_name %], [% hold.desk_name %],[% END %] since [% hold.waiting_date | $KohaDates %] [% ELSE %] Waiting to be pulled [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc @@ -1,4 +1,5 @@ [% USE ItemTypes %] +[% USE Desks %] [% USE AuthorisedValues %]
@@ -38,7 +39,7 @@ [% END %] - + --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -4,6 +4,7 @@ [% USE KohaDates %] [% USE AuthorisedValues %] [% USE Branches %] +[% USE Desks %] [% USE Biblio %] [% USE ColumnsSettings %] [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] @@ -358,7 +359,7 @@ [% SET hold = item.first_hold %] [% IF hold %] [% IF hold.waitingdate %] - Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %]. + Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) %][% END %] since [% hold.waitingdate | $KohaDates %]. [% ELSIF hold.priority == 1 %] Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( hold.branchcode ) | html %]. [% ELSE %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE KohaDates %] [% USE Branches %] +[% USE Desks %] [% USE Koha %] [% USE Borrowers %] [% USE ItemTypes %] @@ -468,8 +469,7 @@
[% Branches.GetName( reserveloo.item.homebranch ) | html %][% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id ) %], [% Desks.GetName (reserveloo.desk_id) %][% END %] [% AuthorisedValues.GetByCode('LOC', reserveloo.item.location) | html %] [% reserveloo.item.itemcallnumber | html %] [% reserveloo.item.copynumber | html %]