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 422155cf7fe4f9768fe813dd228883b88270195b (commit)
via cf166d5c98d69358a105c3fedbd69a484fd161e1 (commit)
via c61e1eae6227abae2c9ab9ac66067781a0f3ee22 (commit)
from fd0fbb458d1d26bb9dc238db9ee143ddde29b2a0 (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=422155cf7fe4f9768fe813dd228883b88270195b
commit 422155cf7fe4f9768fe813dd228883b88270195b
Author: Franck Villaume <[email protected]>
Date: Sat Dec 31 11:29:34 2016 +0100
plugin projects-hierarchy: support listing of child trackers, forums &
packages in respective index page.
diff --git a/src/common/frs/views/listpackages.php
b/src/common/frs/views/listpackages.php
index 488bfac..ca0690f 100644
--- a/src/common/frs/views/listpackages.php
+++ b/src/common/frs/views/listpackages.php
@@ -5,7 +5,7 @@
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2002-2004 (c) GForge Team
* Copyright 2010 (c) FusionForge Team
- * Copyright 2013-2014, Franck Villaume - TrivialDev
+ * Copyright 2013-2014,2016, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -32,20 +32,41 @@ global $g; // group object
global $fpFactory; // frs package factory package
$FRSPackages = $fpFactory->getFRSs(true);
+if (count($FRSPackages) < 1) {
+ $localInformation = _('There are no file packages defined for this
project.');
+}
+
+$child_has_p = false;
+if ($g->usesPlugin('projects-hierarchy')) {
+ $projectsHierarchy = plugin_get_object('projects-hierarchy');
+ $projectIDsArray = $projectsHierarchy->getFamily($group_id, 'child',
true, 'validated');
+ foreach ($projectIDsArray as $projectid) {
+ $childGroupObject = group_get_object($projectid);
+ if ($childGroupObject && is_object($childGroupObject) &&
!$childGroupObject->isError()) {
+ if ($childGroupObject->usesFRS() &&
$projectsHierarchy->getFRSStatus($childGroupObject->getID())) {
+ $childfpf = new
FRSPackageFactory($childGroupObject);
+ $child_frsp = $childfpf->getFRSs(true);
+ if (count($child_frsp) > 0) {
+ $FRSPackages =
array_merge($FRSPackages, $child_frsp);
+ $child_has_p = true;
+ }
+ }
+ }
+ unset($childGroupObject);
+ }
+}
if (count($FRSPackages) < 1) {
echo $HTML->information(_('There are no file packages defined for this
project.'));
} else {
- echo html_ao('script', array('type' => 'text/javascript'));
- ?>
- //<![CDATA[
+ $javascript = <<<'EOS'
var controllerFRS;
jQuery(document).ready(function() {
controllerFRS = new FRSController();
});
- //]]>
- <?php
- echo html_ac(html_ap() - 1);
+EOS;
+ echo html_e('script', array( 'type'=>'text/javascript'),
'//<![CDATA['."\n".'jQuery(function(){'.$javascript.'});'."\n".'//]]>');
+
echo html_ao('div', array('id' => 'forge-frs', 'class' =>
'underline-link'));
$content = _('Below is a list of all files of the project.').' ';
@@ -66,8 +87,13 @@ if (count($FRSPackages) < 1) {
$proj_stats['size'] = 0;
// Iterate and show the packages
+ $current_groupid = $group_id;
foreach ($FRSPackages as $FRSPackage) {
+ if ($FRSPackage->Group->getID() != $current_groupid) {
+ echo html_e('h2', array(), sprintf(_('Child Project %s
Packages'), util_make_link('/frs/?group_id='.$FRSPackage->Group->getID(),
$FRSPackage->Group->getPublicName())));
+ $current_groupid = $FRSPackage->Group->getID();
+ }
$package_id = $FRSPackage->getID();
$package_name = $FRSPackage->getName();
$url =
'/frs/?group_id='.$FRSPackage->Group->getID().'&package_id='.$package_id.'&action=monitor';
diff --git a/src/common/tracker/actions/ind.php
b/src/common/tracker/actions/ind.php
index fac2bab..c26dd0e 100644
--- a/src/common/tracker/actions/ind.php
+++ b/src/common/tracker/actions/ind.php
@@ -4,7 +4,7 @@
*
* Copyright 2010-2011, Franck Villaume - Capgemini
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012,2014, Franck Villaume - TrivialDev
+ * Copyright 2012,2014,2016, Franck Villaume - TrivialDev
* http://fusionforge.org/
*
* This file is part of FusionForge. FusionForge is free software;
@@ -37,23 +37,52 @@ if ($at_arr === false) {
}
html_use_tablesorter();
-
$atf->header();
if (!$at_arr || count($at_arr) < 1) {
- echo $HTML->information(_('No trackers have been set up, or you cannot
view them.'));
- echo '<p>';
- echo sprintf(_('The Admin for this project will have to set up data
types using the %1$s admin page %2$s'), '<a href="'.util_make_url
('/tracker/admin/?group_id='.$group_id).'">', '</a>');
- echo "</p>";
+ $localInformation = $HTML->information(_('No trackers have been set up,
or you cannot view them.'));
+ $localInformation .= html_e('p', array(), sprintf(_('The Admin for this
project will have to set up data types using the %1$s admin page %2$s'), '<a
href="'.util_make_url ('/tracker/admin/?group_id='.$group_id).'">', '</a>'));
+ $at_arr = array();
+}
+$child_has_at = false;
+if ($group->usesPlugin('projects-hierarchy')) {
+ $projectsHierarchy = plugin_get_object('projects-hierarchy');
+ $projectIDsArray = $projectsHierarchy->getFamily($group->getID(),
'child', true, 'validated');
+ foreach ($projectIDsArray as $projectid) {
+ $childGroupObject = group_get_object($projectid);
+ if ($childGroupObject && is_object($childGroupObject) &&
!$childGroupObject->isError()) {
+ if ($childGroupObject->usesTracker() &&
$projectsHierarchy->getTrackerStatus($childGroupObject->getID())) {
+ $childatf = new
ArtifactTypeFactoryHtml($childGroupObject);
+ $child_at_arr = $childatf->getArtifactTypes();
+ if (is_array($child_at_arr) &&
count($child_at_arr) > 0) {
+ $at_arr = array_merge($at_arr,
$child_at_arr);
+ $child_has_at = true;
+ }
+ }
+ }
+ unset($childGroupObject);
+ }
+}
+
+if (count($at_arr) < 1) {
+ echo $localInformation;
} else {
plugin_hook ("blocks", "tracker index");
- echo '<p>'._('Choose a tracker and you can browse/edit/add items to
it.').'</p>';
+ echo html_e('p', array(), _('Choose a tracker and you can
browse/edit/add items to it.'));
/*
Put the result set (list of trackers for this group) into a
column with folders
*/
$tablearr = array(_('Tracker'),_('Description'),_('Open'),_('Total'));
- echo $HTML->listTableTop($tablearr, false, 'full sortable
sortable_table_tracker', 'sortable_table_tracker');
+ $thclass = array(array(), array(), array(), array('class' =>
'align-center'), array('class' => 'align-center'));
+ if ($child_has_at) {
+ $tablearr = array(_('Project'),
_('Tracker'),_('Description'),_('Open'),_('Total'));
+ $thclass = array(array(), array(), array(), array('class' =>
'align-center'), array('class' => 'align-center'));
+ }
+ if (isset($localInformation)) {
+ echo $localInformation;
+ }
+ echo $HTML->listTableTop($tablearr, false, 'full sortable
sortable_table_tracker', 'sortable_table_tracker', array(), array(), $thclass);
for ($j = 0; $j < count($at_arr); $j++) {
if (!is_object($at_arr[$j])) {
//just skip it
@@ -61,8 +90,14 @@ if (!$at_arr || count($at_arr) < 1) {
echo $at_arr[$j]->getErrorMessage();
} else {
$cells = array();
- $cells[][] =
util_make_link('/tracker/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id.'&func=browse',
-
html_image("ic/tracker20w.png", 20, 20).' '.$at_arr[$j]->getName());
+ if ($child_has_at) {
+ if ($at_arr[$j]->Group->getID() !=
$group->getID()) {
+ $cells[] = array(sprintf(_('Child
project %s Tracker'),
util_make_link('/tracker/?group='.$at_arr[$j]->Group->getID(),
$at_arr[$j]->Group->getPublicName())), 'content' =>
$at_arr[$j]->Group->getID());
+ } else {
+ $cells[] = array('', 'content' =>
$at_arr[$j]->Group->getID());
+ }
+ }
+ $cells[][] =
util_make_link('/tracker/?atid='.$at_arr[$j]->getID().'&group_id='.$at_arr[$j]->Group->getID().'&func=browse',
$HTML->getFollowPic().' '.$at_arr[$j]->getName());
$cells[][] = $at_arr[$j]->getDescription();
$cells[] = array((int) $at_arr[$j]->getOpenCount(),
'class' => 'align-center');
$cells[] = array((int) $at_arr[$j]->getTotalCount(),
'class' => 'align-center');
diff --git a/src/plugins/projects-hierarchy/actions/updateGlobalConf.php
b/src/plugins/projects-hierarchy/actions/updateGlobalConf.php
index 80f6243..98b80cb 100644
--- a/src/plugins/projects-hierarchy/actions/updateGlobalConf.php
+++ b/src/plugins/projects-hierarchy/actions/updateGlobalConf.php
@@ -3,7 +3,7 @@
* Projects Hierarchy plugin
*
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2016, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -25,8 +25,11 @@
global $projectsHierarchy; // the projects-hierarchy plugin object
$confArr = array();
-$confArr['tree'] = getIntFromRequest('tree');
$confArr['docman'] = getIntFromRequest('docman');
+$confArr['forum'] = getIntFromRequest('forum');
+$confArr['frs'] = getIntFromRequest('frs');
+$confArr['tracker'] = getIntFromRequest('tracker');
+$confArr['tree'] = getIntFromRequest('tree');
if (!$projectsHierarchy->updateGlobalConf($confArr)) {
$error_msg = _('Failed to update global configuration.');
diff --git a/src/plugins/projects-hierarchy/actions/updateProjectConf.php
b/src/plugins/projects-hierarchy/actions/updateProjectConf.php
index 7f8afd7..c438e2a 100644
--- a/src/plugins/projects-hierarchy/actions/updateProjectConf.php
+++ b/src/plugins/projects-hierarchy/actions/updateProjectConf.php
@@ -2,7 +2,7 @@
/**
* Projects Hierarchy plugin
*
- * Copyright 2011, Franck Villaume - Capgemini
+ * Copyright 2011,2016, Franck Villaume - Capgemini
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -25,9 +25,12 @@ global $projectsHierarchy; // the projects-hierarchy plugin
object
global $group_id;
$confArr = array();
-$confArr['tree'] = getIntFromRequest('tree');
$confArr['docman'] = getIntFromRequest('docman');
+$confArr['forum'] = getIntFromRequest('forum');
+$confArr['frs'] = getIntFromRequest('frs');
$confArr['globalconf'] = getIntFromRequest('globalconf');
+$confArr['tracker'] = getIntFromRequest('tracker');
+$confArr['tree'] = getIntFromRequest('tree');
if (!$projectsHierarchy->updateConf($group_id, $confArr)) {
$error_msg = _('Failed to update configuration.');
diff --git
a/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php
b/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php
index e11cc32..1d8f18c 100644
--- a/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php
+++ b/src/plugins/projects-hierarchy/common/projects-hierarchyPlugin.class.php
@@ -322,6 +322,117 @@ EOS;
}
/**
+ * getForumStatus - returns the forum status for this project
+ *
+ * @param integer group_id
+ * @return boolean true/false
+ * @access public
+ */
+ function getForumStatus($group_id) {
+ $res = db_query_params('SELECT forum FROM
plugin_projects_hierarchy WHERE project_id = $1 limit 1',
+ array($group_id));
+ if (!$res) {
+ return false;
+ }
+ $resArr = db_fetch_array($res);
+ if ($resArr['forum'] == 't') {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * setForumStatus - allow parent to list your forums and allow yourself
to select your childs to be browsed.
+ *
+ * @param integer your groud_id
+ * @param boolean the status to set
+ * @return boolean success or not
+ */
+ function setForumStatus($group_id, $status = 0) {
+ $res = db_query_params('UPDATE plugin_projects_hierarchy set
forum = $1 WHERE project_id = $2',
+ array($status, $group_id));
+
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * getTrackerStatus - returns the tracker status for this project
+ *
+ * @param integer group_id
+ * @return boolean true/false
+ * @access public
+ */
+ function getTrackerStatus($group_id) {
+ $res = db_query_params('SELECT tracker FROM
plugin_projects_hierarchy WHERE project_id = $1 limit 1',
+ array($group_id));
+ if (!$res) {
+ return false;
+ }
+ $resArr = db_fetch_array($res);
+ if ($resArr['tracker'] == 't') {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * setTrackerStatus - allow parent to list your trackers and allow
yourself to select your childs to be browsed.
+ *
+ * @param integer your groud_id
+ * @param boolean the status to set
+ * @return boolean success or not
+ */
+ function setTrackerStatus($group_id, $status = 0) {
+ $res = db_query_params('UPDATE plugin_projects_hierarchy set
tracker = $1 WHERE project_id = $2',
+ array($status, $group_id));
+
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * getFRSStatus - returns the FRS status for this project
+ *
+ * @param integer group_id
+ * @return boolean true/false
+ * @access public
+ */
+ function getFRSStatus($group_id) {
+ $res = db_query_params('SELECT frs FROM
plugin_projects_hierarchy WHERE project_id = $1 limit 1',
+ array($group_id));
+ if (!$res) {
+ return false;
+ }
+ $resArr = db_fetch_array($res);
+ if ($resArr['frs'] == 't') {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * setFRSStatus - allow parent to list your FRS packages & releases and
allow yourself to select your childs to be browsed.
+ *
+ * @param integer your groud_id
+ * @param boolean the status to set
+ * @return boolean success or not
+ */
+ function setFRSStatus($group_id, $status = 0) {
+ $res = db_query_params('UPDATE plugin_projects_hierarchy set
frs = $1 WHERE project_id = $2',
+ array($status, $group_id));
+
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
* redirect - encapsulate session_redirect to handle correctly the
redirection URL
*
* @param string usually http_referer from $_SERVER
@@ -380,7 +491,8 @@ EOS;
function add($group_id) {
if (!$this->exists($group_id)) {
$globalConf = $this->getGlobalconf();
- $res = db_query_params('INSERT INTO
plugin_projects_hierarchy (project_id, tree, docman) VALUES ($1, $2, $3)',
array($group_id, (int)$globalConf['tree'], (int)$globalConf['docman']));
+ $res = db_query_params('INSERT INTO
plugin_projects_hierarchy (project_id, tree, docman, forum, frs, tracker)
VALUES ($1, $2, $3, $4, $5, $6)',
+ array($group_id,
(int)$globalConf['tree'], (int)$globalConf['docman'],
(int)$globalConf['forum'], (int)$globalConf['frs'],
(int)$globalConf['tracker']));
if (!$res) {
return false;
}
@@ -734,19 +846,16 @@ EOS;
* @return bool true on success
*/
function updateGlobalConf($confArr) {
- if (!isset($confArr['tree']) || !isset($confArr['docman'])) {
+ if (!isset($confArr['tree']) || !isset($confArr['docman']) ||
!isset($confArr['frs']) || !isset($confArr['forum']) ||
!isset($confArr['tracker'])) {
return false;
}
- $res = db_query_params('truncate
plugin_projects_hierarchy_global',array());
+ $res = db_query_params('TRUNCATE
plugin_projects_hierarchy_global',array());
if (!$res) {
return false;
}
- $res = db_query_params('insert into
plugin_projects_hierarchy_global (tree, docman)
- values ($1, $2)',
- array(
- $confArr['tree'],
- $confArr['docman'],
- ));
+ $res = db_query_params('INSERT INTO
plugin_projects_hierarchy_global (tree, docman, frs, forum, tracker) VALUES
($1, $2, $3, $4, $5)',
+ array($confArr['tree'],
$confArr['docman'], $confArr['frs'], $confArr['forum'], $confArr['tracker'])
+ );
if (!$res) {
return false;
}
@@ -761,18 +870,13 @@ EOS;
* @return bool true on success
*/
function updateConf($project_id, $confArr) {
- if (!isset($confArr['tree']) || !isset($confArr['docman']) ||
!isset($confArr['globalconf'])) {
+ if (!isset($confArr['tree']) || !isset($confArr['docman']) ||
!isset($confArr['frs']) || !isset($confArr['forum']) ||
!isset($confArr['tracker']) || !isset($confArr['globalconf'])) {
return false;
}
$res = db_query_params('update plugin_projects_hierarchy
- set (tree, docman, globalconf) = ($1,
$2, $3)
- where project_id = $4',
- array(
- $confArr['tree'],
- $confArr['docman'],
- $confArr['globalconf'],
- $project_id
- ));
+ set (tree, docman, frs, forum, tracker,
globalconf) = ($1, $2, $3, $4, $5, $6)
+ where project_id = $7',
+ array($confArr['tree'],
$confArr['docman'], $confArr['frs'], $confArr['forum'], $confArr['tracker'],
$confArr['globalconf'], $project_id));
if (!$res) {
return false;
}
diff --git
a/src/plugins/projects-hierarchy/db/20161229-plugin-hierarchy-frs-forum-tracker.sql
b/src/plugins/projects-hierarchy/db/20161229-plugin-hierarchy-frs-forum-tracker.sql
new file mode 100644
index 0000000..5b5e913
--- /dev/null
+++
b/src/plugins/projects-hierarchy/db/20161229-plugin-hierarchy-frs-forum-tracker.sql
@@ -0,0 +1,6 @@
+ALTER TABLE plugin_projects_hierarchy ADD COLUMN frs boolean DEFAULT false;
+ALTER TABLE plugin_projects_hierarchy ADD COLUMN forum boolean DEFAULT false;
+ALTER TABLE plugin_projects_hierarchy ADD COLUMN tracker boolean DEFAULT false;
+ALTER TABLE plugin_projects_hierarchy_global ADD COLUMN frs boolean DEFAULT
false;
+ALTER TABLE plugin_projects_hierarchy_global ADD COLUMN forum boolean DEFAULT
false;
+ALTER TABLE plugin_projects_hierarchy_global ADD COLUMN tracker boolean
DEFAULT false;
diff --git
a/src/plugins/projects-hierarchy/view/admin/viewGlobalConfiguration.php
b/src/plugins/projects-hierarchy/view/admin/viewGlobalConfiguration.php
index cb22946..2d8af8e 100644
--- a/src/plugins/projects-hierarchy/view/admin/viewGlobalConfiguration.php
+++ b/src/plugins/projects-hierarchy/view/admin/viewGlobalConfiguration.php
@@ -3,7 +3,7 @@
* Projects Hierarchy plugin
*
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2012,2014 Franck Villaume - TrivialDev
+ * Copyright 2012,2014,2016, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -37,16 +37,45 @@ if (!$projectsHierarchyGlobalConf) {
$cells = array();
$cells[][] = html_e('label', array('id' => 'projectsHierarchy-tree',
'title' => _('Enable visibility in hierarchy tree.')), _('Enable Tree'));
$inputAttrs = array('type' => 'checkbox', 'name' => 'tree', 'value' =>
1);
- if ($projectsHierarchyGlobalConf['tree'])
+ if ($projectsHierarchyGlobalConf['tree']) {
$inputAttrs['checked'] = 'checked';
+ }
$cells[][] = html_e('input', $inputAttrs);
echo $HTML->multiTableRow(array(), $cells);
- $cells = array();
+ $cells = array();
$cells[][] = html_e('label', array('id' => 'projectsHierarchy-docman',
'title' => _('Enable hierarchical view for browsing in document manager.')),
_('Enable Docman'));
$inputAttrs = array('type' => 'checkbox', 'name' => 'docman', 'value'
=> 1);
- if ($projectsHierarchyGlobalConf['docman'])
+ if ($projectsHierarchyGlobalConf['docman']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-forum',
'title' => _('Enable hierarchical view for browsing in forum main page.')),
_('Enable Forum'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'forum', 'value' =>
1);
+ if ($projectsHierarchyGlobalConf['forum']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-frs',
'title' => _('Enable hierarchical view for browsing in FRS main page.')),
_('Enable FRS'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'frs', 'value' =>
1);
+ if ($projectsHierarchyGlobalConf['frs']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-tracker',
'title' => _('Enable hierarchical view for browsing in Tracker main page.')),
_('Enable Tracker'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'tracker', 'value'
=> 1);
+ if ($projectsHierarchyGlobalConf['tracker']) {
$inputAttrs['checked'] = 'checked';
+ }
$cells[][] = html_e('input', $inputAttrs);
echo $HTML->multiTableRow(array(), $cells);
diff --git
a/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php
b/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php
index c28b157..60d9207 100644
--- a/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php
+++ b/src/plugins/projects-hierarchy/view/admin/viewProjectConfiguration.php
@@ -3,7 +3,7 @@
* Projects Hierarchy Plugin
*
* Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2016, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -51,6 +51,33 @@ if (!$projectsHierarchyProjectConf) {
echo $HTML->multiTableRow(array(), $cells);
$cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-forum',
'title' => _('Enable hierarchical view for browsing in Forum main page.')),
_('Enable Forum'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'forum', 'value' =>
1);
+ if ($projectsHierarchyProjectConf['forum']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-frs',
'title' => _('Enable hierarchical view for browsing in FRS main page.')),
_('Enable FRS'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'frs', 'value' =>
1);
+ if ($projectsHierarchyProjectConf['frs']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
+ $cells[][] = html_e('label', array('id' => 'projectsHierarchy-tracker',
'title' => _('Enable hierarchical view for browsing in Tracker main page.')),
_('Enable Tracker'));
+ $inputAttrs = array('type' => 'checkbox', 'name' => 'tracker', 'value'
=> 1);
+ if ($projectsHierarchyProjectConf['tracker']) {
+ $inputAttrs['checked'] = 'checked';
+ }
+ $cells[][] = html_e('input', $inputAttrs);
+ echo $HTML->multiTableRow(array(), $cells);
+
+ $cells = array();
$cells[][] = html_e('label', array('id' =>
'projectsHierarchy-globalconf', 'title' => _('Use forge global configuration.
Superseed any configuration done at project level.')), _('Enable forge global
configuration'));
$inputAttrs = array('type' => 'checkbox', 'name' => 'globalconf',
'value' => 1);
if ($projectsHierarchyProjectConf['globalconf'])
diff --git a/src/www/forum/index.php b/src/www/forum/index.php
index c052a9e..8174564 100644
--- a/src/www/forum/index.php
+++ b/src/www/forum/index.php
@@ -40,43 +40,70 @@ if ($group_id) {
}
$ff = new ForumFactory($g);
- if (!$ff || !is_object($ff) || $ff->isError()) {
- exit_error($ff->getErrorMessage(),'forums');
+ if (!$ff || !is_object($ff)) {
+ exit_error(_('Unable to retrieve forums'), 'forums');
+ } elseif ($ff->isError()) {
+ exit_error($ff->getErrorMessage(), 'forums');
}
$farr = $ff->getForums();
+ if (count($farr) == 0) {
+ $localInformation = $HTML->information(sprintf(_('No Forums
found for %s'), $g->getPublicName()));
+ }
+
+ $child_has_f = false;
+ if ($g->usesPlugin('projects-hierarchy')) {
+ $projectsHierarchy = plugin_get_object('projects-hierarchy');
+ $projectIDsArray = $projectsHierarchy->getFamily($group_id,
'child', true, 'validated');
+ foreach ($projectIDsArray as $projectid) {
+ $childGroupObject = group_get_object($projectid);
+ if ($childGroupObject && is_object($childGroupObject)
&& !$childGroupObject->isError()) {
+ if ($childGroupObject->usesForum() &&
$projectsHierarchy->getForumStatus($childGroupObject->getID())) {
+ $childff = new
ForumFactory($childGroupObject);
+ $child_farr = $childff->getForums();
+ if (count($child_farr) > 0) {
+ $farr = array_merge($farr,
$child_farr);
+ $child_has_f = true;
+ }
+ }
+ }
+ unset($childGroupObject);
+ }
+ }
- if ( $farr !== false && count($farr) == 1 ) {
+ if ((count($farr) == 1) && ($farr[0]->Group->getID() == $group_id)) {
session_redirect('/forum/forum.php?forum_id='.$farr[0]->getID(), false);
}
- forum_header(array('title'=>sprintf(_('Forums for %s'),
$g->getPublicName()) ));
+ html_use_tablesorter();
- if ($ff->isError()) {
- echo $HTML->error_msg($ff->getErrorMessage());
- forum_footer();
- exit;
- } elseif ( count($farr) < 1) {
- echo $HTML->information(sprintf(_('No Forums Found for %s'),
$g->getPublicName()));
+ forum_header(array('title' => sprintf(_('Forums for %s'),
$g->getPublicName()) ));
+
+ if ( count($farr) < 1) {
+ echo $localInformation;
forum_footer();
exit;
}
-// echo _('<p>Choose a forum and you can browse, search, and post
messages.<p>');
-
if (session_loggedin()) {
echo $HTML->printsubMenu(array(_("My Monitored Forums")),
array("/forum/myforums.php?group_id=$group_id"), array());
}
plugin_hook("blocks", "forum index");
- $tablearr=array(_('Forum'),_('Description'),_('Threads'),_('Posts'),
_('Last Post'));
- echo $HTML->listTableTop($tablearr);
-
+ $tablearr = array(_('Forum'), _('Description'), _('Threads'),
_('Posts'), _('Last Post'));
+ $thclass = array(array(), array(), array('class' => 'align-center'),
array('class' => 'align-center'), array('class' => 'align-center'));
+ if ($child_has_f) {
+ $tablearr = array(_('Project'), _('Forum'), _('Description'),
_('Threads'), _('Posts'), _('Last Post'));
+ $thclass = array(array(), array(), array(), array('class' =>
'align-center'), array('class' => 'align-center'), array('class' =>
'align-center'));
+ }
+ if (isset($localInformation)) {
+ echo $localInformation;
+ }
/*
Put the result set (list of forums for this group) into a
column with folders
*/
-
+ echo $HTML->listTableTop($tablearr, array(), 'full sortable
sortable_table_forum', 'sortable_table_forum', array(), array(), $thclass);
for ($j = 0; $j < count($farr); $j++) {
if (!is_object($farr[$j])) {
//just skip it - this object should never have been
placed here
@@ -84,20 +111,24 @@ if ($group_id) {
echo $farr[$j]->getErrorMessage();
} else {
$cells = array();
- $cells[][] =
util_make_link('/forum/forum.php?forum_id='.$farr[$j]->getID().'&group_id='.$group_id,
html_image('ic/forum20w.png').' '.$farr[$j]->getName());
+ if ($child_has_f) {
+ if ($farr[$j]->Group->getID() != $group_id) {
+ $cells[] = array(sprintf(_('Child
project %s Forum'), util_make_link('/forum/?group='.$farr[$j]->Group->getID(),
$farr[$j]->Group->getPublicName())), 'content' => $farr[$j]->Group->getID());
+ } else {
+ $cells[] = array('', 'content' =>
$farr[$j]->Group->getID());
+ }
+ }
+ $cells[][] =
util_make_link('/forum/forum.php?forum_id='.$farr[$j]->getID().'&group_id='.$farr[$j]->Group->getID(),
$HTML->getForumPic().' '.$farr[$j]->getName());
$cells[][] = $farr[$j]->getDescription();
$cells[] = array($farr[$j]->getThreadCount(), 'class'
=> 'align-center');
$cells[] = array($farr[$j]->getMessageCount(), 'class'
=> 'align-center');
- $cells[][] = date(_('Y-m-d
H:i'),$farr[$j]->getMostRecentDate());
+ $cells[] = array(date(_('Y-m-d
H:i'),$farr[$j]->getMostRecentDate()), 'class' => 'align-center');
echo $HTML->multiTableRow(array(), $cells);
}
}
echo $HTML->listTableBottom();
-
forum_footer();
} else {
-
exit_no_group();
-
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=cf166d5c98d69358a105c3fedbd69a484fd161e1
commit cf166d5c98d69358a105c3fedbd69a484fd161e1
Author: Franck Villaume <[email protected]>
Date: Sat Dec 31 01:47:43 2016 +0100
fix sprintf & strings
diff --git a/src/common/include/Group.class.php
b/src/common/include/Group.class.php
index 157f6b9..6b3e3c6 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -1857,7 +1857,7 @@ class Group extends FFError {
for ($i=0; $i<db_numrows($res); $i++) {
$Forum = new
Forum($news_group,db_result($res,$i,'forum_id'));
if (!$Forum->delete(1,1)) {
- $this->setError(_("Could Not Delete News Forum:
%d"),$Forum->getID());
+ $this->setError(_('Could not delete News
Forum')._(': '),$Forum->getID());
return false;
}
}
@@ -1866,7 +1866,7 @@ class Group extends FFError {
for ($i = 0; $i < db_numrows($res); $i++) {
$Forum = new Forum($this, db_result($res, $i,
'forum_id'));
if (!$Forum->delete(1, 1)) {
- $this->setError(_("Could Not Delete News Forum:
%d"), $Forum->getID());
+ $this->setError(_('Could not delete News
Forum')._(': '), $Forum->getID());
return false;
}
}
@@ -1874,7 +1874,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM news_bytes WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting News: ').db_error());
+ $this->setError(_('Error Deleting News')._(':
').db_error());
db_rollback();
return false;
}
@@ -1885,7 +1885,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM doc_data WHERE group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Documents:
').db_error());
+ $this->setError(_('Error Deleting Documents')._(':
').db_error());
db_rollback();
return false;
}
@@ -1893,7 +1893,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM doc_groups WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Documents:
').db_error());
+ $this->setError(_('Error Deleting Documents')._(':
').db_error());
db_rollback();
return false;
}
@@ -1903,7 +1903,7 @@ class Group extends FFError {
//
$res=db_query_params('DELETE FROM project_tags WHERE
group_id=$1', array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Tags: ').db_error());
+ $this->setError(_('Error Deleting Tags')._(':
').db_error());
db_rollback();
return false;
}
@@ -1914,7 +1914,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM group_history WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Project History:
').db_error());
+ $this->setError(_('Error Deleting Project
History')._(': ').db_error());
db_rollback();
return false;
}
@@ -1925,7 +1925,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM group_plugin WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Project Plugins:
').db_error());
+ $this->setError(_('Error Deleting Project
Plugins')._(': ').db_error());
db_rollback();
return false;
}
@@ -1936,7 +1936,7 @@ class Group extends FFError {
$res = db_query_params ('DELETE FROM stats_cvs_group WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting SCM Statistics:
').db_error());
+ $this->setError(_('Error Deleting SCM Statistics')._(':
').db_error());
db_rollback();
return false;
}
@@ -1994,7 +1994,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM trove_group_link WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Trove: ').db_error());
+ $this->setError(_('Error Deleting Trove')._(':
').db_error());
db_rollback();
return false;
}
@@ -2002,7 +2002,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM trove_agg WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Trove: ').db_error());
+ $this->setError(_('Error Deleting Trove')._(':
').db_error());
db_rollback();
return false;
}
@@ -2013,7 +2013,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM project_sums_agg WHERE
group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Counters:
').db_error());
+ $this->setError(_('Error Deleting Counters')._(':
').db_error());
db_rollback();
return false;
}
@@ -2023,7 +2023,7 @@ class Group extends FFError {
time(),
0));
if (!$res) {
- $this->setError(_('Error Deleting Project:').'
'.db_error());
+ $this->setError(_('Error Deleting Project')._(':
').db_error());
db_rollback();
return false;
}
@@ -2042,7 +2042,7 @@ class Group extends FFError {
$res = db_query_params('DELETE FROM groups WHERE group_id=$1',
array($this->getID()));
if (!$res) {
- $this->setError(_('Error Deleting Project:').'
'.db_error());
+ $this->setError(_('Error Deleting Project')._(':
').db_error());
db_rollback();
return false;
}
@@ -2217,7 +2217,7 @@ class Group extends FFError {
}
}
if (count($found_roles) == 0) {
- $this->setError(sprintf(_('Error: User not removed:
%s')));
+ $this->setError(_('Error')._(': ')._('User not
removed')._(': ').$user_id);
db_rollback();
return false;
}
@@ -2241,7 +2241,7 @@ class Group extends FFError {
array($this->getID(),
$user_id));
if (!$res) {
- $this->setError(_('Error: artifact:').' '.db_error());
+ $this->setError(_('Error')._(': ')._('artifact')._(':
').db_error());
db_rollback();
return false;
}
@@ -2262,7 +2262,7 @@ class Group extends FFError {
array($this->getID(),
$user_id));
if (!$res) {
- $this->setError(sprintf(_('Error: project_assigned_to
%d: %s'), 1, db_error()));
+ $this->setError(_('Error')._(':
').sprintf(_('project_assigned_to %d: %s'), 1, db_error()));
db_rollback();
return false;
}
@@ -2275,7 +2275,7 @@ class Group extends FFError {
array($this->getID(),
$user_id));
if (!$res) {
- $this->setError(sprintf(_('Error: project_assigned_to
%d: %s'), 2, db_error()));
+ $this->setError(_('Error')._(':
').sprintf(_('project_assigned_to %d: %s'), 2, db_error()));
db_rollback();
return false;
}
@@ -2350,7 +2350,7 @@ class Group extends FFError {
}
}
if ($found_role == NULL) {
- $this->setError(sprintf(_('Error: User not removed:
%s')));
+ $this->setError(_('Error')._(': ').sprintf(_('User not
removed: %s'), $user_id));
db_rollback();
return false;
}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=c61e1eae6227abae2c9ab9ac66067781a0f3ee22
commit c61e1eae6227abae2c9ab9ac66067781a0f3ee22
Author: Franck Villaume <[email protected]>
Date: Fri Dec 30 19:20:00 2016 +0100
remove unused icon + use HTML theme icon
diff --git a/src/common/tracker/actions/admin-ind.php
b/src/common/tracker/actions/admin-ind.php
index 20b44ac..00549e6 100644
--- a/src/common/tracker/actions/admin-ind.php
+++ b/src/common/tracker/actions/admin-ind.php
@@ -102,8 +102,7 @@ if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
for ($j = 0; $j < count($at_arr); $j++) {
$cells = array();
- $cells[][] =
util_make_link('/tracker/admin/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id,
html_image('ic/tracker20w.png', 20, 20).' '.
- $at_arr[$j]->getName());
+ $cells[][] =
util_make_link('/tracker/admin/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id,
$HTML->getFollowPic().' '.$at_arr[$j]->getName());
$cells[][] = $at_arr[$j]->getDescription();
echo $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($j, true)), $cells);
}
diff --git a/src/plugins/taskboard/common/views/admin/ind.php
b/src/plugins/taskboard/common/views/admin/ind.php
index f7de4bc..6b79a20 100644
--- a/src/plugins/taskboard/common/views/admin/ind.php
+++ b/src/plugins/taskboard/common/views/admin/ind.php
@@ -3,7 +3,7 @@
* Tracker Link & List for administration
*
* Copyright (C) 2013 Vitaliy Pylypiv <[email protected]>
- * Copyright 2015 Franck Villaume - TrivialDev
+ * Copyright 2015,2016, Franck Villaume - TrivialDev
* Copyright 2016, Stéphane-Eymeric Bredtthauer - TrivialDev
*
* http://fusionforge.org
@@ -52,7 +52,7 @@ echo html_e('p', array(),
util_make_link('/plugins/'.$pluginTaskboard->name.'/ad
if (!$tb_arr || count($tb_arr) < 1) {
echo $HTML->information(_('No taskboards have been set up, or you
cannot view them.'));
} else {
- echo '<p>'._('Choose a taskboard.').'</p>';
+ echo html_e('p', array(), _('Choose a taskboard.'));
$tablearr = array(_('Taskboard'),_('Description'));
echo $HTML->listTableTop($tablearr, false, 'full sortable
sortable_table_taskboard', 'sortable_table_taskboard');
@@ -63,7 +63,7 @@ if (!$tb_arr || count($tb_arr) < 1) {
} else {
$cells = array();
$cells[][] =
util_make_link('/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&taskboard_id='.$tb_arr[$j]->getID(),
- html_image("ic/tracker20w.png",
20, 20).' '.$tb_arr[$j]->getName());
+ $HTML->getFollowPic().'
'.$tb_arr[$j]->getName());
$cells[][] = $tb_arr[$j]->getDescription();
echo $HTML->multiTableRow(array(), $cells);
}
diff --git a/src/plugins/taskboard/common/views/ind.php
b/src/plugins/taskboard/common/views/ind.php
index c6d3056..d294c9e 100644
--- a/src/plugins/taskboard/common/views/ind.php
+++ b/src/plugins/taskboard/common/views/ind.php
@@ -3,6 +3,7 @@
* Taskboard Front Page
*
* Copyright 2016, Stéphane-Eymeric Bredthauer - TrivialDev
+ * Copyright 2016, Franck Villaume - TrivialDev
*
* http://fusionforge.org/
*
@@ -41,14 +42,11 @@ html_use_tablesorter();
$taskboardFactory->header();
if (!$tb_arr || count($tb_arr) < 1) {
echo $HTML->information(_('No taskboards have been set up, or you
cannot view them.'));
- echo '<p>';
- echo sprintf(_('The Admin for this project will have to set up data
types using the %1$s admin page %2$s'), '<a
href="'.util_make_uri('/plugins/'.$pluginTaskboard->name.'/?group_id='.$group_id).'">',
'</a>');
- echo "</p>";
+ echo html_e('p', array(), sprintf(_('The Admin for this project will
have to set up data types using the %1$s admin page %2$s'), '<a
href="'.util_make_uri('/plugins/'.$pluginTaskboard->name.'/?group_id='.$group_id).'">',
'</a>'));
} else {
- echo '<p>'._('Choose a taskboard.').'</p>';
+ echo html_e('p', array(), _('Choose a taskboard.'));
$tablearr = array(_('Taskboard'),_('Description'));
echo $HTML->listTableTop($tablearr, false, 'full sortable
sortable_table_taskboard', 'sortable_table_taskboard');
-
for ($j = 0; $j < count($tb_arr); $j++) {
if (is_object($tb_arr[$j])) {
if ($tb_arr[$j]->isError()) {
@@ -56,7 +54,7 @@ if (!$tb_arr || count($tb_arr) < 1) {
} else {
$cells = array();
$cells[][] =
util_make_link('/plugins/'.$pluginTaskboard->name.'/?group_id='.$group_id.'&taskboard_id='.$tb_arr[$j]->getID(),
-
html_image("ic/tracker20w.png", 20, 20).' '.$tb_arr[$j]->getName());
+
$HTML->getFollowPic().' '.$tb_arr[$j]->getName());
$cells[][] = $tb_arr[$j]->getDescription();
echo $HTML->multiTableRow(array(), $cells);
}
diff --git a/src/www/images/ic/tracker20w.png b/src/www/images/ic/tracker20w.png
deleted file mode 100644
index d0efc4b..0000000
Binary files a/src/www/images/ic/tracker20w.png and /dev/null differ
diff --git a/src/www/themes/funky-wOw/images/ic/tracker20w.png
b/src/www/themes/funky-wOw/images/ic/tracker20w.png
deleted file mode 100644
index b16cf33..0000000
Binary files a/src/www/themes/funky-wOw/images/ic/tracker20w.png and /dev/null
differ
diff --git a/src/www/themes/funky/images/ic/tracker20w.png
b/src/www/themes/funky/images/ic/tracker20w.png
deleted file mode 100644
index b16cf33..0000000
Binary files a/src/www/themes/funky/images/ic/tracker20w.png and /dev/null
differ
-----------------------------------------------------------------------
Summary of changes:
src/common/frs/views/listpackages.php | 40 ++++--
src/common/include/Group.class.php | 38 +++---
src/common/tracker/actions/admin-ind.php | 3 +-
src/common/tracker/actions/ind.php | 55 ++++++--
.../actions/updateGlobalConf.php | 7 +-
.../actions/updateProjectConf.php | 7 +-
.../common/projects-hierarchyPlugin.class.php | 140 ++++++++++++++++++---
...20161229-plugin-hierarchy-frs-forum-tracker.sql | 6 +
.../view/admin/viewGlobalConfiguration.php | 37 +++++-
.../view/admin/viewProjectConfiguration.php | 29 ++++-
src/plugins/taskboard/common/views/admin/ind.php | 6 +-
src/plugins/taskboard/common/views/ind.php | 10 +-
src/www/forum/index.php | 73 +++++++----
src/www/images/ic/tracker20w.png | Bin 332 -> 0 bytes
src/www/themes/funky-wOw/images/ic/tracker20w.png | Bin 315 -> 0 bytes
src/www/themes/funky/images/ic/tracker20w.png | Bin 315 -> 0 bytes
16 files changed, 356 insertions(+), 95 deletions(-)
create mode 100644
src/plugins/projects-hierarchy/db/20161229-plugin-hierarchy-frs-forum-tracker.sql
delete mode 100644 src/www/images/ic/tracker20w.png
delete mode 100644 src/www/themes/funky-wOw/images/ic/tracker20w.png
delete mode 100644 src/www/themes/funky/images/ic/tracker20w.png
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits