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 154-159 Using this account is not recommended because some parts of Koha will not functi Link Here
154
                            [% END %]
154
                            [% END %]
155
155
156
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
156
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
157
                            [% IF ( RECALLS.count ) %]<li><a href="#opac-user-recalls">Recalls ([% RECALLS.count %])</a></li>[% END %]
157
                            [% 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 %]
158
                            [% 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 %]
158
                            [% IF ( OverDriveCirculation ) %]
159
                            [% IF ( OverDriveCirculation ) %]
159
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
160
                            <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
Lines 239-244 Using this account is not recommended because some parts of Koha will not functi Link Here
239
                                                <td class="title">
240
                                                <td class="title">
240
                                                    <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>
241
                                                    <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>
241
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
242
                                                    [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
243
                                                    [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %]
242
                                                </td>
244
                                                </td>
243
245
244
                                                <td class="author">[% ISSUE.author %]</td>
246
                                                <td class="author">[% ISSUE.author %]</td>
Lines 776-781 Using this account is not recommended because some parts of Koha will not functi Link Here
776
                        </div> <!-- / #opac-user-holds -->
778
                        </div> <!-- / #opac-user-holds -->
777
                        [% END # / #RESERVES.count %]
779
                        [% END # / #RESERVES.count %]
778
780
781
                        [% IF RECALLS.count %]
782
                            <div id="opac-user-recalls">
783
                                <table id="recalls-table" class="table table-bordered table-striped">
784
                                    <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption>
785
                                    <thead>
786
                                        <tr>
787
                                            <th class="anti-the">Title</th>
788
                                            <th class="psort title-string">Placed on</th>
789
                                            <th class="title-string">Expires on</th>
790
                                            <th>Pick up location</th>
791
                                            <th>Status</th>
792
                                            <th>Cancel</th>
793
                                        </tr>
794
                                    </thead>
795
                                    <tbody>
796
                                        [% FOREACH RECALL IN RECALLS %]
797
                                            <td class="title">
798
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
799
                                                    [% RECALL.biblio.title %]
800
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
801
                                                        [% s %]
802
                                                    [% END %]
803
                                                    [% RECALL.item.enumchron %]
804
                                                </a>
805
                                                [% RECALL.biblio.author %]
806
                                            </td>
807
                                            <td class="recalldate">
808
                                                <span title="[% RECALL.recalldate %]">
809
                                                    <span class="tdlabel">Recall date:</span>
810
                                                    [% RECALL.recalldate | $KohaDates %]
811
                                                </span>
812
                                            </td>
813
                                            <td class="expirationdate">
814
                                                [% IF ( RECALL.is_waiting ) %]
815
                                                    [% IF ( RECALL.expirationdate ) %]
816
                                                        <span title="[% RECALL.expirationdate %]">
817
                                                            <span class="tdlabel">Expiration:</span>
818
                                                                [% RECALL.expirationdate | $KohaDates %]
819
                                                        </span>
820
                                                    [% ELSE %]
821
                                                        <span title="0000-00-00">
822
                                                            <span class="tdlabel">Expiration:</span>
823
                                                            Never expires
824
                                                        </span>
825
                                                    [% END %]
826
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
827
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
828
                                                        <span class="tdlabel">Expiration:</span>
829
                                                        [% RECALL.expirationdate | $KohaDates %]
830
                                                    </span>
831
                                                [% ELSE %]
832
                                                    <span title="0000-00-00">-</span>
833
                                                [% END %]
834
                                            </td>
835
                                            <td class="branch">
836
                                                <span class="tdlabel">Pick up location:</span>
837
                                                [% RECALL.branch.branchname %]
838
                                            </td>
839
                                            <td class="status">
840
                                                <span class="tdlabel">Status:</span>
841
                                                [% IF ( RECALL.is_requested ) %]
842
                                                    Requested
843
                                                [% ELSIF ( RECALL.is_waiting ) %]
844
                                                    Ready for pickup
845
                                                [% ELSIF ( RECALL.has_expired ) %]
846
                                                    Expired
847
                                                [% END %]
848
                                            </td>
849
                                            <td class="cancelrecall">
850
                                                [% IF ( !RECALL.cancellationdate ) %]
851
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
852
                                                        <input type="hidden" name="op" value="cancel">
853
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
854
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
855
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
856
                                                    </form>
857
                                                [% ELSE %]
858
                                                    Cancelled
859
                                                [% END %]
860
                                            </td>
861
                                        [% END %]
862
                                    </tbody>
863
                                <table>
864
                            </div>
865
                        [% END # / # RECALLS.count %]
866
779
                        [% IF Koha.Preference('ArticleRequests') %]
867
                        [% IF Koha.Preference('ArticleRequests') %]
780
                            <div id="opac-user-article-requests">
868
                            <div id="opac-user-article-requests">
781
                                [% IF borrower.article_requests_current.count %]
869
                                [% IF borrower.article_requests_current.count %]
Lines 901-906 Using this account is not recommended because some parts of Koha will not functi Link Here
901
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
989
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
902
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
990
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
903
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
991
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
992
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
904
993
905
        $(document).ready(function(){
994
        $(document).ready(function(){
906
            $('#opac-user-views').tabs();
995
            $('#opac-user-views').tabs();
Lines 909-914 Using this account is not recommended because some parts of Koha will not functi Link Here
909
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
998
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
910
            $(".suspend-until").prop("readonly",1);
999
            $(".suspend-until").prop("readonly",1);
911
1000
1001
            $("#cancel_recall").click(function(e){
1002
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1003
            });
1004
912
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1005
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
913
            dTables.each(function(){
1006
            dTables.each(function(){
914
                var thIndex = $(this).find("th.psort").index();
1007
                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 236-241 if ($issues){ Link Here
236
            }
237
            }
237
        }
238
        }
238
239
240
        my $recall = Koha::Recalls->find($issue->{itemnumber});
241
        if (defined $recall){
242
            $issue->{recalled} = 1;
243
        }
244
239
        if ( $issue->{'overdue'} ) {
245
        if ( $issue->{'overdue'} ) {
240
            push @overdues, $issue;
246
            push @overdues, $issue;
241
            $overdues_count++;
247
            $overdues_count++;
Lines 288-296 $template->param( show_barcode => 1 ) if $show_barcode; Link Here
288
294
289
# now the reserved items....
295
# now the reserved items....
290
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
296
my $reserves = Koha::Holds->search( { borrowernumber => $borrowernumber } );
297
my $recalls = Koha::Recalls->search( { borrowernumber => $borrowernumber } );
291
298
292
$template->param(
299
$template->param(
293
    RESERVES       => $reserves,
300
    RESERVES       => $reserves,
301
    RECALLS        => $recalls,
294
    showpriority   => $show_priority,
302
    showpriority   => $show_priority,
295
);
303
);
296
304
297
- 

Return to bug 19532