mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-26 23:35:02 +02:00
#13433 Fixed error 500 when filtering. The none option is left by default when loading report data
This commit is contained in:
parent
c52254ffea
commit
cae5bcd164
@ -2343,7 +2343,7 @@ if (is_metaconsole() === true) {
|
|||||||
if ($idAgent) {
|
if ($idAgent) {
|
||||||
$sql = 'SELECT id_agente_modulo, nombre
|
$sql = 'SELECT id_agente_modulo, nombre
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE id_agente = "'.$idAgent["id_agent"].'" AND delete_pending = 0';
|
WHERE id_agente = "'.$idAgent.'" AND delete_pending = 0';
|
||||||
|
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
$connection = metaconsole_get_connection($server_name);
|
$connection = metaconsole_get_connection($server_name);
|
||||||
|
@ -1006,10 +1006,10 @@ function get_parameter($name, $default='')
|
|||||||
|
|
||||||
function get_parameter_date($name, $default='', $date_format='Y/m/d')
|
function get_parameter_date($name, $default='', $date_format='Y/m/d')
|
||||||
{
|
{
|
||||||
// TODO: Configure default value.
|
|
||||||
$date_end = get_parameter('date_end', 0);
|
$date_end = get_parameter('date_end', 0);
|
||||||
$time_end = get_parameter('time_end');
|
$time_end = get_parameter('time_end');
|
||||||
$datetime_end = strtotime($date_end.' '.$time_end);
|
$datetime_end = strtotime($date_end.' '.$time_end);
|
||||||
|
$date_none = get_parameter($name, $default);
|
||||||
|
|
||||||
$custom_date = get_parameter('custom_date', 0);
|
$custom_date = get_parameter('custom_date', 0);
|
||||||
$range = get_parameter($name, SECONDS_1DAY);
|
$range = get_parameter($name, SECONDS_1DAY);
|
||||||
@ -1055,6 +1055,9 @@ function get_parameter_date($name, $default='', $date_format='Y/m/d')
|
|||||||
$date_init = $first_of_week;
|
$date_init = $first_of_week;
|
||||||
$period = (strtotime($date_end) - strtotime($first_of_week));
|
$period = (strtotime($date_end) - strtotime($first_of_week));
|
||||||
}
|
}
|
||||||
|
} else if ($date_none === 'none') {
|
||||||
|
// Prioritize the report item period based on the current local date/time.
|
||||||
|
$date_end = date('Y/m/d H:i:s');
|
||||||
} else {
|
} else {
|
||||||
$date_end = date('Y/m/d H:i:s');
|
$date_end = date('Y/m/d H:i:s');
|
||||||
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range));
|
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range));
|
||||||
|
@ -43,7 +43,7 @@ if (!reporting_user_can_see_report($id_report)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_params = get_parameter_date('date', '', 'U');
|
$date_params = get_parameter_date('date', 'none', 'U');
|
||||||
$date_end = date('Y/m/d', $date_params['date_end']);
|
$date_end = date('Y/m/d', $date_params['date_end']);
|
||||||
$time_end = date('H:i:s', $date_params['date_end']);
|
$time_end = date('H:i:s', $date_params['date_end']);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user