|
Lines 103-109
if ($op eq 'add_form') {
Link Here
|
| 103 |
my $duplicate_entry = 0; |
103 |
my $duplicate_entry = 0; |
| 104 |
my @branches = grep { $_ ne q{} } $input->param('branches'); |
104 |
my @branches = grep { $_ ne q{} } $input->param('branches'); |
| 105 |
|
105 |
|
| 106 |
if ( $id ) { # Update |
106 |
my $already_exists = Koha::AuthorisedValues->search( |
|
|
107 |
{ |
| 108 |
category => $new_category, |
| 109 |
authorised_value => $new_authorised_value, |
| 110 |
} |
| 111 |
)->count; |
| 112 |
|
| 113 |
if ( $already_exists ) { |
| 114 |
push @messages, {type => 'error', code => 'already_exists' }; |
| 115 |
} |
| 116 |
elsif ( $id ) { # Update |
| 107 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
117 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
| 108 |
|
118 |
|
| 109 |
$av->lib( $input->param('lib') || undef ); |
119 |
$av->lib( $input->param('lib') || undef ); |