forked from joedanz/cf-project-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserPermissions.cfm
357 lines (319 loc) · 14.9 KB
/
userPermissions.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<cfsetting enablecfoutputonly="true">
<cfprocessingdirective pageencoding="utf-8">
<cfset variables.errors = "">
<cfparam name="form.from" default="site">
<cfif StructKeyExists(url,"from")>
<cfset form.from = url.from>
</cfif>
<cfif StructKeyExists(form,"submit")>
<cfparam name="form.admin" default="0">
<cfset application.role.remove(projectID=url.p,userID=url.u)>
<cfset application.role.add(url.p,url.u,form.admin,form.file_view,form.file_edit,form.file_comment,form.issue_view,form.issue_edit,form.issue_assign,form.issue_resolve,form.issue_close,form.issue_comment,form.msg_view,form.msg_edit,form.msg_comment,form.mstone_view,form.mstone_edit,form.mstone_comment,form.todolist_view,form.todolist_edit,form.todo_edit,form.todo_comment,form.time_view,form.time_edit,form.bill_view,form.bill_edit,form.bill_rates,form.bill_invoices,form.bill_markpaid,form.report,form.svn)>
<cfif not compareNoCase(form.from,'admin')>
<cflocation url="admin/editUser.cfm?u=#url.u###projects" addtoken="false">
<cfelse>
<cflocation url="people.cfm?p=#url.p#" addtoken="false">
</cfif>
</cfif>
<cfparam name="form.admin" default="0">
<cfset user = application.user.get(url.u)>
<cfset project = application.project.get(url.u,url.p)>
<!--- Loads header/footer --->
<cfmodule template="#application.settings.mapping#/tags/layout.cfm" templatename="main" title="#application.settings.app_title# » Admin">
<cfoutput>
<div id="container">
<!--- left column --->
<div class="left medium">
<div class="main">
<div class="header"<cfif not compareNoCase(form.from,'admin')> style="margin-bottom:0;"</cfif>>
<h2 class="admin">User Permissions</h2>
</div>
<cfif not compareNoCase(form.from,'admin')>
<ul class="submenu mb15">
<cfinclude template="admin/menu.cfm">
</ul>
</cfif>
<div class="content">
<div class="wrapper">
<h3 class="mb10">#user.firstName# #user.lastName# : #project.name#</h3>
<form action="#cgi.script_name#?#cgi.query_string#" method="post" class="frm">
<p>
<label for="admin" class="med b">Project Administrator?</label>
<select name="admin" id="admin" onclick="showPerms();">
<option value="0"<cfif project.admin eq 0> selected="selected"</cfif>>No</option>
<option value="1"<cfif project.admin eq 1> selected="selected"</cfif>>Yes</option>
</select>
</p>
<div id="fullperms"<cfif project.admin eq 1> style="display:none;"</cfif>>
<table>
<tr valign="top"><td width="50%">
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Messages</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View messages</td>
<td class="tac"><input type="radio" name="msg_view" value="1"<cfif project.msg_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="msg_view" value="0"<cfif project.msg_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Post/edit messages</td>
<td class="tac"><input type="radio" name="msg_edit" value="1"<cfif project.msg_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="msg_edit" value="0"<cfif project.msg_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Comment on messages</td>
<td class="tac"><input type="radio" name="msg_comment" value="1"<cfif project.msg_comment eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="msg_comment" value="0"<cfif project.msg_comment eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">To-Dos</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View to-do lists</td>
<td class="tac"><input type="radio" name="todolist_view" value="1"<cfif project.todolist_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="todolist_view" value="0"<cfif project.todolist_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit to-do lists</td>
<td class="tac"><input type="radio" name="todolist_edit" value="1"<cfif project.todolist_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="todolist_edit" value="0"<cfif project.todolist_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit to-do items</td>
<td class="tac"><input type="radio" name="todo_edit" value="1"<cfif project.todo_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="todo_edit" value="0"<cfif project.todo_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Comment on to-do items</td>
<td class="tac"><input type="radio" name="todo_comment" value="1"<cfif project.todo_comment eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="todo_comment" value="0"<cfif project.todo_comment eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Milestones</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View milestones</td>
<td class="tac"><input type="radio" name="mstone_view" value="1"<cfif project.mstone_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="mstone_view" value="0"<cfif project.mstone_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit milestones</td>
<td class="tac"><input type="radio" name="mstone_edit" value="1"<cfif project.mstone_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="mstone_edit" value="0"<cfif project.mstone_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Comment on milestones</td>
<td class="tac"><input type="radio" name="mstone_comment" value="1"<cfif project.mstone_comment eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="mstone_comment" value="0"<cfif project.mstone_comment eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Files</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View files</td>
<td class="tac"><input type="radio" name="file_view" value="1"<cfif project.file_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="file_view" value="0"<cfif project.file_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Upload/edit files</td>
<td class="tac"><input type="radio" name="file_edit" value="1"<cfif project.file_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="file_edit" value="0"<cfif project.file_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Comment on files</td>
<td class="tac"><input type="radio" name="file_comment" value="1"<cfif project.file_comment eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="file_comment" value="0"<cfif project.file_comment eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Subversion</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>Access Subversion repository</td>
<td class="tac"><input type="radio" name="svn" value="1"<cfif project.svn eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="svn" value="0"<cfif project.svn eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
</td><td width="50%">
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Issues</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View issues</td>
<td class="tac"><input type="radio" name="issue_view" value="1"<cfif project.issue_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_view" value="0"<cfif project.issue_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit issues</td>
<td class="tac"><input type="radio" name="issue_edit" value="1"<cfif project.issue_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_edit" value="0"<cfif project.issue_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Assign issues</td>
<td class="tac"><input type="radio" name="issue_assign" value="1"<cfif project.issue_assign eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_assign" value="0"<cfif project.issue_assign eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Resolve issues</td>
<td class="tac"><input type="radio" name="issue_resolve" value="1"<cfif project.issue_resolve eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_resolve" value="0"<cfif project.issue_resolve eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Close issues</td>
<td class="tac"><input type="radio" name="issue_close" value="1"<cfif project.issue_close eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_close" value="0"<cfif project.issue_close eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Comment on issues</td>
<td class="tac"><input type="radio" name="issue_comment" value="1"<cfif project.issue_comment eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="issue_comment" value="0"<cfif project.issue_comment eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Time Tracking</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View time tracking</td>
<td class="tac"><input type="radio" name="time_view" value="1"<cfif project.time_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="time_view" value="0"<cfif project.time_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit time tracking</td>
<td class="tac"><input type="radio" name="time_edit" value="1"<cfif project.time_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="time_edit" value="0"<cfif project.time_edit eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Reporting</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>Allow reporting</td>
<td class="tac"><input type="radio" name="report" value="1"<cfif project.report eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="report" value="0"<cfif project.report eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
<table class="perms full mb10">
<thead>
<tr>
<th class="b">Billing</th>
<th class="tac b yes">Yes</th>
<th class="tac b no">No</th>
</tr>
</thead>
<tbody>
<tr>
<td>View billing</td>
<td class="tac"><input type="radio" name="bill_view" value="1"<cfif project.bill_view eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="bill_view" value="0"<cfif project.bill_view eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Add/edit billing</td>
<td class="tac"><input type="radio" name="bill_edit" value="1"<cfif project.bill_edit eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="bill_edit" value="0"<cfif project.bill_edit eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Manage billing rates</td>
<td class="tac"><input type="radio" name="bill_rates" value="1"<cfif project.bill_rates eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="bill_rates" value="0"<cfif project.bill_rates eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Generate invoices</td>
<td class="tac"><input type="radio" name="bill_invoices" value="1"<cfif project.bill_invoices eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="bill_invoices" value="0"<cfif project.bill_invoices eq 0> checked="checked"</cfif> /></td>
</tr>
<tr>
<td>Mark items paid</td>
<td class="tac"><input type="radio" name="bill_markpaid" value="1"<cfif project.bill_markpaid eq 1> checked="checked"</cfif> /></td>
<td class="tac"><input type="radio" name="bill_markpaid" value="0"<cfif project.bill_markpaid eq 0> checked="checked"</cfif> /></td>
</tr>
</tbody>
</table>
</td></tr>
</table>
</div>
<p>
<input type="submit" name="submit" value="Update Permissions" class="button shorter" />
or <a href="#application.settings.mapping#/<cfif not compareNoCase(form.from,'admin')>admin/editUser.cfm?u=#url.u###projects<cfelse>people.cfm?p=#url.p#</cfif>">Cancel</a>
</p>
<input type="hidden" name="from" value="#form.from#" />
</form>
</div>
</div>
</div>
<div class="bottom"> </div>
<div class="footer">
<cfinclude template="#application.settings.mapping#/footer.cfm">
</div>
</div>
<!--- right column --->
<div class="right">
</div>
</div>
<script type="text/javascript">
function showPerms() {
if ($('##admin').val() == '1') $('##fullperms').slideUp();
else $('##fullperms').slideDown();
}
</script>
</cfoutput>
</cfmodule>
<cfsetting enablecfoutputonly="false">