[Fusionforge-commits] FusionForge branch Branch_5_2 updated. c6c5e89aab6b153cc2e7a4d6d3839e1bbcb1bf57

Franck VILLAUME nerville at fusionforge.org
Tue Feb 19 19:43:25 CET 2013


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_2 has been updated
       via  c6c5e89aab6b153cc2e7a4d6d3839e1bbcb1bf57 (commit)
      from  3e0fd2930a4e415141ca17ec0628db6d13f40139 (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 c6c5e89aab6b153cc2e7a4d6d3839e1bbcb1bf57
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Feb 19 19:41:19 2013 +0100

    Branch_5_2: widgets: fix availability based on patch from French Ministry of education

diff --git a/src/common/widget/Widget_MyArtifacts.class.php b/src/common/widget/Widget_MyArtifacts.class.php
index c8958f4..c781e7b 100644
--- a/src/common/widget/Widget_MyArtifacts.class.php
+++ b/src/common/widget/Widget_MyArtifacts.class.php
@@ -1,7 +1,8 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
+ * Copyright 2013, French Ministry of Education
  * http://fusionforge.org
  *
  * This file is a part of Fusionforge.
@@ -256,6 +257,17 @@ class Widget_MyArtifacts extends Widget {
 	function getDescription() {
 		return _("List artifacts you have submitted or assigned to you, by project.");
 	}
+
+	function isAvailable() {
+		if (!forge_get_config('use_tracker')) {
+			return false;
+		}
+		foreach (UserManager::instance()->getCurrentUser()->getGroups(false) as $p) {
+			if ($p->usesTracker()) {
+				return true;
+			}
+		}
+	}
 }
 
 ?>
diff --git a/src/common/widget/Widget_MyMonitoredDocuments.class.php b/src/common/widget/Widget_MyMonitoredDocuments.class.php
index 84cd4bb..a5779f9 100644
--- a/src/common/widget/Widget_MyMonitoredDocuments.class.php
+++ b/src/common/widget/Widget_MyMonitoredDocuments.class.php
@@ -2,7 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2011-2012, Franck Villaume - TrivialDev
+ * Copyright 2011-2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of FusionForge.
@@ -114,5 +114,16 @@ class Widget_MyMonitoredDocuments extends Widget {
 	function getDescription() {
 		return _("List documents that you are currently monitoring, by project.<br />To cancel any of the monitored items just click on the trash icon next to the item label.");
 	}
+
+	function isAvailable() {
+		if (!forge_get_config('use_docman')) {
+			return false;
+		}
+		foreach (UserManager::instance()->getCurrentUser()->getGroups(false) as $p) {
+			if ($p->usesDocman()) {
+				return true;
+			}
+		}
+	}
 }
 ?>
diff --git a/src/common/widget/Widget_MyMonitoredForums.class.php b/src/common/widget/Widget_MyMonitoredForums.class.php
index c8c9572..fe45c89 100644
--- a/src/common/widget/Widget_MyMonitoredForums.class.php
+++ b/src/common/widget/Widget_MyMonitoredForums.class.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
  *
  * This file is a part of FusionForge.
  *
@@ -141,5 +141,16 @@ class Widget_MyMonitoredForums extends Widget {
 		}
 		return $ajax_url;
 	}
+
+	function isAvailable() {
+		if (!forge_get_config('use_forum')) {
+			return false;
+		}
+		foreach (UserManager::instance()->getCurrentUser()->getGroups(false) as $p) {
+			if ($p->usesForum()) {
+				return true;
+			}
+		}
+	}
 }
-?>
\ No newline at end of file
+?>
diff --git a/src/common/widget/Widget_MyProjectsLastDocuments.class.php b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
index 644ebb3..21b99e0 100644
--- a/src/common/widget/Widget_MyProjectsLastDocuments.class.php
+++ b/src/common/widget/Widget_MyProjectsLastDocuments.class.php
@@ -2,7 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2011-2012, Franck Villaume - TrivialDev
+ * Copyright 2011-2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of FusionForge.
@@ -136,6 +136,17 @@ class Widget_MyProjectsLastDocuments extends Widget {
 	function getCategory() {
 		return 'Documents-Manager';
 	}
+
+	function isAvailable() {
+		if (!forge_get_config('use_docman')) {
+			return false;
+		}
+		foreach (UserManager::instance()->getCurrentUser()->getGroups(false) as $p) {
+			if ($p->usesDocman()) {
+				return true;
+			}
+		}
+	}
 }
 
 // Local Variables:

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

Summary of changes:
 src/common/widget/Widget_MyArtifacts.class.php          |   14 +++++++++++++-
 src/common/widget/Widget_MyMonitoredDocuments.class.php |   13 ++++++++++++-
 src/common/widget/Widget_MyMonitoredForums.class.php    |   15 +++++++++++++--
 .../widget/Widget_MyProjectsLastDocuments.class.php     |   13 ++++++++++++-
 4 files changed, 50 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list