Bugzilla – Attachment 72317 Details for
Bug 19532
Recalls for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19532: Cancel recall and see recalls in OPAC
Bug-19532-Cancel-recall-and-see-recalls-in-OPAC.patch (text/plain), 12.72 KB, created by
Nick Clemens
on 2018-03-01 16:00:42 UTC
(
hide
)
Description:
Bug 19532: Cancel recall and see recalls in OPAC
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-03-01 16:00:42 UTC
Size:
12.72 KB
patch
obsolete
>From e73024391910a347280dc0f738efb27e3a57964c Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 13 Nov 2017 02:22:09 +0000 >Subject: [PATCH] Bug 19532: Cancel recall and see recalls in OPAC > >This patch adds ability for user to cancel a recall >They can also see their recalls in the user summary > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Recall.pm | 43 ++++++++++ > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 93 ++++++++++++++++++++++ > opac/opac-recall.pl | 4 + > opac/opac-user.pl | 8 ++ > 4 files changed, 148 insertions(+) > >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index 596aafa..64779c8 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -41,6 +41,49 @@ sub _type { > return 'Recall'; > } > >+=head3 biblio >+ >+Returns the related Koha::Biblio object for this hold >+ >+=cut >+ >+sub biblio { >+ my ($self) = @_; >+ >+ $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() ); >+ >+ return $self->{_biblio}; >+} >+ >+=head3 item >+ >+Returns the related Koha::Item object for this Hold >+ >+=cut >+ >+sub item { >+ >+ my ($self) = @_; >+ >+ $self->{_item} ||= Koha::Items->find( $self->itemnumber() ); >+ >+ return $self->{_item}; >+} >+ >+=head3 branch >+ >+Returns the related Koha::Library object for this Hold >+ >+=cut >+ >+sub branch { >+ my ($self) = @_; >+ >+ $self->{_branch} ||= Koha::Libraries->find( $self->branchcode() ); >+ >+ return $self->{_branch}; >+} >+ > =head3 is_waiting > > Returns true if recall is awaiting pickup >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 1a5203f..e4528db 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -154,6 +154,7 @@ Using this account is not recommended because some parts of Koha will not functi > [% END %] > > [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %] >+ [% IF ( RECALLS.count ) %]<li><a href="#opac-user-recalls">Recalls ([% RECALLS.count %])</a></li>[% END %] > [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% borrower.article_requests_current.count %])</a></li>[% END %] > [% IF ( OverDriveCirculation ) %] > <li><a href="#opac-user-overdrive">OverDrive Account</a></li> >@@ -239,6 +240,7 @@ Using this account is not recommended because some parts of Koha will not functi > <td class="title"> > <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber %]">[% ISSUE.title |html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield %][% END %]</a> > [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %] >+ [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %] > </td> > > <td class="author">[% ISSUE.author %]</td> >@@ -776,6 +778,92 @@ Using this account is not recommended because some parts of Koha will not functi > </div> <!-- / #opac-user-holds --> > [% END # / #RESERVES.count %] > >+ [% IF RECALLS.count %] >+ <div id="opac-user-recalls"> >+ <table id="recalls-table" class="table table-bordered table-striped"> >+ <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption> >+ <thead> >+ <tr> >+ <th class="anti-the">Title</th> >+ <th class="psort title-string">Placed on</th> >+ <th class="title-string">Expires on</th> >+ <th>Pick up location</th> >+ <th>Status</th> >+ <th>Cancel</th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH RECALL IN RECALLS %] >+ <td class="title"> >+ <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]"> >+ [% RECALL.biblio.title %] >+ [% FOREACH s IN RECALL.biblio.subtitles %] >+ [% s %] >+ [% END %] >+ [% RECALL.item.enumchron %] >+ </a> >+ [% RECALL.biblio.author %] >+ </td> >+ <td class="recalldate"> >+ <span title="[% RECALL.recalldate %]"> >+ <span class="tdlabel">Recall date:</span> >+ [% RECALL.recalldate | $KohaDates %] >+ </span> >+ </td> >+ <td class="expirationdate"> >+ [% IF ( RECALL.is_waiting ) %] >+ [% IF ( RECALL.expirationdate ) %] >+ <span title="[% RECALL.expirationdate %]"> >+ <span class="tdlabel">Expiration:</span> >+ [% RECALL.expirationdate | $KohaDates %] >+ </span> >+ [% ELSE %] >+ <span title="0000-00-00"> >+ <span class="tdlabel">Expiration:</span> >+ Never expires >+ </span> >+ [% END %] >+ [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %] >+ <span title="[% RECALL.expirationdate %]" class="overdue"> >+ <span class="tdlabel">Expiration:</span> >+ [% RECALL.expirationdate | $KohaDates %] >+ </span> >+ [% ELSE %] >+ <span title="0000-00-00">-</span> >+ [% END %] >+ </td> >+ <td class="branch"> >+ <span class="tdlabel">Pick up location:</span> >+ [% RECALL.branch.branchname %] >+ </td> >+ <td class="status"> >+ <span class="tdlabel">Status:</span> >+ [% IF ( RECALL.is_requested ) %] >+ Requested >+ [% ELSIF ( RECALL.is_waiting ) %] >+ Ready for pickup >+ [% ELSIF ( RECALL.has_expired ) %] >+ Expired >+ [% END %] >+ </td> >+ <td class="cancelrecall"> >+ [% IF ( !RECALL.cancellationdate ) %] >+ <form action="/cgi-bin/koha/opac-recall.pl" method="post"> >+ <input type="hidden" name="op" value="cancel"> >+ <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]"> >+ <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]"> >+ <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button> >+ </form> >+ [% ELSE %] >+ Cancelled >+ [% END %] >+ </td> >+ [% END %] >+ </tbody> >+ <table> >+ </div> >+ [% END # / # RECALLS.count %] >+ > [% IF Koha.Preference('ArticleRequests') %] > <div id="opac-user-article-requests"> > [% IF borrower.article_requests_current.count %] >@@ -901,6 +989,7 @@ Using this account is not recommended because some parts of Koha will not functi > var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); > var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?"); > var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended holds?"); >+ var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?"); > > $(document).ready(function(){ > $('#opac-user-views').tabs(); >@@ -909,6 +998,10 @@ Using this account is not recommended because some parts of Koha will not functi > $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); > $(".suspend-until").prop("readonly",1); > >+ $("#cancel_recall").click(function(e){ >+ return confirmDelete(MSG_CONFIRM_CANCEL_RECALL); >+ }); >+ > var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table"); > dTables.each(function(){ > var thIndex = $(this).find("th.psort").index(); >diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl >index 72602a5..09e15d6 100755 >--- a/opac/opac-recall.pl >+++ b/opac/opac-recall.pl >@@ -85,6 +85,10 @@ if ($op eq 'request'){ > $error = 'failed'; > } > } >+} elsif ($op eq 'cancel'){ >+ my $recall_id = $query->param('recall_id'); >+ Koha::Recalls->find($recall_id)->delete; >+ print $query->redirect('/cgi-bin/koha/opac-user.pl'); > } > > $template->param( >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index ac91d4f..d3ae960 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -43,6 +43,7 @@ use Koha::Patron::Attribute::Types; > use Koha::Patron::Messages; > use Koha::Patron::Discharge; > use Koha::Patrons; >+use Koha::Recalls; > > use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; > >@@ -247,6 +248,11 @@ if ($issues){ > } > } > >+ my $recall = Koha::Recalls->find($issue->{itemnumber}); >+ if (defined $recall){ >+ $issue->{recalled} = 1; >+ } >+ > if ( $issue->{'overdue'} ) { > push @overdues, $issue; > $overdues_count++; >@@ -299,9 +305,11 @@ $template->param( show_barcode => 1 ) if $show_barcode; > > # now the reserved items.... > my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } ); >+my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } ); > > $template->param( > RESERVES => $reserves, >+ RECALLS => $recalls, > showpriority => $show_priority, > ); > >-- >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 19532
:
68569
|
68570
|
68571
|
68572
|
68642
|
68643
|
68644
|
68645
|
68653
|
69100
|
69102
|
69147
|
69148
|
69149
|
69170
|
69172
|
69221
|
69222
|
69223
|
69322
|
69353
|
69354
|
69405
|
69409
|
69410
|
69411
|
69841
|
69872
|
69873
|
69874
|
69875
|
69876
|
69877
|
69878
|
69879
|
69880
|
69881
|
69882
|
69883
|
69884
|
69885
|
69886
|
69887
|
69888
|
69889
|
69890
|
69986
|
70093
|
71409
|
71574
|
71575
|
71576
|
71577
|
71578
|
71579
|
71580
|
71581
|
71582
|
71583
|
71584
|
71585
|
71586
|
71587
|
71588
|
71589
|
71590
|
71591
|
71592
|
72244
|
72311
|
72312
|
72313
|
72314
|
72315
|
72316
| 72317 |
72318
|
72319
|
72320
|
72321
|
72322
|
72323
|
72324
|
72325
|
72326
|
72327
|
72328
|
72329
|
72330
|
72331
|
72332
|
72333
|
72334
|
72335
|
72336
|
72337
|
72338
|
72527