[Fusionforge-commits] r9982 - in trunk/gforge: common/docman www/docman www/docman/admin www/docman/include

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Thu Jun 3 09:32:13 CEST 2010


Author: nerville
Date: 2010-06-03 09:32:12 +0200 (Thu, 03 Jun 2010)
New Revision: 9982

Modified:
   trunk/gforge/common/docman/Document.class.php
   trunk/gforge/common/docman/DocumentFactory.class.php
   trunk/gforge/www/docman/admin/index.php
   trunk/gforge/www/docman/include/doc_utils.php
   trunk/gforge/www/docman/index.php
   trunk/gforge/www/docman/new.php
   trunk/gforge/www/docman/search.php
Log:
remove the language tag in docman

Modified: trunk/gforge/common/docman/Document.class.php
===================================================================
--- trunk/gforge/common/docman/Document.class.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/common/docman/Document.class.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -108,7 +108,7 @@
 	 *	@param	string	The description of this document.
 	 *	@return	boolean	success.
 	 */
-	function create($filename,$filetype,$data,$doc_group,$title,$language_id,$description) {
+	function create($filename,$filetype,$data,$doc_group,$title,$description) {
 		if (strlen($title) < 5) {
 			$this->setError(_('Title Must Be At Least 5 Characters'));
 			return false;
@@ -152,15 +152,14 @@
 
 		db_begin();
 		$result = db_query_params('INSERT INTO doc_data (group_id,title,description,createdate,doc_group,
-			stateid,language_id,filename,filetype,filesize,data,data_words,created_by)
-                        VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)',
+			stateid,filename,filetype,filesize,data,data_words,created_by)
+                        VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)',
 					  array($this->Group->getId(),
 						htmlspecialchars($title),
 						htmlspecialchars($description),
 						time(),
 						$doc_group,
 						$doc_initstatus,
-						$language_id,
 						$filename,
 						$filetype,
 						$filesize,
@@ -300,24 +299,6 @@
 	}
 
 	/**
-	 *	getLanguageID - get this language_id.
-	 *
-	 *	@return	int	The language_id.
-	 */
-	function getLanguageID() {
-		return $this->data_array['language_id'];
-	}
-
-	/**
-	 *	getLanguageName - the language_name of this document.
-	 *
-	 *	@return string	The language_name.
-	 */
-	function getLanguageName() {
-		return $this->data_array['language_name'];
-	}
-
-	/**
 	 *	getDocGroupID - get this doc_group_id.
 	 *
 	 *	@return	int	The doc_group_id.
@@ -442,7 +423,7 @@
 	 *	@param	int	The state id of the doc_states table.
 	 *	@return	boolean	success.
 	 */
