|
40 | 40 |
|
41 | 41 | getProjects(); |
42 | 42 | }); |
| 43 | + $('#show-archived-projects').change(function (e){ |
| 44 | + getProjects(); |
| 45 | + }); |
43 | 46 | $("#new-project-submit").click(function (e) { |
44 | 47 | e.preventDefault(); |
45 | 48 | var selectedClient = $('#client-select').select2('data'); |
|
257 | 260 | target = dialogProjectEditForm.target; |
258 | 261 | form = dialogProjectEditForm.find( "form" ); |
259 | 262 | var baseUrl = OC.generateUrl('/apps/timetracker/ajax/edit-project/'+target.getData().id); |
260 | | - var jqxhr = $.post( baseUrl, {name:form.find("#name").val(), clientId:form.find("#client-select-popup").val(), locked:form.find("#locked").is(':checked')?'1':'0', allowedTags:form.find("#locked-select-tags").val(), allowedUsers:form.find("#locked-select-users").val() },function() { |
| 263 | + var jqxhr = $.post( baseUrl, {name:form.find("#name").val(), clientId:form.find("#client-select-popup").val(), locked:form.find("#locked").is(':checked')?'1':'0',archived:form.find("#archived").is(':checked')?'1':'0', allowedTags:form.find("#locked-select-tags").val(), allowedUsers:form.find("#locked-select-users").val() },function() { |
261 | 264 | getProjects(); |
262 | 265 | $(dialogProjectEditForm).dialog("close"); |
263 | 266 | }) |
|
331 | 334 | if (isAdmin()){ |
332 | 335 | columns = columns.concat(adminColumns); |
333 | 336 | } |
| 337 | + if ($("#show-archived-projects").is(':checked')){ |
| 338 | + columns = columns.concat([{title:"Archived", field:"archived", widthGrow:1, formatter:"tickCross"}]); |
| 339 | + } |
334 | 340 |
|
335 | 341 | var table = new Tabulator("#projects", { |
336 | | - ajaxURL:baseUrl, |
| 342 | + ajaxURL:baseUrl+"?archived="+($("#show-archived-projects").is(':checked')?'1':'0'), |
337 | 343 | layout:"fitColumns", |
338 | 344 | columns:columns, |
339 | 345 | rowClick:function(e, row){ |
|
359 | 365 | // }]; |
360 | 366 |
|
361 | 367 | form.find("#client-select-popup").select2("val",JSON.stringify(clientSelectData)); |
| 368 | + form.find("#archived").prop('checked', row.getData().archived); |
362 | 369 | if (isAdmin()){ |
363 | 370 | var tags = row.getData().origAllowedTags.map(function(e){ return e.id;}); |
364 | 371 | var users = row.getData().allowedUsers; |
|
0 commit comments