Removing replace statement from C4::Branch as per bug 1546
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
b5a1060788
commit
96e89fa4dc
16
C4/Branch.pm
16
C4/Branch.pm
|
|
@ -480,12 +480,20 @@ sets the data from the editbranch form, and writes to the database...
|
|||
=cut
|
||||
|
||||
sub ModBranchCategoryInfo {
|
||||
|
||||
my ($data) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare("replace branchcategories (categorycode,categoryname,codedescription,categorytype) values (?,?,?,?)");
|
||||
$sth->execute(uc( $data->{'categorycode'} ),$data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'} );
|
||||
$sth->finish;
|
||||
if ($data->{'add'}){
|
||||
# we are doing an insert
|
||||
my $sth = $dbh->prepare("INSERT INTO branchcategories (categorycode,categoryname,codedescription,categorytype) VALUES (?,?,?,?)");
|
||||
$sth->execute(uc( $data->{'categorycode'} ),$data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'} );
|
||||
$sth->finish();
|
||||
}
|
||||
else {
|
||||
# modifying
|
||||
my $sth = $dbh->prepare("UPDATE branchcategories SET categoryname=?,codedescription=?,categorytype=? WHERE categorycode=?");
|
||||
$sth->execute($data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},uc( $data->{'categorycode'} ) );
|
||||
$sth->finish();
|
||||
}
|
||||
}
|
||||
|
||||
=head2 DeleteBranchCategory
|
||||
|
|
|
|||
|
|
@ -223,6 +223,11 @@
|
|||
<h3><!-- TMPL_IF NAME="categorycode" -->Edit Group <!-- TMPL_VAR NAME="categorycode" --><!-- TMPL_ELSE -->Add Group<!-- /TMPL_IF --></h3>
|
||||
<form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
|
||||
<input type="hidden" name="op" value="addcategory_validate" />
|
||||
<!-- TMPL_IF NAME="categorycode" -->
|
||||
<input type="hidden" name="add" value="0">
|
||||
<!-- TMPL_ELSE -->
|
||||
<input type="hidden" name="add" value="1">
|
||||
<!-- /TMPL_IF -->
|
||||
<fieldset class="rows">
|
||||
|
||||
<ol><li>
|
||||
|
|
|
|||
Loading…
Reference in New Issue