[Fusionforge-commits] r11884 - trunk/src/common/widget

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Wed Dec 22 17:48:14 CET 2010


Author: nerville
Date: 2010-12-22 17:48:14 +0100 (Wed, 22 Dec 2010)
New Revision: 11884

Added:
   trunk/src/common/widget/Widget_MyProjectsLatestDocuments.class.php
Modified:
   trunk/src/common/widget/Widget.class.php
Log:
prepare landing for new widget: last documents publish in my projets during the 5 last days

Modified: trunk/src/common/widget/Widget.class.php
===================================================================
--- trunk/src/common/widget/Widget.class.php	2010-12-22 16:46:27 UTC (rev 11883)
+++ trunk/src/common/widget/Widget.class.php	2010-12-22 16:48:14 UTC (rev 11884)
@@ -26,6 +26,7 @@
 require_once('common/widget/Widget_MyMonitoredForums.class.php');
 //require_once('common/widget/Widget_MyMonitoredFp.class.php');
 require_once('common/widget/Widget_MyLatestSvnCommits.class.php');
+require_once('common/widget/Widget_MyProjectsLatestDocuments.class.php');
 require_once('common/widget/Widget_MyArtifacts.class.php');
 //require_once('common/widget/Widget_MyBugs.class.php');
 //require_once('common/widget/Widget_MySrs.class.php');
@@ -44,6 +45,7 @@
 require_once('common/widget/Widget_ProjectInfo.class.php');
 require_once('common/widget/Widget_ProjectLatestFileReleases.class.php');
 require_once('common/widget/Widget_ProjectLatestDocuments.class.php');
+
 require_once('common/widget/Widget_ProjectLatestNews.class.php');
 require_once('common/widget/Widget_ProjectPublicAreas.class.php');
 require_once('common/widget/Widget_ProjectRss.class.php');/*
@@ -176,6 +178,9 @@
 			case 'mymonitoreddocuments':
 				$o = new Widget_MyMonitoredDocuments();
 				break;
+			case 'myprojectslatestdocuments':
+				$o = new Widget_MyProjectsLatestDocuments();
+                break;
 			case 'myartifacts':
 				$o = new Widget_MyArtifacts();
 				break;
@@ -187,9 +192,9 @@
 				break;
 
 			case 'myadmin':
-				if (forge_check_global_perm ('forge_admin')
-					|| forge_check_global_perm ('approve_projects')
-					|| forge_check_global_perm ('approve_news')) {
+				if (forge_check_global_perm('forge_admin')
+					|| forge_check_global_perm('approve_projects')
+					|| forge_check_global_perm('approve_news')) {
 					$o = new Widget_MyAdmin();
 				}
 				break;/*
@@ -219,28 +224,28 @@
 				case 'projectclassification':
 				$o = new Widget_ProjectClassification();
 				break;*/
-				case 'projectdescription':
+			case 'projectdescription':
 				$o = new Widget_ProjectDescription();
 				break;
-				case 'projectmembers':
+			case 'projectmembers':
 				$o = new Widget_ProjectMembers();
 				break;
-				case 'projectinfo':
+			case 'projectinfo':
 				$o = new Widget_ProjectInfo();
 				break;
-				case 'projectlatestfilereleases':
+			case 'projectlatestfilereleases':
 				$o = new Widget_ProjectLatestFileReleases();
 				break;
-				case 'projectlatestdocuments':
+			case 'projectlatestdocuments':
 				$o = new Widget_ProjectLatestDocuments();
 				break;
-				case 'projectlatestnews':
+			case 'projectlatestnews':
 				$o = new Widget_ProjectLatestNews();
 				break;
-				case 'projectpublicareas':
+			case 'projectpublicareas':
 				$o = new Widget_ProjectPublicAreas();
 				break;
-				case 'projectrss':
+			case 'projectrss':
 				$o = new Widget_ProjectRss();
 				break;/*
 				case 'projecttwitterfollow':
@@ -275,7 +280,7 @@
 				$widgets = array('myadmin', 'mysurveys', 'myprojects', 'mybookmarks', 
 						'mymonitoredforums', 'mymonitoredfp', 'myartifacts', 'mybugs', //'mywikipage' //not yet
 						'mytasks', 'mysrs', 'mylatestsvncommits', 'mytwitterfollow',
-						'mysystemevent', 'myrss', 'mymonitoreddocuments',
+						'mysystemevent', 'myrss', 'mymonitoreddocuments', 'myprojectslatestdocuments',
 						);
 				break;
 			case WidgetLayoutManager::OWNER_TYPE_GROUP:

Added: trunk/src/common/widget/Widget_MyProjectsLatestDocuments.class.php
===================================================================
--- trunk/src/common/widget/Widget_MyProjectsLatestDocuments.class.php	                        (rev 0)
+++ trunk/src/common/widget/Widget_MyProjectsLatestDocuments.class.php	2010-12-22 16:48:14 UTC (rev 11884)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ * Copyright 2010, Franck Villaume - Capgemini
+ *
+ * This file is a part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+require_once('Widget.class.php');
+
+/**
+* Widget_MyProjectsLatestDocuments
+* 
+* PROJECT LIST
+*/
+class Widget_MyProjectsLatestDocuments extends Widget {
+	function Widget_MyProjectsLatestDocuments() {
+		$this->Widget('myprojectslastestdocuments');
+	}
+
+	function getTitle() {
+		return _("Lastest Documents in My Projects");
+	}
+
+	function getContent() {
+		$html_my_projects = '';
+		global $HTML;
+		$user = session_get_user();
+		$groups = $user->getGroups();
+		sortProjectList($groups);
+
+		if (count ($groups) < 1) {
+			$html_my_projects .= '<div class="warning">'. _("You're not a member of any project") .'</div>';
+		} else {
+			$html_my_projects .= '<table style="width:100%">';
+			$i = 0;
+			foreach ($groups as $g) {
+				$i++;
+				$html_my_projects .= '
+					<TR '. $HTML->boxGetAltRowStyle($i) .'"><TD WIDTH="99%">'.
+					'<A href="/docman/?group_id='. $g->getID() .'/">'.
+					$g->getPublicName().'</A></td></tr>';
+			}
+			$html_my_projects .= '</table>';
+		}
+		return $html_my_projects;
+	}
+
+	function getDescription() {
+		return _("List the documents publish in projects you belong to during the 5 last days. Selecting any of these projects brings you to the corresponding Project Document Manager page.");
+	}
+
+	function getCategory() {
+		return 'Documents-Manager';
+	}
+
+	function isAjax() {
+		return true;
+	}
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>




More information about the Fusionforge-commits mailing list