Lines 34-40
sub usage {
Link Here
|
34 |
|
34 |
|
35 |
|
35 |
|
36 |
sub force_borrower_messaging_defaults { |
36 |
sub force_borrower_messaging_defaults { |
37 |
my ($doit, $since, $not_expired, $no_overwrite, $category ) = @_; |
37 |
my ($doit, $since, $not_expired, $no_overwrite, $category, $branchcode ) = @_; |
38 |
|
38 |
|
39 |
print "Since: $since\n" if $since; |
39 |
print "Since: $since\n" if $since; |
40 |
|
40 |
|
Lines 56-63
WHERE 1|;
Link Here
|
56 |
$sql .= " AND mp.borrowernumber IS NULL"; |
56 |
$sql .= " AND mp.borrowernumber IS NULL"; |
57 |
} |
57 |
} |
58 |
$sql .= " AND bo.categorycode = ?" if $category; |
58 |
$sql .= " AND bo.categorycode = ?" if $category; |
|
|
59 |
$sql .= " AND bo.branchcode = ?" if $branchcode; |
59 |
my $sth = $dbh->prepare($sql); |
60 |
my $sth = $dbh->prepare($sql); |
60 |
$sth->execute($since || (), $category || () ); |
61 |
$sth->execute($since || (), $category || (), $branchcode || () ); |
61 |
my $cnt = 0; |
62 |
my $cnt = 0; |
62 |
while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { |
63 |
while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) { |
63 |
print "$borrowernumber: $categorycode\n"; |
64 |
print "$borrowernumber: $categorycode\n"; |
Lines 73-91
WHERE 1|;
Link Here
|
73 |
} |
74 |
} |
74 |
|
75 |
|
75 |
|
76 |
|
76 |
my ( $doit, $since, $help, $not_expired, $no_overwrite, $category ); |
77 |
my ( $doit, $since, $help, $not_expired, $no_overwrite, $category, $branchcode ); |
77 |
my $result = GetOptions( |
78 |
my $result = GetOptions( |
78 |
'doit' => \$doit, |
79 |
'doit' => \$doit, |
79 |
'since:s' => \$since, |
80 |
'since:s' => \$since, |
80 |
'not-expired' => \$not_expired, |
81 |
'not-expired' => \$not_expired, |
81 |
'no-overwrite' => \$no_overwrite, |
82 |
'no-overwrite' => \$no_overwrite, |
82 |
'category:s' => \$category, |
83 |
'category:s' => \$category, |
|
|
84 |
'library:s' => \$branchcode, |
83 |
'help|h' => \$help, |
85 |
'help|h' => \$help, |
84 |
); |
86 |
); |
85 |
|
87 |
|
86 |
usage() if $help; |
88 |
usage() if $help; |
87 |
|
89 |
|
88 |
force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category ); |
90 |
force_borrower_messaging_defaults( $doit, $since, $not_expired, $no_overwrite, $category, $branchcode ); |
89 |
|
91 |
|
90 |
=head1 NAME |
92 |
=head1 NAME |
91 |
|
93 |
|
Lines 98-103
borrowers-force-messaging-defaults.pl
Link Here
|
98 |
borrowers-force-messaging-defaults.pl --doit |
100 |
borrowers-force-messaging-defaults.pl --doit |
99 |
borrowers-force-messaging-defaults.pl --doit --not-expired |
101 |
borrowers-force-messaging-defaults.pl --doit --not-expired |
100 |
borrowers-force-messaging-defaults.pl --doit --category PT |
102 |
borrowers-force-messaging-defaults.pl --doit --category PT |
|
|
103 |
borrowers-force-messaging-defaults.pl --doit --library CPL |
101 |
|
104 |
|
102 |
=head1 DESCRIPTION |
105 |
=head1 DESCRIPTION |
103 |
|
106 |
|
Lines 134-139
already set their preferences.
Link Here
|
134 |
|
137 |
|
135 |
Will only update patrons in the category specified. |
138 |
Will only update patrons in the category specified. |
136 |
|
139 |
|
|
|
140 |
=item B<--library> |
141 |
|
142 |
Will only update patrons in the library specified. |
143 |
|
137 |
=item B<--since> |
144 |
=item B<--since> |
138 |
|
145 |
|
139 |
Will only update borrowers enrolled since the specified date. |
146 |
Will only update borrowers enrolled since the specified date. |
140 |
- |
|
|