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('SVN', '$Id$');
24 $focus['showreport
'] = 'focus
';
26 require_once('./global.php
');
28 // ###################################################################
30 if (empty($_REQUEST['do']))
32 $message->error($lang->getlex('error_invalid_id
'));
35 // ###################################################################
37 if ($_REQUEST['do'] == 'handle
')
39 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . intval($bugsys->in['bugid
']));
40 if (!$bug OR (!can_perform('canviewhidden
', $bug['productid
']) AND $bug['hidden
']))
42 $message->error($lang->getlex('error_invalid_id
'));
45 if (!can_perform('cansubscribe
', $bug['productid
']) OR !can_perform('canviewbugs
', $bug['productid
']))
47 $message->error_permission();
50 if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid
'] . " AND bugid = " . intval($bugsys->in['bugid
'])))
52 $db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid
'] . " AND bugid = " . intval($bugsys->in['bugid
']));
53 $message->redirect($lang->string('This bug has been removed from your favourites
list.'), "showreport.php?bugid=" . intval($bugsys->in['bugid
']));
57 $db->query("INSERT INTO " . TABLE_PREFIX . "favourite (userid, bugid) VALUES (" . $bugsys->userinfo['userid
'] . ", " . intval($bugsys->in['bugid
']) . ")");
58 $message->redirect($lang->string('This bug has been added to your favourites
list.'), "showreport.php?bugid=" . intval($bugsys->in['bugid
']));
62 /*=====================================================================*\
63 || ###################################################################
66 || ###################################################################
67 \*=====================================================================*/