]> git.pld-linux.org Git - packages/eventum.git/commitdiff
- rss code fixes
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 28 Mar 2005 07:21:10 +0000 (07:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    eventum-rss-updates.patch -> 1.1

eventum-rss-updates.patch [new file with mode: 0644]

diff --git a/eventum-rss-updates.patch b/eventum-rss-updates.patch
new file mode 100644 (file)
index 0000000..56556e2
--- /dev/null
@@ -0,0 +1,143 @@
+- rss.php
+ - set rss version to 2.0 (it really is more 2.0 than 0.91)
+ - display issue description in feed
+ - pubDate is now in feed in rfc822  format, confirming to rss specification
+ - Created Date removed from <descripion> (duplicate)
+
+- class.date.php
+ - Date_API::getRFC822Date added second (optional) parameter $timezone, to specify the timezone the $timestamp is in
+
+- class.issue.php
+ - added getDescriptionByIssues method
+
+--- ./rss.php~ 2005-02-27 17:59:14.000000000 +0200
++++ ./rss.php  2005-03-08 16:49:48.000000000 +0200
+@@ -54,7 +54,12 @@
+     header("Content-Type: text/xml");
+     echo '<?xml version="1.0"?>' . "\n";
+ ?>
+-<rss version="0.91">
++<rss version="2.0"
++    xmlns:dc="http://purl.org/dc/elements/1.1/"
++    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
++    xmlns:admin="http://webns.net/mvcb/"
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:content="http://purl.org/rss/1.0/modules/content/">
+   <channel>
+     <title>Error!</title>
+     <link><?php echo APP_BASE_URL; ?></link>
+@@ -117,6 +122,7 @@
+         returnError('Error: The provided custom filter ID is not associated with the given email address.');
+         exit;
+     }
++
+ }
+ include_once("/etc/eventum/private_key.php");
+@@ -144,30 +150,36 @@
+ $issues = Issue::getListing($filter['cst_prj_id'], $options, 0, 'ALL', TRUE);
+ $issues = $issues['list'];
+ $project_title = Project::getName($filter['cst_prj_id']);
++Issue::getDescriptionByIssues($issues);
+ header("Content-Type: text/xml");
+ echo '<?xml version="1.0" encoding="'. APP_CHARSET .'"?>' . "\n";
+ ?>
+-<rss version="0.91">
++<rss version="2.0"
++    xmlns:dc="http://purl.org/dc/elements/1.1/"
++    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
++    xmlns:admin="http://webns.net/mvcb/"
++    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
++    xmlns:content="http://purl.org/rss/1.0/modules/content/">
+   <channel>
+     <title><?php echo $setup['tool_caption']; ?> - <?php echo htmlspecialchars($filter['cst_title']); ?></title>
+     <link><?php echo APP_BASE_URL; ?></link>
+     <description>List of issues</description>
+-
+-<?php foreach($issues as $issue) { ?>
++<?php foreach ($issues as $issue) {
++?>
+     <item>
+       <title><?php echo '#' . $issue['iss_id'] . " - " . htmlspecialchars($issue['iss_summary']); ?></title>
+       <link><?php echo APP_BASE_URL . "view.php?id=" . $issue['iss_id']; ?></link>
+       <description>
+-      Project: <?php echo htmlspecialchars($project_title); ?> &lt;BR&gt;
+-      Created Date: <?php echo htmlspecialchars($issue['iss_created_date']); ?> &lt;BR&gt;
+-      Assignment: <?php echo htmlspecialchars($issue['assigned_users']); ?> &lt;BR&gt;
+-      Status: <?php echo htmlspecialchars($issue['sta_title']); ?> &lt;BR&gt;
+-      Priority: <?php echo htmlspecialchars($issue['pri_title']); ?> &lt;BR&gt;
+-      Category: <?php echo htmlspecialchars($issue['prc_title']); ?> &lt;BR&gt;
++      Project: <?php echo htmlspecialchars($project_title); ?>&lt;BR&gt;&lt;BR&gt;
++      Assignment: <?php echo htmlspecialchars($issue['assigned_users']); ?>&lt;BR&gt;
++      Status: <?php echo htmlspecialchars($issue['sta_title']); ?>&lt;BR&gt;
++      Priority: <?php echo htmlspecialchars($issue['pri_title']); ?>&lt;BR&gt;
++      Category: <?php echo htmlspecialchars($issue['prc_title']); ?>&lt;BR&gt;
++      &lt;BR&gt;<?php echo htmlspecialchars(Misc::activateLinks(nl2br($issue['iss_description']))); ?>&lt;BR&gt;
+       </description>
+       <author><?php echo htmlspecialchars($issue['reporter']); ?></author>
+-      <pubDate><?php echo $issue['iss_created_date']; ?></pubDate>
++      <pubDate><?php echo Date_API::getRFC822Date($issue['iss_created_date'], "GMT"); ?></pubDate>
+     </item>
+ <?php } ?>
+--- ./include/class.date.php   2005-02-27 17:59:14.000000000 +0200
++++ ./include/class.date.php   2005-03-08 16:04:35.000000000 +0200
+@@ -149,11 +149,14 @@
+      * RFC822 compliant format.
+      *
+      * @access  public
++     * @param   string $timezone The needed timezone
+      * @return  string The current GMT date
+      */
+-    function getRFC822Date($timestamp)
++    function getRFC822Date($timestamp, $timezone = FALSE)
+     {
+-        $timezone = Date_API::getPreferredTimezone();
++        if (!$timezone) {
++            $timezone = Date_API::getPreferredTimezone();
++        }
+         $date = new Date($timestamp);
+         // now convert to another timezone and return the date
+         $date->convertTZById($timezone);
+--- ./include/class.issue.php  2005-02-27 17:59:14.000000000 +0200
++++ ./include/class.issue.php  2005-03-08 17:42:23.000000000 +0200
+@@ -2620,6 +2620,38 @@
+     /**
++     * Method used to add the issue description to a list of issues.
++     *
++     * @access  public
++     * @param   array $result The result set
++     * @return  void
++     */
++    function getDescriptionByIssues(&$result)
++    {
++        $ids = array();
++        for ($i = 0; $i < count($result); $i++) {
++            $ids[] = $result[$i]["iss_id"];
++        }
++        $ids = implode(", ", $ids);
++
++        $stmt = "SELECT
++                    iss_id, iss_description
++                 FROM
++                    " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue
++                 WHERE
++                    iss_id in ($ids)";
++
++        $res = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
++        if (PEAR::isError($res)) {
++            Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
++        } else {
++            for ($i = 0; $i < count($result); $i++) {
++                @$result[$i]['iss_description'] = $res[$result[$i]['iss_id']];
++            }
++        }
++    }
++
++    /**
+      * Method used to get the details for a specific issue.
+      *
+      * @access  public
This page took 0.046462 seconds and 4 git commands to generate.