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  c37d9bf44d8db4616858bb771fcaeea202e79687 (commit)
      from  6f3cbc7744e1f97f1ef396564d5f96ea860f84ef (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 c37d9bf44d8db4616858bb771fcaeea202e79687
Author: Franck Villaume <[email protected]>
Date:   Thu May 29 14:17:42 2014 +0200

    fix [#683]: Hudson Widgets do not respect roles

diff --git a/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php 
b/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
index 0968269..11d880b 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -25,6 +26,8 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_JobBuildHistory extends HudsonJobWidget {
 
+       var $content;
+
        function hudson_Widget_JobBuildHistory($owner_type, $owner_id) {
                $request =& HTTPRequest::instance();
                if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
@@ -36,16 +39,25 @@ class hudson_Widget_JobBuildHistory extends HudsonJobWidget 
{
                }
                $this->Widget($this->widget_id);
                $this->setOwner($owner_id, $owner_type);
+               if ($this->widget_id == 'plugin_hudson_project_jobbuildhistory' 
&& forge_check_perm('hudson', $this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_("%s Builds 
History"), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _("Builds History");
+                       }
+               } else {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_("%s Builds 
History"), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _("Builds History");
+                       }
+               }
        }
 
        function getTitle() {
-               $title = '';
-               if ($this->job) {
-                       $title .= sprintf(_("%s Builds History"), 
$this->job->getName());
-               } else {
-                       $title .= _("Builds History");
-               }
-               return  $title;
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -95,4 +107,8 @@ class hudson_Widget_JobBuildHistory extends HudsonJobWidget {
                        return null;
                }
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }
diff --git 
a/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php 
b/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
index 8e5d269..6139ef9 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -27,6 +28,7 @@ class hudson_Widget_JobLastArtifacts extends HudsonJobWidget {
 
        var $build;
        var $last_build_url;
+       var $content;
 
        function hudson_Widget_JobLastArtifacts($owner_type, $owner_id) {
                $request =& HTTPRequest::instance();
@@ -39,16 +41,25 @@ class hudson_Widget_JobLastArtifacts extends 
HudsonJobWidget {
                }
                $this->Widget($this->widget_id);
                $this->setOwner($owner_id, $owner_type);
+               if ($this->widget_id == 
'plugin_hudson_project_joblastartifacts' && forge_check_perm('hudson', 
$this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_('%s Last 
Artifacts'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Last Artifacts');
+                       }
+               } else {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_('%s Last 
Artifacts'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Last Artifacts');
+                       }
+               }
        }
 
        function getTitle() {
-               $title = '';
-               if ($this->job) {
-                       $title .= sprintf(_('%s Last Artifacts'), 
$this->job->getName());
-               } else {
-                       $title .= _('Last Artifacts');
-               }
-               return  $title;
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -99,4 +110,8 @@ class hudson_Widget_JobLastArtifacts extends HudsonJobWidget 
{
                }
                return $html;
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php 
b/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
index bbd1a41..d04a36e 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -25,6 +26,8 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_JobLastBuilds extends HudsonJobWidget {
 
+       var $content;
+
        function hudson_Widget_JobLastBuilds($owner_type, $owner_id) {
                $request =& HTTPRequest::instance();
                if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
@@ -36,16 +39,25 @@ class hudson_Widget_JobLastBuilds extends HudsonJobWidget {
                }
                $this->Widget($this->widget_id);
                $this->setOwner($owner_id, $owner_type);
+               if ($this->widget_id == 'plugin_hudson_project_joblastbuilds' 
&& forge_check_perm('hudson', $this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_('%s Last 
Builds'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Last Builds');
+                       }
+               } else {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] .= sprintf(_('%s Last 
Builds'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Last Builds');
+                       }
+               }
        }
 
        function getTitle() {
-               $title = '';
-               if ($this->job) {
-                       $title .= sprintf(_('%s Last Builds'), 
$this->job->getName());
-               } else {
-                       $title .= _('Last Builds');
-               }
-               return  $title;
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -97,4 +109,8 @@ class hudson_Widget_JobLastBuilds extends HudsonJobWidget {
                }
                return $html;
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php 
b/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
index f22b7af..4e6570d 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -27,6 +28,7 @@ require_once 'HudsonTestResult.class.php';
 class hudson_Widget_JobTestResults extends HudsonJobWidget {
 
        var $test_result;
+       var $content;
 
        function hudson_Widget_JobTestResults($owner_type, $owner_id) {
                $request =& HTTPRequest::instance();
@@ -39,19 +41,31 @@ class hudson_Widget_JobTestResults extends HudsonJobWidget {
                }
                $this->Widget($this->widget_id);
                $this->setOwner($owner_id, $owner_type);
+               if ($this->widget_id == 'plugin_hudson_project_jobtestresults' 
&& forge_check_perm('hudson', $this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->job && $this->test_result) {
+                               $this->content['title'] .= vsprintf(_('%1$s 
Test Results (%2$s / %3$s)'),
+                                               array($this->job->getName(), 
$this->test_result->getPassCount(), $this->test_result->getTotalCount()));
+                       } elseif ($this->job && ! $this->test_result) {
+                               $this->content['title'] .= sprintf(_('%s Test 
Results'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Test Results');
+                       }
+               } else {
+                       $this->content['title'] = '';
+                       if ($this->job && $this->test_result) {
+                               $this->content['title'] .= vsprintf(_('%1$s 
Test Results (%2$s / %3$s)'),
+                                               array($this->job->getName(), 
$this->test_result->getPassCount(), $this->test_result->getTotalCount()));
+                       } elseif ($this->job && ! $this->test_result) {
+                               $this->content['title'] .= sprintf(_('%s Test 
Results'), $this->job->getName());
+                       } else {
+                               $this->content['title'] .= _('Test Results');
+                       }
+               }
        }
 
        function getTitle() {
-               $title = '';
-               if ($this->job && $this->test_result) {
-                       $title .= vsprintf(_('%1$s Test Results (%2$s / %3$s)'),
-                                       array($this->job->getName(), 
$this->test_result->getPassCount(), $this->test_result->getTotalCount()));
-               } elseif ($this->job && ! $this->test_result) {
-                       $title .= sprintf(_('%s Test Results'), 
$this->job->getName());
-               } else {
-                       $title .= _('Test Results');
-               }
-               return  $title;
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -100,4 +114,8 @@ class hudson_Widget_JobTestResults extends HudsonJobWidget {
                }
                return $html;
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php 
b/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
index b10c756..87d8b2d 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
@@ -27,6 +27,8 @@ require_once 'HudsonTestResult.class.php';
 
 class hudson_Widget_JobTestTrend extends HudsonJobWidget {
 
+       var $content;
+
        function hudson_Widget_JobTestTrend($owner_type, $owner_id) {
                $request =& HTTPRequest::instance();
                if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
@@ -38,14 +40,25 @@ class hudson_Widget_JobTestTrend extends HudsonJobWidget {
                }
                $this->Widget($this->widget_id);
                $this->setOwner($owner_id, $owner_type);
+               if ($this->widget_id == 'plugin_hudson_project_jobtesttrend' && 
forge_check_perm('hudson', $this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] = sprintf(_('%s Test 
Result Trend'), $this->job->getName());
+                       } else {
+                               $this->content['title'] = _('Test Result 
Trend');
+                       }
+               } else {
+                       $this->content['title'] = '';
+                       if ($this->job) {
+                               $this->content['title'] = sprintf(_('%s Test 
Result Trend'), $this->job->getName());
+                       } else {
+                               $this->content['title'] = _('Test Result 
Trend');
+                       }
+               }
        }
 
        function getTitle() {
-               if ($this->job) {
-                       return sprintf(_('%s Test Result Trend'), 
$this->job->getName());
-               } else {
-                       return _('Test Result Trend');
-               }
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -95,4 +108,8 @@ class hudson_Widget_JobTestTrend extends HudsonJobWidget {
                }
                return $html;
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }
diff --git 
a/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php 
b/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
index ea4e667..aea3e3f 100644
--- a/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -32,6 +33,7 @@ class hudson_Widget_ProjectJobsOverview extends 
HudsonOverviewWidget {
        var $_all_status;
        var $_global_status;
        var $_global_status_icon;
+       var $content;
 
        function hudson_Widget_ProjectJobsOverview($plugin) {
                $this->Widget('plugin_hudson_project_jobsoverview');
@@ -49,6 +51,13 @@ class hudson_Widget_ProjectJobsOverview extends 
HudsonOverviewWidget {
                        );
                        $this->computeGlobalStatus();
                }
+               if (forge_check_perm('hudson', $this->group_id, 'read')) {
+                       $this->content['title'] = '';
+                       if ($this->_use_global_status == "true") {
+                               $this->content['title'] = '<img 
src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" 
alt="'.$this->_global_status.'" /> ';
+                       }
+                       $this->content['title'] .= _("Hudson Jobs");
+               }
        }
 
        function computeGlobalStatus() {
@@ -69,12 +78,7 @@ class hudson_Widget_ProjectJobsOverview extends 
HudsonOverviewWidget {
        }
 
        function getTitle() {
-               $title = '';
-               if ($this->_use_global_status == "true") {
-                       $title = '<img src="'.$this->_global_status_icon.'" 
title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
-               }
-               $title .= _("Hudson Jobs");
-               return  $title;
+               return $this->content['title'];
        }
 
        function getDescription() {
@@ -116,4 +120,8 @@ class hudson_Widget_ProjectJobsOverview extends 
HudsonOverviewWidget {
                        return $html;
                }
        }
+
+       function isAvailable() {
+               return isset($this->content['title']);
+       }
 }

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

Summary of changes:
 .../hudson_Widget_JobBuildHistory.class.php        |   30 ++++++++++++----
 .../hudson_Widget_JobLastArtifacts.class.php       |   29 +++++++++++----
 .../include/hudson_Widget_JobLastBuilds.class.php  |   30 ++++++++++++----
 .../include/hudson_Widget_JobTestResults.class.php |   38 ++++++++++++++------
 .../include/hudson_Widget_JobTestTrend.class.php   |   27 +++++++++++---
 .../hudson_Widget_ProjectJobsOverview.class.php    |   20 +++++++----
 6 files changed, 132 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to