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, 6.1 has been updated
via 1b421b74881babd4e87063d748721ca65ac3cf01 (commit)
from 9b027a383b916494dafea4283d191b84ef56f1e1 (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=1b421b74881babd4e87063d748721ca65ac3cf01
commit 1b421b74881babd4e87063d748721ca65ac3cf01
Author: Franck Villaume <[email protected]>
Date: Sun Dec 31 16:46:16 2017 +0100
rss: remove duplicate code
diff --git a/src/www/export/rss20_docman.php b/src/www/export/rss20_docman.php
index cc31e9a..696fe86 100644
--- a/src/www/export/rss20_docman.php
+++ b/src/www/export/rss20_docman.php
@@ -89,8 +89,7 @@ function beginFeed($groupname = "", $link = "") {
print " <generator>".forge_get_config ('forge_name')." RSS
generator</generator>\n";
}
-function writeFeed($d_arr, $limit){
-
+function writeFeed($d_arr, $limit) {
/*
if (!is_array($nested_groups["$parent_group"])) {
return;
@@ -132,19 +131,3 @@ function writeFeed($d_arr, $limit){
}//for loop
}//else (there are documents)
}
-
-
-function displayError($errorMessage) {
- print " <title>"._('Error')."</title>".
- "<description>".rss_description($errorMessage)."</description>";
-}
-
-function endFeed() {
- print '</channel></rss>';
- exit();
-}
-
-function endOnError($errorMessage) {
- displayError($errorMessage);
- endFeed();
-}
diff --git a/src/www/export/rss20_tasks.php b/src/www/export/rss20_tasks.php
index 4faeb87..1d90b92 100644
--- a/src/www/export/rss20_tasks.php
+++ b/src/www/export/rss20_tasks.php
@@ -191,7 +191,6 @@ function handle_getvar($name) {
}
function beginTaskFeed($feed_title, $feed_link, $feed_desc) {
-
header("Content-Type: text/xml");
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print "<rss version=\"2.0\">\n";
@@ -207,32 +206,15 @@ function beginTaskFeed($feed_title, $feed_link,
$feed_desc) {
}
function writeTaskFeed($msg, $item_cat){
-
- //------------ build one feed item ------------
- print " <item>\n";
- print " <title>".$msg['subject']."</title>\n";
- print " <link>" . util_make_url("/pm/t_follow.php/" .
$msg['project_task_id']) . "</link>\n";
- print " <category>".$item_cat."</category>\n";
- print " <description>".$msg['details']."</description>\n";
- print " <author>".$msg['user_realname']."</author>\n";
- //print " <comment></comment>\n";
- print " <pubDate>".gmdate('D, d M Y
G:i:s',$msg['most_recent_date'])." GMT</pubDate>\n";
+ //------------ build one feed item ------------
+ print " <item>\n";
+ print " <title>".$msg['subject']."</title>\n";
+ print " <link>" . util_make_url("/pm/t_follow.php/" .
$msg['project_task_id']) . "</link>\n";
+ print " <category>".$item_cat."</category>\n";
+ print " <description>".$msg['details']."</description>\n";
+ print " <author>".$msg['user_realname']."</author>\n";
+ //print " <comment></comment>\n";
+ print " <pubDate>".gmdate('D, d M Y
G:i:s',$msg['most_recent_date'])." GMT</pubDate>\n";
print " <guid>" . util_make_url("/pm/t_lookup.php?tid=" .
$msg['project_task_id']) . "</guid>\n";
- print " </item>\n";
-
-}
-
-function displayError($errorMessage) {
- print " <title>Error</title>\n".
- " <description>".$errorMessage."</description>";
-}
-
-function endFeed() {
- print "\n </channel>\n</rss>";
- exit();
-}
-
-function endOnError($errorMessage) {
- displayError($errorMessage);
- endFeed();
+ print " </item>\n";
}
diff --git a/src/www/export/rss20_tracker.php b/src/www/export/rss20_tracker.php
index aec5ae0..338dd32 100644
--- a/src/www/export/rss20_tracker.php
+++ b/src/www/export/rss20_tracker.php
@@ -139,19 +139,3 @@ function writeFeed($at_arr, $group_id){
}//for loop
}//else (there are trackers)
}
-
-
-function displayError($errorMessage) {
- print " <title>Error</title>".
-
"<description>".rss_description($errorMessage)."</description>";
-}
-
-function endFeed() {
- print '</channel></rss>';
- exit();
- }
-
-function endOnError($errorMessage) {
- displayError($errorMessage);
- endFeed();
-}
diff --git a/src/www/export/rss_utils.inc b/src/www/export/rss_utils.inc
index 1d50cbd..a5edef9 100644
--- a/src/www/export/rss_utils.inc
+++ b/src/www/export/rss_utils.inc
@@ -119,3 +119,18 @@ function rss_dump_project_result_array
($result,$title,$desription='',$callback=
// end output
print " </channel>\n";
}
+
+function displayError($errorMessage) {
+ print " <title>"._('Error')."</title>".
+ "<description>".rss_description($errorMessage)."</description>";
+}
+
+function endFeed() {
+ print '</channel></rss>';
+ exit();
+}
+
+function endOnError($errorMessage) {
+ displayError($errorMessage);
+ endFeed();
+}
-----------------------------------------------------------------------
Summary of changes:
src/www/export/rss20_docman.php | 19 +------------------
src/www/export/rss20_tasks.php | 38 ++++++++++----------------------------
src/www/export/rss20_tracker.php | 16 ----------------
src/www/export/rss_utils.inc | 15 +++++++++++++++
4 files changed, 26 insertions(+), 62 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits