本文整理汇总了PHP中getTabid函数的典型用法代码示例。如果您正苦于以下问题:PHP getTabid函数的具体用法?PHP getTabid怎么用?PHP getTabid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTabid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListFiledOfRelatedModule
function getListFiledOfRelatedModule($moduleName)
{
$db = PearDatabase::getInstance();
$tabid = getTabid($moduleName);
$sourceModule = $moduleName;
$sql = "select vtiger_field.fieldid, fieldlabel, uitype, vtiger_fieldmodulerel.relmodule from vtiger_field \n\t\t\t\tleft JOIN vtiger_fieldmodulerel ON vtiger_fieldmodulerel.fieldid = vtiger_field.fieldid where tabid = ? AND (uitype = '10' OR uitype = '59' OR uitype = '53' OR uitype = '51')";
$resultModuleList = $db->pquery($sql, array($tabid), true);
$moduleList = array();
for ($i = 0; $i < $db->num_rows($resultModuleList); $i++) {
$uitype = $db->query_result($resultModuleList, $i, 'uitype');
$fieldid = $db->query_result($resultModuleList, $i, 'fieldid');
$fieldlabel = $db->query_result($resultModuleList, $i, 'fieldlabel');
if ($uitype == 10) {
$moduleList[] = array(Vtiger_Functions::getModuleId($db->query_result($resultModuleList, $i, 'relmodule')), $fieldlabel, $fieldid);
} elseif ($uitype == 51) {
$moduleList[] = array(Vtiger_Functions::getModuleId('Accounts'), $fieldlabel, $fieldid);
} elseif ($uitype == 59) {
$moduleList[] = array(Vtiger_Functions::getModuleId('Products'), $fieldlabel, $fieldid);
} elseif ($uitype == 53) {
$moduleList[] = array(Vtiger_Functions::getModuleId('Users'), $fieldlabel, $fieldid);
}
}
$output = array();
for ($i = 0; $i < count($moduleList); $i++) {
$moduleInfoSql = "SELECT * FROM vtiger_tab WHERE tabid = ?";
$moduleInfoResult = $db->pquery($moduleInfoSql, array($moduleList[$i][0]), true);
$moduleName = $db->query_result($moduleInfoResult, 0, 'name');
$moduleTrLabal = vtranslate($moduleList[$i][1], $sourceModule);
$output[$moduleTrLabal] = array();
$output[$moduleTrLabal] = $this->getListFiledOfModule($moduleName, $moduleList[$i][2]);
}
return $output;
}
示例2: getJoinSQLbyFieldRelation
public function getJoinSQLbyFieldRelation(&$join_array, &$columns_array)
{
$related_focus = CRMEntity::getInstance($this->relModuleName);
$params_fieldname = $this->params["fieldname"];
// first join to vtiger module table
$this->params["fieldname"] = $related_focus->tab_name_index[$this->params["tablename"]];
$this->getStJoinSQL($join_array, $columns_array);
$r_tabid = getTabid($this->relModuleName);
$adb = PEARDatabase::getInstance();
$uirel_row = $adb->fetchByAssoc($adb->pquery("SELECT * FROM vtiger_field WHERE tabid = ? AND fieldname = ?", array($r_tabid, $params_fieldname)), 0);
$related_table_name = $related_focus->table_name;
$related_table_index = $related_focus->table_index;
foreach ($related_focus->tab_name as $other_table) {
$related_join_array[$other_table] = $related_focus->tab_name_index[$other_table];
}
$field_uitype = $uirel_row["uitype"];
$fieldid = $this->params["fieldid"];
$oth_as = "";
if ($uirel_row["tablename"] == "vtiger_crmentity") {
$oth_as = $this->oth_as;
$related_table_name = $uirel_row["tablename"];
$related_table_index = $uirel_row["columnname"];
}
$using_aliastablename = $related_table_name . $oth_as . $fieldid;
$using_columnname = $related_table_index;
$params = array('fieldid' => $uirel_row["fieldid"], 'fieldtabid' => $uirel_row["tabid"], 'field_uitype' => $field_uitype, 'fieldname' => $uirel_row["fieldname"], 'columnname' => $uirel_row["columnname"], 'tablename' => $uirel_row["tablename"], 'table_index' => $related_join_array, 'report_primary_table' => $this->params["report_primary_table"], 'primary_table_name' => $related_focus->table_name, 'primary_table_index' => $related_focus->table_index, 'primary_tableid' => $r_tabid, 'using_aliastablename' => $using_array["u_tablename"], 'using_columnname' => $using_array["u_tableindex"], 'old_oth_as' => $oth_as, 'old_oth_fieldid' => $fieldid, 'fld_string' => $this->params["fld_string"]);
$using_array = getJoinInformation($params);
$params["using_array"] = $using_array;
$uifactory = new UIFactory($params);
//show("<font color='green'>fielduitype".$field_uitype."_IN_P_".$field_uitype,$related_join_array,$params["using_array"],"</font>");
$uifactory->getJoinSQL($field_uitype, $join_array, $columns_array);
}
示例3: getTabId
public function getTabId()
{
if ($this->tabId == null) {
$this->tabId = getTabid($this->objectName);
}
return $this->tabId;
}
示例4: getMappingSupportedFieldIdsList
/**
* Function to get mapping supported field ids list
* @return <Array> list of field ids
*/
public function getMappingSupportedFieldIdsList()
{
if (!$this->supportedFieldIdsList) {
$selectedTabidsList[] = getTabid($this->getName());
$presense = array(0, 2);
$restrictedFieldNames = array('campaignrelstatus');
$restrictedUitypes = array(4, 10, 51, 52, 53, 57, 58, 69, 70);
$selectedGeneratedTypes = array(1, 2);
$db = PearDatabase::getInstance();
$query = 'SELECT fieldid FROM vtiger_field
WHERE presence IN (' . generateQuestionMarks($presense) . ')
AND tabid IN (' . generateQuestionMarks($selectedTabidsList) . ')
AND uitype NOT IN (' . generateQuestionMarks($restrictedUitypes) . ')
AND fieldname NOT IN (' . generateQuestionMarks($restrictedFieldNames) . ')
AND generatedtype IN (' . generateQuestionMarks($selectedGeneratedTypes) . ')';
$params = array_merge($presense, $selectedTabidsList, $restrictedUitypes, $restrictedFieldNames, $selectedGeneratedTypes);
$result = $db->pquery($query, $params);
$numOfRows = $db->num_rows($result);
$fieldIdsList = array();
for ($i = 0; $i < $numOfRows; $i++) {
$fieldIdsList[] = $db->query_result($result, $i, 'fieldid');
}
$this->supportedFieldIdsList = $fieldIdsList;
}
return $this->supportedFieldIdsList;
}
示例5: getNameFields
/**
* Function to retrieve name fields of a module
* @return <array> - array which contains fields which together construct name fields
*/
public function getNameFields()
{
$nameFieldObject = Vtiger_Cache::get('EntityField', $this->getName());
$moduleName = $this->getName();
if ($nameFieldObject && $nameFieldObject->fieldname) {
$this->nameFields = explode(',', $nameFieldObject->fieldname);
} else {
$adb = PearDatabase::getInstance();
$query = "SELECT fieldname, tablename, entityidfield FROM vtiger_entityname WHERE tabid = ?";
$result = $adb->pquery($query, array(getTabid('Calendar')));
$this->nameFields = array();
if ($result) {
$rowCount = $adb->num_rows($result);
if ($rowCount > 0) {
$fieldNames = $adb->query_result($result, 0, 'fieldname');
$this->nameFields = explode(',', $fieldNames);
}
}
$entiyObj = new stdClass();
$entiyObj->basetable = $adb->query_result($result, 0, 'tablename');
$entiyObj->basetableid = $adb->query_result($result, 0, 'entityidfield');
$entiyObj->fieldname = $fieldNames;
Vtiger_Cache::set('EntityField', $this->getName(), $entiyObj);
}
return $this->nameFields;
}
示例6: beforeGetTaskform
public function beforeGetTaskform($viewer)
{
$viewer->assign("ENABLE_PDFMAKER", false);
$viewer->assign("pdfmaker_templates", array());
if (getTabid('PDFMaker') && vtlib_isModuleActive('PDFMaker')) {
require_once 'modules/PDFMaker/PDFMaker.php';
if (class_exists("PDFMaker")) {
$PDFMaker = $PDFMaker = new PDFMaker_PDFMaker_Model();
if (method_exists($PDFMaker, "GetAvailableTemplates")) {
$viewer->assign("ENABLE_PDFMAKER", true);
$templates = $PDFMaker->GetAvailableTemplates($this->getModuleName());
foreach ($templates as $index => $value) {
$pdftemplates[$index] = $value["templatename"];
}
$viewer->assign("pdfmaker_templates", $pdftemplates);
$templateid = $this->get("template");
if (!empty($templateid) && $templateid != -1 && $this->get("attachments") == -1) {
$this->set("attachments", '{"pdfmaker#' . $templateid . '":"title"}');
} else {
if ($this->get("attachments") == -1) {
$this->set("attachments", '{}');
}
}
}
}
}
}
示例7: updateProgressMilestone
public function updateProgressMilestone($id)
{
$adb = PearDatabase::getInstance();
//TODO need to handle security
if (!isRecordExists($id)) {
return;
}
$focus = CRMEntity::getInstance($this->getName());
$relatedListMileston = $focus->get_dependents_list($id, $this->getId(), getTabid('ProjectTask'));
$resultMileston = $adb->query($relatedListMileston['query']);
$num = $adb->num_rows($resultMileston);
$estimatedWorkTime = 0;
$progressInHours = 0;
for ($i = 0; $i < $num; $i++) {
$row = $adb->query_result_rowdata($resultMileston, $i);
$estimatedWorkTime += $row['estimated_work_time'];
$recordProgress = $row['estimated_work_time'] * (int) $row['projecttaskprogress'] / 100;
$progressInHours += $recordProgress;
}
if (!$estimatedWorkTime) {
return;
}
$projectMilestoneProgress = round(100 * $progressInHours / $estimatedWorkTime);
$focus->retrieve_entity_info($id, $this->getName());
$focus->column_fields['projectmilestone_progress'] = $projectMilestoneProgress . '%';
$focus->column_fields['mode'] = 'edit';
$focus->saveentity($this->getName(), $id);
}
示例8: create_list_query
/** Function to create list query
* @param reference variable - where condition is passed when the query is executed
* Returns Query.
*/
function create_list_query($order_by, $where)
{
$log = vglobal('log');
$current_user = vglobal('current_user');
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
$tab_id = getTabid("Potentials");
$log->debug("Entering create_list_query(" . $order_by . "," . $where . ") method ...");
// Determine if the vtiger_account name is present in the where clause.
$account_required = preg_match("/accounts\\.name/", $where);
if ($account_required) {
$query = "SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.dateclosed FROM vtiger_potential, vtiger_account ";
$where_auto = "account.accountid = vtiger_potential.related_to AND vtiger_crmentity.deleted=0 ";
} else {
$query = 'SELECT vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_crmentity.smcreatorid, vtiger_potential.closingdate FROM vtiger_potential inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid LEFT JOIN vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid ';
$where_auto = ' AND vtiger_crmentity.deleted=0';
}
$query .= $this->getNonAdminAccessControlQuery('Potentials', $current_user);
if ($where != "") {
$query .= " where {$where} " . $where_auto;
} else {
$query .= " where " . $where_auto;
}
if ($order_by != "") {
$query .= " ORDER BY {$order_by}";
}
$log->debug("Exiting create_list_query method ...");
return $query;
}
示例9: detectRelatedModules
/**
* Detect the related modules based on the entity relation information for this instance.
*/
function detectRelatedModules()
{
global $adb, $current_user;
// Pick the distinct modulenames based on related records.
$result = $adb->pquery("SELECT distinct setype FROM vtiger_crmentity WHERE crmid in (\n\t\t\tSELECT relcrmid FROM vtiger_crmentityrel INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_crmentityrel.crmid \n\t\t\tWHERE vtiger_crmentity.crmid = ? AND vtiger_crmentity.deleted=0)", array($this->id));
$relatedModules = array();
// Calculate the related module access (similar to getRelatedList API in DetailViewUtils.php)
if ($result && $adb->num_rows($result)) {
require 'user_privileges/user_privileges_' . $current_user->id . '.php';
while ($resultrow = $adb->fetch_array($result)) {
$accessCheck = false;
$relatedTabId = getTabid($resultrow['setype']);
if ($relatedTabId == 0) {
$accessCheck = true;
} else {
if ($profileTabsPermission[$relatedTabId] == 0) {
if ($profileActionPermission[$relatedTabId][3] == 0) {
$accessCheck = true;
}
}
}
if ($accessCheck) {
$relatedModules[$relatedTabId] = $resultrow['setype'];
}
}
}
return $relatedModules;
}
示例10: getCFListEntries
/**
* Function to get customfield entries
* @param string $module - Module name
* return array $cflist - customfield entries
*/
function getCFListEntries($module)
{
$tabid = getTabid($module);
global $adb;
global $theme;
global $mod_strings;
global $app_strings;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
//$dbQuery = "select fieldid,columnname,fieldlabel,uitype,displaytype from ec_field where tabid=".$tabid." and generatedtype=2 order by sequence";
$dbQuery = "select multifieldid,multifieldname,totallevel from ec_multifield where tabid=" . $tabid . " order by multifieldid";
$result = $adb->getList($dbQuery);
$count = 1;
$cflist = array();
foreach ($result as $row) {
$cf_element = array();
$cf_element['no'] = $count;
$cf_element['label'] = $row["multifieldname"];
$fld_type_name = $row["totallevel"];
/*
if(isset($mod_strings[$fld_type_name])) {
$fld_type_name = $mod_strings[$fld_type_name];
}
*/
$cf_element['type'] = $fld_type_name;
$cf_element['tool'] = '<img src="' . $image_path . 'editfield.gif" border="0" style="cursor:pointer;" onClick="gotoEditCustomField(\'' . $module . '\',\'' . $row["multifieldid"] . '\',\'' . $tabid . '\',\'' . $row["uitype"] . '\')" alt="' . $app_strings['LBL_EDIT'] . '" title="' . $app_strings['LBL_EDIT'] . '"/>
| <img style="cursor:pointer;" onClick="deleteMultiCustomField(' . $row["multifieldid"] . ',\'' . $module . '\', \'' . $row["columnname"] . '\', \'' . $row["uitype"] . '\')" src="' . $image_path . 'delete.gif" border="0" alt="' . $app_strings['LBL_DELETE'] . '" title="' . $app_strings['LBL_DELETE'] . '"/>
';
$cflist[] = $cf_element;
$count++;
}
return $cflist;
}
示例11: vtlib_handler
/**
* Invoked when special actions are performed on the module.
* @param String Module name
* @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
*/
function vtlib_handler($modulename, $event_type)
{
$registerLink = false;
$displayLabel = 'Time Control';
global $adb, $log;
if ($event_type == 'module.postinstall') {
$tabid = getTabid($modulename);
$adb->query("UPDATE `vtiger_field` SET `summaryfield` = '1' WHERE `tabid` = {$tabid} AND `columnname` IN ('name','osstimecontrol_no','osstimecontrol_status','smownerid','date_start','time_start','time_end','due_date','sum_time','platnosc');", true);
$ModuleInstance = CRMEntity::getInstance($modulename);
$ModuleInstance->setModuleSeqNumber("configure", $modulename, 'TC', '1');
include_once 'vtlib/Vtiger/Module.php';
$moduleInstance = Vtiger_Module::getInstance($modulename);
$docelowy_Module = Vtiger_Module::getInstance('Accounts');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('HelpDesk');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('Project');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('ProjectTask');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('ServiceContracts');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('Assets');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('SalesOrder');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('Potentials');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('Quotes');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$docelowy_Module = Vtiger_Module::getInstance('Leads');
$docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
$modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
include_once 'modules/ModComments/ModComments.php';
if (class_exists('ModComments')) {
ModComments::addWidgetTo(array('OSSTimeControl'));
}
}
} else {
if ($event_type == 'module.disabled') {
// TODO Handle actions when this module is disabled.
} else {
if ($event_type == 'module.enabled') {
// TODO Handle actions when this module is enabled.
} else {
if ($event_type == 'module.preuninstall') {
// TODO Handle actions when this module is about to be deleted.
} else {
if ($event_type == 'module.preupdate') {
// TODO Handle actions before this module is updated.
} else {
if ($event_type == 'module.postupdate') {
}
}
}
}
}
}
}
示例12: getBlockListEntries
/**
* 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;
}
示例13: getUserFldArray
/**
* Function to get picklist fields for the given module
* @ param $fld_module
* It gets the picklist details array for the given module in the given format
* $fieldlist = Array(Array('fieldlabel'=>$fieldlabel,'generatedtype'=>$generatedtype,'columnname'=>$columnname,'fieldname'=>$fieldname,'value'=>picklistvalues))
*/
function getUserFldArray($fld_module, $roleid)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$user_fld = array();
$tabid = getTabid($fld_module);
$query = "select vtiger_field.fieldlabel,vtiger_field.columnname,vtiger_field.fieldname, vtiger_field.uitype" . " FROM vtiger_field inner join vtiger_picklist on vtiger_field.fieldname = vtiger_picklist.name" . " where (displaytype=1 and vtiger_field.tabid=? and vtiger_field.uitype in ('15','55','33','16') " . " or (vtiger_field.tabid=? and fieldname='salutationtype' and fieldname !='vendortype')) " . " and vtiger_field.presence in (0,2) ORDER BY vtiger_picklist.picklistid ASC";
$result = $adb->pquery($query, array($tabid, $tabid));
$noofrows = $adb->num_rows($result);
if ($noofrows > 0) {
$fieldlist = array();
for ($i = 0; $i < $noofrows; $i++) {
$user_fld = array();
$fld_name = $adb->query_result($result, $i, "fieldname");
$user_fld['fieldlabel'] = $adb->query_result($result, $i, "fieldlabel");
$user_fld['generatedtype'] = $adb->query_result($result, $i, "generatedtype");
$user_fld['columnname'] = $adb->query_result($result, $i, "columnname");
$user_fld['fieldname'] = $adb->query_result($result, $i, "fieldname");
$user_fld['uitype'] = $adb->query_result($result, $i, "uitype");
$user_fld['value'] = getAssignedPicklistValues($user_fld['fieldname'], $roleid, $adb);
$fieldlist[] = $user_fld;
}
}
return $fieldlist;
}
示例14: vtEditExpressions
function vtEditExpressions($adb, $appStrings, $current_language, $theme, $formodule = '')
{
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$smarty->assign('APP', $appStrings);
$mod = array_merge(return_module_language($current_language, 'FieldFormulas'), return_module_language($current_language, 'Settings'));
$jsStrings = array('NEED_TO_ADD_A' => $mod['NEED_TO_ADD_A'], 'CUSTOM_FIELD' => $mod['LBL_CUSTOM_FIELD'], 'LBL_USE_FUNCTION_DASHDASH' => $mod['LBL_USE_FUNCTION_DASHDASH'], 'LBL_USE_FIELD_VALUE_DASHDASH' => $mod['LBL_USE_FIELD_VALUE_DASHDASH'], 'LBL_DELETE_EXPRESSION_CONFIRM' => $mod['LBL_DELETE_EXPRESSION_CONFIRM']);
$smarty->assign("JS_STRINGS", Zend_Json::encode($jsStrings));
$smarty->assign("MOD", $mod);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("MODULE_NAME", 'FieldFormulas');
$smarty->assign("PAGE_NAME", 'LBL_FIELDFORMULAS');
$smarty->assign("PAGE_TITLE", 'LBL_FIELDFORMULAS');
$smarty->assign("PAGE_DESC", 'LBL_FIELDFORMULAS_DESCRIPTION');
$smarty->assign("FORMODULE", $formodule);
if (file_exists("modules/{$formodule}/{$formodule}.php")) {
$focus = CRMEntity::getInstance($formodule);
$validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, getTabid($formodule)));
$smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
$smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
$smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
}
$smarty->display(vtlib_getModuleTemplate('FieldFormulas', 'EditExpressions.tpl'));
}
示例15: beforeGetTaskform
public function beforeGetTaskform($viewer)
{
global $adb;
if (!\Workflow\VtUtils::existTable("vtiger_wf_customnumbering")) {
echo "Create table vtiger_wf_confirmation_user ... ok<br>";
$adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_customnumbering` (\r\n `serie` varchar(24) NOT NULL,\r\n `prefix` varchar(16) NOT NULL,\r\n `current` int(10) unsigned NOT NULL,\r\n `length` tinyint(4) NOT NULL,\r\n PRIMARY KEY (`serie`)\r\n ) ENGINE=InnoDB;");
}
$crmidColObj = CRMEntity::getInstance($this->getModuleName());
$viewer->assign('crmidCol', $crmidColObj->table_index);
$moduleName = $this->getModuleName();
$fields = VtUtils::getFieldsWithBlocksForModule($moduleName, false);
$selectedId = $this->get('field');
if ($selectedId === -1 || empty($selectedId)) {
$sql = 'SELECT * FROM vtiger_field WHERE uitype = 4 AND tabid = ' . getTabid($moduleName);
$result = $adb->query($sql);
$selectedId = $adb->query_result($result, 0, 'fieldname');
$this->set('field', $selectedId);
}
$sql = 'SELECT * FROM vtiger_wf_customnumbering';
$result = $adb->query($sql);
$series = array();
while ($row = $adb->fetchByAssoc($result)) {
$series[$row['serie']] = $row;
}
if (isset($series[$this->get('serie')])) {
$viewer->assign('lockFields', true);
}
$viewer->assign('series', $series);
$viewer->assign('fields', $fields);
/* Insert here source code to create custom configurations pages */
}