- Splt caneditinfo into two permissions: caneditotherreply and caneditownreply for comment editing
$lang->string('Moderation/Managment Permissions') => array(
'caneditown' => $lang->string('Can Edit Own Bugs'),
- 'caneditothers' => $lang->string('Can Edit Others\' Bugs'),
- 'caneditinfo' => $lang->string('Can Edit Bug Information'),
+ 'caneditother' => $lang->string('Can Edit Others\' Bugs'),
+ 'caneditownreply' => $lang->string('Can Edit Own Comments'),
+ 'caneditotherreply' => $lang->string('Can Edit Others\' Comments'),
'canassign' => $lang->string('Can Assign Bugs'),
'canchangestatus' => $lang->string('Can Change Status')
)
$lang->string('Moderation/Managment Permissions') => array(
'caneditown' => $lang->string('Can Edit Own Bugs'),
- 'caneditothers' => $lang->string('Can Edit Others\' Bugs'),
- 'caneditinfo' => $lang->string('Can Edit Bug Information'),
+ 'caneditother' => $lang->string('Can Edit Others\' Bugs'),
+ 'caneditownreply' => $lang->string('Can Edit Own Comments'),
+ 'caneditotherreply' => $lang->string('Can Edit Others\' Comments'),
'canassign' => $lang->string('Can Assign Bugs'),
'canchangestatus' => $lang->string('Can Change Status')
),
$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]");
-if (!((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers', $bug['productid'])))
+if (!((can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR (can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid'])))
{
$message->error_permission();
}
WHERE bug.bugid = " . intval($bugsys->in['bugid'])
);
-if (!(((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers', $bug['productid'])) AND can_perform('caneditinfo', $bug['productid'])) AND !can_perform('canpostcomments', $bug['productid']))
+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']))
{
$message->error_permission();
}
{
// -------------------------------------------------------------------
// process comment stuff
- if (!(((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers', $bug['productid'])) AND can_perform('caneditinfo', $bug['productid'])))
+ if (!(((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditother', $bug['productid'])) AND can_perform('caneditownreply', $bug['productid'])))
{
$hascomment = (!empty($bugsys->in['comment'])) ? true : false;
}
}
- if (!(((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers', $bug['productid'])) AND can_perform('caneditinfo', $bug['productid'])))
+ if (!(((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditother', $bug['productid'])) AND can_perform('caneditownreply', $bug['productid'])))
{
$message->redirect($lang->string('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]");
}
'canpostcomments' => 32, // can post new comments
'cangetattach' => 64, // can dl attachments
'canputattach' => 128, // can ul attachments
- 'caneditown' => 256, // can edit own comments
- 'caneditothers' => 512, // can edit others' comments
- 'caneditinfo' => 1024, // can edit bug info -- works in conjunction with canedit(own|others)
+ 'caneditown' => 256, // can edit own bugs
+ 'caneditother' => 512, // can edit others' bugs
+ 'caneditownreply' => 1024, // can edit own comments
'canassign' => 2048, // can assign bug
'canchangestatus' => 4096, // can change bug status
'canadminpanel' => 8192, // can view admin panel
'canadminfields' => 524288, // can admin custom bug fields
'canbeassignedto' => 1048576, // can be assigned bugs,
'caneditattach' => 2097152, // can edit attachments
- 'canviewhidden' => 4194304 // can see hidden bugs
+ 'canviewhidden' => 4194304, // can see hidden bugs
+ 'caneditotherreply' => 8388608 // can edit other peoples' comments
);
foreach ($_PERMISSION AS $name => $maskvalue)
$message->error_permission();
}
-$show['edit'] = (((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR can_perform('caneditothers', $bug['productid'])) AND can_perform('caneditinfo', $bug['productid'])) ? true : false;
+$show['edit'] = ((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['productid']) AND $bugsys->userinfo['userid'] != $bug['userid']));
if (!is_array($bug))
{
$select['status'] = construct_datastore_select('status', 'status', 'statusid', $bug['status']);
$select['resolution'] = construct_datastore_select('resolution', 'resolution', 'resolutionid', $bug['resolution']);
}
+ else
+ {
+ $bug['status'] = $bugsys->datastore['status']["$bug[status]"]['status'];
+ $bug['resolution'] = $bugsys->datastore['resolution']["$bug[resolution]"]['resolution'];
+ $bug['severity'] = $bugsys->datastore['severity']["$bug[severity]"]['severity'];
+ $bug['priority'] = $bugsys->datastore['priority']["$bug[priority]"]['priority'];
+ }
$show['assign'] = ((can_perform('canassign', $bug['productid'])) ? true : false);
if (can_perform('canassign', $bug['productid']))
{
$comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']);
$comment['postby'] = construct_user_display($comment);
- $show['editcomment'] = (((can_perform('caneditown', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers', $bug['productid'])) ? true : false);
+ $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']));
+
+ $bugsys->debug((int)(can_perform('caneditownreply', $bug['productid']) AND $bugsys->userinfo['userid'] == $comment['userid']));
+ $bugsys->debug((int)(can_perform('caneditotherreply', $bug['productid']) AND $bugsys->userinfo['userid'] != $comment['userid']));
+ $bugsys->debug($show['editcomment']);
if (is_array($hilight))
{
$comment[comment_parsed]
</div>
- <if condition="$show['edit']">
+ <if condition="$show['editcomment']">
<div class="box-foot">
<span style="float: right">
[<a href="editcomment.php?commentid=$comment[commentid]">{@"Edit Comment"}</a>]