Bugzilla – Attachment 97330 Details for
Bug 24412
Attach waiting hold to desk
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24412: Attach waiting reserve to desk
Bug-24412-Attach-waiting-reserve-to-desk.patch (text/plain), 14.22 KB, created by
Nicolas Legrand
on 2020-01-13 17:26:21 UTC
(
hide
)
Description:
Bug 24412: Attach waiting reserve to desk
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2020-01-13 17:26:21 UTC
Size:
14.22 KB
patch
obsolete
>From 56f995ebb9c94b2faa6ffced9fb7a93caaa7b614 Mon Sep 17 00:00:00 2001 >From: Nicolas Legrand <nicolas.legrand@bulac.fr> >Date: Mon, 13 Jan 2020 17:56:41 +0100 >Subject: [PATCH] Bug 24412: Attach waiting reserve to desk > >When an item is checked in and marked 'Waiting' or already 'Waiting' >and there is a desk attached to the session, the item is marked >waiting at the current desk of the current library. > >The information is displayed on the OPAC and on the intranet. The >patron can then know at which desk he can retrieve his document. > >Desk Management (Bug 13881) is now useful. > >Test plan : > >1. apply Bug 13881 and then Bug 24201 >2. $KOHA_PATH/installer/data/mysql/updatedatabase.pl >3. Check out some document to someone >4. make another one reserve this document >5. check in the document >6. you can see the document is attach to the current library >7. create some desks and attach one to your session (see Bug 13881 and >Bug 24201) >8. cancel the preceding reserve and redo steps 3 to 5 >9. you should see the document is waiting at the current library and >current desk on: > 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(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 503771e..1c30631 100644 >--- a/C4/Reserves.pm >+++ b/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 ); >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index e2308db..a4392ae 100644 >--- a/Koha/Hold.pm >+++ b/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 >diff --git a/Koha/Template/Plugin/Desks.pm b/Koha/Template/Plugin/Desks.pm >index 75c1d4f..ee76b17 100644 >--- a/Koha/Template/Plugin/Desks.pm >+++ b/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 { >diff --git a/circ/returns.pl b/circ/returns.pl >index a9e2bc2..29781df 100755 >--- a/circ/returns.pl >+++ b/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 ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 6e66ffe..2da82f7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -1,4 +1,5 @@ > [% USE Koha %] >+[% USE Desks %] > <table> > <tr> > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >@@ -119,7 +120,7 @@ > [% IF ( hold.found ) %] > [% IF ( hold.atdestination ) %] > [% IF ( hold.found ) %] >- Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %] >+ Item waiting at <b> [% hold.wbrname | html %]</b>[% IF hold.desk_name %], [% hold.desk_name %],[% END %] <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %] > [% ELSE %] > Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc >index f8a3045..5e1921b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc >@@ -1,4 +1,5 @@ > [% USE ItemTypes %] >+[% USE Desks %] > [% USE AuthorisedValues %] > <table id="[% table_name | html %]"> > <thead> >@@ -38,7 +39,7 @@ > [% END %] > </td> > <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td> >- <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %]</td> >+ <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id ) %], [% Desks.GetName (reserveloo.desk_id) %][% END %]</td> > <td>[% AuthorisedValues.GetByCode('LOC', reserveloo.item.location) | html %]</td> > <td>[% reserveloo.item.itemcallnumber | html %]</td> > <td>[% reserveloo.item.copynumber | html %]</td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index a569a45..7a55e0f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 2981888..9c9d8d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/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 @@ > > <div class="modal-footer"> > <input type="hidden" name="cancel_reserve" value="0" /> >- >- <button type="submit" class="btn btn-default approve" data-dismiss="modal"> >+ <button type="submit" class="btn btn-default approve" [% IF (Desks.defined) %]data-dismiss="modal" [% END %]> > <i class="fa fa-check"></i> Confirm hold > </button> > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js >index 925b38b..af629a8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js >@@ -158,9 +158,15 @@ $(document).ready(function() { > > if ( oObj.waiting_here ) { > data += ITEM_IS_WAITING_HERE; >+ if (oObj.desk_name) { >+ data += ", " + AT.format( oObj.desk_name ); >+ } > } else { > data += ITEM_IS_WAITING; >- data += " " + AT.format( oObj.waiting_at ); >+ data += AT.format( oObj.waiting_at ); >+ if (oObj.desk_name) { >+ data += ", " + AT.format( oObj.desk_name ); >+ } > } > > } else if ( oObj.transferred ) { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >index 3c5ea15..356d1fd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >@@ -1,4 +1,5 @@ > [% USE Branches %] >+[% USE Desks %] > [% USE ItemTypes %] > [% USE KohaDates %] > >@@ -105,7 +106,7 @@ > <i class="fa fa-exclamation-circle text-warning"></i> > [% IF ( HOLD.is_at_destination ) %] > [% IF ( HOLD.found ) %] >- Item waiting at <b> [% HOLD.branch.branchname | html %]</b> >+ Item waiting at <b> [% HOLD.branch.branchname | html %]</b>[% IF ( HOLD.desk_id ) %], [% Desks.GetName ( HOLD.desk_id ) %],[% END %] > [% IF ( HOLD.waitingdate ) %] > since [% HOLD.waitingdate | $KohaDates %] > [% IF HOLD.expirationdate %] >diff --git a/reserve/request.pl b/reserve/request.pl >index c7376c2..9e86f12 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -650,6 +650,7 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{'wbrcode'} = $res->branchcode(); > $reserve{'itemnumber'} = $res->itemnumber(); > $reserve{'wbrname'} = $res->branch()->branchname(); >+ $reserve{'desk_name'} = $res->desk()->desk_name(); > > if ( $reserve{'holdingbranch'} eq $reserve{'wbrcode'} ) { > >diff --git a/svc/holds b/svc/holds >index 55aa3a6..aa094bc 100755 >--- a/svc/holds >+++ b/svc/holds >@@ -98,6 +98,7 @@ while ( my $h = $holds_rs->next() ) { > reserve_id => $h->reserve_id(), > branchcode => $h->branch()->branchname(), > branches => $libraries, >+ desk_name => $h->desk()->desk_name(), > reservedate => $h->reservedate(), > expirationdate => $h->expirationdate(), > suspend => $h->suspend(), >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24412
:
97328
|
97329
|
97330
|
101625
|
101626
|
101627
|
101628
|
101629
|
101630
|
101721
|
101722
|
101723
|
101825
|
101884
|
101885
|
101886
|
101898
|
101899
|
101900
|
101955
|
101956
|
101957
|
106586
|
106648
|
110067
|
110068
|
110069
|
110070
|
110450
|
110451
|
110452
|
110453
|
110454
|
110455
|
110582
|
110583
|
110584
|
110585
|
110586
|
112046
|
112047
|
112048
|
112049
|
112050
|
112092
|
112099
|
112165
|
112166
|
112167
|
112168
|
112169
|
112170
|
112171
|
112172
|
112201
|
112202
|
112203
|
112204
|
112205
|
112206
|
112207
|
112208
|
112209
|
112210
|
112211
|
112212
|
112213
|
112214
|
112215
|
112216
|
112217
|
112218
|
112219
|
112264
|
112265
|
112266
|
112267
|
112268
|
112269
|
112270
|
112271
|
112272
|
112292
|
112293
|
113108
|
113109
|
113116
|
113228
|
113229
|
113230
|
113231
|
113232
|
113233
|
113234
|
113235
|
113236