From 8fce14ee5b3adc0151b53625f3ca570751c70ac7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 15 Feb 2024 07:57:46 +0000 Subject: [PATCH] Bug 23415: (QA follow-up) Fix rebase code re-introduction Looks like some code was re-introduced during rebases, this patch switches it back to calling the newly introduced 'renew' function rather than doing the post inline. I also compared the two posts and updated the function to match the updated post from upstream. Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 43 ++------------------ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index ffe9547ee96..6a53e652839 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -674,46 +674,6 @@ $(document).ready(function() { params.date_due = dueDate } - $.post({ - url: "/cgi-bin/koha/svc/renew", - data: params, - success: function( data ) { - var id = "#renew_" + data.itemnumber; - - var content = ""; - if ( data.renew_okay ) { - content = __("Renewed, due:") + " " + data.date_due; - $('#date_due_' + data.itemnumber).replaceWith( data.date_due ); - } else { - content = __("Renew failed:") + " "; - if ( data.error == "no_checkout" ) { - content += __("not checked out"); - } else if ( data.error == "too_many" ) { - content += __("too many renewals"); - } else if ( data.error == "too_unseen" ) { - content += __("too many consecutive renewals without being seen by the library"); - } else if ( data.error == "on_reserve" ) { - content += __("on hold"); - } else if ( data.error == "restriction" ) { - content += __("Not allowed: patron restricted"); - } else if ( data.error == "overdue" ) { - content += __("Not allowed: overdue"); - } else if ( data.error == 'no_open_days' ) { - content += __('Unable to find an open day'); - } else if ( data.error ) { - content += data.error; - } else { - content += __("reason unknown"); - } - refresh_table = false; - } - - $(id).replaceWith( content ); - }, - dataType: "json", - async: false, - }); - $(this).parent().parent().replaceWith(""); renew(params); }); @@ -755,11 +715,14 @@ $(document).ready(function() { content += __("Not allowed: patron restricted"); } else if ( data.error == "overdue" ) { content += __("Not allowed: overdue"); + } else if ( data.error == 'no_open_days' ) { + content += __('Unable to find an open day'); } else if ( data.error ) { content += data.error; } else { content += __("reason unknown"); } + refresh_table = false; } $(id).replaceWith( content ); -- 2.43.0