/** * Function to get customfield entries * @param string $module - Module name * return array $cflist - customfield entries */ function getBlockListEntries($module) { $tabid = getTabid($module); global $adb; global $theme; global $current_language; if ($module == "Events") { $module = "Calendar"; } $cur_module_strings = return_specified_module_language($current_language, $module); $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $dbQuery = "select blockid,blocklabel,sequence from ec_blocks where tabid={$tabid} and visible = 0 order by sequence"; $result = $adb->query($dbQuery); $row = $adb->fetch_array($result); $count = 1; $cflist = array(); if ($row != '') { do { $cf_element = array(); $cf_element['no'] = $count; if (isset($cur_module_strings[$row["blocklabel"]])) { $cf_element['label'] = $cur_module_strings[$row["blocklabel"]]; } else { $cf_element['label'] = $row["blocklabel"]; } $cf_element['sequence'] = $row["sequence"]; //getCreateCustomBlockForm(customModule,blockid,tabid,label,order) $cf_element['tool'] = '<img src="' . $image_path . 'editfield.gif" border="0" style="cursor:pointer;" onClick="fnvshobj(this,\'createblock\');getCreateCustomBlockForm(\'' . $module . '\',\'' . $row["blockid"] . '\',\'' . $tabid . '\',\'' . $cf_element['label'] . '\',\'' . $row["sequence"] . '\')" alt="Edit" title="Edit"/> | <img style="cursor:pointer;" onClick="deleteCustomBlock(' . $row["blockid"] . ',\'' . $module . '\', \'' . $row["columnname"] . '\', \'' . $row["uitype"] . '\')" src="' . $image_path . 'delete.gif" border="0" alt="Delete" title="Delete"/></a>'; $cflist[] = $cf_element; $count++; } while ($row = $adb->fetch_array($result)); } return $cflist; }
/** * Function to get customfield entries * @param string $module - Module name * return array $cflist - customfield entries */ function getLayoutListEntries($module) { $tabid = getTabid($module); global $adb; global $theme; global $current_language; global $app_strings; if ($module == "Events") { $module = "Calendar"; } $cur_module_strings = return_specified_module_language($current_language, $module); $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $query = "select * from ec_blocks where tabid='" . $tabid . "' order by sequence"; $block_result = $adb->query($query); $blcoklist = array(); while ($block_row = $adb->fetch_array($block_result)) { $blockid = $block_row['blockid']; $blocklabel = $block_row['blocklabel']; if (isset($cur_module_strings[$blocklabel])) { $blocklabel = $cur_module_strings[$blocklabel]; } $dbQuery = "select ec_field.fieldid,ec_field.fieldlabel,ec_field.block,ec_field.sequence,ec_field.typeofdata from ec_field inner join ec_def_org_field on ec_def_org_field.fieldid=ec_field.fieldid where ec_def_org_field.visible=0 and ec_field.tabid={$tabid} and displaytype in(1,2,4) and ec_field.block='" . $blockid . "' order by ec_field.block,ec_field.sequence"; $result = $adb->query($dbQuery); $row = $adb->fetch_array($result); $count = 1; $cflist = array(); if ($row != '') { do { $cf_element = array(); $cf_element['no'] = $count; if (isset($cur_module_strings[$row["fieldlabel"]])) { $cf_element['fieldlabel'] = $cur_module_strings[$row["fieldlabel"]]; } elseif (isset($app_strings[$row["fieldlabel"]])) { $cf_element['fieldlabel'] = $app_strings[$row["fieldlabel"]]; } else { $cf_element['fieldlabel'] = $row["fieldlabel"]; } $cf_element['sequence'] = $row["sequence"]; $typeofdata = $row["typeofdata"]; if (strpos($typeofdata, "~M") > -1) { $typeofdata = "true"; } else { $typeofdata = "false"; } $cf_element['typeofdata'] = $typeofdata; //getCreateCustomBlockForm(customModule,blockid,tabid,label,order) $cf_element['tool'] = '<img src="' . $image_path . 'editfield.gif" border="0" style="cursor:pointer;" onClick="fnvshobj(this,\'createLayout\');getFieldLayoutForm(\'' . $module . '\',\'' . $row["fieldid"] . '\',\'' . $tabid . '\',\'' . $cf_element['fieldlabel'] . '\',\'' . $blocklabel . '\',\'' . $row["sequence"] . '\',\'' . $row['block'] . '\',\'' . $typeofdata . '\')" alt="' . $app_strings['LNK_EDIT'] . '" title="' . $app_strings['LNK_EDIT'] . '"/>'; $cflist[] = $cf_element; $count++; } while ($row = $adb->fetch_array($result)); } $blcoklist[$blocklabel] = $cflist; } return $blcoklist; }
function getCustomBlocks($module, $tabid) { //$tabid = getTabid($module); global $adb; global $theme; global $current_language; $cur_module_strings = return_specified_module_language($current_language, $module); $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $dbQuery = "select blockid,blocklabel,sequence from ec_blocks where tabid={$tabid} and visible = 0 order by sequence"; $result = $adb->getList($dbQuery); $cflist = array(); foreach ($result as $row) { if (isset($cur_module_strings[$row["blocklabel"]])) { $cflist[$row['blockid']] = $cur_module_strings[$row["blocklabel"]]; } else { $cflist[$row['blockid']] = $row["blocklabel"]; } } return $cflist; }
function getFenzuModuleInfo($module) { global $adb; global $current_language; $current_mod_strings = return_specified_module_language($current_language, $module); $block_info = array(); $tabid = getTabid($module); $Sql = "select distinct block,ec_field.tabid,name,blocklabel from ec_field inner join ec_blocks on ec_blocks.blockid=ec_field.block inner join ec_tab on ec_tab.tabid=ec_field.tabid where ec_field.block not in(40,6,75,35,30,54,60,66,72) and ec_tab.tabid='{$tabid}' order by block"; $result = $adb->query($Sql); while ($block_result = $adb->fetch_array($result)) { $block_label = $block_result['blocklabel']; if (trim($block_label) == '') { $block_info[$pre_block_label] = $block_info[$pre_block_label] . "," . $block_result['block']; } else { if (isset($current_mod_strings[$block_label])) { $lan_block_label = $current_mod_strings[$block_label]; } else { $lan_block_label = $block_label; } $block_info[$lan_block_label] = $block_result['block']; } $pre_block_label = $lan_block_label; } $this->module_list[$module] = $block_info; return $this->module_list; }
<?php require_once "include/database/PearDatabase.php"; global $current_user; global $adb; $mod_strings = return_specified_module_language("zh_cn", "Settings"); $now = date("Y-m-d H:i:s"); $userid = $_REQUEST['userid']; if (empty($userid)) { die("CurrentUser->ID is null,Please Check it!"); } $old_endtime = $_REQUEST['endtime']; if (empty($old_endtime) || $old_endtime == '0000-00-00 00:00:00') { $old_endtime = ''; } //价格6元 $price = 6; $newtcdate = $_REQUEST['newtcdate']; if ($newtcdate == 'onemonth') { if (!empty($old_endtime)) { $endtime = date("Y-m-d H:i:s", strtotime("1 month", strtotime($old_endtime))); } else { $endtime = date("Y-m-d H:i:s", strtotime("1 month")); } $chargefee = $price * 1; } if ($newtcdate == 'threemonths') { if (!empty($old_endtime)) { $endtime = date("Y-m-d H:i:s", strtotime("3 months", strtotime($old_endtime))); } else { $endtime = date("Y-m-d H:i:s", strtotime("3 months"));
function getTranslatedColumnFields($module) { global $log; global $current_language; $import_mod_strings = return_specified_module_language($current_language, $module); $log->debug("Entering getTranslatedColumnFields() method ..."); global $adb; $column_fld = array(); $tabid = getTabid($module); $sql = "select ec_field.* from ec_field inner join ec_def_org_field on ec_def_org_field.fieldid=ec_field.fieldid where ec_def_org_field.visible=0 and ec_field.tabid='" . $tabid . "' order by block,sequence"; $result = $adb->query($sql); $noofrows = $adb->num_rows($result); for ($i = 0; $i < $noofrows; $i++) { $fieldname = $adb->query_result($result, $i, "fieldname"); $fieldlabel = $adb->query_result($result, $i, "fieldlabel"); if (isset($import_mod_strings[$fieldlabel])) { $column_fld[$fieldname] = $import_mod_strings[$fieldlabel]; } else { $column_fld[$fieldname] = $fieldlabel; } } $log->debug("Exiting getTranslatedColumnFields method ..."); return $column_fld; }
<?php $ModuleVar = $_REQUEST["ModuleVar"]; global $adb; $tabid = getTabid($ModuleVar); $printArray = array(); $query = "select ec_field.fieldlabel,columnname from ec_field where tabid='" . $tabid . "' and columnname=fieldname and uitype in(1,2,11,13,15,5,70,1021,1022,1023,21,19,87,86,85,88,71,17,7,9,56,33)"; $result = $adb->query($query); global $current_language; $cur_module_strings = return_specified_module_language($current_language, $ModuleVar); //echo $query; $num_rows = $adb->num_rows($result); $optionsstr = "<option value=0 selected> " . $app_strings["LBL_NONE"] . " </option>"; $prefix = "var."; if ($ModuleVar == "Accounts" || $ModuleVar == "Accounts" || $ModuleVar == "Accounts" || $ModuleVar == "Accounts" || $ModuleVar == "Accounts") { } switch ($ModuleVar) { case "Accounts": $prefix = "var.ACCOUNT_"; break; case "Contacts": $prefix = "var.CONTACT_"; break; case "Vendors": $prefix = "var.ACCOUNT_"; break; case "Vcontacts": $prefix = "var.CONTACT_"; break; case "Products": $prefix = "product.";
<?php $currentModule = $_REQUEST['relatedmodule']; $mod_strings = return_specified_module_language($current_language, $currentModule); include 'include/Ajax/UpdateCollectTotalInf.php';
<?php global $adb, $current_language; $module = addslashes($_REQUEST["langmod"]); $mod_lang = return_specified_module_language($current_language, $module); $module_lang_labels = array_flip($mod_lang); $module_lang_labels = array_flip($module_lang_labels); asort($module_lang_labels); $keys = implode('||', array_keys($module_lang_labels)); $values = implode('||', $module_lang_labels); echo $keys . '|@|' . $values; exit;
function getCustomViewModuleInfo($module) { global $adb; global $current_language; $current_mod_strings = return_specified_module_language($current_language, $module); $block_info = array(); $modules_list = explode(",", $module); if ($module == "Calendar") { $module = "Calendar','Events"; $modules_list = array('Calendar', 'Events'); } // Tabid mapped to the list of block labels to be skipped for that tab. $skipBlocksList = array(getTabid('Contacts') => array('LBL_IMAGE_INFORMATION'), getTabid('HelpDesk') => array('LBL_COMMENTS'), getTabid('Products') => array('LBL_IMAGE_INFORMATION'), getTabid('Faq') => array('LBL_COMMENT_INFORMATION'), getTabid('Quotes') => array('LBL_RELATED_PRODUCTS'), getTabid('PurchaseOrder') => array('LBL_RELATED_PRODUCTS'), getTabid('SalesOrder') => array('LBL_RELATED_PRODUCTS'), getTabid('Invoice') => array('LBL_RELATED_PRODUCTS')); $Sql = "select distinct block,vtiger_field.tabid,name,blocklabel from vtiger_field inner join vtiger_blocks on vtiger_blocks.blockid=vtiger_field.block inner join vtiger_tab on vtiger_tab.tabid=vtiger_field.tabid where displaytype != 3 and vtiger_tab.name in (" . generateQuestionMarks($modules_list) . ") and vtiger_field.presence in (0,2) order by block"; $result = $adb->pquery($Sql, array($modules_list)); if ($module == "Calendar','Events") { $module = "Calendar"; } $pre_block_label = ''; while ($block_result = $adb->fetch_array($result)) { $block_label = $block_result['blocklabel']; $tabid = $block_result['tabid']; // Skip certain blocks of certain modules if (array_key_exists($tabid, $skipBlocksList) && in_array($block_label, $skipBlocksList[$tabid])) { continue; } if (trim($block_label) == '') { $block_info[$pre_block_label] = $block_info[$pre_block_label] . "," . $block_result['block']; } else { $lan_block_label = $current_mod_strings[$block_label]; if (isset($block_info[$lan_block_label]) && $block_info[$lan_block_label] != '') { $block_info[$lan_block_label] = $block_info[$lan_block_label] . "," . $block_result['block']; } else { $block_info[$lan_block_label] = $block_result['block']; } } $pre_block_label = $lan_block_label; } $this->module_list[$module] = $block_info; return $this->module_list; }
global $adb, $current_language, $current_user, $mod_strings; switch ($_REQUEST["handler"]) { case "fill_lang": $module = addslashes($_REQUEST["langmod"]); $mod_lang = return_specified_module_language($current_language, $module); $module_lang_labels = array_flip($mod_lang); $module_lang_labels = array_flip($module_lang_labels); asort($module_lang_labels); $keys = implode('||', array_keys($module_lang_labels)); $values = implode('||', $module_lang_labels); echo $keys . '|@|' . $values; break; case "confirm_portal": $module = addslashes($_REQUEST["langmod"]); $curr_templatename = $_REQUEST["curr_templatename"]; $mod_lang = return_specified_module_language($current_language, "XMLExport4You"); $sql = "SELECT filename\n FROM vtiger_xmlexport4you\n INNER JOIN vtiger_xmlexport4you_settings USING(templateid)\n WHERE is_portal=? AND module=?"; $params = array("1", $module); $result = $adb->pquery($sql, $params); $confirm = ""; if ($adb->num_rows($result) > 0) { $templatename = $adb->query_result($result, 0, "filename"); $confirm = $mod_lang["LBL_XMLEXPORT4YOU_TEMPLATE"] . " '" . $templatename . "' " . $mod_lang["LBL_REPLACED_PORTAL_TEMPLATE"] . " '" . $curr_templatename . "' " . $mod_lang["LBL_AS_PORTAL_TEMPLATE"]; } else { $confirm = $mod_lang["LBL_VTIGER_TEMPLATE"] . " " . $mod_lang["LBL_REPLACED_PORTAL_TEMPLATE"] . " '" . $curr_templatename . "' " . $mod_lang["LBL_AS_PORTAL_TEMPLATE"]; } echo $confirm; break; case "templates_order": $inStr = $_REQUEST["tmpl_order"]; $inStr = rtrim($inStr, "#");
function export_all($type) { global $log, $list_max_entries_per_page; $log->debug("Entering export_all(" . $type . ") method ..."); global $adb; $focus = 0; $content = ''; if ($type != "") { //changed by dingjianting on 2009-2-15 for supporting new module require_once "modules/{$type}/{$type}.php"; $focus = new $type(); } $log = LoggerManager::getLogger('export_' . $type); $where = ''; /* if ( isset($_REQUEST['all']) ) { $where = ''; } else { $where = $_SESSION['export_where']; } */ if (!isset($_REQUEST['allids']) || $_REQUEST['allids'] == "") { $where = ""; } else { $allids = str_replace(";", ",", $_REQUEST['allids']); $allids = substr($allids, 0, -1); $where = $crmid . " in (" . $allids . ")"; } $search_type = $_REQUEST['search_type']; $export_data = $_REQUEST['export_data']; $viewname = $_REQUEST['viewname']; $entityArr = getEntityTable($type); $ec_crmentity = $entityArr["tablename"]; $entityidfield = $entityArr["entityidfield"]; $crmid = $ec_crmentity . "." . $entityidfield; $order_by = ""; $query = $focus->create_export_query($order_by, $where); if (isset($_SESSION['export_where']) && $_SESSION['export_where'] != '' && $search_type == 'includesearch') { $where = $_SESSION['export_where']; $query .= ' and (' . $where . ') '; } if (($search_type == 'withoutsearch' || $search_type == 'includesearch') && $export_data == 'selecteddata') { $idstring = str_replace(";", ",", $_REQUEST['idstring']); $idstring = substr($idstring, 0, -1); if ($idstring != "") { $query .= ' and ' . $crmid . ' in (' . $idstring . ')'; } } if ($export_data == 'vieweddata' && $viewname != "" && $viewname != 0) { $oCustomView = new CustomView($type); if ($type == "SalesOrder" || $type == "PurchaseOrder") { $query = $oCustomView->getExportModifiedCvListQuery($viewname, $query, $type, true); //getModifiedCvListQuery } else { $query = $oCustomView->getExportModifiedCvListQuery($viewname, $query, $type, false); //getModifiedCvListQuery } } if (isset($_SESSION['nav_start']) && $_SESSION['nav_start'] != '' && $export_data == 'currentpage') { $start_rec = $_SESSION['nav_start']; $limit_start_rec = $start_rec == 0 ? 0 : $start_rec - 1; $query_order_by = $crmid; $sorder = "desc"; $result = $adb->limitQuery2($query, $limit_start_rec, $list_max_entries_per_page, $query_order_by, $sorder); } else { $query .= " order by " . $crmid . " desc"; $result = $adb->query($query, true, "Error exporting {$type}: " . "<BR>{$query}"); } $numRows = $adb->num_rows($result); $fields_array = $adb->getFieldsArray($result); global $current_language; $spec_mod_strings = return_specified_module_language($current_language, $type); foreach ($fields_array as $key => $fieldlabel) { if (isset($spec_mod_strings[$fieldlabel])) { $fields_array[$key] = $spec_mod_strings[$fieldlabel]; } } $header = implode("\",\"", array_values($fields_array)); $header = "\"" . $header; $header .= "\"\r\n"; $content .= $header; $column_list = implode(",", array_values($fields_array)); while ($val = $adb->fetchByAssoc($result, -1, false)) { $new_arr = array(); foreach ($val as $key => $value) { if ($key == "description") { $value = br2nl_vt($value); } array_push($new_arr, preg_replace("/\"/", "\"\"", $value)); } $line = implode("\",\"", $new_arr); $line = "\"" . $line; $line .= "\"\r\n"; $content .= $line; } $log->debug("Exiting export_all method ..."); return $content; }
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; } }
private function x21($efocus) { global $x0b, $x0c, $x0d, $x0e, $x0f, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19, $x1a, $x1b, $x1c, $x1d, $x1e, $x1f, $x20, $x21, $x22, $x23, $x24, $x25, $x26; $commentlist = ""; $prefix = ""; if ($efocus->column_fields["record_module"] == "HelpDesk") { $prefix = "ticket"; } elseif ($efocus->column_fields["record_module"] == "Faq") { $prefix = "faq"; } if ($prefix != "") { $mod_lang = return_specified_module_language($this->language, $efocus->column_fields["record_module"]); $sql = "SELECT * FROM vtiger_" . $prefix . "comments WHERE " . $prefix . "id=" . $efocus->id; $result = $this->db->query($sql); while ($row = $this->db->fetchByAssoc($result)) { $comment = $row["comments"]; $crtime = getValidDisplayDate($row["createdtime"]); $body = ""; if ($prefix == "ticket") { $author = $this->x19($row["ownerid"]); $body = $comment . "<br />" . $mod_lang["LBL_AUTHOR"] . ": " . $author . "<br />" . $mod_lang["Created Time"] . ": " . $crtime . "<br /><br />"; } else { $body = $comment . "<br />" . $mod_lang["Created Time"] . ": " . $crtime . "<br /><br />"; } $commentlist .= $body; } } return $commentlist; }
function getCollectColumnOpts() { global $adb; global $app_strings, $current_language; $current_module = $this->reportmodule; $tabid = getTabid($current_module); $mod_strings = return_specified_module_language($current_language, $current_module); $collectopts = ""; $selected = ""; if ($this->type == 'count') { $selected = "selected"; } $collectopts .= "<option value='count' {$selected}>记录数</option>"; if ($this->type == 'sum') { $selectoptval = implode(";", $this->collectcolumnfield); } $ssql = "select ec_field.* from ec_field INNER JOIN ec_def_org_field ON ec_def_org_field.fieldid=ec_field.fieldid AND ec_def_org_field.visible=0 inner join ec_tab on ec_tab.tabid = ec_field.tabid where ec_field.uitype != 50 and ec_field.tabid=" . $tabid . " and ec_field.displaytype = 1 union select * from ec_field where ec_field.displaytype=3 and ec_field.tabid=" . $tabid . " order by sequence"; // echo $ssql; $result = $adb->query($ssql); while ($row = $adb->fetch_array($result)) { $fieldtablename = $row["tablename"]; $fieldcolname = $row["columnname"]; $fieldname = $row["fieldname"]; $fieldtype = $row["typeofdata"]; $fieldtype = explode("~", $fieldtype); $fieldtypeofdata = $fieldtype[0]; $fieldlabel = $row["fieldlabel"]; if (isset($mod_strings[$fieldlabel])) { $fieldlabel = $mod_strings[$fieldlabel]; } elseif (isset($app_strings[$fieldlabel])) { $fieldlabel = $app_strings[$fieldlabel]; } $optionvalue = "{$fieldlabel};{$fieldname};{$fieldtablename};{$fieldcolname}"; $columnname = substr($fieldcolname, -2); if (($fieldtype[0] == "N" || $fieldtype[0] == "NN" || $fieldtype[0] == "I") && $columnname != "id") { $selected = ""; if ($this->type == 'sum' && $optionvalue == $selectoptval) { $selected = "selected"; } $collectopts .= "<option value='{$optionvalue}' {$selected}>{$fieldlabel}</option>"; } } return $collectopts; }
$query = "update ec_field set block='" . $blockid . "',sequence=" . $order . ",typeofdata='" . $new_typeofdata . "' where fieldid=" . $fieldid; $adb->query($query); global $current_language; global $root_directory; if (!is_dir($root_directory . "cache/modules/" . $fld_module)) { mkdir($root_directory . "cache/modules/" . $fld_module); } if (!is_dir($root_directory . "cache/modules/" . $fld_module . "/language/")) { mkdir($root_directory . "cache/modules/" . $fld_module . "/language/"); } $language_file_path = $root_directory . "cache/modules/" . $fld_module . "/language/" . $current_language . ".lang.php"; if (!is_file($language_file_path)) { touch($language_file_path); } if (is_writable($language_file_path)) { $cur_module_strings = return_specified_module_language($current_language, $fld_module); $custom_module_strings = return_custom_module_language($current_language, $fld_module); $query = "select fieldlabel from ec_field where fieldid=" . $fieldid; $result = $adb->query($query); $src_fieldlabel = $adb->query_result($result, 0, 'fieldlabel'); if (isset($cur_module_strings[$src_fieldlabel])) { $bk = chr(10); // The sign of line break $qo = ' '; // The sign for quote $string = ''; $fd = fopen($language_file_path, 'w'); fwrite($fd, '<?php' . $bk); //'$mod_strings = array ('.$bk if (is_array($custom_module_strings)) { $custom_module_strings[$src_fieldlabel] = $fieldlabel;
function getProductFieldLabelList($basemodule) { $fieldLabelList = array(); global $log; //$fieldlist = array("productname","productcode","serialno","unit_price","catalogname"); $log->debug("Entering getProductFieldLabelList() method ..."); $key = "inventory_product_fieldlabellist_" . $basemodule; $fieldLabelList = getSqlCacheData($key); if (!$fieldLabelList) { global $adb; global $current_language; $product_mod_strings = return_specified_module_language($current_language, "Products"); $fieldLabelList = array(); $sql = "select ec_productfieldlist.*,ec_field.fieldlabel from ec_productfieldlist inner join ec_field on ec_field.columnname=ec_productfieldlist.fieldname where ec_productfieldlist.module='" . $basemodule . "' and ec_field.tabid=14 order by ec_productfieldlist.id"; $result = $adb->query($sql); $noofrows = $adb->num_rows($result); for ($i = 0; $i < $noofrows; $i++) { $fieldarr = array(); //$fieldname = $adb->query_result($result,$i,"fieldname"); //if($fieldname == "catalogid") $fieldname = "catalogname"; //elseif($fieldname == "vendor_id") $fieldname = "vendorname"; $fieldlabel = $adb->query_result($result, $i, "fieldlabel"); if (isset($product_mod_strings[$fieldlabel])) { $fieldlabel = $product_mod_strings[$fieldlabel]; } $width = $adb->query_result($result, $i, "width"); $fieldarr["LABEL"] = $fieldlabel; $fieldarr["LABEL_WIDTH"] = $width; $fieldLabelList[] = $fieldarr; unset($fieldarr); } setSqlCacheData($key, $fieldLabelList); } $log->debug("Exiting getProductFieldLabelList method ..."); return $fieldLabelList; }
} // ITS4YOU-END $smarty->assign("ALL_RELATED_MODULES", $All_Related_Modules); if ($select_module != "") { foreach ($All_Related_Modules[$select_module] as $rel_module) { $Related_Modules[$rel_module] = getTranslatedString($rel_module); } } $smarty->assign("RELATED_MODULES", $Related_Modules); foreach ($ModuleFields as $module => $Blocks) { $Optgroupts = array(); if (file_exists("modules/{$module}/language/{$default_language}.lang.php")) { //kontrola na $default_language pretoze vo funkcii return_specified_module_language sa kontroluje $current_language a ak neexistuje tak sa pouzije $default_language $current_mod_strings = return_specified_module_language($current_language, $module); } else { $current_mod_strings = return_specified_module_language("en_us", $module); } $b = 0; foreach ($Blocks as $block_label => $block_fields) { $b++; $Options = array(); if (isset($current_mod_strings[$block_label]) and $current_mod_strings[$block_label] != "") { $optgroup_value = $current_mod_strings[$block_label]; } elseif (isset($app_strings[$block_label]) and $app_strings[$block_label] != "") { $optgroup_value = $app_strings[$block_label]; } elseif (isset($mod_strings[$block_label]) and $mod_strings[$block_label] != "") { $optgroup_value = $mod_strings[$block_label]; } else { $optgroup_value = $block_label; } $Optgroupts[] = '"' . $optgroup_value . '","' . $b . '"';
$Calendar4You->GetDefPermission($current_user->id); $detail_permissions = $Calendar4You->CheckPermissions("DETAIL", $record); if (!$detail_permissions) { NOPermissionDiv(); } if ($_SESSION['mail_send_error'] != "") { echo '<b><font color=red>' . $mod_strings["LBL_NOTIFICATION_ERROR"] . '</font></b><br>'; } //MSL if (function_exists('session_unregister')) { session_unregister('mail_send_error'); } else { unset($_SESSION['mail_send_error']); } //---------- $c_mod_strings = return_specified_module_language($current_language, "Calendar"); $focus = CRMEntity::getInstance("Calendar"); $smarty = new vtigerCRM_Smarty(); $activity_mode = vtlib_purify($_REQUEST['activity_mode']); //If activity_mode == null if (empty($activity_mode)) { $activity_mode = getEventActivityMode($record); } if ($activity_mode == 'Task') { $tab_type = 'Calendar'; $rel_tab_type = 'Calendar4You'; $smarty->assign("SINGLE_MOD", $c_mod_strings['LBL_TODO']); } elseif ($activity_mode == 'Events') { $rel_tab_type = $tab_type = 'Events'; $smarty->assign("SINGLE_MOD", $c_mod_strings['LBL_EVENT']); }
function getSortView($modname) { global $adb; $entityname = getModTabName($modname); $query = "select fieldid,columnname,fieldlabel from ec_field where \n\t\t\t\t\ttabid = {$entityname['tabid']} and uitype in (15,16,111) "; $result = $adb->getList($query); $numrows = $adb->num_rows($result); $treeproj = array(); $tree["treeid"] = 'tree'; $tree["treename"] = $app_strings["Category"]; $tree["click"] = ''; $tree["treeparent"] = '-1'; $treeproj[] = $tree; if ($numrows > 0) { $mod_strings = return_specified_module_language("zh_cn", $modname); for ($i = 0; $i < $numrows; $i++) { $fieldid = $adb->query_result($result, $i, "fieldid"); $columnname = $adb->query_result($result, $i, "columnname"); $fieldlabel = $adb->query_result($result, $i, "fieldlabel"); if ($app_strings[$fieldlabel]) { $fieldtitle = $app_strings[$fieldlabel]; } else { if ($mod_strings[$fieldlabel]) { $fieldtitle = $mod_strings[$fieldlabel]; } else { $fieldtitle = $fieldlabel; } } $tree = array(); $tree["treeid"] = $fieldid; $tree["treename"] = $fieldtitle; $tree["click"] = ''; $tree["treeparent"] = 'tree'; $treeproj[] = $tree; if ($columnname == 'account_type') { $colname = "accounttype"; } else { $colname = $columnname; } $picksql = "select colvalue from ec_picklist where colname = '{$colname}' order by sequence "; $pickresult = $adb->getList($picksql); $pickrows = $adb->num_rows($pickresult); if ($pickrows && $pickrows > 0) { for ($j = 0; $j < $pickrows; $j++) { $colvalue = $adb->query_result($pickresult, $j, "colvalue"); $tree = array(); $tree["treeid"] = $colvalue; $tree["treename"] = $colvalue; $tree["click"] = "search_field={$entityname['tablename']}.{$columnname}&\n\t\t\t\t\t\t\t\t\t\t\tsearch_text={$colvalue}&sortview={$sortview}"; $tree["treeparent"] = $fieldid; $treeproj[] = $tree; } } } } require_once "include/Zend/Json.php"; $json = new Zend_Json(); $jsontree = $json->encode($treeproj); return $jsontree; }
function getByModule_ColumnsList($module, $columnslist, $selected = "") { global $oCustomView, $current_language, $theme; global $app_list_strings; $advfilter = array(); $mod_strings = return_specified_module_language($current_language, $module); $check_dup = array(); foreach ($oCustomView->module_list[$module] as $key => $value) { $advfilter = array(); $label = $key; if (isset($columnslist[$module][$key])) { foreach ($columnslist[$module][$key] as $field => $fieldlabel) { if (!in_array($fieldlabel, $check_dup)) { if (isset($mod_strings[$fieldlabel])) { if ($selected == $field) { $advfilter_option['value'] = $field; $advfilter_option['text'] = $mod_strings[$fieldlabel]; $advfilter_option['selected'] = "selected"; } else { $advfilter_option['value'] = $field; $advfilter_option['text'] = $mod_strings[$fieldlabel]; $advfilter_option['selected'] = ""; } } else { if ($selected == $field) { $advfilter_option['value'] = $field; $advfilter_option['text'] = $fieldlabel; $advfilter_option['selected'] = "selected"; } else { $advfilter_option['value'] = $field; $advfilter_option['text'] = $fieldlabel; $advfilter_option['selected'] = ""; } } $advfilter[] = $advfilter_option; $check_dup[] = $fieldlabel; } } $advfilter_out[$label] = $advfilter; } } // Special case handling only for Calendar moudle - Not required for other modules. if ($module == 'Calendar') { $finalfield = array(); $finalfield1 = array(); $finalfield2 = array(); $newLabel = $mod_strings['LBL_CALENDAR_INFORMATION']; if (isset($advfilter_out[$mod_strings['LBL_TASK_INFORMATION']])) { $finalfield1 = $advfilter_out[$mod_strings['LBL_TASK_INFORMATION']]; } if (isset($advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']])) { $finalfield2 = $advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']]; } $finalfield[$newLabel] = array_merge($finalfield1, $finalfield2); if (isset($advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']])) { $finalfield[$mod_strings['LBL_CUSTOM_INFORMATION']] = $advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']]; } $advfilter_out = $finalfield; } return $advfilter_out; }
/** to get the standard filter criteria * @param $module(module name) :: Type String * @param $elected (selection status) :: Type String (optional) * @returns $filter Array in the following format * $filter = Array( 0 => array('value'=>$tablename:$colname:$fieldname:$fieldlabel,'text'=>$mod_strings[$field label],'selected'=>$selected), * 1 => array('value'=>$$tablename1:$colname1:$fieldname1:$fieldlabel1,'text'=>$mod_strings[$field label1],'selected'=>$selected), */ function getStdFilterHTML($module, $selected = "") { global $app_list_strings; global $oCustomView; global $current_language; $stdfilter = array(); $result = $oCustomView->getStdCriteriaByModule($module); $mod_strings = return_specified_module_language($current_language, $module); if (isset($result)) { foreach ($result as $key => $value) { if (isset($mod_strings[$value])) { if ($key == $selected) { $filter['value'] = $key; $filter['text'] = $app_list_strings['moduleList'][$module] . " - " . $mod_strings[$value]; $filter['selected'] = "selected"; } else { $filter['value'] = $key; $filter['text'] = $app_list_strings['moduleList'][$module] . " - " . $mod_strings[$value]; $filter['selected'] = ""; } } else { if ($key == $selected) { $filter['value'] = $key; $filter['text'] = $app_list_strings['moduleList'][$module] . " - " . $value; $filter['selected'] = 'selected'; } else { $filter['value'] = $key; $filter['text'] = $app_list_strings['moduleList'][$module] . " - " . $value; $filter['selected'] = ''; } } $stdfilter[] = $filter; } } return $stdfilter; }
private function x26($x93) { global $x15d, $x15e, $x15f, $x160, $x161, $x162, $x163, $x164, $x165, $x166, $x167, $x168, $x169, $x16a, $x16b, $x16c, $x16d, $x16e, $x16f, $x170, $x171, $x172, $x173, $x174, $x175, $x176, $x177, $x178; $x13d = ""; $x13e = ""; if ($x93->column_fields["record_module"] == "HelpDesk") { $x13e = "ticket"; } elseif ($x93->column_fields["record_module"] == "Faq") { $x13e = "faq"; } if ($x13e != "") { $xb6 = return_specified_module_language(self::$x0d, $x93->column_fields["record_module"]); $x3d = "SELECT * FROM vtiger_" . $x13e . "comments WHERE " . $x13e . "id=" . $x93->id; $x3e = self::$x0f->query($x3d); while ($x42 = self::$x0f->fetchByAssoc($x3e)) { $xd9 = $x42["comments"]; $x13f = getValidDisplayDate($x42["createdtime"]); $x1b = ""; if ($x13e == "ticket") { $x140 = $this->x1e($x42["ownerid"]); $x1b = $xd9 . "<br />" . $xb6["LBL_AUTHOR"] . ": " . $x140 . "<br />" . $xb6["Created Time"] . ": " . $x13f . "<br /><br />"; } else { $x1b = $xd9 . "<br />" . $xb6["Created Time"] . ": " . $x13f . "<br /><br />"; } $x13d .= $x1b; } } return $x13d; }
if (!$treeproj) { if ($modname == 'Contacts') { $modname = 'Accounts'; $entityname = getModTabName("Accounts"); } $query = "select fieldid,columnname,fieldlabel from ec_field where \n\t\t\t\t\ttabid = {$entityname['tabid']} and uitype in (15,16,111) "; $result = $adb->getList($query); $numrows = $adb->num_rows($result); $treeproj = array(); $tree["treeid"] = 'tree'; $tree["treename"] = $app_strings["Category"]; $tree["click"] = ''; $tree["treeparent"] = '-1'; $treeproj[] = $tree; if ($numrows > 0) { $mod_strings = return_specified_module_language("zh_cn", $modname); for ($i = 0; $i < $numrows; $i++) { $fieldid = $adb->query_result($result, $i, "fieldid"); $columnname = $adb->query_result($result, $i, "columnname"); $fieldlabel = $adb->query_result($result, $i, "fieldlabel"); if ($app_strings[$fieldlabel]) { $fieldtitle = $app_strings[$fieldlabel]; } else { if ($mod_strings[$fieldlabel]) { $fieldtitle = $mod_strings[$fieldlabel]; } else { $fieldtitle = $fieldlabel; } } $tree = array(); $tree["treeid"] = $fieldid;