$dateformat = 'd.m.'; $view->timeformat = $timeformat; $view->dateformat = $dateformat; echo $view->render('panel.php'); $view->timeformat = preg_replace('/([A-Za-z])/', '%$1', $timeformat); $view->dateformat = preg_replace('/([A-Za-z])/', '%$1', $dateformat); // Get the total amount of time shown in the table. if (isset($kga['customer'])) { $total = Format::formatDuration($database->get_duration($in, $out, null, array($kga['customer']['customerID']), null)); } else { $total = Format::formatDuration($database->get_duration($in, $out, array($kga['user']['userID']), null, null)); } if (isset($kga['customer'])) { $view->exportData = export_get_data($in, $out, null, array($kga['customer']['customerID'])); } else { $view->exportData = export_get_data($in, $out, array($kga['user']['userID'])); } $view->total = $total; // Get the annotations for the user sub list. if (isset($kga['customer'])) { $ann = export_get_user_annotations($in, $out, null, array($kga['customer']['customerID'])); } else { $ann = export_get_user_annotations($in, $out, array($kga['user']['userID'])); } Format::formatAnnotations($ann); $view->user_annotations = $ann; // Get the annotations for the customer sub list. if (isset($kga['customer'])) { $ann = export_get_customer_annotations($in, $out, null, array($kga['customer']['customerID'])); } else { $ann = export_get_customer_annotations($in, $out, array($kga['user']['userID']));
$orderedExportData[$customerID][$projectID] = array(); } // add row $orderedExportData[$customerID][$projectID][] = $row; } require 'export_pdf.php'; break; /** * Export as a PDF document in a list format. */ /** * Export as a PDF document in a list format. */ case 'export_pdf2': $database->user_set_preferences(array('print_comments' => isset($_REQUEST['print_comments']) ? 1 : 0, 'print_summary' => isset($_REQUEST['print_summary']) ? 1 : 0, 'create_bookmarks' => isset($_REQUEST['create_bookmarks']) ? 1 : 0, 'download_pdf' => isset($_REQUEST['download_pdf']) ? 1 : 0, 'customer_new_page' => isset($_REQUEST['customer_new_page']) ? 1 : 0, 'reverse_order' => isset($_REQUEST['reverse_order']) ? 1 : 0, 'pdf_format' => 'export_pdf2'), 'ki_export.pdf.'); $exportData = export_get_data($in, $out, $filterUsers, $filterCustomers, $filterProjects, $filterActivities, false, $reverse_order, $default_location, $filter_cleared, $filter_type, false, $filter_refundable); // sort data into new array, where first dimension is customer and second dimension is project $orderedExportData = array(); foreach ($exportData as $row) { $customerID = $row['customerID']; $projectID = $row['projectID']; // create key for customer, if not present if (!array_key_exists($customerID, $orderedExportData)) { $orderedExportData[$customerID] = array(); } // create key for project, if not present if (!array_key_exists($projectID, $orderedExportData[$customerID])) { $orderedExportData[$customerID][$projectID] = array(); } // add row $orderedExportData[$customerID][$projectID][] = $row;
$dateformat = $kga->getDateFormat(1); $view->assign('timeformat', $timeformat); $view->assign('dateformat', $dateformat); echo $view->render('panel.php'); $view->assign('timeformat', preg_replace('/([A-Za-z])/', '%$1', $timeformat)); $users = null; $customers = null; if (isset($kga['customer'])) { $customers = array($kga['customer']['customerID']); } else { $users = array($kga['user']['userID']); } // Get the total amount of time shown in the table. $total = Kimai_Format::formatDuration($database->get_duration($in, $out, $users, $customers, null)); $view->assign('total', $total); $view->assign('exportData', export_get_data($in, $out, $users, $customers)); // Get the annotations for the user sub list. $userAnnotations = export_get_user_annotations($in, $out, $users, $customers); Kimai_Format::formatAnnotations($userAnnotations); $view->assign('user_annotations', $userAnnotations); // Get the annotations for the customer sub list. $customerAnnotations = export_get_customer_annotations($in, $out, $users, $customers); Kimai_Format::formatAnnotations($customerAnnotations); $view->assign('customer_annotations', $customerAnnotations); // Get the annotations for the project sub list. $projectAnnotations = export_get_project_annotations($in, $out, $users, $customers); Kimai_Format::formatAnnotations($projectAnnotations); $view->assign('project_annotations', $projectAnnotations); // Get the annotations for the activity sub list. $activityAnnotations = export_get_activity_annotations($in, $out, $users, $customers); Kimai_Format::formatAnnotations($activityAnnotations);