Lines 40-45
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
Link Here
|
40 |
my $op = $cgi->param('op') || 'show'; |
40 |
my $op = $cgi->param('op') || 'show'; |
41 |
my @ids = $cgi->multi_param('id'); |
41 |
my @ids = $cgi->multi_param('id'); |
42 |
|
42 |
|
|
|
43 |
my $copy = $cgi->param('copy'); |
44 |
my $name = $cgi->param('name'); |
45 |
my @fields = qw( |
46 |
preferred_name |
47 |
initials |
48 |
othernames |
49 |
branchcode |
50 |
cardnumber |
51 |
categorycode |
52 |
address |
53 |
address2 |
54 |
city |
55 |
state |
56 |
zipcode |
57 |
country |
58 |
dateenrolled |
59 |
date_renewed |
60 |
dateexpiry |
61 |
dateofbirth |
62 |
debarred |
63 |
email |
64 |
emailpro |
65 |
phone |
66 |
phonepro |
67 |
mobile |
68 |
sex |
69 |
updated_on |
70 |
userid |
71 |
); |
72 |
|
73 |
my %data; |
74 |
|
75 |
for my $field (@fields) { |
76 |
my $val = $cgi->param($field); |
77 |
|
78 |
if ( defined $val ) { |
79 |
$data{$field} = $val; |
80 |
} |
81 |
} |
82 |
|
83 |
if ($name) { |
84 |
my @names = split( ', ', $name ); |
85 |
$data{'firstname'} = $names[0]; |
86 |
$data{'surname'} = $names[1]; |
87 |
} |
88 |
|
43 |
if ( $op eq 'show' ) { |
89 |
if ( $op eq 'show' ) { |
44 |
my $patrons = Koha::Patrons->search( { borrowernumber => { -in => \@ids } } ); |
90 |
my $patrons = Koha::Patrons->search( { borrowernumber => { -in => \@ids } } ); |
45 |
$template->param( patrons => $patrons ); |
91 |
$template->param( patrons => $patrons ); |
Lines 56-61
if ( $op eq 'show' ) {
Link Here
|
56 |
keeper => $keeper, |
102 |
keeper => $keeper, |
57 |
results => $results |
103 |
results => $results |
58 |
); |
104 |
); |
|
|
105 |
if ($copy) { |
106 |
$keeper->set( \%data )->store(); |
107 |
} |
59 |
} catch { |
108 |
} catch { |
60 |
$template->param( error => $_ ); |
109 |
$template->param( error => $_ ); |
61 |
} |
110 |
} |
62 |
- |
|
|