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

PHP getSharingModuleList函数代码示例

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

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



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

示例1: vtlib_getModuleNameForSharing

/**
 * Get module names for which sharing access can be controlled.
 * NOTE: Ignore the standard modules which is already handled.
 */
function vtlib_getModuleNameForSharing()
{
    global $adb;
    $std_modules = array('Calendar', 'Leads', 'Accounts', 'Contacts', 'Potentials', 'HelpDesk', 'Campaigns', 'Quotes', 'PurchaseOrder', 'SalesOrder', 'Invoice', 'Events');
    $modulesList = getSharingModuleList($std_modules);
    return $modulesList;
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:11,代码来源:VtlibUtils.php


示例2: vtlib_getModuleNameForSharing

/**
 * Get module names for which sharing access can be controlled.
 * NOTE: Ignore the standard modules which is already handled.
 */
function vtlib_getModuleNameForSharing()
{
    $adb = PearDatabase::getInstance();
    $std_modules = array('Calendar', 'Leads', 'Accounts', 'Contacts', 'HelpDesk', 'Campaigns', 'Events');
    $modulesList = getSharingModuleList($std_modules);
    return $modulesList;
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:11,代码来源:VtlibUtils.php


示例3: 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


示例4: 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


示例5: getSharingModuleList

<?php

require_once 'include/database/PearDatabase.php';
require_once 'include/utils/UserInfoUtil.php';
require_once 'include/utils/utils.php';
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $adb;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$field_module = getSharingModuleList();
$allfields = array();
foreach ($field_module as $fld_module) {
    $fieldListResult = getDefOrgFieldList($fld_module);
    $noofrows = $adb->num_rows($fieldListResult);
    $language_strings = return_module_language($current_language, $fld_module);
    $allfields[$fld_module] = getStdOutput($fieldListResult, $noofrows, $language_strings, $profileid);
}
if ($_REQUEST['fld_module'] != '') {
    $smarty->assign("DEF_MODULE", $_REQUEST['fld_module']);
} else {
    $smarty->assign("DEF_MODULE", 'Leads');
}
/** Function to get the field label/permission array to construct the default orgnization field UI for the specified profile 
 * @param $fieldListResult -- mysql query result that contains the field label and uitype:: Type array
 * @param $mod_strings -- i18n language mod strings array:: Type array
 * @param $profileid -- profile id:: Type integer
 * @returns $standCustFld -- field label/permission array :: Type varchar
 *
开发者ID:Pengzw,项目名称:c3crm,代码行数:31,代码来源:EditDefOrgFieldLevelAccess.php


示例6: getSharingRuleList

//$custom_access['Emails'] = getSharingRuleList('Emails');
//Campaign Sharing
$custom_access['Campaigns'] = getSharingRuleList('Campaigns');
//Quotes Sharing
$custom_access['Quotes'] = getSharingRuleList('Quotes');
//Purchase Order Sharing
$custom_access['PurchaseOrder'] = getSharingRuleList('PurchaseOrder');
//Sales Order Sharing
$custom_access['SalesOrder'] = getSharingRuleList('SalesOrder');
//Invoice Sharing
$custom_access['Invoice'] = getSharingRuleList('Invoice');
//Document Sharing
$custom_access['Documents'] = getSharingRuleList('Documents');
// Look up for modules for which sharing access is enabled.
// NOTE: Accounts and Contacts has been couple, so we need to elimiate Contacts also
$othermodules = getSharingModuleList(array('Contacts'));
if (!empty($othermodules)) {
    foreach ($othermodules as $moduleresname) {
        if (!isset($custom_access[$moduleresname])) {
            $custom_access[$moduleresname] = getSharingRuleList($moduleresname);
        }
    }
}
uksort($custom_access, function ($a, $b) {
    return strtolower(getTranslatedString($a, $a)) < strtolower(getTranslatedString($b, $b)) ? -1 : 1;
});
$smarty->assign("MODSHARING", $custom_access);
/** returns the list of sharing rules for the specified module
 * @param $module -- Module Name:: Type varchar
 * @returns $access_permission -- sharing rules list info array:: Type array
 *
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:OrgSharingDetailView.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getShopBasePath函数代码示例发布时间:2022-05-15
下一篇:
PHP getSharedCalendarId函数代码示例发布时间: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