Line | |
---|
1 | <a name="top"></a> |
---|
2 | <h2>Répartition par département</h2> |
---|
3 | |
---|
4 | [% dpmts = c.model('Accounts').db.search_objects('group', 'sutype=dpmt') %] |
---|
5 | |
---|
6 | <ul id="org-top" style="display: none"> |
---|
7 | <li>Direction |
---|
8 | |
---|
9 | [% FOREACH dpmt = dpmts %] |
---|
10 | [% "<ul>" IF loop.first %] |
---|
11 | [% odpmt = c.model('Accounts').db.get_object('group', dpmt) %] |
---|
12 | <li>[% dpmt | html %] |
---|
13 | |
---|
14 | [% omanager = c.model('Accounts').db.get_object('user', odpmt.get_attributes('managedBy')) %] |
---|
15 | |
---|
16 | [% IF omanager %] |
---|
17 | <br> |
---|
18 | [% omanager %] |
---|
19 | [% END %] |
---|
20 | |
---|
21 | [% users = c.model('Accounts').db.fetchObjectInfo('user', |
---|
22 | [ 'givenName', 'sn', 'managerContact', 'department', 'expire', 'description' ], |
---|
23 | 'active=1', |
---|
24 | 'department=' _ dpmt, |
---|
25 | ) %] |
---|
26 | |
---|
27 | [% FOREACH user = users.keys.sort %] |
---|
28 | [% IF loop.first %] |
---|
29 | <ul> |
---|
30 | [% END %] |
---|
31 | [% ouser = users.$user %] |
---|
32 | <li> |
---|
33 | [% IF ouser.department.0 != dpmt %] |
---|
34 | <span style="font-style: italic;"> |
---|
35 | [% ELSE %] |
---|
36 | <span> |
---|
37 | [% END %] |
---|
38 | [% ouser.givenName.0 _ ' ' _ ouser.sn.0 || ouser.description.0 || user | html %] |
---|
39 | </span> |
---|
40 | </li> |
---|
41 | [% "</ul>" IF loop.last %] |
---|
42 | [% END %] |
---|
43 | |
---|
44 | [% "</ul>" IF loop.last %] |
---|
45 | [% END %] |
---|
46 | |
---|
47 | </li> |
---|
48 | </ul> |
---|
49 | |
---|
50 | <div id=chart></div> |
---|
51 | |
---|
52 | <style> |
---|
53 | |
---|
54 | div.orgChart { |
---|
55 | overflow-x: scroll |
---|
56 | } |
---|
57 | |
---|
58 | div.orgChart .level1 { |
---|
59 | font-size: 12px; |
---|
60 | } |
---|
61 | |
---|
62 | div.stack-container { |
---|
63 | border: solid; |
---|
64 | } |
---|
65 | |
---|
66 | div.orgChart ul.stack > li { |
---|
67 | margin-top: 1em; |
---|
68 | font-size: 10px; |
---|
69 | line-height: 1em; |
---|
70 | } |
---|
71 | </style> |
---|
72 | |
---|
73 | <script> |
---|
74 | $(function() { |
---|
75 | $("#org-top").orgChart({ |
---|
76 | container: $("#chart"), |
---|
77 | stack: true, |
---|
78 | depth: 2 |
---|
79 | }); |
---|
80 | }); |
---|
81 | </script> |
---|
Note: See
TracBrowser
for help on using the repository browser.