[Fusionforge-commits] FusionForge branch master updated. 0efafb140243248e650b04de57d1cf60bd12b73f

Franck Villaume nerville at fusionforge.org
Fri Jul 4 14:33:52 CEST 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, master has been updated
       via  0efafb140243248e650b04de57d1cf60bd12b73f (commit)
       via  bb99290e897f44ed45bf5865cb34955cab635b4e (commit)
       via  0065a8286aaac78d4858aa4155e90862a4f9a97e (commit)
      from  569713a978d40855dd92e61ff239e29984c0d203 (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 0efafb140243248e650b04de57d1cf60bd12b73f
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Jul 4 14:31:07 2014 +0200

    docman: clean up json call

diff --git a/src/common/docman/actions/lock.php b/src/common/docman/actions/lock.php
index 197850c..345e915 100644
--- a/src/common/docman/actions/lock.php
+++ b/src/common/docman/actions/lock.php
@@ -27,6 +27,7 @@
 global $dirid; //id of doc_group
 global $group_id; // id of group
 global $LUSER; // User object
+global $HTML;
 
 $sysdebug_enable = false;
 
@@ -72,6 +73,14 @@ if ($lock === 0) {
 	echo $objectType->setLock($lock, $LUSER->getID(), time());
 } elseif ($lock === 2) {
 	//get the current status of the lock
-	echo $objectType->getLocked();
+	if (getIntFromRequest('json')) {
+		$result = array();
+		if ($objectType->getLocked()) {
+			$result['html'] = $HTML->warning_msg(_('Action currently locked by another user.'));
+		}
+		echo json_encode($result);
+	} else {
+		echo $objectType->getLocked();
+	}
 }
 exit;
diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php
index 7772424..fac3c6c 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -156,8 +156,7 @@ jQuery(document).ready(function() {
 		enableResize:		true,
 		page:			'listfile',
 		docgroupId:		<?php echo $dirid ?>,
-		lockIntervalDelay:	60000,
-		lockedAction:		'<?php echo _('Action currently locked by another user.') ?>'
+		lockIntervalDelay:	60000
 	});
 });
 
