From 7f1cc03e3e16c4538126d69e43f5d9ff67ecd0b2 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../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 d9cb9b1d55..1a4d2e96e6 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 @@ -229,8 +229,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 %]