Prevent default framework from being inadvertently deleted.
authorRyan Higgins <ryan.higgins@liblime.com>
Sat, 16 Feb 2008 20:09:31 +0000 (09:09 +1300)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 19 Feb 2008 01:30:42 +0000 (19:30 -0600)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/biblio_framework.pl

index c388762..1f345b7 100755 (executable)
@@ -136,14 +136,17 @@ if ($op eq 'add_form') {
 } elsif ($op eq 'delete_confirmed') {
        #start the page and read in includes
        my $dbh = C4::Context->dbh;
-       my $frameworkcode=uc($input->param('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=?");
-       $sth->execute($frameworkcode);
-       $sth=$dbh->prepare("delete from biblio_framework where frameworkcode=?");
-       $sth->execute($frameworkcode);
-       $sth->finish;
+#      my $frameworkcode=uc($input->param('frameworkcode'));
+#   
+       unless($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=?");
+               $sth->execute($frameworkcode);
+               $sth=$dbh->prepare("delete from biblio_framework where frameworkcode=?");
+               $sth->execute($frameworkcode);
+               $sth->finish;
+       }
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=biblio_framework.pl\"></html>";
        exit;
                                                                                                        # END $OP eq DELETE_CONFIRMED