当前位置: 首页>>代码示例>>PHP>>正文


PHP SecurityGroup::getLinkName方法代码示例

本文整理汇总了PHP中SecurityGroup::getLinkName方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityGroup::getLinkName方法的具体用法?PHP SecurityGroup::getLinkName怎么用?PHP SecurityGroup::getLinkName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityGroup的用法示例。


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

示例1: unset

    function popup_onload($event, $arguments)
    {
        global $sugar_config;
        $module = $_REQUEST['module'];
        $action = $_REQUEST['action'];
        if (isset($action) && ($action == "Save" || $action == "SetTimezone")) {
            return;
        }
        if ((isset($sugar_config['securitysuite_popup_select']) && $sugar_config['securitysuite_popup_select'] == true || $module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true) && isset($_SESSION['securitygroups_popup_' . $module]) && !empty($_SESSION['securitygroups_popup_' . $module])) {
            $record_id = $_SESSION['securitygroups_popup_' . $module];
            unset($_SESSION['securitygroups_popup_' . $module]);
            //$record_id = $_REQUEST['record'];
            require_once 'modules/SecurityGroups/SecurityGroup.php';
            $groupFocus = new SecurityGroup();
            if ($module == 'Users') {
                $rel_name = "SecurityGroups";
            } else {
                $rel_name = $groupFocus->getLinkName($module, "SecurityGroups");
            }
            $auto_popup = <<<EOQ
<script type="text/javascript" language="javascript">
\topen_popup("SecurityGroups",600,400,"",true,true,{"call_back_function":"set_return_and_save_background","form_name":"DetailView","field_to_name_array":{"id":"subpanel_id"},"passthru_data":{"child_field":"{$rel_name}","return_url":"index.php%3Fmodule%3D{$module}%26action%3DSubPanelViewer%26subpanel%3D{$rel_name}%26record%3D{$record_id}%26sugar_body_only%3D1","link_field_name":"{$rel_name}","module_name":"{$rel_name}","refresh_page":"1"}},"MultiSelect",true);
</script>
EOQ;
            echo $auto_popup;
        }
    }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:27,代码来源:AssignGroups.php

示例2: foreach

    function popup_onload($event, $arguments)
    {
        if (!empty($_REQUEST['to_pdf']) || !empty($_REQUEST['sugar_body_only'])) {
            return;
        }
        /** //test user popup
        	//always have this loaded
        	echo '<script type="text/javascript" src="modules/SecurityGroups/javascript/popup_relate.js"></script>';
        */
        global $sugar_config;
        $module = $_REQUEST['module'];
        $action = $_REQUEST['action'];
        if (isset($action) && ($action == "Save" || $action == "SetTimezone")) {
            return;
        }
        if ($module == "Users" && isset($sugar_config['securitysuite_user_popup']) && $sugar_config['securitysuite_user_popup'] == true && !empty($_SESSION['securitygroups_popup'])) {
            foreach ($_SESSION['securitygroups_popup'] as $popup_index => $popup) {
                $record_id = $popup['id'];
                $module = $popup['module'];
                unset($_SESSION['securitygroups_popup'][$popup_index]);
                require_once 'modules/SecurityGroups/SecurityGroup.php';
                $groupFocus = new SecurityGroup();
                if ($module == 'Users') {
                    $rel_name = "SecurityGroups";
                } else {
                    $rel_name = $groupFocus->getLinkName($module, "SecurityGroups");
                }
                //this only works if on the detail view of the record actually saved...
                //so ajaxui breaks this as it stays on the parent
                $auto_popup = <<<EOQ
<script type="text/javascript" language="javascript">
\topen_popup("SecurityGroups",600,400,"",true,true,{"call_back_function":"securitysuite_set_return_and_save_background","form_name":"DetailView","field_to_name_array":{"id":"subpanel_id"},"passthru_data":{"module":"{$module}","record":"{$record_id}","child_field":"{$rel_name}","return_url":"","link_field_name":"{$rel_name}","module_name":"{$rel_name}","refresh_page":"1"}},"MultiSelect",true);
</script>
EOQ;
                echo $auto_popup;
            }
            unset($_SESSION['securitygroups_popup']);
        }
    }
开发者ID:isrealconsulting,项目名称:ic-suite,代码行数:39,代码来源:AssignGroups.php

示例3: foreach

        array_push($new_arr, $val['id']);
    }
    $_POST['mass'] = $new_arr;
}
if (isset($_POST['mass']) && is_array($_POST['mass'])) {
    $rel_name = "";
    foreach ($_POST['mass'] as $id) {
        if (isset($_POST['Delete'])) {
            $sugarbean->retrieve($id);
            //if($sugarbean->ACLAccess('Delete')){
            $GLOBALS['log']->debug("MassAssign - deleting relationship: {$groupFocus->name}");
            if ($sugarbean->module_dir == 'Users') {
                $rel_name = "SecurityGroups";
            } else {
                if (empty($rel_name) || !isset($rel_name)) {
                    $rel_name = $groupFocus->getLinkName($sugarbean->module_dir, "SecurityGroups");
                }
            }
            $sugarbean->load_relationship($rel_name);
            $sugarbean->{$rel_name}->delete($sugarbean->id, $groupFocus->id);
            //As of 6.3.0 many-to-many requires a link field set in both modules...so lets bypass that
            //$groupFocus->removeGroupFromRecord($sugarbean->module_dir, $id, $groupFocus->id);
            //}
        } else {
            $sugarbean->retrieve($id);
            //if($sugarbean->ACLAccess('Save')){
            $GLOBALS['log']->debug("MassAssign - adding relationship: {$groupFocus->name}");
            if ($sugarbean->module_dir == 'Users') {
                $rel_name = "SecurityGroups";
            } else {
                if (empty($rel_name) || !isset($rel_name)) {
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:31,代码来源:MassAssign.php

示例4: testgetLinkName

 public function testgetLinkName()
 {
     //unset and reconnect Db to resolve mysqli fetch exeception
     global $db;
     unset($db->database);
     $db->checkConnection();
     $securityGroup = new SecurityGroup();
     $result = $securityGroup->getLinkName('Accounts', 'Contacts');
     $this->assertEquals('contacts', $result);
     $result = $securityGroup->getLinkName('SecurityGroups', 'ACLRoles');
     $this->assertEquals('aclroles', $result);
     error_reporting(E_ALL);
     //error_reporting(E_ERROR | E_PARSE);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:14,代码来源:SecurityGroupTest.php


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