set first option select2 all to none if not condition is enabled
This commit is contained in:
parent
61409b72b4
commit
4d270a3559
|
@ -631,6 +631,7 @@ function html_print_select_groups(
|
|||
inclusions: '<?php echo $json_inclusions; ?>',
|
||||
step: params.page || 1,
|
||||
strict: "<?php echo $strict_user; ?>",
|
||||
not_condition: "<?php echo $inverse; ?>",
|
||||
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
||||
}
|
||||
|
||||
|
|
|
@ -386,6 +386,7 @@ class Group extends Entity
|
|||
$search = get_parameter('search', '');
|
||||
$step = get_parameter('step', 1);
|
||||
$limit = get_parameter('limit', false);
|
||||
$not_condition = get_parameter('not_condition', '');
|
||||
$exclusions = get_parameter('exclusions', '[]');
|
||||
$inclusions = get_parameter('inclusions', '[]');
|
||||
|
||||
|
@ -430,6 +431,11 @@ class Group extends Entity
|
|||
|
||||
$return = self::prepareGroups($groups);
|
||||
|
||||
// When not_condition is select firts option text change All to None.
|
||||
if ($not_condition === 'on') {
|
||||
$return[0]['text'] = 'None';
|
||||
}
|
||||
|
||||
if (is_array($return) === false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1954,7 +1954,6 @@ $table->data[4][0] .= __('Not condition');
|
|||
<script type="text/javascript">
|
||||
|
||||
if(!document.getElementById('not_condition_switch').checked){
|
||||
console.log("pepe");
|
||||
document.getElementById("select2-ag_group-container").innerHTML = "None";
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue