From 03961a4bd7900b2cc5e4d5e1da888a1505378dfa Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 24 Jul 2006 21:59:57 +0000 Subject: [PATCH] r941: Making lots of changes to cope with the renaming of the tree PCV fields in bug. --- attachment.php | 14 ++++++------- editcomment.php | 10 ++++----- editreport.php | 26 ++++++++++++------------ favourite.php | 10 ++++----- newreport.php | 14 ++++++------- search.php | 10 ++++----- showhistory.php | 8 ++++---- showreport.php | 44 ++++++++++++++++++++-------------------- syndicate.php | 6 +++--- templates/showreport.tpl | 4 ++-- viewattachment.php | 4 ++-- vote.php | 2 +- 12 files changed, 76 insertions(+), 76 deletions(-) diff --git a/attachment.php b/attachment.php index f0a6cbb..ec50aed 100755 --- a/attachment.php +++ b/attachment.php @@ -63,7 +63,7 @@ if ($_POST['do'] == 'insert') $attachapi = new AttachmentAPI($bugsys); $attachapi->set('bugid', $bugsys->in['bugid']); - if (!can_perform('canputattach', $bug['productid'])) + if (!can_perform('canputattach', $bug['product'])) { $message->error_permission(); } @@ -132,7 +132,7 @@ if ($_POST['do'] == 'insert') } // handle comment stuff - if (can_perform('canpostcomments', $bug['productid']) AND trim($bugsys->in['comment'])) + if (can_perform('canpostcomments', $bug['product']) AND trim($bugsys->in['comment'])) { $comment = new CommentAPI($bugsys); $comment->set('bugid', $bugsys->in['bugid']); @@ -163,14 +163,14 @@ if ($_POST['do'] == 'insert') if ($_REQUEST['do'] == 'add') { - if (!can_perform('canputattach', $bug['productid'])) + if (!can_perform('canputattach', $bug['product'])) { $message->error_permission(); } $MAXFILESIZE = $funct->fetch_max_attachment_size(); - $show['addcomment'] = ((can_perform('canpostcomments', $bug['productid'])) ? true : false); + $show['addcomment'] = ((can_perform('canpostcomments', $bug['product'])) ? true : false); $show['obsoletes'] = false; $obsoletes_fetch = $db->query("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE bugid = $bug[bugid] AND !obsolete"); @@ -188,7 +188,7 @@ if ($_REQUEST['do'] == 'add') if ($_POST['do'] == 'update') { - if (!(can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['productid'])))) + if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) { $message->error_permission(); } @@ -220,12 +220,12 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'edit') { - if (!(can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['productid'])))) + if (!(can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product'])))) { $message->error_permission(); } - $show['delete'] = ((can_perform('caneditattach', $bug['productid'])) ? true : false); + $show['delete'] = ((can_perform('caneditattach', $bug['product'])) ? true : false); eval('$template->flush("' . $template->fetch('editattach') . '");'); } diff --git a/editcomment.php b/editcomment.php index 5138e96..47fbdb4 100644 --- a/editcomment.php +++ b/editcomment.php @@ -42,7 +42,7 @@ $comment =& $commentapi->objdata; $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]"); -if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) +if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['product'])) { $message->error_permissison(); } @@ -58,7 +58,7 @@ if (empty($_REQUEST['do'])) if ($_POST['do'] == 'kill') { - if (!can_perform('candeletedata', $bug['productid'])) + if (!can_perform('candeletedata', $bug['product'])) { $message->error_permission(); } @@ -72,7 +72,7 @@ if ($_POST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - if (!can_perform('candeletedata', $bug['productid'])) + if (!can_perform('candeletedata', $bug['product'])) { $message->error_permission(); } @@ -89,7 +89,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'update') { - if (!((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']))) + if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid']))) { $message->error_permission(); } @@ -149,7 +149,7 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'edit') { - if (!((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']))) + if (!((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid']))) { $message->error_permission(); } diff --git a/editreport.php b/editreport.php index 4e991be..512094d 100644 --- a/editreport.php +++ b/editreport.php @@ -47,7 +47,7 @@ if (!$bug) $message->error($lang->getlex('error_invalid_id')); } -if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) +if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['product'])) { $message->error_permission(); } @@ -65,11 +65,11 @@ $bugfields = array( 'status', 'severity', 'priority', - 'versionid' => 'version', + 'version' => 'version', 'assignedto' => 'assignto', 'resolution', - 'productid' => 'product', - 'componentid' => 'component' + 'product' => 'product', + 'component' => 'component' ); $notif = new NotificationCenter; @@ -84,7 +84,7 @@ $bugapi->fetch(); if ($_POST['do'] == 'kill') { - if (!can_perform('candeletedata', $bug['productid'])) + if (!can_perform('candeletedata', $bug['product'])) { $message->error_permission(); } @@ -98,7 +98,7 @@ if ($_POST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - if (!can_perform('candeletedata', $bug['productid'])) + if (!can_perform('candeletedata', $bug['product'])) { $message->error_permission(); } @@ -110,7 +110,7 @@ if ($_REQUEST['do'] == 'delete') if ($_POST['do'] == 'update') { - if (!((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['productid']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['productid'])) + if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) AND !can_perform('canpostcomments', $bug['product'])) { $message->error_permission(); } @@ -146,18 +146,18 @@ if ($_POST['do'] == 'update') $bugapi->set('severity', $bugsys->in['severity']); $bugapi->set('duplicateof', $bugsys->in['duplicateof']); $bugapi->set('dependency', $dependencies); - $bugapi->set('productid', $pcv['product']); - $bugapi->set('componentid', $pcv['component']); - $bugapi->set('versionid', $pcv['version']); + $bugapi->set('product', $pcv['product']); + $bugapi->set('component', $pcv['component']); + $bugapi->set('version', $pcv['version']); $bugapi->set('hidden', $bugsys->in['hidden']); - if (can_perform('canchangestatus', $bug['productid'])) + if (can_perform('canchangestatus', $bug['product'])) { $bugapi->set('priority', $bugsys->in['priority']); $bugapi->set('status', $bugsys->in['status']); $bugapi->set('resolution', $bugsys->in['resolution']); } - if (can_perform('canassign', $bug['productid'])) + if (can_perform('canassign', $bug['product'])) { $bugapi->set('assignedto', $bugsys->in['assignedto']); } @@ -196,7 +196,7 @@ if ($_POST['do'] == 'update') $bugapi->set('hiddenlastpostby', $bugsys->userinfo['userid']); $bugapi->set('hiddenlastpostbyname', $bugsys->userinfo['displayname']); - if (!((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['productid']) AND $bugsys->userinfo['userid'] != $bug['userid']))) + if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']))) { $bugapi->update(); $message->redirect($lang->string('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]"); diff --git a/favourite.php b/favourite.php index 0f3e8f2..65608ce 100644 --- a/favourite.php +++ b/favourite.php @@ -41,12 +41,12 @@ if ($_REQUEST['do'] == 'handle') { $bugsys->input_clean('bugid', TYPE_UINT); $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->in['bugid']); - if (!$bug OR (!can_perform('canviewhidden', $bug['productid']) AND $bug['hidden'])) + if (!$bug OR (!can_perform('canviewhidden', $bug['product']) AND $bug['hidden'])) { $message->error($lang->getlex('error_invalid_id')); } - if (!can_perform('cansubscribe', $bug['productid']) OR !can_perform('canviewbugs', $bug['productid'])) + if (!can_perform('cansubscribe', $bug['product']) OR !can_perform('canviewbugs', $bug['product'])) { $message->error_permission(); } @@ -77,14 +77,14 @@ if ($_REQUEST['do'] == 'manage') { $funct->exec_swap_bg($stylevar['alt_colour'], ''); $bug['bgcolour'] = ($bugsys->userinfo['showcolours'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $funct->bgcolour); - $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title']; - $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version']; + $bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title']; + $bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version']; $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity']; - $bug['hiddendisplay'] = ((!can_perform('canviewhidden', $bug['productid']) AND $bug['hiddenlastposttime']) ? true : false); + $bug['hiddendisplay'] = ((!can_perform('canviewhidden', $bug['product']) AND $bug['hiddenlastposttime']) ? true : false); $bug['lastposttime'] = ($bug['hiddendisplay'] ? $bug['hiddenlastposttime'] : $bug['lastposttime']); $bug['lastpost'] = ($bug['hiddendisplay'] ? $bug['hiddenlastpostbyname'] : $bug['lastpostbyname']); diff --git a/newreport.php b/newreport.php index f557006..2b52dc6 100755 --- a/newreport.php +++ b/newreport.php @@ -36,8 +36,8 @@ require_once('./includes/api_comment.php'); require_once('./includes/class_api_error.php'); APIError(array(new API_Error_Handler($message), 'user_cumulative')); -$bugsys->input_clean('productid', TYPE_UINT); -if (!can_perform('cansubmitbugs', $bugsys->in['productid'])) +$bugsys->input_clean('product', TYPE_UINT); +if (!can_perform('cansubmitbugs', $bugsys->in['product'])) { $message->error_permission(); } @@ -68,7 +68,7 @@ if ($_POST['do'] == 'insert') // ------------------------------------------------------------------- // check permissions on various input values - if (!can_perform('canchangestatus', $bugsys->in['productid'])) + if (!can_perform('canchangestatus', $bugsys->in['product'])) { $bug->set('priority', $bugsys->options['defaultpriority']); $bug->set('status', $bugsys->options['defaultstatus']); @@ -80,7 +80,7 @@ if ($_POST['do'] == 'insert') $bug->set('status', $bugsys->in['status']); $bug->set('resolution', $bugsys->in['resolution']); } - if (!can_perform('canassign', $bugsys->in['productid'])) + if (!can_perform('canassign', $bugsys->in['product'])) { $bug->set('assignedto', $bugsys->options['defaultassign']); } @@ -97,9 +97,9 @@ if ($_POST['do'] == 'insert') { $message->add_error($lang->string('Invalid product/component/version selected.')); } - $bug->set('productid', $pcv['product']); - $bug->set('componentid', $pcv['component']); - $bug->set('versionid', $pcv['version']); + $bug->set('product', $pcv['product']); + $bug->set('component', $pcv['component']); + $bug->set('version', $pcv['version']); if (!$message->items) { diff --git a/search.php b/search.php index 5de5eca..15e38cc 100644 --- a/search.php +++ b/search.php @@ -125,7 +125,7 @@ if ($_REQUEST['do'] == 'process') $components[] = $pcv['component']; $versions[] = $pcv['version']; } - $querybuild['pcv'] = "AND bug.productid IN (" . implode(',', $products) . ") AND bug.componentid IN (" . implode(',', $components) . ") AND bug.versionid IN (" . implode(',', $versions) . ")"; + $querybuild['pcv'] = "AND bug.product IN (" . implode(',', $products) . ") AND bug.component IN (" . implode(',', $components) . ") AND bug.version IN (" . implode(',', $versions) . ")"; } // ------------------------------------------------------------------- @@ -259,8 +259,8 @@ if ($_REQUEST['do'] == 'process') LEFT JOIN " . TABLE_PREFIX . "bugvaluefill AS bugfieldvalue ON (bug.bugid = bugfieldvalue.bugid) WHERE bug.bugid <> 0 - AND bug.productid IN (#<'ONBITS:VIEW'>#) - AND (!bug.hidden OR (bug.hidden AND bug.productid IN (#<'ONBITS:HIDDEN'>#))) + AND bug.product IN (#<'ONBITS:VIEW'>#) + AND (!bug.hidden OR (bug.hidden AND bug.product IN (#<'ONBITS:HIDDEN'>#))) " . implode("\n\t\t", $querybuild) . " GROUP BY bug.bugid $sortclause"; @@ -405,8 +405,8 @@ if ($_REQUEST['do'] == 'results') { $funct->exec_swap_bg($stylevar['alt_colour'], ''); $bug['bgcolour'] = ($bugsys->userinfo['showcolours'] ? $bugsys->datastore['status']["$bug[status]"]['color'] : $funct->bgcolour); - $bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title']; - $bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version']; + $bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title']; + $bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version']; $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status']; $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution']; $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; diff --git a/showhistory.php b/showhistory.php index 92b89c7..7ec0af1 100644 --- a/showhistory.php +++ b/showhistory.php @@ -37,7 +37,7 @@ if (!$bug) $message->error($lang->getlex('error_invalid_id')); } -if (($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) OR !can_perform('canviewbugs', $bug['productid'])) +if (($bug['hidden'] AND !can_perform('canviewhidden', $bug['product'])) OR !can_perform('canviewbugs', $bug['product'])) { $message->error_permission(); } @@ -47,10 +47,10 @@ $lookupfields = array( 'priority' => 'priority', 'secerity' => 'severity', 'resolution' => 'resolution', - 'versionid' => 'version', 'version' => 'version', - 'productid' => 'product', - 'componentid' => 'product' + 'version' => 'version', + 'product' => 'product', + 'component' => 'product' ); $lookupkeys = array_keys($lookupfields); diff --git a/showreport.php b/showreport.php index ca59cf9..775427a 100644 --- a/showreport.php +++ b/showreport.php @@ -71,20 +71,20 @@ $bug = $db->query_first(" WHERE bug.bugid = $bugid" ); -if (!can_perform('canviewbugs', $bug['productid'])) +if (!can_perform('canviewbugs', $bug['product'])) { $message->error_permission(); } -$show['edit'] = ((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['productid']) AND $bugsys->userinfo['userid'] != $bug['userid'])); -$show['delete'] = can_perform('candeletedata', $bug['productid']); +$show['edit'] = ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid'] AND $bug['userid'] != 0) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])); +$show['delete'] = can_perform('candeletedata', $bug['product']); if (!is_array($bug)) { $message->error($lang->getlex('error_invalid_id')); } -if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) +if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['product'])) { $message->error_permission(); } @@ -92,16 +92,16 @@ if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) // ################################################################### // global display items -$show['subscribe'] = can_perform('cansubscribe', $bug['productid']); +$show['subscribe'] = can_perform('cansubscribe', $bug['product']); $favourite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); $favouritetext = (($favourite) ? $lang->string('Remove from Favourites') : $lang->string('Add to Favourites')); $bug['userinfo'] = construct_user_display($bug); $bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']); -$bug['product'] = $bugsys->datastore['product']["$bug[productid]"]['title']; -$bug['component'] = (($bug['componentid']) ? $bugsys->datastore['product']["$bug[componentid]"]['title'] : ''); -$bug['version'] = $bugsys->datastore['version']["$bug[versionid]"]['version']; +$bug['product'] = $bugsys->datastore['product']["$bug[product]"]['title']; +$bug['component'] = (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] : ''); +$bug['version'] = $bugsys->datastore['version']["$bug[version]"]['version']; // ################################################################### // edit display @@ -109,8 +109,8 @@ if ($show['edit']) { $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', $bug['severity']); - $show['changestatus'] = ((can_perform('canchangestatus', $bug['productid'])) ? true : false); - if (can_perform('canchangestatus', $bug['productid'])) + $show['changestatus'] = ((can_perform('canchangestatus', $bug['product'])) ? true : false); + if (can_perform('canchangestatus', $bug['product'])) { $select['priority'] = construct_datastore_select('priority', 'priority', 'priorityid', $bug['priority']); $select['status'] = construct_datastore_select('status', 'status', 'statusid', $bug['status']); @@ -124,8 +124,8 @@ if ($show['edit']) $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority']; } - $show['assign'] = ((can_perform('canassign', $bug['productid'])) ? true : false); - if (can_perform('canassign', $bug['productid']) AND is_array($bugsys->datastore['assignto'])) + $show['assign'] = ((can_perform('canassign', $bug['product'])) ? true : false); + if (can_perform('canassign', $bug['product']) AND is_array($bugsys->datastore['assignto'])) { foreach ($bugsys->datastore['assignto'] AS $dev) { @@ -136,7 +136,7 @@ if ($show['edit']) } } - $pcv_select = construct_pcv_select('canviewbugs', "p$bug[productid]c$bug[componentid]v$bug[versionid]"); + $pcv_select = construct_pcv_select('canviewbugs', "p$bug[product]c$bug[component]v$bug[version]"); if ($bug['duplicateof']) { @@ -247,8 +247,8 @@ foreach ($words AS $word) // ------------------------------------------------------------------- // attachments -$show['getattachments'] = ((can_perform('cangetattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false); -$show['putattachments'] = ((can_perform('canputattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false); +$show['getattachments'] = ((can_perform('cangetattach', $bug['product']) OR can_perform('caneditattach', $bug['product'])) ? true : false); +$show['putattachments'] = ((can_perform('canputattach', $bug['product']) OR can_perform('caneditattach', $bug['product'])) ? true : false); $show['attachments'] = ($show['getattachments'] OR $show['putattachments']) ? true : false; if ($show['getattachments'] OR $show['putattachments']) @@ -269,7 +269,7 @@ if ($show['getattachments'] OR $show['putattachments']) while ($attachment = $db->fetch_array($attachments_fetch)) { $attaches = true; - $show['editattach'] = ((can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['productid']))) ? true : false); + $show['editattach'] = ((can_perform('caneditattach', $bug['product']) OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach', $bug['product']))) ? true : false); $attachment['date'] = $datef->format($bugsys->options['dateformat'], $attachment['dateline']); $attachment['user'] = construct_user_display($attachment, false); eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";'); @@ -295,7 +295,7 @@ else $vote['againstpercent'] = 0; } -$show['vote'] = ((can_perform('canvote', $bug['productid']) AND !$vote['uservote']) ? true : false); +$show['vote'] = ((can_perform('canvote', $bug['product']) AND !$vote['uservote']) ? true : false); // ------------------------------------------------------------------- // get comments @@ -304,7 +304,7 @@ $comments_fetch = $db->query(" FROM " . TABLE_PREFIX . "comment AS comment LEFT JOIN " . TABLE_PREFIX . "user AS user ON (comment.userid = user.userid) - WHERE comment.bugid = $bug[bugid]" . ((!can_perform('canviewhidden', $bug['productid'])) ? " + WHERE comment.bugid = $bug[bugid]" . ((!can_perform('canviewhidden', $bug['product'])) ? " AND !hidden" : '') . " ORDER BY comment.dateline ASC" ); @@ -312,10 +312,10 @@ while ($comment = $db->fetch_array($comments_fetch)) { $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']); $comment['postby'] = construct_user_display($comment); - $show['editcomment'] = ((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid'])); + $show['editcomment'] = ((can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid'])); - $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid'])); - $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid'])); + $bugsys->debug('can edit own replies: ' . (int)(can_perform('caneditownreply', $bug['product']) AND $bugsys->userinfo['userid'] == $comment['userid'])); + $bugsys->debug('can edit other replies:' . (int)(can_perform('caneditotherreply', $bug['product']) AND $bugsys->userinfo['userid'] != $comment['userid'])); $bugsys->debug('$show[editcomment]: ' . $show['editcomment']); if (is_array($hilight)) @@ -331,7 +331,7 @@ while ($comment = $db->fetch_array($comments_fetch)) eval('$comments .= "' . $template->fetch('showreport_comment') . '";'); } -$show['newreply'] = ((can_perform('canpostcomments', $bug['productid'])) ? true : false); +$show['newreply'] = ((can_perform('canpostcomments', $bug['product'])) ? true : false); $bug['summary_title'] = $bug['summary']; if (is_array($hilight) AND !$show['edit']) diff --git a/syndicate.php b/syndicate.php index 64bc35c..092280f 100644 --- a/syndicate.php +++ b/syndicate.php @@ -46,8 +46,8 @@ $lastupdated = 0; $buglist = array(); $bugs_fetch = $db->query(" SELECT * FROM " . TABLE_PREFIX . "bug - WHERE productid IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ") - AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . "))) + WHERE product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ") + AND (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . "))) ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "lastposttime" : "hiddenlastposttime") . " DESC LIMIT " . $bugsys->options['syndicateditems'] ); @@ -60,7 +60,7 @@ while ($bug = $db->fetch_array($bugs_fetch))
Severity: %5$s
'), $bug['bugid'], $bug['summary'], - $bugsys->datastore['product']["$bug[productid]"]['title'] . '/' . (($bug['componentid']) ? $bugsys->datastore['product']["$bug[componentid]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[versionid]"]['version'], + $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'], $bugsys->datastore['status']["$bug[status]"]['status'], $bugsys->datastore['severity']["$bug[severity]"]['severity'] ); diff --git a/templates/showreport.tpl b/templates/showreport.tpl index af839df..3304acf 100644 --- a/templates/showreport.tpl +++ b/templates/showreport.tpl @@ -53,9 +53,9 @@ $header {@"Product/Version"} $help[product]
- $bug[product] / $bug[component] / + $bug[product] / $bug[component] / - $bug[product] / $bug[component] / $bug[version] + $bug[product] / $bug[component] / $bug[version]
diff --git a/viewattachment.php b/viewattachment.php index 40fa6f1..c2a9fb4 100755 --- a/viewattachment.php +++ b/viewattachment.php @@ -34,12 +34,12 @@ if (!$attachment) } $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $attachment[bugid]"); -if (($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) OR !can_perform('canviewbugs', $bug['productid'])) +if (($bug['hidden'] AND !can_perform('canviewhidden', $bug['product'])) OR !can_perform('canviewbugs', $bug['product'])) { $message->error_permission(); } -if (!can_perform('cangetattach', $bug['productid'])) +if (!can_perform('cangetattach', $bug['product'])) { $message->error_permission(); } diff --git a/vote.php b/vote.php index 156fd0c..c2b0a70 100644 --- a/vote.php +++ b/vote.php @@ -39,7 +39,7 @@ if ($_REQUEST['do'] == 'vote') $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $bugsys->input_clean('bugid', TYPE_UINT) . ((!can_perform('canviewhidden')) ? " AND !hidden" : '')); $vote = $db->query_first("SELECT *, FIND_IN_SET(" . $bugsys->userinfo['userid'] . ", userids) AS uservote FROM " . TABLE_PREFIX . "vote WHERE bugid = $bug[bugid]"); - if (!can_perform('canvote', $bug['productid'])) + if (!can_perform('canvote', $bug['product'])) { $message->error_permission(); } -- 2.22.5