-	function update($filename,$filetype,$data,$doc_group,$title,$language_id,$description,$stateid) {
+	function update($filename,$filetype,$data,$doc_group,$title,$description,$stateid) {
 		if (strlen($title) < 5) {
 			$this->setError(_('Title Must Be At Least 5 Characters'));
 			return false;
@@ -466,17 +447,15 @@
 			doc_group=$4,
 			filetype=$5,
 			filename=$6,
-			language_id=$7,
-			updatedate=$8
-			WHERE group_id=$9
-			AND docid=$10',
+			updatedate=$7
+			WHERE group_id=$8
+			AND docid=$9',
 					array (htmlspecialchars($title),
 					       htmlspecialchars($description),
 					       $stateid,
 					       $doc_group,
 					       $filetype,
 					       $filename,
-					       $language_id,
 					       time(),
 					       $this->Group->getID(),
 					       $this->getID())) ;

Modified: trunk/gforge/common/docman/DocumentFactory.class.php
===================================================================
--- trunk/gforge/common/docman/DocumentFactory.class.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/common/docman/DocumentFactory.class.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -87,15 +87,6 @@
 	}
 
 	/**
-	 *	setLanguageID - call this before getDocuments() if you want to limit to a specific language.
-	 *
-	 *	@param	int	The language_id from the supported_languages table.
-	 */
-	function setLanguageID($languageid) {
-		$this->languageid=$languageid;
-	}
-
-	/**
 	 *	setDocGroupID - call this before getDocuments() if you want to limit to a specific doc_group.
 	 *
 	 *	@param	int	The doc_group from the doc_groups table.

Modified: trunk/gforge/www/docman/admin/index.php
===================================================================
--- trunk/gforge/www/docman/admin/index.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/www/docman/admin/index.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -67,7 +67,6 @@
 		$doc_group = getIntFromRequest('doc_group');
 		$title = getStringFromRequest('title');
 		$description = getStringFromRequest('description');
-		$language_id = getIntFromRequest('language_id');
 		$data = getStringFromRequest('data');
 		$file_url = getStringFromRequest('file_url');
 		//$ftp_filename = getStringFromRequest('ftp_filename');
@@ -116,7 +115,7 @@
 			$filename=$d->getFileName();
 			$filetype=$d->getFileType();
 		}
-		if (!$d->update($filename,$filetype,$data,$doc_group,$title,$language_id,$description,$stateid)) {
+		if (!$d->update($filename,$filetype,$data,$doc_group,$title,$description,$stateid)) {
 			exit_error('Error',$d->getErrorMessage());
 		}
 		$feedback = _('Updated successfully');
@@ -277,16 +276,6 @@
 
 	<tr>
 		<td>
-		<strong><?php echo _('Language') ?></strong><br />
-		<?php
-
-			echo html_get_language_popup('language_id',$d->getLanguageID());
-
-		?></td>
-	</tr>
-
-	<tr>
-		<td>
 		<strong><?php echo _('Group that document belongs in') ?></strong><br />
 		<?php
 

Modified: trunk/gforge/www/docman/include/doc_utils.php
===================================================================
--- trunk/gforge/www/docman/include/doc_utils.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/www/docman/include/doc_utils.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -92,48 +92,6 @@
 
 }
 
-function doc_droplist_count($l_group_id, $language_id, $g) {
-	$pub = array () ;
-	$pub[] = 1 ;
-	if (session_loggedin()) {
-		$perm =& $g->getPermission ();
-		if ($perm && is_object($perm) && $perm->isMember()) {
-			$pub[] = 4 ;
-			$pub[] = 5 ;
-		}
-	}
-	$gresult = db_query_params ('SELECT dd.language_id, sl.name, COUNT(*) AS count
-		 FROM doc_groups AS dg, doc_data AS dd, supported_languages AS sl
-		 WHERE dg.doc_group = dd.doc_group
-		 AND dg.group_id = $1
-		 AND dd.stateid = ANY ($2)
-		 AND sl.language_id = dd.language_id
-		 GROUP BY dd.language_id, sl.name',
-				    array ($l_group_id,
-					   db_int_array_to_any_clause ($pub))) ;
-	if (db_numrows($gresult) >= 1) {
-
-		print "<form name=\"langchoice\" action=\"index.php?group_id=".$l_group_id."\" method=\"post\"><table border=\"0\">
- <tr><td valign=\"middle\"><strong>"._('Language')." </strong></td>
- <td valign=\"middle\"><select name=\"language_id\">\n\n";
-		print "<option value=\"*\">"._('All Languages')." </option>";
-		while($grow = db_fetch_array($gresult)) {
-
-			if ($language_id == $grow['language_id']) {
-
-				print "<option value=\"".$grow['language_id']."\" selected=\"selected\">".$grow['name']." (".$grow['count'].") </option>";
-			} else {
-				print "<option value=\"".$grow['language_id']."\">".$grow['name']." (".$grow['count'].") </option>";
-			}
-		}
-		print "</select></td><td valign=\"middle\"><input type=\"submit\" value=\""._('Go')."\" /></td></tr></table></form>";
-	} else {
-		echo db_error();
-	}
-
-
-}
-
 function doc_get_state_box($checkedval='xzxz') {
 	$res_states=db_query_params ('select * from doc_states;',
 			array()) ;
@@ -176,7 +134,7 @@
 			} else {
 				$icon = 'cfolder15.png';
 			}
-			echo "<li>".html_image('ic/'.$icon,"15","13",array("border"=>"0"))." <a href='index.php?group_id=".$doc_group->Group->getID()."&amp;selected_doc_group_id=".$doc_group->getID()."&amp;language_id=".@$GLOBALS['selected_language'];
+			echo "<li>".html_image('ic/'.$icon,"15","13",array("border"=>"0"))." <a href='index.php?group_id=".$doc_group->Group->getID()."&amp;selected_doc_group_id=".$doc_group->getID();
 			if ($from_admin && $stateid) {	// if we're sorting by the state, pass the state as a variable
 				echo "&amp;selected_stateid=".$stateid;
 			}

Modified: trunk/gforge/www/docman/index.php
===================================================================
--- trunk/gforge/www/docman/index.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/www/docman/index.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -48,7 +48,6 @@
 }
 
 $group_id = getIntFromRequest('group_id');
-$language_id = getStringFromRequest('language_id');
 $feedback = getStringFromRequest('feedback');
 
 if (!$group_id) {
@@ -70,34 +69,6 @@
 }
 
 
-// Save chosen language in docman and print document details in documents list
-if ($language_id)
-{
-       setcookie("my_language_id", "$language_id", time()+3600*24*999);
-}
-if (!$language_id && isset($_COOKIE["my_language_id"]))
-{
-       $language_id = $_COOKIE["my_language_id"];
-}
-
-// the "selected language" variable will be used in the links to navigate the
-// document groups tree
-
-if (!$language_id) {
-	if (session_loggedin()) {
-		$language_id = $LUSER->getLanguage();
-	} else {
-		$language_id = 1;
-	}
-	
-	$selected_language = $language_id;
-} else if ($language_id == "*") {
-	$language_id = 0 ;
-	$selected_language = "*";
-} else {
-	$selected_language = $language_id;
-}
-
 // check if the user is docman's admin
 if (forge_check_perm ('docman', $group_id, 'approve')) {
 	$is_editor = true;
@@ -105,8 +76,6 @@
 	$is_editor = false;
 }
 
-$df->setLanguageID($language_id);
-
 docman_header(_('Document Manager: Display Document'),_('Project: %1$s'));
 echo '<h1>'.sprintf(_('Documents for %1$s'), $g->getPublicName()) .'</h1>';
 
@@ -119,8 +88,6 @@
 if (!$d_arr || count($d_arr) < 1) {
 	print '<div class="warning_msg">'._('This project has no visible documents').'</div>';
 } else {
-	doc_droplist_count($group_id, $language_id, $g);
-
 	// Get the document groups info
 	$nested_groups =& $dgf->getNested();	
 

Modified: trunk/gforge/www/docman/new.php
===================================================================
--- trunk/gforge/www/docman/new.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/www/docman/new.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -48,7 +48,6 @@
 	$file_url = getStringFromRequest('file_url');
 	//$ftp_filename = getStringFromRequest('ftp_filename');
 	$uploaded_data = getUploadedFile('uploaded_data');
-	$language_id = getIntFromRequest('language_id');
 	$type = getStringFromRequest('type');
 	$name = getStringFromRequest('name');
 
@@ -104,7 +103,7 @@
 		*/
 	}
 	
