From 723a69dc04d48ba07c2a0dbab5266a295cd557ea Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 24 Apr 2023 23:53:50 +0000 Subject: [PATCH] Bug 33512: (follow-up) Check item count before adding add/edit button --- .../prog/en/modules/serials/serials-edit.tt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index 20faf96f34..b1b26a0514 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -233,8 +233,19 @@ $(document).ready(function() { [% IF ( serialslis.serialsadditems ) %] + [% SET item_count = 0 %] + [% FOREACH item IN serialslis.items %] + [% IF ( item.itemnumber ) %] + [% item_count = item_count + 1 %] + [% END %] + [% END %] + [% IF item_count > 0 %] Edit item + [% ELSE %] + + Add item + [% END %]