View | Details | Raw Unified | Return to bug 10363
Collapse All | Expand All

(-)a/Koha/AuthorisedValues.pm (-5 / +1 lines)
Lines 59-69 sub search { Link Here
59
      }
59
      }
60
      : {};
60
      : {};
61
    my $join = $branchcode ? { join => 'authorised_values_branches' } : {};
61
    my $join = $branchcode ? { join => 'authorised_values_branches' } : {};
62
    my $rs = $self->_resultset()
62
    return $self->SUPER::search( { %$params, %$or, }, $join );
63
      ->search( { %$params, %$or, }, $join );
64
65
    my $class = ref($self);
66
    return wantarray ? $self->_wrap( $rs->all() ) : $class->_new_from_dbic($rs);
67
}
63
}
68
64
69
sub categories {
65
sub categories {
(-)a/admin/authorised_values.pl (-1 / +11 lines)
Lines 102-108 if ($op eq 'add_form') { Link Here
102
    my $duplicate_entry = 0;
102
    my $duplicate_entry = 0;
103
    my @branches = grep { $_ ne q{} } $input->param('branches');
103
    my @branches = grep { $_ ne q{} } $input->param('branches');
104
104
105
    if ( $id ) { # Update
105
    my $already_exists = Koha::AuthorisedValues->search(
106
        {
107
            category => $new_category,
108
            authorised_value => $new_authorised_value,
109
        }
110
    )->count;
111
112
    if ( $already_exists ) {
113
        push @messages, {type => 'error', code => 'already_exists' };
114
    }
115
    elsif ( $id ) { # Update
106
        my $av = Koha::AuthorisedValues->new->find( $id );
116
        my $av = Koha::AuthorisedValues->new->find( $id );
107
117
108
        $av->lib( $input->param('lib') || undef );
118
        $av->lib( $input->param('lib') || undef );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (-1 / +2 lines)
Lines 184-189 $(document).ready(function() { Link Here
184
            Authorized value inserted successfully.
184
            Authorized value inserted successfully.
185
        [% CASE 'success_on_delete' %]
185
        [% CASE 'success_on_delete' %]
186
            Authorized value deleted successfully.
186
            Authorized value deleted successfully.
187
        [% CASE 'already_exists' %]
188
            This authorized value already exists.
187
        [% CASE %]
189
        [% CASE %]
188
            [% m.code %]
190
            [% m.code %]
189
        [% END %]
191
        [% END %]
190
- 

Return to bug 10363