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 773-778 Using this account is not recommended because some parts of Koha will not functi Link Here
773
                        </div> <!-- / #opac-user-holds -->
775
                        </div> <!-- / #opac-user-holds -->
774
                        [% END # / #RESERVES.count %]
776
                        [% END # / #RESERVES.count %]
775
777
778
                        [% IF RECALLS.count %]
779
                            <div id="opac-user-recalls">
780
                                <table id="recalls-table" class="table table-bordered table-striped">
781
                                    <caption>Recalls <span class="count">([% RECALLS.count %])</span></caption>
782
                                    <thead>
783
                                        <tr>
784
                                            <th class="anti-the">Title</th>
785
                                            <th class="psort title-string">Placed on</th>
786
                                            <th class="title-string">Expires on</th>
787
                                            <th>Pick up location</th>
788
                                            <th>Status</th>
789
                                            <th>Cancel</th>
790
                                        </tr>
791
                                    </thead>
792
                                    <tbody>
793
                                        [% FOREACH RECALL IN RECALLS %]
794
                                            <td class="title">
795
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RECALL.biblionumber %]">
796
                                                    [% RECALL.biblio.title %]
797
                                                    [% FOREACH s IN RECALL.biblio.subtitles %]
798
                                                        [% s %]
799
                                                    [% END %]
800
                                                    [% RECALL.item.enumchron %]
801
                                                </a>
802
                                                [% RECALL.biblio.author %]
803
                                            </td>
804
                                            <td class="recalldate">
805
                                                <span title="[% RECALL.recalldate %]">
806
                                                    <span class="tdlabel">Recall date:</span>
807
                                                    [% RECALL.recalldate | $KohaDates %]
808
                                                </span>
809
                                            </td>
810
                                            <td class="expirationdate">
811
                                                [% IF ( RECALL.is_waiting ) %]
812
                                                    [% IF ( RECALL.expirationdate ) %]
813
                                                        <span title="[% RECALL.expirationdate %]">
814
                                                            <span class="tdlabel">Expiration:</span>
815
                                                                [% RECALL.expirationdate | $KohaDates %]
816
                                                        </span>
817
                                                    [% ELSE %]
818
                                                        <span title="0000-00-00">
819
                                                            <span class="tdlabel">Expiration:</span>
820
                                                            Never expires
821
                                                        </span>
822
                                                    [% END %]
823
                                                [% ELSIF ( RECALL.has_expired && RECALL.expirationdate ) %]
824
                                                    <span title="[% RECALL.expirationdate %]" class="overdue">
825
                                                        <span class="tdlabel">Expiration:</span>
826
                                                        [% RECALL.expirationdate | $KohaDates %]
827
                                                    </span>
828
                                                [% ELSE %]
829
                                                    <span title="0000-00-00">-</span>
830
                                                [% END %]
831
                                            </td>
832
                                            <td class="branch">
833
                                                <span class="tdlabel">Pick up location:</span>
834
                                                [% RECALL.branch.branchname %]
835
                                            </td>
836
                                            <td class="status">
837
                                                <span class="tdlabel">Status:</span>
838
                                                [% IF ( RECALL.is_requested ) %]
839
                                                    Requested
840
                                                [% ELSIF ( RECALL.is_waiting ) %]
841
                                                    Ready for pickup
842
                                                [% ELSIF ( RECALL.has_expired ) %]
843
                                                    Expired
844
                                                [% END %]
845
                                            </td>
846
                                            <td class="cancelrecall">
847
                                                [% IF ( !RECALL.cancellationdate ) %]
848
                                                    <form action="/cgi-bin/koha/opac-recall.pl" method="post">
849
                                                        <input type="hidden" name="op" value="cancel">
850
                                                        <input type="hidden" name="recall_id" value="[% RECALL.recall_id %]">
851
                                                        <input type="hidden" name="itemnumber" value="[% RECALL.itemnumber %]">
852
                                                        <button type="submit" name="submit" class="btn btn-sm btn-danger" id="cancel_recall"><i class="icon-remove icon-white"></i> Cancel</button>
853
                                                    </form>
854
                                                [% ELSE %]
855
                                                    Cancelled
856
                                                [% END %]
857
                                            </td>
858
                                        [% END %]
859
                                    </tbody>
860
                                <table>
861
                            </div>
862
                        [% END # / # RECALLS.count %]
863
776
                        [% IF Koha.Preference('ArticleRequests') %]
864
                        [% IF Koha.Preference('ArticleRequests') %]
777
                            <div id="opac-user-article-requests">
865
                            <div id="opac-user-article-requests">
778
                                [% IF borrower.article_requests_current.count %]
866
                                [% IF borrower.article_requests_current.count %]
Lines 898-903 Using this account is not recommended because some parts of Koha will not functi Link Here
898
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
986
        var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
899
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
987
        var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
900
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
988
        var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
989
        var MSG_CONFIRM_CANCEL_RECALL = _("Are you sure you want to undo this recall?");
901
990
902
        $(document).ready(function(){
991
        $(document).ready(function(){
903
            $('#opac-user-views').tabs();
992
            $('#opac-user-views').tabs();
Lines 906-911 Using this account is not recommended because some parts of Koha will not functi Link Here
906
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
995
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
907
            $(".suspend-until").prop("readonly",1);
996
            $(".suspend-until").prop("readonly",1);
908
997
998
            $("#cancel_recall").click(function(e){
999
                return confirmDelete(MSG_CONFIRM_CANCEL_RECALL);
1000
            });
1001
909
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1002
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
910
            dTables.each(function(){
1003
            dTables.each(function(){
911
                var thIndex = $(this).find("th.psort").index();
1004
                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