From 8de6e538807ab26650c2d31501341c440a43d4dc Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Mon, 15 Aug 2022 01:58:29 +0300 Subject: [PATCH] Bug 27981: (QA follow-up) Unify JavaScript to false/true from 0/1/"" Make remove_control_num var and JS KohaBackend.GetRecord calls to have only false/true instead of mixed 0,1, and "" in different places. Signed-off-by: Andrew Nugged Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index 52f4598888..18cafecbb2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -251,7 +251,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr saveLabel: _("Duplicate"), get: function( id, callback ) { if ( !id ) return false; - var remove_control_num = [% IF Koha.Preference('autoControlNumber') == 'OFF' %] 0 [% ELSE %] 1 [% END %]; + var remove_control_num = [% IF Koha.Preference('autoControlNumber') == 'OFF' %] false [% ELSE %] true [% END %]; KohaBackend.GetRecord( id, remove_control_num, callback ); }, @@ -276,7 +276,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr get: function( id, callback ) { if ( !id ) return false; - KohaBackend.GetRecord( id, "", callback ); + KohaBackend.GetRecord( id, false, callback ); }, save: function( id, record, done ) { function finishCb( data ) { @@ -412,7 +412,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr backends[ parts[0] ].get( parts[1], function( record ) { if ( !record.error ) { - var remove_control_num = [% IF Koha.Preference('autoControlNumber') == 'OFF' %] 0 [% ELSE %] 1 [% END %]; + var remove_control_num = [% IF Koha.Preference('autoControlNumber') == 'OFF' %] false [% ELSE %] true [% END %]; if( remove_control_num ){ record.removeField("001"); } editor.displayRecord( record ); editor.focus(); -- 2.39.5