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

(-)a/admin/itemtypes.pl (-6 / +5 lines)
Lines 110-116 if ( $op eq 'add_form' ) { Link Here
110
        eval { $itemtype->store; };
110
        eval { $itemtype->store; };
111
111
112
        if ($@) {
112
        if ($@) {
113
            push @messages, { type => 'error', code => 'error_on_update' };
113
            push @messages, { type => 'alert', code => 'error_on_update' };
114
        } else {
114
        } else {
115
            push @messages, { type => 'message', code => 'success_on_update' };
115
            push @messages, { type => 'message', code => 'success_on_update' };
116
        }
116
        }
Lines 137-149 if ( $op eq 'add_form' ) { Link Here
137
        eval { $itemtype->store; };
137
        eval { $itemtype->store; };
138
138
139
        if ($@) {
139
        if ($@) {
140
            push @messages, { type => 'error', code => 'error_on_insert' };
140
            push @messages, { type => 'alert', code => 'error_on_insert' };
141
        } else {
141
        } else {
142
            push @messages, { type => 'message', code => 'success_on_insert' };
142
            push @messages, { type => 'message', code => 'success_on_insert' };
143
        }
143
        }
144
    } else {
144
    } else {
145
        push @messages,
145
        push @messages,
146
          { type => 'error',
146
          { type => 'alert',
147
            code => 'already_exists',
147
            code => 'already_exists',
148
          };
148
          };
149
    }
149
    }
Lines 155-161 if ( $op eq 'add_form' ) { Link Here
155
    my $itemtype = Koha::ItemTypes->find($itemtype_code);
155
    my $itemtype = Koha::ItemTypes->find($itemtype_code);
156
    my $can_be_deleted = $itemtype->can_be_deleted();
156
    my $can_be_deleted = $itemtype->can_be_deleted();
157
    if ($can_be_deleted == 0) {
157
    if ($can_be_deleted == 0) {
158
        push @messages, { type => 'error', code => 'cannot_be_deleted'};
158
        push @messages, { type => 'alert', code => 'cannot_be_deleted'};
159
        $op = 'list';
159
        $op = 'list';
160
    } else {
160
    } else {
161
        $template->param( itemtype => $itemtype, );
161
        $template->param( itemtype => $itemtype, );
Lines 166-172 if ( $op eq 'add_form' ) { Link Here
166
    my $itemtype = Koha::ItemTypes->find($itemtype_code);
166
    my $itemtype = Koha::ItemTypes->find($itemtype_code);
167
    my $deleted = eval { $itemtype->delete };
167
    my $deleted = eval { $itemtype->delete };
168
    if ( $@ or not $deleted ) {
168
    if ( $@ or not $deleted ) {
169
        push @messages, { type => 'error', code => 'error_on_delete' };
169
        push @messages, { type => 'alert', code => 'error_on_delete' };
170
    } else {
170
    } else {
171
        push @messages, { type => 'message', code => 'success_on_delete' };
171
        push @messages, { type => 'message', code => 'success_on_delete' };
172
    }
172
    }
173
- 

Return to bug 22575