Last change
on this file since 1888 was
1068,
checked in by nanardon, 12 years ago
|
- fix another call to default_base
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Rev | Line | |
---|
[960] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use LATMOS::Accounts; |
---|
| 6 | use LATMOS::Accounts::Bases::Sql::DataRequest; |
---|
| 7 | use LATMOS::Accounts::Log; |
---|
| 8 | use Getopt::Long; |
---|
| 9 | use Pod::Usage; |
---|
| 10 | |
---|
| 11 | =head1 NAME |
---|
| 12 | |
---|
| 13 | la-sql-list-request - List pending change request |
---|
| 14 | |
---|
| 15 | =head1 SYNOPSIS |
---|
| 16 | |
---|
| 17 | la-sql-list-request |
---|
| 18 | |
---|
| 19 | =cut |
---|
| 20 | |
---|
| 21 | GetOptions( |
---|
| 22 | 'c|config=s' => \my $config, |
---|
| 23 | 'b|base=s' => \my $base, |
---|
| 24 | 'help' => sub { pod2usage(0) }, |
---|
| 25 | ) or pod2usage(); |
---|
| 26 | |
---|
| 27 | =head1 OPTIONS |
---|
| 28 | |
---|
| 29 | =over 4 |
---|
| 30 | |
---|
| 31 | =item -c|--config configdir |
---|
| 32 | |
---|
| 33 | Use this configuration directory instead of the default one. |
---|
| 34 | |
---|
| 35 | =item -b|--base base |
---|
| 36 | |
---|
| 37 | Use this base instead default one |
---|
| 38 | |
---|
| 39 | =back |
---|
| 40 | |
---|
| 41 | =head1 CONFIGURATION |
---|
| 42 | |
---|
| 43 | Some variables are taken from configuration directory: |
---|
| 44 | |
---|
| 45 | =over 4 |
---|
| 46 | |
---|
| 47 | =cut |
---|
| 48 | |
---|
| 49 | my $LA = LATMOS::Accounts->new($config, noacl => 1); |
---|
[1068] | 50 | my $labase = $LA->base($base); |
---|
[960] | 51 | $labase && $labase->load or die "Cannot load base"; |
---|
| 52 | $labase->wexported(1); |
---|
| 53 | |
---|
| 54 | foreach ($labase->list_requests) { |
---|
| 55 | my $datareq = $labase->get_datarequest($_); |
---|
| 56 | |
---|
| 57 | printf("%-05d %-10s: by %-10s %-11s %s\n", |
---|
| 58 | $datareq->ar_id, |
---|
| 59 | $datareq->accreq->id, |
---|
| 60 | $datareq->user || '(nobody)', |
---|
| 61 | $datareq->oobject ? $datareq->oobject->id : '', |
---|
| 62 | $datareq->apply, |
---|
| 63 | ) |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | exit(0); |
---|
Note: See
TracBrowser
for help on using the repository browser.