예제 #1
0
$reportid = "";
if (isset($_REQUEST["record"]) && $_REQUEST["record"] != "") {
    $reportid = vtlib_purify($_REQUEST["record"]);
}
$scheduledReport = new ITS4YouScheduledReport($adb, $this->current_user, $reportid);
$availableUsersHTML = $scheduledReport->getAvailableUsersHTML();
$availableGroupsHTML = $scheduledReport->getAvailableGroupsHTML();
$availableRolesHTML = $scheduledReport->getAvailableRolesHTML();
$availableRolesAndSubHTML = $scheduledReport->getAvailableRolesAndSubordinatesHTML();
$smarty_obj->assign("AVAILABLE_USERS", $availableUsersHTML);
$smarty_obj->assign("AVAILABLE_GROUPS", $availableGroupsHTML);
$smarty_obj->assign("AVAILABLE_ROLES", $availableRolesHTML);
$smarty_obj->assign("AVAILABLE_ROLESANDSUB", $availableRolesAndSubHTML);
$scheduledReport->id = $reportid;
$scheduledReport->user = $current_user;
$scheduledReport->getReportScheduleInfo();
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'ajax') {
    $is_scheduled = $_REQUEST['isReportScheduled'];
    $report_format = $_REQUEST['scheduledReportFormat'];
    $selectedRecipientsHTML = $scheduledReport->getSelectedRecipientsHTML();
} else {
    $is_scheduled = $scheduledReport->isScheduled;
    $report_format = $scheduledReport->scheduledFormat;
    $selectedRecipientsHTML = $scheduledReport->getSelectedRecipientsHTML();
}
$smarty_obj->assign('IS_SCHEDULED', $is_scheduled);
$smarty_obj->assign('REPORT_FORMAT', $report_format);
$smarty_obj->assign("SELECTED_RECIPIENTS", $selectedRecipientsHTML);
$smarty_obj->assign("schtypeid", $scheduledReport->scheduledInterval['scheduletype']);
$smarty_obj->assign("schtime", $scheduledReport->scheduledInterval['time']);
$smarty_obj->assign("schday", $scheduledReport->scheduledInterval['date']);
예제 #2
0
 public static function ReportScheduler(Vtiger_Request $request, $viewer)
 {
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $mode = $request->get('mode');
     $adb = PearDatabase::getInstance();
     $current_user = Users_Record_Model::getCurrentUserModel();
     $viewer->assign("MODULE", $moduleName);
     $record = $request->get('record');
     $reportModel = ITS4YouReports_Record_Model::getCleanInstance($record);
     /* SCHEDULE REPORTS START */
     $availableUsersHTML = ITS4YouScheduledReport::getAvailableUsersHTML();
     $availableGroupsHTML = ITS4YouScheduledReport::getAvailableGroupsHTML();
     $availableRolesHTML = ITS4YouScheduledReport::getAvailableRolesHTML();
     $availableRolesAndSubHTML = ITS4YouScheduledReport::getAvailableRolesAndSubordinatesHTML();
     $viewer->assign("AVAILABLE_USERS", $availableUsersHTML);
     $viewer->assign("AVAILABLE_GROUPS", $availableGroupsHTML);
     $viewer->assign("AVAILABLE_ROLES", $availableRolesHTML);
     $viewer->assign("AVAILABLE_ROLESANDSUB", $availableRolesAndSubHTML);
     $scheduledReport = new ITS4YouScheduledReport($adb, $current_user, $record);
     if ($mode == "ChangeSteps") {
         $scheduledReport->getReportScheduleInfo();
         $is_scheduled = $request->get('isReportScheduled');
         $report_format = $request->get('scheduledReportFormat');
         $selectedRecipientsHTML = $scheduledReport->getSelectedRecipientsHTML();
     } else {
         $scheduledReport->getReportScheduleInfo();
         $is_scheduled = $scheduledReport->isScheduled;
         $report_format = explode(";", $scheduledReport->scheduledFormat);
         $selectedRecipientsHTML = $scheduledReport->getSelectedRecipientsHTML();
     }
     $viewer->assign('IS_SCHEDULED', $is_scheduled);
     foreach ($report_format as $sh_format) {
         $viewer->assign("REPORT_FORMAT_" . strtoupper($sh_format), true);
     }
     $viewer->assign("SELECTED_RECIPIENTS", $selectedRecipientsHTML);
     $viewer->assign("schtypeid", $scheduledReport->scheduledInterval['scheduletype']);
     $viewer->assign("schtime", $scheduledReport->scheduledInterval['time']);
     $viewer->assign("schday", $scheduledReport->scheduledInterval['date']);
     $viewer->assign("schweek", $scheduledReport->scheduledInterval['day']);
     $viewer->assign("schmonth", $scheduledReport->scheduledInterval['month']);
     /* SCHEDULE REPORTS END */
     $LBL_INFORMATIONS_4YOU = vtranslate("LBL_STEP9_INFO", $moduleName);
     $viewer->assign("LBL_INFORMATIONS_4YOU", $LBL_INFORMATIONS_4YOU);
     if ($mode == "ChangeSteps") {
         $tpl_name = "ReportSchedulerContent.tpl";
     } else {
         $tpl_name = "ReportScheduler.tpl";
     }
     return $viewer->view($tpl_name, $moduleName, true);
 }
