[Fusionforge-commits] r11665 - in branches/Branch_5_1/src: common/docman common/docman/views www/docman/scripts

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Mon Nov 29 14:56:36 CET 2010


Author: nerville
Date: 2010-11-29 14:56:36 +0100 (Mon, 29 Nov 2010)
New Revision: 11665

Modified:
   branches/Branch_5_1/src/common/docman/
   branches/Branch_5_1/src/common/docman/views/admin.php
   branches/Branch_5_1/src/common/docman/views/menu.php
   branches/Branch_5_1/src/common/docman/views/tree.php
   branches/Branch_5_1/src/www/docman/scripts/DocManController.js
Log:
port docman fix from trunk


Property changes on: branches/Branch_5_1/src/common/docman
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/Branch_4_7/gforge/common/docman:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8/gforge/common/docman:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8704-8754
/trunk/gforge/common/docman:8721-8727
   + /branches/Branch_4_7/gforge/common/docman:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8/gforge/common/docman:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8704-8754
/trunk/gforge/common/docman:8721-8727
/trunk/src/common/docman:11661-11663

Modified: branches/Branch_5_1/src/common/docman/views/admin.php
===================================================================
--- branches/Branch_5_1/src/common/docman/views/admin.php	2010-11-29 13:47:07 UTC (rev 11664)
+++ branches/Branch_5_1/src/common/docman/views/admin.php	2010-11-29 13:56:36 UTC (rev 11665)
@@ -57,77 +57,82 @@
 }
 </script>
 <?php
-	echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminpending\')" ><h4>'. _('Admin Pending Files') .'</h4></a>';
-	echo '<div id="adminpending" style="display:none">';
-	include ($gfcommon.'docman/views/listpendingfile.php');
-	echo '</div>';
+	if (forge_check_perm('docman', $group_id, 'approve')) {
+		echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminpending\')" ><h4>'. _('Admin Pending Files') .'</h4></a>';
+		echo '<div id="adminpending" style="display:none">';
+		include ($gfcommon.'docman/views/listpendingfile.php');
+		echo '</div>';
 
-	echo '<a href="#" onclick="javascript:displayAdminDiv(\'admintrash\')" ><h4>'. _('Admin Trash') .'</h4></a>';
-	echo '<div id="admintrash" style="display:none;" >';
-	include ($gfcommon.'docman/views/listtrashfile.php');
-	echo '</div>';
+		echo '<a href="#" onclick="javascript:displayAdminDiv(\'admintrash\')" ><h4>'. _('Admin Trash') .'</h4></a>';
+		echo '<div id="admintrash" style="display:none;" >';
+		include ($gfcommon.'docman/views/listtrashfile.php');
+		echo '</div>';
+	}
 
