View | Details | Raw Unified | Return to bug 11441
Collapse All | Expand All

(-)a/misc/migration_tools/remove_unused_authorities.pl (-8 / +4 lines)
Lines 46-61 if ($test) { Link Here
46
}
46
}
47
47
48
my $dbh=C4::Context->dbh;
48
my $dbh=C4::Context->dbh;
49
@authtypes or @authtypes = qw( NC );
50
my $thresholdmin=0;
49
my $thresholdmin=0;
51
my $thresholdmax=0;
50
my $thresholdmax=0;
52
my @results;
51
my @results;
53
# prepare the request to retrieve all authorities of the requested types
52
# prepare the request to retrieve all authorities of the requested types
54
my $rqselect = $dbh->prepare(
53
my $rqsql = "SELECT * from auth_header where 1";
55
    qq{SELECT * from auth_header where authtypecode IN (}
54
$rqsql .= " AND authtypecode IN (".join(",",map{$dbh->quote($_)}@authtypes).")" if @authtypes;
56
    . join(",",map{$dbh->quote($_)}@authtypes)
55
my $rqselect = $dbh->prepare($rqsql);
57
    . ")"
58
);
59
$|=1;
56
$|=1;
60
57
61
$rqselect->execute;
58
$rqselect->execute;
Lines 89-95 sub print_usage { Link Here
89
    print <<_USAGE_;
86
    print <<_USAGE_;
90
$0: Removes unused authorities.
87
$0: Removes unused authorities.
91
88
92
This script will parse all authoritiestypes given as parameter, and remove authorities without any biblio attached.
89
This script will parse all authoritiestypes (or only those given as parameter), and remove authorities without any biblio attached.
93
warning : there is no individual confirmation !
90
warning : there is no individual confirmation !
94
parameters
91
parameters
95
    --aut|authtypecode TYPE       the list of authtypes to check
92
    --aut|authtypecode TYPE       the list of authtypes to check
96
- 

Return to bug 11441