]>
src.bluestatic.org Git - bugdar.git/blob - syndicate.php
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 (!can_perform('canviewbugs'))
28 $message->error_permission();
31 // ###################################################################
33 header('Content-type: application/xml');
36 $timestamp = (can_perform('canviewhidden', 0, fetch_guest_user()) ? 'lastposttime' : 'hiddenlastposttime');
39 $bugs_fetch = $db->query("
40 SELECT bug.*, comment.comment_parsed
41 FROM " . TABLE_PREFIX
. "bug AS bug
42 LEFT JOIN " . TABLE_PREFIX
. "comment AS comment
43 ON (bug.initialreport = comment.commentid)
44 WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
45 AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
46 ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC
47 LIMIT " . $bugsys->options
['syndicateditems']
49 while ($bug = $db->fetch_array($bugs_fetch))
53 <id>bug://report/' . $bug['bugid'] . '</id>
54 <title>' . $bug['summary'] . '</title>
55 <updated>' . gmdate('Y-m-d\TH:i:s\Z', $bug["$timestamp"]) . '</updated>
57 <name>' . $bug['username'] . '</name>
60 ' . htmlspecialchars('<table cellspacing="0" cellpadding="3" border="0">
62 <td><strong>' . _('Bug ID') . ':</strong></td>
63 <td>' . $bug['bugid'] . '</td>
66 <td><strong>' . _('Summary') . ':</strong></td>
67 <td>' . $bug['summary'] . '</td>
70 <td><strong>' . _('Product/Component/Version') . ':</strong></td>
71 <td>' . $bugsys->datastore['product']["$bug[product
]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component
]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version
]"]['version'] . '</td>
74 <td><strong>' . _('Status') . ':</strong></td>
75 <td>' . $bugsys->datastore['status']["$bug[status
]"]['status'] . '</td>
78 <td><strong>' . _('Severity') . ':</strong></td>
79 <td>' . $bugsys->datastore['severity']["$bug[severity
]"]['severity'] . '</td>
82 <p>' . $bug['comment_parsed'] . '</p>') . '
84 <summary type="text
">' . htmlspecialchars($bug['comment_parsed']) . '</summary>
85 <link rel="alternate
" href="' . $bugsys->options['trackerurl
'] . '/showreport
.php
?bugid
=' . $bug['bugid
'] . '"/>
88 $lastupdated = $bug["$timestamp"];
91 echo '<?xml version="1.0" encoding="' . $language['charset'] . '"?>
92 <feed xmlns="http://www.w3.org/2005/Atom">
94 <title>' . sprintf(_('%1$s Syndication Feed'), $bugsys->options
['trackertitle']) . '</title>
95 <link href="' . $bugsys->options
['trackerurl'] . '"/>
96 <updated>' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . '</updated>
108 /*=====================================================================*\
109 || ###################################################################
112 || ###################################################################
113 \*=====================================================================*/