2 * FusionForge Documentation Manager
4 * Copyright 2010, Antoine Mercadal - Capgemini
5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2011, Alain Peyrat
7 * Copyright 2011-2016, Franck Villaume - TrivialDev
8 * http://fusionforge.org
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 /*! ListFileController
27 * @param groupId the current FusionForge groupID
29 DocManListFileController = function(params)
31 this.lockInterval = [];
32 this.listfileparams = params;
34 if (this.listfileparams.enableResize) {
37 this.initModalEditWindow();
38 this.initModelNotifyWindow();
41 DocManAddItemController = function(params)
43 this.additemparams = params;
47 DocManAddFileController = function(params)
49 this.addfileparams = params;
53 DocManSearchController = function(params)
55 this.searchparams = params;
59 DocManListFileController.prototype =
61 /*! Binds the controls to the actions
63 bindControls: function() {
64 if (typeof(this.listfileparams.buttonAddItem) != 'undefined') {
65 this.listfileparams.buttonAddItem.click(jQuery.proxy(this, "toggleAddItemView"));
69 resizableDiv: function() {
70 var splitterPosition = '30%';
71 var mainwidth = jQuery('#maindiv').innerWidth();
72 if (jQuery.Storage.get('splitterStyle') !== undefined) {
73 var storedSplitterPosition = jQuery.Storage.get('splitterStyle').replace(/px;?/g, '').replace(/left: /g, '');
74 splitterPosition = Math.round(storedSplitterPosition * 100 / mainwidth )+'%';
76 if (this.listfileparams.page == 'trashfile') {
77 (this.listfileparams.divLeft.outerHeight() > this.listfileparams.divRight.outerHeight()) ? mainheight = this.listfileparams.divLeft.outerHeight() : mainheight = this.listfileparams.divRight.outerHeight();
80 if (jQuery('#editFile').length >= 1) {
81 fixwidth += jQuery('#editFile').outerHeight() - jQuery('[aria-describedby="editFile"]').outerHeight();
83 if (jQuery('#notifyUsers').length >= 1) {
84 fixwidth += jQuery('#notifyUsers').outerHeight() - jQuery('[aria-describedby="notifyUsers"]').outerHeight();
86 var totalRightHeight = 0;
87 this.listfileparams.divRight.children().each(function() {
88 if (jQuery(this).is(':visible')) {
89 totalRightHeight += jQuery(this).outerHeight();
92 totalRightHeight -= fixwidth;
93 (this.listfileparams.divRight.outerHeight() - fixwidth < 0) ? useRightHeight = this.listfileparams.divRight.outerHeight() : useRightHeight = this.listfileparams.divRight.outerHeight() - fixwidth;
94 (useRightHeight < totalRightHeight) ? useRightHeight = totalRightHeight : useRightHeight ;
95 (this.listfileparams.divLeft.outerHeight() + 30 > this.listfileparams.divRight.outerHeight()) ? mainheight = this.listfileparams.divLeft.outerHeight() + 30 : mainheight = useRightHeight;
97 jQuery('#views').height(mainheight)
98 .split({orientation:'vertical', limit:100, position: splitterPosition});
99 jQuery('.vsplitter').mouseup(function(){
100 jQuery.Storage.set('splitterStyle',''+jQuery('.vsplitter').attr('style'));
104 initModalEditWindow: function() {
105 var modalId = this.listfileparams.divEditFile;
106 jQuery(modalId).dialog({
110 title: this.listfileparams.divEditTitle,
112 Save: jQuery.proxy(function() {
113 jQuery('#editdocdata').submit();
114 var id = jQuery('#docid').attr('value');
115 jQuery.get(this.listfileparams.docManURL+'/', {
116 group_id: this.listfileparams.groupId,
121 childgroup_id: this.listfileparams.childGroupId
123 jQuery.get(this.listfileparams.docManURL+'/', {
124 group_id: this.listfileparams.groupId,
127 itemid: this.listfileparams.docgroupId,
129 childgroup_id: this.listfileparams.childGroupId
131 clearInterval(this.lockInterval[id]);
132 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
133 jQuery(modalId).dialog( "close" );
135 Cancel: jQuery.proxy(function() {
136 var id = jQuery('#docid').attr('value');
137 jQuery.get(this.listfileparams.docManURL+'/', {
138 group_id: this.listfileparams.groupId,
143 childgroup_id: this.listfileparams.childGroupId
145 jQuery.get(this.listfileparams.docManURL+'/', {
146 group_id: this.listfileparams.groupId,
149 itemid: this.listfileparams.docgroupId,
151 childgroup_id: this.listfileparams.childGroupId
153 clearInterval(this.lockInterval[id]);
154 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
155 jQuery(modalId).dialog('close');
159 jQuery(modalId).bind('dialogclose', jQuery.proxy(function() {
160 var id = jQuery('#docid').attr('value');
161 jQuery.get(this.listfileparams.docManURL+'/', {
162 group_id: this.listfileparams.groupId,
167 childgroup_id: this.listfileparams.childGroupId
169 jQuery.get(this.listfileparams.docManURL+'/', {
170 group_id: this.listfileparams.groupId,
173 itemid: this.listfileparams.docgroupId,
175 childgroup_id: this.listfileparams.childGroupId
177 clearInterval(this.lockInterval[id]);
178 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
182 initModelNotifyWindow: function() {
183 var modalId = this.listfileparams.divNotifyUsers;
184 jQuery(modalId).dialog({
188 title: this.listfileparams.divNotifyTitle,
190 Save: { text: this.listfileparams.divNotifySaveButtonTxt,
191 click: jQuery.proxy(function() {
192 jQuery('#notifyusersdoc').submit();
193 var id = jQuery('#notifydocid').attr('value');
194 jQuery.get(this.listfileparams.docManURL+'/', {
195 group_id: this.listfileparams.groupId,
200 childgroup_id: this.listfileparams.childGroupId
202 jQuery.get(this.listfileparams.docManURL+'/', {
203 group_id: this.listfileparams.groupId,
206 itemid: this.listfileparams.docgroupId,
208 childgroup_id: this.listfileparams.childGroupId
210 clearInterval(this.lockInterval[id]);
211 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
212 jQuery(modalId).dialog( "close" );
214 Cancel: jQuery.proxy(function() {
215 var id = jQuery('#notifydocid').attr('value');
216 jQuery.get(this.listfileparams.docManURL+'/', {
217 group_id: this.listfileparams.groupId,
222 childgroup_id: this.listfileparams.childGroupId
224 jQuery.get(this.listfileparams.docManURL+'/', {
225 group_id: this.listfileparams.groupId,
228 itemid: this.listfileparams.docgroupId,
230 childgroup_id: this.listfileparams.childGroupId
232 clearInterval(this.lockInterval[id]);
233 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
234 jQuery(modalId).dialog('close');
238 jQuery(modalId).bind('dialogclose', jQuery.proxy(function() {
239 var id = jQuery('#notifydocid').attr('value');
240 jQuery.get(this.listfileparams.docManURL+'/', {
241 group_id: this.listfileparams.groupId,
246 childgroup_id: this.listfileparams.childGroupId
248 jQuery.get(this.listfileparams.docManURL+'/', {
249 group_id: this.listfileparams.groupId,
252 itemid: this.listfileparams.docgroupId,
254 childgroup_id: this.listfileparams.childGroupId
256 clearInterval(this.lockInterval[id]);
257 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
261 /*! toggle edit group view div visibility
263 toggleEditDirectoryView: function() {
264 if (!this.listfileparams.divEditDirectory.is(":visible")) {
265 jQuery.getJSON(this.listfileparams.docManURL + '/?group_id='+this.listfileparams.groupId+'&action=lock&json=1&type=dir&itemid='+this.listfileparams.docgroupId, jQuery.proxy(function(data){
266 if (typeof data.html != 'undefined') {
267 jQuery('#maindiv > .feedback').remove();
268 jQuery('#maindiv > .error').remove();
269 jQuery('#maindiv > .warning_msg').remove();
270 jQuery('#maindiv').prepend(data.html);
272 this.listfileparams.divEditDirectory.show();
273 if (typeof(this.listfileparams.divAddItem) != 'undefined') {
274 this.listfileparams.divAddItem.hide();
276 computeHeight = this.listfileparams.divRight.outerHeight() + this.listfileparams.divEditDirectory.outerHeight();
277 currentLeftHeight = this.listfileparams.divLeft.outerHeight();
278 this.listfileparams.divLeft.height(currentLeftHeight + this.listfileparams.divEditDirectory.outerHeight());
279 jQuery.get(this.listfileparams.docManURL+'/', {
280 group_id: this.listfileparams.groupId,
284 itemid: this.listfileparams.docgroupId,
285 childgroup_id: this.listfileparams.childGroupId
287 this.lockInterval[this.listfileparams.docgroupId] = setInterval("jQuery.get('" + this.listfileparams.docManURL + "/', {group_id:"+this.listfileparams.groupId+", action:'lock', lock:1, type:'dir', itemid:"+this.listfileparams.docgroupId+", childgroup_id:"+this.listfileparams.childGroupId+"})", this.listfileparams.lockIntervalDelay);
288 if (typeof(this.listfileparams.divLeft) != 'undefined' && typeof(this.listfileparams.divRight) != 'undefined') {
289 if (this.listfileparams.divLeft.outerHeight() > computeHeight) {
290 jQuery('#views').height(this.listfileparams.divLeft.outerHeight());
292 jQuery('#views').height(computeHeight);
298 this.listfileparams.divEditDirectory.hide();
299 computeHeight = this.listfileparams.divRight.outerHeight() - this.listfileparams.divEditDirectory.outerHeight();
300 currentLeftHeight = this.listfileparams.divLeft.outerHeight();
301 this.listfileparams.divLeft.height(currentLeftHeight - this.listfileparams.divEditDirectory.outerHeight());
302 jQuery.get(this.listfileparams.docManURL+'/', {
303 group_id: this.listfileparams.groupId,
307 itemid: this.listfileparams.docgroupId,
308 childgroup_id: this.listfileparams.childGroupId
310 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
311 if (typeof(this.listfileparams.divLeft) != 'undefined' && typeof(this.listfileparams.divRight) != 'undefined') {
312 if (this.listfileparams.divLeft.outerHeight() > computeHeight) {
313 jQuery('#views').height(this.listfileparams.divLeft.outerHeight());
315 jQuery('#views').height(computeHeight);
322 /*! toggle add item view div visibility
324 toggleAddItemView: function() {
325 if (!this.listfileparams.divAddItem.is(":visible")) {
326 jQuery.getJSON(this.listfileparams.docManURL + '/?group_id='+this.listfileparams.groupId+'&action=lock&json=1&type=dir&itemid='+this.listfileparams.docgroupId, jQuery.proxy(function(data){
327 if (typeof data.html != 'undefined') {
328 jQuery('#maindiv > .feedback').remove();
329 jQuery('#maindiv > .error').remove();
330 jQuery('#maindiv > .warning_msg').remove();
331 jQuery('#maindiv').prepend(data.html);
333 jQuery.get(this.listfileparams.docManURL+'/', {
334 group_id: this.listfileparams.groupId,
338 itemid: this.listfileparams.docgroupId,
339 childgroup_id: this.listfileparams.childGroupId
341 this.lockInterval[this.listfileparams.docgroupId] = setInterval("jQuery.get('"+this.listfileparams.docManURL+"/', {group_id:"+this.listfileparams.groupId+", action:'lock', lock:1, type:'dir', itemid:"+this.listfileparams.docgroupId+", childgroup_id:"+this.listfileparams.childGroupId+"})", this.listfileparams.lockIntervalDelay);
342 this.listfileparams.divAddItem.show();
343 this.listfileparams.divEditDirectory.hide();
344 computeHeight = this.listfileparams.divRight.outerHeight() + jQuery(this.listfileparams.divAddItem).outerHeight();
345 currentLeftHeight = this.listfileparams.divLeft.outerHeight();
346 this.listfileparams.divLeft.height(currentLeftHeight + jQuery(this.listfileparams.divAddItem).outerHeight());
347 if (typeof(this.listfileparams.divLeft) != 'undefined' && typeof(this.listfileparams.divRight) != 'undefined') {
348 if (this.listfileparams.divLeft.outerHeight() > computeHeight) {
349 jQuery('#views').height(this.listfileparams.divLeft.outerHeight());
351 jQuery('#views').height(computeHeight);
357 jQuery.get(this.listfileparams.docManURL+'/', {
358 group_id: this.listfileparams.groupId,
362 itemid: this.listfileparams.docgroupId,
363 childgroup_id: this.listfileparams.childGroupId
365 clearInterval(this.lockInterval[this.listfileparams.docgroupId]);
366 this.listfileparams.divAddItem.hide();
367 computeHeight = this.listfileparams.divRight.outerHeight() - jQuery(this.listfileparams.divAddItem).outerHeight();
368 currentLeftHeight = this.listfileparams.divLeft.outerHeight();
369 this.listfileparams.divLeft.height(currentLeftHeight - jQuery(this.listfileparams.divAddItem).outerHeight());
370 if (typeof(this.listfileparams.divLeft) != 'undefined' && typeof(this.listfileparams.divRight) != 'undefined') {
371 if (this.listfileparams.divLeft.outerHeight() > computeHeight) {
372 jQuery('#views').height(this.listfileparams.divLeft.outerHeight());
374 jQuery('#views').height(computeHeight);
381 /*! toggle add file edit view div visibility and play with lock
383 * @param params array
385 toggleEditFileView: function(params) {
386 this.docparams = params;
387 this.listfileparams.tableAddVersion.hide();
388 jQuery('#doc_group').empty();
389 for (var i = 0; i < this.docparams.docgroupDict.length; i++) {
390 jQuery('#doc_group').append(jQuery('<option>').text(this.docparams.docgroupDict[i][1]).attr('value', this.docparams.docgroupDict[i][0]));
392 jQuery('#doc_group option[value='+this.docparams.docgroupId+']').attr('selected', 'selected');
393 jQuery('#stateid').empty();
394 jQuery.each(this.docparams.statusDict, function(key, value) {
395 jQuery('#stateid').append(jQuery('<option>').text(key).attr('value',value));
397 jQuery('#stateid option[value='+this.docparams.statusId+']').attr('selected', 'selected');
398 jQuery('#docid').val(this.docparams.id);
399 var docid_groupid = this.listfileparams.groupId;
400 if (this.listfileparams.childGroupId != 0) {
401 docid_groupid = this.listfileparams.childGroupId;
403 jQuery.getJSON(this.listfileparams.docManURL + '/?group_id=' + docid_groupid + '&action=getdocversions&docid='+ this.docparams.id, jQuery.proxy(function(data){
404 if (typeof data.html != 'undefined') {
405 jQuery('#editFile > .feedback').remove();
406 jQuery('#editFile > .error').remove();
407 jQuery('#editFile > .warning_msg').remove();
408 jQuery('#editFile').prepend(data.html);
410 jQuery('#sortable_doc_version_table > tbody').children().remove();
411 eachdocparams = this.docparams;
412 jQuery.each(data, function (i, val) {
413 //_('VersionID/Current'), _('Filename'), _('Title'), _('Description'), _('Comment'), _('Author'), _('Last Time'), _('Size'), _('Actions'));
414 currenttdcontent = '';
415 if (val.current_version == 1) {
416 currenttdcontent += ' (x)';
418 if (eachdocparams.statusId != 2) {
419 filenametdcontent = jQuery('<a>'+val.filename+'</a>');
420 if (val.filetype == 'URL') {
422 filenametdcontent.attr('href', val.filename);
424 filenametdcontent.attr('href', eachdocparams.docManURL+'/view.php/'+eachdocparams.groupId+'/versions/'+eachdocparams.id+'/'+val.version);
427 filenametdcontent = val.filename;
429 versionactiontdcontent = '';
430 versionActionsArrayLength = val.versionactions.length;
431 for (var i = 0; i < versionActionsArrayLength; i++) {
432 versionactiontdcontent += val.versionactions[i];
434 var htmlString = '<tr id="docversion'+val.version.substr(1)+'" ><td>'+val.version.substr(1)+currenttdcontent+'</td><td>'+filenametdcontent[0].outerHTML+'</td><td>'+val.title+'</td><td>'+val.description+'</td><td>'+val.vcomment+'</td><td>'+val.created_by_username+'</td><td>'+val.lastdate+'</td><td>'+val.filesize_readable+'</td><td>'+versionactiontdcontent+'</td></tr>'
435 jQuery('#sortable_doc_version_table > tbody:last-child').append(htmlString);
440 jQuery('#editdocdata').attr('action', this.docparams.action);
442 jQuery.get(this.docparams.docManURL+'/', {
443 group_id: this.docparams.groupId,
447 itemid: this.docparams.docgroupId,
448 childgroup_id: this.docparams.childGroupId
450 this.lockInterval[this.docparams.id] = setInterval("jQuery.get('" + this.docparams.docManURL + "/', {group_id:"+this.docparams.groupId+", action:'lock', lock:1, type:'file', itemid:"+this.docparams.id+", childgroup_id:"+this.docparams.childGroupId+"})", this.docparams.lockIntervalDelay);
451 this.lockInterval[this.docparams.docgroupId] = setInterval("jQuery.get('" + this.docparams.docManURL + "/', {group_id:"+this.docparams.groupId+", action:'lock', lock:1, type: 'dir', itemid:"+this.docparams.docgroupId+", childgroup_id:"+this.docparams.childGroupId+"})", this.docparams.lockIntervalDelay);
452 jQuery(this.listfileparams.divEditFile).dialog('open');
456 toggleAddVersionView: function() {
457 jQuery('#title').val('');
458 jQuery('#description').val('');
459 jQuery(':file').val('');
460 jQuery('#edit_version').val('');
461 jQuery('#defaulteditzone').text();
462 jQuery('#current_version').prop('checked', false);
463 jQuery('#current_version').attr('onclick', 'return true');
464 if (!this.listfileparams.tableAddVersion.is(':visible')) {
465 jQuery('#new_version').val(1);
466 this.listfileparams.tableAddVersion.show();
468 this.listfileparams.tableAddVersion.hide();
469 jQuery('#new_version').val(0);
473 toggleEditVersionView: function(params) {
474 this.version = params;
475 if (this.version.isHtml) {
476 jQuery('#defaulteditfiletype').val('text/html');
478 if (this.version.isText && !this.version.isHtml) {
479 jQuery('#defaulteditfiletype').val('text/plain');
481 if (this.version.isText) {
482 jQuery.getJSON(this.listfileparams.docManURL+'/?group_id='+this.docparams.groupId+'&action=getfile&type=file&itemid='+this.docparams.id+'&version='+this.version.version, jQuery.proxy(function(data){
484 jQuery('#defaulteditzone').text(data.body);
489 if (!this.listfileparams.tableAddVersion.is(':visible')) {
490 if (this.version.isURL) {
491 jQuery('#uploadnewroweditfile').hide();
492 jQuery('#fileurlroweditfile').show();
493 jQuery('#fileurlroweditfile').find('input').attr('required', 'required').prop('required', true);
494 jQuery('#fileurlroweditfile').find('input').val(this.version.filename);
495 jQuery('#editonlineroweditfile').hide();
496 jQuery('#editor').attr('disabled', true);
497 jQuery('#editButtonUrl').prop('checked', true);
498 } else if (this.docparams.useCreateOnline && this.version.isText){
499 jQuery('#fileurlroweditfile').hide();
500 jQuery('#uploadnewroweditfile').hide();
501 jQuery('#editonlineroweditfile').show();
502 jQuery('#editor').removeAttr('disabled');
503 jQuery('#editButtonEditor').prop('checked', true);
505 jQuery('#onlineroweditfile').hide();
506 jQuery('#editor').attr('disabled', true);
507 jQuery('#fileurlroweditfile').hide();
508 jQuery('#uploadnewroweditfile').show();
509 jQuery('#editButtonFile').prop('checked', true);
511 jQuery('#title').val(this.version.title);
512 jQuery('#description').val(this.version.description);
513 jQuery('#vcomment').val(this.version.vcomment);
514 jQuery('#edit_version').val(this.version.version);
515 if (this.version.current_version == 1) {
516 jQuery('#current_version').attr('checked', 'checked').prop('checked', true);
517 jQuery('#current_version').attr('onclick', 'return false');
519 this.listfileparams.tableAddVersion.show();
521 this.listfileparams.tableAddVersion.hide();
522 jQuery('#title').val('');
523 jQuery('#description').val('');
524 jQuery('#vcomment').val('');
525 jQuery(':file').val('');
526 jQuery('#edit_version').val('');
527 jQuery('#current_version').removeAttr('checked');
528 jQuery('#current_version').attr('onclick', 'return true');
529 jQuery('#fileurlroweditfile').find('input').val('');
530 jQuery('#fileurlroweditfile').find('input').removeAttr('required');
531 jQuery('#fileurlroweditfile').hide();
532 jQuery('#uploadnewroweditfile').hide();
533 jQuery('#editonlineroweditfile').hide();
534 jQuery('#defaulteditzone').text('');
538 deleteVersion: function(params) {
539 this.delversion = params;
540 jQuery.getJSON(this.docparams.docManURL + '/?group_id=' + this.docparams.groupId + '&action=deleteversion&docid='+this.docparams.id+'&version='+this.delversion.version , jQuery.proxy(function(data){
541 if (typeof data.html != 'undefined') {
542 jQuery('#editFile > .feedback').remove();
543 jQuery('#editFile > .error').remove();
544 jQuery('#editFile > .warning_msg').remove();
545 jQuery('#editFile').prepend(data.html);
547 if (typeof data.status != 'undefined') {
548 if (data.status == 1) {
549 jQuery('#docversion'+this.version).remove();
550 if (jQuery('#sortable_doc_version_table tr').length <= 2) {
551 jQuery('#version_action_delete').remove();
555 }, this.delversion));
558 toggleMoveFileView: function() {
559 if (!this.listfileparams.divMoveFile.is(':visible')) {
560 this.listfileparams.divMoveFile.show();
561 jQuery('#movefileinput').val(function() {
562 var CheckedBoxes = new Array();
563 for (var h = 0; h < jQuery('input:checked').length; h++) {
564 if (typeof(jQuery('input:checked')[h].className) != 'undefined' && jQuery('input:checked')[h].className.match('checkeddocidactive')) {
565 CheckedBoxes.push(jQuery('input:checked')[h].value);
571 this.listfileparams.divMoveFile.hide();
575 toggleNotifyUserView: function(params) {
576 this.notifyparams = params;
577 jQuery('#notifytitle').text(this.notifyparams.title);
578 jQuery('#notifydescription').text(this.notifyparams.description);
579 jQuery('#notifydocid').val(this.notifyparams.id);
580 jQuery('#notifyfilelink').text(this.notifyparams.filename);
581 if (this.notifyparams.statusId != 2) {
582 if (this.notifyparams.isURL) {
583 jQuery('#notifyfilelink').attr('href', this.notifyparams.filename);
585 jQuery('#notifyfilelink').attr('href', this.notifyparams.docManURL+'/view.php/'+this.notifyparams.groupId+'/'+this.notifyparams.id);
589 jQuery('#notifyusersdoc').attr('action', this.notifyparams.action);
590 jQuery.get(this.notifyparams.docManURL+'/', {
591 group_id: this.notifyparams.groupId,
595 itemid: this.notifyparams.docgroupId,
596 childgroup_id: this.notifyparams.childGroupId
598 this.lockInterval[this.notifyparams.id] = setInterval("jQuery.get('" + this.notifyparams.docManURL + "/', {group_id:"+this.notifyparams.groupId+",action:'lock',lock:1,type:'file',itemid:"+this.notifyparams.id+",childgroup_id:"+this.notifyparams.childGroupId+"})", this.notifyparams.lockIntervalDelay);
599 this.lockInterval[this.notifyparams.docgroupId] = setInterval("jQuery.get('" + this.notifyparams.docManURL + "/', {group_id:"+this.notifyparams.groupId+",action:'lock',lock:1,type:'dir',itemid:"+this.notifyparams.docgroupId+",childgroup_id:"+this.notifyparams.childGroupId+"})", this.notifyparams.lockIntervalDelay);
600 jQuery(this.listfileparams.divNotifyUsers).dialog('open');
606 /*! build list of id, comma separated
608 buildUrlByCheckbox: function(id) {
609 var CheckedBoxes = new Array();
610 for (var h = 0; h < jQuery('input:checked').length; h++) {
611 if (typeof(jQuery('input:checked')[h].className) != 'undefined' && jQuery('input:checked')[h].className.match('checkeddocid'+id)) {
612 CheckedBoxes.push(jQuery('input:checked')[h].value);
618 checkAll: function(id, type) {
619 if (jQuery('#checkall'+type).is(':checked')) {
620 jQuery('.'+id).each(function() {
621 jQuery(this).prop('checked', true);
623 jQuery('#massaction'+type).show();
625 jQuery('.'+id).each(function() {
626 jQuery(this).prop('checked', false);
628 jQuery('#massaction'+type).hide();
632 checkgeneral: function(id) {
633 if (jQuery(this).attr('checked', false)) {
634 jQuery('#checkall'+id).prop('checked', false);
635 jQuery('#massaction'+id).hide();
636 jQuery('#movefile').hide();
638 for (var h = 0; h < jQuery('input:checked').length; h++) {
639 if (typeof(jQuery('input:checked')[h].className) != 'undefined' && jQuery('input:checked')[h].className.match('checkeddocid'+id)) {
640 jQuery('#massaction'+id).show();
647 DocManAddItemController.prototype =
649 /*! Binds the controls to the actions
651 bindControls: function() {
652 this.additemparams.submitZip.click(jQuery.proxy(this, "submitFormZip"));
655 submitFormZip: function() {
656 this.additemparams.injectZip.submit();
657 this.additemparams.submitZip.attr('disabled', true);
661 DocManAddFileController.prototype =
663 /*! Binds the controls to the actions
665 bindControls: function() {
666 this.addfileparams.buttonFile.click(jQuery.proxy(this, "toggleFileRowView"));
667 this.addfileparams.buttonUrl.click(jQuery.proxy(this, "toggleUrlRowView"));
668 if (typeof(this.addfileparams.buttonManualUpload) != 'undefined') {
669 this.addfileparams.buttonManualUpload.click(jQuery.proxy(this, "toggleManualUploadView"));
671 if (typeof(this.addfileparams.buttonEditor) != 'undefined') {
672 this.addfileparams.buttonEditor.click(jQuery.proxy(this, "toggleEditorView"));
676 toggleFileRowView: function() {
677 this.addfileparams.fileRow.show();
678 this.addfileparams.fileRow.find('input').attr("required", "required");
679 this.addfileparams.urlRow.hide();
680 this.addfileparams.urlRow.find('input').removeAttr("required");
681 this.addfileparams.pathRow.hide();
682 this.addfileparams.pathRow.find('input').removeAttr("required");
683 this.addfileparams.editRow.hide();
684 this.addfileparams.editNameRow.hide();
687 toggleUrlRowView: function() {
688 this.addfileparams.fileRow.hide();
689 this.addfileparams.fileRow.find('input').removeAttr("required");
690 this.addfileparams.urlRow.show();
691 this.addfileparams.urlRow.find('input').attr("required", "required");
692 this.addfileparams.pathRow.hide();
693 this.addfileparams.pathRow.find('input').removeAttr("required");
694 this.addfileparams.editRow.hide();
695 this.addfileparams.editNameRow.hide();
698 toggleManualUploadView: function() {
699 this.addfileparams.fileRow.hide();
700 this.addfileparams.fileRow.find('input').removeAttr("required");
701 this.addfileparams.urlRow.hide();
702 this.addfileparams.urlRow.find('input').removeAttr("required");
703 this.addfileparams.pathRow.show();
704 this.addfileparams.pathRow.find('input').attr("required", "required");
705 this.addfileparams.editRow.hide();
706 this.addfileparams.editNameRow.hide();
709 toggleEditorView: function() {
710 this.addfileparams.fileRow.hide();
711 this.addfileparams.fileRow.find('input').removeAttr("required");
712 this.addfileparams.urlRow.hide();
713 this.addfileparams.urlRow.find('input').removeAttr("required");
714 this.addfileparams.pathRow.hide();
715 this.addfileparams.pathRow.find('input').removeAttr("required");
716 this.addfileparams.editRow.show();
717 this.addfileparams.editNameRow.show();
721 DocManSearchController.prototype =
723 /*! Binds the controls to the actions
725 bindControls: function() {
726 this.searchparams.buttonStartDate.click(jQuery.proxy(this, 'setStartDate'));
727 this.searchparams.buttonEndDate.click(jQuery.proxy(this, 'setEndDate'));
730 setStartDate: function() {
731 if (this.searchparams.buttonStartDate.is(':checked')) {
732 this.searchparams.datePickerStartDate.removeAttr('disabled');
733 this.searchparams.datePickerStartDate.attr('required', 'required');
735 this.searchparams.datePickerStartDate.attr('disabled', 'disabled');
736 this.searchparams.datePickerStartDate.removeAttr('required');
740 setEndDate: function() {
741 if (this.searchparams.buttonEndDate.is(':checked')) {
742 this.searchparams.datePickerEndDate.removeAttr('disabled');
743 this.searchparams.datePickerEndDate.attr('required', 'required');
745 this.searchparams.datePickerEndDate.attr('disabled', 'disabled');
746 this.searchparams.datePickerEndDate.removeAttr('required');