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 boolean $simple_multiple_options Discovery simple multiple inputs.
|
||||
* @param boolean $required Required input.
|
||||
* @param string $inverse Change All to None with inverse condition.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
|
@ -462,7 +463,8 @@ function html_print_select_groups(
|
|||
$include_groups=false,
|
||||
$size=false,
|
||||
$simple_multiple_options=false,
|
||||
$required=false
|
||||
$required=false,
|
||||
$inverse=''
|
||||
) {
|
||||
$output = '';
|
||||
|
||||
|
@ -522,7 +524,11 @@ function html_print_select_groups(
|
|||
if (empty($selected) === false) {
|
||||
$fields = [ $selected => groups_get_name($selected) ];
|
||||
} else if ($returnAllGroup === true && $multiple === false) {
|
||||
$fields = [ $selected => groups_get_name(null, true) ];
|
||||
if ($selected === 0 && $inverse !== '') {
|
||||
$fields = [ $selected => 'None' ];
|
||||
} else {
|
||||
$fields = [ $selected => groups_get_name(null, true) ];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($selected as $k) {
|
||||
|
@ -595,7 +601,9 @@ function html_print_select_groups(
|
|||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('select[name="<?php echo $name; ?>"]').each(
|
||||
function() {
|
||||
$(this).select2({
|
||||
|
@ -625,6 +633,7 @@ function html_print_select_groups(
|
|||
inclusions: '<?php echo $json_inclusions; ?>',
|
||||
step: params.page || 1,
|
||||
strict: "<?php echo $strict_user; ?>",
|
||||
not_condition: $('#not_condition_switch').prop('checked'),
|
||||
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
||||
}
|
||||
|
||||
|
@ -781,7 +790,7 @@ function html_print_select(
|
|||
$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 != '' || empty($fields)) {
|
||||
|
|
|
@ -12,7 +12,6 @@ function parse_alert_command(command, classs) {
|
|||
// Only render values different from ''
|
||||
var field = "_field" + nfield + "_";
|
||||
var regex = new RegExp(field, "gi");
|
||||
console.log($(this).val());
|
||||
if ($(this).val() == "") {
|
||||
if (
|
||||
classs == "fields_recovery" &&
|
||||
|
|
|
@ -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', false);
|
||||
$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 === 'true') {
|
||||
$return[0]['text'] = 'None';
|
||||
}
|
||||
|
||||
if (is_array($return) === false) {
|
||||
return;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue