From 9a956d7f97b0ce2cd7e18d50a4d405ce7fc2fe19 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 13 Nov 2019 16:39:18 +0100 Subject: [PATCH] Bug 23590: Remove JS error on the suggestion list MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The notify option is only available from the edit view Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../prog/en/modules/suggestion/suggestion.tt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index f758e1c8ac..17ff90b349 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -904,14 +904,16 @@ $('#managedby').val(borrowernumber); } - var notify = $('#notify'); - if ( notify.length ) { - if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) { - $(notify).prop('checked', false).prop('disabled', true); - } else { - $(notify).prop('disabled', false); + [% IF op == "save" %] + var notify = $('#notify'); + if ( notify.length ) { + if ( borrowernumber == [% logged_in_user.borrowernumber | html %] || borrowernumber == [% managedby_patron.borrowernumber | html %] ) { + $(notify).prop('checked', false).prop('disabled', true); + } else { + $(notify).prop('disabled', false); + } } - } + [% END %] } $(document).ready(function(){ -- 2.39.5