Bugzilla – Attachment 68255 Details for
Bug 19287
Add ability to mark an item 'Lost' from 'Holds to pull' list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19287: Add some feedback messages to the librarian
Bug-19287-Add-some-feedback-messages-to-the-librar.patch (text/plain), 5.95 KB, created by
Jonathan Druart
on 2017-10-18 14:36:36 UTC
(
hide
)
Description:
Bug 19287: Add some feedback messages to the librarian
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-18 14:36:36 UTC
Size:
5.95 KB
patch
obsolete
>From ba901a938926ad04df5d43db85995097fa90d80b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 12 Oct 2017 16:58:17 -0300 >Subject: [PATCH] Bug 19287: Add some feedback messages to the librarian > >Be kind with librarians and give them feedback messages. >--- > circ/waitingreserves.pl | 29 ++++++++++++++++---- > .../prog/en/modules/circ/waitingreserves.tt | 32 ++++++++++++++++++---- > 2 files changed, 49 insertions(+), 12 deletions(-) > >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 6d10a2c5ec..ab28b41d40 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -68,14 +68,17 @@ my $transfer_when_cancel_all = C4::Context->preference('TransferWhenCancelAllWai > $template->param( TransferWhenCancelAllWaitingHolds => 1 ) if $transfer_when_cancel_all; > > my @cancel_result; >+my @messages; >+my $number_of_holds_cancelled; > # if we have a return from the form we cancel the holds > if ( $op eq 'cancel_reserve' and $item) { >- my $res = cancel( $item, $borrowernumber, $fbr, $tbr ); >- push @cancel_result, $res if $res; >+ my $next_res = cancel( $item, $borrowernumber, $fbr, $tbr ); >+ push @cancel_result, $next_res if $next_res; >+ $number_of_holds_cancelled++; > } elsif ( $op =~ m|^mark_as_lost| ) { > my $reserve_id = $input->param('reserve_id'); > my $hold = Koha::Holds->find( $reserve_id ); >- die "wrong reserve_id" unless $hold; >+ die "wrong reserve_id" unless $hold; # This is a bit rude, but we are not supposed to get a wrong reserve_id > if ( C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') =~ m|^yes| ) { > my $itemnumber = $hold->item->itemnumber; > my $patron = $hold->borrower; >@@ -106,12 +109,17 @@ if ( $op eq 'cancel_reserve' and $item) { > from_address => $admin_email_address, > } > ); >+ unless ( C4::Members::GetNoticeEmailAddress( $patron->borrowernumber ) ) { >+ push @messages, {type => 'alert', code => 'no_email_address', }; >+ } >+ push @messages, { type => 'message', code => 'letter_enqueued' }; >+ } else { >+ push @messages, { type => 'error', code => 'no_template_notice' }; > } > } >- my $res = cancel( $itemnumber, $patron->borrowernumber, $fbr, $tbr ); >- push @cancel_result, $res if $res; >+ my $next_res = cancel( $itemnumber, $patron->borrowernumber, $fbr, $tbr ); >+ push @cancel_result, $next_res if $next_res; > }# else the url parameters have been modified and the user is not allowed to continue >- > } > > if ( C4::Context->preference('IndependentBranches') ) { >@@ -182,6 +190,7 @@ foreach my $num (@getreserves) { > if ($op eq 'cancel_all') { > my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); > push @cancel_result, $res if $res; >+ $number_of_holds_cancelled++; > next; > } else { > push @overloop, \%getreserv; >@@ -194,6 +203,13 @@ foreach my $num (@getreserves) { > > } > >+if ( $number_of_holds_cancelled ) { >+ if ( $number_of_holds_cancelled == 1 ) { >+ push @messages, { type => 'message', code => 'hold_cancelled' }; >+ } else { >+ push @messages, { type => 'message', code => 'holds_cancelled' }; >+ } >+} > $template->param(cancel_result => \@cancel_result) if @cancel_result; > $template->param( > reserveloop => \@reservloop, >@@ -203,6 +219,7 @@ $template->param( > show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), > ReservesMaxPickUpDelay => $max_pickup_delay, > tab => $tab, >+ messages => \@messages, > ); > > # Checking if there is a Fast Cataloging Framework >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index a0bc10f13a..397b39c6f4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -40,12 +40,25 @@ > [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %] > <div class="yui-g"> > >- <h2>Holds awaiting pickup for your library on: [% show_date | $KohaDates %] >- [% IF ( all_branches_link ) %] >- <span style="margin-left:20px"><a href="[% all_branches_link %]"> >- View all libraries</a></span> >- [% END %] >- </h2> >+ [% FOR m IN messages %] >+ <div class="dialog [% m.type %]"> >+ [% SWITCH m.code %] >+ [% CASE 'letter_enqueued' %] >+ The notice has been correctly enqueued. >+ [% CASE 'no_email_address' %] >+ The patron does not have an email address defined. >+ [% CASE 'no_template_notice' %] >+ There is no notice template with a code 'CANCEL_HOLD_ON_LOST' defined in your system. >+ [% CASE 'hold_cancelled' %] >+ The hold has been correctly cancelled. >+ [% CASE 'holds_cancelled' %] >+ All the holds has been correctly cancelled.. >+ [% CASE %] >+ [% m.code %] >+ [% END %] >+ </div> >+ [% END %] >+ > [% IF ( cancel_result ) %] > [% FOREACH cancel_result %] > [% IF ( messagetransfert ) %] >@@ -72,6 +85,13 @@ > [% END %] > [% END %] > [% ELSE %] >+ <h2>Holds awaiting pickup for your library on: [% show_date | $KohaDates %] >+ [% IF ( all_branches_link ) %] >+ <span style="margin-left:20px"><a href="[% all_branches_link %]"> >+ View all libraries</a></span> >+ [% END %] >+ </h2> >+ > <div id="resultlist" class="toptabs"> > <ul> > <li><a href="#holdswaiting">Holds waiting: [% reservecount %]</a></li> >-- >2.11.0
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 19287
:
68226
|
68227
|
68228
|
68229
|
68230
|
68251
|
68252
|
68253
|
68254
|
68255
|
68284
|
69746
|
70705
|
70764
|
70918
|
70919
|
73881
|
73882
|
73883
|
73884
|
73885
|
73886
|
73887
|
73888
|
73889
|
74696
|
74697
|
74698
|
74699
|
74700
|
74701
|
74702
|
74703
|
74704
|
74705
|
74749
|
75535