[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 46d9fc2991a9f906e50fe411b6d1357f1684399c

Franck Villaume nerville at fusionforge.org
Fri Mar 7 11:51:00 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  46d9fc2991a9f906e50fe411b6d1357f1684399c (commit)
      from  ea11f6e9219833c95e28d2814d4cc43ab056d814 (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 46d9fc2991a9f906e50fe411b6d1357f1684399c
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Mar 7 11:50:31 2014 +0100

    docman: fix listtrashfile, plugin project-hierarchy handling and massive actions

diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php
index 95b7f06..d1d5256 100644
--- a/src/common/docman/views/listfile.php
+++ b/src/common/docman/views/listfile.php
@@ -38,8 +38,8 @@ global $dm; // the docman manager
 
 $linkmenu = 'listfile';
 $baseredirecturl = '/docman/?group_id='.$group_id;
-$redirecturl = $baseredirecturl.'&view=listfile&dirid='.$dirid;
-$actionlistfileurl = '?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
+$redirecturl = $baseredirecturl.'&view='.$linkmenu.'&dirid='.$dirid;
+$actionlistfileurl = '?group_id='.$group_id.'&view='.$linkmenu.'&dirid='.$dirid;
 if (!forge_check_perm('docman', $group_id, 'read')) {
 	$return_msg= _('Document Manager Access Denied');
 	session_redirect($baseredirecturl.'&warning_msg='.urlencode($return_msg));
diff --git a/src/common/docman/views/listtrashfile.php b/src/common/docman/views/listtrashfile.php
index 80e2e5f..39e51b6 100644
--- a/src/common/docman/views/listtrashfile.php
+++ b/src/common/docman/views/listtrashfile.php
@@ -5,7 +5,7 @@
  * Copyright 2000, Quentin Cregan/Sourceforge
  * Copyright 2002-2003, Tim Perdue/GForge, LLC
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2011-2013, Franck Villaume - TrivialDev
+ * Copyright 2011-2014, Franck Villaume - TrivialDev
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  * http://fusionforge.org
  *
@@ -31,15 +31,30 @@ global $group_id; // id of the group
 global $dirid; // id of doc_group
 global $g; // the Group object
 
+$linkmenu = 'listtrashfile';
 $childgroup_id = getIntFromRequest('childgroup_id');
+$baseredirecturl = '/docman/?group_id='.$group_id;
+$redirecturl = $baseredirecturl.'&view=.'.$linkmenu.'&dirid='.$dirid;
+$actionlistfileurl = '?group_id='.$group_id.'&view='.$linkmenu.'&dirid='.$dirid;
 
 if (!forge_check_perm('docman', $group_id, 'approve')) {
 	$return_msg= _('Document Manager Access Denied');
-	session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
+	session_redirect($baseredirecturl.'&warning_msg='.urlencode($return_msg));
 }
 
+echo '<div id="leftdiv">';
+include ($gfcommon.'docman/views/tree.php');
+echo '</div>';
+
 // plugin projects-hierarchy
-if (isset($childgroup_id) && $childgroup_id) {
+$childgroup_id = getIntFromRequest('childgroup_id');
+if ($childgroup_id) {
+	if (!forge_check_perm('docman', $childgroup_id, 'read')) {
+		$return_msg= _('Document Manager Access Denied');
+		session_redirect($baseredirecturl.'&warning_msg='.urlencode($return_msg));
+	}
+	$redirecturl .= '&childgroup_id='.$childgroup_id;
+	$actionlistfileurl .= '&childgroup_id='.$childgroup_id;
 	$g = group_get_object($childgroup_id);
 }
 
@@ -67,11 +82,11 @@ if ($dirid) {
 	$ndg = new DocumentGroup($g, $dirid);
 	$DocGroupName = $ndg->getName();
 	if (!$DocGroupName) {
-		session_redirect('/docman/?group_id='.$group_id.'&error_msg='.urlencode($g->getErrorMessage()));
+		session_redirect($baseredirecturl.'&error_msg='.urlencode($g->getErrorMessage()));
 	}
 	if ($ndg->getState() != 2) {
 		$error_msg = _('Invalid folder');
-		session_redirect('/docman/?group_id='.$group_id.'&view=listtrashfile&error_msg='.urlencode($error_msg));
+		session_redirect($baseredirecturl.'&view=listtrashfile&error_msg='.urlencode($error_msg));
 	}
 }
 
@@ -85,9 +100,6 @@ if ($d_arr != NULL ) {
 	}
 }
 
-echo '<div id="leftdiv">';
-include ($gfcommon.'docman/views/tree.php');
-echo '</div>';
 echo '<div id="rightdiv">';
 echo '<div style="padding:5px;"><form id="emptytrash" name="emptytrash" method="post" action="?group_id='.$group_id.'&action=emptytrash" >';
 echo '<input id="submitemptytrash" type="submit" value="'. _('Delete permanently all documents and folders with deleted status.') .'" >';
@@ -117,7 +129,7 @@ if ($DocGroupName) {
 	echo '<h3 class="docman_h3" >'._('Document Folder')._(': ').' <i>'.$DocGroupName.'</i> ';
 	if ($DocGroupName != '.trash') {
 		echo '<a href="#" id="docman-editdirectory" class="tabtitle" title="'._('Edit this folder').'" >'. html_image('docman/configure-directory.png',22,22,array('alt'=>'edit')). '</a>';
-		echo '<a href="?group_id='.$group_id.'&action=deldir&dirid='.$dirid.'" id="docman-deletedirectory" title="'._('Delete permanently this folder and his content.').'" >'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
+		echo '<a href="'.$actionlistfileurl.'&action=deldir" id="docman-deletedirectory" title="'._('Delete permanently this folder and his content.').'" >'. html_image('docman/delete-directory.png',22,22,array('alt'=>'deldir')). '</a>';
 	}
 	echo '</h3>';
 	echo '<div class="docman_div_include" id="editdocgroup" style="display:none;">';
@@ -188,8 +200,12 @@ if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
 
 		echo '<td>';
 		$newdgf = new DocumentGroupFactory($d->Group);
-		$editfileaction = '?action=editfile&fromview=listfile&dirid='.$d->getDocGroupID().'&group_id='.$group_id;
-		echo '<a class="tabtitle" href="?group_id='.$group_id.'&action=delfile&view=listtrashfile&dirid='.$dirid.'&fileid='.$d->getID().'" title="'. _('Delete permanently this document.') .'" >'.html_image('docman/delete-directory.png',22,22,array('alt'=>_('Delete permanently this document.'))). '</a>';
+		$editfileaction = '?action=editfile&fromview=listfile&dirid='.$d->getDocGroupID();
+		if (isset($GLOBALS['childgroup_id']) && $GLOBALS['childgroup_id']) {
+			$editfileaction .= '&childgroup_id='.$GLOBALS['childgroup_id'];
+		}
+		$editfileaction .= '&group_id='.$GLOBALS['group_id'];
+		echo '<a class="tabtitle" href="'.$actionlistfileurl.'&action=delfile&fileid='.$d->getID().'" title="'. _('Delete permanently this document.') .'" >'.html_image('docman/delete-directory.png',22,22,array('alt'=>_('Delete permanently this document.'))). '</a>';
 		echo '<a class="tabtitle-ne" href="#" onclick="javascript:controllerListTrash.toggleEditFileView({action:\''.$editfileaction.'\', lockIntervalDelay: 60000, childGroupId: '.util_ifsetor($childgroup_id, 0).' ,id:'.$d->getID().', groupId:'.$d->Group->getID().', docgroupId:'.$d->getDocGroupID().', statusId:'.$d->getStateID().', statusDict:'.$dm->getStatusNameList('json','2').', docgroupDict:'.$dm->getDocGroupList($newdgf->getNested(), 'json').', title:\''.$d->getName().'\', filename:\''.$d->getFilename().'\', description:\''.$d->getDescription().'\', isURL:\''.$d->isURL().'\', isText:\''.$d->isText().'\', useCreateOnline:'.$d->Group->useCreateOnline().', docManURL:\''.util_make_uri("docman").'\'})" title="'. _('Edit this document') .'" >'.html_image('docman/edit-file.png',22,22,array('alt'=>_('Edit this document'))). '</a>';
 		echo '</td>';
 		echo '</tr>'."\n";
@@ -200,8 +216,8 @@ if (isset($nested_docs[$dirid]) && is_array($nested_docs[$dirid])) {
     echo '<span class="tabtitle" id="docman-massactionmessage" title="'. _('Actions availables for selected documents, you need to check at least one document to get actions') . '" >';
     echo _('Mass actions for selected documents:');
     echo '</span>';
-	echo '<a class="tabtitle" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=delfile&view=listtrashfile&dirid='.$dirid.'&fileid=\'+controllerListTrash.buildUrlByCheckbox()" title="'. _('Permanently Delete') .'" >'.html_image('docman/delete-directory.png',22,22,array('alt'=>_('Permanently Delete'))). '</a>';
-	echo '<a class="tabtitle" href="#" onclick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/\'+controllerListTrash.buildUrlByCheckbox()" title="'. _('Download as a ZIP') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>_('Download as a ZIP'))). '</a>';
+	echo '<a class="tabtitle" href="#" onclick="window.location.href=\''.$actionlistfileurl.'&action=delfile&fileid=\'+controllerListTrash.buildUrlByCheckbox(\'active\')" title="'. _('Permanently Delete') .'" >'.html_image('docman/delete-directory.png',22,22,array('alt'=>_('Permanently Delete'))). '</a>';
+	echo '<a class="tabtitle" href="#" onclick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/\'+controllerListTrash.buildUrlByCheckbox(\'active\')" title="'. _('Download as a ZIP') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>_('Download as a ZIP'))). '</a>';
 	echo '</span>';
 	echo '</p>';
 	echo '</div>';

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

Summary of changes:
 src/common/docman/views/listfile.php      |    4 +--
 src/common/docman/views/listtrashfile.php |   42 ++++++++++++++++++++---------
 2 files changed, 31 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list