/** * Fills info in array about grid. * For new add row * @param array $rowInfoArr array with total info, that assignes grid */ function fillGridShowInfo(&$rowInfoArr) { $rowInfoArr["data"] = array(); $editlink = ""; $copylink = ""; // add inline add row if ($this->mainPSet->isAllowToAdd($this->mainField) && $this->permis[$this->tName]['add']) { $row = array(); $row["rowclass"] = "gridRowAdd " . $this->makeClassName("hiddenelem"); $row["rsclass"] = "gridRowSepAdd " . $this->makeClassName("hiddenelem"); if ($this->listGridLayout == gltVERTICAL) { $row["rowattrs"] .= "vertical=\"1\""; } $record = array(); $record["edit_link"] = true; $record["inlineedit_link"] = true; $record["view_link"] = true; $record["copy_link"] = true; $record["checkbox"] = true; $record["checkbox"] = true; $record["editlink_attrs"] = "id=\"editLink_add" . $this->id . "\""; $record["copylink_attrs"] = "id=\"copyLink_add" . $this->id . "\" name=\"copyLink_add" . $this->id . "\""; $record["viewlink_attrs"] = "id=\"viewLink_add" . $this->id . "\" name=\"viewLink_add" . $this->id . "\""; $record["checkbox_attrs"] = "id=\"check_add" . $this->id . "\" name=\"selection[]\""; // add container for inline add controls $addedInlineAddContainer = false; if ($this->permis[$this->tName]['edit'] && $this->isUseInlineEdit) { $record["inlineeditlink_attrs"] = "id=\"inlineEdit_add" . $this->id . "\" "; $addedInlineAddContainer = true; } for ($i = 0; $i < count($this->allDetailsTablesArr); $i++) { //detail tables $dDataSourceTable = $this->allDetailsTablesArr[$i]['dDataSourceTable']; $dShortTable = $this->allDetailsTablesArr[$i]['dShortTable']; $record[$dShortTable . "_dtable_link"] = $this->permis[$dDataSourceTable]['add'] || $this->permis[$dDataSourceTable]['search']; $record[$dShortTable . "_dtablelink_attrs"] = " href=\"" . GetTableLink($dShortTable, "list") . "\" id=\"master_" . $dShortTable . "_add" . $this->id . "\" "; if ($this->allDetailsTablesArr[$i]['previewOnList'] == DP_INLINE) { $record[$dShortTable . "_dtablelink_attrs"] = "id = \"" . $dShortTable . "_preview" . $this->id . "\"\n\t\t\t\t\t\tcaption = \"" . GetTableCaption(GoodFieldName($dDataSourceTable)) . "\" \n\t\t\t\t\t\thref = \"" . GetTableLink($dShortTable, "list") . "\"\n\t\t\t\t\t\tstyle = \"display:none;\""; } } $this->addSpansForGridCells('add', $record); for ($i = 0; $i < count($this->listFields); $i++) { $field = $this->listFields[$i]['fName']; $gFieldName = GoodFieldName($field); if (!$addedInlineAddContainer) { if ($i == 0 && !($this->permis[$this->tName]['edit'] && $this->isUseInlineEdit)) { $record[$gFieldName . "_value"] .= "<span id=\"inlineEdit_add" . $this->id . "\"></span>"; } } $record[$gFieldName . "_class"] .= $this->fieldClass($field); if (isset($this->hiddenColumnClasses[$field])) { $record[$gFieldName . "_class"] .= " " . $this->hiddenColumnClasses[$field]; if ($this->listGridLayout != gltHORIZONTAL) { $record[$gFieldName . "_label_class"] = $this->hiddenColumnClasses[$field]; } } } if ($this->colsOnPage > 1) { $record["endrecord_block"] = true; } $record["grid_recordheader"] = true; $record["grid_vrecord"] = true; $row["grid_record"] = array("data" => array()); //set the $row["grid_record"] value $this->setRowsGridRecord($row, $record); for ($i = 1; $i < $this->colsOnPage; $i++) { $rec = array(); if ($i < $this->colsOnPage - 1) { $rec["endrecord_block"] = true; } if ($row["grid_record"]["data"]) { $row["grid_record"]["data"][] = $rec; } } $row["grid_rowspace"] = true; $row["grid_recordspace"] = array("data" => array()); for ($i = 0; $i < $this->colsOnPage * 2 - 1; $i++) { $row["grid_recordspace"]["data"][] = true; } $rowInfoArr["data"][] = $row; } }
$tdataFact_SalesTransaction["Fact_Salescol"] = $fdata; $tables_data["Fact_SalesTransaction"] =& $tdataFact_SalesTransaction; $field_labels["Fact_SalesTransaction"] =& $fieldLabelsFact_SalesTransaction; $fieldToolTips["Fact_SalesTransaction"] =& $fieldToolTipsFact_SalesTransaction; $page_titles["Fact_SalesTransaction"] =& $pageTitlesFact_SalesTransaction; // -----------------start prepare master-details data arrays ------------------------------// // tables which are detail tables for current table (master) $detailsTablesData["Fact_SalesTransaction"] = array(); // GroupMaster $dIndex = 0; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "GroupMaster"; $detailsParam["dOriginalTable"] = "GroupMaster"; $detailsParam["dType"] = PAGE_LIST; $detailsParam["dShortTable"] = "GroupMaster"; $detailsParam["dCaptionTable"] = GetTableCaption("GroupMaster"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = false; $detailsParam["previewOnList"] = 1; $detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 0; $detailsTablesData["Fact_SalesTransaction"][$dIndex] = $detailsParam; $detailsTablesData["Fact_SalesTransaction"][$dIndex]["masterKeys"] = array(); $detailsTablesData["Fact_SalesTransaction"][$dIndex]["masterKeys"][] = "GroupID"; $detailsTablesData["Fact_SalesTransaction"][$dIndex]["detailKeys"] = array(); $detailsTablesData["Fact_SalesTransaction"][$dIndex]["detailKeys"][] = "Groupid"; // tables which are master tables for current table (detail) $masterTablesData["Fact_SalesTransaction"] = array();
function getDefaultValue($series, $row) { if ($this->chrt_array["chart_type"]["type"] == "ohlc" || $this->chrt_array["chart_type"]["type"] == "candlestick") { $res = "O: " . $this->formatCurrency("{%Open}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; $res .= "H: " . $this->formatCurrency("{%High}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; $res .= "L: " . $this->formatCurrency("{%Low}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; $res .= "C: " . $this->formatCurrency("{%Close}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; } elseif ($this->chrt_array["chart_type"]["type"] == "bubble") { $res = "Series: {%SeriesName}" . "\r"; $res .= "Point Name: " . $this->labelFormat($this->strLabel, $row) . "" . "\r"; $res .= "Value: " . $this->formatCurrency("{%Value}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; $res .= "Bubble Size: {%BubbleSize}" . "\r"; } elseif ($this->chrt_array["chart_type"]["type"] == "2d_bar" || $this->chrt_array["chart_type"]["type"] == "2d_column" || $this->chrt_array["chart_type"]["type"] == "area" || $this->chrt_array["chart_type"]["type"] == "funnel") { $res = $this->labelFormat($this->strLabel, $row) . " - " . $this->formatCurrency("{%YValue}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series); } elseif ($this->chrt_array["chart_type"]["type"] == "line" || $this->chrt_array["chart_type"]["type"] == "combined") { $res = "Series: {%SeriesName}" . "\r"; $res .= "Point Name: " . $this->labelFormat($this->strLabel, $row) . "\r"; $res .= "Value: " . $this->formatCurrency("{%Value}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; } elseif ($this->chrt_array["chart_type"]["type"] == "2d_pie" || $this->chrt_array["chart_type"]["type"] == "2d_doughnut") { $res = $this->labelFormat($this->strLabel, $row) . " - " . $this->formatCurrency("{%YValue}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series) . "\r"; $res .= "Percent: {%YPercentOfSeries}{numDecimals:" . $this->arrFormatDecimal[$series] . "}%"; } else { $res = $this->formatCurrency("{%YValue}{numDecimals:" . $this->arrFormatDecimal[$series] . "}", $series); } if (count($this->detailTablesData)) { $tableCaption = GetTableCaption($this->detailTablesData[0]['dDataSourceTable']); $tableCaption = $tableCaption ? $tableCaption : runner_htmlspecialchars($this->detailTablesData[0]['dDataSourceTable']); $res .= "\r Click to see " . $tableCaption . " details"; } return $res; }
/** * Proccess master-details on list grid * * @param array $record * @param array $data */ function proccessDetailGridInfo(&$record, &$data, $gridRowInd) { for ($i = 0; $i < count($this->allDetailsTablesArr); $i++) { $dDataSourceTable = $this->allDetailsTablesArr[$i]['dDataSourceTable']; $dShortTable = $this->allDetailsTablesArr[$i]['dShortTable']; $masterquery = "mastertable=" . rawurlencode($this->tName); $this->controlsMap['gridRows'][$gridRowInd]['masterKeys'][$dDataSourceTable] = array(); $detailid = array(); foreach ($this->masterKeysByD[$i] as $idx => $m) { $d = $this->detailKeysByD[$i][$idx]; $masterquery .= "&masterkey" . ($idx + 1) . "=" . rawurlencode($data[$m]); // Don't need to use here make_db_value func, it use in countDetailsRecsNoSubQ func $detailid[] = $data[$m]; $this->controlsMap['gridRows'][$gridRowInd]['masterKeys'][$dDataSourceTable]["masterkey" . ($idx + 1)] = $data[$m]; } // add count of child records to SQL if (($this->allDetailsTablesArr[$i]['dispChildCount'] || $this->allDetailsTablesArr[$i]['hideChild']) && (!$this->subQueriesSupp || !$this->subQueriesSupAccess || $this->theSameFieldsType)) { $data[$dDataSourceTable . "_cnt"] = $this->countDetailsRecsNoSubQ($i, $detailid); } //detail tables $record[$dShortTable . "_dtable_link"] = $this->permis[$dDataSourceTable]['add'] || $this->permis[$dDataSourceTable]['search']; if ($this->allDetailsTablesArr[$i]['dispChildCount']) { if ($data[$dDataSourceTable . "_cnt"] + 0) { $record[$dShortTable . "_childcount"] = true; } $record[$dShortTable . "_childnumber"] = $data[$dDataSourceTable . "_cnt"]; $record[$dShortTable . "_childnumber_attr"] = " id='cntDet_" . $dShortTable . "_" . $this->recId . "'"; $this->controlsMap['gridRows'][$gridRowInd]['childNum'] = $data[$dDataSourceTable . "_cnt"]; } //if($this->pSet->getDPType($dDataSourceTable) == DP_POPUP) // $record[$dShortTable."_dtablelink_attrs"].= " onmouseover=\"RollDetailsLink.showPopup(this,'".$dShortTable."_detailspreview.php'+this.href.substr(this.href.indexOf('?')));\" onmouseout=\"RollDetailsLink.hidePopup();\""; if ($this->pSet->getDPType($dDataSourceTable) == DP_INLINE) { $record[$dShortTable . "_dtablelink_attrs"] = "\r\n\t\t\t\t\tid = \"" . $dShortTable . "_preview" . $this->recId . "\" \r\n\t\t\t\t\tcaption = \"" . htmlspecialchars(GetTableCaption(GoodFieldName($dDataSourceTable))) . "\"" . "href = \"" . $dShortTable . "_list.php?" . $masterquery . "\""; } else { $record[$dShortTable . "_dtablelink_attrs"] = "id=\"master_" . $dShortTable . "_" . $this->recId . "\" href=\"" . $dShortTable . "_list.php?" . $masterquery . "\""; } if ($this->allDetailsTablesArr[$i]['hideChild']) { if (!($data[$dDataSourceTable . "_cnt"] + 0)) { $record[$dShortTable . "_dtablelink_attrs"] .= " class=\"runner-hiddenelem\""; } } } }
function xt_caption($params) { echo GetTableCaption($params["custom1"]); }
$detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 1; $detailsTablesData["calendar_table"][$dIndex] = $detailsParam; $detailsTablesData["calendar_table"][$dIndex]["masterKeys"] = array(); $detailsTablesData["calendar_table"][$dIndex]["masterKeys"][] = "dt"; $detailsTablesData["calendar_table"][$dIndex]["detailKeys"] = array(); $detailsTablesData["calendar_table"][$dIndex]["detailKeys"][] = "TranDate"; // Current Year Sales $dIndex = 1; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "Current Year Sales"; $detailsParam["dOriginalTable"] = "Fact_SalesTransaction"; $detailsParam["dType"] = PAGE_CHART; $detailsParam["dShortTable"] = "Current_Year_Sales"; $detailsParam["dCaptionTable"] = GetTableCaption("Current_Year_Sales"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = false; $detailsParam["previewOnList"] = 0; $detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 1; $detailsTablesData["calendar_table"][$dIndex] = $detailsParam; $detailsTablesData["calendar_table"][$dIndex]["masterKeys"] = array(); $detailsTablesData["calendar_table"][$dIndex]["masterKeys"][] = "dt"; $detailsTablesData["calendar_table"][$dIndex]["detailKeys"] = array(); $detailsTablesData["calendar_table"][$dIndex]["detailKeys"][] = "TranDate"; // tables which are master tables for current table (detail) $masterTablesData["calendar_table"] = array();
/** * Get the default page's title template * @param String page * @param String table A good table name * @param ProjectSettings pSet * @return STring */ protected function getDefaultPageTitle($page, $table, $pSet) { if ($page == "add") { return GetTableCaption($table) . ", " . "Add new record"; } if ($page == "edit") { return GetTableCaption($table) . ", " . "Edit record" . " [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "view") { return GetTableCaption($table) . ", " . "View record" . " [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "export") { return "Export"; } if ($page == "import") { return GetTableCaption($table) . ", " . "Import"; } if ($page == "search") { return GetTableCaption($table) . " - " . "Advanced search"; } if ($page == "print") { return GetTableCaption($table); } if ($page == "rprint") { return GetTableCaption($table); } if ($page == "list") { return GetTableCaption($table); } if ($page == "masterlist") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "masterchart") { return GetTableCaption($table); } if ($page == "masterreport") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "masterprint") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "login") { return "Login"; } if ($page == "register") { return "Register"; } if ($page == "changepwd") { return "Change password"; } if ($page == "remind") { return "Password reminder"; } if ($page == "chart") { return GetTableCaption($table); } if ($page == "report") { return GetTableCaption($table); } if ($page == "dashboard") { return GetTableCaption($table); } if ($page == "menu") { return "Menu"; } }
$tdataDimDept["DepartmentDesc"] = $fdata; $tables_data["DimDept"] =& $tdataDimDept; $field_labels["DimDept"] =& $fieldLabelsDimDept; $fieldToolTips["DimDept"] =& $fieldToolTipsDimDept; $page_titles["DimDept"] =& $pageTitlesDimDept; // -----------------start prepare master-details data arrays ------------------------------// // tables which are detail tables for current table (master) $detailsTablesData["DimDept"] = array(); // Fact_SalesTransaction $dIndex = 0; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "Fact_SalesTransaction"; $detailsParam["dOriginalTable"] = "Fact_SalesTransaction"; $detailsParam["dType"] = PAGE_LIST; $detailsParam["dShortTable"] = "Fact_SalesTransaction"; $detailsParam["dCaptionTable"] = GetTableCaption("Fact_SalesTransaction"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = false; $detailsParam["previewOnList"] = 1; $detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 0; $detailsTablesData["DimDept"][$dIndex] = $detailsParam; $detailsTablesData["DimDept"][$dIndex]["masterKeys"] = array(); $detailsTablesData["DimDept"][$dIndex]["masterKeys"][] = "DeptID"; $detailsTablesData["DimDept"][$dIndex]["detailKeys"] = array(); $detailsTablesData["DimDept"][$dIndex]["detailKeys"][] = "TranDept"; // tables which are master tables for current table (detail) $masterTablesData["DimDept"] = array();
$tdatacompany["coy_city"] = $fdata; $tables_data["company"] =& $tdatacompany; $field_labels["company"] =& $fieldLabelscompany; $fieldToolTips["company"] =& $fieldToolTipscompany; $page_titles["company"] =& $pageTitlescompany; // -----------------start prepare master-details data arrays ------------------------------// // tables which are detail tables for current table (master) $detailsTablesData["company"] = array(); // StockMaster $dIndex = 0; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "StockMaster"; $detailsParam["dOriginalTable"] = "StockMaster"; $detailsParam["dType"] = PAGE_LIST; $detailsParam["dShortTable"] = "StockMaster"; $detailsParam["dCaptionTable"] = GetTableCaption("StockMaster"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = false; $detailsParam["previewOnList"] = 1; $detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 1; $detailsTablesData["company"][$dIndex] = $detailsParam; $detailsTablesData["company"][$dIndex]["masterKeys"] = array(); $detailsTablesData["company"][$dIndex]["masterKeys"][] = "coy_id"; $detailsTablesData["company"][$dIndex]["masterKeys"][] = "grp_id"; $detailsTablesData["company"][$dIndex]["detailKeys"] = array(); $detailsTablesData["company"][$dIndex]["detailKeys"][] = "Coy_Id"; $detailsTablesData["company"][$dIndex]["detailKeys"][] = "Grp_id";
function RunnerPage(&$params) { global $locale_info, $cCharset, $page_layouts; // copy properties to object RunnerApply($this, $params); $this->pSet = new ProjectSettings($this->tName, $this->pageType); $this->pSetEdit = $this->pSet; $this->cipherer = new RunnerCipherer($this->tName, $this->pSet); include_once getabspath("classes/controls/EditControlsContainer.php"); $this->controls = new EditControlsContainer($this); include_once getabspath("classes/controls/ViewControlsContainer.php"); $this->viewControls = new ViewControlsContainer($this->pSet, $this->pageType, $this); $this->gQuery = $this->pSet->getSQLQuery(); //set google map configuration $this->googleMapCfg = array('markerAsLinkToView' => true, 'isUseMainMaps' => false, 'isUseFieldsMaps' => false, 'isUseGoogleMap' => false, 'APIcode' => GetGlobalData("apiGoogleMapsCode", ""), 'mainMapIds' => array(), 'fieldMapsIds' => array(), 'mapsData' => array()); $this->debugJSMode = false; if ($this->flyId < $this->id + 1) { $this->flyId = $this->id + 1; } // get permissions if ($this->tName) { $this->permis[$this->tName] = $this->getPermissions(); $this->eventsObject =& getEventObject($this->tName); } if (!$this->sessionPrefix) { $this->sessionPrefix = $this->tName; } $this->setSessionVariables(); // get locking object $this->lockingObj = GetLockingObject($this->tName); $this->is508 = isEnableSection508(); $this->isEncryptionEnabled = isEncryptionEnabled(); $this->isEncryptionByPHPEnabled = isEncryptionByPHPEnabled(); $this->isUseVideo = $this->pSet->isUseVideo(); $this->isUseAudio = $this->pSet->isUseAudio(); $this->strCaption = GetTableCaption(GoodFieldName($this->tName)); $this->isTableType = $this->pSet->isTableType(); $this->isAddWebRep = GetGlobalData("isAddWebRep", false); // get details keys by master table $this->detailKeysByM = $this->pSet->getDetailKeysByMasterTable($this->masterTable); $this->isDynamicPerm = GetGlobalData("isDynamicPerm", false); $this->shortTableName = $this->pSet->getShortTableName(); $this->showAddInPopup = $this->pSet->isShowAddInPopup(); $this->showEditInPopup = $this->pSet->isShowEditInPopup(); $this->showViewInPopup = $this->pSet->isShowViewInPopup(); $this->isResizeColumns = $this->pSet->isResizeColumns(); $this->isUseAjaxSuggest = $this->pSet->isUseAjaxSuggest(); $this->useDetailsPreview = $this->pSet->isUseDetailsPreview(); $this->isShowDetailTables = displayDetailsOn($this->tName, $this->pageType); // get all details table for current table $this->allDetailsTablesArr = $this->pSet->getDetailTablesArr(); // set template file $this->setTemplateFile(); // init jsSettings $this->jsSettings["tableSettings"][$this->tName] = array(); $this->jsSettings["tableSettings"][$this->tName]["proxy"] = array("proxy" => ""); $this->jsSettings["tableSettings"][$this->tName]['fieldSettings'] = array(); $this->settingsMap["globalSettings"] = array(); $this->settingsMap["globalSettings"]["ext"] = "php"; $this->settingsMap["globalSettings"]["charSet"] = $cCharset; $this->settingsMap["globalSettings"]["debugMode"] = $this->debugJSMode; $this->settingsMap["globalSettings"]["googleMapsApiCode"] = $this->googleMapCfg['APIcode']; $this->settingsMap["globalSettings"]["shortTNames"][$this->tName] = $this->shortTableName; //isMobile $this->settingsMap["globalSettings"]["isMobile"] = isMobile(); // s508 must be in global settings $this->settingsMap['globalSettings']['s508'] = $this->is508; $this->settingsMap["globalSettings"]["locale"]["dateFormat"] = $locale_info["LOCALE_IDATE"]; $this->settingsMap["globalSettings"]["locale"]["startWeekDay"] = $locale_info["LOCALE_IFIRSTDAYOFWEEK"]; $this->settingsMap["globalSettings"]["locale"]["dateDelimiter"] = $locale_info["LOCALE_SDATE"]; $this->settingsMap["tableSettings"] = array(); $this->settingsMap['tableSettings']['hasEvents'] = array("default" => false, "jsName" => "hasEvents"); $this->settingsMap["tableSettings"]["listIcons"] = array("default" => false, "jsName" => "listIcons"); $this->settingsMap["tableSettings"]["strCaption"] = array("default" => "", "jsName" => "strCaption"); $this->settingsMap["tableSettings"]["isUseAudio"] = array("default" => false, "jsName" => "isUseAudio"); $this->settingsMap["tableSettings"]["isUseVideo"] = array("default" => false, "jsName" => "isUseVideo"); $this->settingsMap['tableSettings']['isVerLayout'] = array("default" => false, "jsName" => "isVertLayout"); $this->settingsMap["tableSettings"]["rowHighlite"] = array("default" => false, "jsName" => "isUseHighlite"); $this->settingsMap["tableSettings"]["isUseToolTips"] = array("default" => false, "jsName" => "isUseToolTips"); $this->settingsMap['tableSettings']['recsPerRowList'] = array("default" => 1, "jsName" => "recsPerRowList"); $this->settingsMap["tableSettings"]["showAddInPopup"] = array("default" => false, "jsName" => "showAddInPopup"); $this->settingsMap["tableSettings"]["showEditInPopup"] = array("default" => false, "jsName" => "showEditInPopup"); $this->settingsMap["tableSettings"]["showViewInPopup"] = array("default" => false, "jsName" => "showViewInPopup"); $this->settingsMap["tableSettings"]["isResizeColumns"] = array("default" => false, "jsName" => "isUseResize"); $this->settingsMap["tableSettings"]["isUseAjaxSuggest"] = array("default" => true, "jsName" => "ajaxSuggest"); $this->settingsMap["tableSettings"]["useDetailsPreview"] = array("default" => false, "jsName" => "isUseDP"); $this->settingsMap['tableSettings']['isUsebuttonHandlers'] = array("default" => false, "jsName" => "isUseButtons"); if ($this->pageType == PAGE_REGISTER || $this->pageType == PAGE_CHANGEPASS) { $layout = GetPageLayout('', $this->pageType); } else { $layout = GetPageLayout($this->shortTableName, $this->pageType); } if ($layout) { $rtl = $this->xt->getReadingOrder() == 'RTL' ? 'RTL' : ''; $this->jsSettings['tableSettings'][$this->tName]['pageCSS'] = "styles/" . $layout->style . '/style' . $rtl . ".css"; $this->jsSettings['tableSettings'][$this->tName]['pageLayout'] = "pagestyles/" . $layout->name . $rtl . ".css"; $this->jsSettings['tableSettings'][$this->tName]['pageSkinStyle'] = $layout->style . " page-" . $layout->name; } $this->settingsMap["fieldSettings"]["UseTimestamp"] = array("default" => false, "jsName" => "isUseTimeStamp"); $this->settingsMap["fieldSettings"]["strName"] = array("default" => "", "jsName" => "strName"); $this->settingsMap["fieldSettings"]["ShowTime"] = array("default" => false, "jsName" => "showTime"); $this->settingsMap["fieldSettings"]["EditFormat"] = array("default" => "", "jsName" => "editFormat"); $this->settingsMap["fieldSettings"]["DateEditType"] = array("default" => EDIT_DATE_SIMPLE, "jsName" => "dateEditType"); $this->settingsMap["fieldSettings"]["RTEType"] = array("default" => "", "jsName" => "RTEType"); $this->settingsMap["fieldSettings"]["ViewFormat"] = array("default" => "", "jsName" => "viewFormat"); $this->settingsMap["fieldSettings"]["validateAs"] = array("default" => null, "jsName" => "validation"); $this->settingsMap["fieldSettings"]["strEditMask"] = array("default" => null, "jsName" => "mask"); $this->settingsMap["fieldSettings"]["LastYearFactor"] = array("default" => 10, "jsName" => "lastYear"); $this->settingsMap["fieldSettings"]["InitialYearFactor"] = array("default" => 100, "jsName" => "initialYear"); $this->jsSettings["tableSettings"][$this->tName]["strCaption"] = $this->strCaption; $this->jsSettings["tableSettings"][$this->tName]["pageMode"] = $this->mode; if ($this->listAjax) { $this->jsSettings['tableSettings'][$this->tName]['pageMode'] = LIST_AJAX; } if ($this->lockingObj) { $this->jsSettings['tableSettings'][$this->tName]['locking'] = true; } //If current table has detail tables if (count($this->allDetailsTablesArr)) { if ($this->pageType == PAGE_LIST) { $this->jsSettings['tableSettings'][$this->tName]['detailTables'] = array(); } $this->jsSettings['tableSettings'][$this->tName]['isShowDetails'] = $this->isShowDetailTables; for ($i = 0; $i < count($this->allDetailsTablesArr); $i++) { $this->settingsMap["globalSettings"]['shortTNames'][$this->allDetailsTablesArr[$i]['dDataSourceTable']] = $this->allDetailsTablesArr[$i]['dShortTable']; if ($this->pageType == PAGE_LIST) { $this->jsSettings['tableSettings'][$this->tName]['detailTables'][$this->allDetailsTablesArr[$i]['dDataSourceTable']] = array('dispChildCount' => $this->allDetailsTablesArr[$i]['dispChildCount'], 'hideChild' => $this->allDetailsTablesArr[$i]['hideChild'], 'listShowType' => $this->allDetailsTablesArr[$i]['previewOnList'], 'addShowType' => $this->allDetailsTablesArr[$i]['previewOnAdd'], 'editShowType' => $this->allDetailsTablesArr[$i]['previewOnEdit'], 'viewShowType' => $this->allDetailsTablesArr[$i]['previewOnView']); if ($this->allDetailsTablesArr[$i]['previewOnList'] == DP_POPUP) { $this->jsSettings['tableSettings'][$this->tName]['isUsePopUp'] = true; } // field names of master keys of current table for passed details table name $this->masterKeysByD[$i] = $this->pSet->getMasterKeysByDetailTable($this->allDetailsTablesArr[$i]['dDataSourceTable']); } } if (($this->pageType == PAGE_ADD || $this->pageType == PAGE_EDIT) && $this->isShowDetailTables) { $this->controlsMap["dControlsMap"] = array(); } } $this->controlsMap["video"] = array(); $this->controlsMap['toolTips'] = array(); $this->addLookupSettings(); $this->addMultiUploadSettings(); if ($this->mode != LIST_DETAILS) { $this->controlsMap["controls"] = array(); if (!$this->pageAddLikeInline && !$this->pageEditLikeInline) { $this->controlsMap["search"] = array(); $this->controlsMap["search"]["searchBlocks"] = array(); $this->controlsMap["search"]["panelSearchFields"] = $this->pSet->GetPanelSearchFields(); $this->controlsMap["search"]["allSearchFields"] = $this->pSet->getAllSearchFields(); $this->controlsMap["search"]["googleLikeFields"] = $this->pSet->getGoogleLikeFields(); if ($this->pageType != PAGE_SEARCH) { $this->controlsMap["search"]["submitPageType"] = $this->pageType; } else { if (postvalue("rname")) { $this->controlsMap["search"]["submitPageType"] = "dreport"; $this->controlsMap["search"]["baseParams"]["rname"] = postvalue("rname"); if ($_SESSION["crossLink"]) { if (substr($_SESSION["crossLink"], 0, 1) == "&") { $_SESSION["crossLink"] = substr($_SESSION["crossLink"], 1); } $alink = explode("&", $_SESSION["crossLink"]); foreach ($alink as $param) { $arrtmp = explode("=", $param); $this->controlsMap["search"]["baseParams"][$arrtmp[0]] = $arrtmp[1]; } } } elseif (postvalue("cname")) { $this->controlsMap["search"]["submitPageType"] = "dchart"; $this->controlsMap["search"]["baseParams"]["cname"] = postvalue("cname"); } else { $this->controlsMap["search"]["submitPageType"] = $this->isTableType; } } } } $this->timepicker = $this->timepicker || $this->pSet->isUseTimeForSearch(); $this->isUseToolTips = $this->isUseToolTips || $this->pSet->isUseToolTips(); $this->googleMapCfg["APIcode"] = ""; if ($this->xt) { $this->xt->assign("pagetitle", $this->getPageTitle()); } }
$menuNode["title"] = GetTableCaption("dbo_User_Roles"); $menuNodes[] = $menuNode; $menuNode = array(); $menuNode["id"] = "16"; $menuNode["name"] = ""; $menuNode["href"] = "mypage.htm"; $menuNode["type"] = "Leaf"; $menuNode["table"] = "dbo.System Users"; $menuNode["style"] = ""; $menuNode["params"] = ""; $menuNode["parent"] = "0"; $menuNode["nameType"] = "Text"; $menuNode["linkType"] = "Internal"; $menuNode["pageType"] = "List"; $menuNode["openType"] = "None"; $menuNode["title"] = GetTableCaption("dbo_System_Users"); $menuNodes[] = $menuNode; if ($pageType == PAGE_MENU && IsAdmin()) { } } else { //Admin Area menu items $xt->assign("adminAreaTypeMenu", true); } // need to predefine vars $nullParent = NULL; $rootInfoArr = array("id" => 0, "href" => ""); // create treeMenu instance $menuRoot = new MenuItem($rootInfoArr, $menuNodes, $nullParent); // call xtempl assign, set session params $menuRoot->setMenuSession(); $menuRoot->assignMenuAttrsToTempl($xt);
$detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 0; $detailsTablesData["GroupMaster"][$dIndex] = $detailsParam; $detailsTablesData["GroupMaster"][$dIndex]["masterKeys"] = array(); $detailsTablesData["GroupMaster"][$dIndex]["masterKeys"][] = "Groupid"; $detailsTablesData["GroupMaster"][$dIndex]["detailKeys"] = array(); $detailsTablesData["GroupMaster"][$dIndex]["detailKeys"][] = "GroupID"; // CompanyMaster $dIndex = 1; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "CompanyMaster"; $detailsParam["dOriginalTable"] = "CompanyMaster"; $detailsParam["dType"] = PAGE_LIST; $detailsParam["dShortTable"] = "CompanyMaster"; $detailsParam["dCaptionTable"] = GetTableCaption("CompanyMaster"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = false; $detailsParam["previewOnList"] = 1; $detailsParam["previewOnAdd"] = 0; $detailsParam["previewOnEdit"] = 0; $detailsParam["previewOnView"] = 0; $detailsTablesData["GroupMaster"][$dIndex] = $detailsParam; $detailsTablesData["GroupMaster"][$dIndex]["masterKeys"] = array(); $detailsTablesData["GroupMaster"][$dIndex]["masterKeys"][] = "Groupid"; $detailsTablesData["GroupMaster"][$dIndex]["detailKeys"] = array(); $detailsTablesData["GroupMaster"][$dIndex]["detailKeys"][] = "GroupID"; // tables which are master tables for current table (detail) $masterTablesData["GroupMaster"] = array();
/** * Get the default page's title template * @param String page * @param String table A good table name * @param ProjectSettings pSet * @return STring */ protected function getDefaultPageTitle($page, $table, $pSet) { if ($page == "add") { return GetTableCaption($table) . ", " . "Añadir nuevo registro"; } if ($page == "edit") { return GetTableCaption($table) . ", " . "Editar registro" . " [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "view") { return GetTableCaption($table) . ", " . "Ver registro" . " [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "export") { return "Exportar"; } if ($page == "import") { return GetTableCaption($table) . ", " . "Importar"; } if ($page == "search") { return GetTableCaption($table) . " - " . "Búsqueda avanzada"; } if ($page == "print") { return GetTableCaption($table); } if ($page == "list") { return GetTableCaption($table); } if ($page == "masterlist") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "masterchart") { return GetTableCaption($table); } if ($page == "masterreport") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "masterprint") { return GetTableCaption($table) . ": [" . $this->getKeysTitleTemplate($table, $pSet) . "]"; } if ($page == "login") { return "Conectar"; } if ($page == "register") { return "Registrar"; } if ($page == "changepwd") { return "Cambiar contraseña"; } if ($page == "remind") { return "Recordador de contraseña"; } if ($page == "chart") { return GetTableCaption($table); } if ($page == "report") { return GetTableCaption($table); } if ($page == "dashboard") { return GetTableCaption($table); } if ($page == "menu") { return "Menu"; } }
/** * Fills info in array about grid. * For new add row * @param array $rowInfoArr array with total info, that assignes grid */ function fillGridShowInfo(&$rowInfoArr) { $rowInfoArr["data"] = array(); $editlink = ""; $copylink = ""; // add inline add row //print('$this->mainTable = '.$this->mainTable.'<br>'); $mainPSet = $this->pSet->getTable($this->mainTable); if ($mainPSet->isAllowToAdd($this->mainField) && $this->permis[$this->tName]['add']) { $row = array(); $row["rowclass"] = "gridRowAdd runner-hiddenelem"; if ($this->isVerLayout) { $row["rowattrs"] .= "vertical=\"1\""; $row["rowclass"] = 'class="' . $row["rowclass"] . '"'; $row["rsclass"] = "gridRowSepAdd runner-hiddenelem"; } $record = array(); $record["edit_link"] = true; $record["inlineedit_link"] = true; $record["view_link"] = true; $record["copy_link"] = true; $record["checkbox"] = true; $record["checkbox"] = true; $record["editlink_attrs"] = "id=\"editLink_add" . $this->id . "\""; //for list icons instead of list links $this->countWidthListIcons('add'); $record["copylink_attrs"] = "id=\"copyLink_add" . $this->id . "\" name=\"copyLink_add" . $this->id . "\""; $record["viewlink_attrs"] = "id=\"viewLink_add" . $this->id . "\" name=\"viewLink_add" . $this->id . "\""; $record["checkbox_attrs"] = "id=\"check_add" . $this->id . "\" name=\"selection[]\""; // add container for inline add controls $addedInlineAddContainer = false; if ($this->permis[$this->tName]['edit'] && $this->isUseInlineEdit) { $record["inlineeditlink_attrs"] = "id=\"inlineEdit_add" . $this->id . "\" "; $addedInlineAddContainer = true; } for ($i = 0; $i < count($this->allDetailsTablesArr); $i++) { //detail tables $dDataSourceTable = $this->allDetailsTablesArr[$i]['dDataSourceTable']; $dShortTable = $this->allDetailsTablesArr[$i]['dShortTable']; $record[$dShortTable . "_dtable_link"] = $this->permis[$dDataSourceTable]['add'] || $this->permis[$dDataSourceTable]['search']; $record[$dShortTable . "_dtablelink_attrs"] = " href=\"" . $dShortTable . "_list.php?\" id=\"master_" . $dShortTable . "_add" . $this->id . "\" "; if ($this->allDetailsTablesArr[$i]['previewOnList'] == DP_INLINE) { $record[$dShortTable . "_dtablelink_attrs"] = "id = \"" . $dShortTable . "_preview" . $this->id . "\"\r\n\t\t\t\t\t\tcaption = \"" . GetTableCaption(GoodFieldName($dDataSourceTable)) . "\" \r\n\t\t\t\t\t\thref = \"" . $dShortTable . "_list.php?\"\r\n\t\t\t\t\t\tstyle = \"display:none;\""; } } $this->addSpansForGridCells('add', $record); for ($i = 0; $i < count($this->listFields); $i++) { if (!$addedInlineAddContainer) { if ($i == 0 && !($this->permis[$this->tName]['edit'] && $this->isUseInlineEdit)) { $record[GoodFieldName($this->listFields[$i]['fName']) . "_value"] .= "<span id=\"inlineEdit_add" . $this->id . "\"></span>"; } } $record[GoodFieldName($this->listFields[$i]['fName']) . "_class"] .= $this->fieldClass($this->listFields[$i]['fName']); } if ($this->colsOnPage > 1) { $record["endrecord_block"] = true; } $record["grid_recordheader"] = true; $record["grid_vrecord"] = true; $row["grid_record"] = array("data" => array()); $row["grid_record"]["data"][] = $record; for ($i = 1; $i < $this->colsOnPage; $i++) { $rec = array(); if ($i < $this->colsOnPage - 1) { $rec["endrecord_block"] = true; } $row["grid_record"]["data"][] = $rec; } $row["grid_rowspace"] = true; $row["grid_recordspace"] = array("data" => array()); for ($i = 0; $i < $this->colsOnPage * 2 - 1; $i++) { $row["grid_recordspace"]["data"][] = true; } $rowInfoArr["data"][] = $row; } }
$tdatagroup["Groupcol"] = $fdata; $tables_data["group"] =& $tdatagroup; $field_labels["group"] =& $fieldLabelsgroup; $fieldToolTips["group"] =& $fieldToolTipsgroup; $page_titles["group"] =& $pageTitlesgroup; // -----------------start prepare master-details data arrays ------------------------------// // tables which are detail tables for current table (master) $detailsTablesData["group"] = array(); // company $dIndex = 0; $detailsParam = array(); $detailsParam["dDataSourceTable"] = "company"; $detailsParam["dOriginalTable"] = "company"; $detailsParam["dType"] = PAGE_LIST; $detailsParam["dShortTable"] = "company"; $detailsParam["dCaptionTable"] = GetTableCaption("company"); $detailsParam["masterKeys"] = array(); $detailsParam["detailKeys"] = array(); $detailsParam["dispChildCount"] = "1"; $detailsParam["hideChild"] = true; $detailsParam["previewOnList"] = 1; $detailsParam["previewOnAdd"] = 1; $detailsParam["previewOnEdit"] = 1; $detailsParam["previewOnView"] = 1; $detailsTablesData["group"][$dIndex] = $detailsParam; $detailsTablesData["group"][$dIndex]["masterKeys"] = array(); $detailsTablesData["group"][$dIndex]["masterKeys"][] = "GRP_ID"; $detailsTablesData["group"][$dIndex]["detailKeys"] = array(); $detailsTablesData["group"][$dIndex]["detailKeys"][] = "grp_id"; // tables which are master tables for current table (detail) $masterTablesData["group"] = array();