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 c402e478e71bb48093f861bcda6431a0ca826b65 (commit)
via 1af2f4bf798cdd58b02e30a3b7d181db675fb37c (commit)
via ed8cef203c217c0f191cc4f2a5e206153fe0154c (commit)
from f203d5819d01882de0ba4475ad76ea6a4af79a95 (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=c402e478e71bb48093f861bcda6431a0ca826b65
commit c402e478e71bb48093f861bcda6431a0ca826b65
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 16:41:43 2017 +0100
new widget: ProjectLatestArtifacts to display 5 more recent artifacts in
the project
diff --git a/src/CHANGES b/src/CHANGES
index 22ea18c..f16528f 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -47,6 +47,7 @@ FusionForge 6.X:
* Web UI: upgrade jquery ui to 1.12.1 (TrivialDev)
* Web UI: upgrade jquery to 1.12.4 (Nokia)
* Widget MySystasks: new widget for user to display systasks perform on user
projects (TrivialDev)
+* Widget ProjectlatestArtifact: new widget for project to display the 5 more
recent artifacts (TrivialDev)
* Widget ProjectScmStats: new widget for project to display SCM stats
(TrivialDev)
* Widget HomeRss: new widget for Forge home page to display RSS flow
(TrivialDev)
diff --git a/src/common/widget/Widget.class.php
b/src/common/widget/Widget.class.php
index 34bc949..bd6b4ca 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -48,6 +48,7 @@ require_once
$gfcommon.'widget/Widget_ProjectLatestNews.class.php';
require_once $gfcommon.'widget/Widget_ProjectPublicAreas.class.php';
require_once $gfcommon.'widget/Widget_ProjectRss.class.php';
require_once $gfcommon.'widget/Widget_ProjectLatestCommits.class.php';
+require_once $gfcommon.'widget/Widget_ProjectLatestArtifacts.class.php';
//require_once $gfcommon.'widget/Widget_ProjectTwitterFollow.class.php';
//require_once $gfcommon.'widget/Widget_ProjectWikiPage.class.php';
require_once $gfcommon.'widget/Widget_ProjectScmStats.class.php';
@@ -289,6 +290,9 @@ require_once
$gfcommon.'widget/Widget_TrackerSummary.class.php';
case 'projectlatestcommits':
$o = new Widget_ProjectLatestCommits();
break;
+ case 'projectlatestartifacts':
+ $o = new Widget_ProjectLatestArtifacts();
+ break;
case 'trackercontent':
$o = new Widget_TrackerContent();
break;
@@ -336,7 +340,7 @@ require_once
$gfcommon.'widget/Widget_TrackerSummary.class.php';
// project home widgets
$widgets = array('projectdescription',
'projectmembers', 'projectinfo', 'projectscmstats',
'projectlatestfilereleases',
'projectlatestdocuments', 'projectlatestnews', 'projectpublicareas',
//'projectwikipage' //not yet
- 'projectlatestcommits',
'projecttwitterfollow', 'projectrss', 'projectdocumentsactivity',
+ 'projectlatestcommits',
'projecttwitterfollow', 'projectrss', 'projectdocumentsactivity',
'projectlatestartifacts'
);
break;
case WidgetLayoutManager::OWNER_TYPE_HOME:
diff --git a/src/common/widget/Widget_ProjectLatestArtifacts.class.php
b/src/common/widget/Widget_ProjectLatestArtifacts.class.php
new file mode 100644
index 0000000..ff98a6e
--- /dev/null
+++ b/src/common/widget/Widget_ProjectLatestArtifacts.class.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Widget_ProjectLatestArtifacts
+ *
+ * Copyright 2017, Franck Villaume - TrivialDev
+ *
+ * This file is a part of Fusionforge.
+ *
+ * Fusionforge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Fusionforge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+class Widget_ProjectLatestArtifacts extends Widget {
+
+ /**
+ * Default number of artifacts to display
+ */
+ const NB_ARTIFACTS_TO_DISPLAY = 5;
+
+ public function __construct() {
+ parent::__construct('projectlatestartifacts');
+ $request =& HTTPRequest::instance();
+ $pm = ProjectManager::instance();
+ $project = $pm->getProject($request->get('group_id'));
+ if ($project && $this->canBeUsedByProject($project)) {
+ $atf = new ArtifactTypeFactory($project);
+ $ats = $atf->getArtifactTypes();
+ if (count($ats) > 0) {
+ $this->content['title'] = _('5 Latest
Artifacts');
+ }
+ }
+ }
+
+ public function getTitle() {
+ return _('5 Latest Artifacts');
+ }
+
+ public function _getLinkToArtifact($aid) {
+ $artf = artifact_get_object($aid);
+ return $artf->getPermalink();
+ }
+
+ public function getContent() {
+ global $HTML;
+ $html = '';
+ //$uh = new UserHelper();
+ $request = HTTPRequest::instance();
+ $pm = ProjectManager::instance();
+ $project = $pm->getProject($request->get('group_id'));
+ $atf = new ArtifactTypeFactory($project);
+ $artifacts = array();
+ $ats = $atf->getArtifactTypes();
+ $atids = array();
+ foreach ($ats as $at) {
+ $atids[] = $at->getID();
+ }
+ $artifacts = db_query_params('SELECT * FROM artifact_vw WHERE
group_artifact_id = ANY ($1) ORDER BY last_modified_date, artifact_id',
array(db_int_array_to_any_clause($atids)), self::NB_ARTIFACTS_TO_DISPLAY);
+ if (db_numrows($artifacts) > 0) {
+ html_use_tablesorter();
+ $html .= $HTML->getJavascripts();
+ $tabletop = array(_('Date'), _('Id'), _('Summary'),
_('Tracker'), _('Status'), _('Priority'), _('Last Modified By'));
+ $classth = array('', '', '', '', '', '');
+ $html .= $HTML->listTableTop($tabletop, false,
'sortable_widget_tracker_listartifact full', 'sortable', $classth);
+ while ($artifact = db_fetch_array($artifacts)) {
+ $cells = array();
+ $artf =
artifact_get_object($artifact['artifact_id'], $artifact);
+ $cells[][] = date(_('Y-m-d H:i'),
$artifact['last_modified_date']);
+ $cells[][] =
util_make_link($artf->getPermalink(), $artf->getID());
+ $cells[][] = $artifact['summary'];
+ $at =
artifactType_get_object($artifact['group_artifact_id']);
+ $cells[][] =
util_make_link('/tracker/?group_id='.$project->getID().'&atid='.$artifact['group_artifact_id'],
$at->getName());
+ $cells[][] = $artf->getCustomStatusName();
+ $cells[][] = $artifact['priority'];
+ if ($artf->getLastModifiedBy() != 100) {
+ $cells[][] =
util_display_user($artf->getLastModifiedUnixName(), $artf->getLastModifiedBy(),
$artf->getLastModifiedRealName());
+ } else {
+ $cells[][] =
$artf->getLastModifiedRealName();
+ }
+ $html .= $HTML->multiTableRow(array(), $cells);
+ }
+ $html .= $HTML->listTableBottom();
+ } else {
+ $html .= $HTML->information(_('No artifact found'));
+ }
+ $html .= html_e('div', array('class' => 'underline-link'),
util_make_link('/tracker/?group_id='.$project->getID(), _('Browse Trackers')));
+ return $html;
+ }
+
+ function getCategory() {
+ return _('Trackers');
+ }
+
+ function getDescription() {
+ return _('List the 5 most recent artifacts in the project.');
+ }
+
+ function isAvailable() {
+ return isset($this->content['title']);
+ }
+
+ function canBeUsedByProject(&$project) {
+ return $project->usesTracker();
+ }
+}
+
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=1af2f4bf798cdd58b02e30a3b7d181db675fb37c
commit 1af2f4bf798cdd58b02e30a3b7d181db675fb37c
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 16:40:01 2017 +0100
space
diff --git a/src/common/tracker/Artifact.class.php
b/src/common/tracker/Artifact.class.php
index a64c47f..31984ce 100644
--- a/src/common/tracker/Artifact.class.php
+++ b/src/common/tracker/Artifact.class.php
@@ -862,7 +862,7 @@ class Artifact extends FFObject {
* @access private
* @return boolean success.
*/
- function addHistory($field_name,$old_value, $importData = array()) {
+ function addHistory($field_name, $old_value, $importData = array()) {
if (array_key_exists('user', $importData)){
$user = $importData['user'];
} else {
@@ -878,7 +878,7 @@ class Artifact extends FFObject {
$field_name,
$old_value,
$user,
- $time)) ;
+ $time));
}
/**
@@ -1285,7 +1285,7 @@ class Artifact extends FFObject {
* @return bool true on success / false on failure
*/
function updateLastModified($importData = array()) {
- if (array_key_exists('time',$importData)){
+ if (array_key_exists('time', $importData)){
$time = $importData['time'];
} else {
$time = time();
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ed8cef203c217c0f191cc4f2a5e206153fe0154c
commit ed8cef203c217c0f191cc4f2a5e206153fe0154c
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 14:26:05 2017 +0100
use util_display_user in news
diff --git a/src/www/news/news_utils.php b/src/www/news/news_utils.php
index 734681f..cecf258 100644
--- a/src/www/news/news_utils.php
+++ b/src/www/news/news_utils.php
@@ -5,6 +5,7 @@
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2002-2004 (c) GForge Team
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2017, Franck Villaume - TrivialDev
* http://fusionforge.org/
*
* This file is part of FusionForge. FusionForge is free software;
@@ -94,7 +95,7 @@ function
news_show_latest($group_id=0,$limit=10,$show_summaries=true,$allow_subm
}
$result = db_query_params ('
SELECT groups.group_name, groups.unix_group_name, groups.group_id,
- users.user_name, users.realname,
+ users.user_name, users.realname, users.user_id,
news_bytes.forum_id, news_bytes.summary, news_bytes.post_date,
news_bytes.details
FROM users,news_bytes,groups
@@ -121,7 +122,7 @@ ORDER BY post_date DESC',
for ($i=0; $i<$rows; $i++) {
$t_thread_title = db_result($result,$i,'summary');
$t_thread_url = "/forum/forum.php?forum_id=" .
db_result($result,$i,'forum_id');
- $t_thread_author = db_result($result,$i,'realname');
+ $t_thread_author =
util_display_user(db_result($result,$i,'user_name'),db_result($result,$i,'user_id'),db_result($result,$i,'realname'));
$return .= '<div class="one-news bordure-dessous">';
$return .= "\n";
-----------------------------------------------------------------------
Summary of changes:
src/CHANGES | 1 +
src/common/tracker/Artifact.class.php | 6 +-
src/common/widget/Widget.class.php | 6 +-
.../widget/Widget_ProjectLatestArtifacts.class.php | 115 +++++++++++++++++++++
src/www/news/news_utils.php | 5 +-
5 files changed, 127 insertions(+), 6 deletions(-)
create mode 100644 src/common/widget/Widget_ProjectLatestArtifacts.class.php
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits