- $sth->execute($new_category, $new_authorised_value, $lib, $lib_opac, $imageurl, $id);
+ $sth->execute($new_category, $new_authorised_value, $lib, $lib_opac, $imageurl, $id);
+ if ( @branches ) {
+ $sth = $dbh->prepare("DELETE FROM authorised_values_branches WHERE av_id = ?");
+ $sth->execute( $id );
+ $sth = $dbh->prepare(
+ "INSERT INTO authorised_values_branches
+ ( av_id, branchcode )
+ VALUES ( ?, ? )"
+ );
+ for my $branchcode ( @branches ) {
+ next if not $branchcode;
+ $sth->execute($id, $branchcode);
+ }
+ }
+ $sth->finish;