mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-6885-11172-añadir-opcion-de-nor-en-monitor-detail' into 'develop'
add not option in monitor detail filter See merge request artica/pandorafms!4112
This commit is contained in:
commit
8397f778b3
@ -436,6 +436,7 @@ function html_print_select_style($fields, $name, $selected='', $style='', $scrip
|
|||||||
* @param string $size Style, size (width) of element.
|
* @param string $size Style, size (width) of element.
|
||||||
* @param boolean $simple_multiple_options Discovery simple multiple inputs.
|
* @param boolean $simple_multiple_options Discovery simple multiple inputs.
|
||||||
* @param boolean $required Required input.
|
* @param boolean $required Required input.
|
||||||
|
* @param string $inverse Change All to None with inverse condition.
|
||||||
*
|
*
|
||||||
* @return string HTML code if return parameter is true.
|
* @return string HTML code if return parameter is true.
|
||||||
*/
|
*/
|
||||||
@ -462,7 +463,8 @@ function html_print_select_groups(
|
|||||||
$include_groups=false,
|
$include_groups=false,
|
||||||
$size=false,
|
$size=false,
|
||||||
$simple_multiple_options=false,
|
$simple_multiple_options=false,
|
||||||
$required=false
|
$required=false,
|
||||||
|
$inverse=''
|
||||||
) {
|
) {
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
@ -522,8 +524,12 @@ function html_print_select_groups(
|
|||||||
if (empty($selected) === false) {
|
if (empty($selected) === false) {
|
||||||
$fields = [ $selected => groups_get_name($selected) ];
|
$fields = [ $selected => groups_get_name($selected) ];
|
||||||
} else if ($returnAllGroup === true && $multiple === false) {
|
} else if ($returnAllGroup === true && $multiple === false) {
|
||||||
|
if ($selected === 0 && $inverse !== '') {
|
||||||
|
$fields = [ $selected => 'None' ];
|
||||||
|
} else {
|
||||||
$fields = [ $selected => groups_get_name(null, true) ];
|
$fields = [ $selected => groups_get_name(null, true) ];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
foreach ($selected as $k) {
|
foreach ($selected as $k) {
|
||||||
if ($k === null || $k === '') {
|
if ($k === null || $k === '') {
|
||||||
@ -595,7 +601,9 @@ function html_print_select_groups(
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('select[name="<?php echo $name; ?>"]').each(
|
$('select[name="<?php echo $name; ?>"]').each(
|
||||||
function() {
|
function() {
|
||||||
$(this).select2({
|
$(this).select2({
|
||||||
@ -625,6 +633,7 @@ function html_print_select_groups(
|
|||||||
inclusions: '<?php echo $json_inclusions; ?>',
|
inclusions: '<?php echo $json_inclusions; ?>',
|
||||||
step: params.page || 1,
|
step: params.page || 1,
|
||||||
strict: "<?php echo $strict_user; ?>",
|
strict: "<?php echo $strict_user; ?>",
|
||||||
|
not_condition: $('#not_condition_switch').prop('checked'),
|
||||||
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,7 +790,7 @@ function html_print_select(
|
|||||||
$required = 'required';
|
$required = 'required';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '<select '.$required.' id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
|
$output .= '<select '.$required.' onclick="'.$script.'" id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
|
||||||
|
|
||||||
if ($nothing !== false) {
|
if ($nothing !== false) {
|
||||||
if ($nothing != '' || empty($fields)) {
|
if ($nothing != '' || empty($fields)) {
|
||||||
|
@ -12,7 +12,6 @@ function parse_alert_command(command, classs) {
|
|||||||
// Only render values different from ''
|
// Only render values different from ''
|
||||||
var field = "_field" + nfield + "_";
|
var field = "_field" + nfield + "_";
|
||||||
var regex = new RegExp(field, "gi");
|
var regex = new RegExp(field, "gi");
|
||||||
console.log($(this).val());
|
|
||||||
if ($(this).val() == "") {
|
if ($(this).val() == "") {
|
||||||
if (
|
if (
|
||||||
classs == "fields_recovery" &&
|
classs == "fields_recovery" &&
|
||||||
|
@ -386,6 +386,7 @@ class Group extends Entity
|
|||||||
$search = get_parameter('search', '');
|
$search = get_parameter('search', '');
|
||||||
$step = get_parameter('step', 1);
|
$step = get_parameter('step', 1);
|
||||||
$limit = get_parameter('limit', false);
|
$limit = get_parameter('limit', false);
|
||||||
|
$not_condition = get_parameter('not_condition', false);
|
||||||
$exclusions = get_parameter('exclusions', '[]');
|
$exclusions = get_parameter('exclusions', '[]');
|
||||||
$inclusions = get_parameter('inclusions', '[]');
|
$inclusions = get_parameter('inclusions', '[]');
|
||||||
|
|
||||||
@ -430,6 +431,11 @@ class Group extends Entity
|
|||||||
|
|
||||||
$return = self::prepareGroups($groups);
|
$return = self::prepareGroups($groups);
|
||||||
|
|
||||||
|
// When not_condition is select firts option text change All to None.
|
||||||
|
if ($not_condition === 'true') {
|
||||||
|
$return[0]['text'] = 'None';
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($return) === false) {
|
if (is_array($return) === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user