Lines 131-147
sub approve {
Link Here
|
131 |
); |
131 |
); |
132 |
} |
132 |
} |
133 |
foreach my $attr ( @{$extended_attributes} ) { |
133 |
foreach my $attr ( @{$extended_attributes} ) { |
|
|
134 |
$attr->{attribute} = exists $attr->{attribute} ? $attr->{attribute} : $attr->{value}; |
134 |
Koha::Patron::Attribute->new( |
135 |
Koha::Patron::Attribute->new( |
135 |
{ borrowernumber => $patron->borrowernumber, |
136 |
{ borrowernumber => $patron->borrowernumber, |
136 |
code => $attr->{code}, |
137 |
code => $attr->{code}, |
137 |
attribute => $attr->{value} |
138 |
attribute => $attr->{attribute}, |
138 |
} |
139 |
} |
139 |
)->store |
140 |
)->store |
140 |
if $attr->{value} # there's a value |
141 |
if $attr->{attribute} # there's a value |
141 |
or |
142 |
or |
142 |
( defined $attr->{value} # there's a value that is 0, and not |
143 |
( defined $attr->{attribute} # there's a value that is 0, and not |
143 |
&& $attr->{value} ne "" # the empty string which means delete |
144 |
&& $attr->{attribute} ne "" # the empty string which means delete |
144 |
&& $attr->{value} == 0 |
145 |
&& $attr->{attribute} == 0 |
145 |
); |
146 |
); |
146 |
} |
147 |
} |
147 |
} |
148 |
} |