Lines 167-173
if ($op eq 'add_form') {
Link Here
|
167 |
); |
167 |
); |
168 |
|
168 |
|
169 |
if ( $already_exists ) { |
169 |
if ( $already_exists ) { |
170 |
push @messages, {type => 'error', code => 'cat_already_exists' }; |
170 |
if ( $new_category eq 'branches' or $new_category eq 'itemtypes' or $new_category eq 'cn_source' ) { |
|
|
171 |
push @messages, {type => 'error', code => 'invalid_category_name' }; |
172 |
} else { |
173 |
push @messages, {type => 'error', code => 'cat_already_exists' }; |
174 |
} |
171 |
} |
175 |
} |
172 |
else { # Insert |
176 |
else { # Insert |
173 |
my $av = Koha::AuthorisedValueCategory->new( { |
177 |
my $av = Koha::AuthorisedValueCategory->new( { |
Lines 182-192
if ($op eq 'add_form') {
Link Here
|
182 |
push @messages, {type => 'error', code => 'error_on_insert_cat' }; |
186 |
push @messages, {type => 'error', code => 'error_on_insert_cat' }; |
183 |
} else { |
187 |
} else { |
184 |
push @messages, { type => 'message', code => 'success_on_insert_cat' }; |
188 |
push @messages, { type => 'message', code => 'success_on_insert_cat' }; |
|
|
189 |
$searchfield = $new_category; |
185 |
} |
190 |
} |
186 |
} |
191 |
} |
187 |
|
192 |
|
188 |
$op = 'list'; |
193 |
$op = 'list'; |
189 |
$searchfield = $new_category; |
|
|
190 |
} elsif ($op eq 'delete') { |
194 |
} elsif ($op eq 'delete') { |
191 |
my $av = Koha::AuthorisedValues->new->find( $input->param('id') ); |
195 |
my $av = Koha::AuthorisedValues->new->find( $input->param('id') ); |
192 |
my $deleted = eval {$av->delete}; |
196 |
my $deleted = eval {$av->delete}; |
193 |
- |
|
|