Lines 3-8
Link Here
|
3 |
# This file is part of Koha. |
3 |
# This file is part of Koha. |
4 |
# |
4 |
# |
5 |
# Copyright 2013 BibLibre |
5 |
# Copyright 2013 BibLibre |
|
|
6 |
# Copyright 2021 Catalyst IT |
6 |
# |
7 |
# |
7 |
# Koha is free software; you can redistribute it and/or modify it |
8 |
# Koha is free software; you can redistribute it and/or modify it |
8 |
# under the terms of the GNU General Public License as published by |
9 |
# under the terms of the GNU General Public License as published by |
Lines 65-70
if ( $op eq 'update' ) {
Link Here
|
65 |
my @substitution_values = $cgi->multi_param("substitution_value_$unique_id"); |
66 |
my @substitution_values = $cgi->multi_param("substitution_value_$unique_id"); |
66 |
my @condition_fields = $cgi->multi_param("condition_field_$unique_id"); |
67 |
my @condition_fields = $cgi->multi_param("condition_field_$unique_id"); |
67 |
my @condition_values = $cgi->multi_param("condition_value_$unique_id"); |
68 |
my @condition_values = $cgi->multi_param("condition_value_$unique_id"); |
|
|
69 |
my @age_fields = $cgi->multi_param("agefield_$unique_id"); |
68 |
my $rule = { |
70 |
my $rule = { |
69 |
substitutions => [], |
71 |
substitutions => [], |
70 |
conditions => [], |
72 |
conditions => [], |
Lines 84-89
if ( $op eq 'update' ) {
Link Here
|
84 |
push @{ $rule->{conditions} }, {} |
86 |
push @{ $rule->{conditions} }, {} |
85 |
unless @{ $rule->{conditions} }; |
87 |
unless @{ $rule->{conditions} }; |
86 |
$rule->{age} = $cgi->param("age_$unique_id"); |
88 |
$rule->{age} = $cgi->param("age_$unique_id"); |
|
|
89 |
|
90 |
for my $age_field ( @age_fields ) { |
91 |
$rule->{agefield} = $age_field ? $age_field : "items.dateaccessioned"; |
92 |
} |
87 |
push @rules, $rule; |
93 |
push @rules, $rule; |
88 |
} |
94 |
} |
89 |
my $syspref_content = to_json( \@rules ); |
95 |
my $syspref_content = to_json( \@rules ); |
Lines 109-117
if ( $@ ) {
Link Here
|
109 |
|
115 |
|
110 |
my @item_fields = map { "items.$_" } Koha::Items->columns; |
116 |
my @item_fields = map { "items.$_" } Koha::Items->columns; |
111 |
my @biblioitem_fields = map { "biblioitems.$_" } Koha::Biblioitems->columns; |
117 |
my @biblioitem_fields = map { "biblioitems.$_" } Koha::Biblioitems->columns; |
|
|
118 |
my @age_fields = ('items.dateaccessioned', 'items.replacementpricedate', 'items.datelastborrowed', 'items.datelastseen', 'items.damaged_on', 'items.itemlost_on', 'items.withdrawn_on'); |
112 |
$template->param( |
119 |
$template->param( |
113 |
op => $op, |
120 |
op => $op, |
114 |
messages => \@messages, |
121 |
messages => \@messages, |
|
|
122 |
agefields => [ @age_fields ], |
115 |
condition_fields => [ @item_fields, @biblioitem_fields ], |
123 |
condition_fields => [ @item_fields, @biblioitem_fields ], |
116 |
substitution_fields => \@item_fields, |
124 |
substitution_fields => \@item_fields, |
117 |
rules => $rules, |
125 |
rules => $rules, |
118 |
- |
|
|