本文整理汇总了PHP中getTabModuleName函数的典型用法代码示例。如果您正苦于以下问题:PHP getTabModuleName函数的具体用法?PHP getTabModuleName怎么用?PHP getTabModuleName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTabModuleName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWidget
public function getWidget()
{
$widget = array();
$model = Vtiger_Module_Model::getInstance($this->Data['relatedmodule']);
if ($model->isPermitted('DetailView')) {
$this->Config['url'] = $this->getUrl();
$this->Config['tpl'] = 'Basic.tpl';
if ($this->Data['action'] == 1) {
$createPermission = $model->isPermitted('EditView');
$this->Config['action'] = $createPermission == true ? 1 : 0;
$this->Config['actionURL'] = $model->getQuickCreateUrl();
}
if (isset($this->Data['filter'])) {
$filterArray = explode('::', $this->Data['filter']);
$this->Config['field_name'] = $filterArray[2];
}
if (isset($this->Data['checkbox']) && $this->Data['checkbox'] != '-') {
$this->Config['url'] .= '&whereCondition[' . getTableNameForField(getTabModuleName($this->Data['relatedmodule']), $this->Data['checkbox']) . '.' . $this->Data['checkbox'] . ']=1';
$on = 'LBL_SWITCH_ON_' . strtoupper($this->Data['checkbox']);
$translateOn = vtranslate($on, $model->getName());
if ($on == $translateOn) {
$translateOn = vtranslate('LBL_YES', $model->getName());
}
$off = 'LBL_SWITCH_OFF_' . strtoupper($this->Data['checkbox']);
$translateOff = vtranslate($off, $model->getName());
if ($off == $translateOff) {
$translateOff = vtranslate('LBL_NO', $model->getName());
}
$this->Config['checkboxLables'] = ['on' => $translateOn, 'off' => $translateOff];
}
$widget = $this->Config;
}
return $widget;
}
示例2: module
/**
* Get module name.
*/
function module()
{
if (!empty($this->tabid)) {
return getTabModuleName($this->tabid);
}
return false;
}
示例3: getDependentPicklistFields
static function getDependentPicklistFields($module = '')
{
global $adb;
if (empty($module)) {
$result = $adb->pquery('SELECT DISTINCT sourcefield, targetfield, tabid FROM vtiger_picklist_dependency', array());
} else {
$tabId = getTabid($module);
$result = $adb->pquery('SELECT DISTINCT sourcefield, targetfield, tabid FROM vtiger_picklist_dependency WHERE tabid=?', array($tabId));
}
$noofrows = $adb->num_rows($result);
$dependentPicklists = array();
if ($noofrows > 0) {
$fieldlist = array();
for ($i = 0; $i < $noofrows; ++$i) {
$fieldTabId = $adb->query_result($result, $i, 'tabid');
$sourceField = $adb->query_result($result, $i, 'sourcefield');
$targetField = $adb->query_result($result, $i, 'targetfield');
if (getFieldid($fieldTabId, $sourceField) == false || getFieldid($fieldTabId, $targetField) == false) {
continue;
}
$fieldResult = $adb->pquery('SELECT fieldlabel FROM vtiger_field WHERE fieldname = ?', array($sourceField));
$sourceFieldLabel = $adb->query_result($fieldResult, 0, 'fieldlabel');
$fieldResult = $adb->pquery('SELECT fieldlabel FROM vtiger_field WHERE fieldname = ?', array($targetField));
$targetFieldLabel = $adb->query_result($fieldResult, 0, 'fieldlabel');
$forModule = getTabModuleName($fieldTabId);
$dependentPicklists[] = array('sourcefield' => $sourceField, 'sourcefieldlabel' => vtranslate($sourceFieldLabel, $forModule), 'targetfield' => $targetField, 'targetfieldlabel' => vtranslate($targetFieldLabel, $forModule), 'module' => $forModule);
}
}
return $dependentPicklists;
}
示例4: getDBValidationData_510
/** Function to get the details for fieldlabels for a given table array
* @param $tablearray -- tablearray:: Type string array (table names in array)
* @param $tabid -- tabid:: Type integer
* @returns $fieldName_array -- fieldName_array:: Type string array (field name details)
*
*/
function getDBValidationData_510($tablearray, $tabid = '')
{
global $log;
$log->debug("Entering getDBValidationData(" . $tablearray . "," . $tabid . ") method ...");
$sql = '';
$params = array();
$tab_con = "";
$numValues = count($tablearray);
global $adb, $mod_strings;
if ($tabid != '') {
$tab_con = ' and tabid=' . $adb->sql_escape_string($tabid);
}
for ($i = 0; $i < $numValues; $i++) {
if (in_array("emails", $tablearray)) {
if ($numValues > 1 && $i != $numValues - 1) {
$sql .= "select fieldlabel,fieldname,typeofdata from vtiger_field where tablename=? and tabid=10 and vtiger_field.presence in (0,2) and displaytype <> 2 union ";
array_push($params, $tablearray[$i]);
} else {
$sql .= "select fieldlabel,fieldname,typeofdata from vtiger_field where tablename=? and tabid=10 and vtiger_field.presence in (0,2) and displaytype <> 2 ";
array_push($params, $tablearray[$i]);
}
} else {
if ($numValues > 1 && $i != $numValues - 1) {
$sql .= "select fieldlabel,fieldname,typeofdata from vtiger_field where tablename=? {$tab_con} and displaytype in (1,3) and vtiger_field.presence in (0,2) union ";
array_push($params, $tablearray[$i]);
} else {
$sql .= "select fieldlabel,fieldname,typeofdata from vtiger_field where tablename=? {$tab_con} and displaytype in (1,3) and vtiger_field.presence in (0,2)";
array_push($params, $tablearray[$i]);
}
}
}
$result = $adb->pquery($sql, $params);
$noofrows = $adb->num_rows($result);
$fieldModuleName = empty($tabid) ? false : getTabModuleName($tabid);
$fieldName_array = array();
for ($i = 0; $i < $noofrows; $i++) {
// Translate label with reference to module language string
$fieldlabel = getTranslatedString($adb->query_result($result, $i, 'fieldlabel'), $fieldModuleName);
$fieldname = $adb->query_result($result, $i, 'fieldname');
$typeofdata = $adb->query_result($result, $i, 'typeofdata');
//echo '<br> '.$fieldlabel.'....'.$fieldname.'....'.$typeofdata;
$fldLabel_array = array();
$fldLabel_array[$fieldlabel] = $typeofdata;
$fieldName_array[$fieldname] = $fldLabel_array;
}
$log->debug("Exiting getDBValidationData method ...");
return $fieldName_array;
}
示例5: showBlocksAndFields
public function showBlocksAndFields(Vtiger_Request $request)
{
$sourceModuleId = $request->get('moduleId');
$language = $request->get('lang');
$currentModule = $request->get('module');
$parent = $request->get('parent');
$settings_block = $request->get('block');
$settings_fieldid = $request->get('fieldid');
$adb = PearDatabase::getInstance();
$sourceModule = getTabModuleName($sourceModuleId);
$moduleModel = Settings_LayoutEditor_Module_Model::getInstanceByName($sourceModule);
$fieldModels = $moduleModel->getFields();
$blockModels = $moduleModel->getBlocks();
$blockIdFieldMap = array();
$inactiveFields = array();
foreach ($fieldModels as $fieldModel) {
$blockIdFieldMap[$fieldModel->getBlockId()][$fieldModel->getName()] = $fieldModel;
if (!$fieldModel->isActiveField()) {
$inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = vtranslate($fieldModel->get('label'), $sourceModule);
}
}
foreach ($blockModels as $blockLabel => $blockModel) {
$fieldModelList = $blockIdFieldMap[$blockModel->get('id')];
$blockModel->setFields($fieldModelList);
}
$query = "SELECT * from its4you_labels where tabid = ? and lang =?";
$result = $adb->pquery($query, array($sourceModuleId, $language));
while ($row = $adb->fetchByAssoc($result)) {
$Fields_Labels[$row['fieldid']] = $row['translate_label'];
}
$qualifiedModule = $request->getModule(false);
$viewer = $this->getViewer($request);
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
$viewer->assign('SELECTED_MODULE_MODEL', $moduleModel);
$viewer->assign('BLOCKS', $blockModels);
$viewer->assign('ADD_SUPPORTED_FIELD_TYPES', $moduleModel->getAddSupportedFieldTypes());
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
$viewer->assign('LANGUAGE', $language);
$viewer->assign('CURRENT_MODULE', $currentModule);
$viewer->assign('PARENT', $parent);
$viewer->assign('FIELDS_LABELS', $Fields_Labels);
$viewer->assign('SETTINGS_FIELDID', $settings_fieldid);
$viewer->assign('SETTINGS_BLOCK', $settings_block);
echo $viewer->view('EditView.tpl', $qualifiedModule, true);
}
示例6: vtJsonDependentModules
function vtJsonDependentModules($adb, $request)
{
$moduleName = $request['modulename'];
$result = $adb->pquery("SELECT fieldname, tabid, typeofdata, vtiger_ws_referencetype.type as reference_module FROM vtiger_field\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_ws_fieldtype ON vtiger_field.uitype = vtiger_ws_fieldtype.uitype\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_ws_referencetype ON vtiger_ws_fieldtype.fieldtypeid = vtiger_ws_referencetype.fieldtypeid\n\t\t\t\t\t\t\tUNION\n\t\t\t\t\t\t\tSELECT fieldname, tabid, typeofdata, relmodule as reference_module FROM vtiger_field\n\t\t\t\t\t\t\t\t\tINNER JOIN vtiger_fieldmodulerel ON vtiger_field.fieldid = vtiger_fieldmodulerel.fieldid", array());
$noOfFields = $adb->num_rows($result);
$dependentFields = array();
// List of modules which will not be supported by 'Create Entity' workflow task
$filterModules = array('Invoice', 'Quotes', 'SalesOrder', 'PurchaseOrder', 'Emails', 'Calendar', 'Events', 'Accounts');
$skipFieldsList = array();
for ($i = 0; $i < $noOfFields; ++$i) {
$tabId = $adb->query_result($result, $i, 'tabid');
$fieldName = $adb->query_result($result, $i, 'fieldname');
$typeOfData = $adb->query_result($result, $i, 'typeofdata');
$referenceModule = $adb->query_result($result, $i, 'reference_module');
$tabModuleName = getTabModuleName($tabId);
if (in_array($tabModuleName, $filterModules)) {
continue;
}
if ($referenceModule == $moduleName && $tabModuleName != $moduleName) {
if (!vtlib_isModuleActive($tabModuleName)) {
continue;
}
$dependentFields[$tabModuleName] = array('fieldname' => $fieldName, 'modulelabel' => getTranslatedString($tabModuleName, $tabModuleName));
} else {
$dataTypeInfo = explode('~', $typeOfData);
if ($dataTypeInfo[1] == 'M') {
// If the current reference field is mandatory
$skipFieldsList[$tabModuleName] = array('fieldname' => $fieldName);
}
}
}
foreach ($skipFieldsList as $tabModuleName => $fieldInfo) {
$dependentFieldInfo = $dependentFields[$tabModuleName];
if ($dependentFieldInfo['fieldname'] != $fieldInfo['fieldname']) {
unset($dependentFields[$tabModuleName]);
}
}
$returnValue = array('count' => count($dependentFields), 'entities' => $dependentFields);
echo Zend_Json::encode($returnValue);
}
示例7: getNameFields
public function getNameFields()
{
global $adb;
$data = getEntityFieldNames(getTabModuleName($this->getEffectiveTabId()));
$fieldNames = '';
if ($data) {
$fieldNames = $data['fieldname'];
if (is_array($fieldNames)) {
$fieldNames = implode(',', $fieldNames);
}
}
return $fieldNames;
}
示例8: getFieldRelatedInfo
function getFieldRelatedInfo($tabId, $fieldName)
{
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
if ($fieldInfo === false) {
getColumnFields(getTabModuleName($tabid));
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
}
return $fieldInfo;
}
示例9: getPickListOptions
function getPickListOptions()
{
global $app_strings, $mod_strings, $log, $current_language;
static $purified_plcache = array();
$fieldName = $this->getFieldName();
$default_charset = VTWS_PreserveGlobal::getGlobal('default_charset');
$moduleName = getTabModuleName($this->getTabId());
if ($moduleName == 'Events') {
$moduleName = 'Calendar';
}
$temp_mod_strings = $moduleName != '' ? return_module_language($current_language, $moduleName) : $mod_strings;
if (array_key_exists($moduleName . $fieldName, $purified_plcache)) {
return $purified_plcache[$moduleName . $fieldName];
}
$options = array();
$sql = "select * from vtiger_picklist where name=?";
$result = $this->pearDB->pquery($sql, array($fieldName));
$numRows = $this->pearDB->num_rows($result);
if ($numRows == 0) {
$sql = "select * from vtiger_{$fieldName}";
$result = $this->pearDB->pquery($sql, array());
$numRows = $this->pearDB->num_rows($result);
for ($i = 0; $i < $numRows; ++$i) {
$elem = array();
$picklistValue = $this->pearDB->query_result($result, $i, $fieldName);
$picklistValue = decode_html($picklistValue);
$trans_str = $temp_mod_strings[$picklistValue] != '' ? $temp_mod_strings[$picklistValue] : ($app_strings[$picklistValue] != '' ? $app_strings[$picklistValue] : $picklistValue);
while ($trans_str != preg_replace('/(.*) {.+}(.*)/', '$1$2', $trans_str)) {
$trans_str = preg_replace('/(.*) {.+}(.*)/', '$1$2', $trans_str);
}
$elem["label"] = $trans_str;
$elem["value"] = $picklistValue;
array_push($options, $elem);
}
} else {
$user = VTWS_PreserveGlobal::getGlobal('current_user');
$details = getPickListValues($fieldName, $user->roleid);
for ($i = 0; $i < sizeof($details); ++$i) {
$elem = array();
$picklistValue = decode_html($details[$i]);
$trans_str = $temp_mod_strings[$picklistValue] != '' ? $temp_mod_strings[$picklistValue] : ($app_strings[$picklistValue] != '' ? $app_strings[$picklistValue] : $picklistValue);
while ($trans_str != preg_replace('/(.*) {.+}(.*)/', '$1$2', $trans_str)) {
$trans_str = preg_replace('/(.*) {.+}(.*)/', '$1$2', $trans_str);
}
$elem["label"] = $trans_str;
$elem["value"] = $picklistValue;
array_push($options, $elem);
}
}
$purified_plcache[$moduleName . $fieldName] = $options;
return $options;
}
示例10: getPermittedModuleNames
/** Function to get the permitted module name Array with presence as 0
* @returns permitted module name Array :: Type Array
*
*/
function getPermittedModuleNames()
{
global $log;
global $WERPASCOPETABDATA;
$log->debug("Entering getPermittedModuleNames() method ...");
global $current_user;
$permittedModules = array();
global $WERPASCOPEUSERPRIVILEGES;
require $WERPASCOPEUSERPRIVILEGES . '/user_privileges_' . $current_user->id . '.php';
include $WERPASCOPETABDATA;
if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) {
foreach ($tab_seq_array as $tabid => $seq_value) {
if ($seq_value === 0 && $profileTabsPermission[$tabid] === 0) {
$permittedModules[] = getTabModuleName($tabid);
}
}
} else {
foreach ($tab_seq_array as $tabid => $seq_value) {
if ($seq_value === 0) {
$permittedModules[] = getTabModuleName($tabid);
}
}
}
$log->debug("Exiting getPermittedModuleNames method ...");
return $permittedModules;
}
示例11: get_modules
function get_modules($id)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$log->debug("Entering customer portal Function get_modules");
getServerSessionId($id);
// Check if information is available in cache?
$modules = Vtiger_Soap_YetiPortal::lookupAllowedModules();
if ($modules === false) {
$modules = array();
$query = $adb->pquery("SELECT vtiger_customerportal_tabs.* FROM vtiger_customerportal_tabs\n\t\t\tINNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_customerportal_tabs.tabid\n\t\t\tWHERE vtiger_tab.presence = 0 AND vtiger_customerportal_tabs.visible = 1", array());
$norows = $adb->num_rows($query);
if ($norows) {
while ($resultrow = $adb->fetch_array($query)) {
$name = getTabModuleName($resultrow['tabid']);
$modules[(int) $resultrow['sequence']] = array('name' => $name, 'translated_name' => Vtiger_Language_Handler::getTranslatedString($name, $name, vglobal('default_language')));
}
ksort($modules);
// Order via SQL might cost us, so handling it ourselves in this case
}
Vtiger_Soap_YetiPortal::updateAllowedModules($modules);
}
$log->debug("Exiting customerportal function get_modules");
return $modules;
}
示例12: getAccessPickListValues
/** Function to get picklist value array based on profile
* * returns permitted fields in array format
**/
function getAccessPickListValues()
{
$adb = PearDatabase::getInstance();
$current_user = vglobal('current_user');
$id = array(getTabid($this->primarymodule));
if ($this->secondarymodule != '') {
array_push($id, getTabid($this->secondarymodule));
}
$query = 'select fieldname,columnname,fieldid,fieldlabel,tabid,uitype from vtiger_field where tabid in(' . generateQuestionMarks($id) . ') and uitype in (15,33,55)';
//and columnname in (?)';
$result = $adb->pquery($query, $id);
//,$select_column));
$roleid = $current_user->roleid;
$subrole = getRoleSubordinates($roleid);
if (count($subrole) > 0) {
$roleids = $subrole;
array_push($roleids, $roleid);
} else {
$roleids = $roleid;
}
$temp_status = array();
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$fieldname = $adb->query_result($result, $i, "fieldname");
$fieldlabel = $adb->query_result($result, $i, "fieldlabel");
$tabid = $adb->query_result($result, $i, "tabid");
$uitype = $adb->query_result($result, $i, "uitype");
$fieldlabel1 = str_replace(" ", "__", $fieldlabel);
$keyvalue = getTabModuleName($tabid) . "__" . $fieldlabel1;
$fieldvalues = array();
if (count($roleids) > 1) {
$mulsel = "select distinct {$fieldname} from vtiger_{$fieldname} inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_{$fieldname}.picklist_valueid where roleid in (\"" . implode($roleids, "\",\"") . "\") and picklistid in (select picklistid from vtiger_{$fieldname})";
// order by sortid asc - not requried
} else {
$mulsel = "select distinct {$fieldname} from vtiger_{$fieldname} inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_{$fieldname}.picklist_valueid where roleid ='" . $roleid . "' and picklistid in (select picklistid from vtiger_{$fieldname})";
// order by sortid asc - not requried
}
if ($fieldname != 'firstname') {
$mulselresult = $adb->query($mulsel);
}
for ($j = 0; $j < $adb->num_rows($mulselresult); $j++) {
$fldvalue = $adb->query_result($mulselresult, $j, $fieldname);
if (in_array($fldvalue, $fieldvalues)) {
continue;
}
$fieldvalues[] = $fldvalue;
}
$field_count = count($fieldvalues);
if ($uitype == 15 && $field_count > 0 && ($fieldname == 'taskstatus' || $fieldname == 'eventstatus')) {
$temp_count = count($temp_status[$keyvalue]);
if ($temp_count > 0) {
for ($t = 0; $t < $field_count; $t++) {
$temp_status[$keyvalue][$temp_count + $t] = $fieldvalues[$t];
}
$fieldvalues = $temp_status[$keyvalue];
} else {
$temp_status[$keyvalue] = $fieldvalues;
}
}
if ($uitype == 33) {
$fieldlists[1][$keyvalue] = $fieldvalues;
} else {
if ($uitype == 55 && $fieldname == 'salutationtype') {
$fieldlists[$keyvalue] = $fieldvalues;
} else {
if ($uitype == 15) {
$fieldlists[$keyvalue] = $fieldvalues;
}
}
}
}
return $fieldlists;
}
示例13: setupTemporaryTable
/**
*
* @param <type> $module
* @param <type> $user
* @param <type> $parentRole
* @param <type> $userGroups
*/
protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups)
{
$module = null;
if (!empty($tabId)) {
$module = getTabModuleName($tabId);
}
$query = $this->getNonAdminAccessQuery($module, $user, $parentRole, $userGroups);
$query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key) ignore " . $query;
$db = PearDatabase::getInstance();
$result = $db->pquery($query, array());
if (is_object($result)) {
return true;
}
return false;
}
示例14: getTabname
/** Function to get the tabname for a given id
* @param $tabid -- tab id:: Type integer
* @returns $string -- string:: Type string
*
*/
function getTabname($tabid)
{
global $log;
$log->debug("Entering getTabname() method ...");
$tabname = getTabModuleName($tabid);
$log->debug("Exiting getTabname method ...");
return $tabname;
}
示例15: vtlib_purify
$sharing_module = vtlib_purify($_REQUEST['sharing_module']);
$tabid = getTabid($sharing_module);
$sharedby = explode('::', vtlib_purify($_REQUEST[$sharing_module . '_share']));
$sharedto = explode('::', vtlib_purify($_REQUEST[$sharing_module . '_access']));
$share_entity_type = $sharedby[0];
$to_entity_type = $sharedto[0];
$share_entity_id = $sharedby[1];
$to_entity_id = $sharedto[1];
$module_sharing_access = vtlib_purify($_REQUEST['share_memberType']);
$mode = vtlib_purify($_REQUEST['mode']);
$relatedShareModuleArr = getRelatedSharingModules($tabid);
if ($mode == 'create') {
$shareId = addSharingRule($tabid, $share_entity_type, $to_entity_type, $share_entity_id, $to_entity_id, $module_sharing_access);
//Adding the Related ModulePermission Sharing
foreach ($relatedShareModuleArr as $reltabid => $ds_rm_id) {
$reltabname = getTabModuleName($reltabid);
$relSharePermission = vtlib_purify($_REQUEST[$reltabname . '_accessopt']);
addRelatedModuleSharingPermission($shareId, $tabid, $reltabid, $relSharePermission);
}
} elseif ($mode == 'edit') {
$shareId = vtlib_purify($_REQUEST['shareId']);
updateSharingRule($shareId, $tabid, $share_entity_type, $to_entity_type, $share_entity_id, $to_entity_id, $module_sharing_access);
//Adding the Related ModulePermission Sharing
foreach ($relatedShareModuleArr as $reltabid => $ds_rm_id) {
$reltabname = getTabModuleName($reltabid);
$relSharePermission = vtlib_purify($_REQUEST[$reltabname . '_accessopt']);
updateRelatedModuleSharingPermission($shareId, $tabid, $reltabid, $relSharePermission);
}
}
$loc = "Location: index.php?action=OrgSharingDetailView&module=Settings&parenttab=Settings";
header($loc);