@@ -, +, @@ --- 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(+) --- a/Koha/Recall.pm +++ a/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 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/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 ) %]
  • Holds ([% RESERVES.count %])
  • [% END %] + [% IF ( RECALLS.count ) %]
  • Recalls ([% RECALLS.count %])
  • [% END %] [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current %]
  • Article requests ([% borrower.article_requests_current.count %])
  • [% END %] [% IF ( OverDriveCirculation ) %]
  • OverDrive Account
  • @@ -239,6 +240,7 @@ Using this account is not recommended because some parts of Koha will not functi [% ISSUE.title |html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield %][% END %] [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %] + [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %] [% ISSUE.author %] @@ -776,6 +778,92 @@ Using this account is not recommended because some parts of Koha will not functi [% END # / #RESERVES.count %] + [% IF RECALLS.count %] +
    + + + + + + + + + + + + + + [% FOREACH RECALL IN RECALLS %] + + + + + + + [% END %] + +
    Recalls ([% RECALLS.count %])
    TitlePlaced onExpires onPick up locationStatusCancel
    + + [% RECALL.biblio.title %] + [% FOREACH s IN RECALL.biblio.subtitles %] + [% s %] + [% END %] + [% RECALL.item.enumchron %] + + [% RECALL.biblio.author %] + + + Recall date: + [% RECALL.recalldate | $KohaDates %] + + + [% IF ( RECALL.is_waiting ) %] + [% IF ( RECALL.expirationdate ) %] + + Expiration: + [% RECALL.expirationdate | $KohaDates %] + + [% ELSE %] + + Expiration: + Never expires + + [% END %] + [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %] + + Expiration: + [% RECALL.expirationdate | $KohaDates %] + + [% ELSE %] + - + [% END %] + + Pick up location: + [% RECALL.branch.branchname %] + + Status: + [% IF ( RECALL.is_requested ) %] + Requested + [% ELSIF ( RECALL.is_waiting ) %] + Ready for pickup + [% ELSIF ( RECALL.has_expired ) %] + Expired + [% END %] + + [% IF ( !RECALL.cancellationdate ) %] +
    + + + + +
    + [% ELSE %] + Cancelled + [% END %] +
    + + [% END # / # RECALLS.count %] + [% IF Koha.Preference('ArticleRequests') %]
    [% 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(); --- a/opac/opac-recall.pl +++ a/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( --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -42,6 +42,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'; @@ -236,6 +237,11 @@ if ($issues){ } } + my $recall = Koha::Recalls->find($issue->{itemnumber}); + if (defined $recall){ + $issue->{recalled} = 1; + } + if ( $issue->{'overdue'} ) { push @overdues, $issue; $overdues_count++; @@ -288,9 +294,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, ); --