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

PHP ACLAction类代码示例

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

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



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

示例1: template_pagination

function template_pagination(&$args)
{
    $smarty = new Sugar_Smarty();
    $reporter = $args['reporter'];
    global $mod_strings;
    // disable export if configured to
    global $current_user, $sugar_config, $app_strings;
    $smarty->assign('mod_strings', $mod_strings);
    $smarty->assign('app_strings', $app_strings);
    $is_owner = true;
    if (isset($args['reporter']->saved_report) && $args['reporter']->saved_report->assigned_user_id != $current_user->id) {
        $is_owner = false;
    }
    // if
    $isExportAccess = false;
    if (!ACLController::checkAccess('Reports', 'export', $is_owner) || $sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($reporter->module) && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'access') == ACL_ALLOW_ENABLED && ACLAction::getUserAccessLevel($current_user->id, $reporter->module, 'admin') == ACL_ALLOW_ADMIN)) {
        // no op
    } else {
        $smarty->assign('exportImagePath', SugarThemeRegistry::current()->getImage('export', "  border='0' align='absmiddle'", null, null, '.gif', translate('LBL_EXPORT')));
        $isExportAccess = true;
    }
    // else
    $smarty->assign('isExportAccess', $isExportAccess);
    $smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start_off", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
    $smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
    $smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
    $smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next_off", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
    $smarty->assign('start_link_disabled', true);
    $smarty->assign('prev_link_disabled', true);
    $smarty->assign('end_link_disabled', true);
    $smarty->assign('next_link_disabled', true);
    $next = $reporter->row_end + $reporter->report_offset;
    if ($reporter->report_offset > 0) {
        $prev = $reporter->report_offset - $reporter->report_max;
        $smarty->assign('start_link_ImagePath', SugarThemeRegistry::current()->getImage("start", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_START']));
        $smarty->assign('start_link_onclick', "onClick=javascript:set_offset(0);");
        $smarty->assign('start_link_disabled', false);
        $smarty->assign('prev_link_ImagePath', SugarThemeRegistry::current()->getImage("previous", "border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_PREVIOUS']));
        $smarty->assign('prev_link_onclick', "onClick=javascript:set_offset({$prev});");
        $smarty->assign('prev_link_disabled', false);
    }
    // if
    if ($next < $reporter->total_count) {
        $end = ceil($reporter->total_count / $reporter->report_max - 1) * $reporter->report_max;
        $smarty->assign('end_link_ImagePath', SugarThemeRegistry::current()->getImage("end", "  border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_END']));
        $smarty->assign('end_link_disabled', false);
        $smarty->assign('end_link_onclick', "onClick=javascript:set_offset({$end});");
        $smarty->assign('next_link_ImagePath', SugarThemeRegistry::current()->getImage("next", " border='0' align='absmiddle'", null, null, '.gif', $app_strings['LNK_LIST_NEXT']));
        $smarty->assign('next_link_disabled', false);
        $smarty->assign('next_link_onclick', "onClick=javascript:set_offset({$next});");
    }
    // if
    $start_range = $reporter->report_offset > 0 ? $reporter->row_start + $reporter->report_offset : ($reporter->total_count == 0 ? 0 : 1);
    $end_range = $reporter->row_end + $reporter->report_offset;
    $smarty->assign('start_range', $start_range);
    $smarty->assign('end_range', $end_range);
    $smarty->assign('total_count', $reporter->total_count);
    return $smarty->fetch("modules/Reports/templates/_template_pagination.tpl");
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:59,代码来源:templates_list_view.php


示例2: run

 public function run()
 {
     if (!$this->toFlavor('pro')) {
         return;
     }
     // add User field in Role
     include_once "modules/ACLActions/ACLAction.php";
     ACLAction::addActions('Users', 'module');
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:9,代码来源:3_AddUserActions.php


示例3: export

 /**
  * Export API
  *
  * @param $api ServiceBase The API class of the request, used in cases where the API changes how the fields are pulled from the args array.
  * @param $args array The arguments array passed in from the API
  * @return String
  */
 public function export(ServiceBase $api, array $args)
 {
     $seed = BeanFactory::newBean($args['module']);
     if (!$seed->ACLAccess('export')) {
         throw new SugarApiExceptionNotAuthorized($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
     }
     ob_start();
     global $sugar_config;
     global $current_user;
     global $app_list_strings;
     $theModule = clean_string($args['module']);
     if ($sugar_config['disable_export'] || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($theModule) && ACLAction::getUserAccessLevel($current_user->id, $theModule, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $theModule, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $theModule, 'admin') == ACL_ALLOW_ADMIN_DEV))) {
         throw new SugarApiExceptionNotAuthorized($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
     }
     //check to see if this is a request for a sample or for a regular export
     if (!empty($args['sample'])) {
         //call special method that will create dummy data for bean as well as insert standard help message.
         $content = exportSampleFromApi($args);
     } else {
         $content = exportFromApi($args);
     }
     $filename = $args['module'];
     //use label if one is defined
     if (!empty($app_list_strings['moduleList'][$args['module']])) {
         $filename = $app_list_strings['moduleList'][$args['module']];
     }
     //strip away any blank spaces
     $filename = str_replace(' ', '', $filename);
     if (isset($args['members']) && $args['members'] == true) {
         $filename .= '_' . 'members';
     }
     ///////////////////////////////////////////////////////////////////////////////
     ////	BUILD THE EXPORT FILE
     ob_end_clean();
     return $this->doExport($api, $filename, $content);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:43,代码来源:ExportApi.php


示例4: _getModulesForACL

 /**
  * Helper function that enumerates the list of modules and checks if they are an admin/dev.
  * The code was just too similar to copy and paste.
  *
  * @return array
  */
 protected function _getModulesForACL($type = 'dev')
 {
     $isDev = $type == 'dev';
     $isAdmin = $type == 'admin';
     global $beanList;
     $myModules = array();
     if (!is_array($beanList)) {
         return $myModules;
     }
     // These modules don't take kindly to the studio trying to play about with them.
     static $ignoredModuleList = array('iFrames', 'Feeds', 'Home', 'Dashboard', 'Calendar', 'Activities', 'Reports');
     $actions = ACLAction::getUserActions($this->id);
     foreach ($beanList as $module => $val) {
         // Remap the module name
         $module = $this->_fixupModuleForACL($module);
         if (in_array($module, $myModules)) {
             // Already have the module in the list
             continue;
         }
         if (in_array($module, $ignoredModuleList)) {
             // You can't develop on these modules.
             continue;
         }
         $key = 'module';
         if ($this->isAdmin() && isset($actions[$module][$key])) {
             $myModules[] = $module;
         }
     }
     return $myModules;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:36,代码来源:User.php


示例5: process

 function process($lvsParams = array())
 {
     global $current_user;
     $currentSearchFields = array();
     $configureView = true;
     // configure view or regular view
     $query = false;
     $whereArray = array();
     $lvsParams['massupdate'] = false;
     // apply filters
     if (isset($this->filters) || $this->myItemsOnly) {
         $whereArray = $this->buildWhere();
     }
     $this->lvs->export = false;
     $this->lvs->multiSelect = false;
     $this->lvs->quickViewLinks = false;
     // columns
     foreach ($this->columns as $name => $val) {
         if (!empty($val['default']) && $val['default']) {
             $displayColumns[strtoupper($name)] = $val;
             $displayColumns[strtoupper($name)]['label'] = trim($displayColumns[strtoupper($name)]['label'], ':');
         }
     }
     $this->lvs->displayColumns = $displayColumns;
     $this->lvs->lvd->setVariableName($this->seedBean->object_name, array());
     $lvsParams['overrideOrder'] = true;
     $lvsParams['orderBy'] = 'date_entered';
     $lvsParams['sortOrder'] = 'DESC';
     $lvsParams['custom_from'] = '';
     // Get the real module list
     if (empty($this->selectedCategories)) {
         $mod_list = $this->categories;
     } else {
         $mod_list = array_flip($this->selectedCategories);
         //27949, here the key of $this->selectedCategories is not module name, the value is module name, so array_flip it.
     }
     $external_modules = array();
     $admin_modules = array();
     $owner_modules = array();
     $regular_modules = array();
     foreach ($mod_list as $module => $ignore) {
         // Handle the UserFeed differently
         if ($module == 'UserFeed') {
             $regular_modules[] = 'UserFeed';
             continue;
         }
         if (in_array($module, $this->externalAPIList)) {
             $external_modules[] = $module;
         }
         if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') <= ACL_ALLOW_NONE) {
             // Not enough access to view any records, don't add it to any lists
             continue;
         }
         if (ACLAction::getUserAccessLevel($current_user->id, $module, 'view') == ACL_ALLOW_OWNER) {
             $owner_modules[] = $module;
         } else {
             $regular_modules[] = $module;
         }
     }
     if (!empty($this->displayTpl)) {
         //MFH BUG #14296
         $where = '';
         if (!empty($whereArray)) {
             $where = '(' . implode(') AND (', $whereArray) . ')';
         }
         $additional_where = '';
         $module_limiter = " sugarfeed.related_module in ('" . implode("','", $regular_modules) . "')";
         if (is_admin($GLOBALS['current_user'])) {
             $all_modules = array_merge($regular_modules, $owner_modules, $admin_modules);
             $module_limiter = " sugarfeed.related_module in ('" . implode("','", $all_modules) . "')";
         } else {
             if (count($owner_modules) > 0) {
                 $module_limiter = " ((sugarfeed.related_module IN ('" . implode("','", $regular_modules) . "') " . ") ";
                 if (count($owner_modules) > 0) {
                     $module_limiter .= "OR (sugarfeed.related_module IN('" . implode("','", $owner_modules) . "') AND sugarfeed.assigned_user_id = '" . $current_user->id . "' " . ") ";
                 }
                 $module_limiter .= ")";
             }
         }
         if (!empty($where)) {
             $where .= ' AND ';
         }
         $where .= $module_limiter;
         $this->lvs->setup($this->seedBean, $this->displayTpl, $where, $lvsParams, 0, $this->displayRows, array('name', 'description', 'date_entered', 'created_by', 'related_module', 'link_url', 'link_type'));
         foreach ($this->lvs->data['data'] as $row => $data) {
             $this->lvs->data['data'][$row]['NAME'] = str_replace("{this.CREATED_BY}", get_assigned_user_name($this->lvs->data['data'][$row]['CREATED_BY']), $data['NAME']);
             //Translate the SugarFeeds labels if necessary.
             preg_match('/\\{([^\\^ }]+)\\.([^\\}]+)\\}/', $this->lvs->data['data'][$row]['NAME'], $modStringMatches);
             if (count($modStringMatches) == 3 && $modStringMatches[1] == 'SugarFeed' && !empty($data['RELATED_MODULE'])) {
                 $modKey = $modStringMatches[2];
                 $modString = translate($modKey, $modStringMatches[1]);
                 if (strpos($modString, '{0}') === FALSE || !isset($GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']])) {
                     continue;
                 }
                 $modStringSingular = $GLOBALS['app_list_strings']['moduleListSingular'][$data['RELATED_MODULE']];
                 $modString = string_format($modString, array($modStringSingular));
                 $this->lvs->data['data'][$row]['NAME'] = preg_replace('/' . $modStringMatches[0] . '/', strtolower($modString), $this->lvs->data['data'][$row]['NAME']);
             }
         }
         // assign a baseURL w/ the action set as DisplayDashlet
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:101,代码来源:SugarFeedDashlet.php


示例6: getRoleActions

 /**
  * static getRoleActions($role_id)
  *
  * gets the actions of a given role
  *
  * @param GUID $role_id
  *
  * @return array of actions
  */
 function getRoleActions($role_id, $type = 'module')
 {
     global $beanList;
     //if we don't have it loaded then lets check against the db
     $additional_where = '';
     $db = DBManagerFactory::getInstance();
     $query = "SELECT acl_actions.*";
     //only if we have a role id do we need to join the table otherwise lets use the ones defined in acl_actions as the defaults
     if (!empty($role_id)) {
         $query .= " ,acl_roles_actions.access_override ";
     }
     $query .= " FROM acl_actions ";
     if (!empty($role_id)) {
         $query .= " LEFT JOIN acl_roles_actions ON acl_roles_actions.role_id = '{$role_id}' AND  acl_roles_actions.action_id = acl_actions.id AND acl_roles_actions.deleted = 0";
     }
     $query .= " WHERE acl_actions.deleted=0 ORDER BY acl_actions.category, acl_actions.name";
     $result = $db->query($query);
     $role_actions = [];
     while ($row = $db->fetchByAssoc($result)) {
         $action = new ACLAction();
         $action->populateFromRow($row);
         if (!empty($row['access_override'])) {
             $action->aclaccess = $row['access_override'];
         } else {
             $action->aclaccess = ACL_ALLOW_DEFAULT;
         }
         //#27877 . If  there is no this module in beanlist , we will not show them in UI, no matter this module was deleted or not in ACL_ACTIONS table.
         if (empty($beanList[$action->category])) {
             continue;
         }
         //end
         if (!isset($role_actions[$action->category])) {
             $role_actions[$action->category] = [];
         }
         $role_actions[$action->category][$action->acltype][$action->name] = $action->toArray();
     }
     // Sort by translated categories
     uksort($role_actions, "ACLRole::langCompare");
     return $role_actions;
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:49,代码来源:ACLRole.php


示例7: get_user_module_list

 function get_user_module_list($user)
 {
     $GLOBALS['log']->info('Begin: SoapHelperWebServices->get_user_module_list');
     global $app_list_strings, $current_language;
     $app_list_strings = return_app_list_strings_language($current_language);
     $modules = query_module_access_list($user);
     ACLController::filterModuleList($modules, false);
     global $modInvisList, $modInvisListActivities;
     foreach ($modInvisList as $invis) {
         $modules[$invis] = 'read_only';
     }
     if (isset($modules['Calendar']) || $modules['Activities']) {
         foreach ($modInvisListActivities as $invis) {
             $modules[$invis] = $invis;
         }
     }
     $actions = ACLAction::getUserActions($user->id, true);
     foreach ($actions as $key => $value) {
         if (isset($value['module']) && $value['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED) {
             if ($value['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                 unset($modules[$key]);
             } else {
                 $modules[$key] = 'read_only';
             }
             // else
         } else {
             $modules[$key] = '';
         }
         // else
     }
     // foreach
     $GLOBALS['log']->info('End: SoapHelperWebServices->get_user_module_list');
     return $modules;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:34,代码来源:SoapHelperWebService.php


示例8: get_user_module_list

function get_user_module_list($user)
{
    global $app_list_strings, $current_language, $beanList, $beanFiles;
    $app_list_strings = return_app_list_strings_language($current_language);
    $modules = query_module_access_list($user);
    ACLController::filterModuleList($modules, false);
    global $modInvisList;
    foreach ($modInvisList as $invis) {
        $modules[$invis] = 'read_only';
    }
    $actions = ACLAction::getUserActions($user->id, true);
    foreach ($actions as $key => $value) {
        if (isset($value['module']) && $value['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED) {
            if ($value['module']['access']['aclaccess'] == ACL_ALLOW_DISABLED) {
                unset($modules[$key]);
            } else {
                $modules[$key] = 'read_only';
            }
            // else
        } else {
            $modules[$key] = '';
        }
        // else
    }
    // foreach
    //Remove all modules that don't have a beanFiles entry associated with it
    foreach ($modules as $module_name => $module) {
        if (isset($beanList[$module_name])) {
            $class_name = $beanList[$module_name];
            if (empty($beanFiles[$class_name])) {
                unset($modules[$module_name]);
            }
        } else {
            unset($modules[$module_name]);
        }
    }
    return $modules;
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:38,代码来源:SoapHelperFunctions.php


示例9: disabledModuleList

 function disabledModuleList($moduleList, $by_value = true, $view = 'list')
 {
     global $aclModuleList, $current_user;
     if (is_admin($GLOBALS['current_user'])) {
         return array();
     }
     $actions = ACLAction::getUserActions($current_user->id, false);
     $disabled = array();
     $compList = array();
     if ($by_value) {
         foreach ($moduleList as $key => $value) {
             $compList[$value] = $key;
         }
     } else {
         $compList =& $moduleList;
     }
     if (isset($moduleList['ProductTemplates'])) {
         $moduleList['Products'] = 'Products';
     }
     foreach ($actions as $action_name => $action) {
         if (!empty($action['module'])) {
             $aclModuleList[$action_name] = $action_name;
             if (isset($compList[$action_name])) {
                 if ($action['module']['access']['aclaccess'] < ACL_ALLOW_ENABLED || $action['module'][$view]['aclaccess'] < 0) {
                     if ($by_value) {
                         $disabled[$compList[$action_name]] = $compList[$action_name];
                     } else {
                         $disabled[$action_name] = $action_name;
                     }
                 }
             }
         }
     }
     if (isset($compList['Calendar']) && !(ACL_ALLOW_ENABLED == $actions['Calls']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Meetings']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Tasks']['module']['access']['aclaccess'])) {
         if ($by_value) {
             $disabled[$compList['Calendar']] = $compList['Calendar'];
         } else {
             $disabled['Calendar'] = 'Calendar';
         }
         if (isset($compList['Activities']) && !(ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'] || ACL_ALLOW_ENABLED == $actions['Notes']['module']['access']['aclaccess'])) {
             if ($by_value) {
                 $disabled[$compList['Activities']] = $compList['Activities'];
             } else {
                 $disabled['Activities'] = 'Activities';
             }
         }
     }
     if (isset($disabled['Products'])) {
         $disabled['ProductTemplates'] = 'ProductTemplates';
     }
     return $disabled;
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:52,代码来源:ACLController.php


示例10: create_tables

 /** create the appropriate database tables for this bean */
 function create_tables()
 {
     global $dictionary;
     $key = $this->getObjectName();
     if (!array_key_exists($key, $dictionary)) {
         $GLOBALS['log']->fatal("create_tables: Metadata for table " . $this->table_name . " does not exist");
         display_notice("meta data absent for table " . $this->table_name . " keyed to {$key} ");
     } else {
         if (!$this->db->tableExists($this->table_name)) {
             $this->dbManager->createTable($this);
             if ($this->bean_implements('ACL')) {
                 ACLAction::addActions($this->module_dir);
             }
         } else {
             echo "Table Already Exists : {$this->table_name}<br>";
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:19,代码来源:SugarBean.php


示例11: getUserAccess

 /**
  * Get user access for the list of actions
  * @param string $module
  * @param array $access_list List of actions
  * @returns array - List of access levels. Access levels not returned are assumed to be "all allowed".
  */
 public function getUserAccess($module, $access_list, $context)
 {
     $user = $this->getCurrentUser($context);
     if (empty($user) || empty($user->id) || is_admin($user)) {
         // no user or admin - do nothing
         return $access_list;
     }
     $is_owner = !(isset($context['owner_override']) && $context['owner_override'] == false);
     if (isset(self::$non_module_acls[$module])) {
         $level = self::$non_module_acls[$module];
     } else {
         $level = 'module';
     }
     $actions = ACLAction::getUserActions($user->id, false, $module, $level);
     if (empty($actions)) {
         return $access_list;
     }
     // default implementation, specific ACLs can override
     $access = $access_list;
     // check 'access' first - if it's false all others will be false
     if (isset($access_list['access'])) {
         if (!ACLAction::userHasAccess($user->id, $module, 'access', $level, true)) {
             foreach ($access_list as $action => $value) {
                 $access[$action] = false;
             }
             return $access;
         }
         // no need to check it second time
         unset($access_list['access']);
     }
     foreach ($access_list as $action => $value) {
         // may have the bean, so we need to use checkAccess
         if (!$this->checkAccess($module, $action, $context) || isset($actions[$action]['aclaccess']) && !ACLAction::hasAccess($is_owner, $actions[$action]['aclaccess'])) {
             $access[$action] = false;
         }
     }
     return $access;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:44,代码来源:SugarACLStatic.php


示例12: create_tables

 /**
  * create_tables
  * Override this method to insert ACLActions for the tracker beans
  *
  */
 function create_tables()
 {
     $path = 'modules/Trackers/config.php';
     if (defined('TEMPLATE_URL')) {
         $path = SugarTemplateUtilities::getFilePath($path);
     }
     require $path;
     foreach ($tracker_config as $key => $configEntry) {
         if (isset($configEntry['bean']) && $configEntry['bean'] != 'Tracker') {
             $bean = new $configEntry['bean']();
             if ($bean->bean_implements('ACL')) {
                 ACLAction::addActions($bean->module_dir, $configEntry['bean']);
             }
         }
     }
     parent::create_tables();
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:22,代码来源:Tracker.php


示例13: get_workflow_admin_modules_for_user

function get_workflow_admin_modules_for_user($user)
{
    /* Workflow modules blacklist */
    $workflowNotSupportedModules = array('iFrames', 'Feeds', 'Home', 'Dashboard', 'Calendar', 'Activities', 'Reports', 'pmse_Business_Rules', 'pmse_Project', 'pmse_Emails_Templates', 'pmse_Inbox');
    if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
        return $_SESSION['get_workflow_admin_modules_for_user'];
    }
    global $moduleList;
    $workflow_mod_list = array();
    foreach ($moduleList as $module) {
        $workflow_mod_list[$module] = $module;
    }
    // This list is taken from teh previous version of workflow_utils.php
    $workflow_mod_list['Tasks'] = "Tasks";
    $workflow_mod_list['Calls'] = "Calls";
    $workflow_mod_list['Meetings'] = "Meetings";
    $workflow_mod_list['Notes'] = "Notes";
    $workflow_mod_list['ProjectTask'] = "Project Tasks";
    $workflow_mod_list['Leads'] = "Leads";
    $workflow_mod_list['Opportunities'] = "Opportunities";
    // End of list
    $workflow_admin_modules = array();
    if (empty($user)) {
        return $workflow_admin_modules;
    }
    $actions = ACLAction::getUserActions($user->id);
    foreach ($workflow_mod_list as $key => $val) {
        if (!in_array($val, $workflow_admin_modules) && !in_array($val, $workflowNotSupportedModules) && $user->isDeveloperForModule($key)) {
            $workflow_admin_modules[$key] = $val;
        }
    }
    $_SESSION['get_workflow_admin_modules_for_user'] = $workflow_admin_modules;
    return $workflow_admin_modules;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:34,代码来源:utils.php


示例14: fixRevenueLineItemModule

 /**
  * Metadata fixes for the RLI Module
  *
  * - Removes the file that shows the RLI Module
  * - Removes the Studio File
  * - Hides the RLI module from the menu bar
  * - Removes the ACL Actions
  */
 protected function fixRevenueLineItemModule()
 {
     // hide the RLI module from the quick create, this needs to be done first, so it's properly removed
     $this->toggleRevenueLineItemQuickCreate(false);
     // cleanup on the current request
     $GLOBALS['modInvisList'][] = 'RevenueLineItems';
     if (isset($GLOBALS['moduleList']) && is_array($GLOBALS['moduleList'])) {
         foreach ($GLOBALS['moduleList'] as $key => $mod) {
             if ($mod === 'RevenueLineItems') {
                 unset($GLOBALS['moduleList'][$key]);
             }
         }
     }
     if (SugarAutoLoader::fileExists($this->appExtFolder . '/Include/' . $this->rliModuleExtFile)) {
         SugarAutoLoader::unlink($this->appExtFolder . '/Include/' . $this->rliModuleExtFile);
     }
     if (SugarAutoLoader::fileExists($this->rliStudioFile)) {
         SugarAutoLoader::unlink($this->rliStudioFile);
     }
     if (SugarAutoLoader::fileExists($this->rliModuleExtFolder . '/Vardefs/' . $this->rliModuleExtVardefFile)) {
         SugarAutoLoader::unlink($this->rliModuleExtFolder . '/Vardefs/' . $this->rliModuleExtVardefFile);
     }
     // hide the RLI module in workflows
     $affected_modules = $this->toggleRevenueLineItemsLinkInWorkFlows(false);
     // hide the mega menu tab
     $this->setRevenueLineItemModuleTab(false);
     // handle the parent type field
     $this->setRevenueLineItemInParentRelateDropDown(false);
     // disable the ACLs on RevenueLineItems
     ACLAction::removeActions('RevenueLineItems');
     // add the RLI module
     $affected_modules[] = 'RevenueLineItems';
     return $affected_modules;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:42,代码来源:OpportunityWithOutRevenueLineItem.php


示例15: action_DeployPackage

 function action_DeployPackage()
 {
     global $current_user;
     if (defined('TEMPLATE_URL')) {
         sugar_cache_reset();
         SugarTemplateUtilities::disableCache();
     }
     //increment etag for menu so the new module shows up when the AJAX UI reloads
     $current_user->incrementETag("mainMenuETag");
     $mb = new ModuleBuilder();
     $load = $_REQUEST['package'];
     $message = $GLOBALS['mod_strings']['LBL_MODULE_DEPLOYED'];
     if (!empty($load)) {
         $zip = $mb->getPackage($load);
         require_once 'ModuleInstall/PackageManager/PackageManager.php';
         $pm = new PackageManager();
         $info = $mb->packages[$load]->build(false);
         $uploadDir = $pm->upload_dir . '/upgrades/module/';
         mkdir_recursive($uploadDir);
         rename($info['zip'], $uploadDir . $info['name'] . '.zip');
         copy($info['manifest'], $uploadDir . $info['name'] . '-manifest.php');
         $_REQUEST['install_file'] = $uploadDir . $info['name'] . '.zip';
         $GLOBALS['mi_remove_tables'] = false;
         $pm->performUninstall($load);
         //#23177 , js cache clear
         clearAllJsAndJsLangFilesWithoutOutput();
         //#30747, clear the cache in memory
         $cache_key = 'app_list_strings.' . $GLOBALS['current_language'];
         sugar_cache_clear($cache_key);
         sugar_cache_reset();
         //clear end
         $pm->performInstall($_REQUEST['install_file'], true);
         //clear the unified_search_module.php file
         require_once 'modules/Home/UnifiedSearchAdvanced.php';
         UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
         //bug 44269 - start
         //clear workflow admin modules cache
         if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
             unset($_SESSION['get_workflow_admin_modules_for_user']);
         }
         //clear "is_admin_for_module" cache
         $sessionVar = 'MLA_' . $current_user->user_name;
         foreach ($mb->packages as $package) {
             foreach ($package->modules as $module) {
                 $_SESSION[$sessionVar][$package->name . '_' . $module->name] = true;
             }
         }
         //recreate acl cache
         $actions = ACLAction::getUserActions($current_user->id, true);
         //bug 44269 - end
     }
     echo 'complete';
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:53,代码来源:controller.php


示例16: processListNavigation


//.........这里部分代码省略.........
                     $onClick = "'location.href=\"{$end_URL}\";'";
                 }
                 $end_link = "<button type='button' name='listViewEndButton' class='button' title='{$this->local_app_strings['LNK_LIST_END']}' onClick=" . $onClick . ">" . SugarThemeRegistry::current()->getImage("end", "border='0' align='absmiddle'", null, null, '.gif', $this->local_app_strings['LNK_LIST_END']) . "</button>";
             }
         }
         $GLOBALS['log']->info("Offset (next, current, prev)({$next_offset}, {$current_offset}, {$previous_offset})");
         $GLOBALS['log']->info("Start/end records ({$start_record}, {$end_record})");
         $end_record = $end_record - 1;
         $script_href = "<a style=\\'width: 150px\\' name=\"thispage\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$this->records_per_page})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}&nbsp;&#x28;{$this->records_per_page}&#x29;&#x200E;</a>" . "<a style=\\'width: 150px\\' name=\"selectall\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$row_count});\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}&nbsp;&#x28;{$row_count}&#x29;&#x200E;</a>" . "<a style=\\'width: 150px\\' name=\"deselect\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.clear_all(document.MassUpdate, \"mass[]\", false);\\' href=\\'#\\'>{$this->local_app_strings['LBL_LISTVIEW_NONE']}</a>";
         $close_inline_img = SugarThemeRegistry::current()->getImage('close_inline', 'border=0', null, null, ".gif", $app_strings['LBL_CLOSEINLINE']);
         echo "<script>\n                function select_dialog() {\n                \tvar \$dialog = \$('<div></div>')\n\t\t\t\t\t.html('<a style=\\'width: 150px\\' name=\"thispage\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$this->records_per_page})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}&nbsp;&#x28;{$this->records_per_page}&#x29;&#x200E;</a>" . "<a style=\\'width: 150px\\' name=\"selectall\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$row_count});\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}&nbsp;&#x28;{$row_count}&#x29;&#x200E;</a>" . "<a style=\\'width: 150px\\' name=\"deselect\" class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'sListView.clear_all(document.MassUpdate, \"mass[]\", false);\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_NONE']}</a>')\n\t\t\t\t\t.dialog({\n\t\t\t\t\t\tautoOpen: false,\n\t\t\t\t\t\twidth: 150\n\t\t\t\t\t});\n\t\t\t\t\t\$dialog.dialog('open');\n\n                }\n                </script>";
         if ($this->show_select_menu) {
             $total_label = "";
             $total = $row_count;
             $pageTotal = $row_count > 0 ? $end_record - $start_record + 1 : 0;
             if (!empty($GLOBALS['sugar_config']['disable_count_query']) && $GLOBALS['sugar_config']['disable_count_query'] === true && $total > $pageTotal) {
                 $this->show_plus = true;
                 $total = $pageTotal;
                 $total_label = $total . '+';
             } else {
                 $this->show_plus = false;
                 $total_label = $total;
             }
             echo "<input type='hidden' name='show_plus' value='{$this->show_plus}'>\n";
             //Bug#52931: Replace with actionMenu
             //$select_link = "<a id='select_link' onclick='return select_dialog();' href=\"javascript:void(0)\">".$this->local_app_strings['LBL_LINK_SELECT']."&nbsp;".SugarThemeRegistry::current()->getImage('MoreDetail', 'border=0', 11, 7, '.png', $app_strings['LBL_MOREDETAIL'])."</a>";
             $menuItems = array("<input title=\"" . $app_strings['LBL_SELECT_ALL_TITLE'] . "\" type='checkbox' class='checkbox massall' name='massall' id='massall' value='' onclick='sListView.check_all(document.MassUpdate, \"mass[]\", this.checked);' /><a href='javascript: void(0);'></a>", "<a  name='thispage' id='button_select_this_page' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='if (document.MassUpdate.select_entire_list.value==1){document.MassUpdate.select_entire_list.value=0;sListView.check_all(document.MassUpdate, \"mass[]\", true, {$pageTotal})}else {sListView.check_all(document.MassUpdate, \"mass[]\", true)};' href='#'>{$app_strings['LBL_LISTVIEW_OPTION_CURRENT']}&nbsp;&#x28;{$pageTotal}&#x29;&#x200E;</a>", "<a  name='selectall' id='button_select_all' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='sListView.check_entire_list(document.MassUpdate, \"mass[]\",true,{$total});' href='#'>{$app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}&nbsp;&#x28;{$total_label}&#x29;&#x200E;</a>", "<a name='deselect' id='button_deselect' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' onclick='sListView.clear_all(document.MassUpdate, \"mass[]\", false);' href='#'>{$app_strings['LBL_LISTVIEW_NONE']}</a>");
             require_once 'include/Smarty/plugins/function.sugar_action_menu.php';
             $select_link = smarty_function_sugar_action_menu(array('class' => 'clickMenu selectmenu', 'id' => 'selectLink', 'buttons' => $menuItems), $this->xTemplate);
         } else {
             $select_link = "&nbsp;";
         }
         $export_link = '<input class="button" type="button" value="' . $this->local_app_strings['LBL_EXPORT'] . '" ' . 'onclick="return sListView.send_form(true, \'' . $_REQUEST['module'] . '\', \'index.php?entryPoint=export\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\')">';
         if ($this->show_delete_button) {
             $delete_link = '<input class="button" type="button" id="delete_button" name="Delete" value="' . $this->local_app_strings['LBL_DELETE_BUTTON_LABEL'] . '" onclick="return sListView.send_mass_update(\'selected\',\'' . $this->local_app_strings['LBL_LISTVIEW_NO_SELECTED'] . '\', 1)">';
         } else {
             $delete_link = '&nbsp;';
         }
         $admin = new Administration();
         $admin->retrieveSettings('system');
         $user_merge = $current_user->getPreference('mailmerge_on');
         if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']) {
             echo "<script>\n                function mailmerge_dialog(el) {\n                   \tvar \$dialog = \$('<div></div>')\n\t\t\t\t\t.html('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' onclick=\\'return sListView.send_form(true, \"MailMerge\", \"index.php\", \"{$this->local_app_strings['LBL_LISTVIEW_NO_SELECTED']}\")\\' href=\\'javascript:void(0)\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_SELECTED']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_CURRENT']}</a>" . "<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,\"yes\");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?action=index&module=MailMerge&entire=true\\'>{$this->local_app_strings['LBL_LISTVIEW_OPTION_ENTIRE']}</a>')\n\t\t\t\t\t.dialog({\n\t\t\t\t\t\tautoOpen: false,\n\t\t\t\t\t\ttitle: '" . $this->local_app_strings['LBL_MAILMERGE'] . "',\n\t\t\t\t\t\twidth: 150,\n\t\t\t\t\t\tposition: {\n\t\t\t\t\t\t    my: myPos,\n\t\t\t\t\t\t    at: atPos,\n\t\t\t\t\t\t    of: \$(el)\n\t\t\t\t\t \t}\n\t\t\t\t\t});\n\n                }\n            </script>";
             $merge_link = "&nbsp;|&nbsp;<a id='mailmerge_link' onclick='return mailmerge_dialog(this)'; href=\"javascript:void(0)\">" . $this->local_app_strings['LBL_MAILMERGE'] . "</a>";
         } else {
             $merge_link = "&nbsp;";
         }
         $selected_objects_span = "&nbsp;|&nbsp;{$this->local_app_strings['LBL_LISTVIEW_SELECTED_OBJECTS']}<input  style='border: 0px; background: transparent; font-size: inherit; color: inherit' type='text' readonly name='selectCount[]' value='" . (isset($_POST['mass']) ? count($_POST['mass']) : 0) . "' />";
         if ($_REQUEST['module'] == 'Home' || $this->local_current_module == 'Import' || $this->show_export_button == false || !empty($sugar_config['disable_export']) || !empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || ACLController::moduleSupportsACL($_REQUEST['module']) && ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $_REQUEST['module'], 'admin') == ACL_ALLOW_ADMIN_DEV))) {
             if ($_REQUEST['module'] != 'InboundEmail' && $_REQUEST['module'] != 'EmailMan' && $_REQUEST['module'] != 'iFrames') {
                 $selected_objects_span = '';
             }
             $export_link = "&nbsp;";
             $merge_link = "&nbsp;";
         } elseif ($_REQUEST['module'] != "Accounts" && $_REQUEST['module'] != "Cases" && $_REQUEST['module'] != "Contacts" & 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ACLController类代码示例发布时间:2022-05-23
下一篇:
PHP ACL类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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