]>
src.bluestatic.org Git - bugdar.git/blob - syndicate.php
2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2002-2007 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 2 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->errorPermission();
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>' . T('Bug ID') . ':</strong></td>
63 <td>' . $bug['bugid'] . '</td>
66 <td><strong>' . T('Summary') . ':</strong></td>
67 <td>' . $bug['summary'] . '</td>
70 <td><strong>' . T('Product/Component/Version') . ':</strong></td>
71 <td>' . Bugdar::$datastore['product']["$bug[product
]"]['title'] . '/' . (($bug['component']) ? Bugdar::$datastore['product']["$bug[component
]"]['title'] . '/' : '') . Bugdar::$datastore['version']["$bug[version
]"]['version'] . '</td>
74 <td><strong>' . T('Status') . ':</strong></td>
75 <td>' . Bugdar::$datastore['status']["$bug[status
]"]['status'] . '</td>
78 <td><strong>' . T('Severity') . ':</strong></td>
79 <td>' . Bugdar::$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(T('%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>