@@ -402,7 +402,7 @@ function tholds() {
402402 if (get_request_var ('thold_template_id ' ) > 0 ) {
403403 $ sql_where .= ($ sql_where == '' ? '( ' : ' AND ' ) . '(td.thold_template_id = ' . get_request_var ('thold_template_id ' ) . ' AND td.template_enabled = "on") ' ;
404404 } elseif (get_request_var ('thold_template_id ' ) == '-2 ' ) {
405- $ sql_where .= ($ sql_where == '' ? '( ' : ' AND ' ) . '(td.template_enabled = "off" || td.template_enabled = " ") ' ;
405+ $ sql_where .= ($ sql_where == '' ? '( ' : ' AND ' ) . '(td.template_enabled ! = "on ") ' ;
406406 }
407407 }
408408
@@ -614,8 +614,8 @@ function tholds() {
614614 if (api_user_realm_auth ('thold.php ' )) {
615615 if ($ thold_data ['thold_per_enabled ' ] == 'on ' ) {
616616 $ actions_url .= '<a class="pic" href=" ' . html_escape ($ config ['url_path ' ] . 'plugins/thold/thold_graph.php?action=disable&id= ' . $ thold_data ['id ' ]) . '" title=" ' . __esc ('Disable Threshold ' , 'thold ' ) . '"><i class="tholdGlyphDisable fas fa-stop-circle"></i></a> ' ;
617- } elseif ((($ thold_data ['template_enabled ' ] == 'on ' && $ thold_data ['thold_enabled ' ] == 'on ' ) ||
618- ( $ thold_data [ ' template_enabled ' ] == ' off ' || $ thold_data [ ' template_enabled ' ] == '' )) && $ thold_data ['thold_per_enabled ' ] == '' ) {
617+ } elseif ((($ thold_data ['template_enabled ' ] == 'on ' && $ thold_data ['thold_enabled ' ] == 'on ' ) || $ thold_data [ ' template_enabled ' ] != ' on ' ) &&
618+ $ thold_data ['thold_per_enabled ' ] == '' ) {
619619 $ actions_url .= '<a class="pic" href=" ' . html_escape ($ config ['url_path ' ] . 'plugins/thold/thold_graph.php?action=enable&id= ' . $ thold_data ['id ' ]) . '" title=" ' . __esc ('Enable Threshold ' , 'thold ' ) . '"><i class="tholdGlyphEnable fas fa-play-circle"></i></a> ' ;
620620 } else {
621621 $ actions_url .= '<a class="pic" href="#" title=" ' . __esc ('To enable the Threshold, enable the Template first ' , 'thold ' ) . '"><i class="deviceDisabled fas fa-play-circle"></i></a> ' ;
@@ -692,7 +692,7 @@ function tholds() {
692692 form_selectable_cell ($ thold_data ['name_cache ' ] != '' ? filter_value ($ thold_data ['name_cache ' ], get_request_var ('rfilter ' )) : __ ('No name set ' , 'thold ' ), $ thold_data ['id ' ], '' , 'left ' );
693693 form_selectable_cell ($ thold_data ['external_id ' ], $ thold_data ['id ' ], '' , 'left ' );
694694
695- if ((($ thold_data ['template_enabled ' ] == 'on ' && $ thold_data ['thold_enabled ' ] == 'on ' ) || ( $ thold_data ['template_enabled ' ] == ' off ' || $ thold_data [ ' template_enabled ' ] == '' ) ) && $ thold_data ['thold_per_enabled ' ] == 'on ' ) {
695+ if ((($ thold_data ['template_enabled ' ] == 'on ' && $ thold_data ['thold_enabled ' ] == 'on ' ) || $ thold_data ['template_enabled ' ] != ' on ' ) && $ thold_data ['thold_per_enabled ' ] == 'on ' ) {
696696 $ enabled = __ ('Yes ' , 'thold ' );
697697 } elseif ($ thold_data ['template_enabled ' ] == 'on ' && $ thold_data ['thold_enabled ' ] == 'off ' && $ thold_data ['thold_per_enabled ' ] == '' ) {
698698 $ enabled = __ ('No [Template:Thold] ' , 'thold ' );
@@ -1349,7 +1349,7 @@ function thold_export_log() {
13491349 if (get_request_var ('thold_template_id ' ) > 0 ) {
13501350 $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.thold_template_id = ' . get_request_var ('thold_template_id ' ) . ' AND td.template_enabled = "on") ' ;
13511351 } elseif (get_request_var ('thold_template_id ' ) == '-2 ' ) {
1352- $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.template_enabled = "off" OR td.template_enabled = " ") ' ;
1352+ $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.template_enabled ! = "on ") ' ;
13531353 }
13541354 }
13551355
@@ -1440,7 +1440,7 @@ function thold_show_log() {
14401440 if (get_request_var ('thold_template_id ' ) > 0 ) {
14411441 $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.thold_template_id = ' . get_request_var ('thold_template_id ' ) . ' AND td.template_enabled = "on") ' ;
14421442 } elseif (get_request_var ('thold_template_id ' ) == '-2 ' ) {
1443- $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.template_enabled = "off" OR td.template_enabled = " ") ' ;
1443+ $ sql_where .= ($ sql_where == '' ? '' : ' AND ' ) . '(td.template_enabled ! = "on ") ' ;
14441444 }
14451445 }
14461446
0 commit comments