|
Lines 149-158
sub _autocreate {
Link Here
|
| 149 |
} |
149 |
} |
| 150 |
|
150 |
|
| 151 |
while ( my ( $key, $entry ) = each %{ $config->{'mapping'} } ) { |
151 |
while ( my ( $key, $entry ) = each %{ $config->{'mapping'} } ) { |
|
|
152 |
next unless $entry->{'sync_on_creation'}; |
| 152 |
my $value = |
153 |
my $value = |
| 153 |
C4::Context->psgi_env |
154 |
C4::Context->psgi_env |
| 154 |
? ( $entry->{'is'} && $ENV{ "HTTP_" . uc( $entry->{'is'} ) } ) || $entry->{'content'} || '' |
155 |
? ( $entry->{'is'} && $ENV{ "HTTP_" . uc( $entry->{'is'} ) } ) // $entry->{'content'} // '' |
| 155 |
: ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || ''; |
156 |
: ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) // $entry->{'content'} // ''; |
| 156 |
if ( $key =~ /^patron_attribute:(.+)$/ ) { |
157 |
if ( $key =~ /^patron_attribute:(.+)$/ ) { |
| 157 |
$patron_attrs{$1} = $value; |
158 |
$patron_attrs{$1} = $value; |
| 158 |
} else { |
159 |
} else { |
|
Lines 213-222
sub _sync {
Link Here
|
| 213 |
my ( %borrower, %patron_attrs ); |
214 |
my ( %borrower, %patron_attrs ); |
| 214 |
$borrower{'borrowernumber'} = $borrowernumber; |
215 |
$borrower{'borrowernumber'} = $borrowernumber; |
| 215 |
while ( my ( $key, $entry ) = each %{ $config->{'mapping'} } ) { |
216 |
while ( my ( $key, $entry ) = each %{ $config->{'mapping'} } ) { |
|
|
217 |
next unless $entry->{'sync_on_update'}; |
| 216 |
my $value = |
218 |
my $value = |
| 217 |
C4::Context->psgi_env |
219 |
C4::Context->psgi_env |
| 218 |
? ( $entry->{'is'} && $ENV{ "HTTP_" . uc( $entry->{'is'} ) } ) || $entry->{'content'} || '' |
220 |
? ( $entry->{'is'} && $ENV{ "HTTP_" . uc( $entry->{'is'} ) } ) |
| 219 |
: ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || ''; |
221 |
: ( $entry->{'is'} && $ENV{ $entry->{'is'} } ); |
|
|
222 |
next unless defined $value; |
| 223 |
|
| 220 |
if ( $key =~ /^patron_attribute:(.+)$/ ) { |
224 |
if ( $key =~ /^patron_attribute:(.+)$/ ) { |
| 221 |
$patron_attrs{$1} = $value; |
225 |
$patron_attrs{$1} = $value; |
| 222 |
} else { |
226 |
} else { |