2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 define('NO_TEMPLATES', 1);
24 require_once('./global.php');
26 if (in_array($bugsys->in
['type'], array('rss', 'atom')))
28 define('SYND_TYPE', $bugsys->in
['type']);
31 if (!defined('SYND_TYPE'))
33 define('SYND_TYPE', 'atom');
36 if (!can_perform('canviewbugs'))
38 $message->error_permission();
41 // ###################################################################
42 // get the syndicated items and prepare their content
44 $timestamp = (can_perform('canviewhidden', 0, fetch_guest_user()) ? 'lastposttime' : 'hiddenlastposttime');
47 $bugs_fetch = $db->query("
48 SELECT bug.*, comment.comment_parsed
49 FROM " . TABLE_PREFIX
. "bug
50 LEFT JOIN " . TABLE_PREFIX
. "comment
51 ON (bug.initialreport = comment.commentid)
52 WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
53 AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
54 ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC
55 LIMIT " . $bugsys->options
['syndicateditems']
57 while ($bug = $db->fetch_array($bugs_fetch))
59 $bug['storytext'] = htmlspecialchars(sprintf(
60 _('<table cellspacing="0" cellpadding="3" border="0">
62 <td><strong>Bug ID:</strong></td>
66 <td><strong>Summary:</strong></td>
70 <td><strong>Product/Component/Version:</strong></td>
74 <td><strong>Status:</strong></td>
78 <td><strong>Severity:</strong></td>
85 $bugsys->datastore
['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore
['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore
['version']["$bug[version]"]['version'],
86 $bugsys->datastore
['status']["$bug[status]"]['status'],
87 $bugsys->datastore
['severity']["$bug[severity]"]['severity'],
88 $bug['comment_parsed']
90 $buglist["$bug[bugid]"] = $bug;
91 $lastupdated = $bug["$timestamp"];
94 // ###################################################################
97 if (SYND_TYPE == 'atom')
99 header('Content-type: application/xml');
101 echo '<?xml version="1.0" encoding="utf
-8"?>
102 <feed xmlns="http
://www.w3.org/2005/Atom">
104 <title
>' . sprintf(_('%
1$s Syndication Feed
'), $bugsys->options['trackertitle
']) . '</title
>
105 <link href
="' . $bugsys->options['trackerurl'] . '"/>
106 <updated
>' . gmdate('Y
-m
-d\TH
:i
:s\Z
', $lastupdated) . '</updated
>
111 foreach ($buglist AS $bug)
115 <id
>' . $bugsys->options['trackertitle
'] . '/showreport
.php
?bugid
=' . $bug['bugid
'] . '</id
>
116 <title
>' . $bug['summary
'] . '</title
>
117 <updated
>' . gmdate('Y
-m
-d\TH
:i
:s\Z
', $bug["$timestamp"]) . '</updated
>
119 <name
>' . $bug['username
'] . '</name
>
121 <content type
="html">' . $bug['storytext
'] . '</content
>
122 <summary type
="text">' . htmlspecialchars($bug['comment_parsed
']) . '</summary
>
123 <link rel
="alternate" href
="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
135 // ###################################################################
138 else if (SYND_TYPE == 'rss
')
140 // not going to be implemented in 1.1 because I don't want to clutter the templates with multiple feed icons
and such
...
143 /*=====================================================================*\
144 || ###################################################################
147 || ###################################################################
148 \*=====================================================================*/