From 34e7c21ea0b4eb7831b2cba3cf3fe92a6e514ee1 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 8 Aug 2024 01:25:27 +0000 Subject: [PATCH] Bug 34346: Tidy Signed-off-by: Owen Leonard --- admin/marctagstructure.pl | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 45b55e9589..1e89615e0d 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -139,36 +139,36 @@ if ($op eq 'add_form') { ); } else { my $schema = Koha::Database->new()->schema(); - my $rs = $schema->resultset('MarcTagStructure'); - my $field = $rs->find({ tagfield => $tagfield, frameworkcode => $frameworkcode }); - if (!$field){ + my $rs = $schema->resultset('MarcTagStructure'); + my $field = $rs->find( { tagfield => $tagfield, frameworkcode => $frameworkcode } ); + if ( !$field ) { $sth = $dbh->prepare( - "INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?,?)" + "INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?,?)" ); - $sth->execute($tagfield, - $liblibrarian, - $libopac, - $repeatable, - $mandatory, - $important, - $authorised_value, - $ind1_defaultvalue, - $ind2_defaultvalue, - $frameworkcode + $sth->execute( + $tagfield, + $liblibrarian, + $libopac, + $repeatable, + $mandatory, + $important, + $authorised_value, + $ind1_defaultvalue, + $ind2_defaultvalue, + $frameworkcode ); - } - else { + } else { $error = 'duplicate_tagfield'; } } - if (!$error){ + if ( !$error ) { $cache->clear_from_cache("MarcStructure-0-$frameworkcode"); $cache->clear_from_cache("MarcStructure-1-$frameworkcode"); $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); $cache->clear_from_cache("MarcCodedFields-$frameworkcode"); } my $redirect_url = "/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"; - if ($error){ + if ($error) { $redirect_url .= "&error=$error"; } print $input->redirect($redirect_url); -- 2.39.2