source: trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax/Services/Mailing.pm @ 1135

Last change on this file since 1135 was 1135, checked in by nanardon, 12 years ago

Merge branch 'dyngroup'

File size: 2.2 KB
Line 
1package LATMOS::Accounts::Web::Controller::Ajax::Services::Mailing;
2use Moose;
3use namespace::autoclean;
4
5BEGIN { extends 'Catalyst::Controller'; }
6
7=head1 NAME
8
9LATMOS::Accounts::Web::Controller::Ajax::Services::Mailing - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19
20=head2 index
21
22=cut
23
24sub index :Path :Args(0) {
25    my ( $self, $c ) = @_;
26
27    $c->response->body('Matched LATMOS::Accounts::Web::Controller::Ajax::Services::Mailing in Ajax::Services::Mailing.');
28}
29
30sub users_list :Local {
31    my ( $self, $c ) = @_;
32
33    $c->req->params->{attr} =    [ 'active', 'mail' ];
34    $c->req->params->{attrval} = [ '1',    , '*'    ];
35
36    for ($c->req->param('type')) {
37
38        /^dpmt$/ and do {
39            push(@{ $c->req->params->{attr} }, 'department');
40            push(@{ $c->req->params->{attrval} }, $c->req->param('obj'));
41            last;
42        };
43        /^dpmt_assoc$/ and do {
44            push(@{ $c->req->params->{attr} }, 'memberOf');
45            push(@{ $c->req->params->{attrval} }, $c->req->param('obj'));
46            last;
47        };
48        /^quick$/ and do {
49            last;
50        };
51
52        # Else
53        push(@{ $c->req->params->{attr} }, $_);
54        push(@{ $c->req->params->{attrval} }, $c->req->param('toto'));
55    }
56    $c->stash->{ofilter} = $c->model('AttrFilter', 'user');
57}
58
59sub dest_list :Private {}
60
61sub quick_input :Private {}
62
63sub empty :Local {
64    my ( $self, $c ) = @_;
65    $c->session->{to} = {};
66    $c->go('dest_list');
67}
68
69sub mod_to :Local {
70    my ( $self, $c ) = @_;
71
72    for ($c->req->param('act' || '')) {
73        /add_to/ and do {
74            foreach ($c->req->param('user')) {
75                $c->session->{to}{$_} = 1;
76            }
77        };
78        /remove_to/ and do {
79            foreach ($c->req->param('user')) {
80                delete($c->session->{to}{$_});
81            }
82        };
83    }
84
85    $c->go('dest_list');
86}
87
88sub end : Private {
89    my ( $self, $c ) = @_;
90    $c->forward($c->view('TTpart'));
91}
92
93=head1 AUTHOR
94
95olivier
96
97=head1 LICENSE
98
99This library is free software. You can redistribute it and/or modify
100it under the same terms as Perl itself.
101
102=cut
103
104__PACKAGE__->meta->make_immutable;
105
1061;
Note: See TracBrowser for help on using the repository browser.