• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getTabname函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getTabname函数的典型用法代码示例。如果您正苦于以下问题:PHP getTabname函数的具体用法?PHP getTabname怎么用?PHP getTabname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getTabname函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: vtws_getUserAccessibleGroups

function vtws_getUserAccessibleGroups($moduleId, $user)
{
    global $adb;
    require 'user_privileges/user_privileges_' . $user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $user->id . '.php';
    $tabName = getTabname($moduleId);
    if ($is_admin == false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[$moduleId] == 3 or $defaultOrgSharingPermission[$moduleId] == 0)) {
        $result = get_current_user_access_groups($tabName);
    } else {
        $result = get_group_options();
    }
    $groups = array();
    if ($result != null && $result != '' && is_object($result)) {
        $rowCount = $adb->num_rows($result);
        for ($i = 0; $i < $rowCount; $i++) {
            $nameArray = $adb->query_result_rowdata($result, $i);
            $groupId = $nameArray["groupid"];
            $groupName = $nameArray["groupname"];
            $groups[] = array('id' => $groupId, 'name' => $groupName);
        }
    }
    return $groups;
}
开发者ID:kduqi,项目名称:corebos,代码行数:23,代码来源:Utils.php


示例2: setupTemporaryTable

 protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups)
 {
     $module = null;
     if (!empty($tabId)) {
         $module = getTabname($tabId);
     }
     $query = $this->getNonAdminAccessQuery($module, $user, $parentRole, $userGroups);
     $query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key, shared " . "int(1) default 0) ignore " . $query;
     $db = PearDatabase::getInstance();
     $result = $db->pquery($query, array());
     if (is_object($result)) {
         $query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key, shared " . "int(1) default 0) replace select 1, userid as id from vtiger_sharedcalendar where " . "sharedid = {$user->id}";
         $result = $db->pquery($query, array());
         if (is_object($result)) {
             return true;
         }
     }
     return false;
 }
开发者ID:kikojover,项目名称:corebos,代码行数:19,代码来源:Activity.php


示例3: getRelatedListInfo

