From 4ab7b5d4361badc4f25647299555413268b17621 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Wed, 23 Oct 2002 17:03:31 +0000 Subject: [PATCH] Fix branches.pl admin script so that it sets the IS and CU branchrelations on by default. --- admin/branches.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/admin/branches.pl b/admin/branches.pl index 54b7e82aaf..898ff728ce 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -174,6 +174,20 @@ printend $query.= $dbh->quote($input->param('issuing')).")"; my $sth=$dbh->prepare($query); $sth->execute; + $sth=$dbh->prepare("select categorycode from branchrelations where branchcode=?"); + $sth->execute($input->param('searchfield')); + my $categorycodes; + while (my ($categorycode) = $sth->fetchrow) { + $categorycodes->{$categorycode}=1; + } + unless ($categorycodes->{IS}) { + $sth=$dbh->prepare("insert into branchrelations (branchcode,categorycode) values (?, 'IS')"); + $sth->execute($input->param('searchfield')); + } + unless ($categorycodes->{CU}) { + $sth=$dbh->prepare("insert into branchrelations (branchcode,categorycode) values (?, 'CU')"); + $sth->execute($input->param('searchfield')); + } $sth->finish; print "data recorded"; print "
"; -- 2.39.5