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 <nugged@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Andrew Nugged 2022-08-15 01:58:29 +03:00 committed by Tomas Cohen Arazi
parent ab358f06da
commit 8de6e53880
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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();