View | Details | Raw Unified | Return to bug 19532
Collapse All | Expand All

(-)a/Koha/Recall.pm (+43 lines)
Lines 41-46 sub _type { Link Here
41
    return 'Recall';
41
    return 'Recall';
42
}
42
}
43
43
44
=head3 biblio
45
46
Returns the related Koha::Biblio object for this hold
47
48
=cut
49
50
sub biblio {
51
    my ($self) = @_;
52
53
    $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() );
54
55
    return $self->{_biblio};
56
}
57
58
=head3 item
59
60
Returns the related Koha::Item object for this Hold
61
62
=cut
63
64
sub item {
65
66
    my ($self) = @_;
67
68
    $self->{_item} ||= Koha::Items->find( $self->itemnumber() );
69
70
    return $self->{_item};
71
}
72
73
=head3 branch
74
75
Returns the related Koha::Library object for this Hold
76
77
=cut
78
79
sub branch {
80
    my ($self) = @_;
81
82
    $self->{_branch} ||= Koha::Libraries->find( $self->branchcode() );
83
84
    return $self->{_branch};
85
}
86
44
=head3 is_waiting
87
=head3 is_waiting
45
88
46
Returns true if recall is awaiting pickup
89
Returns true if recall is awaiting pickup
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+93 lines)
Lines 159-164 Link Here
159
                            [% END %]
159
                            [% END %]
160
160
161
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
161
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
162
                            [% IF ( RECALLS.count ) %]<li><a href="#opac-user-recalls">Recalls ([% RECALLS.count %])</a></li>[% END %]
162
                            [% 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 %]
163
                            [% 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 %]
163
                            [% IF ( OverDriveCirculation ) %]
164
                            [% IF ( OverDriveCirculation ) %]
164
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
165
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
Lines 244-249 Link Here
244
                                                <td class="title">
245
                                                <td class="title">
245
                                                    <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>
246
                                                    <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>
246
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
247
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
248
                                                    [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %]
247
                                                </td>
249
                                                </td>
248
250
249
                                                <td class="author">[% ISSUE.author %]</td>
251
                                                <td class="author">[% ISSUE.author %]</td>
Lines 789-794 Link Here
789
                        </div> <!-- / #opac-user-holds -->
791
                        </div> <!-- / #opac-user-holds -->
