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 (-2 / +95 lines)
Lines 159-165 Link Here
159
                            [% END %]
159
                            [% END %]
160
160
161
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
161
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
162
                            [% IF Koha.Preference('ArticleRequests') && logged_in_user.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% logged_in_user.article_requests_current.count | html %])</a></li>[% END %]
162
                            [% IF ( RECALLS.count ) %]<li><a href="#opac-user-recalls">Recalls ([% RECALLS.count | html %])</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 | html %])</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>
165
                            [% END %]
166
                            [% END %]
Lines 244-250 Link Here
244
245
245
                                                <td class="title">
246
                                                <td class="title">
246
                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% ISSUE.title | html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield | html %][% END %]</a>
247
                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% ISSUE.title | html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield | html %][% END %]</a>
247
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
248
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
249
                                                    [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %]
248
                                                </td>
250
                                                </td>
249
251
250
                                                <td class="author">[% ISSUE.author | html %]</td>
252
                                                <td class="author">[% ISSUE.author | html %]</td>
Lines 786-791 Link Here
786
                        </div> <!-- / #opac-user-holds -->
788
                        </div> <!-- / #opac-user-holds -->
787
                        [% END # / #RESERVES.count %]
789
                        [% END # / #RESERVES.count %]
788
790
791
                        [% IF RECALLS.count %]
792
                            <div id="opac-user-recalls">
793
                                <table id="recalls-table" class="table table-bordered table-striped">
794
                                    <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption>
795
                                    <thead>
796
                                        <tr>
797
                                            <th class="anti-the">Title</th>
798
                                            <th class="psort title-string">Placed on</th>
799
                                            <th class="title-string">Expires on</th>
800
                                            <th>Pick up location</th>
801
                                            <th>Status</th>
802
                                            <th>Cancel</th>
803
                                        </tr>
804
                                    </thead>
805
                                    <tbody>
806
                                        [% FOREACH RECALL IN RECALLS %]
807
                                            <td class="title">
808
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
809
                                                    [% RECALL.biblio.title %]
810
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
811
                                                        [% s %]
812
                                                    [% END %]
813
                                                    [% RECALL.item.enumchron %]
814
                                                </a>
815
                                                [% RECALL.biblio.author %]
816
                                            </td>
817
                                            <td class="recalldate">
818
                                                <span title="[% RECALL.recalldate %]">
819
                                                    <span class="tdlabel">Recall date:</span>
820
                                                    [% RECALL.recalldate | $KohaDates %]
821
                                                </span>
822
                                            </td>
823
                                            <td class="expirationdate">
824
                                                [% IF ( RECALL.is_waiting ) %]
825
                                                    [% IF ( RECALL.expirationdate ) %]
826
                                                        <span title="[% RECALL.expirationdate %]">
827
                                                            <span class="tdlabel">Expiration:</span>
828
                                                                [% RECALL.expirationdate | $KohaDates %]
829
                                                        </span>
830
                                                    [% ELSE %]
831
                                                        <span title="0000-00-00">
832
                                                            <span class="tdlabel">Expiration:</span>
833
                                                            Never expires
834
                                                        </span>
835
                                                    [% END %]
836
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
837
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
838
                                                        <span class="tdlabel">Expiration:</span>
839
                                                        [% RECALL.expirationdate | $KohaDates %]
840
                                                    </span>
841
                                                [% ELSE %]
842
                                                    <span title="0000-00-00">-</span>
843
                                                [% END %]
844
                                            </td>
845
                                            <td class="branch">
846
                                                <span class="tdlabel">Pick up location:</span>
847
                                                [% RECALL.branch.branchname %]
848
                                            </td>
849
                                            <td class="status">
850
                                                <span class="tdlabel">Status:</span>
851
                                                [% IF ( RECALL.is_requested ) %]
852
                                                    Requested
853
                                                [% ELSIF ( RECALL.is_waiting ) %]
854
                                                    Ready for pickup
855
                                                [% ELSIF ( RECALL.has_expired ) %]
856
                                                    Expired
857
                                                [% END %]
858
                                            </td>
859
                                            <td class="cancelrecall">
860
                                                [% IF ( !RECALL.cancellationdate ) %]
861
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
862
                                                        <input type="hidden" name="op" value="cancel">
863
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
864
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
865
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
866
                                                    </form>
867
                                                [% ELSE %]
868
                                                    Cancelled
869
                                                [% END %]
870
                                            </td>
871
                                        [% END %]
872
                                    </tbody>
873
                                <table>
874
                            </div>
875
                        [% END # / # RECALLS.count %]
876
789
                        [% IF Koha.Preference('ArticleRequests') %]
877
                        [% IF Koha.Preference('ArticleRequests') %]
790
                            <div id="opac-user-article-requests">
878
                            <div id="opac-user-article-requests">
791
                                [% IF logged_in_user.article_requests_current.count %]
879
                                [% IF logged_in_user.article_requests_current.count %]
Lines 917-922 Link Here
917
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
1005
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
918
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
1006
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
919
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
1007
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
1008
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
920
1009
921
        $(document).ready(function(){
1010
        $(document).ready(function(){
922
            $('#opac-user-views').tabs();
1011
            $('#opac-user-views').tabs();
Lines 925-930 Link Here
925
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1014
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
926
            $(".suspend-until").prop("readonly",1);
1015
            $(".suspend-until").prop("readonly",1);
927
1016
1017
            $("#cancel_recall").click(function(e){
1018
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1019
            });
1020
928
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1021
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
929
            dTables.each(function(){
1022
            dTables.each(function(){
930
                var thIndex = $(this).find("th.psort").index();
1023
                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 42-47 use Koha::Patron::Attribute::Types; Link Here
42
use Koha::Patron::Messages;
42
use Koha::Patron::Messages;
43
use Koha::Patron::Discharge;
43
use Koha::Patron::Discharge;
44
use Koha::Patrons;
44
use Koha::Patrons;
45
use Koha::Recalls;
45
46
46
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
47
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
47
48
Lines 247-252 if ( $pending_checkouts->count ) { # Useless test Link Here
247
            }
248
            }
248
        }
249
        }
249
250
251
        my $recall = Koha::Recalls->find($issue->{itemnumber});
252
        if (defined $recall){
253
            $issue->{recalled} = 1;
254
        }
255
250
        if ( $c->is_overdue ) {
256
        if ( $c->is_overdue ) {
251
            push @overdues, $issue;
257
            push @overdues, $issue;
252
            $overdues_count++;
258
            $overdues_count++;
Lines 299-307 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
299
305
300
# now the reserved items....
306
# now the reserved items....
301
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
307
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
308
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } );
302
309
303
$template->param(
310
$template->param(
304
    RESERVES       => $reserves,
311
    RESERVES       => $reserves,
312
    RECALLS        => $recalls,
305
    showpriority   => $show_priority,
313
    showpriority   => $show_priority,
306
);
314
);
307
315
308
- 

Return to bug 19532