Beispiel #1
0
 public function preProcess()
 {
     global $current_user;
     $workflow_modules = get_workflow_admin_modules_for_user($current_user);
     if (!is_admin($current_user) && empty($workflow_modules)) {
         sugar_die("Unauthorized access to WorkFlow.");
     }
 }
function get_module_map($start_none = false)
{
    global $current_user;
    global $app_strings;
    global $app_list_strings;
    //$module_map = array();
    $module_map = get_workflow_admin_modules_for_user($current_user);
    if ($start_none == true) {
        $module_map[''] = $app_strings['LBL_PLEASE_SELECT'];
    }
    foreach ($module_map as $key => $value) {
        $module_map[$key] = $app_list_strings['moduleList'][$key];
    }
    asort($module_map);
    return $module_map;
    //end function get_module_map
}
Beispiel #3
0
 /**
 * @return void
 * @param unknown $seed
 * @param unknown $xTemplateSection
 * @param unknown $html_varName
 * @desc PUBLIC FUNCTION Handles List views using seeds that extend SugarBean
     $XTemplateSection is the section in the XTemplate file that should be parsed usually main
     $html_VarName is the variable name used in the XTemplateFile e.g. TASK
     $seed is a seed there are two types of seeds one is a subclass of SugarBean, the other is a list usually created from a sugar bean using get_list
     if no XTemplate is set it will create  a new XTemplate
     * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
     * All Rights Reserved..
     * Contributor(s): ______________________________________..
 */
 function processListViewTwo($seed, $xTemplateSection, $html_varName)
 {
     global $current_user;
     if (!isset($this->xTemplate)) {
         $this->createXTemplate();
     }
     $isSugarBean = is_subclass_of($seed, "SugarBean");
     $list = null;
     if ($isSugarBean) {
         $list = $this->processSugarBean($xTemplateSection, $html_varName, $seed);
     } else {
         $list = $seed;
     }
     if (is_object($seed) && isset($seed->object_name) && $seed->object_name == 'WorkFlow') {
         $tab = array();
         $access = get_workflow_admin_modules_for_user($current_user);
         for ($i = 0; $i < count($list); $i++) {
             if (!empty($access[$list[$i]->base_module])) {
                 $tab[] = $list[$i];
             }
         }
         $list = $tab;
     }
     if ($this->is_dynamic) {
         $this->processHeaderDynamic($xTemplateSection, $html_varName);
         $this->processListRows($list, $xTemplateSection, $html_varName);
     } else {
         $this->processSortArrows($html_varName);
         if ($isSugarBean) {
             $seed->parse_additional_headers($this->xTemplate, $xTemplateSection);
         }
         $this->xTemplateAssign('CHECKALL', "<img src='" . SugarThemeRegistry::current()->getImageURL('blank.gif') . "' width=\"1\" height=\"1\" al=\"\">");
         // Process the  order by before processing the pro_nav.  The pro_nav requires the order by values to be set
         $this->processOrderBy($html_varName);
         $this->processListRows($list, $xTemplateSection, $html_varName);
     }
     if ($this->display_header_and_footer) {
         $this->getAdditionalHeader();
         if (!empty($this->header_title)) {
             echo get_form_header($this->header_title, $this->header_text, false);
         }
     }
     $this->xTemplate->out($xTemplateSection);
     if (isset($_SESSION['validation'])) {
         print base64_decode('PGEgaHJlZj0naHR0cDovL3d3dy5zdWdhcmNybS5jb20nPlBPV0VSRUQmbmJzcDtCWSZuYnNwO1NVR0FSQ1JNPC9hPg==');
     }
 }
 * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
/*********************************************************************************
 * $Header$
 * Description: TODO:  To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
global $current_user;
$workflow_modules = get_workflow_admin_modules_for_user($current_user);
if (!is_admin($current_user) && empty($workflow_modules)) {
    sugar_die("Unauthorized access to WorkFlow.");
}
///////////Show related config option
//Set to true - show related dynamic fields
//Set to false - do not show related dynamic fields
$show_related = true;
global $app_strings;
global $app_list_strings;
global $mod_strings;
$focus = BeanFactory::getBean('EmailTemplates');
if (isset($_REQUEST['record'])) {
    $focus->retrieve($_REQUEST['record']);
}
$old_id = '';
Beispiel #5
0
function displayWorkflowForCurrentUser()
{
    if (is_admin($GLOBALS['current_user'])) {
        return true;
    }
    if (isset($_SESSION['display_workflow_for_user'])) {
        return $_SESSION['display_workflow_for_user'];
    }
    global $moduleList;
    $workflow_mod_list = array();
    foreach ($moduleList as $module) {
        $workflow_mod_list[$module] = $module;
    }
    // This list is taken from the 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
    $access = get_workflow_admin_modules_for_user($GLOBALS['current_user']);
    foreach ($access as $key => $val) {
        if (in_array($val, $workflow_mod_list)) {
            $_SESSION['display_workflow_for_user'] = true;
            return true;
        }
    }
    $_SESSION['display_workflow_for_user'] = false;
    return false;
}