public function displayOptions() { ob_start(); global $current_language, $app_list_strings; $mod_strings = return_module_language($current_language, 'AOR_Reports'); $optionsSmarty = new Sugar_Smarty(); $optionsSmarty->assign('MOD', $mod_strings); $optionsSmarty->assign('id', $this->id); $optionsSmarty->assign('dashletTitle', $this->title); $optionsSmarty->assign('aor_report_id', $this->report->id); $optionsSmarty->assign('aor_report_name', $this->report->name); $optionsSmarty->assign('onlyCharts', $this->onlyCharts); $charts = array(); if (!empty($this->report->id)) { foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) { $charts[$chart->id] = $chart->name; } } $conditions = getConditionsAsParameters($this->report, $this->params); $optionsSmarty->assign('parameters', $conditions); $chartOptions = get_select_options_with_id($charts, $this->charts); $optionsSmarty->assign('chartOptions', $chartOptions); $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl'); ob_clean(); return $optionsSmarty->fetch($optionsTemplate); }
protected function action_getParametersForReport() { if (empty($_REQUEST['record'])) { echo json_encode(array()); return; } $report = BeanFactory::getBean('AOR_Reports', $_REQUEST['record']); if (!$report) { echo json_encode(array()); return; } if (empty($report->id)) { echo json_encode(array()); return; } $conditions = getConditionsAsParameters($report); echo json_encode($conditions); }
public function displayOptions() { ob_start(); global $current_language, $app_list_strings, $datetime; $mod_strings = return_module_language($current_language, 'AOR_Reports'); $optionsSmarty = new Sugar_Smarty(); $optionsSmarty->assign('MOD', $mod_strings); $optionsSmarty->assign('id', $this->id); $optionsSmarty->assign('dashletTitle', $this->title); $optionsSmarty->assign('aor_report_id', $this->report->id); $optionsSmarty->assign('aor_report_name', $this->report->name); $optionsSmarty->assign('onlyCharts', $this->onlyCharts); $optionsSmarty->assign('aor_date_options', $app_list_strings['aor_date_options']); $optionsSmarty->assign('aor_condition_type_list', $app_list_strings['aor_condition_type_list']); $optionsSmarty->assign('aor_date_operator', $app_list_strings['aor_date_operator']); $optionsSmarty->assign('aor_date_type_list', $app_list_strings['aor_date_type_list']); $optionsSmarty->assign('date_time_period_list', $app_list_strings['date_time_period_list']); $charts = array(); if (!empty($this->report->id)) { foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) { $charts[$chart->id] = $chart->name; } } $conditions = getConditionsAsParameters($this->report, $this->params); $i = 0; foreach ($conditions as $condition) { if ($condition["value_type"] == "Date") { if ($condition["additionalConditions"][0] == "now") { $conditions[$i]["value"] = date("d/m/Y"); } } $i++; } $optionsSmarty->assign('parameters', $conditions); $chartOptions = get_select_options_with_id($charts, $this->charts); $optionsSmarty->assign('chartOptions', $chartOptions); $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl'); ob_clean(); return $optionsSmarty->fetch($optionsTemplate); }