예제 #3
0
 public function getReportHeaderInfo($noofrows = 0)
 {
     $final_return = $return = $return_name = $return_val = "";
     $return_arr = $col_order_arr = $summ_order_arr = array();
     $colspan = 2;
     global $default_charset;
     if (isset($this->reportinformations["reports4youid"]) && $this->reportinformations["reports4youid"] != "") {
         /*
          if (isset($this->reportinformations["reports4youid"]) && $this->reportinformations["reports4youid"] != "") {
          $return_val = $this->reportinformations["reports4youname"];
          } else {
          $return_val = vtranslate("LBL_REPORT_NAME", $this->currentModule);
          }
          $return_arr["reportname"] =  array("val"=>$return_val,"colspan"=>$colspan);
         */
         $return_val = "<b>" . vtranslate("LBL_Module", $this->currentModule) . ": </b>";
         $primarymodule_id = $this->reportinformations["primarymodule"];
         $primarymodule = vtlib_getModuleNameById($primarymodule_id);
         $return_val .= vtranslate($primarymodule, $primarymodule);
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_TOTAL", $this->currentModule) . ": </b><span id='_reportrun_total'>{$noofrows}</span> " . vtranslate("LBL_RECORDS", "ITS4YouReports");
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_TEMPLATE_OWNER", $this->currentModule) . ": </b>";
         $return_val .= getUserFullName($this->reportinformations["owner"]);
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_GroupBy", $this->currentModule) . ": </b>";
         for ($gi = 1; $gi < 4; $gi++) {
             if (isset($this->reportinformations["Group{$gi}"]) && $this->reportinformations["Group{$gi}"] != "" && $this->reportinformations["Group{$gi}"] != "none") {
                 $group_col_info = array();
                 // columns visibility control !!!!!!
                 if ($this->getColumnVisibilityPerm($this->reportinformations["Group{$gi}"]) == 0) {
                     $gp_column_lbl = $this->getColumnStr_Label($this->reportinformations["Group{$gi}"], "SC");
                     $group_col_info[] = $gp_column_lbl;
                     $group_col_info[] = vtranslate($this->reportinformations["Sort{$gi}"]);
                     if (isset($this->reportinformations["timeline_columnstr{$gi}"]) && $this->reportinformations["timeline_columnstr{$gi}"] != "" && $this->reportinformations["timeline_columnstr{$gi}"] != "@vlv@") {
                         $tr_arr = explode("@vlv@", $this->reportinformations["timeline_columnstr{$gi}"]);
                         $tl_option = "TL_" . $tr_arr[1];
                         $group_col_info[] = vtranslate("LBL_BY", $this->currentModule);
                         $group_col_info[] = vtranslate($tl_option, $this->currentModule);
                     }
                     $group_cols[] = implode(" ", $group_col_info);
                 }
             }
         }
         if (empty($group_cols)) {
             $group_cols[] = vtranslate("LBL_NONE", $this->currentModule);
         }
         $return_val .= implode(", ", $group_cols);
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_Sharing", $this->currentModule) . ": </b>";
         if (isset($this->reportinformations["sharingtype"]) && $this->reportinformations["sharingtype"] != "") {
             $sharingtype = vtranslate($this->reportinformations["sharingtype"]);
         }
         $sharing_with = "";
         if ($this->reportinformations["sharingtype"] == "share") {
             $sharingMemberArray = $this->reportinformations["members_array"];
             $sharingMemberArray = array_unique($sharingMemberArray);
             if (count($sharingMemberArray) > 0) {
                 $outputMemberArr = array();
                 foreach ($sharingMemberArray as $setype => $shareIdArr) {
                     $shareIdArr = explode("::", $shareIdArr);
                     $shareIdArray[$shareIdArr[0]] = $shareIdArr[1];
                     foreach ($shareIdArray as $shareType => $shareId) {
                         switch ($shareType) {
                             case "groups":
                                 $groupName_array = getGroupName($shareId);
                                 $memberName = $groupName_array[0];
                                 $memberDisplay = "Group::";
                                 break;
                             case "roles":
                                 $memberName = getRoleName($shareId);
                                 $memberDisplay = "Roles::";
                                 break;
                             case "rs":
                                 $memberName = getRoleName($shareId);
                                 $memberDisplay = "RoleAndSubordinates::";
                                 break;
                             case "users":
                                 $memberName = getUserName($shareId);
                                 $memberDisplay = "User::";
                                 break;
                         }
                         // $outputMemberArr[] = $shareType."::".$shareId;
                         $outputMemberArr[] = $memberDisplay . $memberName;
                     }
                 }
                 $outputMemberArr = array_unique($outputMemberArr);
             }
             if (!empty($outputMemberArr)) {
                 $sharing_with = " (" . implode(", ", $outputMemberArr) . ")";
             }
         }
         $return_val .= $sharingtype . $sharing_with;
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_Schedule", $this->currentModule) . ": </b>";
         $adb = PearDatabase::getInstance();
         require_once 'modules/ITS4YouReports/ScheduledReports4You.php';
         $scheduledReport = new ITS4YouScheduledReport($adb, $this->current_user, $this->record);
         $scheduledReport->getReportScheduleInfo();
         $is_scheduled = $scheduledReport->isScheduled;
         $schedule_info = "";
         $scheduled_arr = array(1 => "HOURLY", 2 => "DAILY", 3 => "WEEKLY", 4 => "BIWEEKLY", 5 => "MONTHLY", 6 => "ANNUALLY");
         if ($is_scheduled) {
             $schtypeid = $scheduledReport->scheduledInterval["scheduletype"];
             // $schedule_info_arr[] = vtranslate("LBL_SCHEDULE_EMAIL", $this->currentModule);
             $schedulerFormatArr = explode(";", $scheduledReport->scheduledFormat);
             if (!empty($schedulerFormatArr)) {
                 foreach ($schedulerFormatArr as $format_str) {
                     $translated_schedulerFormat[] = vtranslate($format_str, $this->currentModule);
                 }
             }
             // $schedule_info_arr[] = $scheduledReport->scheduledFormat;
             $schedule_info_arr[] = implode(", ", $translated_schedulerFormat);
             $schedule_info_arr[] = vtranslate($scheduled_arr[$schtypeid], $this->currentModule);
             $schtime = $scheduledReport->scheduledInterval['time'];
             $schday = $scheduledReport->scheduledInterval['day'];
             $schweek = $scheduledReport->scheduledInterval['day'];
             $schmonth = $scheduledReport->scheduledInterval['month'];
             $WEEKDAY_STRINGS = vtranslate("WEEKDAY_STRINGS", $this->currentModule);
             $MONTH_STRINGS = vtranslate("MONTH_STRINGS", $this->currentModule);
             switch ($schtypeid) {
                 case 1:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
                 case 2:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
                 case 3:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_ON", $this->currentModule) . " " . $WEEKDAY_STRINGS[$schday];
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
                 case 4:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_ON", $this->currentModule) . " " . $WEEKDAY_STRINGS[$schday];
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
                 case 5:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_ON", $this->currentModule) . " {$schday}. " . vtranslate("LBL_SCHEDULE_EMAIL_DAY", $this->currentModule);
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
                 case 6:
                     $schedule_info_arr[] = vtranslate("LBL_SCH_IN", $this->currentModule) . " " . $MONTH_STRINGS[$schmonth];
                     $schedule_info_arr[] = vtranslate("LBL_SCH_ON", $this->currentModule) . " {$schday}. " . vtranslate("LBL_SCHEDULE_EMAIL_DAY", $this->currentModule);
                     $schedule_info_arr[] = vtranslate("LBL_SCH_AT", $this->currentModule) . " {$schtime}";
                     break;
             }
             $schedule_info = implode(" ", $schedule_info_arr);
         } else {
             $schedule_info = vtranslate("LBL_NONE", $this->currentModule);
         }
         $return_val .= $schedule_info;
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_LIMIT", $this->currentModule) . ": </b>";
         if (!empty($this->reportinformations["summaries_columns"])) {
             $return_val .= vtranslate("LBL_Summaries", $this->currentModule) . " ";
             if (isset($this->reportinformations["summaries_limit"]) && $this->reportinformations["summaries_limit"] != "0") {
                 $summ_limit_str = $this->reportinformations["summaries_limit"] . " " . vtranslate("LBL_RECORDS", $this->currentModule);
             } else {
                 $summ_limit_str = vtranslate("LBL_ALL", $this->currentModule) . " " . strtolower(vtranslate("LBL_RECORDS", $this->currentModule));
             }
             $return_val .= $summ_limit_str;
             if ($this->reportinformations["selectedColumnsString"] != "") {
                 $return_val .= ", " . vtranslate("LBL_Details", $this->currentModule) . " ";
             }
         }
         if ($this->reportinformations["selectedColumnsString"] != "") {
             if (isset($this->reportinformations["columns_limit"]) && $this->reportinformations["columns_limit"] != "0") {
                 $limit_str = $this->reportinformations["columns_limit"] . " " . vtranslate("LBL_RECORDS", $this->currentModule);
             } else {
                 $limit_str = vtranslate("LBL_ALL", $this->currentModule) . " " . strtolower(vtranslate("LBL_RECORDS", $this->currentModule));
             }
             $return_val .= $limit_str;
         }
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_CHART_INFO", $this->currentModule) . ": </b>";
         $ch_column_populated = false;
         $new_ch_info = $n_ch_info = $ch_column_str = "";
         if (!empty($this->reportinformations["charts"])) {
             foreach ($this->reportinformations["charts"] as $chi => $ch_array) {
                 $ch_type = $ch_array["charttype"];
                 if ($ch_column_populated != true) {
                     if ($ch_array["x_group"] == "group1") {
                         $ch_column_lbl = GenerateObj::getHeaderLabel($this->record, "SC", "", $this->reportinformations["Group1"]);
                         if (is_array($ch_column_lbl) && $ch_column_lbl["lbl"] != "") {
                             $ch_column_lbl = $ch_column_lbl["lbl"];
                         }
                         $ch_column[] = $ch_column_lbl;
                     } elseif ($ch_array["x_group"] == "group2") {
                         $ch_column_lbl = GenerateObj::getHeaderLabel($this->record, "SC", "", $this->reportinformations["Group1"]);
                         if (is_array($ch_column_lbl) && $ch_column_lbl["lbl"] != "") {
                             $ch_column_lbl = $ch_column_lbl["lbl"];
                         }
                         $ch_column[] = $ch_column_lbl;
                         $ch_column_lbl = GenerateObj::getHeaderLabel($this->record, "SC", "", $this->reportinformations["Group1"]);
                         if (is_array($ch_column_lbl) && $ch_column_lbl["lbl"] != "") {
                             $ch_column_lbl = $ch_column_lbl["lbl"];
                         }
                         $ch_column[] = $ch_column_lbl;
                     }
                     $ch_column_str = implode(", ", $ch_column);
                     $ch_column_populated = true;
                 }
                 $ch_dataseries = GenerateObj::getHeaderLabel($this->record, "SM", "", $ch_array["dataseries"]);
                 if (is_array($ch_dataseries) && $ch_dataseries["lbl"] != "") {
                     $ch_dataseries = $ch_dataseries["lbl"];
                 }
                 $n_ch_info[] = vtranslate("LBL_CHART_{$ch_type}", $this->currentModule) . " " . vtranslate("LBL_CHART", $this->currentModule) . " ({$ch_dataseries})";
             }
             $new_ch_info = vtranslate("LBL_CHART_DataSeries", $this->currentModule) . " " . $ch_column_str . " [" . implode(", ", $n_ch_info) . "]";
         } else {
             $new_ch_info = " <small><i>(" . vtranslate("LBL_NO_CHARTS", $this->currentModule) . ")</i></small>";
         }
         $return_val .= $new_ch_info;
         /*
          if(isset($this->reportinformations["charts"]) && $this->reportinformations["charts"]["charttype"]=="" && isset($this->reportinformations["charts"]["dataseries"]) && $this->reportinformations["charts"]["dataseries"]!=""){
          $ch_info = " <small><i>(".vtranslate("LBL_NO_CHARTS", $this->currentModule).")</i></small>";
          }elseif(isset($this->reportinformations["Group1"]) && $this->reportinformations["Group1"]!="none" && isset($this->reportinformations["charts"]) && $this->reportinformations["charts"]["charttype"]!="none" && isset($this->reportinformations["charts"]["dataseries"]) && $this->reportinformations["charts"]["dataseries"]!=""){
          // columns visibility control !!!!!!
          if($this->getColumnVisibilityPerm($this->reportinformations["Group1"])==0 && $this->getColumnVisibilityPerm($this->reportinformations["charts"]["dataseries"])==0){
          $ch_column = GenerateObj::getHeaderLabel($this->record,"SC","",$this->reportinformations["Group1"]);
          if(is_array($ch_column) && $ch_column["lbl"]!=""){
          $ch_column = $ch_column["lbl"];
          }
          $ch_dataseries = GenerateObj::getHeaderLabel($this->record,"SM","",$this->reportinformations["charts"]["dataseries"]);
          if(is_array($ch_dataseries) && $ch_dataseries["lbl"]!=""){
          $ch_dataseries = $ch_dataseries["lbl"];
          }
          $ch_type = $this->reportinformations["charts"]["charttype"];
          $ch_info = vtranslate("LBL_CHART_$ch_type", $this->currentModule)." ".vtranslate("LBL_CHART", $this->currentModule)." ($ch_column, $ch_dataseries)";
          }
          }else{
          $ch_info = " <small><i>(".vtranslate("LBL_CHARE", $this->currentModule)." ".vtranslate("LBL_IGNORED", $this->currentModule)."!)</i></small>";
          }
          $return_val .= $ch_info;
         */
         $return_arr[] = array("val" => $return_val, "colspan" => "");
         $return_val = "<b>" . vtranslate("LBL_Columns", $this->currentModule) . ": </b>";
         $col_order_str = "";
         if (isset($this->reportinformations["selectedColumnsString"]) && $this->reportinformations["selectedColumnsString"] != "") {
             $selected_column_string = $this->reportinformations["selectedColumnsString"];
             $selected_column_array = explode(";", html_entity_decode($selected_column_string, ENT_QUOTES, $default_charset));
             if (!empty($selected_column_array)) {
                 foreach ($selected_column_array as $column_str) {
                     if ($column_str != "" && $column_str != "none") {
                         // columns visibility control !!!!!!
                         if ($this->getColumnVisibilityPerm($column_str) == 0) {
                             $column_lbl = $this->getColumnStr_Label($column_str, "SC");
                             $columns[] = $column_lbl;
                         }
                     }
                 }
             }
             if (isset($this->reportinformations["SortByColumn"]) && $this->reportinformations["SortByColumn"] != "none") {
                 $col_order_arr[] = vtranslate("LBL_SORT_FIELD", $this->currentModule);
                 $col_order_column = $this->getColumnStr_Label($this->reportinformations["SortByColumn"], "SC");
                 $col_order_arr[] = $col_order_column;
                 if ($this->reportinformations["SortOrderColumn"] == "DESC") {
                     $col_order_arr[] = vtranslate("Descending");
                 } else {
                     $col_order_arr[] = vtranslate("Ascending");
                 }
                 $col_order_str = implode(" ", $col_order_arr);
             }
         }
         if (empty($columns)) {
             $columns[] = vtranslate("LBL_NONE", $this->currentModule);
         }
         $return_val .= implode(", ", $columns);
         if ($this->reportinformations["timeline_type2"] == "cols" || $this->reportinformations["timeline_type3"] == "cols") {
             $return_val .= " <small><i>(" . vtranslate("LBL_NOT_A", $this->currentModule) . " " . vtranslate("LBL_IGNORED", $this->currentModule) . "!)</i></small>";
         }
         if ($col_order_str != "") {
             $return_val .= " ({$col_order_str})";
         }
         $return_arr[] = array("val" => $return_val, "colspan" => "2");
         $return_val = "<b>" . vtranslate("LBL_SummariesColumns", $this->currentModule) . ": </b>";
         $summ_order_str = "";
         if (isset($this->reportinformations["summaries_columns"]) && !empty($this->reportinformations["summaries_columns"])) {
             foreach ($this->reportinformations["summaries_columns"] as $column_arr) {
                 $column_str = $column_arr["columnname"];
                 // columns visibility control !!!!!!
                 if ($this->getColumnVisibilityPerm($column_str) == 0) {
                     $sm_column_lbl = $this->getColumnStr_Label($column_str, "SM");
                     $summaries_columns[] = $sm_column_lbl;
                 }
             }
             if (isset($this->reportinformations["summaries_orderby_columns"]) && !empty($this->reportinformations["summaries_orderby_columns"])) {
                 if ($this->reportinformations["summaries_orderby_columns"][0]["column"] != "none") {
                     $summ_order_arr[] = vtranslate("LBL_SORT_FIELD", $this->currentModule);
                     $summ_order_column = $this->getColumnStr_Label($this->reportinformations["summaries_orderby_columns"][0]["column"], "SM");
                     $summ_order_arr[] = $summ_order_column;
                     if ($this->reportinformations["summaries_orderby_columns"][0]["type"] == "DESC") {
                         $summ_order_arr[] = vtranslate("Descending");
                     } else {
                         $summ_order_arr[] = vtranslate("Ascending");
                     }
                     $summ_order_str = implode(" ", $summ_order_arr);
                 }
             }
         }
         if (empty($summaries_columns)) {
             $summaries_columns[] = vtranslate("LBL_NONE", $this->currentModule);
         }
         $return_val .= implode(", ", $summaries_columns);
         if ($summ_order_str != "") {
             $return_val .= " ({$summ_order_str})";
         }
         $return_arr[] = array("val" => $return_val, "colspan" => "2");
         $return_val = "<b>" . vtranslate("LBL_Filters", $this->currentModule) . ": </b>";
         $std_filter_columns = $this->getStdFilterColumns();
         if (isset($_REQUEST["reload"])) {
             $tmp = $this->getAdvanceFilterOptionsJSON($this->primarymodule);
             $criteria_columns = $this->getRequestCriteria($this->adv_sel_fields);
             if (!empty($criteria_columns)) {
                 if (isset($_REQUEST["reload"])) {
                     foreach ($criteria_columns as $group_id => $group_arr) {
                         $criteria_columns = $group_arr["columns"];
                         if (!empty($criteria_columns)) {
                             foreach ($criteria_columns as $criteria_groups_arr) {
                                 if ($criteria_groups_arr["columnname"] != "") {
                                     // columns visibility control !!!!!!
                                     if ($this->getColumnVisibilityPerm($criteria_groups_arr["columnname"]) == 0) {
                                         $column_condition = "";
                                         if ($criteria_groups_arr["column_condition"] != "") {
                                             $column_condition = $criteria_groups_arr["column_condition"];
                                         }
                                         if (in_array($criteria_groups_arr["columnname"], $std_filter_columns)) {
                                             $comparator = $criteria_groups_arr["comparator"];
                                             $comparator_val = $this->Date_Filter_Values[$comparator];
                                             $comparator_info = vtranslate($comparator_val, $this->currentModule);
                                             if ($comparator == "custom") {
                                                 $comparator_info_arr = explode("<;@STDV@;>", html_entity_decode(trim($criteria_groups_arr["value"]), ENT_QUOTES, $default_charset));
                                                 if ($comparator_info_arr[0] != "" && $comparator_info_arr[1] != "") {
                                                     $comparator_info .= vtranslate("BETWEEN", $this->currentModule) . " ";
                                                     $comparator_info .= $comparator_info_arr[0] . " ";
                                                     $comparator_info .= vtranslate("LBL_AND", $this->currentModule) . " ";
                                                     $comparator_info .= $comparator_info_arr[1];
                                                 } elseif ($comparator_info_arr[0] != "") {
                                                     $comparator_info .= vtranslate("LBL_IS", $this->currentModule) . " ";
                                                     $comparator_info .= $comparator_info_arr[0];
                                                 } elseif ($comparator_info_arr[1] != "") {
                                                     $comparator_info .= vtranslate("LBL_IS", $this->currentModule) . " ";
                                                     $comparator_info .= $comparator_info_arr[1];
                                                 }
                                             }
                                             $criteria_info_value = "";
                                         } else {
                                             $comparator = self::$adv_filter_options[$criteria_groups_arr["comparator"]];
                                             $comparator_info = vtranslate($comparator, $this->currentModule);
                                             $criteria_info_value = $criteria_groups_arr["value"];
                                         }
                                         $ft_column_lbl = $this->getColumnStr_Label($criteria_groups_arr["columnname"]);
                                         $condition_info = $ft_column_lbl . " " . $comparator_info . " " . $criteria_info_value . " " . $column_condition;
                                         $conditions_arr[$group_id][] = $condition_info;
                                     }
                                 }
                             }
                         }
                         $group_conditions[$group_id] = $group_arr["condition"];
                     }
                 }
             }
         } else {
             $criteria_columns = $this->reportinformations["advft_criteria"];
             $criteria_groups = $this->reportinformations["advft_criteria_groups"];
             if (!empty($criteria_groups) && !empty($criteria_columns)) {
                 foreach ($criteria_groups as $criteria_groups_arr) {
                     $group_id = $criteria_groups_arr["groupid"];
                     $group_condition = $criteria_groups_arr["group_condition"];
                     $group_conditions[$group_id] = $group_condition;
                 }
                 foreach ($criteria_columns as $criteria_groups_arr) {
                     if ($criteria_groups_arr["columnname"] != "") {
                         // filter columns and values visibility control !!!!!! start
                         if ($this->getColumnVisibilityPerm($criteria_groups_arr["columnname"]) == 0) {
                             if (array_key_exists($criteria_groups_arr["columnname"], $this->adv_sel_fields)) {
                                 $this->getColumnValuesVisibilityPerm($criteria_groups_arr["value"], $this->adv_sel_fields[$criteria_groups_arr["columnname"]]);
                             }
                         }
                         // filter columns and values visibility control !!!!!! end
                         $column_condition = "";
                         if ($criteria_groups_arr["column_condition"] != "") {
                             $column_condition = $criteria_groups_arr["column_condition"];
                         }
                         if (in_array($criteria_groups_arr["columnname"], $std_filter_columns)) {
                             $comparator = $criteria_groups_arr["comparator"];
                             $comparator_val = $this->Date_Filter_Values[$comparator];
                             $comparator_info = vtranslate($comparator_val, $this->currentModule);
                             if ($comparator == "custom") {
                                 $comparator_info_arr = explode("<;@STDV@;>", html_entity_decode(trim($criteria_groups_arr["value"]), ENT_QUOTES, $default_charset));
                                 if ($comparator_info_arr[0] != "" && $comparator_info_arr[1] != "") {
                                     $comparator_info .= vtranslate("BETWEEN", $this->currentModule) . " ";
                                     $comparator_info .= $comparator_info_arr[0] . " ";
                                     $comparator_info .= vtranslate("LBL_AND", $this->currentModule) . " ";
                                     $comparator_info .= $comparator_info_arr[1];
                                 } elseif ($comparator_info_arr[0] != "") {
                                     $comparator_info .= vtranslate("LBL_IS", $this->currentModule) . " ";
                                     $comparator_info .= $comparator_info_arr[0];
                                 } elseif ($comparator_info_arr[1] != "") {
                                     $comparator_info .= vtranslate("LBL_IS", $this->currentModule) . " ";
                                     $comparator_info .= $comparator_info_arr[1];
                                 }
                             }
                             $criteria_info_value = "";
                         } else {
                             $comparator = self::$adv_filter_options[$criteria_groups_arr["comparator"]];
                             $comparator_info = vtranslate($comparator, $this->currentModule);
                             $criteria_info_value = $criteria_groups_arr["value"];
                         }
                         $ft_column_lbl = $this->getColumnStr_Label($criteria_groups_arr["columnname"]);
                         $conditions_arr[$criteria_groups_arr["groupid"]][] = $ft_column_lbl . " " . $comparator_info . " " . $criteria_info_value . " " . $column_condition;
                     }
                 }
             }
         }
         $filters_str = "";
         if (!empty($group_conditions)) {
             foreach ($group_conditions as $g_condition_id => $g_condition) {
                 if (isset($conditions_arr[$g_condition_id]) && !empty($conditions_arr[$g_condition_id])) {
                     $filters_str .= " (" . trim(implode(" ", $conditions_arr[$g_condition_id])) . ") ";
                     if ($g_condition != "") {
                         $filters_str .= " " . vtranslate($g_condition, $this->currentModule) . " ";
                     }
                 }
             }
         }
         if ($filters_str == "") {
             $filters_str .= vtranslate("LBL_NONE", $this->currentModule);
         }
         $return_val .= $filters_str;
         $return_arr[] = array("val" => $return_val, "colspan" => "2");
         $td_i = 0;
         foreach ($return_arr as $ra_key => $ra_arr) {
             if (isset($ra_arr["colspan"]) && $ra_arr["colspan"] != "") {
                 $ra_colspan = $ra_arr["colspan"];
             } else {
                 $ra_colspan = 1;
             }
             $ra_val = $ra_arr["val"];
             if ($ra_key === "reportname") {
                 $return_name .= "<tr>";
                 $return_name .= "<td colspan='{$ra_colspan}' class='rpt4youGrpHeadInfoText' width='100%' style='border:0px;'>";
                 $return_name .= "{$ra_val}";
                 $return_name .= "</td>";
                 $return_name .= "</tr>";
             } else {
                 if ($td_i == 0) {
                     $return .= "<tr>";
                 }
                 $return .= "<td colspan='{$ra_colspan}' class='rpt4youGrpHeadInfo' style='text-align:left;padding-left:20px;width:50%;'>";
                 $return .= $ra_val;
                 $return .= "</td>";
                 $td_i += $ra_colspan;
                 if ($td_i == $colspan) {
                     $return .= "</tr>";
                     $td_i = 0;
                 }
             }
             /* $ra_val = $ra_arr["val"];
                if(isset($ra_arr["colspan"]) && $ra_arr["colspan"]!=""){
                $ra_colspan = $ra_arr["colspan"];
                }else{
                $ra_colspan = 1;
                }
                if($td_i==0){
                $return .= "<tr>";
                }
                if(is_numeric($ra_key)){
                $return .= "<td colspan='$ra_colspan' class='rpt4youGrpHeadInfo' style='text-align:left;padding-left:10px;width:50%;'>";
                }else{
                $return .= "<td colspan='$ra_colspan' class='rpt4youGrpHeadInfo' style='text-align:center;font-size:25px;width:100%;'>";
                }
                $return .= $ra_val;
                $return .= "</td>";
                $td_i += $ra_colspan;
                if($td_i==$colspan){
                $return .= "</tr>";
                $td_i = 0;
                } */
         }
         //$final_return = "<table class='rpt4youTableText' style='margin-top:1em;' width='100%'>";
         $final_return = "<table class='rpt4youTableText' width='100%'>";
         $final_return .= $return_name;
         $final_return .= "</table>";
         $final_return .= "<table width='100%' ><tr><td align='center'>";
         $final_return .= "<table class='rpt4youTable' width='98%'>";
         $final_return .= $return;
         $final_return .= "</table>";
         $final_return .= "</td></tr></table>";
         // ITS4YOU-UP SlOl 4. 12. 2014 13:56:43
         // ADD PAGE BREAK AFTER HEADER INFO disabled - remove // to enable it please
         // $final_return .= "<div style='page-break-after:always'></div>";
     }
     return $final_return;
 }