Skip to content

Commit

Permalink
Allow setting reminder view status
Browse files Browse the repository at this point in the history
If reminders are stored as bugnotes, display a checkbox allowing user
to set the view status. If user does not have the necessary permissions
($g_set_view_sattus_threshold), just display the default view status.

Fixes #10107
  • Loading branch information
dregad committed Sep 3, 2019
1 parent 67f20fe commit f131121
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bug_reminder.php
Expand Up @@ -59,7 +59,7 @@

$f_bug_id = gpc_get_int( 'bug_id' );
$f_to = gpc_get_int_array( 'to' );
$f_body = gpc_get_string( 'body' );
$f_body = gpc_get_string( 'bugnote_text' );

$t_bug = bug_get( $f_bug_id, true );
if( $t_bug->project_id != helper_get_current_project() ) {
Expand Down
44 changes: 41 additions & 3 deletions bug_reminder_page.php
Expand Up @@ -85,7 +85,42 @@
<div class="widget-body">
<div class="widget-main no-padding">
<div class="table-responsive">

<table class="table table-bordered table-condensed table-striped">
<?php
$t_store_reminders = ON == config_get( 'store_reminders' );

# Only display view status checkbox/info if reminders are stored as bugnotes
if( $t_store_reminders ) {
$t_default_reminder_view_status = config_get( 'default_reminder_view_status' );
$t_bugnote_class = $t_default_reminder_view_status == VS_PRIVATE
? 'bugnote-private'
: '';
?>
<tr>
<th class="category">
<?php echo lang_get( 'view_status' ) ?>
</th>
<td></td>
<td>
<?php
if( access_has_bug_level( config_get( 'set_view_status_threshold' ), $f_bug_id ) ) {
?>
<input type="checkbox" id="bugnote_add_view_status" class="ace" name="private"
<?php check_checked( $t_default_reminder_view_status, VS_PRIVATE ); ?> />
<label class="lbl padding-6" for="bugnote_add_view_status"><?php echo lang_get( 'private' ) ?></label>
<?php
} else {
echo get_enum_element( 'view_state', $t_default_reminder_view_status );
}
?>
</td>
</tr>
<?php
} else {
$t_bugnote_class = '';
}
?>
<tr>
<th class="category">
<?php echo lang_get( 'to' ) ?>
Expand All @@ -107,10 +142,12 @@
</select>
</td>
<td class="center">
<textarea class="form-control" name="body" cols="65" rows="10"></textarea>
<textarea name="bugnote_text" cols="65" rows="10"
class="form-control <?php echo $t_bugnote_class; ?>"></textarea>
</td>
</tr>
</tr>
</table>

</div>
</div>
<div class="widget-toolbox padding-8 clearfix">
Expand All @@ -119,14 +156,15 @@
</div>
</div>
</form>
<br>
<div class="alert alert-info">
<p><i class="fa fa-info-circle fa-lg"> </i>
<?php
echo lang_get( 'reminder_explain' ) . ' ';
if( ON == config_get( 'reminder_recipients_monitor_bug' ) ) {
echo lang_get( 'reminder_monitor' ) . ' ';
}
if( ON == config_get( 'store_reminders' ) ) {
if( $t_store_reminders ) {
echo lang_get( 'reminder_store' );
}

Expand Down

0 comments on commit f131121

Please sign in to comment.