function getRelatedListInfo($module)
{
    global $adb;
    $tabid = getTabid($module);
    $related_query = 'select * from vtiger_relatedlists ' . 'inner join vtiger_tab on vtiger_relatedlists.related_tabid = vtiger_tab.tabid and vtiger_tab.presence = 0 where vtiger_relatedlists.tabid = ? order by sequence';
    $relinfo = $adb->pquery($related_query, array($tabid));
    $noofrows = $adb->num_rows($relinfo);
    for ($i = 0; $i < $noofrows; $i++) {
        $res[$i]['name'] = $adb->query_result($relinfo, $i, 'name');
        $res[$i]['sequence'] = $adb->query_result($relinfo, $i, 'sequence');
        $label = $adb->query_result($relinfo, $i, 'label');
        $relatedModule = getTabname($adb->query_result($relinfo, $i, 'related_tabid'));
        $res[$i]['label'] = getTranslatedString($label, $relatedModule);
        $res[$i]['presence'] = $adb->query_result($relinfo, $i, 'presence');
        $res[$i]['tabid'] = $tabid;
        $res[$i]['id'] = $adb->query_result($relinfo, $i, 'relation_id');
    }
    return $res;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:19,代码来源:LayoutBlockList.php


示例4: getParentRecordOwner

/** Function to get parent record owner
 * @param $tabid -- tabid :: Type integer
 * @param $parModId -- parent module id :: Type integer
 * @param $record_id -- record id :: Type integer
 * @returns $parentRecOwner -- parentRecOwner:: Type integer
 */
function getParentRecordOwner($tabid, $parModId, $record_id)
{
    global $log;
    $log->debug("Entering getParentRecordOwner(" . $tabid . "," . $parModId . "," . $record_id . ") method ...");
    $parentRecOwner = array();
    $parentTabName = getTabname($parModId);
    $relTabName = getTabname($tabid);
    $fn_name = "get" . $relTabName . "Related" . $parentTabName;
    $ent_id = $fn_name($record_id);
    if ($ent_id != '') {
        $parentRecOwner = getRecordOwnerId($ent_id);
    }
    $log->debug("Exiting getParentRecordOwner method ...");
    return $parentRecOwner;
}
开发者ID:yunter,项目名称:crm,代码行数:21,代码来源:utils.php


示例5: populateSharingtmptables

/** Function to populate the read/wirte Sharing permissions data of user/groups for the specified user into the database 
 * @param $userid -- user id:: Type integer
 */
function populateSharingtmptables($userid)
{
    global $adb;
    checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
    require 'user_privileges/sharing_privileges_' . $userid . '.php';
    //Deleting from the existing vtiger_tables
    $table_arr = array('vtiger_tmp_read_user_sharing_per', 'vtiger_tmp_write_user_sharing_per', 'vtiger_tmp_read_group_sharing_per', 'vtiger_tmp_write_group_sharing_per', 'vtiger_tmp_read_user_rel_sharing_per', 'vtiger_tmp_write_user_rel_sharing_per', 'vtiger_tmp_read_group_rel_sharing_per', 'vtiger_tmp_write_group_rel_sharing_per');
    foreach ($table_arr as $tabname) {
        $query = "delete from " . $tabname . " where userid=?";
        $adb->pquery($query, array($userid));
    }
    // Look up for modules for which sharing access is enabled.
    $sharingArray = array('Emails');
    $otherModules = getSharingModuleList();
    $sharingArray = array_merge($sharingArray, $otherModules);
    foreach ($sharingArray as $module) {
        $module_sharing_read_permvar = $module . '_share_read_permission';
        $module_sharing_write_permvar = $module . '_share_write_permission';
        populateSharingPrivileges('USER', $userid, $module, 'read', ${$module_sharing_read_permvar});
        populateSharingPrivileges('USER', $userid, $module, 'write', ${$module_sharing_write_permvar});
        populateSharingPrivileges('GROUP', $userid, $module, 'read', ${$module_sharing_read_permvar});
        populateSharingPrivileges('GROUP', $userid, $module, 'write', ${$module_sharing_write_permvar});
    }
    //Populating Values into the temp related sharing tables
    foreach ($related_module_share as $rel_tab_id => $tabid_arr) {
        $rel_tab_name = getTabname($rel_tab_id);
        foreach ($tabid_arr as $taid) {
            $tab_name = getTabname($taid);
            $relmodule_sharing_read_permvar = $tab_name . '_' . $rel_tab_name . '_share_read_permission';
            $relmodule_sharing_write_permvar = $tab_name . '_' . $rel_tab_name . '_share_write_permission';
            populateRelatedSharingPrivileges('USER', $userid, $tab_name, $rel_tab_name, 'read', ${$relmodule_sharing_read_permvar});
            populateRelatedSharingPrivileges('USER', $userid, $tab_name, $rel_tab_name, 'write', ${$relmodule_sharing_write_permvar});
            populateRelatedSharingPrivileges('GROUP', $userid, $tab_name, $rel_tab_name, 'read', ${$relmodule_sharing_read_permvar});
            populateRelatedSharingPrivileges('GROUP', $userid, $tab_name, $rel_tab_name, 'write', ${$relmodule_sharing_write_permvar});
        }
    }
}
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:40,代码来源:CreateUserPrivilegeFile.php


示例6: isReadWritePermittedBySharing

/** Function to check if the currently logged in user has Write Access due to Sharing for the specified record
 * @param $module -- Module Name:: Type varchar
 * @param $actionid -- Action Id:: Type integer
 * @param $recordid -- Record Id:: Type integer
 * @param $tabid -- Tab Id:: Type integer
 * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
 */
function isReadWritePermittedBySharing($module, $tabid, $actionid, $record_id)
{
    $log = vglobal('log');
    $log->debug("Entering isReadWritePermittedBySharing(" . $module . "," . $tabid . "," . $actionid . "," . $record_id . ") method ...");
    $adb = PearDatabase::getInstance();
    $current_user = vglobal('current_user');
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    $ownertype = '';
    $ownerid = '';
    $sharePer = 'no';
    $sharingModuleList = getSharingModuleList();
    if (!in_array($module, $sharingModuleList)) {
        $sharePer = 'no';
        return $sharePer;
    }
    $recordOwnerArr = getRecordOwnerId($record_id);
    foreach ($recordOwnerArr as $type => $id) {
        $ownertype = $type;
        $ownerid = $id;
    }
    $varname = $module . "_share_write_permission";
    $write_per_arr = ${$varname};
    if ($ownertype == 'Users') {
        //Checking the Write Sharing Permission Array in Role Users
        $write_role_per = $write_per_arr['ROLE'];
        foreach ($write_role_per as $roleid => $userids) {
            if (in_array($ownerid, $userids)) {
                $sharePer = 'yes';
                $log->debug("Exiting isReadWritePermittedBySharing method ...");
                return $sharePer;
            }
        }
        //Checking the Write Sharing Permission Array in Groups Users
        $write_grp_per = $write_per_arr['GROUP'];
        foreach ($write_grp_per as $grpid => $userids) {
            if (in_array($ownerid, $userids)) {
                $sharePer = 'yes';
                $log->debug("Exiting isReadWritePermittedBySharing method ...");
                return $sharePer;
            }
        }
    } elseif ($ownertype == 'Groups') {
        $write_grp_per = $write_per_arr['GROUP'];
        if (array_key_exists($ownerid, $write_grp_per)) {
            $sharePer = 'yes';
            $log->debug("Exiting isReadWritePermittedBySharing method ...");
            return $sharePer;
        }
    }
    //Checking for the Related Sharing Permission
    $relatedModuleArray = $related_module_share[$tabid];
    if (is_array($relatedModuleArray)) {
        foreach ($relatedModuleArray as $parModId) {
            $parRecordOwner = getParentRecordOwner($tabid, $parModId, $record_id);
            if (sizeof($parRecordOwner) > 0) {
                $parModName = getTabname($parModId);
                $rel_var = $parModName . "_" . $module . "_share_write_permission";
                $write_related_per_arr = ${$rel_var};
                $rel_owner_type = '';
                $rel_owner_id = '';
                foreach ($parRecordOwner as $rel_type => $rel_id) {
                    $rel_owner_type = $rel_type;
                    $rel_owner_id = $rel_id;
                }
                if ($rel_owner_type == 'Users') {
                    //Checking in Role Users
                    $write_related_role_per = $write_related_per_arr['ROLE'];
                    foreach ($write_related_role_per as $roleid => $userids) {
                        if (in_array($rel_owner_id, $userids)) {
                            $sharePer = 'yes';
                            $log->debug("Exiting isReadWritePermittedBySharing method ...");
                            return $sharePer;
                        }
                    }
                    //Checking in Group Users
                    $write_related_grp_per = $write_related_per_arr['GROUP'];
                    foreach ($write_related_grp_per as $grpid => $userids) {
                        if (in_array($rel_owner_id, $userids)) {
                            $sharePer = 'yes';
                            $log->debug("Exiting isReadWritePermittedBySharing method ...");
                            return $sharePer;
                        }
                    }
                } elseif ($rel_owner_type == 'Groups') {
                    $write_related_grp_per = $write_related_per_arr['GROUP'];
                    if (array_key_exists($rel_owner_id, $write_related_grp_per)) {
                        $sharePer = 'yes';
                        $log->debug("Exiting isReadWritePermittedBySharing method ...");
                        return $sharePer;
                    }
                }
            }
        }
//.........这里部分代码省略.........
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:101,代码来源:UserInfoUtil.php


示例7: setupTemporaryTable

 protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups)
 {
     $module = null;
     if (!empty($tabId)) {
         $module = getTabname($tabId);
     }
     $query = $this->getNonAdminAccessQuery($module, $user, $parentRole, $userGroups);
     $query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key, shared " . "int(1) default 0) ignore " . $query;
     $db = PearDatabase::getInstance();
     $result = $db->pquery($query, array());
     if (is_object($result)) {
         $query = "REPLACE INTO {$tableName} (id) SELECT userid as id FROM vtiger_sharedcalendar WHERE sharedid = ?";
         $result = $db->pquery($query, array($user->id));
         //For newly created users, entry will not be there in vtiger_sharedcalendar table
         //so, consider the users whose having the calendarsharedtype is public
         $query = "REPLACE INTO {$tableName} (id) SELECT id FROM vtiger_users WHERE calendarsharedtype = ?";
         $result = $db->pquery($query, array('public'));
         if (is_object($result)) {
             return true;
         }
     }
     return false;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:23,代码来源:Activity.php


示例8: setupCalendar4YouTemporaryTable

function setupCalendar4YouTemporaryTable($tableName, $tabId, $userid, $parentRole, $userGroups)
{
    global $adb;
    $module = null;
    if (!empty($tabId)) {
        $module = getTabname($tabId);
    }
    $query = getCalendar4YouNonAdminAccessQuery($module, $userid, $parentRole, $userGroups);
    $query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key, shared " . "int(1) default 0) ignore " . $query;
    $result = $adb->pquery($query, array());
    if (is_object($result)) {
        $query = "create temporary table IF NOT EXISTS {$tableName}(id int(11) primary key, shared " . "int(1) default 0) replace select 1, userid as id from vtiger_sharedcalendar where " . "sharedid = {$userid}";
        $result = $adb->pquery($query, array());
        if (is_object($result)) {
            return true;
        }
    }
    return false;
}
开发者ID:mslokhat,项目名称:corebos,代码行数:19,代码来源:CalendarUtils.php


示例9: vtigerCRM_Smarty

require_once 'include/utils/utils.php';
require_once 'include/utils/UserInfoUtil.php';
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$defSharingPermissionData = getDefaultSharingAction();
$access_privileges = array();
$row = 1;
foreach ($defSharingPermissionData as $tab_id => $def_perr) {
    $entity_name = getTabname($tab_id);
    if ($tab_id == 6) {
        $cont_name = getTabname(4);
        $entity_name .= ' & ' . $cont_name;
    }
    $entity_perr = getDefOrgShareActionName($def_perr);
    $access_privileges[] = $entity_name;
    $access_privileges[] = $entity_perr;
    if ($entity_perr != 'Private') {
        $access_privileges[] = $mod_strings['LBL_DESCRIPTION_' . $entity_perr] . $app_strings[$entity_name];
    } else {
        $access_privileges[] = $mod_strings['LBL_USR_CANNOT_ACCESS'] . $app_strings[$entity_name];
    }
    $row++;
}
$access_privileges = array_chunk($access_privileges, 3);
usort($access_privileges, function ($a, $b) {
    $moda = $a[0] == 'Accounts & Contacts' ? 'Accounts' : $a[0];
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:OrgSharingDetailView.php


示例10: foreach

            foreach ($action_array as $action_id => $act_per) {
                $action_name = getActionname($action_id);
                $tab_util_act_per = $action_array[$action_id];
                $tab_util_per = getDisplayOutput($tab_util_act_per, $tabid, $action_id);
                $util[] = $action_name;
                $util[] = $tab_util_per;
            }
            $util = array_chunk($util, 2);
            $util = array_chunk($util, 3);
            $privilege_util[$tabid] = $util;
        }
    } else {
        $act_utility_arry = getTabsUtilityActionPermission(1);
        foreach ($act_utility_arry as $tabid => $action_array) {
            $util = array();
            $entity_name = getTabname($tabid);
            $no_of_actions = sizeof($action_array);
            foreach ($action_array as $action_id => $act_per) {
                $action_name = getActionname($action_id);
                $tab_util_act_per = $action_array[$action_id];
                $tab_util_per = getDisplayOutput(0, $tabid, $action_id);
                $util[] = $action_name;
                $util[] = $tab_util_per;
            }
            $util = array_chunk($util, 2);
            $util = array_chunk($util, 3);
            $privilege_util[$tabid] = $util;
        }
    }
}
$smarty->assign("UTILITIES_PRIV", $privilege_util);
开发者ID:latechdirect,项目名称:vtiger,代码行数:31,代码来源:profilePrivileges.php



注:本文中的getTabname函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getTag函数代码示例发布时间:2022-05-15
下一篇:
PHP getTablePermissions函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap