$stdfilterhtml = $oCustomView->getStdFilterCriteria($stdfilterlist["stdfilter"]); $stdfiltercolhtml = getStdFilterHTML($cv_module, $stdfilterlist["columnname"]); $stdfilterjs = $oCustomView->getCriteriaJS(); if (isset($stdfilterlist["startdate"]) && isset($stdfilterlist["enddate"])) { $smarty->assign("STARTDATE", DateTimeField::convertToUserFormat($stdfilterlist["startdate"])); $smarty->assign("ENDDATE", DateTimeField::convertToUserFormat($stdfilterlist["enddate"])); } else { $smarty->assign("STARTDATE", $stdfilterlist["startdate"]); $smarty->assign("ENDDATE", $stdfilterlist["enddate"]); } $smarty->assign("STDFILTERCOLUMNS", $stdfiltercolhtml); $smarty->assign("STDCOLUMNSCOUNT", count($stdfiltercolhtml)); $smarty->assign("STDFILTERCRITERIA", $stdfilterhtml); $smarty->assign("STDFILTER_JAVASCRIPT", $stdfilterjs); $advfilterlist = $oCustomView->getAdvFilterByCvid($recordid); $advfilterhtml = getAdvCriteriaHTML(); $modulecolumnshtml = getByModule_ColumnsHTML($cv_module, $modulecollist); $smarty->assign("FOPTION", $advfilterhtml); $smarty->assign("COLUMNS_BLOCK", $modulecolumnshtml); $smarty->assign("CRITERIA_GROUPS", $advfilterlist); $smarty->assign("MANDATORYCHECK", implode(",", array_unique($oCustomView->mandatoryvalues))); $smarty->assign("SHOWVALUES", implode(",", $oCustomView->showvalues)); $smarty->assign("EXIST", "true"); $cactionhtml = "<input name='customaction' class='button' type='button' value='Create Custom Action' onclick=goto_CustomAction('" . $cv_module . "');>"; if ($cv_module == "Leads" || $cv_module == "Accounts" || $cv_module == "Contacts") { $smarty->assign("CUSTOMACTIONBUTTON", $cactionhtml); } $data_type[] = $oCustomView->data_type; $smarty->assign("DATATYPE", $data_type); } else { echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>";
public static function ReportFilters(Vtiger_Request $request, $viewer) { require_once 'modules/ITS4YouReports/FilterUtils.php'; $adb = PearDatabase::getInstance(); $moduleName = $request->getModule(); $R_Data = $request->getAll(); $record = $request->get('record'); $viewer->assign("MODULE", $moduleName); $reportModel = ITS4YouReports_Record_Model::getCleanInstance($record); $Report_Informations = $reportModel->getReportInformations(); $primary_module = $reportModel->getPrimaryModule(); $primary_moduleid = $reportModel->getPrimaryModuleId(); $current_user = Users_Record_Model::getCurrentUserModel(); $viewer->assign("DATEFORMAT", $current_user->date_format); $viewer->assign("JS_DATEFORMAT", parse_calendardate(vtranslate('NTC_DATE_FORMAT'))); // ITS4YOU-CR SlOl 10. 9. 2013 16:13:47 $LBL_INFORMATIONS_4YOU = vtranslate("LBL_STEP7_INFO", $moduleName); $viewer->assign("LBL_INFORMATIONS_4YOU", $LBL_INFORMATIONS_4YOU); // ITS4YOU-END 10. 9. 2013 16:13:50 $BLOCK1 = "<option selected value='Not Accessible'>" . vtranslate('LBL_NOT_ACCESSIBLE') . "</option>"; $user_privileges_path = 'user_privileges/user_privileges_' . $current_user->id . '.php'; if (file_exists($user_privileges_path)) { require $user_privileges_path; } $related_modules = $reportModel->getReportRelatedModulesList(); $advft_criteria = array(); if ($record != "") { $reportModel->getSelectedStandardCriteria($reportid); $stdselectedcolumn = $reportModel->getSTDSelectedColumn(); $relatedmodulesstring = $reportModel->getRelatedModulesString(); $BLOCK1 .= getITSPrimaryStdFilterHTML($primary_module, $stdselectedcolumn); $BLOCK1 .= getITSSecondaryStdFilterHTML($relatedmodulesstring, $stdselectedcolumn); //added to fix the ticket #5117 $selectedcolumnvalue = '"' . $stdselectedcolumn . '"'; if (!$is_admin && isset($stdselectedcolumn) && strpos($BLOCK1, $selectedcolumnvalue) === false) { $viewer->assign("BLOCK1_STD", $BLOCK1); } $stdselectedfilter = $reportModel->getSTDSelectedFilter(); $startdate = $reportModel->getStartDate(); $enddate = $reportModel->getEndDate(); if ($startdate != "") { $viewer->assign("STARTDATE_STD", getValidDisplayDate($startdate)); } if ($enddate != "") { $viewer->assign("ENDDATE_STD", getValidDisplayDate($enddate)); } $reportModel->getGroupFilterList($reportid); $reportModel->getAdvancedFilterList($reportid); $advft_criteria = $reportModel->getSelectedAdvancedFilter($reportid); } else { $primary_module = $R_Data["reportmodule"]; $BLOCK1 .= getITSPrimaryStdFilterHTML($primary_module); if (!empty($related_modules[$primary_module])) { foreach ($related_modules[$primary_module] as $key => $value) { $BLOCK1 .= getITSSecondaryStdFilterHTML($R_Data["secondarymodule_" . $value]); } } $viewer->assign("BLOCK1_STD", $BLOCK1); $stdselectedfilter = ""; } $BLOCKCRITERIA = $reportModel->getSelectedStdFilterCriteria($stdselectedfilter); $viewer->assign("BLOCKCRITERIA_STD", $BLOCKCRITERIA); $BLOCKJS = $reportModel->getCriteriaJS(); $viewer->assign("BLOCKJS_STD", $BLOCKJS); ///AdvancedFilter.php $summaries_criteria = $reportModel->getSummariesCriteria(); $viewer->assign("CRITERIA_GROUPS", $advft_criteria); $viewer->assign("EMPTY_CRITERIA_GROUPS", empty($advft_criteria)); $viewer->assign("SUMMARIES_CRITERIA", $summaries_criteria); /* if(isset($R_Data["mode"]) && $R_Data["mode"]!=""){ $mode = vtlib_purify($R_Data["mode"]); }else{ $mode = "generate"; } */ if ($record != "") { $viewer->assign('MODE', 'edit'); } else { $viewer->assign('MODE', 'create'); } $FILTER_OPTION = getAdvCriteriaHTML(); $viewer->assign("FOPTION", $FILTER_OPTION); $secondarymodule = ''; $secondarymodules = array(); if (!empty($related_modules[$primary_module])) { foreach ($related_modules[$primary_module] as $key => $value) { if (isset($R_Data["secondarymodule_" . $value])) { $secondarymodules[] = $R_Data["secondarymodule_" . $value]; } } } $reportModel->getPriModuleColumnsList($primary_module); if (!empty($related_modules[$primary_module])) { foreach ($related_modules[$primary_module] as $key => $value) { $secondarymodules[] = $value["id"]; } $secondary_modules_str = implode(":", $secondarymodules); } $reportModel->getSecModuleColumnsList($secondary_modules_str); if ($mode != "ChangeSteps") { $Options = getPrimaryColumns($Options, $reportModel->report->primarymodule, true, $reportModel->report); $secondarymodules = array(); if (!empty($reportModel->report->related_modules[$reportModel->report->primarymodule])) { foreach ($reportModel->report->related_modules[$reportModel->report->primarymodule] as $key => $value) { $exploded_mid = explode("x", $value["id"]); if (strtolower($exploded_mid[1]) != "mif") { $secondarymodules[] = $value["id"]; } } } $secondarymodules_str = implode(":", $secondarymodules); $Options_sec = getSecondaryColumns(array(), $secondarymodules_str, $reportModel->report); foreach ($Options_sec as $moduleid => $sec_options) { $Options = array_merge($Options, $sec_options); } // ITS4YOU-CR SlOl 16. 9. 2015 10:49:04 OTHER COLUMNS if (isset($R_Data["selectedColumnsStr"]) && $R_Data["selectedColumnsStr"] != "") { $selectedColumnsStr = $R_Data["selectedColumnsStr"]; $selectedColumnsStringDecoded = html_entity_decode($selectedColumnsStr, ENT_QUOTES, $default_charset); $selectedColumns_arr = explode("<_@!@_>", $selectedColumnsStringDecoded); } else { $selectedColumnsStr = $reportModel->report->reportinformations["selectedColumnsString"]; $selectedColumnsStringDecoded = html_entity_decode($selectedColumnsStr, ENT_QUOTES, $default_charset); $selectedColumns_arr = explode(";", $selectedColumnsStringDecoded); } if (!empty($selectedColumns_arr)) { $opt_label = vtranslate("LBL_Filter_SelectedColumnsGroup", "ITS4YouReports"); foreach ($selectedColumns_arr as $sc_key => $sc_col_str) { if ($sc_col_str != "") { $in_options = false; foreach ($Options as $opt_group => $opt_array) { if ($reportModel->report->in_multiarray($sc_col_str, $opt_array, "value") === true) { $in_options = true; continue; } } if ($in_options) { continue; } else { $Options[$opt_label][] = array("value" => $sc_col_str, "text" => $reportModel->report->getColumnStr_Label($sc_col_str)); } } } } // ITS4YOU-END foreach ($Options as $optgroup => $optionsdata) { if ($COLUMNS_BLOCK_JSON != "") { $COLUMNS_BLOCK_JSON .= "(|@!@|)"; } $COLUMNS_BLOCK_JSON .= $optgroup; $COLUMNS_BLOCK_JSON .= "(|@|)"; $COLUMNS_BLOCK_JSON .= Zend_JSON::encode($optionsdata); } $viewer->assign("COLUMNS_BLOCK_JSON", $COLUMNS_BLOCK_JSON); $adv_sel_fields = $reportModel->getAdvSelFields(); $sel_fields = Zend_Json::encode($adv_sel_fields); $viewer->assign("SEL_FIELDS", $sel_fields); $default_charset = vglobal("default_charset"); $std_filter_columns = $reportModel->getStdFilterColumns(); $std_filter_columns_js = implode("<%jsstdjs%>", $std_filter_columns); $std_filter_columns_js = html_entity_decode($std_filter_columns_js, ENT_QUOTES, $default_charset); $viewer->assign("std_filter_columns", $std_filter_columns_js); $Date_Filter_Values = $reportModel->getDateFilterValues(); $std_filter_criteria = Zend_Json::encode($Date_Filter_Values); $viewer->assign("std_filter_criteria", $std_filter_criteria); } $rel_fields = $reportModel->getAdvRelFields(); $viewer->assign("REL_FIELDS", Zend_Json::encode($rel_fields)); /*NEWS*/ //error_reporting(63);ini_set("display_errors",1); $primary_module = $reportModel->report->primarymodule; $primary_moduleid = $reportModel->report->primarymoduleid; // NEW ADVANCE FILTERS START $reportModel->report->getGroupFilterList($reportModel->report->record); $reportModel->report->getAdvancedFilterList($reportModel->report->record); $reportModel->report->getSummariesFilterList($reportModel->report->record); $sel_fields = Zend_Json::encode($reportModel->report->adv_sel_fields); $viewer->assign("SEL_FIELDS", $sel_fields); if (isset($_REQUEST["reload"])) { $criteria_groups = $reportModel->report->getRequestCriteria($sel_fields); } else { $criteria_groups = $reportModel->report->advft_criteria; } $viewer->assign("CRITERIA_GROUPS", $criteria_groups); $viewer->assign("EMPTY_CRITERIA_GROUPS", empty($criteria_groups)); $viewer->assign("SUMMARIES_CRITERIA", $reportModel->report->summaries_criteria); $FILTER_OPTION = getAdvCriteriaHTML(); $viewer->assign("FOPTION", $FILTER_OPTION); $COLUMNS_BLOCK_JSON = $reportModel->report->getAdvanceFilterOptionsJSON($primary_module); $viewer->assign("COLUMNS_BLOCK", $COLUMNS_BLOCK); if ($mode != "ajax") { //echo "<div class='none' style='display:none;' id='filter_columns'>" . $COLUMNS_BLOCK_JSON . "</div>"; //echo "<input type='hidden' name='filter_columns' id='filter_columns' value='".$COLUMNS_BLOCK_JSON."' />"; $viewer->assign("filter_columns", $COLUMNS_BLOCK_JSON); $sel_fields = Zend_Json::encode($reportModel->report->adv_sel_fields); $viewer->assign("SEL_FIELDS", $sel_fields); global $default_charset; $std_filter_columns = $reportModel->report->getStdFilterColumns(); $std_filter_columns_js = implode("<%jsstdjs%>", $std_filter_columns); $std_filter_columns_js = html_entity_decode($std_filter_columns_js, ENT_QUOTES, $default_charset); $viewer->assign("std_filter_columns", $std_filter_columns_js); $std_filter_criteria = Zend_Json::encode($reportModel->report->Date_Filter_Values); $viewer->assign("std_filter_criteria", $std_filter_criteria); } $rel_fields = $reportModel->report->adv_rel_fields; $rel_fields = Zend_Json::encode($rel_fields); $rel_fields = str_replace("'", "\\'", $rel_fields); $viewer->assign("REL_FIELDS", $rel_fields); // NEW ADVANCE FILTERS END $BLOCKJS = $reportModel->getCriteriaJS(); $viewer->assign("BLOCKJS_STD", $BLOCKJS); /*NEWE*/ return $viewer->view('ReportFilters.tpl', $moduleName, true); }
$REL_FIELDS4 = getRelatedColumns($oReport->advft_column[3]); $report_std_filter->assign("REL_FIELDS4", $REL_FIELDS4); $BLOCK5 = getPrimaryColumns_AdvFilterHTML($oReport->primodule, $oReport->advft_column[4]); $BLOCK5 .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule, $oReport->advft_column[4]); $report_std_filter->assign("BLOCK5", $BLOCK5); $REL_FIELDS5 = getRelatedColumns($oReport->advft_column[4]); $report_std_filter->assign("REL_FIELDS5", $REL_FIELDS5); $FILTEROPTION1 = getAdvCriteriaHTML($oReport->advft_option[0]); $report_std_filter->assign("FOPTION1", $FILTEROPTION1); $FILTEROPTION2 = getAdvCriteriaHTML($oReport->advft_option[1]); $report_std_filter->assign("FOPTION2", $FILTEROPTION2); $FILTEROPTION3 = getAdvCriteriaHTML($oReport->advft_option[2]); $report_std_filter->assign("FOPTION3", $FILTEROPTION3); $FILTEROPTION4 = getAdvCriteriaHTML($oReport->advft_option[3]); $report_std_filter->assign("FOPTION4", $FILTEROPTION4); $FILTEROPTION5 = getAdvCriteriaHTML($oReport->advft_option[4]); $report_std_filter->assign("FOPTION5", $FILTEROPTION5); $report_std_filter->assign("VALUE1", $oReport->advft_value[0]); $report_std_filter->assign("VALUE2", $oReport->advft_value[1]); $report_std_filter->assign("VALUE3", $oReport->advft_value[2]); $report_std_filter->assign("VALUE4", $oReport->advft_value[3]); $report_std_filter->assign("VALUE5", $oReport->advft_value[4]); $rel_fields = getRelatedFieldColumns(); $report_std_filter->assign("REL_FIELDS", Zend_Json::encode($rel_fields)); } else { $primarymodule = $_REQUEST["primarymodule"]; $BLOCK1 = getPrimaryColumns_AdvFilterHTML($primarymodule); $ogReport = new Reports(); if (!empty($ogReport->related_modules[$primarymodule])) { foreach ($ogReport->related_modules[$primarymodule] as $key => $value) { //$BLOCK1 .= getSecondaryColumnsHTML($_REQUEST["secondarymodule_".$value]);
$choosecolumnHtml[] = $entries; } $smarty->assign("CHOOSECOLUMN", $choosecolumnHtml); $stdfilterlist = $oCustomView->getStdFilterByCvid($recordid); $log->info('CustomView :: Successfully got Standard Filter for the Viewid' . $recordid); $stdfilterhtml = $oCustomView->getStdFilterCriteria($stdfilterlist["stdfilter"]); $stdfiltercolhtml = getStdFilterHTML($cv_module, $stdfilterlist["columnname"]); $stdfilterjs = $oCustomView->getCriteriaJS(); if (isset($stdfilterlist["startdate"]) && isset($stdfilterlist["enddate"])) { $smarty->assign("STARTDATE", $stdfilterlist["startdate"]); $smarty->assign("ENDDATE", $stdfilterlist["enddate"]); } $advfilterlist = $oCustomView->getAdvFilterByCvid($recordid); $log->info('CustomView :: Successfully got Advanced Filter for the Viewid' . $recordid, 'info'); for ($i = 1; $i < 6; $i++) { $advfilterhtml = getAdvCriteriaHTML($advfilterlist[$i - 1]["comparator"]); $advcolumnhtml = getByModule_ColumnsHTML($cv_module, $modulecollist, $advfilterlist[$i - 1]["columnname"]); $smarty->assign("FOPTION" . $i, $advfilterhtml); $smarty->assign("BLOCK" . $i, $advcolumnhtml); $smarty->assign("VALUE" . $i, $advfilterlist[$i - 1]["value"]); } $smarty->assign("STDFILTERCOLUMNS", $stdfiltercolhtml); $smarty->assign("STDFILTERCRITERIA", $stdfilterhtml); $smarty->assign("STDFILTER_JAVASCRIPT", $stdfilterjs); if (is_array($oCustomView->mandatoryvalues)) { $smarty->assign("MANDATORYCHECK", implode(",", $oCustomView->mandatoryvalues)); } if (is_array($oCustomView->showvalues)) { $smarty->assign("SHOWVALUES", implode(",", $oCustomView->showvalues)); } $cactionhtml = "<input name='customaction' class='button' type='button' value='Create Custom Action' onclick=goto_CustomAction('" . $cv_module . "');>";
$secondarymodules = array(); if (!empty($oRep->related_modules[$oReport->primodule])) { foreach ($oRep->related_modules[$oReport->primodule] as $key => $value) { if (isset($_REQUEST["secondarymodule_" . $value])) { $secondarymodules[] = $_REQUEST["secondarymodule_" . $value]; } } } $secondarymodule = implode(":", $secondarymodules); if ($secondarymodule != '') { $oReport->secmodule = $secondarymodule; } $COLUMNS_BLOCK = getPrimaryColumns_AdvFilterHTML($oReport->primodule); $COLUMNS_BLOCK .= getSecondaryColumns_AdvFilterHTML($oReport->secmodule); $report_std_filter->assign("COLUMNS_BLOCK", $COLUMNS_BLOCK); $FILTER_OPTION = getAdvCriteriaHTML(); $report_std_filter->assign("FOPTION", $FILTER_OPTION); $rel_fields = getRelatedFieldColumns(); $report_std_filter->assign("REL_FIELDS", Zend_Json::encode($rel_fields)); $report_std_filter->assign("CRITERIA_GROUPS", $oReport->advft_criteria); } else { $primarymodule = $_REQUEST["primarymodule"]; $COLUMNS_BLOCK = getPrimaryColumns_AdvFilterHTML($primarymodule); $ogReport = new Reports(); if (!empty($ogReport->related_modules[$primarymodule])) { foreach ($ogReport->related_modules[$primarymodule] as $key => $value) { //$BLOCK1 .= getSecondaryColumnsHTML($_REQUEST["secondarymodule_".$value]); $COLUMNS_BLOCK .= getSecondaryColumns_AdvFilterHTML($_REQUEST["secondarymodule_" . $value]); } } $report_std_filter->assign("COLUMNS_BLOCK", $COLUMNS_BLOCK);
public function getSelectedValuesToSmarty($smarty_obj = "", $step_name = "") { if ($smarty_obj != "" && $step_name != "") { global $app_strings; global $mod_strings; global $default_charset; global $current_language; global $image_path; global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $smarty_obj->assign("THEME", $theme_path); $smarty_obj->assign("IMAGE_PATH", $image_path); $adb = PEARDatabase::getInstance(); $get_all_steps = "all"; if (isset($_REQUEST["record"]) && $_REQUEST['record'] != '') { $recordid = vtlib_purify($_REQUEST["record"]); } else { $recordid = ""; } $smarty_obj->assign("RECORDID", $recordid); $smarty_obj->assign("DISPLAY_FILTER_HEADER", false); if (in_array($step_name, array("ReportsStep1"))) { if (isset($_REQUEST["reportname"]) && $_REQUEST["reportname"] != "") { $reportname = htmlspecialchars(vtlib_purify($_REQUEST["reportname"])); } else { $reportname = $this->reportinformations["reports4youname"]; } $smarty_obj->assign("REPORTNAME", $reportname); if (isset($_REQUEST["reportdesc"]) && $_REQUEST["reportdesc"] != "") { $reportdesc = htmlspecialchars(vtlib_purify($_REQUEST["reportdesc"])); } else { $reportdesc = $this->reportinformations["reportdesc"]; } $smarty_obj->assign("REPORTDESC", $reportdesc); $smarty_obj->assign("REP_MODULE", $this->reportinformations["primarymodule"]); $smarty_obj->assign("PRIMARYMODULES", $this->getPrimaryModules()); $smarty_obj->assign("REP_FOLDERS", $this->getReportFolders()); if (isset($this->primarymodule) && $this->primarymodule != '') { $rel_modules = $this->getReportRelatedModules($this->primarymoduleid); foreach ($rel_modules as $key => $relmodule) { $restricted_modules .= $relmodule['id'] . ":"; } $smarty_obj->assign("REL_MODULES_STR", trim($restricted_modules, ":")); $smarty_obj->assign("RELATEDMODULES", $rel_modules); } $smarty_obj->assign("FOLDERID", vtlib_purify($_REQUEST['folder'])); } if (in_array($step_name, array("ReportsStep2", $get_all_steps))) { if (isset($this->primarymodule) && $this->primarymodule != '') { $rel_modules = $this->getReportRelatedModules($this->primarymoduleid); foreach ($rel_modules as $key => $relmodule) { $restricted_modules .= $relmodule['id'] . ":"; } $smarty_obj->assign("REL_MODULES_STR", trim($restricted_modules, ":")); $smarty_obj->assign("RELATEDMODULES", $rel_modules); } } if (in_array($step_name, array("ReportGrouping", $get_all_steps))) { // TIMELINE COLUMNS DEFINITION CHANGED New Code 13.5.2014 11:58 // ITS4YOU-CR SlOl | 13.5.2014 11:53 if (isset($_REQUEST["primarymodule"]) && $_REQUEST["primarymodule"] != "") { $primary_moduleid = $_REQUEST["primarymodule"]; $primary_module = vtlib_getModuleNameById($_REQUEST["primarymodule"]); if (vtlib_isModuleActive($primary_module)) { $primary_df_arr = getPrimaryTLStdFilter($primary_module, $this); } } else { $primary_module = $this->primarymodule; $primary_moduleid = $this->primarymoduleid; $primary_df_arr = getPrimaryTLStdFilter($primary_module, $this); } $date_options = array(); if (!empty($primary_df_arr)) { foreach ($primary_df_arr as $val_arr) { foreach ($val_arr as $val_dtls) { $date_options[] = $val_dtls["value"]; } } } $date_options_json = Zend_JSON::encode($date_options); $smarty_obj->assign("date_options_json", $date_options_json); $timelinecolumn = $this->getTimeLineColumnHTML(); $smarty_obj->assign("timelinecolumn", $timelinecolumn); // ITS4YOU-END 13.5.2014 11:53 if (isset($_REQUEST["record"]) && $_REQUEST['record'] != '') { $reportid = vtlib_purify($_REQUEST["record"]); $secondarymodule = ''; $secondarymodules = array(); if (!empty($this->related_modules[$primary_module])) { foreach ($this->related_modules[$primary_module] as $key => $value) { if (isset($_REQUEST["secondarymodule_" . $value])) { $secondarymodules[] = vtlib_purify($_REQUEST["secondarymodule_" . $value]); } } } if ($primary_moduleid == getTabid('Invoice')) { $secondarymodules[] = getTabid('Products'); $secondarymodules[] = getTabid('Services'); } $secondarymodule = implode(":", $secondarymodules); if ($secondarymodule != '') { $this->secondarymodules .= $secondarymodule; } if (isset($_REQUEST["summaries_limit"])) { $summaries_limit = vtlib_purify($_REQUEST["summaries_limit"]); } else { $summaries_limit = $this->reportinformations["summaries_limit"]; } } else { $secondarymodule = ''; $secondarymodules = array(); $this->getPriModuleColumnsList($primary_module); foreach ($this->secondarymodules as $key => $secmodid) { $this->getSecModuleColumnsList(vtlib_getModuleNameById($secmodid)); } $summaries_limit = "20"; } $smarty_obj->assign("SUMMARIES_MAX_LIMIT", $summaries_limit); for ($tc_i = 1; $tc_i < 4; $tc_i++) { $timelinecol = $selected_timeline_column = ""; if (isset($_REQUEST["group{$tc_i}"]) && $_REQUEST["group{$tc_i}"] != "" && $step_name != "ReportGrouping") { $group = vtlib_purify($_REQUEST["group{$tc_i}"]); if (isset($_REQUEST["timeline_column{$tc_i}"]) && $_REQUEST["timeline_column{$tc_i}"] != "") { $selected_timeline_column = vtlib_purify($_REQUEST["timeline_column{$tc_i}"]); } } else { $group = $this->reportinformations["Group{$tc_i}"]; $selected_timeline_column = $this->reportinformations["timeline_columnstr{$tc_i}"]; } if (isset($selected_timeline_column) && !in_array($selected_timeline_column, array("", "none", "@vlv@"))) { $timelinecol = $this->getTimeLineColumnHTML($tc_i, $selected_timeline_column); $smarty_obj->assign("timelinecolumn" . $tc_i . "_html", $timelinecol); } $RG_BLOCK = getPrimaryColumns_GroupingHTML($primary_module, $group, $this); $smarty_obj->assign("RG_BLOCK{$tc_i}", $RG_BLOCK); if ($tc_i > 1) { if (isset($_REQUEST["timeline_type{$tc_i}"]) && $_REQUEST["timeline_type{$tc_i}"] != "") { $timeline_type = vtlib_purify($_REQUEST["timeline_type{$tc_i}"]); } else { $timeline_type = $this->reportinformations["timeline_type{$tc_i}"]; } $smarty_obj->assign("timeline_type{$tc_i}", $timeline_type); } } for ($sci = 1; $sci < 4; $sci++) { if (isset($_REQUEST["sort" . $sci]) && $_REQUEST["sort" . $sci] != "") { $sortorder = vtlib_purify($_REQUEST["sort" . $sci]); } else { $sortorder = $this->reportinformations["Sort" . $sci]; } $sa = $sd = ""; if ($sortorder != "Descending") { $sa = "checked"; } else { $sd = "checked"; } $shtml = '<input type="radio" id="Sort' . $sci . 'a" name="Sort' . $sci . '" value="Ascending" ' . $sa . '>' . vtranslate('Ascending') . ' <input type="radio" id="Sort' . $sci . 'd" name="Sort' . $sci . '" value="Descending" ' . $sd . '>' . vtranslate('Descending'); $smarty_obj->assign("ASCDESC" . $sci, $shtml); } // ITS4YOU-CR SlOl 5. 3. 2014 14:50:45 SUMMARIES START $module_id = $primary_moduleid; $modulename_prefix = ""; $module_array["module"] = $primary_module; $module_array["id"] = $module_id; $selectedmodule = $module_array["id"]; $modulename = $module_array["module"]; $modulename_lbl = vtranslate($modulename, $modulename); $availModules[$module_array["id"]] = $modulename_lbl; $modulename_id = $module_array["id"]; if (isset($selectedmodule)) { $secondarymodule_arr = $this->getReportRelatedModules($module_array["id"]); $this->getSecModuleColumnsList($selectedmodule); $RG_BLOCK4 = sgetSummariesHTMLOptions($module_array["id"], $module_id); $available_modules[] = array("id" => $module_id, "name" => $modulename_lbl, "checked" => "checked"); foreach ($secondarymodule_arr as $key => $value) { $exploded_mid = explode("x", $value["id"]); if (strtolower($exploded_mid[1]) != "mif") { $available_modules[] = array("id" => $value["id"], "name" => "- " . $value["name"], "checked" => ""); } } $smarty_obj->assign("RG_BLOCK4", $RG_BLOCK4); } $smarty_obj->assign("SummariesModules", $available_modules); $SumOptions = sgetSummariesOptions($selectedmodule); if (empty($SumOptions)) { $SumOptions = vtranslate("NO_SUMMARIES_COLUMNS", $this->currentModule); } $SPSumOptions[$module_array["id"]][$module_array["id"]] = $SumOptions; $smarty_obj->assign("SUMOPTIONS", $SPSumOptions); if (isset($_REQUEST["selectedSummariesString"])) { $selectedSummariesString = vtlib_purify($_REQUEST["selectedSummariesString"]); $selectedSummariesArr = explode(";", $selectedSummariesString); $summaries_orderby = vtlib_purify($_REQUEST["summaries_orderby"]); $RG_BLOCK6 = sgetSelectedSummariesHTMLOptions($selectedSummariesArr, $summaries_orderby); } else { if (!empty($this->reportinformations["summaries_columns"])) { foreach ($this->reportinformations["summaries_columns"] as $key => $summaries_columns_arr) { $selectedSummariesArr[] = $summaries_columns_arr["columnname"]; } } $selectedSummariesString = implode(";", $selectedSummariesString); $summaries_orderby = ""; if (isset($this->reportinformations["summaries_orderby_columns"][0]) && $this->reportinformations["summaries_orderby_columns"][0] != "") { $summaries_orderby = $this->reportinformations["summaries_orderby_columns"][0]; } $RG_BLOCK6 = sgetSelectedSummariesHTMLOptions($selectedSummariesArr, $summaries_orderby); } // sum_group_columns for group filters start $sm_arr = sgetSelectedSummariesOptions($selectedSummariesArr); $sm_str = ""; foreach ($sm_arr as $key => $opt_arr) { if ($sm_str != "") { $sm_str .= "(|@!@|)"; } $sm_str .= $opt_arr["value"] . "(|@|)" . $opt_arr["text"]; } $smarty_obj->assign("sum_group_columns", $sm_str); // sum_group_columns for group filters end $smarty_obj->assign("selectedSummariesString", $selectedSummariesString); $smarty_obj->assign("RG_BLOCK6", $RG_BLOCK6); $RG_BLOCKx2 = array(); $all_fields_str = ""; foreach ($SPSumOptions as $module_key => $SumOptions) { $RG_BLOCKx2 = ""; $r_modulename = vtlib_getModuleNameById($module_key); $r_modulename_lbl = vtranslate($r_modulename, $r_modulename); foreach ($SumOptions as $SumOptions_key => $SumOptions_value) { if (is_array($SumOptions_value)) { foreach ($SumOptions_value as $optgroup => $optionsdata) { if ($RG_BLOCKx2 != "") { $RG_BLOCKx2 .= "(|@!@|)"; } $RG_BLOCKx2 .= $optgroup; $RG_BLOCKx2 .= "(|@|)"; $RG_BLOCKx2 .= Zend_JSON::encode($optionsdata); } } else { $RG_BLOCKx2 .= $SumOptions_value; $RG_BLOCKx2 .= "(|@|)"; $optionsdata[] = array("value" => "none", "text" => vtranslate("LBL_NONE", $this->currentModule)); $RG_BLOCKx2 .= Zend_JSON::encode($optionsdata); } $all_fields_str .= $module_key . "(!#_ID@ID_#!)" . $r_modulename_lbl . "(!#_ID@ID_#!)" . $RG_BLOCKx2; } } $smarty_obj->assign("ALL_FIELDS_STRING", $all_fields_str); // ITS4YOU-END 5. 3. 2014 14:50:47 SUMMARIES END if (isset($_REQUEST["summaries_orderby"]) && $_REQUEST["summaries_orderby"] != "" && isset($_REQUEST["summaries_orderby_type"]) && $_REQUEST["summaries_orderby_type"] != "") { $summaries_orderby = vtlib_purify($_REQUEST["summaries_orderby"]); $summaries_orderby_type = vtlib_purify($_REQUEST["summaries_orderby_type"]); } elseif (isset($this->reportinformations["summaries_orderby_columns"]) && !empty($this->reportinformations["summaries_orderby_columns"])) { $summaries_orderby = $this->reportinformations["summaries_orderby_columns"][0]["column"]; $summaries_orderby_type = $this->reportinformations["summaries_orderby_columns"][0]["type"]; } else { $summaries_orderby = "none"; $summaries_orderby_type = "ASC"; } $smarty_obj->assign("summaries_orderby", $summaries_orderby); $smarty_obj->assign("summaries_orderby_type", $summaries_orderby_type); } if (in_array($step_name, array("ReportColumns", $get_all_steps))) { if (isset($_REQUEST["record"]) && $_REQUEST['record'] != '') { $RC_BLOCK1 = getPrimaryColumnsHTML($this->primarymodule); $secondarymodule = ''; $secondarymodules = array(); if (!empty($this->related_modules[$this->primarymodule])) { foreach ($this->related_modules[$this->primarymodule] as $key => $value) { if (isset($_REQUEST["secondarymodule_" . $value])) { $secondarymodules[] = $_REQUEST["secondarymodule_" . $value]; } } } $secondarymodule = implode(":", $secondarymodules); $RC_BLOCK2 = $this->getSelectedColumnsList($this->selected_columns_list_arr); $smarty_obj->assign("RC_BLOCK1", $RC_BLOCK1); $smarty_obj->assign("RC_BLOCK2", $RC_BLOCK2); $sreportsortsql = "SELECT columnname, sortorder FROM its4you_reports4you_sortcol WHERE reportid =? AND sortcolid = 4"; $result_sort = $adb->pquery($sreportsortsql, array($recordid)); $num_rows = $adb->num_rows($result_sort); if ($num_rows > 0) { $columnname = $adb->query_result($result_sort, 0, "columnname"); $sortorder = $adb->query_result($result_sort, 0, "sortorder"); $RC_BLOCK3 = $this->getSelectedColumnsList($this->selected_columns_list_arr, $columnname); } else { $RC_BLOCK3 = $RC_BLOCK2; } $smarty_obj->assign("RC_BLOCK3", $RC_BLOCK3); $this->secmodule = $secondarymodule; $RC_BLOCK4 = ""; $RC_BLOCK4 = getSecondaryColumnsHTML($this->relatedmodulesstring, $this); $smarty_obj->assign("RC_BLOCK4", $RC_BLOCK4); } else { $primarymodule = vtlib_purify($_REQUEST["primarymodule"]); $RC_BLOCK1 = getPrimaryColumnsHTML($primarymodule); if (!empty($this->related_modules[$primarymodule])) { foreach ($this->related_modules[$primarymodule] as $key => $value) { $RC_BLOCK1 .= getSecondaryColumnsHTML($_REQUEST["secondarymodule_" . $value], $this); } } $smarty_obj->assign("RC_BLOCK1", $RC_BLOCK1); $this->reportinformations["columns_limit"] = "20"; } $smarty_obj->assign("MAX_LIMIT", $this->reportinformations["columns_limit"]); if ($sortorder != "DESC") { $shtml = '<input type="radio" name="SortOrderColumn" value="ASC" checked>' . vtranslate('Ascending') . ' <input type="radio" name="SortOrderColumn" value="DESC">' . vtranslate('Descending'); } else { $shtml = '<input type="radio" name="SortOrderColumn" value="ASC">' . vtranslate('Ascending') . ' <input type="radio" name="SortOrderColumn" value="DESC" checked>' . vtranslate('Descending'); } $smarty_obj->assign("COLUMNASCDESC", $shtml); $timelinecolumns .= '<input type="radio" name="TimeLineColumn" value="DAYS" checked>' . $mod_strings['TL_DAYS'] . ' '; $timelinecolumns .= '<input type="radio" name="TimeLineColumn" value="WEEK" >' . $mod_strings['TL_WEEKS'] . ' '; $timelinecolumns .= '<input type="radio" name="TimeLineColumn" value="MONTH" >' . $mod_strings['TL_MONTHS'] . ' '; $timelinecolumns .= '<input type="radio" name="TimeLineColumn" value="YEAR" >' . $mod_strings['TL_YEARS'] . ' '; $timelinecolumns .= '<input type="radio" name="TimeLineColumn" value="QUARTER" >' . $mod_strings['TL_QUARTERS'] . ' '; $smarty_obj->assign("TIMELINE_FIELDS", $timelinecolumns); // ITS4YOU-CR SlOl 19. 2. 2014 16:30:20 $SPSumOptions = $availModules = array(); $RC_BLOCK0 = ""; $smarty_obj->assign("availModules", $availModules); $smarty_obj->assign("ALL_FIELDS_STRING", $RC_BLOCK0); // ITS4YOU-END 19. 2. 2014 16:30:23 $smarty_obj->assign("currentModule", $this->currentModule); } if (in_array($step_name, array("ReportColumnsTotal", $get_all_steps))) { $Objects = array(); $curl_array = array(); if (isset($_REQUEST["curl"])) { $curl = vtlib_purify($_REQUEST["curl"]); $curl_array = explode('$_@_$', $curl); $selectedColumnsString = str_replace("@AMPKO@", "&", $_REQUEST["selectedColumnsStr"]); $R_Objects = explode("<_@!@_>", $selectedColumnsString); } else { $curl_array = $this->getSelectedColumnsToTotal($this->record); $curl = implode('$_@_$', $curl_array); $selectedColumnsString = str_replace("@AMPKO@", "&", $this->reportinformations["selectedColumnsString"]); $R_Objects = explode(";", $selectedColumnsString); } $smarty_obj->assign("CURL", $curl); $Objects = sgetNewColumnstoTotalHTMLScript($R_Objects); $this->columnssummary = $Objects; $CT_BLOCK1 = $this->sgetNewColumntoTotalSelected($recordid, $R_Objects, $curl_array); $smarty_obj->assign("CT_BLOCK1", $CT_BLOCK1); //added to avoid displaying "No data avaiable to total" when using related modules in report. $rows_count = 0; $rows_count = count($CT_BLOCK1); $smarty_obj->assign("ROWS_COUNT", $rows_count); } if (in_array($step_name, array("ReportLabels", $get_all_steps))) { // selected labels from url $lbl_url_string = html_entity_decode(vtlib_purify($_REQUEST["lblurl"]), ENT_QUOTES, $default_charset); if ($lbl_url_string != "") { $lbl_url_arr = explode('$_@_$', $lbl_url_string); foreach ($lbl_url_arr as $key => $lbl_value) { if (strpos($lbl_value, 'hidden_') === false) { if (strpos($lbl_value, '_SC_lLbLl_') !== false) { $temp = explode('_SC_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = trim($temp_lbls[0]); $lbl_value = trim($temp_lbls[1]); $lbl_url_selected["SC"][$lbl_key] = $lbl_value; } if (strpos($lbl_value, '_SM_lLbLl_') !== false) { $temp = explode('_SM_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = trim($temp_lbls[0]); $lbl_value = trim($temp_lbls[1]); $lbl_url_selected["SM"][$lbl_key] = $lbl_value; } if (strpos($lbl_value, '_CT_lLbLl_') !== false) { $temp = explode('_CT_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = trim($temp_lbls[0]); $lbl_value = trim($temp_lbls[1]); $lbl_url_selected["CT"][$lbl_key] = $lbl_value; } } } } // COLUMNS labeltype SC if (isset($_REQUEST["selectedColumnsStr"]) && $_REQUEST["selectedColumnsStr"] != "") { $selectedColumnsString = vtlib_purify($_REQUEST["selectedColumnsStr"]); $selectedColumnsString = html_entity_decode($selectedColumnsString, ENT_QUOTES, $default_charset); $selected_columns_array = explode("<_@!@_>", $selectedColumnsString); $decode_labels = true; } else { $selectedColumnsString = html_entity_decode($this->reportinformations["selectedColumnsString"], ENT_QUOTES, $default_charset); $selected_columns_array = explode(";", $selectedColumnsString); $decode_labels = false; } $labels_html["SC"] = $this->getLabelsHTML($selected_columns_array, "SC", $lbl_url_selected, $decode_labels); // SUMMARIES labeltype SM $selectedSummariesString = vtlib_purify($_REQUEST["selectedSummariesString"]); if ($selectedSummariesString != "") { $selectedSummaries_array = explode(";", trim($selectedSummariesString, ";")); } else { foreach ($this->reportinformations["summaries_columns"] as $key => $sum_arr) { $selectedSummaries_array[] = $sum_arr["columnname"]; } } $labels_html["SM"] = $this->getLabelsHTML($selectedSummaries_array, "SM", $lbl_url_selected, $decode_labels); $smarty_obj->assign("labels_html", $labels_html); $smarty_obj->assign("LABELS", $curl); //added to avoid displaying "No data avaiable to total" when using related modules in report. $rows_count = count($labels_html); foreach ($labels_html as $key => $labels_type_arr) { $rows_count += count($labels_type_arr); } $smarty_obj->assign("ROWS_COUNT", $rows_count); } if (in_array($step_name, array("ReportFilters", $get_all_steps))) { require_once 'modules/ITS4YouReports/FilterUtils.php'; if (isset($_REQUEST["primarymodule"]) && $_REQUEST["primarymodule"] != "") { $primary_moduleid = $_REQUEST["primarymodule"]; $primary_module = vtlib_getModuleNameById($_REQUEST["primarymodule"]); } else { $primary_module = $this->primarymodule; $primary_moduleid = $this->primarymoduleid; } // NEW ADVANCE FILTERS START $this->getGroupFilterList($this->record); $this->getAdvancedFilterList($this->record); $this->getSummariesFilterList($this->record); $sel_fields = Zend_Json::encode($this->adv_sel_fields); $smarty_obj->assign("SEL_FIELDS", $sel_fields); if (isset($_REQUEST["reload"])) { $criteria_groups = $this->getRequestCriteria($sel_fields); } else { $criteria_groups = $this->advft_criteria; } $smarty_obj->assign("CRITERIA_GROUPS", $criteria_groups); $smarty_obj->assign("EMPTY_CRITERIA_GROUPS", empty($criteria_groups)); $smarty_obj->assign("SUMMARIES_CRITERIA", $this->summaries_criteria); $FILTER_OPTION = getAdvCriteriaHTML(); $smarty_obj->assign("FOPTION", $FILTER_OPTION); $COLUMNS_BLOCK_JSON = $this->getAdvanceFilterOptionsJSON($primary_module); $smarty_obj->assign("COLUMNS_BLOCK", $COLUMNS_BLOCK); if ($mode != "ajax") { echo "<textarea style='display:none;' id='filter_columns'>" . $COLUMNS_BLOCK_JSON . "</textarea>"; $smarty_obj->assign("filter_columns", $COLUMNS_BLOCK_JSON); $sel_fields = Zend_Json::encode($this->adv_sel_fields); $smarty_obj->assign("SEL_FIELDS", $sel_fields); global $default_charset; $std_filter_columns = $this->getStdFilterColumns(); $std_filter_columns_js = implode("<%jsstdjs%>", $std_filter_columns); $std_filter_columns_js = html_entity_decode($std_filter_columns_js, ENT_QUOTES, $default_charset); $smarty_obj->assign("std_filter_columns", $std_filter_columns_js); $std_filter_criteria = Zend_Json::encode($this->Date_Filter_Values); $smarty_obj->assign("std_filter_criteria", $std_filter_criteria); } $rel_fields = $this->adv_rel_fields; $smarty_obj->assign("REL_FIELDS", Zend_Json::encode($rel_fields)); // NEW ADVANCE FILTERS END $BLOCKJS = $this->getCriteriaJS(); $smarty_obj->assign("BLOCKJS_STD", $BLOCKJS); } if (in_array($step_name, array("ReportSharing", $get_all_steps))) { $roleid = $this->current_user->column_fields['roleid']; $user_array = getRoleAndSubordinateUsers($roleid); $userIdStr = ""; $userNameStr = ""; $m = 0; foreach ($user_array as $userid => $username) { if ($userid != $this->current_user->id) { if ($m != 0) { $userIdStr .= ","; $userNameStr .= ","; } $userIdStr .= "'" . $userid . "'"; $userNameStr .= "'" . escape_single_quotes(decode_html($username)) . "'"; $m++; } } require_once 'include/utils/GetUserGroups.php'; // ITS4YOU-UP SlOl 26. 4. 2013 9:47:59 $template_owners = get_user_array(false); if (isset($this->reportinformations["owner"]) && $this->reportinformations["owner"] != "") { $selected_owner = $this->reportinformations["owner"]; } else { $selected_owner = $this->current_user->id; } $smarty_obj->assign("TEMPLATE_OWNERS", $template_owners); $owner = isset($_REQUEST['template_owner']) && $_REQUEST['template_owner'] != '' ? $_REQUEST['template_owner'] : $selected_owner; $smarty_obj->assign("TEMPLATE_OWNER", $owner); $sharing_types = array("public" => vtranslate("PUBLIC_FILTER"), "private" => vtranslate("PRIVATE_FILTER"), "share" => vtranslate("SHARE_FILTER")); $smarty_obj->assign("SHARINGTYPES", $sharing_types); $sharingtype = "public"; if (isset($_REQUEST['sharing']) && $_REQUEST['sharing'] != '') { $sharingtype = $_REQUEST['sharing']; } elseif (isset($this->reportinformations["sharingtype"]) && $this->reportinformations["sharingtype"] != "") { $sharingtype = $this->reportinformations["sharingtype"]; } $smarty_obj->assign("SHARINGTYPE", $sharingtype); $cmod = return_specified_module_language($current_language, "Settings"); $smarty_obj->assign("CMOD", $cmod); $sharingMemberArray = array(); if (isset($_REQUEST['sharingSelectedColumns']) && $_REQUEST['sharingSelectedColumns'] != '') { $sharingMemberArray = explode("|", trim($_REQUEST['sharingSelectedColumns'], "|")); } elseif (isset($this->reportinformations["members_array"]) && !empty($this->reportinformations["members_array"])) { $sharingMemberArray = $this->reportinformations["members_array"]; } $sharingMemberArray = array_unique($sharingMemberArray); if (count($sharingMemberArray) > 0) { $outputMemberArr = array(); foreach ($sharingMemberArray as $setype => $shareIdArr) { $shareIdArr = explode("::", $shareIdArr); $shareIdArray = array(); $shareIdArray[$shareIdArr[0]] = $shareIdArr[1]; foreach ($shareIdArray as $shareType => $shareId) { switch ($shareType) { case "groups": $memberName = fetchGroupName($shareId); $memberDisplay = "Group::"; break; case "roles": $memberName = getRoleName($shareId); $memberDisplay = "Roles::"; break; case "rs": $memberName = getRoleName($shareId); $memberDisplay = "RoleAndSubordinates::"; break; case "users": $memberName = getUserFullName($shareId); $memberDisplay = "User::"; break; } $outputMemberArr[] = $shareType . "::" . $shareId; $outputMemberArr[] = $memberDisplay . $memberName; } } $smarty_obj->assign("MEMBER", array_chunk($outputMemberArr, 2)); } // ITS4YOU-END $userGroups = new GetUserGroups(); $userGroups->getAllUserGroups($this->current_user->id); $user_groups = $userGroups->user_groups; $groupIdStr = ""; $groupNameStr = ""; $l = 0; foreach ($user_groups as $i => $grpid) { $grp_details = getGroupDetails($grpid); if ($l != 0) { $groupIdStr .= ","; $groupNameStr .= ","; } $groupIdStr .= "'" . $grp_details[0] . "'"; $groupNameStr .= "'" . escape_single_quotes(decode_html($grp_details[1])) . "'"; $l++; } $visiblecriteria = getVisibleCriteria(); $smarty_obj->assign("VISIBLECRITERIA", $visiblecriteria); $smarty_obj->assign("GROUPNAMESTR", $groupNameStr); $smarty_obj->assign("USERNAMESTR", $userNameStr); $smarty_obj->assign("GROUPIDSTR", $groupIdStr); $smarty_obj->assign("USERIDSTR", $userIdStr); } if (in_array($step_name, array("ReportScheduler", $get_all_steps))) { // SEE ReportScheduler.php for this step for a reason of problem with incomplemete ReportScheduler object } if (in_array($step_name, array("ReportGraphs", $get_all_steps))) { if (isset($_REQUEST["chart_type"]) && $_REQUEST["chart_type"] != "" && $_REQUEST["chart_type"] != "none") { $selected_chart_type = vtlib_purify($_REQUEST["chart_type"]); } else { $selected_chart_type = $this->reportinformations["charts"]["charttype"]; } $smarty_obj->assign("IMAGE_PATH", $chart_type); if (isset($_REQUEST["data_series"]) && $_REQUEST["data_series"] != "" && $_REQUEST["data_series"] != "none") { $selected_data_series = vtlib_purify($_REQUEST["data_series"]); } else { $selected_data_series = $this->reportinformations["charts"]["dataseries"]; } if (isset($_REQUEST["charttitle"]) && $_REQUEST["charttitle"] != "") { $selected_charttitle = htmlspecialchars(vtlib_purify($_REQUEST["charttitle"])); } else { $selected_charttitle = $this->reportinformations["charts"]["charttitle"]; } $chart_type["horizontal"] = array("value" => vtranslate("LBL_CHART_horizontal", $this->currentModule), "selected" => $selected_chart_type == "horizontal" ? "selected" : ""); $chart_type["vertical"] = array("value" => vtranslate("LBL_CHART_vertical", $this->currentModule), "selected" => $selected_chart_type == "vertical" ? "selected" : ""); $chart_type["linechart"] = array("value" => vtranslate("LBL_CHART_linechart", $this->currentModule), "selected" => $selected_chart_type == "linechart" ? "selected" : ""); $chart_type["pie"] = array("value" => vtranslate("LBL_CHART_pie", $this->currentModule), "selected" => $selected_chart_type == "pie" ? "selected" : ""); $chart_type["pie3d"] = array("value" => vtranslate("LBL_CHART_pie3D", $this->currentModule), "selected" => $selected_chart_type == "pie3d" ? "selected" : ""); $chart_type["funnel"] = array("value" => vtranslate("LBL_CHART_funnel", $this->currentModule), "selected" => $selected_chart_type == "funnel" ? "selected" : ""); $smarty_obj->assign("CHART_TYPE", $chart_type); // selected labels from url if (isset($_REQUEST["lblurl"])) { global $default_charset; $lbl_url_string = html_entity_decode(vtlib_purify($_REQUEST["lblurl"]), ENT_QUOTES, $default_charset); } $lbl_url_string = str_replace("@AMPKO@", "&", $lbl_url_string); if ($lbl_url_string != "") { $lbl_url_arr = explode('$_@_$', $lbl_url_string); foreach ($lbl_url_arr as $key => $lbl_value) { if (strpos($lbl_value, 'hidden_') === false) { if (strpos($lbl_value, '_SC_lLbLl_') !== false) { $temp = explode('_SC_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = $temp_lbls[0]; $lbl_value = $temp_lbls[1]; $lbl_url_selected["SC"][$lbl_key] = $lbl_value; } if (strpos($lbl_value, '_SM_lLbLl_') !== false) { $temp = explode('_SM_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = $temp_lbls[0]; $lbl_value = $temp_lbls[1]; $lbl_url_selected["SM"][$lbl_key] = $lbl_value; } if (strpos($lbl_value, '_CT_lLbLl_') !== false) { $temp = explode('_CT_lLbLl_', $lbl_value); $temp_lbls = explode('_lLGbGLl_', $temp[1]); $lbl_key = $temp_lbls[0]; $lbl_value = $temp_lbls[1]; $lbl_url_selected["CT"][$lbl_key] = $lbl_value; } } } } $selectedSummariesString = vtlib_purify($_REQUEST["selectedSummariesString"]); if ($selectedSummariesString != "") { $selectedSummariesArray = explode(";", $selectedSummariesString); if (!empty($selectedSummariesArray)) { foreach ($selectedSummariesArray as $column_str) { if ($column_str != "") { if (isset($lbl_url_selected["SM"][$column_str]) && $lbl_url_selected["SM"][$column_str] != "") { $column_lbl = $lbl_url_selected["SM"][$column_str]; } else { $column_str_arr = explode(":", $column_str); $translate_arr = explode("_", $column_str_arr[2]); $translate_module = $translate_arr[0]; unset($translate_arr[0]); $translate_str = implode("_", $translate_arr); $translate_mod_str = return_module_language($current_language, $translate_module); if (isset($translate_mod_str[$translate_str])) { $column_lbl = $translate_mod_str[$translate_str]; } else { $column_lbl = $translate_str; } } $data_series[$column_str] = array("value" => $column_lbl, "selected" => $column_str == $selected_data_series ? "selected" : ""); } } } } if (empty($data_series) && $selected_data_series != "") { $column_lbl = $this->getColumnStr_Label($selected_data_series, "SM"); $data_series[$selected_data_series] = array("value" => $column_lbl, "selected" => "selected"); } $smarty_obj->assign("DATA_SERIES", $data_series); $smarty_obj->assign("CHART_TITLE", $selected_charttitle); } return $smarty_obj; } }