Dutch and Polish opac updates
[koha.git] / admin / biblio_framework.pl
index 1f345b7..77dc797 100755 (executable)
@@ -95,15 +95,17 @@ if ($op eq 'add_form') {
 # called by add_form, used to insert/modify data in DB
 } elsif ($op eq 'add_validate') {
        my $dbh = C4::Context->dbh;
-    if ($input->param('modif')) {
-        my $sth=$dbh->prepare("UPDATE biblio_framework SET frameworktext=? WHERE frameworkcode=?");
-        $sth->execute($input->param('frameworktext'),$input->param('frameworkcode'));
-        $sth->finish;
-    } else {
-        my $sth=$dbh->prepare("INSERT into biblio_framework (frameworkcode,frameworktext) values (?,?)");
-        $sth->execute($input->param('frameworkcode'),$input->param('frameworktext'));
-        $sth->finish;
-    }
+       if($input->param('frameworktext') and $input->param('frameworkcode')){
+        if ($input->param('modif')) {
+            my $sth=$dbh->prepare("UPDATE biblio_framework SET frameworktext=? WHERE frameworkcode=?");
+            $sth->execute($input->param('frameworktext'),$input->param('frameworkcode'));
+            $sth->finish;
+        } else {
+            my $sth=$dbh->prepare("INSERT into biblio_framework (frameworkcode,frameworktext) values (?,?)");
+            $sth->execute($input->param('frameworkcode'),$input->param('frameworktext'));
+            $sth->finish;
+        }
+       }
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=biblio_framework.pl\"></html>";
        exit;
                                                                                                        # END $OP eq ADD_VALIDATE
@@ -138,7 +140,7 @@ if ($op eq 'add_form') {
        my $dbh = C4::Context->dbh;
 #      my $frameworkcode=uc($input->param('frameworkcode'));
 #   
-       unless($frameworkcode) { 
+       if($frameworkcode) { 
                my $sth=$dbh->prepare("delete from marc_tag_structure where frameworkcode=?");
                $sth->execute($frameworkcode);
                $sth=$dbh->prepare("delete from marc_subfield_structure where frameworkcode=?");