2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
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 * FROM " . TABLE_PREFIX
. "bug
49 WHERE productid IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
50 AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
51 ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "lastposttime" : "hiddenlastposttime") . " DESC
52 LIMIT " . $bugsys->options
['syndicateditems']
54 while ($bug = $db->fetch_array($bugs_fetch))
56 $bug['storytext'] = sprintf($lang->string('<div><strong>Bug ID:</strong> %1$s</div>
57 <div><strong>Summary:</strong> %2$s</div>
58 <div><strong>Product/Component/Version:</strong> %3$s</div>
59 <div><strong>Status:</strong> %4$s</div>
60 <div><strong>Severity:</strong> %5$s</div>'),
63 $bugsys->datastore
['product']["$bug[productid]"]['title'] . '/' . (($bug['componentid']) ? $bugsys->datastore
['product']["$bug[componentid]"]['title'] . '/' : '') . $bugsys->datastore
['version']["$bug[versionid]"]['version'],
64 $bugsys->datastore
['status']["$bug[status]"]['status'],
65 $bugsys->datastore
['severity']["$bug[severity]"]['severity']
67 $buglist["$bug[bugid]"] = $bug;
68 $lastupdated = $bug["$timestamp"];
71 // ###################################################################
74 if (SYND_TYPE == 'atom')
76 $feed = '<?xml version="1.0" encoding="utf
-8"?>
77 <feed xmlns="http
://www.w3.org/2005/Atom">
79 <title
>' . sprintf($lang->string('%
1$s Syndication Feed
'), $bugsys->options['trackertitle
']) . '</title
>
80 <link href
="' . $bugsys->options['trackerurl'] . '"/>
81 <updated
>' . gmdate('Y
-m
-d\TH
:i
:s\Z
', $lastupdated) . '</updated
>
86 foreach ($buglist AS $bug)
90 <id
>' . $bugsys->options['trackertitle
'] . '/showreport
.php
?bugid
=' . $bug['bugid
'] . '</id
>
91 <title
>' . $bug['summary
'] . '</title
>
92 <updated
>' . gmdate('Y
-m
-d\TH
:i
:s\Z
', $bug["$timestamp"]) . '</updated
>
94 <name
>' . $bug['username
'] . '</name
>
96 <content
>' . $bug['storytext
'] . '</content
>
98 <!-- firstreport goes here
-->
100 <link rel
="alternate" href
="' . $bugsys->options['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
109 header('Content
-type
: application
/xml
');
115 // ###################################################################
118 else if (SYND_TYPE == 'rss
')
120 // not going to be implemented in 1.1 because I don't want to clutter the templates with multiple feed icons
and such
...
123 /*=====================================================================*\
124 || ###################################################################
127 || ###################################################################
128 \*=====================================================================*/