1 | package LATMOS::Accounts::Web::Controller::Ajax::Services::Mailing; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | |
---|
5 | BEGIN { extends 'Catalyst::Controller'; } |
---|
6 | |
---|
7 | =head1 NAME |
---|
8 | |
---|
9 | LATMOS::Accounts::Web::Controller::Ajax::Services::Mailing - Catalyst Controller |
---|
10 | |
---|
11 | =head1 DESCRIPTION |
---|
12 | |
---|
13 | Catalyst Controller. |
---|
14 | |
---|
15 | =head1 METHODS |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | |
---|
20 | =head2 index |
---|
21 | |
---|
22 | =cut |
---|
23 | |
---|
24 | sub 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 | |
---|
30 | sub 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 | |
---|
59 | sub dest_list :Private {} |
---|
60 | |
---|
61 | sub quick_input :Private {} |
---|
62 | |
---|
63 | sub empty :Local { |
---|
64 | my ( $self, $c ) = @_; |
---|
65 | $c->session->{to} = {}; |
---|
66 | $c->go('dest_list'); |
---|
67 | } |
---|
68 | |
---|
69 | sub 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 | |
---|
88 | sub end : Private { |
---|
89 | my ( $self, $c ) = @_; |
---|
90 | $c->forward($c->view('TTpart')); |
---|
91 | } |
---|
92 | |
---|
93 | =head1 AUTHOR |
---|
94 | |
---|
95 | olivier |
---|
96 | |
---|
97 | =head1 LICENSE |
---|
98 | |
---|
99 | This library is free software. You can redistribute it and/or modify |
---|
100 | it under the same terms as Perl itself. |
---|
101 | |
---|
102 | =cut |
---|
103 | |
---|
104 | __PACKAGE__->meta->make_immutable; |
---|
105 | |
---|
106 | 1; |
---|