[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 57655dd300e111ccc12363803799c8d5282996b6

Franck Villaume nerville at fusionforge.org
Wed Mar 5 17:48:46 CET 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, Branch_5_3 has been updated
       via  57655dd300e111ccc12363803799c8d5282996b6 (commit)
      from  da3b2e279f833d3399f41cb55bf4b2dc52638913 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 57655dd300e111ccc12363803799c8d5282996b6
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 5 17:45:57 2014 +0100

    docman: hack to fix div height size in listfile and trashfile

diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php
index 7458d41..95b7f06 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -156,7 +156,8 @@ jQuery(document).ready(function() {
 		childGroupId:		<?php echo util_ifsetor($childgroup_id, 0) ?>,
 		divEditFile:		jQuery('#editFile'),
 		divEditTitle:		'<?php echo _("Edit document dialog box") ?>',
-		enableResize:		true
+		enableResize:		true,
+		page:			'listfile'
 	});
 });
 
@@ -379,7 +380,13 @@ if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
 if (forge_check_perm('docman', $group_id, 'approve') && $DocGroupName) {
 	include ($gfcommon.'docman/views/pendingfiles.php');
 }
-if (forge_check_perm('docman', $g->getID(), 'approve')) {
+$foundFiles = 0;
+if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
+	$foundFiles = count($nested_docs[$dirid]);
+} elseif (isset($nested_pending_docs)) {
+	$foundFiles .= count($nested_pending_docs);
+}
+if (forge_check_perm('docman', $g->getID(), 'approve') && $foundFiles) {
 	include ($gfcommon.'docman/views/editfile.php');
 }
 
diff --git a/src/common/docman/views/listtrashfile.php b/src/common/docman/views/listtrashfile.php
index e9cd37c..80e2e5f 100644
--- a/src/common/docman/views/listtrashfile.php
+++ b/src/common/docman/views/listtrashfile.php
@@ -107,7 +107,8 @@ jQuery(document).ready(function() {
 		divRight:		jQuery('#rightdiv'),
 		divEditFile:		jQuery('#editFile'),
 		divEditTitle:		'<?php echo _("Edit document dialog box") ?>',
-		enableResize:		true
+		enableResize:		true,
+		page:			'trashfile'
 	});
 });
 //]]></script>
@@ -211,6 +212,10 @@ if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
 }
 
 echo '</div>';
-if (forge_check_perm('docman', $g->getID(), 'approve')) {
+$foundFiles = 0;
+if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
+	$foundFiles = count($nested_docs[$dirid]);
+}
+if (forge_check_perm('docman', $g->getID(), 'approve') && $foundFiles) {
 	include ($gfcommon.'docman/views/editfile.php');
 }
diff --git a/src/www/docman/scripts/DocManController.js b/src/www/docman/scripts/DocManController.js
index 64edbdb..f2b037c 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -3,7 +3,7 @@
  *
  * Copyright 2010, Antoine Mercadal - Capgemini
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2011-2013, Franck Villaume - TrivialDev
+ * Copyright 2011-2014, Franck Villaume - TrivialDev
  * Copyright 2011, Alain Peyrat
  * http://fusionforge.org
  *
@@ -65,15 +65,34 @@ DocManListFileController.prototype =
 	resizableDiv: function() {
 		var splitterPosition = '30%';
 		var mainwidth = jQuery('#maindiv').width();
-		var fixheight = 40;
-		if (this.params.divEditFile !== undefined) {
-			fixheight = this.params.divEditFile.height() - 40;
-		}
 		if (jQuery.Storage.get('splitterStyle') !== undefined) {
 			var storedSplitterPosition = jQuery.Storage.get('splitterStyle').replace(/px;?/g, '').replace(/left: /g, '');
 			splitterPosition = Math.round(storedSplitterPosition * 100 / mainwidth )+'%';
 		}
-		(this.params.divLeft.height() > this.params.divRight.height() - fixheight) ? mainheight = this.params.divLeft.height() : mainheight = this.params.divRight.height() - fixheight;
+		if (this.params.page == 'trashfile') {
+			(this.params.divLeft.height() > this.params.divRight.height()) ? mainheight = this.params.divLeft.height() : mainheight = this.params.divRight.height();
+		} else {
+			var fixwidth = 0;
+			if (jQuery('#editFile')) {
+				fixwidth = jQuery('#editFile').height() - jQuery('#resourcePopupContainer').height();
+				if ( fixwidth < 0) {
+					fixwidth = 0;
+				}
+			}
+			if (fixwidth == 0) {
+				fixwidth = -40;
+			}
+			var totalRightHeight = 0;
+			this.params.divRight.children().each(function() {
+					if (jQuery(this).is(':visible')) {
+						totalRightHeight = totalRightHeight + jQuery(this).outerHeight();
+					}
+				});
+			totalRightHeight = totalRightHeight - fixwidth;
+			(this.params.divRight.height() - fixwidth < 0) ? useRightHeight = this.params.divRight.height() : useRightHeight = this.params.divRight.height() - fixwidth;
+			(useRightHeight < totalRightHeight) ? useRightHeight = totalRightHeight : useRightHeight ;
+			(this.params.divLeft.height() > this.params.divRight.height()) ? mainheight = this.params.divLeft.height() : mainheight = useRightHeight;
+		}
 		jQuery('#views').height(mainheight)
 				.split({orientation:'vertical', limit:100, position: splitterPosition});
 		jQuery('.vsplitter').mouseup(function(){
@@ -235,14 +254,14 @@ DocManListFileController.prototype =
 			}, this));
 		}
 		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(this.params.divEditFile).dialog("open");
 
@@ -316,7 +335,7 @@ DocManAddFileController.prototype =
 			this.params.buttonEditor.click(jQuery.proxy(this, "toggleEditorView"));
 		}
 	},
-	
+
 	toggleFileRowView: function() {
 		this.params.fileRow.show();
 		this.params.fileRow.find('input').attr("required", "required");
@@ -327,7 +346,7 @@ DocManAddFileController.prototype =
 		this.params.editRow.hide();
 		this.params.editNameRow.hide();
 	},
-	
+
 	toggleUrlRowView: function() {
 		this.params.fileRow.hide();
 		this.params.fileRow.find('input').removeAttr("required");
@@ -338,7 +357,7 @@ DocManAddFileController.prototype =
 		this.params.editRow.hide();
 		this.params.editNameRow.hide();
 	},
-	
+
 	toggleManualUploadView: function() {
 		this.params.fileRow.hide();
 		this.params.fileRow.find('input').removeAttr("required");
@@ -349,7 +368,7 @@ DocManAddFileController.prototype =
 		this.params.editRow.hide();
 		this.params.editNameRow.hide();
 	},
-	
+
 	toggleEditorView: function() {
 		this.params.fileRow.hide();
 		this.params.fileRow.find('input').removeAttr("required");

-----------------------------------------------------------------------

Summary of changes:
 src/common/docman/views/listfile.php       |   11 +++++--
 src/common/docman/views/listtrashfile.php  |    9 ++++--
 src/www/docman/scripts/DocManController.js |   43 ++++++++++++++++++++--------
 3 files changed, 47 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list