Index: trunk/LATMOS-Accounts-Web/MANIFEST
===================================================================
--- trunk/LATMOS-Accounts-Web/MANIFEST	(revision 2020)
+++ trunk/LATMOS-Accounts-Web/MANIFEST	(revision 2021)
@@ -42,5 +42,4 @@
 lib/LATMOS/Accounts/Web/Controller/Remote/PwReset.pm
 lib/LATMOS/Accounts/Web/Controller/Remote/Search.pm
-lib/LATMOS/Accounts/Web/Controller/Request.pm
 lib/LATMOS/Accounts/Web/Controller/Root.pm
 lib/LATMOS/Accounts/Web/Controller/Rpc.pm
@@ -123,7 +122,4 @@
 root/html/oaliases/Edit.tt
 root/html/oaliases/index.tt
-root/html/request/default.tt
-root/html/request/index.tt
-root/html/request/recorded.tt
 root/html/search/adv/index.tt
 root/html/search/index.tt
@@ -320,5 +316,4 @@
 t/controller_Remote-Search.t
 t/controller_Remote.t
-t/controller_Request.t
 t/controller_Search-Adv.t
 t/controller_Search.t
Index: trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Request.pm
===================================================================
--- trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Request.pm	(revision 2020)
+++ 	(revision )
@@ -1,115 +1,0 @@
-package LATMOS::Accounts::Web::Controller::Request;
-use Moose;
-use namespace::autoclean;
-
-BEGIN {extends 'Catalyst::Controller'; }
-
-=head1 NAME
-
-LATMOS::Accounts::Web::Controller::Request - Catalyst Controller
-
-=head1 DESCRIPTION
-
-Catalyst Controller.
-
-=head1 METHODS
-
-=cut
-
-
-=head2 index
-
-=cut
-
-sub index :Path :Args(0) {
-    my ( $self, $c ) = @_;
-
-}
-
-sub default :LocalPath {
-    my ( $self, $c, undef, $form, $obj ) = @_;
-
-    $obj ||= $c->req->param('obj');
-
-    my $accreq = $c->model('Accounts')->db->get_object('accreq', $form) or do {
-        $c->forward('/no_object');
-        return;
-    };
-    
-    my $otype = $accreq->get_attributes('oType');
-    $c->stash->{accreq} = $accreq;
-
-    if ($accreq->get_attributes('requireObject')) {
-        if (!$obj) {
-            $c->stash->{ofilter} = $c->model('AttrFilter', $otype);
-            $c->stash->{select_object} = 1;
-            return;
-        } else {
-            $c->stash->{object} = $c->model('Accounts')->db->get_object(
-                $otype, $obj
-            );
-        }
-    }
-
-    require LATMOS::Accounts::Bases::Sql::DataRequest;
-    $c->stash->{datarequest} =
-        LATMOS::Accounts::Bases::Sql::DataRequest->new($accreq);
-    $c->stash->{datarequest}->set_ptr_object($c->stash->{object})
-        if ($c->stash->{object});
-
-    $c->stash->{form} = $c->model(
-        'AttrForms',
-        '',
-        $c->stash->{datarequest},
-        $c->model('Accounts')->db
-    );
-
-    # Default apply date:
-    my @date = localtime( time + 3600 * 24 ); # eg: tomorrow
-    $c->stash->{default_apply_date} = sprintf(
-        '%02d/%02d/%d',
-        $date[3],
-        $date[4] + 1,
-        $date[5] + 1900
-    );
-
-    if ($c->req->param('send')) {
-        my %attrs;
-        foreach ($c->stash->{datarequest}->attributes) {
-            my $htmlname = $c->stash->{form}->attr_field_name($_);
-            my @vals = $c->req->param($htmlname);
-            $attrs{$_} = @vals > 1 ? \@vals : $vals[0];
-        }
-        if ($c->stash->{datarequest}->register(
-            { user => $c->user->{username},
-              apply => $c->req->param('apply') ||
-              $c->stash->{default_apply_date} },
-            %attrs,
-        )) {
-            $c->go('recorded');
-        }
-    }
-
-}
-
-sub recorded : Private {
-    my ($self, $c) = @_;
-
-    my %attrs = $c->stash->{datarequest}->get_values;
-    $c->stash->{values} = \%attrs;
-}
-
-=head1 AUTHOR
-
-olivier
-
-=head1 LICENSE
-
-This library is free software. You can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-__PACKAGE__->meta->make_immutable;
-
-1;
Index: trunk/LATMOS-Accounts-Web/root/html/request/default.tt
===================================================================
--- trunk/LATMOS-Accounts-Web/root/html/request/default.tt	(revision 2020)
+++ 	(revision )
@@ -1,67 +1,0 @@
-<!-- $Id$ -->
-
-<h2>[% accreq.get_attributes('description') | html %]</h2>
-
-[% IF select_object %]
-<form action="[% c.uri_for('/request', accreq.id) %]">
-<input name=q value="[% c.req.param('q') | html %]" id="q">
-
-<span style="display:none" id="list_objects_ind">Searching...</span>
-[% c.prototype.observe_field('q', {
-    url => c.uri_for('/ajax', 'select_objects_list', ofilter.otype),
-    with   => "'q='+value",
-    update => 'list_objects',
-    frequency => 1,
-    before => "document.getElementById('list_objects_ind').style.display='block';",
-    loaded => "document.getElementById('list_objects_ind').style.display='none';",
-}) %]
-
-<span id="list_objects">
-[% INCLUDE 'includes/select_objects_list.tt' %]
-</span>
-
-[% c.prototype.observe_field( 'obj',
-    {
-        update => "obj_span",
-        url => c.uri_for('/ajax', 'rawattr', accreq.get_attributes('oType')),
-        frequency => 1,
-        with   => "'attr=displayName&id=' + element.options[element.selectedIndex].text",
-    }
-) %]
-
-<span id="obj_span" style="margin-left: 1em"></span>
-<br>
-<input type="submit">
-</form>
-[% ELSE %]
-
-[% IF accreq.get_attributes('requireObject') %]
-<h3>[% datarequest.get_attributes('displayName') || datarequest.id %]</h3>
-[% END %]
-
-<form action="[% c.uri_for('/request', accreq.id, object.id) %]">
-[% FOREACH attr = datarequest.attributes %]
-[% IF loop.first %]
-<table>
-[% END %]
-<tr>
-[% attrinfo = datarequest.attribute_info(attr) %]
-<th>[% form.attr_label(attr, attrinfo.label) %]</th>
-<td>[% form.attr_field(attr) %]</td>
-</tr>
-[% IF loop.last %]
-<tr>
-<th>Date d'application</th>
-<td>
-[% form.attr_field('apply', { formtype => 'date', _noacl => 1, default => default_apply_date } ) %]
-</td>
-</tr>
-<tr><td></td><td>
-<input type="submit" name="send">
-</td></tr>
-</table>
-[% END %]
-[% END %]
-</form>
-
-[% END %]
Index: trunk/LATMOS-Accounts-Web/root/html/request/index.tt
===================================================================
--- trunk/LATMOS-Accounts-Web/root/html/request/index.tt	(revision 2020)
+++ 	(revision )
@@ -1,16 +1,0 @@
-<!-- $Id$ -->
-
-<h2>Formuler une demande:</h2>
-
-[% FOREACH h = c.model('Accounts').db.search_objects('accreq', 'exported=*') %]
-[% IF loop.first %]
-<ul>
-[% END %]
-[% o = c.model('Accounts').db.get_object('accreq', h) %]
-<li>
-<a href="[% c.uri_for(h) %]">[% o.get_attributes('description') || o.id | html %]</a>
-</li>
-[% IF loop.last %]
-</ul>
-[% END %]
-[% END %]
Index: trunk/LATMOS-Accounts-Web/root/html/request/recorded.tt
===================================================================
--- trunk/LATMOS-Accounts-Web/root/html/request/recorded.tt	(revision 2020)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<!-- $Id$ -->
-
-<h2>[% accreq.get_attributes('description') | html %]</h2>
-
-[% IF accreq.get_attributes('requireObject') %]
-<h3>[% datarequest.get_attributes('displayName') || datarequest.id %]</h3>
-[% END %]
-
-[% FOREACH attr = values.keys %]
-[% IF loop.first %]
-<table>
-[% END %]
-
-[% attrinfo = datarequest.attribute_info(attr) %]
-<tr>
-<th>[% form.attr_label(attr, attrinfo.label) %]</th>
-<td>
-[% FOREACH v = values.$attr %]
-[% v | html %]<br>
-[% END %]
-</td> 
-</tr>
-
-[% IF loop.last %]
-<tr>
-<th>Date d'application</th>
-<td>
-[% datarequest.apply | html %]
-</td>
-</tr>
-</table>
-[% END %]
-[% END %]
Index: trunk/LATMOS-Accounts-Web/t/controller_Request.t
===================================================================
--- trunk/LATMOS-Accounts-Web/t/controller_Request.t	(revision 2020)
+++ 	(revision )
@@ -1,10 +1,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-
-use Catalyst::Test 'LATMOS::Accounts::Web';
-use LATMOS::Accounts::Web::Controller::Request;
-
-ok( request('/request')->is_success, 'Request should succeed' );
-done_testing();
Index: trunk/LATMOS-Accounts/MANIFEST
===================================================================
--- trunk/LATMOS-Accounts/MANIFEST	(revision 2020)
+++ trunk/LATMOS-Accounts/MANIFEST	(revision 2021)
@@ -34,5 +34,4 @@
 bin/la-sql-find-expired
 bin/la-sql-freeip
