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, master has been updated
       via  d5a71125a36031539cfcb99bfdd7520b1c93b233 (commit)
       via  be754f8f51b0c701ca9abd636a31ec52875877f7 (commit)
      from  f9f96d15d79af1d67880e570c6ce7fa7e9f2d82e (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d5a71125a36031539cfcb99bfdd7520b1c93b233

commit d5a71125a36031539cfcb99bfdd7520b1c93b233
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Fri Apr 23 11:38:21 2021 +0200

    remove ProjectManager useless class. Just use group_get_object

diff --git a/src/common/include/ProjectManager.class.php 
b/src/common/include/ProjectManager.class.php
deleted file mode 100644
index fe1a719..0000000
--- a/src/common/include/ProjectManager.class.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
- *
- * 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 Codendi. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * Provide access to projects
- */
-class ProjectManager {
-
-       /**
-       * Hold an instance of the class
-       */
-       private static $_instance;
-
-       /**
-       * A private constructor; prevents direct creation of object
-       */
-       private function __construct() {
-       }
-
-       /**
-       * ProjectManager is a singleton
-       * @return ProjectManager
-       */
-       public static function instance() {
-               if (!isset(self::$_instance)) {
-                       $c = __CLASS__;
-                       self::$_instance = new $c;
-               }
-               return self::$_instance;
-       }
-
-       /**
-       * @param $group_id int The id of the project to look for
-       * @return Project
-       */
-       public function & getProject($group_id) {
-               return  group_get_object($group_id);
-       }
-}
diff --git a/src/common/include/preplugins.php 
b/src/common/include/preplugins.php
index 3236948..7178860 100644
--- a/src/common/include/preplugins.php
+++ b/src/common/include/preplugins.php
@@ -26,5 +26,4 @@ require_once 
$gfcommon.'include/Codendi_HTMLPurifier.class.php';
 require_once $gfcommon.'valid/ValidFactory.class.php';
 
 //Manager from Codendi
-require_once $gfcommon.'include/ProjectManager.class.php';
 require_once $gfcommon.'include/UserManager.class.php';
diff --git a/src/common/widget/WidgetLayoutManager.class.php 
b/src/common/widget/WidgetLayoutManager.class.php
index 856cc6e..4a21447 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -456,8 +456,7 @@ class WidgetLayoutManager {
         * @param       int     $template_id  the id of the project template
         */
        function createDefaultLayoutForProject($group_id, $template_id) {
-               $pm = ProjectManager::instance();
-               $project = $pm->getProject($group_id);
+               $project = group_get_object($group_id);
                $sql = "INSERT INTO owner_layouts(layout_id, is_default, 
owner_id, owner_type)
                        SELECT layout_id, is_default, $1, owner_type
                        FROM owner_layouts
@@ -502,8 +501,7 @@ class WidgetLayoutManager {
         */
        function createLayoutForProjectFromArray($group_id, $layoutDescArr) {
                if (isset($layoutDescArr['rows']) && 
is_array($layoutDescArr['rows'])) {
-                       $pm = ProjectManager::instance();
-                       $project = $pm->getProject($group_id);
+                       $project = group_get_object($group_id);
                        db_query_params('DELETE FROM layouts_contents WHERE 
owner_id = $1 AND owner_type = $2', array($group_id, self::OWNER_TYPE_GROUP));
                        db_query_params('DELETE FROM owner_layouts WHERE 
owner_id = $1 AND owner_type = $2', array($group_id, self::OWNER_TYPE_GROUP));
                        $sql = "INSERT INTO layouts(name, description, scope) 
VALUES ('custom', '', 'P')";
diff --git a/src/common/widget/Widget_MyArtifacts.class.php 
b/src/common/widget/Widget_MyArtifacts.class.php
index a457bbf..a359e1c 100644
--- a/src/common/widget/Widget_MyArtifacts.class.php
+++ b/src/common/widget/Widget_MyArtifacts.class.php
@@ -156,13 +156,12 @@ class Widget_MyArtifacts extends Widget {
                $artifact_types = array();
                $allIds = array();
 
-               $pm = ProjectManager::instance();
                foreach ($list_trackers as $trackers_array) {
                        $atid = $trackers_array->getArtifactType()->getID();
                        $group_id = 
$trackers_array->getArtifactType()->getGroup()->getID();
 
                        //create group
-                       $group = $pm->getProject($group_id);
+                       $group = group_get_object($group_id);
                        if (!$group || !is_object($group) || $group->isError()) 
{
                                exit_no_group();
                        }
diff --git a/src/plugins/admssw/include/admsswPlugin.class.php 
b/src/plugins/admssw/include/admsswPlugin.class.php
index 1637625..7299c63 100644
--- a/src/plugins/admssw/include/admsswPlugin.class.php
+++ b/src/plugins/admssw/include/admsswPlugin.class.php
@@ -5,6 +5,7 @@
  *
  * Copyright 2012-2013, Olivier Berger & Institut Mines-Telecom
  * Copyright 2013, Roland Mas
+ * Copyright 2021, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -269,19 +270,14 @@ projects on /projects URLs with content-negotiation
                $types = array('doap:Project', 'admssw:SoftwareProject');
                rdfutils_setPropToUri($res, 'rdf:type', $types);
 
-               // Handle project tags
-               $tags_list = NULL;
-               if (forge_get_config('use_project_tags')) {
-                       $group = group_get_object($group_id);
-                       $tags_list = $group->getTags();
-               }
                // connect to FusionForge internals
-               $pm = ProjectManager::instance();
-               $project = $pm->getProject($group_id);
-               $tags = array();
-               if($tags_list) {
-                       $tags = split(', ',$tags_list);
+               $project = group_get_object($group_id);
 
+               // Handle project tags
+               $tags = array();
+               if (forge_get_config('use_project_tags')) {
+                       $tags_list = $project->getTags();
+                       $tags = explode(', ',$tags_list);
                        // reuse the same as dcterms:subject until further 
specialization of adms.sw keywords
                        $res->setProp('rad:keyword', $tags);
                }
@@ -437,7 +433,7 @@ projects on /projects URLs with content-negotiation
         */
        public function getProjectListSize() {
                // same as for trove's full list
-               $projects = group_get_public_active_projects_asc();
+               $projects = group_get_public_active_projects_asc();
                return count($projects);
        }
 
@@ -449,9 +445,9 @@ projects on /projects URLs with content-negotiation
         * @param $chunk number of the chunk to be returned in case of paging
         * @param $chunksize size of chunks in case of paging
         */
-    public function getProjectListResourcesGraph($documenturi, 
$detailed=false, $chunk=null, $chunksize=null) {
+       public function getProjectListResourcesGraph($documenturi, 
$detailed=false, $chunk=null, $chunksize=null) {
 
-       // Construct an ARC2_Resource containing the project's RDF (DOAP) 
description
+               // Construct an ARC2_Resource containing the project's RDF 
(DOAP) description
                $ns = $this->admsswNameSpaces();
 
                $conf = array(
diff --git a/src/plugins/doaprdf/include/doaprdfPlugin.class.php 
b/src/plugins/doaprdf/include/doaprdfPlugin.class.php
index c45f5e2..3bfa4b0 100644
--- a/src/plugins/doaprdf/include/doaprdfPlugin.class.php
+++ b/src/plugins/doaprdf/include/doaprdfPlugin.class.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * doaprdfPlugin Class
  *
@@ -25,7 +24,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-require_once 'common/include/ProjectManager.class.php';
 require_once 'common/include/rdfutils.php';
 
 class doaprdfPlugin extends Plugin {
@@ -68,15 +66,13 @@ with content-negotiation (application/rdf+xml).");
        function getProjectResourceIndex($group_id, &$ns, $detailed = false) {
 
                // connect to FusionForge internals
-               $pm = ProjectManager::instance();
-               $project = $pm->getProject($group_id);
+               $project = group_get_object($group_id);
                $projectname = $project->getUnixName();
                $project_shortdesc = $project->getPublicName();
                $project_description = $project->getDescription();
                $tags_list = NULL;
                if (forge_get_config('use_project_tags')) {
-                       $group = group_get_object($group_id);
-                       $tags_list = $group->getTags();
+                       $tags_list = $project->getTags();
                }
 
                $conf = array(
diff --git a/src/plugins/forumml/www/message.php 
b/src/plugins/forumml/www/message.php
index 9b96879..e630e92 100644
--- a/src/plugins/forumml/www/message.php
+++ b/src/plugins/forumml/www/message.php
@@ -21,9 +21,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/*
+/**
  * ForumML Archives Browsing page
- *
  */
 
 require_once 'env.inc.php';
@@ -38,8 +37,6 @@ 
require_once(dirname(__FILE__).'/../include/ForumML_HTMLPurifier.class.php');
 require_once(dirname(__FILE__).'/../include/ForumML_MessageManager.class.php');
 global $feedback;
 
-$pm = ProjectManager::instance();
-$Group = $pm->getProject($group_id);
 $plugin_manager =& PluginManager::instance();
 $p =& $plugin_manager->getPluginByName('forumml');
 if ($p && $plugin_manager->isPluginAvailable($p) && $p->isAllowed()) {
@@ -54,6 +51,7 @@ if ($p && $plugin_manager->isPluginAvailable($p) && 
$p->isAllowed()) {
        } else {
                $group_id = "";
        }
+       $Group = group_get_object($group_id);
 
        $vTopic = new Valid_UInt('topic');
        $vTopic->required();
diff --git a/src/plugins/hudson/include/hudson.class.php 
b/src/plugins/hudson/include/hudson.class.php
index 87d1057..56b6b5c 100644
--- a/src/plugins/hudson/include/hudson.class.php
+++ b/src/plugins/hudson/include/hudson.class.php
@@ -48,8 +48,7 @@ class hudson extends Controler {
                $vgi->required();
                if ($request->valid($vgi)) {
                        $group_id = $request->get('group_id');
-                       $pm = ProjectManager::instance();
-                       $project = $pm->getProject($group_id);
+                       $project = group_get_object($group_id);
                        if ($project->usesService('hudson')) {
                                $user = 
UserManager::instance()->getCurrentUser();
                                if (forge_check_perm('plugin_hudson_read', 
$group_id, 'read')) {
diff --git a/src/plugins/hudson/include/hudsonViews.class.php 
b/src/plugins/hudson/include/hudsonViews.class.php
index cedc26a..744663b 100644
--- a/src/plugins/hudson/include/hudsonViews.class.php
+++ b/src/plugins/hudson/include/hudsonViews.class.php
@@ -3,7 +3,7 @@
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights 
reserved
  * Copyright (c) 2010 Alcatel-Lucent
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2013-2014,2016, Franck Villaume - TrivialDev
+ * Copyright 2013-2014,2016,2021, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -24,8 +24,7 @@
 require_once 'common/mvc/Views.class.php';
 /*require_once('common/include/HTTPRequest.class.php');
   require_once 'common/user/UserManager.class.php';
-  require_once 'common/project/ProjectManager.class.php';*/
-//require_once('common/reference/CrossReferenceFactory.class.php');
+  require_once('common/reference/CrossReferenceFactory.class.php');*/
 
 require_once 'HudsonJob.class.php';
 require_once 'common/dao/CodendiDataAccess.class.php';
@@ -41,12 +40,9 @@ class hudsonViews extends Views {
        function header() {
 
                parent::header();
-//             echo $this->_getHelp();
-//             echo '<h1>'.$this->_getTitle().'</h1>';
        }
 
        function _getTitle() {
-//             return _("Continuous Integration");
                return _("Hudson/Jenkins");
        }
 
@@ -207,8 +203,7 @@ class hudsonViews extends Views {
                $user = UserManager::instance()->getCurrentUser();
                if ($user->isMember($group_id, 'A')) {
 
-                       $project_manager = ProjectManager::instance();
-                       $project = $project_manager->getProject($group_id);
+                       $project = group_get_objet($group_id);
 
                        $job_dao = new 
PluginHudsonJobDao(CodendiDataAccess::instance());
                        $dar = $job_dao->searchByJobID($job_id);
@@ -292,8 +287,7 @@ class hudsonViews extends Views {
 
                if ($dar && $dar->valid()) {
 
-                       $project_manager = ProjectManager::instance();
-                       $project = $project_manager->getProject($group_id);
+                       $project = group_get_objet($group_id);
 
                        echo '<table id="jobs_table">';
                        echo ' <tr class="boxtable">';
@@ -399,8 +393,7 @@ class hudsonViews extends Views {
 
        function _display_add_job_form($group_id) {
                global $HTML;
-               $project_manager = ProjectManager::instance();
-               $project = $project_manager->getProject($group_id);
+               $project = group_get_objet($group_id);
 
                echo '<a href="#" 
onclick="jQuery(\'#hudson_add_job\').slideToggle(); return false;">' . 
$HTML->getNewPic() . ' '._("Add job").'</a>';
                echo ' '.$this->_getHelp('HudsonService', true);
diff --git a/src/plugins/mailman/include/MailmanList.class.php 
b/src/plugins/mailman/include/MailmanList.class.php
index e36a157..acf39c4 100644
--- a/src/plugins/mailman/include/MailmanList.class.php
+++ b/src/plugins/mailman/include/MailmanList.class.php
@@ -27,13 +27,10 @@
  */
 
 /*
-
-   This work is based on Tim Perdue's work on the forum stuff
-
+ * This work is based on Tim Perdue's work on the forum stuff
  */
 
 require_once 'MailmanListDao.class.php';
-require_once 'ProjectManager.class.php';
 require_once 'UserManager.class.php';
 require_once 'common/dao/CodendiDataAccess.class.php';
 require_once 'common/system_event/SystemEventManager.class.php';
@@ -74,8 +71,7 @@ class MailmanList extends FFError {
         * @param       array           The associative array of data.
         */
        function __construct($group_id, $groupListId = false, $dataArray = 
false) {
-               $pm = ProjectManager::instance();
-               $Group = $pm->getProject($group_id);
+               $Group = group_get_object($group_id);
                $this->_mailingDAO = new 
MailmanListDao(CodendiDataAccess::instance());
                parent::__construct();
                if (!$Group || !is_object($Group)) {
diff --git a/src/plugins/mailman/www/admin/deletelist.php 
b/src/plugins/mailman/www/admin/deletelist.php
index 0e5c029..caadf5f 100644
--- a/src/plugins/mailman/www/admin/deletelist.php
+++ b/src/plugins/mailman/www/admin/deletelist.php
@@ -5,7 +5,7 @@
  * Portions Copyright 1999-2001 (c) VA Linux Systems
  * The rest Copyright 2003-2004 (c) Guillaume Smet - Open Wide
  * Portions Copyright 2010 (c) Mélanie Le Bail
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016,2021, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge.
  *
@@ -30,16 +30,16 @@ require_once 'preplugins.php';
 require_once 'plugins_utils.php';
 require_once '../mailman_utils.php';
 
-$request =& HTTPRequest::instance();
-$group_id = $request->get('group_id');
-
 global $HTML, $feedback;
 
+$request =& HTTPRequest::instance();
+$group_id = getIntFromRequest('group_id');
+
 if (!$group_id) {
        exit_no_group();
 }
-$pm = ProjectManager::instance();
-$Group = $pm->getProject($group_id);
+
+$Group = group_get_object($group_id);
 if (!$Group || !is_object($Group) || $Group->isError()) {
        exit_no_group();
 }
diff --git a/src/plugins/mailman/www/admin/index.php 
b/src/plugins/mailman/www/admin/index.php
index 454cdc8..477babe 100644
--- a/src/plugins/mailman/www/admin/index.php
+++ b/src/plugins/mailman/www/admin/index.php
@@ -5,7 +5,7 @@
  * Portions Copyright 1999-2001 (c) VA Linux Systems
  * The rest Copyright 2003-2004 (c) Guillaume Smet - Open Wide
  * Portions Copyright 2010 (c) Mélanie Le Bail
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016, 2021, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge.
  *
@@ -33,10 +33,8 @@ require_once '../mailman_utils.php';
 global $HTML, $feedback;
 
 $request =& HTTPRequest::instance();
-$group_id=$request->get('group_id');
-$group_list_id=$request->get('group_list_id');
-$pm = ProjectManager::instance();
-$Group = $pm->getProject($group_id);
+$group_id      = getIntFromRequest('group_id');
+$group_list_id = getIntFromRequest('group_list_id');
 $post_changes= $request->get('post_changes');
 $add_list=$request->get('add_list');
 $action=$request->get('action');
@@ -46,6 +44,7 @@ $is_public=$request->get('is_public');
 $description=$request->get('description');
 
 if ($group_id) {
+       $Group = group_get_object($group_id);
        if (!$Group || !is_object($Group) || $Group->isError()) {
                exit_no_group();
        }
diff --git a/src/plugins/mailman/www/index.php 
b/src/plugins/mailman/www/index.php
index 17d83be..22de8ea 100644
--- a/src/plugins/mailman/www/index.php
+++ b/src/plugins/mailman/www/index.php
@@ -16,11 +16,9 @@ require_once 'plugins_utils.php';
 require_once 'mailman_utils.php';
 $request =& HTTPRequest::instance();
 
-$group_id = $request->get('group_id');
-$pm = ProjectManager::instance();
-$Group = $pm->getProject($group_id);
+$group_id = getIntFromRequest('group_id');
 if (isset ($group_id)) {
-
+       $Group = group_get_object($group_id);
        if (!$Group || !is_object($Group)) {
                exit_error(_('Error'), 'Could Not Get Group');
        } elseif ($Group->isError()) {
@@ -104,12 +102,8 @@ if (isset ($group_id)) {
                if ($request->get('action') == 'update') {
                        $mlFactory->updateInfos();
                }
-
        }
        mail_footer();
-
 } else {
-
        exit_no_group();
-
 }
diff --git 
a/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
 
b/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
index c27bdc4..5dc0ca7 100644
--- 
a/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
+++ 
b/src/plugins/oslc/include/oslc-zend/application/controllers/CodendiOSLCConnector.php
@@ -32,143 +32,142 @@ require_once 
'common/tracker/Tracker_FormElementFactory.class.php';
 
 class CodendiOSLCConnector extends OSLCConnector {
 
-    /**
-     * Filter parameters provided in the REST GET request to check whether 
mandatory ones are set.
-     *
-     * @param  array $params
-     * @return array
-     */
-    public function filterRequestParams($params) {
-        // Process the args provided by Zend REST
-        if (is_array($params)) {
-            if(!isset($params['project'])) {
-                throw new Exception('Missing project id !');
-            } elseif(!isset($params['tracker'])) {
-                throw new Exception('Missing tracker id resource for project 
'.$params['project'].' !');
-            } else {
-                return $params;
-            }
-        }
-    }
-
-    /**
-     * Checks whether a change request exists inside Codendi trackers.
-     * @param  int  $id change request id.
-     * @return bool
-     */
-    public function checkChangeRequestExists($changerequest_id) {
-        $af = Tracker_ArtifactFactory::instance();
-        $artifact = $af->getArtifactById($changerequest_id);
-        if (!$artifact) {
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    /**
-     * Constructs the model from Codendi DB by fetching the requested 
changeRequests.
-     *
-     * @param array $params contains 'project' + 'tracker'
-     */
-    public function fetchChangeRequests($params) {
-        $artifacts = array();
-
-        // what the DB will be queried on
-        $group_id = null;
-        $tracker_id = null;
-
-        if (isset($params['project'])) {
-            $group_id = $params['project'];
-        }
-        if (isset($params['tracker'])) {
-            $tracker_id = $params['tracker'];
-        }
-        if (isset($params['bug'])) {
-            $changerequest_id = $params['bug'];
-            $af = Tracker_ArtifactFactory::instance();
-            $changeRequest = $af->getArtifactById($changerequest_id);
-            $this->changerequests = new 
ChangeRequestsFusionForgeDb($changeRequest);
-        }
-
-        $project = new Project($group_id);
-        if (!$project->usesService('tracker')) {
-            throw new Exception('Error : Tracker service is not used for this 
project.', 'fetchChangeRequests');
-        }
-
-        $tf = TrackerFactory::instance();
-        if (!$tf) {
-            throw new Exception('Error : Could Not Get TrackerFactory', 
'fetchChangeRequests');
-        }
-
-        $tracker = $tf->getTrackerById($tracker_id);
-
-        if ($tracker == null) {
-            throw new Exception('Error : Could Not Get Tracker', 
'fetchChangeRequests');
-        } else {
-            $af = Tracker_ArtifactFactory::instance();
-            $artifacts = $af->getArtifactsByTrackerId($tracker_id);
-        }
-
-        // instanciate the model from the returned artifacts
-            if(isset($params['fields'])){
-                $this->changerequests = new 
ChangeRequestsCodendiDb($artifacts, $params['fields']);
-            } else {
-                $this->changerequests = new 
ChangeRequestsCodendiDb($artifacts);
-            }
-    }
-
-    public function fetchChangeRequest($changerequest_id, $uri, 
$requested_fields=array()) {
-        $af = Tracker_ArtifactFactory::instance();
-        $artifact = $af->getArtifactById($changerequest_id);
-
-        if(!$artifact){
-            throw new NotFoundException('Error : Change Request not found', 
'fetchChangeRequest' );
-        }
-        $art = array($artifact);
-
-        $changerequest = new ChangeRequestsCodendiDb($art, $requested_fields);
-
-        return $this->prepareChangeRequest($changerequest[$changerequest_id], 
$uri);
-    }
-
-    /**
-     * Updates an existant Codendi ChangeRequest in the tracker DataBase.
-     * @param int $identifier id of the ChangeRequest within Codendi tracker
-     * @param ChangeRequest the change request given as input for the PUT 
request.
-     * @param  array   $props array of the properties that PUT request is 
going to change
-     * @return boolean true if success, false otherwise.
-     */
-    public function updateChangeRequest($changerequest_id, $group_id, 
$tracker_id, $changerequest, $props) {
-        $user = UserManager::instance()->getCurrentUser();
-        $pm = ProjectManager::instance();
-        $project = $pm->getProject($group_id);
-        if (! $project || ! is_object($project)) {
-            throw new Exception('Error : Could Not Get 
Group','updateChangeRequest');
-        } elseif ($project->isError()) {
-            throw new Exception('Error : ' . 
$project->getErrorMessage(),'updateChangeRequest');
-        }
-        if ( ! checkRestrictedAccess($project)) {
-            throw new Exception('Error, Restricted user: permission denied.', 
'updateChangeRequest');
-        }
-
-        $tf = TrackerFactory::instance();
-        $tracker = $tf->getTrackerById($tracker_id);
-
-        if ($tracker == null) {
-            throw new Exception('Error : Could not get Tracker.', 
'updateChangeRequest');
-        } elseif ($tracker->getGroupId() != $group_id) {
-            throw new Exception('Error : Could not get Tracker.', 
'updateChangeRequest');
-        }
-
-        $af = Tracker_ArtifactFactory::instance();
-        if ($artifact = $af->getArtifactById($changerequest_id)) {
-            if ($artifact->getTrackerId() != $tracker_id) {
-                throw new Exception('Error : Could not get Artifact.', 
'updateChangeRequest');
-            }
-        }
-
-        // Get the artifact data using its ID.
+       /**
+        * Filter parameters provided in the REST GET request to check whether 
mandatory ones are set.
+        *
+        * @param  array $params
+        * @return array
+        */
+       public function filterRequestParams($params) {
+               // Process the args provided by Zend REST
+               if (is_array($params)) {
+               if(!isset($params['project'])) {
+                       throw new Exception('Missing project id !');
+               } elseif(!isset($params['tracker'])) {
+                       throw new Exception('Missing tracker id resource for 
project '.$params['project'].' !');
+               } else {
+                       return $params;
+               }
+               }
+       }
+
+       /**
+        * Checks whether a change request exists inside Codendi trackers.
+        * @param  int  $id change request id.
+        * @return bool
+        */
+       public function checkChangeRequestExists($changerequest_id) {
+               $af = Tracker_ArtifactFactory::instance();
+               $artifact = $af->getArtifactById($changerequest_id);
+               if (!$artifact) {
+               return false;
+               } else {
+               return true;
+               }
+       }
+
+       /**
+        * Constructs the model from Codendi DB by fetching the requested 
changeRequests.
+        *
+        * @param array $params contains 'project' + 'tracker'
+        */
+       public function fetchChangeRequests($params) {
+               $artifacts = array();
+
+               // what the DB will be queried on
+               $group_id = null;
+               $tracker_id = null;
+
+               if (isset($params['project'])) {
+               $group_id = $params['project'];
+               }
+               if (isset($params['tracker'])) {
+               $tracker_id = $params['tracker'];
+               }
+               if (isset($params['bug'])) {
+               $changerequest_id = $params['bug'];
+               $af = Tracker_ArtifactFactory::instance();
+               $changeRequest = $af->getArtifactById($changerequest_id);
+               $this->changerequests = new 
ChangeRequestsFusionForgeDb($changeRequest);
+               }
+
+               $project = group_get_object($group_id);
+               if (!$project->usesService('tracker')) {
+                       throw new Exception('Error : Tracker service is not 
used for this project.', 'fetchChangeRequests');
+               }
+
+               $tf = TrackerFactory::instance();
+               if (!$tf) {
+                       throw new Exception('Error : Could Not Get 
TrackerFactory', 'fetchChangeRequests');
+               }
+
+               $tracker = $tf->getTrackerById($tracker_id);
+
+               if ($tracker == null) {
+                       throw new Exception('Error : Could Not Get Tracker', 
'fetchChangeRequests');
+               } else {
+                       $af = Tracker_ArtifactFactory::instance();
+                       $artifacts = $af->getArtifactsByTrackerId($tracker_id);
+               }
+
+               // instanciate the model from the returned artifacts
+               if(isset($params['fields'])){
+                       $this->changerequests = new 
ChangeRequestsCodendiDb($artifacts, $params['fields']);
+               } else {
+                       $this->changerequests = new 
ChangeRequestsCodendiDb($artifacts);
+               }
+       }
+
+       public function fetchChangeRequest($changerequest_id, $uri, 
$requested_fields=array()) {
+               $af = Tracker_ArtifactFactory::instance();
+               $artifact = $af->getArtifactById($changerequest_id);
+
+               if(!$artifact){
+                       throw new NotFoundException('Error : Change Request not 
found', 'fetchChangeRequest' );
+               }
+               $art = array($artifact);
+
+               $changerequest = new ChangeRequestsCodendiDb($art, 
$requested_fields);
+
+               return 
$this->prepareChangeRequest($changerequest[$changerequest_id], $uri);
+       }
+
+       /**
+        * Updates an existant Codendi ChangeRequest in the tracker DataBase.
+        * @param int $identifier id of the ChangeRequest within Codendi tracker
+        * @param ChangeRequest the change request given as input for the PUT 
request.
+        * @param  array   $props array of the properties that PUT request is 
going to change
+        * @return boolean true if success, false otherwise.
+        */
+       public function updateChangeRequest($changerequest_id, $group_id, 
$tracker_id, $changerequest, $props) {
+               $user = UserManager::instance()->getCurrentUser();
+               $project = group_get_object($group_id);
+               if (! $project || ! is_object($project)) {
+                       throw new Exception('Error : Could Not Get 
Group','updateChangeRequest');
+               } elseif ($project->isError()) {
+                       throw new Exception('Error : ' . 
$project->getErrorMessage(),'updateChangeRequest');
+               }
+               if ( ! checkRestrictedAccess($project)) {
+                       throw new Exception('Error, Restricted user: permission 
denied.', 'updateChangeRequest');
+               }
+
+               $tf = TrackerFactory::instance();
+               $tracker = $tf->getTrackerById($tracker_id);
+
+               if ($tracker == null) {
+                       throw new Exception('Error : Could not get Tracker.', 
'updateChangeRequest');
+               } elseif ($tracker->getGroupId() != $group_id) {
+                       throw new Exception('Error : Could not get Tracker.', 
'updateChangeRequest');
+               }
+
+               $af = Tracker_ArtifactFactory::instance();
+               if ($artifact = $af->getArtifactById($changerequest_id)) {
+                       if ($artifact->getTrackerId() != $tracker_id) {
+                               throw new Exception('Error : Could not get 
Artifact.', 'updateChangeRequest');
+                       }
+               }
+
+               // Get the artifact data using its ID.
                $art_obj =& artifact_get_object($identifier);
                $art = $art_obj->data_array;
 
@@ -183,66 +182,46 @@ class CodendiOSLCConnector extends OSLCConnector {
                // Check all the mandatory fields for an artifact update 
request.
 
                // dc:title ===> summary
-               if(in_array('title',$props))
-               {
-                       if(isset($cm_request['title']))
-                       {
+               if(in_array('title',$props)) {
+                       if(isset($cm_request['title'])) {
                                $art['summary'] = $cm_request['title'];         
        // mandatory
-                       }
-                       else
-                       {
+                       } else {
                                throw new BadRequestException("dc:title 
mentioned in the request query not found in request body!");
                        }
                }
 
                // dc:description ===> details
-               if(in_array('description',$props))
-               {
-                       if(isset($cm_request['description']))
-                       {
+               if(in_array('description',$props)) {
+                       if(isset($cm_request['description'])) {
                                $art['details'] = $cm_request['description'];   
                // mandatory
-                       }
-                       else
-                       {
+                       } else {
                                throw new BadRequestException("dc:decription 
mentioned in the request query not found in request body!");
                        }
                }
 
                // helios_bt:priority ===> priority
-               if(in_array('priority',$props))
-               {
-                       if(isset($cm_request['priority']))
-                       {
+               if(in_array('priority',$props)) {
+                       if(isset($cm_request['priority'])) {
                                $art['priority'] = $cm_request['priority'];     
                // mandatory
-                       }
-                       else
-                       {
+                       } else {
                                throw new 
BadRequestException("helios_bt:priority mentioned in the request query not 
found in request body!");
                        }
                }
 
                // helios_bt:status ===> status
-               if(in_array('status',$props))
-               {
-                       if(isset($cm_request['status']))
-                       {
+               if(in_array('status',$props)) {
+                       if(isset($cm_request['status'])) {
                                $art['status_id'] = 
self::$status_arr[$cm_request['status']];                   // mandatory
-                       }
-                       else
-                       {
+                       } else {
                                throw new BadRequestException("helios_bt:status 
mentioned in the request query not found in request body!");
                        }
                }
 
                //helios_bt:assigned_to ====> assigned_to
-               if(in_array('assigned_to', $props))
-               {
-                       if(isset($cm_request['assigned_to']))
-                       {
+               if(in_array('assigned_to', $props)) {
+                       if(isset($cm_request['assigned_to'])) {
                                $art['assigned_to'] = 
$cm_request['assigned_to'];
-                       }
-                       else
-                       {
+                       } else {
                                throw new 
BadRequestException("helios_bt:assigned_to mentionned in the request query not 
found in request body!");
                        }
                }
@@ -256,150 +235,145 @@ class CodendiOSLCConnector extends OSLCConnector {
                //TODO: figure out if a follow up is in OSLC specs and if it is 
the case include it.
                $follow_up_msg = '';
 
-               
if(!$art_obj->update($art['priority'],$art['status_id'],$art['assigned_to'],$art['summary'],$canned_response,$follow_up_msg,$new_artifact_type_id,array(),$art['details']))
-               {
+               
if(!$art_obj->update($art['priority'],$art['status_id'],$art['assigned_to'],$art['summary'],$canned_response,$follow_up_msg,$new_artifact_type_id,array(),$art['details']))
 {
                        throw new Exception($art_obj->getErrorMessage());
                }
        }
 
-    /**
-     * Returns the list of projects of the user.
-     * @todo fix this method.
-     */
-    public function getProjectsList() {
-        $uM = UserManager::instance();
-        $pM = ProjectManager::instance();
-        $user = $uM->getCurrentUser();
-        if($user->getId() != 0) {
-            $project_ids = $user->getProjects();
-        } else {
-            return $this->createProjectsArray($pM->getAllPublicProjects());
-        }
-        foreach($project_ids as $id) {
-            $projects[$id] = $pM->getProject($id);
-        }
-        $uM->logout();
-        return $this->createProjectsArray($projects);
+       /**
+        * Returns the list of projects of the user.
+        * @todo fix this method.
+        */
+       public function getProjectsList() {
+               $user = session_get_user();
+               if($user->getId() != 0) {
+                       $project_ids = $user->getProjects();
+               } else {
+                       return 
$this->createProjectsArray(group_get_public_active_projects_asc());
+               }
+               foreach($project_ids as $id) {
+                       $projects[$id] = group_get_object($id);
+               }
+               return $this->createProjectsArray($projects);
+               }
+
+       /**
+        *  Converts projects objects into a single projects array.
+        *  We only set the id and the public name of each project
+        *  into the array.
+        *  @param array $projects array of projects indexed by their relative 
ids
+        */
+       private function createProjectsArray($projects) {
+               $return = array();
+               foreach($projects as $prj_idx => $project){
+                       $return[$prj_idx] = array(
+                               'id'                => $prj_idx,
+                               'name'              => $project->getPublicName()
+                       );
+               }
+               return $return;
        }
 
-    /**
-     *  Converts projects objects into a single projects array.
-     *  We only set the id and the public name of each project
-     *  into the array.
-     *  @param array $projects array of projects indexed by their relative ids
-     */
-    private function createProjectsArray($projects) {
-        $return = array();
-        foreach($projects as $prj_idx => $project){
-            $return[$prj_idx] = array(
-                'id'                => $prj_idx,
-                'name'              => $project->getPublicName()
-            );
-        }
-        return $return;
-    }
+       /**
+       * updateArtifact - update the artifact $artifact_id in tracker 
$tracker_id of the project $group_id with given values
+       *
+       * @param string $sessionKey  the session hash associated with the 
session opened by the person who calls the service
+       * @param int    $group_id    the ID of the group we want to update the 
artifact
+       * @param int    $tracker_id  the ID of the tracker we want to update 
the artifact
+       * @param int    $artifact_id the ID of the artifact to update
+       * @param array{SOAPArtifactFieldValue} $value the fields value to update
+       * @param string $comment     the comment associated with the 
modification, or null if no follow-up comment.
+       *
+       * @return int The artifact id if update was fine,
+       *              or a soap fault if :
+       *              - group_id does not match with a valid project,
+       *              - tracker_id does not match with a valid tracker,
+       *              - artifact_id does not match with a valid artifact,
+       *              - the given values are breaking a field dependency rule
+       *              - the artifact modification failed.
+       */
+       function updateArtifact($sessionKey, $group_id, $tracker_id, 
$artifact_id, $value, $comment) {
+               if (session_continue($sessionKey)) {
+                       $user = session_get_user();
+                       $project = group_get_object($group_id);
+                       if (! $project || ! is_object($project)) {
+                               return new SoapFault(get_group_fault,'Could Not 
Get Group','updateArtifact');
+                       } elseif ($project->isError()) {
+                               return new SoapFault(get_group_fault, 
$project->getErrorMessage(),'updateArtifact');
+                       }
+                       if ( ! checkRestrictedAccess($project)) {
+                               return new SoapFault(get_group_fault, 
'Restricted user: permission denied.', 'updateArtifact');
+                       }
 
-/**
- * updateArtifact - update the artifact $artifact_id in tracker $tracker_id of 
the project $group_id with given values
- *
- * @param string $sessionKey  the session hash associated with the session 
opened by the person who calls the service
- * @param int    $group_id    the ID of the group we want to update the 
artifact
- * @param int    $tracker_id  the ID of the tracker we want to update the 
artifact
- * @param int    $artifact_id the ID of the artifact to update
- * @param array{SOAPArtifactFieldValue} $value the fields value to update
- * @param string $comment     the comment associated with the modification, or 
null if no follow-up comment.
- *
- * @return int The artifact id if update was fine,
- *              or a soap fault if :
- *              - group_id does not match with a valid project,
- *              - tracker_id does not match with a valid tracker,
- *              - artifact_id does not match with a valid artifact,
- *              - the given values are breaking a field dependency rule
- *              - the artifact modification failed.
- */
-function updateArtifact($sessionKey, $group_id, $tracker_id, $artifact_id, 
$value, $comment) {
-    if (session_continue($sessionKey)) {
-        $user = UserManager::instance()->getCurrentUser();
-        $pm = ProjectManager::instance();
-        $project = $pm->getProject($group_id);
-        if (! $project || ! is_object($project)) {
-            return new SoapFault(get_group_fault,'Could Not Get 
Group','updateArtifact');
-        } elseif ($project->isError()) {
-            return new SoapFault(get_group_fault, 
$project->getErrorMessage(),'updateArtifact');
-        }
-        if ( ! checkRestrictedAccess($project)) {
-            return new SoapFault(get_group_fault, 'Restricted user: permission 
denied.', 'updateArtifact');
-        }
-
-        $tf = TrackerFactory::instance();
-        $tracker = $tf->getTrackerById($tracker_id);
-        if ($tracker == null) {
-            return new SoapFault(get_tracker_fault, 'Could not get Tracker.', 
'updateArtifact');
-        } elseif ($tracker->getGroupId() != $group_id) {
-            return new SoapFault(get_tracker_fault, 'Could not get Tracker.', 
'updateArtifact');
-        }
-
-        $af = Tracker_ArtifactFactory::instance();
-        if ($artifact = $af->getArtifactById($artifact_id)) {
-            if ($artifact->getTrackerId() != $tracker_id) {
-                return new SoapFault(get_tracker_fault, 'Could not get 
Artifact.', 'updateArtifact');
-            }
-
-            //Check Field Dependencies
-            // TODO : implement it
-            /*require_once('common/tracker/ArtifactRulesManager.class.php');
-            $arm =& new ArtifactRulesManager();
-            if (!$arm->validate($ath->getID(), $data, $art_field_fact)) {
-                return new SoapFault(invalid_field_dependency_fault, 'Invalid 
Field Dependency', 'updateArtifact');
-            }*/
-
-            $fef = Tracker_FormElementFactory::instance();
-
-            $fields_data = array();
-            foreach ($value as $field_value) {
-                // field are identified by name, we need to retrieve the field 
id
-                if ($field_value->field_name) {
-
-                    $field = $fef->getUsedFieldByName($tracker_id, 
$field_value->field_name);
-                    if ($field) {
-
-                        $field_data = 
$field->getFieldData($field_value->field_value);
-                        if ($field_data != null) {
-                            // $field_value is an object: SOAP must cast it in 
ArtifactFieldValue
-                            if (isset($fields_data[$field->getId()])) {
-                                if ( ! is_array($fields_data[$field->getId()]) 
) {
-                                    $fields_data[$field->getId()] = 
array($fields_data[$field->getId()]);
-                                }
-                                $fields_data[$field->getId()][] = $field_data;
-                            } else {
-                                $fields_data[$field->getId()] = $field_data;
-                            }
-                        } else {
-                            return new SoapFault(update_artifact_fault, 
'Unknown value ' . $field_value->field_value . ' for field: 
'.$field_value->field_name ,'addArtifact');
-                        }
-                    } else {
-                        return new SoapFault(update_artifact_fault, 'Unknown 
field: '.$field_value->field_name ,'addArtifact');
-                    }
-                }
-            }
-
-            if ($artifact->createNewChangeset($fields_data, $comment, $user, 
null)) {
-                return $artifact_id;
-            } else {
-                $response = new Response();
-                if ($response->feedbackHasErrors()) {
-                    return new SoapFault(update_artifact_fault, 
$response->getRawFeedback(),'updateArtifact');
-                } else {
-                    return new SoapFault(update_artifact_fault, 'Unknown 
error','updateArtifact');
-                }
-            }
-        } else {
-            return new SoapFault(get_tracker_fault, 'Could not get Artifact.', 
'updateArtifact');
-        }
-
-    } else {
-        return new SoapFault(invalid_session_fault,'Invalid Session 
','updateArtifact');
-    }
-}
+                       $tf = TrackerFactory::instance();
+                       $tracker = $tf->getTrackerById($tracker_id);
+                       if ($tracker == null) {
+                               return new SoapFault(get_tracker_fault, 'Could 
not get Tracker.', 'updateArtifact');
+                       } elseif ($tracker->getGroupId() != $group_id) {
+                               return new SoapFault(get_tracker_fault, 'Could 
not get Tracker.', 'updateArtifact');
+                       }
+
+                       $af = Tracker_ArtifactFactory::instance();
+                       if ($artifact = $af->getArtifactById($artifact_id)) {
+                       if ($artifact->getTrackerId() != $tracker_id) {
+                               return new SoapFault(get_tracker_fault, 'Could 
not get Artifact.', 'updateArtifact');
+                       }
+
+                       //Check Field Dependencies
+                       // TODO : implement it
+                       
/*require_once('common/tracker/ArtifactRulesManager.class.php');
+                       $arm =& new ArtifactRulesManager();
+                       if (!$arm->validate($ath->getID(), $data, 
$art_field_fact)) {
+                               return new 
SoapFault(invalid_field_dependency_fault, 'Invalid Field Dependency', 
'updateArtifact');
+                       }*/
+
+                       $fef = Tracker_FormElementFactory::instance();
+
+                       $fields_data = array();
+                       foreach ($value as $field_value) {
+                               // field are identified by name, we need to 
retrieve the field id
+                               if ($field_value->field_name) {
+
+                                       $field = 
$fef->getUsedFieldByName($tracker_id, $field_value->field_name);
+                                       if ($field) {
+
+                                               $field_data = 
$field->getFieldData($field_value->field_value);
+                                               if ($field_data != null) {
+                                                       // $field_value is an 
object: SOAP must cast it in ArtifactFieldValue
+                                                       if 
(isset($fields_data[$field->getId()])) {
+                                                               if ( ! 
is_array($fields_data[$field->getId()]) ) {
+                                                                       
$fields_data[$field->getId()] = array($fields_data[$field->getId()]);
+                                                               }
+                                                               
$fields_data[$field->getId()][] = $field_data;
+                                                       } else {
+                                                               
$fields_data[$field->getId()] = $field_data;
+                                                       }
+                                               } else {
+                                                       return new 
SoapFault(update_artifact_fault, 'Unknown value ' . $field_value->field_value . 
' for field: '.$field_value->field_name ,'addArtifact');
+                                               }
+                                       } else {
+                                               return new 
SoapFault(update_artifact_fault, 'Unknown field: '.$field_value->field_name 
,'addArtifact');
+                                       }
+                               }
+                       }
+
+                       if ($artifact->createNewChangeset($fields_data, 
$comment, $user, null)) {
+                               return $artifact_id;
+                       } else {
+                               $response = new Response();
+                               if ($response->feedbackHasErrors()) {
+                                       return new 
SoapFault(update_artifact_fault, $response->getRawFeedback(),'updateArtifact');
+                               } else {
+                                       return new 
SoapFault(update_artifact_fault, 'Unknown error','updateArtifact');
+                               }
+                       }
+                       } else {
+                       return new SoapFault(get_tracker_fault, 'Could not get 
Artifact.', 'updateArtifact');
+                       }
+
+               } else {
+                       return new SoapFault(invalid_session_fault,'Invalid 
Session ','updateArtifact');
+               }
+       }
 
 }
diff --git a/src/www/widgets/updatelayout.php b/src/www/widgets/updatelayout.php
index 0473b49..51ac660 100644
--- a/src/www/widgets/updatelayout.php
+++ b/src/www/widgets/updatelayout.php
@@ -44,8 +44,7 @@ if ($owner) {
                        }
                        break;
                case WidgetLayoutManager::OWNER_TYPE_GROUP:
-                       $pm = ProjectManager::instance();
-                       if ($project = $pm->getProject($owner_id)) {
+                       if ($project = group_get_object($owner_id)) {
                                $group_id = $owner_id;
                                $_REQUEST['group_id'] = $_GET['group_id'] = 
$group_id;
                                $redirect = '/projects/'. 
$project->getUnixName().'/';
diff --git a/src/www/widgets/widget.php b/src/www/widgets/widget.php
index be053ce..0c74e71 100644
--- a/src/www/widgets/widget.php
+++ b/src/www/widgets/widget.php
@@ -41,8 +41,7 @@ switch($owner_type) {
                }
                break;
        case WidgetLayoutManager::OWNER_TYPE_GROUP:
-               $pm = ProjectManager::instance();
-               if ($project = $pm->getProject($owner_id)) {
+               if ($project = group_get_object($owner_id)) {
                        $group_id = $owner_id;
                        $_REQUEST['group_id'] = $_GET['group_id'] = $group_id; 
// why ?
                        $redirect = '/projects/'. $project->getUnixName();
diff --git a/src/www/widgets/widgets.php b/src/www/widgets/widgets.php
index 3904be1..52877c8 100644
--- a/src/www/widgets/widgets.php
+++ b/src/www/widgets/widgets.php
@@ -46,8 +46,7 @@ if (session_loggedin()) {
                        }
                        break;
                case WidgetLayoutManager::OWNER_TYPE_GROUP:
-                       $pm = ProjectManager::instance();
-                       if ($project = $pm->getProject($owner_id)) {
+                       if ($project = group_get_object($owner_id)) {
                                $group_id = $owner_id;
                                $_REQUEST['group_id'] = $_GET['group_id'] = 
$group_id;
                                if (forge_check_perm('project_admin', 
$group_id) || forge_check_global_perm('forge_admin')) {

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=be754f8f51b0c701ca9abd636a31ec52875877f7

commit be754f8f51b0c701ca9abd636a31ec52875877f7
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Fri Apr 23 09:35:52 2021 +0200

    do not use request object

diff --git a/src/common/widget/Widget_ProjectDocumentsActivity.class.php 
b/src/common/widget/Widget_ProjectDocumentsActivity.class.php
index c067308..5923ae0 100644
--- a/src/common/widget/Widget_ProjectDocumentsActivity.class.php
+++ b/src/common/widget/Widget_ProjectDocumentsActivity.class.php
@@ -55,7 +55,7 @@ class Widget_ProjectDocumentsActivity extends Widget {
                $cancel = getStringFromRequest('cancel');
                if (strlent($cancel) > 0) {
                        $show = getStringFromRequest('show');
-                       switch($request->get('show')) {
+                       switch($show) {
                                case 'F':
                                        $this->_statistic_show = 'F';
                                        break;
diff --git a/src/common/widget/Widget_Rss.class.php 
b/src/common/widget/Widget_Rss.class.php
index 72822c0..ee91a30 100644
--- a/src/common/widget/Widget_Rss.class.php
+++ b/src/common/widget/Widget_Rss.class.php
@@ -188,7 +188,7 @@ require_once 'Widget.class.php';
                        $title =  $rss['title'] ;
                        if ($url || $title) {
                                $sql = "UPDATE widget_rss SET title=$1 , url=$2 
 WHERE owner_id =$3 AND owner_type = $4 AND id = $5";
-                               db_query_params($sql, array($title, $url, 
$this->owner_id, $this->owner_type, (int)$request->get('content_id')));
+                               db_query_params($sql, array($title, $url, 
$this->owner_id, $this->owner_type, getIntFromRequest('content_id')));
                                $done = true;
                        }
                }
diff --git a/src/common/widget/Widget_TrackerContent.class.php 
b/src/common/widget/Widget_TrackerContent.class.php
index 9f76efe..d5bc17a 100644
--- a/src/common/widget/Widget_TrackerContent.class.php
+++ b/src/common/widget/Widget_TrackerContent.class.php
@@ -72,7 +72,7 @@ class Widget_TrackerContent extends Widget {
        function create() {
                $sanitizer = new TextSanitizer();
                $hp = Codendi_HTMLPurifier::instance();
-               $this->trackercontent_title = 
$hp->purify($request->get('title'), CODENDI_PURIFIER_CONVERT_HTML);
+               $this->trackercontent_title = 
$hp->purify(getStringFromRequest('title'), CODENDI_PURIFIER_CONVERT_HTML);
                $trackerrows = getArrayFromRequest('trackercontent_layout');
                $trackerextrafields = getArrayFromRequest('trackercontent_ef');
                $trackercelltitles = 
getArrayFromRequest('trackercontent_title');
diff --git a/src/www/include/project_home.php b/src/www/include/project_home.php
index fcd335b..05e36b1 100644
--- a/src/www/include/project_home.php
+++ b/src/www/include/project_home.php
@@ -28,16 +28,11 @@ require_once $gfwww.'news/news_utils.php';
 require_once $gfwww.'include/trove.php';
 require_once $gfwww.'include/project_summary.php';
 require_once $gfcommon.'include/tag_cloud.php';
-require_once $gfcommon.'include/HTTPRequest.class.php';
 require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
 
 session_require_perm ('project_read', $group_id) ;
 
 $title = _('Project Home');
-
-$request =& HTTPRequest::instance();
-$request->set('group_id', $group_id);
-
 $params['submenu'] = '';
 
 if (session_loggedin()) {
@@ -75,8 +70,7 @@ if (session_loggedin()) {
 }
 
 html_use_jqueryui();
-site_project_header(array('title'=>$title, 'h1' => '', 'group'=>$group_id, 
'toptab' => 'home',
-       'submenu' => $params['submenu']));
+site_project_header(array('title' => $title, 'h1' => '', 'group' => $group_id, 
'toptab' => 'home', 'submenu' => $params['submenu']));
 
 $params = array('group_id' => $group_id);
 plugin_hook('project_before_widgets', $params);

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

Summary of changes:
 src/common/include/ProjectManager.class.php        |  56 --
 src/common/include/preplugins.php                  |   1 -
 src/common/widget/WidgetLayoutManager.class.php    |   6 +-
 src/common/widget/Widget_MyArtifacts.class.php     |   3 +-
 .../Widget_ProjectDocumentsActivity.class.php      |   2 +-
 src/common/widget/Widget_Rss.class.php             |   2 +-
 src/common/widget/Widget_TrackerContent.class.php  |   2 +-
 src/plugins/admssw/include/admsswPlugin.class.php  |  24 +-
 .../doaprdf/include/doaprdfPlugin.class.php        |   8 +-
 src/plugins/forumml/www/message.php                |   6 +-
 src/plugins/hudson/include/hudson.class.php        |   3 +-
 src/plugins/hudson/include/hudsonViews.class.php   |  17 +-
 src/plugins/mailman/include/MailmanList.class.php  |   8 +-
 src/plugins/mailman/www/admin/deletelist.php       |  12 +-
 src/plugins/mailman/www/admin/index.php            |   9 +-
 src/plugins/mailman/www/index.php                  |  10 +-
 .../controllers/CodendiOSLCConnector.php           | 594 ++++++++++-----------
 src/www/include/project_home.php                   |   8 +-
 src/www/widgets/updatelayout.php                   |   3 +-
 src/www/widgets/widget.php                         |   3 +-
 src/www/widgets/widgets.php                        |   3 +-
 21 files changed, 328 insertions(+), 452 deletions(-)
 delete mode 100644 src/common/include/ProjectManager.class.php


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to