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 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
    )->next;
112
113
    if ( $already_exists and ( not $id or $already_exists->id != $id ) ) {
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 );
(-)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