Lines 155-174
my $verbose = 0;
Link Here
|
155 |
my $help = 0; |
155 |
my $help = 0; |
156 |
my $host = ''; |
156 |
my $host = ''; |
157 |
my $host_pro = ''; |
157 |
my $host_pro = ''; |
158 |
my $html = 0; |
158 |
my $html = ''; |
159 |
my $uriedit = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber="; |
159 |
my $uriedit = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber="; |
160 |
my $agent = ''; |
160 |
my $agent = ''; |
161 |
my $timeout = 15; |
161 |
my $timeout = 15; |
162 |
GetOptions( |
162 |
GetOptions( |
163 |
'verbose' => \$verbose, |
163 |
'verbose' => \$verbose, |
164 |
'html' => \$html, |
164 |
'html:s' => \$html, |
165 |
'help' => \$help, |
165 |
'help' => \$help, |
166 |
'host=s' => \$host, |
166 |
'host=s' => \$host, |
167 |
'host-pro=s' => \$host_pro, |
167 |
'host-pro=s' => \$host_pro, |
168 |
'agent=s' => \$agent, |
168 |
'agent=s' => \$agent, |
169 |
'timeout=i', => \$timeout, |
169 |
'timeout=i', => \$timeout, |
170 |
); |
170 |
); |
171 |
|
171 |
my $htmlfh; |
172 |
|
172 |
|
173 |
sub usage { |
173 |
sub usage { |
174 |
pod2usage( -verbose => 2 ); |
174 |
pod2usage( -verbose => 2 ); |
Lines 195-202
sub check_all_url {
Link Here
|
195 |
my $sth = $dbh->prepare( |
195 |
my $sth = $dbh->prepare( |
196 |
"SELECT biblionumber FROM biblioitems WHERE url <> ''" ); |
196 |
"SELECT biblionumber FROM biblioitems WHERE url <> ''" ); |
197 |
$sth->execute; |
197 |
$sth->execute; |
198 |
if ( $html ) { |
198 |
if ( $htmlfh ) { |
199 |
print <<EOS; |
199 |
print $htmlfh <<EOS; |
200 |
<html> |
200 |
<html> |
201 |
<body> |
201 |
<body> |
202 |
<table> |
202 |
<table> |
Lines 207-222
EOS
Link Here
|
207 |
next unless $result; # No URL |
207 |
next unless $result; # No URL |
208 |
foreach my $url ( @$result ) { |
208 |
foreach my $url ( @$result ) { |
209 |
if ( ! $url->{ is_success } || $verbose ) { |
209 |
if ( ! $url->{ is_success } || $verbose ) { |
210 |
print $html |
210 |
if($htmlfh){ |
211 |
? "<tr>\n<td>" . bibediturl( $biblionumber ) . |
211 |
my $message = "<tr>\n<td>" . bibediturl( $biblionumber ) . |
212 |
"</td>\n<td>" . $url->{url} . "</td>\n<td>" . |
212 |
"</td>\n<td>" . $url->{url} . "</td>\n<td>" . |
213 |
$url->{status} . "</td>\n</tr>\n\n" |
213 |
$url->{status} . "</td>\n</tr>\n\n"; |
214 |
: "$biblionumber\t" . $url->{ url } . "\t" . |
214 |
print $htmlfh $message; |
215 |
$url->{ status } . "\n"; |
215 |
} |
|
|
216 |
print "$biblionumber\t$url->{ url }\t$url->{ status }\n" if (!$htmlfh || $verbose); |
216 |
} |
217 |
} |
217 |
} |
218 |
} |
218 |
} |
219 |
} |
219 |
print "</table>\n</body>\n</html>\n" if $html; |
220 |
print $htmlfh "</table>\n</body>\n</html>\n" if $htmlfh; |
220 |
} |
221 |
} |
221 |
|
222 |
|
222 |
|
223 |
|
Lines 233-240
if ( $html && !$host_pro ) {
Link Here
|
233 |
exit; |
234 |
exit; |
234 |
} |
235 |
} |
235 |
} |
236 |
} |
236 |
|
237 |
if($html){ |
237 |
check_all_url(); |
238 |
open($htmlfh, '>', $html) or die $!; |
|
|
239 |
} |
240 |
check_all_url(); |
241 |
close $htmlfh if $htmlfh; |
238 |
|
242 |
|
239 |
|
243 |
|
240 |
|
244 |
|
241 |
- |
|
|