Don't add checkboxes if can't edit groups

pull/2715/head
Isaac Connor 2019-09-28 12:58:01 -04:00
parent 80e3922165
commit ec9e94b99d
1 changed files with 7 additions and 4 deletions

View File

@ -55,7 +55,9 @@ xhtmlHeaders(__FILE__, translate('Groups'));
<tr>
<th class="colName" colspan="<?php echo $max_depth+1 ?>"><?php echo translate('Name') ?></th>
<th class="colIds"><?php echo translate('Monitors') ?></th>
<?php if ( canEdit('Groups') ) { ?>
<th class="colSelect"><?php echo translate('Mark') ?></th>
<?php } ?>
</tr>
</thead>
<tbody>
@ -71,10 +73,11 @@ function group_line( $Group ) {
} else {
$html .= validHtmlStr($Group->Name());
}
$html .= '</td><td class="colIds">'. monitorIdsToNames($Group->MonitorIds(), 30).'</td>
<td class="colSelect"><input type="checkbox" name="gid[]" value="'. $Group->Id() .'" data-on-click-this="configureButtons"/></td>
</tr>
';
$html .= '</td><td class="colIds">'. monitorIdsToNames($Group->MonitorIds(), 30).'</td>';
if ( canEdit('Groups') ) {
$html .= '<td class="colSelect"><input type="checkbox" name="gid[]" value="'. $Group->Id() .'" data-on-click-this="configureButtons"/></td>';
}
$html .= '</tr>';
if ( isset( $children[$Group->Id()] ) ) {
foreach ( $children[$Group->Id()] as $G ) {
$html .= group_line($G);