From 547412306d3e588904b1a5b8b955571925b9a456 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 (cherry picked from commit 7f1cc03e3e16c4538126d69e43f5d9ff67ecd0b2) Signed-off-by: Matt Blenkinsop (cherry picked from commit 7c4ac22a4215274115128eb7b2cf3e0ac9cb7adf) Signed-off-by: Lucas Gass --- .../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 1b6ca53634..e7a73e5d4b 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 @@ -230,8 +230,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 %]