Contents of /trunk/flyspray/themes/Magellan/templates/admin.groups.tpl
Parent Directory | Revision Log
Revision 6 -
(show annotations)
(download)
Thu Mar 24 13:33:23 2016 UTC (8 years, 1 month ago) by niro
File size: 4856 byte(s)
Thu Mar 24 13:33:23 2016 UTC (8 years, 1 month ago) by niro
File size: 4856 byte(s)
-import flyspray-1.0-beta Magellan theme
1 | <div id="toolbox"> |
2 | <ul id="submenu"> |
3 | <li><a href="#users_tab"><?php echo Filters::noXSS(L('users')); ?></a></li> |
4 | <li><a href="#groups_tab"><?php echo Filters::noXSS(L('globalgroups')); ?></a></li> |
5 | </ul> |
6 | <div id="users_tab" class="tab"> |
7 | <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newuser', $proj->id)); ?>"><i class="good fa fa-user-plus fa-lg fa-fw"></i><?php echo L('newuser'); ?></a> |
8 | <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newuserbulk', $proj->id)); ?>"><i class="good fa fa-user-times fa-lg fa-fw"></i><?php echo L('newuserbulk'); ?></a> |
9 | <a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'editallusers', $proj->id)); ?>"><i class="fa fa-group fa-lg fa-fw"></i><?php echo L('editallusers'); ?></a> |
10 | <div class="groupedit"> |
11 | <!-- |
12 | <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> |
13 | <label for="selectgroup"><?php echo Filters::noXSS(L('editgroup')); ?></label> |
14 | <select name="id" id="selectgroup"><?php echo tpl_options(Flyspray::ListGroups()); ?></select> |
15 | <button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> |
16 | <input type="hidden" name="do" value="admin" /> |
17 | <input type="hidden" name="area" value="editgroup" /> |
18 | <input type="hidden" name="project" value="<?php echo $proj->id; ?>" /> |
19 | </form> |
20 | --> |
21 | <form action="<?php echo Filters::noXSS($baseurl); ?>index.php" method="get"> |
22 | <label for="edit_user"><?php echo Filters::noXSS(L('edituser')); ?></label> |
23 | <?php echo tpl_userselect('user_name', '', 'edit_user'); ?> |
24 | <button type="submit"><?php echo Filters::noXSS(L('edit')); ?></button> |
25 | <input type="hidden" name="do" value="admin" /> |
26 | <input type="hidden" name="area" value="users" /> |
27 | <input type="hidden" name="project" value="<?php echo $proj->id; ?>" /> |
28 | </form> |
29 | </div> |
30 | </div> |
31 | <div id="groups_tab" class="tab"> |
32 | <div><a class="button" href="<?php echo Filters::noXSS(CreateURL('admin', 'newgroup', $proj->id)); ?>"><i class="fa fa-group fa-lg fa-fw"></i><?php echo Filters::noXSS(L('newgroup')); ?></a></div> |
33 | |
34 | <?php |
35 | $perm_fields = array( |
36 | 'is_admin', 'manage_project', |
37 | 'view_tasks', 'open_new_tasks', 'add_multiple_tasks', 'modify_own_tasks', 'modify_all_tasks', |
38 | 'create_attachments', 'delete_attachments', |
39 | 'assign_to_self', 'assign_others_to_self', 'edit_assignments', |
40 | 'close_own_tasks', 'close_other_tasks', |
41 | 'view_roadmap', 'view_history', 'view_reports', |
42 | 'add_votes', |
43 | 'view_comments', 'add_comments', 'edit_comments', 'edit_own_comments', 'delete_comments', |
44 | 'view_estimated_effort', 'view_current_effort_done', 'track_effort' |
45 | ); |
46 | |
47 | $yesno = array( |
48 | '<td style="color:#ccc" title="'.eL('no').'">-</td>', |
49 | '<td title="'.eL('yes').'"><i class="good fa fa-check fa-lg"></i></td>' |
50 | ); |
51 | |
52 | $perms=array(); |
53 | $gmembers=''; |
54 | $gnames=''; |
55 | $gdesc=''; |
56 | $cols=''; |
57 | foreach ($groups as $group){ |
58 | $cols.='<col></col>'; |
59 | $gmembers.='<td>'.$group['users'].'</td>'; |
60 | $gnames .='<td><a class="button" title="'.eL('editgroup').'" href="'.( Filters::noXSS(CreateURL('editgroup', $group['group_id'], 'admin'))).'">'.$group['group_name'] |
61 | .'<i class="fa fa-pencil fa-lg fa-fw"></i></a></td>'; |
62 | $gdesc .='<td>'.$group['group_desc'].'</td>'; |
63 | foreach ($group as $key => $val) { |
64 | if (!is_numeric($key) && in_array($key, $perm_fields)) { |
65 | $perms[$key][]=$val; |
66 | } |
67 | } |
68 | } |
69 | ?> |
70 | <style> |
71 | .perms {border-collapse:collapse;} |
72 | .perms tbody tr:hover {background-color:#eee;} |
73 | .perms td, .perms th{border:1px solid #999;} |
74 | .perms thead th, .perms thead td {text-align:center;} |
75 | .perms tbody th{text-align:right;} |
76 | .perms tbody td{width:100px;text-align:center;} |
77 | .perms tbody span i:first-child {color: #f50;} |
78 | </style> |
79 | <table class="perms"> |
80 | <colgroup> |
81 | <col></col> |
82 | <?php echo $cols; ?> |
83 | </colgroup> |
84 | <thead> |
85 | <tr> |
86 | <th><?php echo L('groupmembers'); ?></th> |
87 | <?php echo $gmembers; ?> |
88 | </tr> |
89 | <tr> |
90 | <th><?php echo L('group'); ?></th> |
91 | <?php echo $gnames; ?> |
92 | </tr> |
93 | <tr> |
94 | <th><?php echo L('description'); ?></th> |
95 | <?php echo $gdesc; ?> |
96 | </tr> |
97 | </thead> |
98 | <tbody> |
99 | <?php foreach ($perm_fields as $p): ?> |
100 | <tr> |
101 | <th><?php echo eL(str_replace('_', '', $p)); ?></th> |
102 | <?php |
103 | require_once('permicons.tpl'); |
104 | $i=0; |
105 | foreach($perms[$p] as $val){ |
106 | if ($perms['is_admin'][$i]==1 && $val == 0){ |
107 | if(isset($permicons[$p])){ |
108 | echo '<td title="'.eL('yes').' - Permission granted because of is_admin">( '.$permicons[$p].' )</td>'; |
109 | }else{ |
110 | echo $yesno[1]; |
111 | } |
112 | } elseif($val==1 && isset($permicons[$p])){ |
113 | echo '<td>'.$permicons[$p].'</td>'; |
114 | } else{ |
115 | echo $yesno[$val]; |
116 | } |
117 | $i++; |
118 | } |
119 | ?> |
120 | </tr> |
121 | <?php endforeach; ?> |
122 | </tbody> |
123 | </table> |
124 | </div> |
125 | </div> |