[Fusionforge-commits] r15079 - trunk/src/www/docman/scripts

Franck VILLAUME nerville at fusionforge.org
Sun Feb 26 17:02:04 CET 2012


Author: nerville
Date: 2012-02-26 17:02:03 +0100 (Sun, 26 Feb 2012)
New Revision: 15079

Modified:
   trunk/src/www/docman/scripts/DocManController.js
Log:
enable lock feature

Modified: trunk/src/www/docman/scripts/DocManController.js
===================================================================
--- trunk/src/www/docman/scripts/DocManController.js	2012-02-26 15:45:44 UTC (rev 15078)
+++ trunk/src/www/docman/scripts/DocManController.js	2012-02-26 16:02:03 UTC (rev 15079)
@@ -96,29 +96,31 @@
 			modal: true,
 			title: this.params.divEditTitle,
 			buttons: {
-				Save: function() {
+				Save: jQuery.proxy(function() {
 					jQuery('#editdocdata').submit();
-// 					jQuery.get(this.params.docManURL, {
-// 						group_id:	this.params.groupId,
-// 						action:		'lockfile',
-// 						lock:		0,
-// 						fileid:		id,
-// 						childgroup_id:	this.params.childGroupId
-// 					});
-// 					clearInterval(this.lockInterval[id]);
+					var id = jQuery('#docid').attr('value');
+					jQuery.get(this.params.docManURL, {
+						group_id:	this.params.groupId,
+						action:		'lockfile',
+						lock:		0,
+						fileid:		id,
+						childgroup_id:	this.params.childGroupId
+					});
+					clearInterval(this.lockInterval[id]);
 					jQuery(modalId).dialog( "close" );
-				},
-				Cancel: function() {
-// 					jQuery.get(this.params.docManURL, {
-// 						group_id:	this.params.groupId,
-// 						action:		'lockfile',
-// 						lock:		0,
-// 						fileid:		id,
-// 						childgroup_id:	this.params.childGroupId
-// 					});
-// 					clearInterval(this.lockInterval[id]);
+				}, this),
+				Cancel: jQuery.proxy(function() {
+					var id = jQuery('#docid').attr('value');
+					jQuery.get(this.params.docManURL, {
+						group_id:	this.params.groupId,
+						action:		'lockfile',
+						lock:		0,
+						fileid:		id,
+						childgroup_id:	this.params.childGroupId
+					});
+					clearInterval(this.lockInterval[id]);
 					jQuery(modalId).dialog( "close" );
-				},
+				}, this),
 			},
 		});
 	},
@@ -211,14 +213,14 @@
 		}
 		jQuery('#editdocdata').attr('action', this.docparams.action);
 		
-// 		jQuery.get(this.docparams.docManURL, {
-// 				group_id:	this.docparams.groupId,
-// 				action:		'lockfile',
-// 				lock:		1,
-// 				fileid:		this.docparams.id,
-// 				childgroup_id:	this.docparams.childGroupId
-// 			});		
-// 		this.lockInterval[this.docparams.id] = setInterval("jQuery.get('" + this.docparams.docManURL + "', {group_id:"+this.docparams.groupId+",action:'lockfile',lock:1,fileid:"+this.docparams.id+",childgroup_id:"+this.docparams.childGroupId+"})",this.docparams.lockIntervalDelay);
+		jQuery.get(this.docparams.docManURL, {
+				group_id:	this.docparams.groupId,
+				action:		'lockfile',
+				lock:		1,
+				fileid:		this.docparams.id,
+				childgroup_id:	this.docparams.childGroupId
+			});		
+		this.lockInterval[this.docparams.id] = setInterval("jQuery.get('" + this.docparams.docManURL + "', {group_id:"+this.docparams.groupId+",action:'lockfile',lock:1,fileid:"+this.docparams.id+",childgroup_id:"+this.docparams.childGroupId+"})",this.docparams.lockIntervalDelay);
 		jQuery(this.params.divEditFile).dialog("open");
 
 		return false;




More information about the Fusionforge-commits mailing list