Lines 101-107
if ($op eq 'add_form') {
Link Here
|
101 |
my $imageurl = $input->param( 'imageurl' ) || ''; |
101 |
my $imageurl = $input->param( 'imageurl' ) || ''; |
102 |
$imageurl = '' if $imageurl =~ /removeImage/; |
102 |
$imageurl = '' if $imageurl =~ /removeImage/; |
103 |
my $duplicate_entry = 0; |
103 |
my $duplicate_entry = 0; |
104 |
my @branches = $input->param('branches'); |
104 |
my @branches = grep { $_ ne q{} } $input->param('branches'); |
105 |
|
105 |
|
106 |
if ( $id ) { # Update |
106 |
if ( $id ) { # Update |
107 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
107 |
my $av = Koha::AuthorisedValues->new->find( $id ); |
Lines 113-119
if ($op eq 'add_form') {
Link Here
|
113 |
$av->imageurl( $imageurl ); |
113 |
$av->imageurl( $imageurl ); |
114 |
eval{ |
114 |
eval{ |
115 |
$av->store; |
115 |
$av->store; |
116 |
$av->branch_limitations( \@branches ); |
116 |
$av->replace_branch_limitations( \@branches ); |
117 |
}; |
117 |
}; |
118 |
if ( $@ ) { |
118 |
if ( $@ ) { |
119 |
push @messages, {type => 'error', code => 'error_on_update' }; |
119 |
push @messages, {type => 'error', code => 'error_on_update' }; |
Lines 129-138
if ($op eq 'add_form') {
Link Here
|
129 |
lib_opac => $input->param('lib_opac') || undef, |
129 |
lib_opac => $input->param('lib_opac') || undef, |
130 |
imageurl => $imageurl, |
130 |
imageurl => $imageurl, |
131 |
} ); |
131 |
} ); |
|
|
132 |
|
132 |
eval { |
133 |
eval { |
133 |
$av->store; |
134 |
$av->store; |
134 |
$av->branch_limitations( \@branches ); |
135 |
$av->replace_branch_limitations( \@branches ); |
135 |
}; |
136 |
}; |
|
|
137 |
|
136 |
if ( $@ ) { |
138 |
if ( $@ ) { |
137 |
push @messages, {type => 'error', code => 'error_on_insert' }; |
139 |
push @messages, {type => 'error', code => 'error_on_insert' }; |
138 |
} else { |
140 |
} else { |
139 |
- |
|
|