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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-6 / +7 lines)
Lines 942-948 Link Here
942
942
943
                                            <tbody>
943
                                            <tbody>
944
                                                [% FOREACH ar IN current_article_requests %]
944
                                                [% FOREACH ar IN current_article_requests %]
945
                                                    <tr>
945
                                                    <tr id="article_[% ar.id | html %]">
946
                                                        <td class="article-request-record-title">
946
                                                        <td class="article-request-record-title">
947
                                                            [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link=> 1 %]
947
                                                            [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link=> 1 %]
948
                                                            [% ar.item.enumchron | html %]
948
                                                            [% ar.item.enumchron | html %]
Lines 1095-1101 Link Here
1095
            [% IF ( opac_user_article_requests ) %]
1095
            [% IF ( opac_user_article_requests ) %]
1096
                $("#opac-user-views a[href='#opac-user-article-requests_panel']").tab("show");
1096
                $("#opac-user-views a[href='#opac-user-article-requests_panel']").tab("show");
1097
            [% END %]
1097
            [% END %]
1098
            $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]'));
1098
            $('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]'));
1099
1099
1100
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1100
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1101
1101
Lines 1123-1129 Link Here
1123
                );
1123
                );
1124
            });
1124
            });
1125
1125
1126
            $(".btn-delete-article-request").on("click", function(e){
1126
            $("#article-requests-table").on("click", ".btn-delete-article-request", function(e){
1127
                e.preventDefault();
1127
                e.preventDefault();
1128
                var article_request = $(this).data("title");
1128
                var article_request = $(this).data("title");
1129
                var article_request_id = $(this).data("article-request_id");
1129
                var article_request_id = $(this).data("article-request_id");
Lines 1134-1149 Link Here
1134
                                type: "DELETE",
1134
                                type: "DELETE",
1135
                                url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC',
1135
                                url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC',
1136
                                success: function( data ) {
1136
                                success: function( data ) {
1137
                                    row.parents('tr').hide({
1137
                                    $("#article_" + article_request_id ).hide({
1138
                                        duration: 'slow',
1138
                                        duration: 'slow',
1139
                                        complete: function() {
1139
                                        complete: function() {
1140
                                            var ar_tab = $('a[href="#opac-user-article-requests"');
1140
                                            $(this).siblings(".child").hide();
1141
                                            var ar_tab = $('a[href="#opac-user-article-requests_panel"');
1141
                                            var ar_table = $('#article-requests-table');
1142
                                            var ar_table = $('#article-requests-table');
1142
                                            var ar_length = $('tbody tr:visible', ar_table).length;
1143
                                            var ar_length = $('tbody tr:visible', ar_table).length;
1143
                                            var ar_count = $('caption .count', ar_table);
1144
                                            var ar_count = $('caption .count', ar_table);
1144
1145
1145
                                            ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')'));
1146
                                            ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')'));
1146
                                            ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1147
                                            ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1148
1147
                                        }
1149
                                        }
1148
                                    });
1150
                                    });
1149
                                }
1151
                                }
1150
- 

Return to bug 39095