-bin/la-sql-list-request
 bin/la-sql-log
 bin/la-sql-properties
@@ -46,5 +45,4 @@
 bin/la-sql-updsshfp
 bin/la-sql-upgrade.in
-bin/la-sql-valid-request
 bin/la-sync
 bin/la-sync-ctl
@@ -87,5 +85,4 @@
 lib/LATMOS/Accounts/Bases/Objects.pm
 lib/LATMOS/Accounts/Bases/Sql.pm
-lib/LATMOS/Accounts/Bases/Sql/Accreq.pm
 lib/LATMOS/Accounts/Bases/Sql/Address.pm
 lib/LATMOS/Accounts/Bases/Sql/Aliases.pm
@@ -95,5 +92,4 @@
 lib/LATMOS/Accounts/Bases/Sql/Nethost.pm
 lib/LATMOS/Accounts/Bases/Sql/Netzone.pm
-lib/LATMOS/Accounts/Bases/Sql/OCHelper/Accreq.pm
 lib/LATMOS/Accounts/Bases/Sql/Onlyaddress.pm
 lib/LATMOS/Accounts/Bases/Sql/Revaliases.pm
@@ -121,5 +117,4 @@
 lib/LATMOS/Accounts/Synchro.pm
 lib/LATMOS/Accounts/Task.pm