790
                        [% END # / #RESERVES.count %]
792
                        [% END # / #RESERVES.count %]
791
793
794
                        [% IF RECALLS.count %]
795
                            <div id="opac-user-recalls">
796
                                <table id="recalls-table" class="table table-bordered table-striped">
797
                                    <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption>
798
                                    <thead>
799
                                        <tr>
800
                                            <th class="anti-the">Title</th>
801
                                            <th class="psort title-string">Placed on</th>
802
                                            <th class="title-string">Expires on</th>
803
                                            <th>Pick up location</th>
804
                                            <th>Status</th>
805
                                            <th>Cancel</th>
806
                                        </tr>
807
                                    </thead>
808
                                    <tbody>
809
                                        [% FOREACH RECALL IN RECALLS %]
810
                                            <td class="title">
811
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
812
                                                    [% RECALL.biblio.title %]
813
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
814
                                                        [% s %]
815
                                                    [% END %]
816
                                                    [% RECALL.item.enumchron %]
817
                                                </a>
818
                                                [% RECALL.biblio.author %]
819
                                            </td>
820
                                            <td class="recalldate">
821
                                                <span title="[% RECALL.recalldate %]">
822
                                                    <span class="tdlabel">Recall date:</span>
823
                                                    [% RECALL.recalldate | $KohaDates %]
824
                                                </span>
825
                                            </td>
826
                                            <td class="expirationdate">
827
                                                [% IF ( RECALL.is_waiting ) %]
828
                                                    [% IF ( RECALL.expirationdate ) %]
829
                                                        <span title="[% RECALL.expirationdate %]">
830
                                                            <span class="tdlabel">Expiration:</span>
831
                                                                [% RECALL.expirationdate | $KohaDates %]
832
                                                        </span>
833
                                                    [% ELSE %]
834
                                                        <span title="0000-00-00">
835
                                                            <span class="tdlabel">Expiration:</span>
836
                                                            Never expires
837
                                                        </span>
838
                                                    [% END %]
839
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
840
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
841
                                                        <span class="tdlabel">Expiration:</span>
842
                                                        [% RECALL.expirationdate | $KohaDates %]
843
                                                    </span>
844
                                                [% ELSE %]
845
                                                    <span title="0000-00-00">-</span>
846
                                                [% END %]
847
                                            </td>
848
                                            <td class="branch">
849
                                                <span class="tdlabel">Pick up location:</span>
850
                                                [% RECALL.branch.branchname %]
851
                                            </td>
852
                                            <td class="status">
853
                                                <span class="tdlabel">Status:</span>
854
                                                [% IF ( RECALL.is_requested ) %]
855
                                                    Requested
856
                                                [% ELSIF ( RECALL.is_waiting ) %]
857
                                                    Ready for pickup
858
                                                [% ELSIF ( RECALL.has_expired ) %]
859
                                                    Expired
860
                                                [% END %]
861
                                            </td>
862
                                            <td class="cancelrecall">
863
                                                [% IF ( !RECALL.cancellationdate ) %]
864
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
865
                                                        <input type="hidden" name="op" value="cancel">
866
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
867
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
868
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
869
                                                    </form>
870
                                                [% ELSE %]
871
                                                    Cancelled
872
                                                [% END %]
873
                                            </td>
874
                                        [% END %]
875
                                    </tbody>
876
                                <table>
877
                            </div>
878
                        [% END # / # RECALLS.count %]
879
792
                        [% IF Koha.Preference('ArticleRequests') %]
880
                        [% IF Koha.Preference('ArticleRequests') %]
793
                            <div id="opac-user-article-requests">
881
                            <div id="opac-user-article-requests">
794
                                [% IF borrower.article_requests_current.count %]
882
                                [% IF borrower.article_requests_current.count %]
Lines 914-919 Link Here
914
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
1002
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
915
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
1003
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
916
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
1004
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
1005
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
917
1006
918
        $(document).ready(function(){
1007
        $(document).ready(function(){
919
            $('#opac-user-views').tabs();
1008
            $('#opac-user-views').tabs();
Lines 922-927 Link Here
922
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1011
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
923
            $(".suspend-until").prop("readonly",1);
1012
            $(".suspend-until").prop("readonly",1);
924
1013
1014
            $("#cancel_recall").click(function(e){
1015
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1016
            });
1017
925
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1018
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
926
            dTables.each(function(){
1019
            dTables.each(function(){
927
                var thIndex = $(this).find("th.psort").index();
1020
                var thIndex = $(this).find("th.psort").index();
(-)a/opac/opac-recall.pl (+4 lines)
Lines 85-90 if ($op eq 'request'){ Link Here
85
            $error = 'failed';
85
            $error = 'failed';
86
        }
86
        }
87
    }
87
    }
88
} elsif ($op eq 'cancel'){
89
    my $recall_id = $query->param('recall_id');
90
    Koha::Recalls->find($recall_id)->delete;
91
    print $query->redirect('/cgi-bin/koha/opac-user.pl');
88
}
92
}
89
93
90
$template->param(
94
$template->param(
(-)a/opac/opac-user.pl (-1 / +8 lines)
Lines 43-48 use Koha::Patron::Attribute::Types; Link Here
43
use Koha::Patron::Messages;
43
use Koha::Patron::Messages;
44
use Koha::Patron::Discharge;
44
use Koha::Patron::Discharge;
45
use Koha::Patrons;
45
use Koha::Patrons;
46
use Koha::Recalls;
46
47
47
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
48
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
48
49
Lines 248-253 if ( $pending_checkouts->count ) { # Useless test Link Here
248
            }
249
            }
249
        }
250
        }
250
251
252
        my $recall = Koha::Recalls->find($issue->{itemnumber});
253
        if (defined $recall){
254
            $issue->{recalled} = 1;
255
        }
256
251
        if ( $c->is_overdue ) {
257
        if ( $c->is_overdue ) {
252
            push @overdues, $issue;
258
            push @overdues, $issue;
253
            $overdues_count++;
259
            $overdues_count++;
Lines 300-308 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
300
306
301
# now the reserved items....
307
# now the reserved items....
302
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
308
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
309
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } );
303
310
304
$template->param(
311
$template->param(
305
    RESERVES       => $reserves,
312
    RESERVES       => $reserves,
313
    RECALLS        => $recalls,
306
    showpriority   => $show_priority,
314
    showpriority   => $show_priority,
307
);
315
);
308
316
309
- 

Return to bug 19532