-	echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminoptions\')" ><h4>'. _('Admin Options') .'</h4></a>';
-	echo '<div id="adminoptions" style="display:none;" >';
+	if (forge_check_perm('docman', $group_id, 'admin')) {
+		echo '<a href="#" onclick="javascript:displayAdminDiv(\'adminoptions\')" ><h4>'. _('Admin Options') .'</h4></a>';
+		echo '<div id="adminoptions" style="display:none;" >';
 
-	echo '<form id="backup" name="backup" method="post" action="'. util_make_url ('/docman/view.php/'.$group_id.'/backup') .'" >';
-	echo '<ul>';
-	echo '<li><input id="submitbackup" type="button" value="'. _('Extract documents and directories as an archive') .'" onclick="javascript:doIt(\'backup\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+		echo '<form id="backup" name="backup" method="post" action="'. util_make_url ('/docman/view.php/'.$group_id.'/backup') .'" >';
+		echo '<ul>';
+		echo '<li><input id="submitbackup" type="button" value="'. _('Extract documents and directories as an archive') .'" onclick="javascript:doIt(\'backup\')"></li>';
+		echo '</ul>';
+		echo '</form>';
 
-	echo '<form id="createonline" name="createonline" method="post" action="?group_id='.$group_id.'&action=updatecreateonline" >';
-	echo '<ul>';
+		echo '<form id="createonline" name="createonline" method="post" action="?group_id='.$group_id.'&action=updatecreateonline" >';
+		echo '<ul>';
 
-	$createOnlineStatus = '1';
-	$labelCreateOnline = _('Enable Create Online Documents');
-	if ($g->useCreateOnline()) {
-		$createOnlineStatus='0';
-		$labelCreateOnline = _('Disable Create Online Documents');
-	}
+		$createOnlineStatus = '1';
+		$labelCreateOnline = _('Enable Create Online Documents');
+		if ($g->useCreateOnline()) {
+			$createOnlineStatus='0';
+			$labelCreateOnline = _('Disable Create Online Documents');
+		}
 
-	echo '<li><input name="status" type="hidden" value="'.$createOnlineStatus.'"><input id="submitcreateonline" type="button" value="'.$labelCreateOnline.'" onclick="javascript:doIt(\'createonline\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+		echo '<li><input name="status" type="hidden" value="'.$createOnlineStatus.'"><input id="submitcreateonline" type="button" value="'.$labelCreateOnline.'" onclick="javascript:doIt(\'createonline\')"></li>';
+		echo '</ul>';
+		echo '</form>';
 
-	echo '<form id="searchengine" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updateenginesearch" >';
-	echo '<ul>';
+		echo '<form id="searchengine" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updateenginesearch" >';
+		echo '<ul>';
 
-	$searchEngineStatus = '1';
-	$labelSearchEngine = _('Enable Search Engine');
-	if ($g->useDocmanSearch()) {
-		$searchEngineStatus='0';
-		$labelSearchEngine = _('Disable Search Engine');
-	}
+		$searchEngineStatus = '1';
+		$labelSearchEngine = _('Enable Search Engine');
+		if ($g->useDocmanSearch()) {
+			$searchEngineStatus='0';
+			$labelSearchEngine = _('Disable Search Engine');
+		}
 
-	echo '<li><input name="status" type="hidden" value="'.$searchEngineStatus.'"><input id="submitsearchengine" type="button" value="'.$labelSearchEngine.'" onclick="javascript:doIt(\'searchengine\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+		echo '<li><input name="status" type="hidden" value="'.$searchEngineStatus.'"><input id="submitsearchengine" type="button" value="'.$labelSearchEngine.'" onclick="javascript:doIt(\'searchengine\')"></li>';
+		echo '</ul>';
+		echo '</form>';
 
-	if ($g->useDocmanSearch()) {
-		if ($d_arr || count($d_arr) > 1) {
-			echo '<form id="reindexword" name="reindexword" method="post" action="?group_id='.$group_id.'&action=forcereindexenginesearch">';
+		if ($g->useDocmanSearch()) {
+			if ($d_arr || count($d_arr) > 1) {
+				echo '<form id="reindexword" name="reindexword" method="post" action="?group_id='.$group_id.'&action=forcereindexenginesearch">';
+				echo '<ul>';
+				echo '<li><input name="status" type="hidden" value="1"><input id="submitreindexword" type="button" value="'. _('Force reindexation search engine') .'" onclick="javascript:doIt(\'reindexword\')"></li>';
+				echo '</ul>';
+				echo '</form>';
+			}
+		}
+
+		if (forge_get_config('use_webdav')) {
+			echo '<form id="webdavinterface" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updatewebdavinterface" >';
 			echo '<ul>';
-			echo '<li><input name="status" type="hidden" value="1"><input id="submitreindexword" type="button" value="'. _('Force reindexation search engine') .'" onclick="javascript:doIt(\'reindexword\')"></li>';
+			$webdavStatus = '1';
+			$labelWebdavInterface = _('Enable Webdav Interface');
+			if ($g->useWebDav()) {
+				$webdavStatus = '0';
+				$labelWebdavInterface = _('Disable Webdav Interface');
+			}
+			echo '<li><input name="status" type="hidden" value="'.$webdavStatus.'"><input id="submitweddavinterface" type="button" value="'.$labelWebdavInterface.'" onclick="javascript:doIt(\'webdavinterface\')"></li>';
 			echo '</ul>';
 			echo '</form>';
 		}
-	}
 
-	if (forge_get_config('use_webdav')) {
-		echo '<form id="webdavinterface" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updatewebdavinterface" >';
-		echo '<ul>';
-		$webdavStatus = '1';
-		$labelWebdavInterface = _('Enable Webdav Interface');
-		if ($g->useWebDav()) {
-			$webdavStatus = '0';
-			$labelWebdavInterface = _('Disable Webdav Interface');
-		}
-		echo '<li><input name="status" type="hidden" value="'.$webdavStatus.'"><input id="submitweddavinterface" type="button" value="'.$labelWebdavInterface.'" onclick="javascript:doIt(\'webdavinterface\')"></li>';
-		echo '</ul>';
-		echo '</form>';
+		echo '</div>';
 	}
-
-	echo '</div></div>';
+	echo '</div>';
 }
 ?>

Modified: branches/Branch_5_1/src/common/docman/views/menu.php
===================================================================
--- branches/Branch_5_1/src/common/docman/views/menu.php	2010-11-29 13:47:07 UTC (rev 11664)
+++ branches/Branch_5_1/src/common/docman/views/menu.php	2010-11-29 13:56:36 UTC (rev 11665)
@@ -54,9 +54,11 @@
 	}
 }
 
