本文整理汇总了PHP中getTabModuleName函数的典型用法代码示例。如果您正苦于以下问题:PHP getTabModuleName函数的具体用法?PHP getTabModuleName怎么用?PHP getTabModuleName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTabModuleName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:34,代码来源:RelatedModule.php
示例2: module
/**
* Get module name.
*/
function module()
{
if (!empty($this->tabid)) {
return getTabModuleName($this->tabid);
}
return false;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:10,代码来源:Link.php
示例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;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:30,代码来源:DependentPickListUtils.php
示例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;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:54,代码来源:FormValidationUtil.php
示例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);
}
开发者ID:cin-system,项目名称:cinrepo,代码行数:46,代码来源:Edit.php
示例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);
}
开发者ID:kduqi,项目名称:corebos,代码行数:40,代码来源:WorkflowComponents.php
示例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;
}
开发者ID:Wasage,项目名称:werpa,代码行数:13,代码来源:VtigerCRMObjectMeta.php
示例8: getFieldRelatedInfo
function getFieldRelatedInfo($tabId, $fieldName)
{
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
if ($fieldInfo === false) {
getColumnFields(getTabModuleName($tabid));
$fieldInfo = VTCacheUtils::lookupFieldInfo($tabId, $fieldName);
}
return $fieldInfo;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:9,代码来源:Save.php
示例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;
}
开发者ID:jgjermeni,项目名称:corebos,代码行数:52,代码来源:WebserviceField.php
示例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;
}
开发者ID:Wasage,项目名称:werpa,代码行数:30,代码来源:UserInfoUtil.php
示例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;
}
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:25,代码来源:yetiportal.php
示例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;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:75,代码来源:ReportRun.php
示例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;
}
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:22,代码来源:CRMEntity.php
示例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;
}
开发者ID:Pengzw,项目名称:c3crm,代码行数:13,代码来源:utils.php
示例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);
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:SaveSharingRule.php
示例16: getObjectTypeName
private function getObjectTypeName($moduleId)
{
return getTabModuleName($moduleId);
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:4,代码来源:VtigerCRMObject.php
示例17: vtws_listtypes
function vtws_listtypes($fieldTypeList, $user)
{
// Bulk Save Mode: For re-using information
static $webserviceEntities = false;
// END
static $types = array();
if (!empty($fieldTypeList)) {
$fieldTypeList = array_map(strtolower, $fieldTypeList);
sort($fieldTypeList);
$fieldTypeString = implode(',', $fieldTypeList);
} else {
$fieldTypeString = 'all';
}
if (!empty($types[$user->id][$fieldTypeString])) {
return $types[$user->id][$fieldTypeString];
}
try {
global $log;
/**
* @var PearDatabase
*/
$db = PearDatabase::getInstance();
vtws_preserveGlobal('current_user', $user);
//get All the modules the current user is permitted to Access.
$allModuleNames = getPermittedModuleNames();
if (array_search('Calendar', $allModuleNames) !== false) {
array_push($allModuleNames, 'Events');
}
if (!empty($fieldTypeList)) {
$sql = "SELECT distinct(vtiger_field.tabid) as tabid FROM vtiger_field LEFT JOIN vtiger_ws_fieldtype ON " . "vtiger_field.uitype=vtiger_ws_fieldtype.uitype\n\t\t\t\t INNER JOIN vtiger_profile2field ON vtiger_field.fieldid = vtiger_profile2field.fieldid\n\t\t\t\t INNER JOIN vtiger_def_org_field ON vtiger_def_org_field.fieldid = vtiger_field.fieldid\n\t\t\t\t INNER JOIN vtiger_role2profile ON vtiger_profile2field.profileid = vtiger_role2profile.profileid\n\t\t\t\t INNER JOIN vtiger_user2role ON vtiger_user2role.roleid = vtiger_role2profile.roleid\n\t\t\t\t where vtiger_profile2field.visible=0 and vtiger_def_org_field.visible = 0\n\t\t\t\t and vtiger_field.presence in (0,2)\n\t\t\t\t and vtiger_user2role.userid=? and fieldtype in (" . generateQuestionMarks($fieldTypeList) . ')';
$params = array();
$params[] = $user->id;
foreach ($fieldTypeList as $fieldType) {
$params[] = $fieldType;
}
$result = $db->pquery($sql, $params);
$it = new SqlResultIterator($db, $result);
$moduleList = array();
foreach ($it as $row) {
$moduleList[] = getTabModuleName($row->tabid);
}
$allModuleNames = array_intersect($moduleList, $allModuleNames);
$params = $fieldTypeList;
$sql = "select name from vtiger_ws_entity inner join vtiger_ws_entity_tables on " . "vtiger_ws_entity.id=vtiger_ws_entity_tables.webservice_entity_id inner join " . "vtiger_ws_entity_fieldtype on vtiger_ws_entity_fieldtype.table_name=" . "vtiger_ws_entity_tables.table_name where fieldtype=(" . generateQuestionMarks($fieldTypeList) . ')';
$result = $db->pquery($sql, $params);
$it = new SqlResultIterator($db, $result);
$entityList = array();
foreach ($it as $row) {
$entityList[] = $row->name;
}
}
//get All the CRM entity names.
if ($webserviceEntities === false || !CRMEntity::isBulkSaveMode()) {
// Bulk Save Mode: For re-using information
$webserviceEntities = vtws_getWebserviceEntities();
}
$accessibleModules = array_values(array_intersect($webserviceEntities['module'], $allModuleNames));
$entities = $webserviceEntities['entity'];
$accessibleEntities = array();
if (empty($fieldTypeList)) {
foreach ($entities as $entity) {
$webserviceObject = VtigerWebserviceObject::fromName($db, $entity);
$handlerPath = $webserviceObject->getHandlerPath();
$handlerClass = $webserviceObject->getHandlerClass();
require_once $handlerPath;
$handler = new $handlerClass($webserviceObject, $user, $db, $log);
$meta = $handler->getMeta();
if ($meta->hasAccess() === true) {
array_push($accessibleEntities, $entity);
}
}
}
} catch (WebServiceException $exception) {
throw $exception;
} catch (Exception $exception) {
throw new WebServiceException(WebServiceErrorCode::$DATABASEQUERYERROR, "An Database error occured while performing the operation");
}
$default_language = VTWS_PreserveGlobal::getGlobal('default_language');
global $current_language;
if (empty($current_language)) {
$current_language = $default_language;
}
$current_language = vtws_preserveGlobal('current_language', $current_language);
$appStrings = return_application_language($current_language);
$appListString = return_app_list_strings_language($current_language);
vtws_preserveGlobal('app_strings', $appStrings);
vtws_preserveGlobal('app_list_strings', $appListString);
$informationArray = array();
foreach ($accessibleModules as $module) {
$vtigerModule = $module == 'Events' ? 'Calendar' : $module;
$informationArray[$module] = array('isEntity' => true, 'label' => getTranslatedString($module, $vtigerModule), 'singular' => getTranslatedString('SINGLE_' . $module, $vtigerModule));
}
foreach ($accessibleEntities as $entity) {
$label = isset($appStrings[$entity]) ? $appStrings[$entity] : $entity;
$singular = isset($appStrings['SINGLE_' . $entity]) ? $appStrings['SINGLE_' . $entity] : $entity;
$informationArray[$entity] = array('isEntity' => false, 'label' => $label, 'singular' => $singular);
}
VTWS_PreserveGlobal::flush();
$types[$user->id][$fieldTypeString] = array("types" => array_merge($accessibleModules, $accessibleEntities), 'information' => $informationArray);
return $types[$user->id][$fieldTypeString];
//.........这里部分代码省略.........
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:101,代码来源:ModuleTypes.php
示例18: getTreeDetails
function getTreeDetails()
{
if (count(self::$treeDetails) > 0) {
return self::$treeDetails;
}
$result = $this->pearDB->pquery('SELECT module FROM vtiger_trees_templates WHERE templateid = ?', [$this->getFieldParams()]);
$module = $this->pearDB->getSingleValue($result);
$moduleName = getTabModuleName($module);
$result = $this->pearDB->pquery('SELECT tree,label FROM vtiger_trees_templates_data WHERE templateid = ?', [$this->getFieldParams()]);
while ($row = $this->pearDB->fetch_array($result)) {
self::$treeDetails[$row['tree']] = getTranslatedString($row['label'], $moduleName);
}
return self::$treeDetails;
}
开发者ID:noclav,项目名称:UpdatePackages,代码行数:14,代码来源:WebserviceField.php
示例19: getImportInfoFromResult
static function getImportInfoFromResult($rowData)
{
return array('id' => $rowData['importid'], 'module' => getTabModuleName($rowData['tabid']), 'field_mapping' => Zend_Json::decode($rowData['field_mapping']), 'default_values' => Zend_Json::decode($rowData['default_values']), 'merge_type' => $rowData['merge_type'], 'merge_fields' => Zend_Json::decode($rowData['merge_fields']), 'user_id' => $rowData['userid'], 'status' => $rowData['status']);
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:4,代码来源:Queue.php
示例20: getFieldid
/**
* Function to get the fieldid
*
* @param Integer $tabid
* @param Boolean $onlyactive
*/
function getFieldid($tabid, $fieldname, $onlyactive = true)
{
global $adb;
// Look up information at cache first
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
if ($fieldinfo === false) {
getColumnFields(getTabModuleName($tabid));
$fieldinfo = VTCacheUtils::lookupFieldInfo($tabid, $fieldname);
}
// Get the field id based on required criteria
$fieldid = false;
if ($fieldinfo) {
$fieldid = $fieldinfo['fieldid'];
if ($onlyactive && !in_array($fieldinfo['presence'], array('0', '2'))) {
$fieldid = false;
}
}
return $fieldid;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:25,代码来源:CommonUtils.php
注:本文中的getTabModuleName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论