[Fusionforge-commits] r12299 - in trunk/src/common/docman: include views

Franck VILLAUME nerville at fusionforge.org
Fri Feb 18 17:19:16 CET 2011


Author: nerville
Date: 2011-02-18 17:19:16 +0100 (Fri, 18 Feb 2011)
New Revision: 12299

Modified:
   trunk/src/common/docman/include/utils.php
   trunk/src/common/docman/views/listfile.php
   trunk/src/common/docman/views/listtrashfile.php
Log:
remove useless code

Modified: trunk/src/common/docman/include/utils.php
===================================================================
--- trunk/src/common/docman/include/utils.php	2011-02-18 16:04:37 UTC (rev 12298)
+++ trunk/src/common/docman/include/utils.php	2011-02-18 16:19:16 UTC (rev 12299)
@@ -29,30 +29,6 @@
  * tooling library
  */
 
-function getNameDocGroup($id, $group) {
-	$group_object = group_get_object($group);
-	$res = db_query_params('SELECT groupname FROM doc_groups WHERE doc_group=$1 AND group_id=$2',
-				array($id, $group));
-	if (!$res || db_numrows($res) < 1) {
-		$group_object->setError('DocumentGroup::'. _('Invalid DocumentGroup ID'));
-		return false;
-	} else {
-		return (db_result($res, 0, 'groupname'));
-	}
-}
-
-function getStateDocGroup($id, $group) {
-	$group_object = group_get_object($group);
-	$res = db_query_params('SELECT stateid FROM doc_groups WHERE doc_group=$1 AND group_id=$2',
-				array($id, $group));
-	if (!$res || db_numrows($res) < 1) {
-		$group_object->setError('DocumentGroup:: '. _('Invalid DocumentGroup ID'));
-		return false;
-	} else {
-		return (db_result($res, 0, 'stateid'));
-	}
-}
-
 function doc_get_state_box($checkedval = 'xzxz') {
 	$res_states = db_query_params('select * from doc_states', array());
 	echo html_build_select_box($res_states, 'stateid', $checkedval, false);

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2011-02-18 16:04:37 UTC (rev 12298)
+++ trunk/src/common/docman/views/listfile.php	2011-02-18 16:19:16 UTC (rev 12299)
@@ -33,6 +33,7 @@
 global $HTML; // Layout object
 global $u; // User object
 global $use_tooltips; // enable or not tooltips in docman
+global $g; // the Group object
 
 if (!forge_check_perm('docman', $group_id, 'read')) {
 	$return_msg= _('Document Manager Access Denied');
@@ -53,7 +54,8 @@
 $DocGroupName = 0;
 
 if ($dirid) {
-	$DocGroupName = getNameDocGroup($dirid, $group_id);
+	$ndg = new DocumentGroup($g,$dirid);
+	$DocGroupName = $ndg->getName();
 	if (!$DocGroupName) {
 		session_redirect('/docman/?group_id='.$group_id.'&error_msg='.urlencode($g->getErrorMessage()));
 	}

Modified: trunk/src/common/docman/views/listtrashfile.php
===================================================================
--- trunk/src/common/docman/views/listtrashfile.php	2011-02-18 16:04:37 UTC (rev 12298)
+++ trunk/src/common/docman/views/listtrashfile.php	2011-02-18 16:19:16 UTC (rev 12299)
@@ -30,6 +30,7 @@
 global $dgf; // document group factory
 global $group_id; // id of the group
 global $dirid; // id of doc_group
+global $g; // the Group object
 
 if (!forge_check_perm('docman', $group_id, 'approve')) {
 	$return_msg= _('Document Manager Access Denied');
@@ -50,7 +51,8 @@
 $DocGroupName = 0;
 
 if ($dirid) {
-	$DocGroupName = getNameDocGroup($dirid, $group_id);
+	$ndg = new DocumentGroup($g,$dirid);
+	$DocGroupName = $ndg->getName();
 	if (!$DocGroupName) {
 		session_redirect('/docman/?group_id='.$group_id.'&error_msg='.urlencode($g->getErrorMessage()));
 	}




More information about the Fusionforge-commits mailing list