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 239-245 Link Here
239
240
240
                                                <td class="title">
241
                                                <td class="title">
241
                                                    <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>
242
                                                    <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>
242
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
243
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
244
                                                    [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %]
243
                                                </td>
245
                                                </td>
244
246
245
                                                <td class="author">[% ISSUE.author | html %]</td>
247
                                                <td class="author">[% ISSUE.author | html %]</td>
Lines 781-786 Link Here
781
                        </div> <!-- / #opac-user-holds -->
783
                        </div> <!-- / #opac-user-holds -->
782
                        [% END # / #RESERVES.count %]
784
                        [% END # / #RESERVES.count %]
783
785
786
                        [% IF RECALLS.count %]
787
                            <div id="opac-user-recalls">
788
                                <table id="recalls-table" class="table table-bordered table-striped">
789
                                    <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption>
790
                                    <thead>
791
                                        <tr>
792
                                            <th class="anti-the">Title</th>
793
                                            <th class="psort title-string">Placed on</th>
794
                                            <th class="title-string">Expires on</th>
795
                                            <th>Pick up location</th>
796
                                            <th>Status</th>
797
                                            <th>Cancel</th>
798
                                        </tr>
799
                                    </thead>
800
                                    <tbody>
801
                                        [% FOREACH RECALL IN RECALLS %]
802
                                            <td class="title">
803
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
804
                                                    [% RECALL.biblio.title %]
805
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
806
                                                        [% s %]
807
                                                    [% END %]
808
                                                    [% RECALL.item.enumchron %]
809
                                                </a>
810
                                                [% RECALL.biblio.author %]
811
                                            </td>
812
                                            <td class="recalldate">
813
                                                <span title="[% RECALL.recalldate %]">
814
                                                    <span class="tdlabel">Recall date:</span>
815
                                                    [% RECALL.recalldate | $KohaDates %]
816
                                                </span>
817
                                            </td>
818
                                            <td class="expirationdate">
819
                                                [% IF ( RECALL.is_waiting ) %]
820
                                                    [% IF ( RECALL.expirationdate ) %]
821
                                                        <span title="[% RECALL.expirationdate %]">
822
                                                            <span class="tdlabel">Expiration:</span>
823
                                                                [% RECALL.expirationdate | $KohaDates %]
824
                                                        </span>
825
                                                    [% ELSE %]
826
                                                        <span title="0000-00-00">
827
                                                            <span class="tdlabel">Expiration:</span>
828
                                                            Never expires
829
                                                        </span>
830
                                                    [% END %]
831
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
832
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
833
                                                        <span class="tdlabel">Expiration:</span>
834
                                                        [% RECALL.expirationdate | $KohaDates %]
835
                                                    </span>
836
                                                [% ELSE %]
837
                                                    <span title="0000-00-00">-</span>
838
                                                [% END %]
839
                                            </td>
840
                                            <td class="branch">
841
                                                <span class="tdlabel">Pick up location:</span>
842
                                                [% RECALL.branch.branchname %]
843
                                            </td>
844
                                            <td class="status">
845
                                                <span class="tdlabel">Status:</span>
846
                                                [% IF ( RECALL.is_requested ) %]
847
                                                    Requested
848
                                                [% ELSIF ( RECALL.is_waiting ) %]
849
                                                    Ready for pickup
850
                                                [% ELSIF ( RECALL.has_expired ) %]
851
                                                    Expired
852
                                                [% END %]
853
                                            </td>
854
                                            <td class="cancelrecall">
855
                                                [% IF ( !RECALL.cancellationdate ) %]
856
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
857
                                                        <input type="hidden" name="op" value="cancel">
858
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
859
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
860
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
861
                                                    </form>
862
                                                [% ELSE %]
863
                                                    Cancelled
864
                                                [% END %]
865
                                            </td>
866
                                        [% END %]
867
                                    </tbody>
868
                                <table>
869
                            </div>
870
                        [% END # / # RECALLS.count %]
871
784
                        [% IF Koha.Preference('ArticleRequests') %]
872
                        [% IF Koha.Preference('ArticleRequests') %]
785
                            <div id="opac-user-article-requests">
873
                            <div id="opac-user-article-requests">
786
                                [% IF logged_in_user.article_requests_current.count %]
874
                                [% IF logged_in_user.article_requests_current.count %]
Lines 906-911 Link Here
906
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
994
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
907
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
995
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
908
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
996
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
997
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
909
998
910
        $(document).ready(function(){
999
        $(document).ready(function(){
911
            $('#opac-user-views').tabs();
1000
            $('#opac-user-views').tabs();
Lines 914-919 Link Here
914
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1003
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
915
            $(".suspend-until").prop("readonly",1);
1004
            $(".suspend-until").prop("readonly",1);
916
1005
1006
            $("#cancel_recall").click(function(e){
1007
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1008
            });
1009
917
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1010
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
918
            dTables.each(function(){
1011
            dTables.each(function(){
919
                var thIndex = $(this).find("th.psort").index();
1012
                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