@@ -173,7 +172,7 @@ if ($DocGroupName) {
 	echo html_e('h2', array(), $headerPath, false);
 	echo html_ao('h3', array('class' => 'docman_h3'));
 	echo html_e('span', array(), _('Document Folder')._(': ').html_e('i', array(), $DocGroupName, false).' ', false);
-	/* should we steal the lock on file ? */
+	/* should we steal the lock on folder ? */
 	if ($ndg->getLocked()) {
 		if ($ndg->getLockedBy() == $u->getID()) {
 			$ndg->setLock(0);
diff --git a/src/www/docman/scripts/DocManController.js b/src/www/docman/scripts/DocManController.js
index 2663a31..8b05ba7 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -179,12 +179,12 @@ DocManListFileController.prototype =
 	 */
 	toggleEditDirectoryView: function() {
 		if (!this.params.divEditDirectory.is(":visible")) {
-			jQuery.getJSON(this.params.docManURL + '/?group_id=' + this.params.groupId + '&action=lock&type=dir&itemid=' + this.params.docgroupId, jQuery.proxy(function(data){
-				if (data) {
+			jQuery.getJSON(this.params.docManURL + '/?group_id=' + this.params.groupId + '&action=lock&json=1&type=dir&itemid=' + this.params.docgroupId, jQuery.proxy(function(data){
+				if (typeof data.html != 'undefined') {
 					jQuery('#maindiv > .feedback').remove();
 					jQuery('#maindiv > .error').remove();
 					jQuery('#maindiv > .warning_msg').remove();
-					jQuery('#maindiv').prepend('<div class="actionresult"><p id="validateLinkMessage" class="warning_msg">'+this.params.lockedAction+'</p></div>');
+					jQuery('#maindiv').prepend(data.html);
 				} else {
 					this.params.divEditDirectory.show();
 					if (typeof(this.params.divAddItem) != 'undefined') {
@@ -240,9 +240,12 @@ DocManListFileController.prototype =
 	 */
 	toggleAddItemView: function() {
 		if (!this.params.divAddItem.is(":visible")) {
-			jQuery.getJSON(this.params.docManURL + '/?group_id=' + this.params.groupId + '&action=lock&type=dir&itemid=' + this.params.docgroupId, jQuery.proxy(function(data){
-				if (data) {
-					jQuery('#maindiv').prepend('<div class="actionresult"><p id="validateLinkMessage" class="warning_msg">'+this.params.lockedAction+'</p></div>');
+			jQuery.getJSON(this.params.docManURL + '/?group_id=' + this.params.groupId + '&action=lock&json=1&type=dir&itemid=' + this.params.docgroupId, jQuery.proxy(function(data){
+				if (typeof data.html != 'undefined') {
+					jQuery('#maindiv > .feedback').remove();
+					jQuery('#maindiv > .error').remove();
+					jQuery('#maindiv > .warning_msg').remove();
+					jQuery('#maindiv').prepend(data.html);
 				} else {
 					jQuery.get(this.params.docManURL, {
 						group_id:	this.params.groupId,

commit bb99290e897f44ed45bf5865cb34955cab635b4e
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Jul 4 14:30:44 2014 +0200

    FRS: fix wrong function call

diff --git a/src/common/frs/actions/deleterelease.php b/src/common/frs/actions/deleterelease.php
index 5336451..7259357 100644
--- a/src/common/frs/actions/deleterelease.php
+++ b/src/common/frs/actions/deleterelease.php
@@ -31,7 +31,7 @@ $sysdebug_enable = false;
 $result = array();
 
 if (!forge_check_perm('frs', $group_id, 'write')) {
-	$result['html'] = $HTML->warning(_('FRS Action Denied.'));
+	$result['html'] = $HTML->warning_msg(_('FRS Action Denied.'));
 	echo json_encode($result);
 	exit;
 }

commit 0065a8286aaac78d4858aa4155e90862a4f9a97e
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jul 3 16:01:08 2014 +0200

    docman: remove unused js param; cleanup feedback, error, warning_msg div

diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php
index dbd71d9..7772424 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -1,3 +1,4 @@
+
 <?php
 /**
  * FusionForge Documentation Manager
@@ -156,7 +157,6 @@ jQuery(document).ready(function() {
 		page:			'listfile',
 		docgroupId:		<?php echo $dirid ?>,
 		lockIntervalDelay:	60000,
-		imgroot:		'<?php echo $HTML->imgroot ?>',
 		lockedAction:		'<?php echo _('Action currently locked by another user.') ?>'
 	});
 });
diff --git a/src/www/docman/scripts/DocManController.js b/src/www/docman/scripts/DocManController.js
index 2b06047..2663a31 100644
--- a/src/www/docman/scripts/DocManController.js
+++ b/src/www/docman/scripts/DocManController.js
@@ -181,6 +181,9 @@ DocManListFileController.prototype =
 		if (!this.params.divEditDirectory.is(":visible")) {
 			jQuery.getJSON(this.params.docManURL + '/?group_id=' + this.params.groupId + '&action=lock&type=dir&itemid=' + this.params.docgroupId, jQuery.proxy(function(data){
 				if (data) {
+					jQuery('#maindiv > .feedback').remove();
+					jQuery('#maindiv > .error').remove();
+					jQuery('#maindiv > .warning_msg').remove();
 					jQuery('#maindiv').prepend('<div class="actionresult"><p id="validateLinkMessage" class="warning_msg">'+this.params.lockedAction+'</p></div>');
 				} else {
 					this.params.divEditDirectory.show();

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

Summary of changes:
 src/common/docman/actions/lock.php         |   11 ++++++++++-
 src/common/docman/views/listfile.php       |    7 +++----
 src/common/frs/actions/deleterelease.php   |    2 +-
 src/www/docman/scripts/DocManController.js |   18 ++++++++++++------
 4 files changed, 26 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list