mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Group selection review
This commit is contained in:
parent
5f4893ef1a
commit
5d63bc547e
@ -53,7 +53,28 @@ foreach ($groups as $id => $name) {
|
||||
|
||||
$row = [];
|
||||
$row[0] = __('Groups');
|
||||
$row[1] = html_print_select($groups, 'groups[]', $groups_selected, '', '', '', true, true, '', '', '');
|
||||
$row[1] = '<div class="w290px">'.html_print_select_groups(
|
||||
// Id_user.
|
||||
false,
|
||||
// Privilege.
|
||||
'AR',
|
||||
// ReturnAllGroup.
|
||||
true,
|
||||
// Name.
|
||||
'groups[]',
|
||||
// Selected.
|
||||
$groups_selected,
|
||||
// Script.
|
||||
'',
|
||||
// Nothing.
|
||||
'',
|
||||
// Nothing_value.
|
||||
0,
|
||||
// Return.
|
||||
true,
|
||||
// Multiple.
|
||||
true
|
||||
).'</div>';
|
||||
$table->data[] = $row;
|
||||
$table->colspan[][1] = 3;
|
||||
|
||||
|
@ -645,7 +645,7 @@ $table->data[0][1] = html_print_input_text(
|
||||
$disabled_in_execution
|
||||
);
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = html_print_select_groups(
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
@ -659,7 +659,7 @@ $table->data[1][1] = html_print_select_groups(
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
);
|
||||
).'</div>';
|
||||
$table->data[2][0] = __('Description');
|
||||
$table->data[2][1] = html_print_textarea(
|
||||
'description',
|
||||
|
@ -222,12 +222,14 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
||||
}
|
||||
|
||||
echo "<td style='width: 12%;'><b>".__('Group').'</b></td><td>';
|
||||
echo '<div class="w250px">';
|
||||
if ($id_container === '1') {
|
||||
echo html_print_select_groups($config['id_user'], '', $return_all_groups, 'container_id_group', $id_group, '', '', '', true, false, true, '', true);
|
||||
} else {
|
||||
echo html_print_select_groups($config['id_user'], '', $return_all_groups, 'container_id_group', $id_group, '', '', '', true, false, true, '', false);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</td></tr>';
|
||||
|
||||
echo '<tr>';
|
||||
@ -500,7 +502,7 @@ if ($edit_container) {
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Group');
|
||||
$data[1] = html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true);
|
||||
$data[1] = '<div class="w250px">'.html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true).'</div>';
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -1146,7 +1146,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Monday')."<br>";
|
||||
echo __('Monday').'<br>';
|
||||
html_print_checkbox_switch('monday', 1, $monday);
|
||||
?>
|
||||
</p>
|
||||
@ -1154,7 +1154,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Tuesday')."<br>";
|
||||
echo __('Tuesday').'<br>';
|
||||
html_print_checkbox_switch('tuesday', 1, $tuesday);
|
||||
?>
|
||||
</p>
|
||||
@ -1162,7 +1162,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Wednesday')."<br>";
|
||||
echo __('Wednesday').'<br>';
|
||||
html_print_checkbox_switch('wednesday', 1, $wednesday);
|
||||
?>
|
||||
</p>
|
||||
@ -1170,7 +1170,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Thursday')."<br>";
|
||||
echo __('Thursday').'<br>';
|
||||
html_print_checkbox_switch('thursday', 1, $thursday);
|
||||
?>
|
||||
</p>
|
||||
@ -1178,7 +1178,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Friday')."<br>";
|
||||
echo __('Friday').'<br>';
|
||||
html_print_checkbox_switch('friday', 1, $friday);
|
||||
?>
|
||||
</p>
|
||||
@ -1186,7 +1186,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Saturday')."<br>";
|
||||
echo __('Saturday').'<br>';
|
||||
html_print_checkbox_switch('saturday', 1, $saturday);
|
||||
?>
|
||||
</p>
|
||||
@ -1194,7 +1194,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Sunday')."<br>";
|
||||
echo __('Sunday').'<br>';
|
||||
html_print_checkbox_switch('sunday', 1, $sunday);
|
||||
?>
|
||||
</p>
|
||||
@ -1260,6 +1260,7 @@ $class = 'databox filters';
|
||||
<td style="font-weight:bold;"><?php echo __('Group'); ?></td>
|
||||
<td style="">
|
||||
<?php
|
||||
echo '<div class="w250px inline padding-right-2-imp">';
|
||||
if (check_acl($config['id_user'], 0, 'RW')) {
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
@ -1280,6 +1281,8 @@ $class = 'databox filters';
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo ' '.__('Recursion').' '.html_print_checkbox_switch(
|
||||
'recursion',
|
||||
1,
|
||||
@ -2117,7 +2120,8 @@ $class = 'databox filters';
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td><?php
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'fullscale',
|
||||
1,
|
||||
@ -2194,7 +2198,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Total time')."<br>";
|
||||
echo __('Total time').'<br>';
|
||||
html_print_checkbox_switch('total_time', 1, $total_time);
|
||||
?>
|
||||
</p>
|
||||
@ -2202,7 +2206,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Time failed')."<br>";
|
||||
echo __('Time failed').'<br>';
|
||||
html_print_checkbox_switch('time_failed', 1, $time_failed);
|
||||
?>
|
||||
</p>
|
||||
@ -2210,7 +2214,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Time in OK status')."<br>";
|
||||
echo __('Time in OK status').'<br>';
|
||||
html_print_checkbox_switch('time_in_ok_status', 1, $time_in_ok_status);
|
||||
?>
|
||||
</p>
|
||||
@ -2218,7 +2222,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Time in unknown status')."<br>";
|
||||
echo __('Time in unknown status').'<br>';
|
||||
html_print_checkbox_switch(
|
||||
'time_in_unknown_status',
|
||||
1,
|
||||
@ -2230,7 +2234,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Time of not initialized module')."<br>";
|
||||
echo __('Time of not initialized module').'<br>';
|
||||
html_print_checkbox_switch(
|
||||
'time_of_not_initialized_module',
|
||||
1,
|
||||
@ -2242,7 +2246,7 @@ $class = 'databox filters';
|
||||
<td>
|
||||
<p style="margin-right:30px;">
|
||||
<?php
|
||||
echo __('Time of downtime')."<br>";
|
||||
echo __('Time of downtime').'<br>';
|
||||
html_print_checkbox_switch('time_of_downtime', 1, $time_of_downtime);
|
||||
?>
|
||||
</p>
|
||||
|
@ -92,7 +92,16 @@ $table->data['group'][0] = __('Group');
|
||||
$write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_grupo');
|
||||
|
||||
|
||||
html_print_select_groups(
|
||||
|
||||
|
||||
|
||||
// If the report group is not among the RW groups (special permission) we add it
|
||||
if (!isset($write_groups[$idGroupReport]) && $idGroupReport) {
|
||||
$write_groups[$idGroupReport] = groups_get_name($idGroupReport);
|
||||
}
|
||||
|
||||
$table->data['group'][1] = '<div class="w290px inline">';
|
||||
$table->data['group'][1] .= html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'AR',
|
||||
true,
|
||||
@ -103,24 +112,7 @@ $write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
// If the report group is not among the RW groups (special permission) we add it
|
||||
if (!isset($write_groups[$idGroupReport]) && $idGroupReport) {
|
||||
$write_groups[$idGroupReport] = groups_get_name($idGroupReport);
|
||||
}
|
||||
|
||||
$table->data['group'][1] = html_print_select(
|
||||
$write_groups,
|
||||
'id_group',
|
||||
$idGroupReport,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$table->data['group'][1] .= '</div>';
|
||||
|
||||
if ($report_id_user == $config['id_user']
|
||||
|| is_user_admin($config['id_user'])
|
||||
@ -147,8 +139,9 @@ $write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_
|
||||
$style = '';
|
||||
}
|
||||
|
||||
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">
|
||||
'.html_print_select_groups(
|
||||
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">';
|
||||
$table->data['access'][1] .= '<div class="w290px inline">';
|
||||
$table->data['access'][1] .= html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
false,
|
||||
@ -158,8 +151,9 @@ $write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).'
|
||||
</span>';
|
||||
);
|
||||
$table->data['access'][1] .= '</div>';
|
||||
$table->data['access'][1] .= '</span>';
|
||||
}
|
||||
|
||||
if ($enterpriseEnable) {
|
||||
@ -200,14 +194,11 @@ $write_groups = users_get_groups_for_select(false, 'AR', true, true, false, 'id_
|
||||
<script type="text/javascript">
|
||||
function change_type_access(select_item) {
|
||||
$(".access_subform").hide();
|
||||
switch ($(select_item).val()) {
|
||||
case 'group_view':
|
||||
break;
|
||||
case 'group_edit':
|
||||
$("#group_edit").show();
|
||||
break;
|
||||
case 'user_edit':
|
||||
break;
|
||||
if ($(select_item).val() == "group_edit") {
|
||||
$("#group_edit").show()
|
||||
} else {
|
||||
$("#group_edit").hide()
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
@ -493,7 +493,7 @@ function html_print_select_groups(
|
||||
if (is_array($selected) === false) {
|
||||
if (empty($selected) === false) {
|
||||
$fields = [ $selected => groups_get_name($selected) ];
|
||||
} else if ($returnAllGroup === true) {
|
||||
} else if ($returnAllGroup === true && $multiple === false) {
|
||||
$fields = [ $selected => groups_get_name(null, true) ];
|
||||
}
|
||||
} else {
|
||||
@ -551,6 +551,8 @@ function html_print_select_groups(
|
||||
$('select[name="<?php echo $name; ?>"]').each(
|
||||
function() {
|
||||
$(this).select2({
|
||||
multiple: <?php echo ($multiple) ? 'true' : 'false'; ?>,
|
||||
placeholder: "<?php echo __('Please select...'); ?>",
|
||||
debug: 0,
|
||||
width: '<?php echo $size; ?>',
|
||||
templateResult: function(node) {
|
||||
@ -582,6 +584,14 @@ function html_print_select_groups(
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
<?php
|
||||
if (empty($fields) === true) {
|
||||
?>
|
||||
$('select[name="<?php echo $name; ?>"]').val(null).trigger("change");
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -461,6 +461,10 @@ select:-internal-list-box {
|
||||
width: 250px;
|
||||
max-width: 250px;
|
||||
}
|
||||
.w290px {
|
||||
width: 290px;
|
||||
max-width: 290px;
|
||||
}
|
||||
.mw120px {
|
||||
min-width: 120px;
|
||||
}
|
||||
|
@ -37,9 +37,11 @@ if (! check_acl($config['id_user'], 0, 'ER') && ! check_acl($config['id_user'],
|
||||
}
|
||||
|
||||
$agents = agents_get_group_agents(0, false, 'none', false, true);
|
||||
|
||||
ob_start('ui_process_page_head');
|
||||
ob_start();
|
||||
echo '<html>';
|
||||
echo '<head>';
|
||||
|
||||
echo '<title>'.__('Sound Events').'</title>';
|
||||
?>
|
||||
<style type='text/css'>
|
||||
@ -100,8 +102,6 @@ $table->data[0][3] .= html_print_image('images/tick_sound_events.png', true, ['i
|
||||
html_print_table($table);
|
||||
?>
|
||||
|
||||
<script src="../../include/javascript/jquery.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var group = 0;
|
||||
var alert_fired = true;
|
||||
@ -265,5 +265,11 @@ $(document).ready (function () {
|
||||
|
||||
<?php
|
||||
echo '</body>';
|
||||
|
||||
while (@ob_end_flush()) {
|
||||
// Dumping...
|
||||
continue;
|
||||
}
|
||||
|
||||
echo '</html>';
|
||||
|
||||
|
@ -338,12 +338,14 @@ if ((check_acl($config['id_user'], $id_grupo, 'IM') == 1) or ($usuario == $confi
|
||||
echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
|
||||
|
||||
// Group combo
|
||||
echo '<div class="w250px">';
|
||||
if ((check_acl($config['id_user'], $id_grupo, 'IM') == 1) or ($usuario == $config['id_user'])) {
|
||||
html_print_select_groups($config['id_user'], 'IR', true, 'grupo_form', $id_grupo, '', '', '', false, false, false, 'w135');
|
||||
} else {
|
||||
html_print_select_groups($config['id_user'], 'IR', true, 'grupo_form', $id_grupo, '', '', '', false, false, true, 'w135', true);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="datos">';
|
||||
|
||||
if ((check_acl($config['id_user'], $id_grupo, 'IM') == 1) or ($usuario == $config['id_user'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user