diff --git a/admin/export.php b/admin/export.php index 3dedeb28..a1ec0899 100644 --- a/admin/export.php +++ b/admin/export.php @@ -38,6 +38,7 @@ require(HESK_PATH . 'inc/admin_functions.inc.php'); require(HESK_PATH . 'inc/reporting_functions.inc.php'); require(HESK_PATH . 'inc/status_functions.inc.php'); require(HESK_PATH . 'inc/mail_functions.inc.php'); +require(HESK_PATH . 'inc/custom_fields.inc.php'); hesk_load_database_functions(); hesk_session_start(); @@ -69,23 +70,23 @@ $is_all_time = 0; // Default this month to date $date_from = date('Y-m-d', mktime(0, 0, 0, date("m"), 1, date("Y"))); $date_to = date('Y-m-d'); -$input_datefrom = date('m/d/Y', strtotime('last month')); -$input_dateto = date('m/d/Y'); +$input_datefrom = date('Y-m-d', strtotime('last month')); +$input_dateto = date('Y-m-d'); /* Date */ if (!empty($_GET['w'])) { $df = preg_replace('/[^0-9]/', '', hesk_GET('datefrom')); if (strlen($df) == 8) { - $date_from = substr($df, 4, 4) . '-' . substr($df, 0, 2) . '-' . substr($df, 2, 2); - $input_datefrom = substr($df, 0, 2) . '/' . substr($df, 2, 2) . '/' . substr($df, 4, 4); + $date_from = substr($df, 0, 4) . '-' . substr($df, 4, 2) . '-' . substr($df, 6, 2); + $input_datefrom = $date_from; } else { $date_from = date('Y-m-d', strtotime('last month')); } $dt = preg_replace('/[^0-9]/', '', hesk_GET('dateto')); if (strlen($dt) == 8) { - $date_to = substr($dt, 4, 4) . '-' . substr($dt, 0, 2) . '-' . substr($dt, 2, 2); - $input_dateto = substr($dt, 0, 2) . '/' . substr($dt, 2, 2) . '/' . substr($dt, 4, 4); + $date_to = substr($dt, 0, 4) . '-' . substr($dt, 4, 2) . '-' . substr($dt, 6, 2); + $input_dateto = $date_to; } else { $date_to = date('Y-m-d'); } @@ -422,15 +423,7 @@ if (isset($_GET['w'])) { foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use']) { - switch ($v['type']) { - case 'date': - $tmp_dt = hesk_custom_date_display_format($ticket[$k], 'Y-m-d\T00:00:00.000'); - $tmp .= strlen($tmp_dt) ? ''.$tmp_dt : ''; - $tmp .= " \n"; - break; - default: - $tmp .= ' ' . "\n"; - } + $tmp .= '' . "\n"; } } @@ -454,10 +447,6 @@ if (isset($_GET['w'])) { foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use']) { - if ($modsForHesk_settings['custom_field_setting']) { - $v['name'] = $hesklang[$v['name']]; - } - $tmp .= '' . $v['name'] . '' . "\n"; } } @@ -520,14 +509,17 @@ if (isset($_GET['w'])) { '; // Add custom fields - foreach ($hesk_settings['custom_fields'] as $k => $v) { + foreach ($hesk_settings['custom_fields'] as $k=>$v) { if ($v['use']) { - $output = $ticket[$k]; - if ($v['type'] == 'date' && !empty($ticket[$k])) { - $dt = date('Y-m-d', $ticket[$k]); - $output = hesk_dateToString($dt, 0); + switch ($v['type']) { + case 'date': + $tmp_dt = hesk_custom_date_display_format($ticket[$k], 'Y-m-d\T00:00:00.000'); + $tmp .= strlen($tmp_dt) ? ''.$tmp_dt : ''; + $tmp .= " \n"; + break; + default: + $tmp .= ' ' . "\n"; } - $tmp .= ' ' . "\n"; } } @@ -702,10 +694,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
-
+
/> -
+
/>