-	if (!$d->create($uploaded_data_name,$uploaded_data_type,$data,$doc_group,$title,$language_id,$description)) {
+	if (!$d->create($uploaded_data_name,$uploaded_data_type,$data,$doc_group,$title,$description)) {
 			exit_error(_('Error'),$d->getErrorMessage());
 	} else {		
 		if ($type == 'editor') {
@@ -215,12 +214,6 @@
 		echo '
 			<tr>
 				<td>
-				<strong>'. _('Language').' :</strong><br />
-				'. html_get_language_popup('language_id',1) .'
-				</td>
-			</tr>
-			<tr>
-				<td>
 				<strong>'. _('Group that document belongs in').' :</strong><br />';
 		$dgf = new DocumentGroupFactory($g);
 		if ($dgf->isError()) {

Modified: trunk/gforge/www/docman/search.php
===================================================================
--- trunk/gforge/www/docman/search.php	2010-06-02 20:16:21 UTC (rev 9981)
+++ trunk/gforge/www/docman/search.php	2010-06-03 07:32:12 UTC (rev 9982)
@@ -21,7 +21,6 @@
 require_once $gfcommon.'docman/DocumentGroupFactory.class.php';
 
 $group_id = getIntFromRequest('group_id');
-$language_id = getIntFromRequest('language_id');
 
 if (!$group_id) {
     exit_no_group();
@@ -41,26 +40,6 @@
 	exit_error(_('Error'),$dgf->getErrorMessage());
 }
 
-// the "selected language" variable will be used in the links to navigate the
-// document groups tree
-
-if (!$language_id) {
-	if (session_loggedin()) {
-		$language_id = $LUSER->getLanguage();
-	} else {
-		$language_id = 1;
-	}
-	
-	$selected_language = $language_id;
-} else if ($language_id == "*") {
-	$language_id = 0 ;
-	$selected_language = "*";
-} else {
-	$selected_language = $language_id;
-}
-$df->setLanguageID($language_id);
-
-
 // check if the user is docman's admin
 $is_editor = forge_check_perm ('docman', $g->getID(), 'admin') ;
 
@@ -90,7 +69,7 @@
 	$textsearch = getStringFromPost("textsearch");
 	$textsearch = prepare_search_text ($textsearch);
 	$mots = preg_split("/[\s,]+/",$textsearch);
-	$qpa = db_construct_qpa (false, 'SELECT filename, docid, doc_data.stateid as stateid, doc_states.name as statename, title, description, createdate, updatedate, doc_group, language_id, group_id FROM doc_data JOIN doc_states ON doc_data.stateid = doc_states.stateid') ;
+	$qpa = db_construct_qpa (false, 'SELECT filename, docid, doc_data.stateid as stateid, doc_states.name as statename, title, description, createdate, updatedate, doc_group, group_id FROM doc_data JOIN doc_states ON doc_data.stateid = doc_states.stateid') ;
 
 	if (getStringFromPost('search_type') == "one")
 	{
@@ -174,7 +153,7 @@
 		$vtp->SetVar($handle,"RESULT.N",$count);
 		$vtp->SetVar($handle,"RESULT.SEARCHTITLE",$item["title"]);
 		$vtp->SetVar($handle,"RESULT.SEARCHCOMMENT",$item["description"]);
-		$s = get_path_document ($groupsarr, $item["doc_group"], "$_GET[group_id]", "$item[language_id]");
+		$s = get_path_document ($groupsarr, $item["doc_group"], "$_GET[group_id]");
 		$vtp->SetVar($handle,"RESULT.SEARCHPATH",$s);
 		$vtp->SetVar($handle,"RESULT.GROUP_ID",$_GET["group_id"]);
 		$vtp->SetVar($handle,"RESULT.DOC_ID",$item["docid"]);
@@ -198,7 +177,7 @@
 	echo "<pre>$text</pre>";
 }
 
-function get_path_document ($groupsarr, $doc_group, $group_id, $language_id="1")
+function get_path_document ($groupsarr, $doc_group, $group_id)
 {
 	$rep = "";
 	foreach ($groupsarr as $group)
@@ -207,12 +186,12 @@
 		{
 			if ($group["parent_doc_group"] == 0) 
 			{
-				$href = util_make_url ("/docman/index.php?group_id=$group_id&selected_doc_group_id=$group[doc_group]&language_id=$language_id");
+				$href = util_make_url ("/docman/index.php?group_id=$group_id&selected_doc_group_id=$group[doc_group]");
 				$rep .= "<a href=\"$href\" style=\"color:#00610A;\">$group[groupname]</a>";
 				break;
 			}
-			$s = get_path_document ($groupsarr,  $group["parent_doc_group"], $group_id, $language_id);
-			$href = util_make_url ("/docman/index.php?group_id=$group_id&selected_doc_group_id=$group[doc_group]&language_id=$language_id");
+			$s = get_path_document ($groupsarr,  $group["parent_doc_group"], $group_id);
+			$href = util_make_url ("/docman/index.php?group_id=$group_id&selected_doc_group_id=$group[doc_group]");
 			$rep .= "$s / <a href=\"$href\" style=\"color:#00610A;\">$group[groupname]</a>";
 			break;
 		}




More information about the Fusionforge-commits mailing list