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

(-)a/admin/smart-rules.pl (-60 / +16 lines)
Lines 204-269 if ( $op eq 'cud-delete' ) { Link Here
204
        );
204
        );
205
    }
205
    }
206
} elsif ( $op eq 'cud-delete-branch-item' ) {
206
} elsif ( $op eq 'cud-delete-branch-item' ) {
207
    my $itemtype = $input->param('itemtype');
207
    my $itemtype    = $input->param('itemtype');
208
    if ( $branch eq "*" ) {
208
    my $rule_branch = $branch eq '*' ? undef : $branch;
209
        if ( $itemtype eq "*" ) {
209
    my $rule_itemtype =
210
            Koha::CirculationRules->set_rules(
210
        $itemtype eq '*' ? undef : $itemtype;    #NOTE: This shouldn't be a thing - is a branch default rule if '*'
211
                {
211
    Koha::CirculationRules->set_rules(
212
                    branchcode => undef,
212
        {
213
                    itemtype   => undef,
213
            branchcode => $rule_branch,
214
                    rules      => {
214
            itemtype   => $rule_itemtype,
215
                        holdallowed             => undef,
215
            rules      => {
216
                        hold_fulfillment_policy => undef,
216
                holdallowed             => undef,
217
                        bookings_lead_period    => undef,
217
                hold_fulfillment_policy => undef,
218
                        bookings_trail_period   => undef,
218
                bookings_lead_period    => undef,
219
                        returnbranch            => undef,
219
                bookings_trail_period   => undef,
220
                    }
220
                returnbranch            => undef,
221
                }
222
            );
223
        } else {
224
            Koha::CirculationRules->set_rules(
225
                {
226
                    branchcode => undef,
227
                    itemtype   => $itemtype,
228
                    rules      => {
229
                        holdallowed             => undef,
230
                        hold_fulfillment_policy => undef,
231
                        bookings_lead_period    => undef,
232
                        bookings_trail_period   => undef,
233
                        returnbranch            => undef,
234
                    }
235
                }
236
            );
237
        }
238
    } elsif ( $itemtype eq "*" ) {
239
        Koha::CirculationRules->set_rules(
240
            {
241
                branchcode => $branch,
242
                itemtype   => undef,
243
                rules      => {
244
                    holdallowed             => undef,
245
                    hold_fulfillment_policy => undef,
246
                    bookings_lead_period    => undef,
247
                    bookings_trail_period   => undef,
248
                    returnbranch            => undef,
249
                }
250
            }
251
        );
252
    } else {
253
        Koha::CirculationRules->set_rules(
254
            {
255
                branchcode => $branch,
256
                itemtype   => $itemtype,
257
                rules      => {
258
                    holdallowed             => undef,
259
                    hold_fulfillment_policy => undef,
260
                    bookings_lead_period    => undef,
261
                    bookings_trail_period   => undef,
262
                    returnbranch            => undef,
263
                }
264
            }
221
            }
265
        );
222
        }
266
    }
223
    );
267
}
224
}
268
225
269
# save the values entered
226
# save the values entered
270
- 

Return to bug 41268