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

(-)a/lib/Koha/Item.pm (-10 / +26 lines)
Lines 2733-2753 sub _check_location_update_rules { Link Here
2733
    }
2733
    }
2734
2734
2735
    if ($update_loc_rules) {
2735
    if ($update_loc_rules) {
2736
        if (defined($update_loc_rules->{'_ALL_'})) {
2736
        $self->_check_location_update_interface($update_loc_rules);
2737
            return $self->_check_location_update_rule($update_loc_rules->{'_ALL_'});
2737
    }
2738
        }
2738
}
2739
        elsif (defined($update_loc_rules->{$self->location//''})) {
2739
2740
            return $self->_check_location_update_rule($update_loc_rules->{$self->location});
2740
sub _check_location_update_interface {
2741
        }
2741
    my ($self, $update_loc_rules) = @_;
2742
        elsif (defined($update_loc_rules->{'_DEFAULT_'})) {
2742
    my $new_location;
2743
            return $self->_check_location_update_rule($update_loc_rules->{'_DEFAULT_'});
2743
2744
        }
2744
    if (my $update_loc_rules = $update_loc_rules->{C4::Context->interface()}) {
2745
        $new_location = $self->_check_location_update_rule($update_loc_rules);
2745
    }
2746
    }
2747
    $new_location = $self->_check_location_update_rule($update_loc_rules) unless (defined($new_location));
2748
    return $new_location;
2746
}
2749
}
2747
2750
2748
sub _check_location_update_rule {
2751
sub _check_location_update_rule {
2749
    my ($self, $update_loc_rule) = @_;
2752
    my ($self, $update_loc_rule) = @_;
2750
2753
2754
    if (defined($update_loc_rule->{'_ALL_'})) {
2755
        return $self->_check_location_update_rule2($update_loc_rule->{'_ALL_'});
2756
    }
2757
    elsif (defined($update_loc_rule->{$self->location//''})) {
2758
        return $self->_check_location_update_rule2($update_loc_rule->{$self->location});
2759
    }
2760
    elsif (defined($update_loc_rule->{'_DEFAULT_'})) {
2761
        return $self->_check_location_update_rule2($update_loc_rule->{'_DEFAULT_'});
2762
    }
2763
}
2764
2765
sub _check_location_update_rule2 {
2766
    my ($self, $update_loc_rule) = @_;
2767
2751
    if ($update_loc_rule eq '_PERM_') {
2768
    if ($update_loc_rule eq '_PERM_') {
2752
        $update_loc_rule = $self->permanent_location;
2769
        $update_loc_rule = $self->permanent_location;
2753
    }
2770
    }
2754
- 

Return to bug 29326