Shifting other variables, no need to have the same code twice just more chance for...
authorChris Cormack <crc@liblime.com>
Sun, 11 Nov 2007 22:59:40 +0000 (16:59 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 12 Nov 2007 00:43:29 +0000 (18:43 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/marctagstructure.pl

index ef377e8..1cb3c7d 100755 (executable)
@@ -154,14 +154,14 @@ if ($op eq 'add_form') {
 # called by add_form, used to insert/modify data in DB
 } elsif ($op eq 'add_validate') {
        my $tagfield       =$input->param('tagfield');
+       my $liblibrarian  = $input->param('liblibrarian');
+       my $libopac       =$input->param('libopac');
+       my $repeatable =$input->param('repeatable');
+       my $mandatory =$input->param('mandatory');
+       my $authorised_value =$input->param('authorised_value');
     if ($input->param('modif')) {
         $sth=$dbh->prepare("UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?");
-        my $liblibrarian  = $input->param('liblibrarian');
-        my $libopac       =$input->param('libopac');
-        my $repeatable =$input->param('repeatable');
-        my $mandatory =$input->param('mandatory');
-        my $authorised_value =$input->param('authorised_value');
-        unless (C4::Context->config('demo') eq 1) {
+         unless (C4::Context->config('demo') eq 1) {
             $sth->execute(  $liblibrarian,
                             $libopac,
                             $repeatable?1:0,
@@ -174,11 +174,6 @@ if ($op eq 'add_form') {
         $sth->finish;
        } else {
         $sth=$dbh->prepare("INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)");
-        my $liblibrarian  = $input->param('liblibrarian');
-        my $libopac       =$input->param('libopac');
-        my $repeatable =$input->param('repeatable');
-        my $mandatory =$input->param('mandatory');
-        my $authorised_value =$input->param('authorised_value');
         unless (C4::Context->config('demo') eq 1) {
             $sth->execute($tagfield,
                                 $liblibrarian,