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 34384179bc7e8e05fb73a7dae081822b0dc75e02 (commit)
via eeabd0c21b7369af0728a450aa5ee5d838d93375 (commit)
from d86c3952dbde48d0cec45bc8761826153e6eb97a (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=34384179bc7e8e05fb73a7dae081822b0dc75e02
commit 34384179bc7e8e05fb73a7dae081822b0dc75e02
Author: Franck Villaume <[email protected]>
Date: Sat Jul 22 04:20:37 2017 +0200
new widget for forge homepage: 5 latest file releases across forge
diff --git a/src/CHANGES b/src/CHANGES
index 54c45aa..3cd9126 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -56,6 +56,7 @@ FusionForge 6.X:
* 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)
+* Widget HomeLatestFlieReleases: new widget for Forge home page to display 5
latest File releases across the forge (TrivialDev)
FusionForge 6.0.5:
* Docman: fix XSS attack (Roland Mas)
diff --git a/src/common/widget/Widget.class.php
b/src/common/widget/Widget.class.php
index 4361cd8..8d30af1 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -48,6 +48,7 @@ require_once
$gfcommon.'widget/Widget_ProjectLatestArtifacts.class.php';
require_once $gfcommon.'widget/Widget_ProjectScmStats.class.php';
require_once
$gfcommon.'widget/Widget_HomeDetailActivityMostActiveProjectWeek.class.php';
require_once $gfcommon.'widget/Widget_HomeLatestNews.class.php';
+require_once $gfcommon.'widget/Widget_HomeLatestFileReleases.class.php';
require_once $gfcommon.'widget/Widget_HomeStats.class.php';
require_once $gfcommon.'widget/Widget_HomeTagCloud.class.php';
require_once $gfcommon.'widget/Widget_HomeVersion.class.php';
@@ -188,6 +189,9 @@ require_once
$gfcommon.'widget/Widget_TrackerSummary.class.php';
case 'homedetailactivitymostactiveprojectweek';
$o = new
Widget_HomeDetailActivityMostActiveProjectWeek();
break;
+ case 'homelatestfilereleases':
+ $o = new Widget_HomeLatestFileReleases();
+ break;
case 'homerss';
$o = new Widget_HomeRss();
break;
@@ -321,7 +325,8 @@ require_once
$gfcommon.'widget/Widget_TrackerSummary.class.php';
);
break;
case WidgetLayoutManager::OWNER_TYPE_HOME:
- $widgets = array('hometagcloud', 'homeversion',
'homelatestnews', 'homestats', 'homedetailactivitymostactiveprojectweek',
'homerss');
+ $widgets = array('hometagcloud', 'homeversion',
'homelatestnews', 'homestats', 'homedetailactivitymostactiveprojectweek',
+ 'homelatestfilereleases',
'homerss');
break;
case WidgetLayoutManager::OWNER_TYPE_TRACKER:
$widgets = array('trackercontent',
'trackercomment', 'trackerdefaultactions', 'trackergeneral', 'trackermain',
'trackersummary');
diff --git a/src/common/widget/Widget_HomeLatestFileReleases.class.php
b/src/common/widget/Widget_HomeLatestFileReleases.class.php
new file mode 100644
index 0000000..925319b
--- /dev/null
+++ b/src/common/widget/Widget_HomeLatestFileReleases.class.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * 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/>.
+ */
+
+require_once 'Widget.class.php';
+
+class Widget_HomeLatestFileReleases extends Widget {
+ function __construct() {
+ parent::__construct('homelatestfilereleases');
+ if (forge_get_config('use_frs')) {
+ $this->content['title'] = _('Latest 5 File Releases');
+ }
+ }
+
+ function getTitle() {
+ return $this->content['title'];
+ }
+
+ function getCategory() {
+ return _('File Release System');
+ }
+
+ function isAvailable() {
+ return isset($this->content['title']);
+ }
+
+ function getContent() {
+ global $HTML;
+ $content = '';
+ $this->cached_results = array();
+ $this->fetchData();
+ while ((count($this->cached_results) < 5) && ($row =
db_fetch_array($this->data_res))) {
+ if (forge_check_perm('frs', $row['package_id'],
'read')) {
+ $this->cached_results[] = $row;
+ }
+ }
+ db_free_result($this->data_res);
+ if (count($this->cached_results)) {
+ $content .= $HTML->listTableTop();
+ $seen = array();
+ foreach ($this->cached_results as $result) {
+ if (!isset($seen[$result['group_id']])) {
+ $cells = array();
+ $cells[] =
array(util_make_link_g($result['unix_group_name'], $result['group_id'],
html_e('strong', array(), $result['group_name'])), 'colspan' => 4);
+ $content .=
$HTML->multiTableRow(array('class' => 'top'), $cells);
+ $seen[$result['group_id']] = 1;
+ }
+ $cells = array();
+ $cells[][] = _('Module')._(':
').$result['module_name'];
+ $cells[][] = _('Version')._(':
').$result['release_version'];
+ $cells[][] = _('Released by')._(':
').util_make_link_u($result['user_name'], $result['user_id'],
$result['user_name']);
+ $cells[][] = date(_('Y-m-d H:i'),
$result['release_date']);
+ $content .= $HTML->multiTableRow(array(),
$cells);
+ $cells = array();
+ $cells[] = array($result['short_description'],
'colspan' => 4);
+ $content .= $HTML->multiTableRow(array(),
$cells);
+ $cells = array();
+ $cells[] =
array(util_make_link('/frs/?group_id='.$result['group_id'].'&release_id='.$result['release_id'],_('Download')).
+ ' ('._('Project Total:')
.$result['downloads'].') | '.
+
util_make_link('/frs/?view=shownotes&group_id='.$result['group_id'].'&release_id='.$result['release_id'],_('Notes
and Changes')), 'colspan' => 4);
+ $content .= $HTML->multiTableRow(array(),
$cells);
+ }
+ $content .= $HTML->listTableBottom();
+ } else {
+ $content .= $HTML->information(_('No file releases
found'));
+ }
+ return $content;
+ }
+
+ function getDescription() {
+ return _('Display last 5 published file releases. Permission
settings apply to filter information.');
+ }
+
+ function fetchData() {
+ $this->data_res = db_query_params('SELECT groups.group_name,
+ groups.group_id,
+ groups.unix_group_name,
+ groups.short_description,
+ users.user_name,
+ users.user_id,
+ frs_release.release_id,
+ frs_package.package_id,
+ frs_release.name AS
release_version,
+ frs_release.release_date,
+ frs_release.released_by,
+ frs_package.name AS module_name,
+
frs_dlstats_grouptotal_vw.downloads
+ FROM
groups,users,frs_package,frs_release,frs_dlstats_grouptotal_vw
+ WHERE ( frs_release.package_id
= frs_package.package_id
+ AND frs_package.group_id =
groups.group_id
+ AND frs_release.released_by =
users.user_id
+ AND frs_package.group_id =
frs_dlstats_grouptotal_vw.group_id
+ AND frs_release.status_id = 1 )
+ ORDER BY
frs_release.release_date DESC',
+ array());
+ return true;
+ }
+}
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=eeabd0c21b7369af0728a450aa5ee5d838d93375
commit eeabd0c21b7369af0728a450aa5ee5d838d93375
Author: Franck Villaume <[email protected]>
Date: Sat Jul 22 04:18:44 2017 +0200
remove unused var, indent
diff --git a/src/www/new/index.php b/src/www/new/index.php
index 9b1313e..33fa99d 100644
--- a/src/www/new/index.php
+++ b/src/www/new/index.php
@@ -81,50 +81,49 @@ if (!$res_new || db_numrows($res_new) < 1) {
print '
<table class="fullwidth">';
$seen = array();
- $i = 0;
foreach ($rows as $row_new) {
// avoid duplicates of different file types
if (!isset($seen[$row_new['group_id']])) {
print '
- <tr class="top">
- <td colspan="2">'.
- util_make_link_g
($row_new['unix_group_name'],$row_new['group_id'],'<strong>'.$row_new['group_name'].'</strong>').'
- </td>
- <td nowrap="nowrap"><em>'._('Released by:').
- util_make_link_u
($row_new['user_name'],$row_new['user_id'],$row_new['user_name']).'</em>
- </td>
- </tr>
- <tr>
- <td>'._('Module:').' '.$row_new['module_name'].'
- </td>
- <td>'._('Version')._(':
').$row_new['release_version'].'
- </td>
- <td>'.date("M d,
h:iA",$row_new['release_date']).'
- </td>
- </tr>
- <tr class="top">
- <td colspan="2"> <br />';
- if ($row_new['short_description']) {
- print '<em>'.$row_new['short_description'].'</em>';
- } else {
- print '<em>'._('This project has not submitted a
description').'</em>';
- }
- print '
- </td>
- <td></td>
- </tr>
- <tr>
- <td colspan="3">';
- // link to whole file list for downloads
- print ' <br />'.
- util_make_link
('/frs/?group_id='.$row_new['group_id'].'&release_id='.$row_new['release_id'],_('Download')).
- ' ('._('Project Total:')
.$row_new['downloads'].') | ';
- // notes for this release
- print util_make_link
('/frs/?view=shownotes&group_id='.$row_new['group_id'].'&release_id='.$row_new['release_id'],_('Notes
and Changes')).'
- <hr />
- </td>
- </tr>';
- $seen[$row_new['group_id']] = 1;
+ <tr class="top">
+ <td colspan="2">'.
+ util_make_link_g
($row_new['unix_group_name'],$row_new['group_id'],'<strong>'.$row_new['group_name'].'</strong>').'
+ </td>
+ <td nowrap="nowrap"><em>'._('Released
by:').
+ util_make_link_u
($row_new['user_name'],$row_new['user_id'],$row_new['user_name']).'</em>
+ </td>
+ </tr>
+ <tr>
+ <td>'._('Module:').'
'.$row_new['module_name'].'
+ </td>
+ <td>'._('Version')._(':
').$row_new['release_version'].'
+ </td>
+ <td>'.date("M d,
h:iA",$row_new['release_date']).'
+ </td>
+ </tr>
+ <tr class="top">
+ <td colspan="2"> <br />';
+ if ($row_new['short_description']) {
+ print
'<em>'.$row_new['short_description'].'</em>';
+ } else {
+ print '<em>'._('This project has not submitted
a description').'</em>';
+ }
+ print '
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td colspan="3">';
+ // link to whole file list for downloads
+ print ' <br />'.
+ util_make_link
('/frs/?group_id='.$row_new['group_id'].'&release_id='.$row_new['release_id'],_('Download')).
+ ' ('._('Project Total:')
.$row_new['downloads'].') | ';
+ // notes for this release
+ print util_make_link
('/frs/?view=shownotes&group_id='.$row_new['group_id'].'&release_id='.$row_new['release_id'],_('Notes
and Changes')).'
+ <hr />
+ </td>
+ </tr>';
+ $seen[$row_new['group_id']] = 1;
}
}
-----------------------------------------------------------------------
Summary of changes:
src/CHANGES | 1 +
src/common/widget/Widget.class.php | 7 +-
.../widget/Widget_HomeLatestFileReleases.class.php | 113 +++++++++++++++++++++
src/www/new/index.php | 79 +++++++-------
4 files changed, 159 insertions(+), 41 deletions(-)
create mode 100644 src/common/widget/Widget_HomeLatestFileReleases.class.php
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits