/** * @param String fName The search field's name * @param Number recId The search field row's Id * @param Number fieldNum The search field control's index (0 for the first, 1 for the second) * @param String value The search control's value * @param Boolean renderHidden Indicator showing if the search control is visible * @param Boolean isCached Indicator showing if the search control is cached * @return Array */ function getCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden = false, $isCached = true) { $parameters = $this->buildCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden, $isCached); $control = array(); AssignFunction($control, "xt_buildeditcontrol", $parameters); return $control; }
/** * Get controls attrs only for the Search panel * @param String fName The search field's name * @param Number recId The search field row's Id * @param Number fieldNum The search field control's index (0 for the first, 1 for the second) * @param String value The search control's value * @param String opt The search control's search option * @param Boolean renderHidden Indicator showing if the search control is visible * @param Boolean isCached Indicator showing if the search control is cached * @return Array */ function getCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden = false, $isCached = true) { $parameters = parent::buildCtrlParamsArr($fName, $recId, $fieldNum, $value, $opt, $renderHidden, $isCached); $control = array(); $parameters["additionalCtrlParams"]['skipDependencies'] = true; $parameters["additionalCtrlParams"]["searchPanelControl"] = true; $parameters["additionalCtrlParams"]["style"] = isMobile() ? 'width: 35%;' : 'width: 115px;'; $ctrlsMap = $this->getExtraControlMap(); $this->pageObj->fillControlsMap($ctrlsMap, true); AssignFunction($control, "xt_buildeditcontrol", $parameters); return $control; }
} // Confirm field for re-enter password if ($fName == GetPasswordField() && GetPasswordField() != GetUserNameField()) { $parameters = array(); $parameters["id"] = $id; $parameters["mode"] = "add"; $parameters["field"] = "confirm"; $parameters["format"] = "Password"; $parameters["suggest"] = true; $parameters["pageObj"] = $pageObject; $parameters["validate"]['basicValidate'] = array('IsRequired'); $parameters["extraParams"] = array(); $parameters["extraParams"]["isConfirm"] = true; $parameters["extraParams"]["getConrirmFieldCtrl"] = true; $control1['confirm'] = array(); AssignFunction($control1['confirm'], "xt_buildeditcontrol", $parameters); $controls = array('controls' => array()); $controls["controls"]['id'] = $id; $controls["controls"]['mode'] = "add"; $controls["controls"]['ctrlInd'] = 0; $controls["controls"]['suggest'] = true; $controls["controls"]['fieldName'] = "confirm"; $xt->assign("confirm_label", true); if (isEnableSection508()) { $xt->assign_section("confirm_label", "<label for=\"value_confirm_" . $id . "\">", "</label>"); } $xt->assignbyref("confirm_editcontrol1", $control1['confirm']); $xt->assign("confirm_block", true); $pageObject->fillControlsMap($controls); } }
$parameters["mode"]="search"; $parameters["ptype"] = PAGE_SEARCH; $parameters["format"]=$editformats[$table_field]; $parameters["id"]=1; $parameters["pageObj"] = $pageObject; AssignFunction($editcont, "xt_buildeditcontrol", $parameters); $arr_page_order_fields["data"][$key]["editcontrol"] = $editcont; //$editcont1 = $editcont; $editcont1 = array(); $parameters["second"]=true; $parameters["fieldNum"]=1; AssignFunction($editcont1, "xt_buildeditcontrol", $parameters); if(@$_SESSION[$sessPrefix."_search"]==2) { $editcont1["params"]["value"] = @$_SESSION[$sessPrefix."_asearchfor2"][$table_field]; } $arr_page_order_fields["data"][$key]["editcontrol1"] = $editcont1; if(is_wr_db()) $arr_page_order_fields["data"][$key]["fieldblock"] = ' <input type="hidden" name="asearchfield[]" value="'.runner_htmlspecialchars($ftable).".".runner_htmlspecialchars($fname).'"> <input type="hidden" name="asearchtable[]" value="'.runner_htmlspecialchars($ftable).'"> '; else $arr_page_order_fields["data"][$key]["fieldblock"] = ' <input type="hidden" name="asearchfield[]" value="'.runner_htmlspecialchars($fname).'"> <input type="hidden" name="asearchtable[]" value="'.runner_htmlspecialchars($ftable).'"> ';
/** * Prepare edit controls */ protected function prepareEditControls() { $controlFields = $this->addFields; if ($this->mode == ADD_INLINE) { //#9069 $this->removeHiddenColumnsFromInlineFields($controlFields, $this->screenWidth, $this->screenHeight, $this->orientation); } $control = array(); foreach ($controlFields as $fName) { $gfName = GoodFieldName($fName); $isDetKeyField = in_array($fName, $this->detailKeysByM); $control[$gfName] = array(); $controls = array(); $controls["controls"] = array(); $controls["controls"]["id"] = $this->id; $controls["controls"]["ctrlInd"] = 0; $controls["controls"]["fieldName"] = $fName; $parameters = array(); $parameters["id"] = $this->id; $parameters["ptype"] = PAGE_ADD; $parameters["field"] = $fName; $parameters["value"] = @$this->defvalues[$fName]; $parameters["pageObj"] = $this; if (!$isDetKeyField || $fName == $this->category) { $parameters["validate"] = $this->pSet->getValidation($fName); if ($this->pSet->isUseRTE($fName)) { $_SESSION[$this->sessionPrefix . "_" . $fName . "_rte"] = @$this->defvalues[$fName]; } } //if richEditor for field if ($this->pSet->isUseRTE($fName)) { $parameters["mode"] = "add"; $controls["controls"]["mode"] = "add"; } else { $controlMode = $this->mode == ADD_ONTHEFLY || $this->mode == ADD_POPUP ? "inline_add" : "add"; $parameters["mode"] = $controlMode; $controls["controls"]["mode"] = $controlMode; } if ($isDetKeyField && $fName != $this->category) { $controls["controls"]["value"] = @$this->defvalues[$fName]; $parameters["extraParams"] = array(); $parameters["extraParams"]["getDetKeyReadOnlyCtrl"] = true; // to the ReadOnly control show the detail key control's value $this->readOnlyFields[$fName] = $this->showDBValue($fName, $this->defvalues); } AssignFunction($control[$gfName], "xt_buildeditcontrol", $parameters); $this->xt->assignbyref($gfName . "_editcontrol", $control[$gfName]); // category control field $strCategoryControl = $this->getMainLookupFieldNameForDependant($fName); if (strlen($strCategoryControl) && in_array($strCategoryControl, $controlFields)) { $vals = array($fName => @$this->defvalues[$fName], $strCategoryControl => @$this->defvalues[$strCategoryControl]); } else { $vals = array($fName => @$this->defvalues[$fName]); } $preload = $this->fillPreload($fName, $vals); if ($preload !== false) { $controls["controls"]["preloadData"] = $preload; if (!@$this->defvalues[$fName] && count($preload["vals"]) > 0) { $this->defvalues[$fName] = $preload["vals"][0]; } } $this->fillControlsMap($controls); $this->fillFieldToolTips($fName); // fill special settings for a time picker if ($this->pSet->getEditFormat($fName) == "Time") { $this->fillTimePickSettings($fName, @$this->defvalues[$fName]); } } }
/** * Display master table info */ public function printMasterTableInfo() { $masterTablesInfoArr = $this->pSet->getMasterTablesArr($this->tName); if (!count($masterTablesInfoArr)) { return; } foreach ($masterTablesInfoArr as $masterTableData) { if ($this->masterTable != $masterTableData['mDataSourceTable']) { continue; } if ($masterTableData['dispInfo']) { include_once getabspath("include/" . $masterTableData['mShortTable'] . "_masterprint.php"); $this->pageBody["showmasterfile"] = array(); $params = array("detailtable" => $this->tName, "keys" => $this->masterKeys); AssignFunction($this->pageBody["showmasterfile"], "DisplayMasterTableInfoForPrint_" . $masterTableData['mShortTable'], $params); $this->pageBody["mastertable_block"] = true; } } }
/** * Display the 'Back to Master' link and master table info */ public function displayMasterTableInfo() { $masterTablesInfoArr = $this->pSet->getMasterTablesArr($this->tName); if (!count($masterTablesInfoArr)) { return; } $this->jsSettings["tableSettings"][$this->tName]["hasMasterList"] = true; foreach ($masterTablesInfoArr as $masterTableData) { if ($this->masterTable != $masterTableData['mDataSourceTable']) { continue; } if ($masterTableData['dispInfo']) { include_once getabspath("include/" . GetTableLink($masterTableData['mShortTable'], "master" . $masterTableData['type'])); $detailKeys = $masterTableData['detailKeys']; $masterKeys = array(); for ($j = 0; $j < count($detailKeys); $j++) { $masterKeys[] = @$_SESSION[$this->sessionPrefix . "_masterkey" . ($j + 1)]; } $this->addMasterInfoJSAndCSS($masterTableData["type"], $masterTableData["mDataSourceTable"], $masterTableData["mShortTable"]); $master = array(); $params = array("detailtable" => $this->tName, "keys" => $masterKeys); AssignFunction($master, "DisplayMasterTableInfo_" . $masterTableData['mShortTable'], $params); $this->xt->assignbyref("showmasterfile", $master); } $this->xt->assign("mastertable_block", true); $backButtonHref = GetTableLink($masterTableData['mShortTable'], $masterTableData["type"], "a=return"); $this->xt->assign("backtomasterlink_attrs", "href=\"" . $backButtonHref . "\""); $this->xt->assign("backtomasterlink_caption", GetTableCaption(GoodFieldName($masterTableData['mDataSourceTable']))); } }
if($inlineedit == EDIT_INLINE) { if(!$detailKeys || !in_array($fName, $detailKeys)) $parameters["mode"]="inline_edit"; $controls["controls"]['mode'] = "inline_edit"; } else{ if (!$detailKeys || !in_array($fName, $detailKeys)) $parameters["mode"] = "edit"; $controls["controls"]['mode'] = "edit"; } if(!$detailKeys || !in_array($fName, $detailKeys)) { AssignFunction($control[$gfName], "xt_buildeditcontrol", $parameters); $xt->assignbyref($gfName."_editcontrol",$control[$gfName]); } elseif($detailKeys && in_array($fName, $detailKeys)) { $controls["controls"]['value'] = @$data[$fName]; } // category control field $strCategoryControl = $pageObject->getMainLookupFieldNameForDependant($fName); if($strCategoryControl !== "" && in_array($strCategoryControl, $controlFields)) { $vals = array($fName => @$data[$fName],$strCategoryControl => @$data[$strCategoryControl]); } else
/** * Prepare edit controls */ public function prepareEditControls() { global $locale_info; if ($this->mode == EDIT_INLINE) { $fields = $this->editFields; $this->removeHiddenColumnsFromInlineFields($fields, $this->screenWidth, $this->screenHeight, $this->orientation); $this->editFields = $fields; } // prepare values $data = $this->getCurrentRecordInternal(); if ($this->readEditValues) { foreach ($this->editFields as $f) { if (!isset($this->newRecordData[$f])) { continue; } $editFormat = $this->pSet->getEditFormat($f); if ($editFormat != EDIT_FORMAT_DATABASE_FILE && $editFormat != EDIT_FORMAT_DATABASE_IMAGE && $editFormat != EDIT_FORMAT_READONLY) { $data[$f] = $this->newRecordData[$f]; } } } $control = array(); foreach ($this->editFields as $fName) { $gfName = GoodFieldName($fName); $isDetKeyField = in_array($fName, $this->detailKeysByM); $control[$gfName] = array(); $controls = array(); $controls["controls"] = array(); $controls["controls"]['ctrlInd'] = 0; $controls["controls"]['id'] = $this->id; $controls["controls"]['fieldName'] = $fName; $parameters = array(); $parameters["id"] = $this->id; $parameters["ptype"] = PAGE_EDIT; $parameters["field"] = $fName; $parameters["pageObj"] = $this; $parameters["value"] = @$data[$fName]; if (!$isDetKeyField) { if (IsFloatType($this->pSet->getFieldType($fName)) && !is_null(@$data[$fName])) { if ($this->pSet->getHTML5InputType($fName) == "number") { // no thousand delimiters, only dot as decimal delimiter $parameters["value"] = formatNumberForHTML5(@$data[$fName]); } else { $parameters["value"] = str_replace(".", $locale_info["LOCALE_SDECIMAL"], @$data[$fName]); } } $parameters["validate"] = $this->pSet->getValidation($fName); $additionalCtrlParams = array(); $additionalCtrlParams["disabled"] = $this->controlsDisabled; $parameters["additionalCtrlParams"] = $additionalCtrlParams; } $controlMode = $this->mode == EDIT_INLINE ? "inline_edit" : "edit"; $parameters["mode"] = $controlMode; $controls["controls"]['mode'] = $controlMode; if ($this->pSet->isUseRTE($fName) && $this->pSet->isAutoUpdatable($fName)) { $_SESSION[$this->sessionPrefix . "_" . $fName . "_rte"] = GetAutoUpdateValue($fName, PAGE_EDIT); $control[$gfName]["params"]["mode"] = "add"; } if ($isDetKeyField) { $controls["controls"]['value'] = @$data[$fName]; $parameters["extraParams"] = array(); $parameters["extraParams"]["getDetKeyReadOnlyCtrl"] = true; // to the ReadOnly control show the detail key cotnrol's value $this->readOnlyFields[$fName] = $this->showDBValue($fName, $data); } AssignFunction($control[$gfName], "xt_buildeditcontrol", $parameters); $this->xt->assignbyref($gfName . "_editcontrol", $control[$gfName]); // category control field $strCategoryControl = $this->getMainLookupFieldNameForDependant($fName); if (strlen($strCategoryControl) && in_array($strCategoryControl, $this->editFields)) { $vals = array($fName => @$data[$fName], $strCategoryControl => @$data[$strCategoryControl]); } else { $vals = array($fName => @$data[$fName]); } $preload = $this->fillPreload($fName, $vals); if ($preload !== false) { $controls["controls"]['preloadData'] = $preload; } $this->fillControlsMap($controls); $this->fillFieldToolTips($fName); // fill special settings for timepicker if ($this->pSet->getEditFormat($fName) == 'Time') { $this->fillTimePickSettings($fName, $data[$fName]); } if ($this->pSet->getViewFormat($fName) == FORMAT_MAP) { $this->googleMapCfg['isUseGoogleMap'] = true; } } }