-if (forge_check_perm('docman', $group_id, 'admin')) {
-	$menu_text[] = _('Admin');
-	$menu_links[] = '/docman/?group_id='.$group_id.'&view=admin';
+if (session_loggedin()) {
+	if (forge_check_perm('docman', $group_id, 'approve')) {
+		$menu_text[] = _('Admin');
+		$menu_links[] = '/docman/?group_id='.$group_id.'&view=admin';
+	}
 }
 
 if (count($menu_text)) {

Modified: branches/Branch_5_1/src/common/docman/views/tree.php
===================================================================
--- branches/Branch_5_1/src/common/docman/views/tree.php	2010-11-29 13:47:07 UTC (rev 11664)
+++ branches/Branch_5_1/src/common/docman/views/tree.php	2010-11-29 13:56:36 UTC (rev 11665)
@@ -52,13 +52,7 @@
 <link rel="stylesheet" href="<?php echo util_make_uri ('/jscook/ThemeXP/theme.css'); ?>" type="text/css" />
 <script src="<?php echo util_make_uri ('/jscook/ThemeXP/theme.js'); ?>" type="text/javascript"></script>
 
-<div id="myMenuID" style="overflow:auto; height:300px"></div>
-<!-- if someone wants to make it dynamic.... please do it -->
-	<!--<script type="text/javascript">
-		var mymenuidDiv = document.getElementById("myMenuID");
-		var documenttreeDiv = document.getElementById("documenttree");
-		mymenuidDiv.style.height = documenttreeDiv.offsetHeight+"px";
-	</script>-->
+<div id="myMenuID" style="overflow:auto;"></div>
 
 <script type="text/javascript">
 	var myMenu =

Modified: branches/Branch_5_1/src/www/docman/scripts/DocManController.js
===================================================================
--- branches/Branch_5_1/src/www/docman/scripts/DocManController.js	2010-11-29 13:47:07 UTC (rev 11664)
+++ branches/Branch_5_1/src/www/docman/scripts/DocManController.js	2010-11-29 13:56:36 UTC (rev 11665)
@@ -22,135 +22,137 @@
  */
 
 /*! ListFileController
-    @param groupId the current FusionForge groupID
-    @param tipsyElements [{selector: "name", options:{delayIn: 1000, delayOut: 1000, fade: true, gravity: 's'}}]
-*/
+ * @param groupId the current FusionForge groupID
+ * @param tipsyElements [{selector: "name", options:{delayIn: 1000, delayOut: 1000, fade: true, gravity: 's'}}]
+ */
 DocManListFileController = function(params)
 {
-    this.lockInterval       = [];
-    this.params             = params;
-    
-    this.initTipsy();
-    this.bindControls();
+	this.lockInterval	= [];
+	this.params		= params;
+
+	this.initTipsy();
+	this.bindControls();
 };
 
 
 DocManListFileController.prototype =
 {
-    /*! Binds the controls to the actions
-    */
-    bindControls: function()
-    {
-        this.params.buttonAddDirectory.click(jQuery.proxy(this, "toggleAddDirectoryView"));
-        this.params.buttonEditDirectory.click(jQuery.proxy(this, "toggleEditDirectoryView"));
-        this.params.buttonAddNewFile.click(jQuery.proxy(this, "toggleAddFileView"));
-    },
-    
-    /*! initializes tipsy
-    */
-    initTipsy: function()
-    {
-        for(var i = 0; i < this.params.tipsyElements.length; i++)
-        {
-            var el = this.params.tipsyElements[i];
-            
-            jQuery(el.selector).tipsy({
-                    gravity: el.options.gravity,
-                    delayIn: el.options.delayIn,
-                    delayOut: el.options.delayOut, 
-                    fade: el.options.fade});
-        }
-    
-    },
+	/*! Binds the controls to the actions
+	 */
+	bindControls: function()
+	{
+		this.params.buttonAddDirectory.click(jQuery.proxy(this, "toggleAddDirectoryView"));
+		this.params.buttonEditDirectory.click(jQuery.proxy(this, "toggleEditDirectoryView"));
+		this.params.buttonAddNewFile.click(jQuery.proxy(this, "toggleAddFileView"));
+	},
 
-    /*! toggle sub group view div visibility
-    */
-    toggleAddDirectoryView: function()
-    {
-    	if (!this.params.divAddDirectory.is(":visible")) 
-    	{
-    	    this.params.divAddDirectory.show();
-            this.params.divAddFile.hide();
-            this.params.divEditDirectory.hide();
-    	}
-    	else
-    	{
-    	    this.params.divAddDirectory.hide();
-    	}
-    },
-        
-    /*! toggle edit group view div visibility
-    */
-    toggleEditDirectoryView: function() 
-    {
-    	if (!this.params.divEditDirectory.is(":visible")) 
-    	{
-    	    this.params.divEditDirectory.show();
-            this.params.divAddDirectory.hide();
-            this.params.divAddFile.hide();
-    	}
-    	else
-    	{
-    	    this.params.divEditDirectory.hide();
-    	}
-    },
-    
-    /*! toggle add file view div visibility
-    */
-    toggleAddFileView: function()
-    {
-    	if (!this.params.divAddFile.is(":visible")) 
-    	{
-    	    this.params.divAddFile.show();
-            this.params.divAddDirectory.hide();
-            this.params.divEditDirectory.hide();
-    	}
-    	else
-    	{
-    	    this.params.divAddFile.hide();
-    	}
-    },
-    
-    
-    toggleEditFileView: function(id)
-    {
-    	var divid   = '#editfile'+id,
-    	    el      = jQuery(divid);
-        
-    	if (!el.is(":visible"))
-    	{
-    		el.show();
-    		
-            jQuery.get(this.params.docManURL, {
-                    group_id:   this.params.groupId, 
-                    action:     'lockfile', 
-                    lock:       1, 
-                    fileid:     id
-            });
-            
-            this.lockInterval[id] = setInterval("jQuery.get('" + this.params.docManURL + "', {group_id:"+this.params.groupId+",action:'lockfile',lock:1,fileid:"+id+"})",this.params.lockIntervalDelay);
-    	}
-    	else
-    	{
-            el.hide();
-            jQuery.get(this.params.docManURL, {
-                group_id:   this.params.groupId,
-                action:     'lockfile',
-                lock:       0,
-                fileid:     id
-            });
-            
-            clearInterval(this.lockInterval[id]);
-    	}
-    },
-    
-    computeDocumentsData: function() {
-        /*
-          TODO:  
-          build the array in php is not dynamic, and clearly, this sucks.
-          It would be better to be able to ask JSON data containing the contents of a dir
-          etc. and compute this data with Javascript in order to build the table. 
-          This will avoids to reload the page when you simply want to lock / remove / add a file etc.
-        */
-    }    
+	/*! initializes tipsy
+	 */
+	initTipsy: function()
+	{
+		for(var i = 0; i < this.params.tipsyElements.length; i++)
+		{
+			var el = this.params.tipsyElements[i];
+
+			jQuery(el.selector).tipsy({
+				gravity: el.options.gravity,
+				delayIn: el.options.delayIn,
+				delayOut: el.options.delayOut,
+				fade: el.options.fade});
+		}
+	},
+
+	/*! toggle sub group view div visibility
+	 */
+	toggleAddDirectoryView: function()
+	{
+		if (!this.params.divAddDirectory.is(":visible"))
+		{
+			this.params.divAddDirectory.show();
+			this.params.divAddFile.hide();
+			this.params.divEditDirectory.hide();
+		}
+		else
+		{
+			this.params.divAddDirectory.hide();
+		}
+	},
+
+	/*! toggle edit group view div visibility
+	 */
+	toggleEditDirectoryView: function() 
+	{
+		if (!this.params.divEditDirectory.is(":visible"))
+		{
+			this.params.divEditDirectory.show();
+			this.params.divAddDirectory.hide();
+			this.params.divAddFile.hide();
+		}
+		else
+		{
+			this.params.divEditDirectory.hide();
+		}
+	},
+
+	/*! toggle add file view div visibility
+	 */
+	toggleAddFileView: function()
+	{
+		if (!this.params.divAddFile.is(":visible"))
+		{
+			this.params.divAddFile.show();
+			this.params.divAddDirectory.hide();
+			this.params.divEditDirectory.hide();
+		}
+		else
+		{
+			this.params.divAddFile.hide();
+		}
+	},
+
+	/*! toggle add file edit view div visibility and play with lock
+	 *
+	 * @param	string	id of the div
+	 */
+	toggleEditFileView: function(id)
+	{
+		var divid	= '#editfile'+id,
+		el		= jQuery(divid);
+
+		if (!el.is(":visible"))
+		{
+			el.show();
+
+			jQuery.get(this.params.docManURL, {
+				group_id:	this.params.groupId,
+				action:		'lockfile',
+				lock:		1,
+				fileid:		id
+			});
+
+			this.lockInterval[id] = setInterval("jQuery.get('" + this.params.docManURL + "', {group_id:"+this.params.groupId+",action:'lockfile',lock:1,fileid:"+id+"})",this.params.lockIntervalDelay);
+		}
+		else
+		{
+			el.hide();
+			jQuery.get(this.params.docManURL, {
+				group_id:	this.params.groupId,
+				action:		'lockfile',
+				lock:		0,
+				fileid:		id
+			});
+
+			clearInterval(this.lockInterval[id]);
+		}
+	},
+
+	computeDocumentsData: function() {
+		/*
+		TODO:  
+		build the array in php is not dynamic, and clearly, this sucks.
+		It would be better to be able to ask JSON data containing the contents of a dir
+		etc. and compute this data with Javascript in order to build the table. 
+		This will avoids to reload the page when you simply want to lock / remove / add a file etc.
+		*/
+	}
 }




More information about the Fusionforge-commits mailing list