function derive_ajax_operation() { // Fetch URL path to reportico and set URL path to the runner $this->reportico_url_path = get_reportico_url_path(); if ( !$this->url_path_to_reportico_runner ) $this->url_path_to_reportico_runner = $this->reportico_url_path."run.php"; // If full ajax mode is requested but no ajax url is passed then defalt the ajax url to the default reportico runner register_session_param("reportico_ajax_script_url", $this->reportico_ajax_script_url); $this->reportico_ajax_script_url = get_reportico_session_param("reportico_ajax_script_url"); if ( $this->reportico_ajax_script_url && !$this->reportico_ajax_mode) $this->reportico_ajax_mode = true; if ( !$this->reportico_ajax_script_url ) $this->reportico_ajax_script_url = $this->url_path_to_reportico_runner; if ( $this->reportico_ajax_called && !$this->reportico_ajax_mode) $this->reportico_ajax_mode = true; $this->reportico_ajax_preloaded = get_request_item("reportico_ajax_called", $this->reportico_ajax_preloaded); if ( get_reportico_session_param("reportico_ajax_called" ) ) $this->reportico_ajax_mode = true; //if ( $this->reportico_ajax_mode ) //{ //$this->embedded_report = true; //} }
function generate_url_params($target_format, $session_placeholder = false) { $this->apply_defaults(); $result = ""; $url = ""; $url .= "title=" . $this->convert_special_chars($this->title_actual); $url .= "&xtitle=" . $this->convert_special_chars($this->xtitle_actual); $url .= "&ytitle=" . $this->convert_special_chars($this->ytitle_actual); if ($target_format == "PDF") { $url .= "&width=" . $this->width_pdf_actual; $url .= "&height=" . $this->height_pdf_actual; } else { $url .= "&width=" . $this->width_actual; $url .= "&height=" . $this->height_actual; } $url .= "&graphcolor=" . $this->graphcolor_actual; $url .= "&gridposition=" . $this->gridpos_actual; $url .= "&xgriddisplay=" . $this->xgriddisplay_actual; $url .= "&xgridcolor=" . $this->xgridcolor_actual; $url .= "&ygriddisplay=" . $this->ygriddisplay_actual; $url .= "&ygridcolor=" . $this->ygridcolor_actual; $url .= "&titlefont=" . $this->titlefont_actual; $url .= "&titlefontstyle=" . $this->titlefontstyle_actual; $url .= "&titlefontsize=" . $this->titlefontsize_actual; $url .= "&titlecolor=" . $this->titlecolor_actual; $url .= "&xaxiscolor=" . $this->xaxiscolor_actual; $url .= "&xaxisfont=" . $this->xaxisfont_actual; $url .= "&xaxisfontstyle=" . $this->xaxisfontstyle_actual; $url .= "&xaxisfontsize=" . $this->xaxisfontsize_actual; $url .= "&xaxisfontcolor=" . $this->xaxisfontcolor_actual; $url .= "&yaxiscolor=" . $this->yaxiscolor_actual; $url .= "&yaxisfont=" . $this->yaxisfont_actual; $url .= "&yaxisfontstyle=" . $this->yaxisfontstyle_actual; $url .= "&yaxisfontsize=" . $this->yaxisfontsize_actual; $url .= "&yaxisfontcolor=" . $this->yaxisfontcolor_actual; $url .= "&xtitlefont=" . $this->xtitlefont_actual; $url .= "&xtitlefontstyle=" . $this->xtitlefontstyle_actual; $url .= "&xtitlefontsize=" . $this->xtitlefontsize_actual; $url .= "&xtitlecolor=" . $this->xtitlecolor_actual; $url .= "&xtickint=" . $this->xtickinterval_actual; $url .= "&xticklabint=" . $this->xticklabelinterval_actual; $url .= "&ytitlefont=" . $this->ytitlefont_actual; $url .= "&ytitlefontstyle=" . $this->ytitlefontstyle_actual; $url .= "&ytitlefontsize=" . $this->ytitlefontsize_actual; $url .= "&ytitlecolor=" . $this->ytitlecolor_actual; $url .= "&ytickint=" . $this->ytickinterval_actual; $url .= "&yticklabint=" . $this->yticklabelinterval_actual; $url .= "&margincolor=" . $this->margincolor_actual; $url .= "&marginleft=" . $this->marginleft_actual; $url .= "&marginright=" . $this->marginright_actual; $url .= "&margintop=" . $this->margintop_actual; $url .= "&marginbottom=" . $this->marginbottom_actual; $url .= "&xlabels=" . implode(",", $this->xlabels); foreach ($this->plot as $k => $v) { $str = implode(",", $v["data"]); $url .= "&plotname{$k}=" . $v["name"]; $url .= "&plotdata{$k}={$str}"; $url .= "&plottype{$k}=" . $v["type"]; $url .= "&plotlinecolor{$k}=" . $v["linecolor"]; if ($v["legend"]) { $url .= "&plotlegend{$k}=" . $v["legend"]; } if ($v["fillcolor"]) { $url .= "&plotfillcolor{$k}=" . $v["fillcolor"]; } } if ($session_placeholder) { $ses = "graph_" . $session_placeholder; set_reportico_session_param($ses, $url); $url = "graphid=" . $ses . "&time=" . time(); } // Select the appropriate reporting engine $dyngraph = "dyngraph.php"; if (defined("SW_GRAPH_ENGINE") && SW_GRAPH_ENGINE == "PCHART") { $dyngraph = "dyngraph_pchart.php"; } if (!is_file($dyngraph)) { find_file_to_include($dyngraph, $dyngraph); $dyngraph = get_relative_path(realpath($dyngraph), dirname($_SERVER["SCRIPT_FILENAME"])); } $dr = get_reportico_url_path(); $result = '<img class="swRepGraph" src=\'' . $dr . $dyngraph . '?' . $url . '\'>'; return $result; }
function generate_url_params($target_format, $session_placeholder = false) { $this->apply_defaults(); $result = ""; $url = ""; $url .= "title=" . $this->convert_special_chars($this->title_actual); $url .= "&xtitle=" . $this->convert_special_chars($this->xtitle_actual); $url .= "&ytitle=" . $this->convert_special_chars($this->ytitle_actual); if ($target_format == "PDF") { $url .= "&width=" . $this->width_pdf_actual; $url .= "&height=" . $this->height_pdf_actual; } else { $url .= "&width=" . $this->width_actual; $url .= "&height=" . $this->height_actual; } $url .= "&graphcolor=" . $this->graphcolor_actual; $url .= "&gridposition=" . $this->gridpos_actual; $url .= "&xgriddisplay=" . $this->xgriddisplay_actual; $url .= "&xgridcolor=" . $this->xgridcolor_actual; $url .= "&ygriddisplay=" . $this->ygriddisplay_actual; $url .= "&ygridcolor=" . $this->ygridcolor_actual; $url .= "&titlefont=" . $this->titlefont_actual; $url .= "&titlefontstyle=" . $this->titlefontstyle_actual; $url .= "&titlefontsize=" . $this->titlefontsize_actual; $url .= "&titlecolor=" . $this->titlecolor_actual; $url .= "&xaxiscolor=" . $this->xaxiscolor_actual; $url .= "&xaxisfont=" . $this->xaxisfont_actual; $url .= "&xaxisfontstyle=" . $this->xaxisfontstyle_actual; $url .= "&xaxisfontsize=" . $this->xaxisfontsize_actual; $url .= "&xaxisfontcolor=" . $this->xaxisfontcolor_actual; $url .= "&yaxiscolor=" . $this->yaxiscolor_actual; $url .= "&yaxisfont=" . $this->yaxisfont_actual; $url .= "&yaxisfontstyle=" . $this->yaxisfontstyle_actual; $url .= "&yaxisfontsize=" . $this->yaxisfontsize_actual; $url .= "&yaxisfontcolor=" . $this->yaxisfontcolor_actual; $url .= "&xtitlefont=" . $this->xtitlefont_actual; $url .= "&xtitlefontstyle=" . $this->xtitlefontstyle_actual; $url .= "&xtitlefontsize=" . $this->xtitlefontsize_actual; $url .= "&xtitlecolor=" . $this->xtitlecolor_actual; $url .= "&xtickint=" . $this->xtickinterval_actual; $url .= "&xticklabint=" . $this->xticklabelinterval_actual; $url .= "&ytitlefont=" . $this->ytitlefont_actual; $url .= "&ytitlefontstyle=" . $this->ytitlefontstyle_actual; $url .= "&ytitlefontsize=" . $this->ytitlefontsize_actual; $url .= "&ytitlecolor=" . $this->ytitlecolor_actual; $url .= "&ytickint=" . $this->ytickinterval_actual; $url .= "&yticklabint=" . $this->yticklabelinterval_actual; $url .= "&margincolor=" . $this->margincolor_actual; $url .= "&marginleft=" . $this->marginleft_actual; $url .= "&marginright=" . $this->marginright_actual; $url .= "&margintop=" . $this->margintop_actual; $url .= "&marginbottom=" . $this->marginbottom_actual; $url .= "&xlabels=" . implode(",", $this->xlabels); foreach ($this->plot as $k => $v) { $str = implode(",", $v["data"]); $url .= "&plotname{$k}=" . $v["name"]; $url .= "&plotdata{$k}={$str}"; $url .= "&plottype{$k}=" . $v["type"]; $url .= "&plotlinecolor{$k}=" . $v["linecolor"]; if ($v["legend"]) { $url .= "&plotlegend{$k}=" . $v["legend"]; } if ($v["fillcolor"]) { $url .= "&plotfillcolor{$k}=" . $v["fillcolor"]; } } if ($session_placeholder) { $ses = "graph_" . $session_placeholder; set_reportico_session_param($ses, $url); $url = "graphid=" . $ses . "&time=" . time(); } // Select the appropriate reporting engine $dyngraph = "dyngraph.php"; if (defined("SW_GRAPH_ENGINE") && SW_GRAPH_ENGINE == "PCHART") { $dyngraph = "dyngraph_pchart.php"; } $dr = get_reportico_url_path(); $dyngraph = $dr . "/" . find_best_url_in_include_path($dyngraph); if ($this->reportico->framework_parent) { $dyngraph = ""; if ($this->reportico->reportico_ajax_mode == "2") { $dyngraph = preg_replace("/ajax/", "graph", $this->reportico->reportico_ajax_script_url); } } $forward_url_params = session_request_item('forward_url_get_parameters_graph'); if (!$forward_url_params) { $forward_url_params = session_request_item('forward_url_get_parameters', $this->reportico->forward_url_get_parameters); } if ($forward_url_params) { $url .= "&" . $forward_url_params; } $url .= "&reportico_call_mode=graph_pchart"; $url .= "&reportico_session_name=" . reportico_session_name(); $result = '<img class="swRepGraph" src=\'' . $dyngraph . '?' . $url . '\'>'; return $result; }
function &display_maintain_field($tag, $val, &$tagct, $translate = true, $overridetitle = false, $toggleclass = false, $togglestate = false, $draw_shadow = false) { $text = ""; $striptag = preg_replace("/ .*/", "", $tag); $showtag = preg_replace("/ /", "_", $tag); $partialMaintain = get_request_item("partialMaintain", false); if ($partialMaintain) { $x = $this->id . "_" . $showtag; if ($partialMaintain != $x && !preg_match("/_ANY/", $partialMaintain)) { return $text; } } $text .= "\n<!-- SETFIELD-->"; $text .= '<TR'; if ($toggleclass) { if ($togglestate) { $text .= " class=\"" . $toggleclass . "\" style=\"display: table-row\" "; } else { $text .= " class=\"" . $toggleclass . "\" style=\"display: none\" "; } } if ($draw_shadow) { $text .= " style=\"display: none\" "; } $text .= '>'; $type = "TEXTFIELD"; $translateoptions = false; $title = $tag; $edit_mode = "FULL"; $tagvals = array(); $subtitle = ""; if (preg_match("/ /", $tag)) { $subtitle = preg_replace("/.* /", " ", $tag); } if (array_key_exists($striptag, $this->field_display)) { $arval = $this->field_display[$striptag]; if (array_key_exists("Title", $arval)) { $title = $arval["Title"] . $subtitle; } if (array_key_exists("Type", $arval)) { $type = $arval["Type"]; } if (array_key_exists("WizardLink", $arval)) { $this->wizard_linked_to = $val; } if (array_key_exists("XlateOptions", $arval)) { $translateoptions = $arval["XlateOptions"]; } if (array_key_exists("EditMode", $arval)) { $edit_mode = $arval["EditMode"]; } if (array_key_exists("Values", $arval)) { $tagvals = $arval["Values"]; } } if ($overridetitle) { $title = $overridetitle; } $default = get_default($striptag, "."); if ($type == "HIDE") { $tagct--; $test = ""; return $text; } $helppage = $this->get_help_link($this->id); $text .= '<TD class="swMntSetField">'; if ($helppage) { if ($this->query->url_path_to_assets) { $helpimg = $this->query->url_path_to_assets . "/images/help.png"; $text .= '<a target="_blank" href="' . $this->help_path($this->id, $striptag) . '">'; $text .= '<img class="swMntHelpImage" alt="tab" src="' . $helpimg . '">'; $text .= '</a> '; } else { $helpimg = find_best_url_in_include_path("images/help.png"); $dr = get_reportico_url_path(); $text .= '<a target="_blank" href="' . $this->help_path($this->id, $striptag) . '">'; $text .= '<img class="swMntHelpImage" alt="tab" src="' . $dr . $helpimg . '">'; $text .= '</a> '; } } if ($translate) { $text .= template_xlate($title); } else { $text .= $title; } if ($edit_mode == "SAFE") { if (SW_SAFE_DESIGN_MODE) { $text .= "<br>" . template_xlate("SAFEOFF"); } else { $text .= ""; } } $text .= '</TD>'; if ($draw_shadow) { $shadow = "_shadow"; } else { $shadow = ""; } // Display Field Entry $text .= '<TD class="swMntSetField" colspan="1">'; switch ($type) { case "PASSWORD": $text .= '<input class="' . $this->query->getBootstrapStyle('textfield') . '" type="password" size="40%" name="set_' . $this->id . "_" . $showtag . $shadow . '" value="' . htmlspecialchars($val) . '"><br>'; break; case "TEXTFIELDREADONLY": $readonly = "readonly"; $text .= '<input class="' . $this->query->getBootstrapStyle('textfield') . '" type="text" size="40%" ' . $readonly . ' name="set_' . $this->id . "_" . $showtag . $shadow . '" value="' . htmlspecialchars($val) . '">'; break; case "TEXTFIELD": case "TEXTFIELDNOOK": $readonly = ""; if ($edit_mode == "SAFE" && ($this->query->allow_maintain == "SAFE" || $this->query->allow_maintain == "DEMO" || SW_SAFE_DESIGN_MODE)) { $readonly = "readonly"; } $text .= '<input class="' . $this->query->getBootstrapStyle('textfield') . '" type="text" size="40%" ' . $readonly . ' name="set_' . $this->id . "_" . $showtag . $shadow . '" value="' . htmlspecialchars($val) . '">'; break; case "TEXTBOX": $readonly = ""; if ($edit_mode == "SAFE" && ($this->query->allow_maintain == "SAFE" || $this->query->allow_maintain == "DEMO" || SW_SAFE_DESIGN_MODE)) { $readonly = "readonly"; } $text .= '<textarea class="' . $this->query->getBootstrapStyle('textfield') . '" ' . $readonly . ' cols="70" rows="20" name="set_' . $this->id . "_" . $showtag . $shadow . '" >'; $text .= htmlspecialchars($val); $text .= '</textarea>'; break; case "TEXTBOXSMALL": $readonly = ""; if ($edit_mode == "SAFE" && ($this->query->allow_maintain == "SAFE" || $this->query->allow_maintain == "DEMO" || SW_SAFE_DESIGN_MODE)) { $readonly = "readonly"; } $text .= '<textarea class="' . $this->query->getBootstrapStyle('textfield') . '" ' . $readonly . ' cols="70" rows="4" name="set_' . $this->id . "_" . $showtag . $shadow . '" >'; $text .= htmlspecialchars($val); $text .= '</textarea>'; break; case "DROPDOWN": $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $tagvals, $val, false, $translateoptions); break; case "CRITERIA": $keys = array_keys($this->query->lookup_queries); if (!is_array($keys)) { $key = array(); } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "GROUPCOLUMNS": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = "REPORT_BODY"; if (is_array($q->columns)) { foreach ($q->columns as $col) { $keys[] = $col->query_name; } } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "REPORTLIST": $keys = array(); $keys[] = ""; if (is_dir($this->query->reports_path)) { $testpath = $this->query->reports_path; } else { $testpath = find_best_location_in_include_path($this->query->reports_path); } if (is_dir($testpath)) { if ($dh = opendir($testpath)) { while (($file = readdir($dh)) !== false) { if (preg_match("/.*\\.xml/", $file)) { $keys[] = $file; } } closedir($dh); } } else { trigger_error(template_xlate("NOOPENDIR") . $this->query->reports_path); } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "FONTLIST": $keys = array(); $keys[] = ""; if ($this->query->pdf_engine == "fpdf") { $fontdir = "fpdf/font"; } else { $fontdir = "tcpdf/fonts"; } if (is_dir($fontdir)) { $testpath = $fontdir; } else { $testpath = find_best_location_in_include_path($fontdir); } if (is_dir($testpath)) { if ($dh = opendir($testpath)) { while (($file = readdir($dh)) !== false) { if (preg_match("/.*\\.php/", $file)) { $keys[] = preg_replace("/.php/", "", $file); } } sort($keys); closedir($dh); } } else { trigger_error(template_xlate("NOOPENDIR") . $this->query->reports_path); } if (!in_array($val, $keys)) { $keys[] = $val; } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "STYLELOCTYPES": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = "CELL"; $keys[] = "ALLCELLS"; $keys[] = "COLUMNHEADERS"; $keys[] = "ROW"; $keys[] = "PAGE"; $keys[] = "BODY"; $keys[] = "GROUPHEADERLABEL"; $keys[] = "GROUPHEADERVALUE"; $keys[] = "GROUPTRAILER"; $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "FONTSTYLES": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = "NONE"; $keys[] = "BOLD"; $keys[] = "ITALIC"; $keys[] = "BOLDANDITALIC"; $keys[] = "UNDERLINE"; $keys[] = "NORMAL"; $keys[] = "STRIKETHROUGH"; $keys[] = "OVERLINE"; $keys[] = "BLINK"; $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "POSITIONS": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = ""; $keys[] = "RELATIVE"; $keys[] = "ABSOLUTE"; $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "BORDERSTYLES": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = "NOBORDER"; $keys[] = "NONE"; $keys[] = "SOLIDLINE"; $keys[] = "DOTTED"; $keys[] = "DASHED"; $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "AGGREGATETYPES": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = ""; $keys[] = "SUM"; $keys[] = "AVERAGE"; $keys[] = "MIN"; $keys[] = "MAX"; $keys[] = "PREVIOUS"; $keys[] = "COUNT"; $keys[] = "SKIPLINE"; $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "QUERYCOLUMNS": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); if ($q && is_array($q->columns)) { foreach ($q->columns as $col) { $keys[] = $col->query_name; } } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "QUERYCOLUMNSOPTIONAL": if (!$this->current_criteria_name) { $q =& $this->query; } else { $q =& $this->query->lookup_queries[$this->current_criteria_name]->lookup_query; } $keys = array(); $keys[] = ""; if (is_array($q->columns)) { foreach ($q->columns as $col) { $keys[] = $col->query_name; } } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; case "QUERYGROUPS": $q =& $this->query; $keys = array(); if (is_array($q->columns)) { foreach ($q->groups as $col) { $keys[] = $col->group_name; } } $text .= $this->draw_array_dropdown("set_" . $this->id . "_" . $showtag . $shadow, $keys, $val, false, $translateoptions); break; } $text .= '<TD class="swMntSetField" colspan="1">'; if ($default) { $text .= ' (' . $default . ')'; } else { $text .= ' '; } $text .= '</TD>'; if ($partial = get_request_item("partialMaintain", false)) { $arr = explode("_", $partial); if (count($arr) > 1) { $partial = $arr[1]; } } if ($tagct == 1 || $partial == $tag && $partial != "ANY") { $text .= "\n<!-- TAG 1-->"; $text .= '<TD colspan="1">'; if ($type != "TEXTFIELDNOOK") { $text .= '<input class="' . $this->query->getBootstrapStyle('design_ok') . 'swMntButton reporticoSubmit" type="submit" name="submit_' . $this->id . '_SET" value="' . template_xlate("OK") . '">'; } else { $text .= " "; } $text .= '</TD>'; } $text .= '</TR>'; return $text; }