-lib/LATMOS/Accounts/Task/Automatedrequest.pm
 lib/LATMOS/Accounts/Task/Basessynchro.pm
 lib/LATMOS/Accounts/Task/Buildlistes.pm
Index: trunk/LATMOS-Accounts/bin/la-sql-list-request
===================================================================
--- trunk/LATMOS-Accounts/bin/la-sql-list-request	(revision 2020)
+++ 	(revision )
@@ -1,66 +1,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use LATMOS::Accounts;
-use LATMOS::Accounts::Bases::Sql::DataRequest;
-use LATMOS::Accounts::Log;
-use Getopt::Long;
-use Pod::Usage;
-
-=head1 NAME
-
-    la-sql-list-request - List pending change request
-
-=head1 SYNOPSIS
-
-    la-sql-list-request
-
-=cut
-
-GetOptions(
-    'c|config=s' => \my $config,
-    'b|base=s'   => \my $base,
-    'help'       => sub { pod2usage(0) },
-) or pod2usage();
-
-=head1 OPTIONS
-
-=over 4
-
-=item -c|--config configdir
-
-Use this configuration directory instead of the default one.
-
-=item -b|--base base
-
-Use this base instead default one
-
-=back
-
-=head1 CONFIGURATION
-
-Some variables are taken from configuration directory:
-
-=over 4
-
-=cut
-
-my $LA = LATMOS::Accounts->new($config, noacl => 1);
-my $labase = $LA->base($base);
-$labase && $labase->load or die "Cannot load base";
-$labase->wexported(1);
-
-foreach ($labase->list_requests) {
-    my $datareq = $labase->get_datarequest($_);
-
-    printf("%-05d %-10s: by %-10s %-11s %s\n",
-        $datareq->ar_id,
-        $datareq->accreq->id,
-        $datareq->user || '(nobody)',
-        $datareq->oobject ? $datareq->oobject->id : '',
-        $datareq->apply,
-    )
-}
-
-exit(0);
Index: trunk/LATMOS-Accounts/bin/la-sql-valid-request
===================================================================
--- trunk/LATMOS-Accounts/bin/la-sql-valid-request	(revision 2020)
+++ 	(revision )
@@ -1,152 +1,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use LATMOS::Accounts;
-use LATMOS::Accounts::Utils;
-use Getopt::Long;
-use Pod::Usage;
-
-=head1 NAME
-
-    la-sql-valid-request - Validate changes request
-
-=head1 SYNOPSIS
-
-    la-sql-valid-request [options] obj_id
-
-=cut
-
-GetOptions(
-    'c|config=s' => \my $config,
-    'b|base=s'   => \my $base,
-    'comment=s'  => \my $comment,
-    'help'       => sub { pod2usage(0) },
-) or pod2usage();
-
-=head1 OPTIONS
-
-=over 4
-
-=item -c|--config configdir
-
-Use this configuration directory instead of the default one.
-
-=item -b|--base basename
-
-Query this specific base instead of the default one.
-
-=back
-
-=cut
-
-if (!$ARGV[0]) {
-    warn "You must specify 'obj_id', aborting\n";
-    pod2usage();
-}
-
-my $LA = LATMOS::Accounts->new($config, noacl => 1);
-my $labase = $LA->base($base);
-$labase && $labase->load or die "Cannot load base";
-$labase->wexported(1);
-
-my $datarequest = $labase->get_datarequest($ARGV[0]) or do {
-    die "Data request $ARGV[0] not found\n";
-};
-
-sub input_from_handle {
-    my ($fh) = @_;
-    my %attr = LATMOS::Accounts::Utils::parse_obj_file($fh);
-    my $res = $datarequest->apply_to_object($comment, %attr);
-    if($res) {
-        print "Changes applied\n";
-        $LA->call_batch_sync;
-    }
-    return
-    $res ? 1 : 0;
-}
-
-sub create_object {
-    my ($fh) = @_;
-
-    my %attrs = LATMOS::Accounts::Utils::parse_obj_file($fh);
-
-    my %newvalues = $datarequest->_prepare_attrs(%attrs);
-
-    # this mean creating a new object (woot)
-    my $ochelper = $labase->ochelper($datarequest->otype);
-    my ($status, $info);
-
-    foreach my $attr (keys %newvalues) {
-        $info->{contents}{$attr} = $newvalues{$attr};
-    }
-    while (1) {
-        ($status, $info) = $ochelper->step($info);
-        if ($status eq 'CREATED') {
-            $datarequest->_register_applied($comment);
-            printf 
-                "Object %s %s created\n",
-                $datarequest->otype,
-                $info->{name}{content}; 
-            $labase->commit;
-            return 1;
-        } elsif ($status eq 'ERROR') {
-            die "Error when creating object\n";
-        } elsif ($status eq 'NEEDINFO') {
-            LATMOS::Accounts::Utils::dump_read_temp_file(
-                sub {
-                    my ($fh) = @_;
-                    if ($info->{name}{ask}) {
-                        printf $fh "name: %s\n", $info->{name}{content};
-                    }
-                    foreach (@{ $info->{ask} }) {
-                        printf $fh "%s: %s\n", $_, $info->{contents}{$_} || '';
-                    }
-                    return 1;
-                },
-                sub {
-                    my ($fh) = @_;
-                    my %attrs = LATMOS::Accounts::Utils::parse_obj_file($fh);
-                    if ($info->{name}{ask}) {
-                        $info->{name}{content} = $attrs{name};
-                        delete($attrs{name});
-                    }
-                    foreach (keys %attrs) {
-                        $info->{contents}{$_} = $attrs{$_};
-                    }
-                    return 1;
-                },
-            );
-            next;
-        }
-    }
-}
-
-exit(
-    ! LATMOS::Accounts::Utils::dump_read_temp_file(
-        sub {
-            my ($fh) = @_;
-            if ($datarequest->accreq->get_attributes('requireObject')) {
-                printf $fh "# Modify Object %s/%s\n",
-                $datarequest->otype,
-                $datarequest->oobject->id;
-            }
-            my %vals = $datarequest->get_values;
-            foreach my $attr ($datarequest->attributes) {
-                foreach (ref $vals{$attr} ? @{ $vals{$attr} } :
-                    $vals{$attr}) {
-                    printf $fh "$attr: %s\n", $_ || '';
-                }
-            }
-            return 1;
-        },
-        sub {
-            my ($fh) = @_;
-            if ($datarequest->is_for_new_object) {
-                return create_object($fh);
-            } else {
-                return input_from_handle($fh);
-            }
-        }
-    )
-);
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Accreq.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Accreq.pm	(revision 2020)
+++ 	(revision )
@@ -1,185 +1,0 @@
-package LATMOS::Accounts::Bases::Sql::Accreq;
-
-use 5.010000;
-use strict;
-use warnings;
-
-use LATMOS::Accounts::Utils;
-use LATMOS::Accounts::Log;
-use base qw(LATMOS::Accounts::Bases::Sql::objects);
-use YAML;
-
-our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0];
-
-=head1 NAME
-
-LATMOS::Accounts::Bases::Sql::Accreq - Accreq object in LATMOS::Accounts system
-
-=head1 DESCRIPTION
-
-The C<Accreq> object is a form handle information about form allowing user to
-request admin for change
-
-=head1 FUNCTIONS
-
-=cut
-
-sub _yaml_attr { qw(description notifyMail) }
-
-sub _object_table { 'accreq' }
-
-sub _key_field { 'name' }
-
-sub _has_extended_attributes { 1 }
-
-sub _get_attr_schema {
-    my ($class, $base) = @_;
-
-    $class->SUPER::_get_attr_schema($base,
-        {
-            unexported  => { inline => 1, formtype => 'CHECKBOX',},
-            name        => { inline => 1, ro => 1, },
-            create      => { inline => 1, ro => 1, },
-            date        => { inline => 1, ro => 1, },
-            attributes  => {
-                ro => 1,
-                multiple => 1,
-                get => sub {
-                    my ($self) = @_;
-                    my $ref = _parse_form($self,
-                        $self->object->get_attributes('form'));
-                    my @attributes = ();
-                    my @attrs = @{ $ref->{attrs} };
-                    while (my $attr = shift(@attrs)) {
-                        my $attrname = ref $attr
-                        ? $attr->{name}
-                        : $attr;
-                        push(@attributes, $attrname);
-                    }
-                    \@attributes
-                },
-            },
-            oType       => {
-                can_values => sub {
-                    return $base->list_supported_objects
-                },
-                mandatory => 1,
-            },
-            requireObject => { formtype => 'CHECKBOX', },
-            hidden => { formtype => 'CHECKBOX', },
-            form => {
-                get => sub {
-                    my ($self) = @_;
-                    if (my $obj = $self->object) {
-                        my $res = $obj->parse_form;
-                        foreach (_yaml_attr()) {
-                            $res->{$_} = $obj->get_field($_);
-                        }
-                        return YAML::freeze($res);
-                    } else {
-                        return;
-                    }
-                },
-                set => sub {
-                    my ($self, $yaml) = @_;
-                    my $res = _parse_form($self, $yaml)
-                        or return 0;
-                    my %attrs;
-                    foreach (_yaml_attr()) {
-                        $attrs{$_} = $res->{$_} if (exists($res->{$_}));
-                    }
-                    $self->object->set_fields(%attrs, form => $yaml);
-                },
-            },
-            comment => { },
-            description => { },
-            notifyMail => { },
-        }
-    )
-}
-
-=head2 parse_form
-
-Load C<form> attribute and return reference to data read from YAML data
-
-=cut 
-
-sub parse_form {
-    my ($self) = @_;
-    if (my $text = $self->get_field('form')) {
-        $self->_parse_form($text);
-    } else {
-        return { attrs => [] };
-    }
-}
-
-sub _parse_form {
-    my ($self, $yaml) = @_;
-
-    my $ref = YAML::thaw($yaml) or return 0;
-
-    my @attributes = ();
-    my @attrs = @{ $ref->{attrs} };
-    while (my $attr = shift(@attrs)) {
-        my $attrname = ref $attr
-            ? $attr->{name}
-            : $attr;
-
-        if (!$attrname) {
-            $self->base->log('LA_ERR', 'No attribute name supplied');
-            return;
-        }
-    }
-
-    $ref
-}
-
-=head2 attr_info($attr)
-
-Return information for attribute C<$attr> from form.
-
-=cut
-
-sub attr_info {
-    my ($self, $wanted_attr) = @_;
-
-    my $ref = $self->parse_form;
-
-    my @attrs = @{ $ref->{attrs} };
-    while (my $attr = shift(@attrs)) {
-        my $attrname = ref $attr
-            ? $attr->{name}
-            : $attr;
-        if ($wanted_attr eq $attrname) {
-            if (ref $attr) {
-                return $attr;
-            } else {
-                return;
-            }
-        }
-    }
-    return;
-}
-
-
-1;
-
-__END__
-
-=head1 SEE ALSO
-
-L<LATMOS::Accounts::Bases::Sql>
-
-=head1 AUTHOR
-
-Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (C) 2008, 2009 CNRS SA/CETP/LATMOS
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.10.0 or,
-at your option, any later version of Perl 5 you may have available.
-
-=cut
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/OCHelper/Accreq.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/OCHelper/Accreq.pm	(revision 2020)
+++ 	(revision )
@@ -1,58 +1,0 @@
-package LATMOS::Accounts::Bases::Sql::OCHelper::User;
-
-# $Id: Accreq.pm 2041 2010-04-18 13:16:39Z nanardon $
-
-=head1 NAME
-
-LATMOS::Accounts::Bases::Sql::OCHelper::User - Helper to create accreq
-object
-
-=cut
-
-use strict;
-use warnings;
-use base qw(LATMOS::Accounts::Bases::OCHelper);
-use LATMOS::Accounts::Utils;
-use POSIX qw(strftime);
-
-sub _step {
-    my ($self, $info) = @_;
-    if ($info->{step} == 0) {
-        $info->{step} = 1;
-        $info->{ask} = [
-            qw(givenName sn managerContact department)
-        ];
-
-    } elsif ($info->{step} == 1) {
-        if ($self->base->create_c_object($self->otype,
-                strftime('%Y%m%d%H%M%S', localtime),
-                %{$info->{contents} || {}},
-            )) {
-            return 'CREATED';
-        } else {
-            return 'ERROR';
-        }
-    } else {
-        return undef;
-    }
-}
-
-=head1 SEE ALSO
-
-L<LATMOS::Accounts>
-
-=head1 AUTHOR
-
-Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (C) 2012 CNRS SA/CETP/LATMOS
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.10.0 or,
-at your option, any later version of Perl 5 you may have available.
-
-=cut
-
-1;
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Automatedrequest.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Automatedrequest.pm	(revision 2020)
+++ 	(revision )
@@ -1,68 +1,0 @@
-package LATMOS::Accounts::Task::Automatedrequest;
-
-use strict;
-use warnings;
-use base qw(LATMOS::Accounts::Task);
-use LATMOS::Accounts;
-use Config::IniFiles;
-use LATMOS::Accounts::Log;
-use LATMOS::Accounts::Utils;
-
-=head1 NAME
-
-LATMOS::Accounts::Task::Automatedrequest - Task responsible of automatic request
-validation
-
-=cut
-
-sub init {
-    my ($self) = @_;
-    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1);
-    my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base;
-    $labase && $labase->load or die "Cannot load base";
-
-    $self->{_la} = $LA;
-    $self->{_base} = $labase;
-
-    1;
-}
-
-sub run {
-    my ($self) = @_;
-
-    foreach my $id ($self->{_base}->list_auto_pending_requests) {
-        my $datarequest = $self->{_base}->get_datarequest($id) or do {
-            $self->{_base}->log(LA_ERR, "Cannot fetch request %d", $id);
-            next;
-        };
-        if ($datarequest->auto_apply_to_object) {
-            $datarequest->base->commit;
-        } else {
-            $datarequest->base->rollback;
-        }
-    }
-
-    1;
-}
-
-1;
-
-__END__
-
-=head1 SEE ALSO
-
-L<LATMOS::Accounts::Bases::Sql>, L<LATMOS::Accounts::Bases::Sql::DataRequest>
-
-=head1 AUTHOR
-
-Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (C) 2008, 2009, 2010, 2011, 2012 CNRS SA/CETP/LATMOS
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.10.0 or,
-at your option, any later version of Perl 5 you may have available.
-
-=cut
