public function setUp()
 {
     global $beanList, $beanFiles;
     include 'include/modules.php';
     //Reload langauge strings
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Accounts');
     //Create an anonymous user for login purposes/
     $this->_user = new User();
     $this->_user->retrieve('1');
     $GLOBALS['current_user'] = $this->_user;
     self::$helperObject = new APIv3Helper();
     if (file_exists(sugar_cached('modules/unified_search_modules.php'))) {
         $this->unified_search_modules_content = file_get_contents(sugar_cached('modules/unified_search_modules.php'));
         unlink(sugar_cached('modules/unified_search_modules.php'));
     }
     require_once 'modules/Home/UnifiedSearchAdvanced.php';
     $unifiedSearchAdvanced = new UnifiedSearchAdvanced();
     $_REQUEST['enabled_modules'] = 'Accounts,Contacts,Opportunities';
     $unifiedSearchAdvanced->saveGlobalSearchSettings();
     $GLOBALS['db']->query("DELETE FROM accounts WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM opportunities WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM contacts WHERE first_name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM calls WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM tasks WHERE name like 'UNIT TEST%' ");
     $GLOBALS['db']->query("DELETE FROM meetings WHERE name like 'UNIT TEST%' ");
     //$this->useOutputBuffering = false;
 }
Example #2
0
function show_error_import($message)
{
    global $current_language;
    $import_mod_strings = return_module_language($current_language, "Import");
    global $theme;
    global $log;
    global $mod_strings;
    global $app_strings;
    global $current_user;
    include 'themes/' . $theme . '/header.php';
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $log->info("Upload Error");
    $smarty = new CRMSmarty();
    $smarty->assign("MOD", $import_mod_strings);
    $smarty->assign("APP", $app_strings);
    if (isset($_REQUEST['return_module'])) {
        $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
    }
    if (isset($_REQUEST['return_action'])) {
        $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
    }
    $smarty->assign("THEME", $theme);
    $category = getParenttab();
    $smarty->assign("CATEGORY", $category);
    $smarty->assign("IMAGE_PATH", $image_path);
    //$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
    $smarty->assign("MODULE", "SalesOrder");
    $smarty->assign("MESSAGE", $message);
    $smarty->display('SalesOrder/Importerror.tpl');
}
function additionalDetailsProjectTask($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'ProjectTask');
    }
    $overlib_string = '';
    if (!empty($fields['PRIORITY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $fields['PRIORITY'] . '<br>';
    }
    if (!empty($fields['PERCENT_COMPLETE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PERCENT_COMPLETE'] . '</b> ' . $fields['PERCENT_COMPLETE'] . '%<br>';
    }
    if (!empty($fields['ESTIMATED_EFFORT'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_ESTIMATED_EFFORT'] . '</b> ' . $fields['ESTIMATED_EFFORT'] . '<br>';
    }
    if (!empty($fields['ACTUAL_EFFORT'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_ACTUAL_EFFORT'] . '</b> ' . $fields['ACTUAL_EFFORT'] . '<br>';
    }
    if (!empty($fields['TASK_NUMBER'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_TASK_NUMBER'] . '</b> ' . $fields['TASK_NUMBER'] . '<br>';
    }
    if (!empty($fields['DATE_START'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_START'] . '</b> ' . $fields['DATE_START'] . ' ' . $fields['TIME_START'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=ProjectTask&return_module=ProjectTask&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=ProjectTask&return_module=ProjectTask&record={$fields['ID']}");
}
Example #4
0
function additionalDetailsContact($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Contacts');
    }
    $overlib_string = '';
    if (!empty($fields['ID'])) {
        $overlib_string .= '<input type="hidden" value="' . $fields['ID'];
        $overlib_string .= '">';
    }
    $overlib_string .= '<h2><img src="index.php?entryPoint=getImage&themeName=' . SugarThemeRegistry::current()->name . '&imageName=Contacts.gif"/> ' . $mod_strings['LBL_CONTACT'] . '</h2>';
    if (!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) || !empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) || !empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET_2'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STREET_3'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>';
    }
    if (!empty($fields['PRIMARY_ADDRESS_CITY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_STATE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
    }
    if (!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
        $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
    }
    if (strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) {
        $overlib_string .= '<br>';
    }
    if (!empty($fields['PHONE_MOBILE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
    }
    if (!empty($fields['PHONE_HOME'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
    }
    if (!empty($fields['PHONE_OTHER'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
    }
    if (!empty($fields['DATE_MODIFIED'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_MODIFIED'] . '</b> ' . $fields['DATE_MODIFIED'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=Contacts&return_module=Contacts&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=Contacts&return_module=Contacts&record={$fields['ID']}");
}
    function displayScript()
    {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Emails');
        $script = <<<EOQ
        <script>
        function quick_create_overlib(id, theme) {
            return overlib('<a style=\\'width: 150px\\' class=\\'menuItem\\' onmouseover=\\'hiliteItem(this,"yes");\\' onmouseout=\\'unhiliteItem(this);\\' href=\\'index.php?module=Cases&action=EditView&inbound_email_id=' + id + '\\'>' +
            "<img border='0' src='themes/" + theme + "/images/Cases.gif' style='margin-right:5px'>" + '{$mod_strings['LBL_LIST_CASE']}' + '</a>' +
            "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Leads&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='themes/" + theme + "/images/Leads.gif' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_LEAD']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Contacts&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='themes/" + theme + "/images/Contacts.gif' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_CONTACT']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Bugs&action=EditView&inbound_email_id=" + id + "'>"+
                    "<img border='0' src='themes/" + theme + "/images/Bugs.gif' style='margin-right:5px'>"
                    + '{$mod_strings['LBL_LIST_BUG']}' + "</a>" +
             "<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\\"yes\\");' onmouseout='unhiliteItem(this);' href='index.php?module=Tasks&action=EditView&inbound_email_id=" + id + "'>" +
                    "<img border='0' src='themes/" + theme + "/images/Tasks.gif' style='margin-right:5px'>"
                   + '{$mod_strings['LBL_LIST_TASK']}' + "</a>"
            , CAPTION, '{$mod_strings['LBL_QUICK_CREATE']}'
            , STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src="themes/' + theme + '/images/close_inline.gif">', WIDTH, 150, CLOSETITLE, SUGAR.language.get('app_strings', 'LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'), CLOSECLICK, FGCLASS, 'olOptionsFgClass',
            CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');
        }
        </script>
EOQ;
        return $script;
    }
 public function displayOptions()
 {
     ob_start();
     global $current_language, $app_list_strings;
     $mod_strings = return_module_language($current_language, 'AOR_Reports');
     $optionsSmarty = new Sugar_Smarty();
     $optionsSmarty->assign('MOD', $mod_strings);
     $optionsSmarty->assign('id', $this->id);
     $optionsSmarty->assign('dashletTitle', $this->title);
     $optionsSmarty->assign('aor_report_id', $this->report->id);
     $optionsSmarty->assign('aor_report_name', $this->report->name);
     $optionsSmarty->assign('onlyCharts', $this->onlyCharts);
     $charts = array();
     if (!empty($this->report->id)) {
         foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) {
             $charts[$chart->id] = $chart->name;
         }
     }
     $conditions = getConditionsAsParameters($this->report, $this->params);
     $optionsSmarty->assign('parameters', $conditions);
     $chartOptions = get_select_options_with_id($charts, $this->charts);
     $optionsSmarty->assign('chartOptions', $chartOptions);
     $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl');
     ob_clean();
     return $optionsSmarty->fetch($optionsTemplate);
 }
function additionalDetailsCall($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Calls');
    }
    $overlib_string = '';
    if (!empty($fields['DATE_START']) && !empty($fields['TIME_START'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_TIME'] . '</b> ' . $fields['DATE_START'] . ' ' . $fields['TIME_START'] . '<br>';
    }
    if (isset($fields['DURATION_HOURS']) && isset($fields['DURATION_MINUTES'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DURATION'] . '</b> ' . $fields['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'] . ' ' . $fields['DURATION_MINUTES'] . $mod_strings['LBL_MINSS_ABBREV'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
        $overlib_string .= '<br>';
    }
    $editLink = "index.php?action=EditView&module=Calls&record={$fields['ID']}";
    $viewLink = "index.php?action=DetailView&module=Calls&record={$fields['ID']}";
    $return_module = empty($_REQUEST['module']) ? 'Calls' : $_REQUEST['module'];
    $return_action = empty($_REQUEST['action']) ? 'ListView' : $_REQUEST['action'];
    $editLink .= "&return_module={$return_module}&return_action={$return_action}";
    $viewLink .= "&return_module={$return_module}&return_action={$return_action}";
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => $editLink, 'viewLink' => $viewLink);
}
function additionalDetailsCampaign($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Campaigns');
    }
    $overlib_string = '';
    if (!empty($fields['START_DATE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_CAMPAIGN_START_DATE'] . '</b> ' . $fields['START_DATE'] . '<br>';
    }
    if (!empty($fields['TRACKER_TEXT'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_TRACKER_TEXT'] . '</b> ' . $fields['TRACKER_TEXT'] . '<br>';
    }
    if (!empty($fields['REFER_URL'])) {
        $overlib_string .= '<a target=_blank href=' . $fields['REFER_URL'] . '>' . $fields['REFER_URL'] . '</a><br>';
    }
    if (!empty($fields['OBJECTIVE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_CAMPAIGN_OBJECTIVE'] . '</b> ' . substr($fields['OBJECTIVE'], 0, 300);
        if (strlen($fields['OBJECTIVE']) > 300) {
            $overlib_string .= '...';
        }
        $overlib_string .= '<br>';
    }
    if (!empty($fields['CONTENT'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_CAMPAIGN_CONTENT'] . '</b> ' . substr($fields['CONTENT'], 0, 300);
        if (strlen($fields['CONTENT']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=Campaigns&return_module=Campaigns&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=Campaigns&return_module=Campaigns&record={$fields['ID']}");
}
 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'ProjectTask');
     parent::process();
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"projectTaskQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"projecttask\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_projecttask\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('projectTaskQuickCreate');
     $focus = new ProjectTask();
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
     $this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['project_task_status_options'], $focus->status));
     $json = getJSONobj();
     ///////////////////////////////////////
     ///
     /// SETUP PARENT POPUP
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTypeQuickCreate', 'field_to_name_array' => array('id' => 'parent_id', 'name' => 'parent_name'));
     $encoded_parent_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_parent_popup_request_data', $encoded_parent_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'projectTaskQuickCreate', 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
     $encoded_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
 }
function additionalDetailsTask($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Tasks');
    }
    $overlib_string = '';
    if (!empty($fields['DATE_START'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_START_DATE_AND_TIME'] . '</b> ' . $fields['DATE_START'] . '<br>';
    }
    if (!empty($fields['DATE_DUE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DUE_DATE_AND_TIME'] . '</b> ' . $fields['DATE_DUE'] . '<br>';
    }
    if (!empty($fields['PRIORITY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $fields['PRIORITY'] . '<br>';
    }
    if (!empty($fields['STATUS'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_STATUS'] . '</b> ' . $fields['STATUS'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    $editLink = "index.php?action=EditView&module=Tasks&record={$fields['ID']}";
    $viewLink = "index.php?action=DetailView&module=Tasks&record={$fields['ID']}";
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => $editLink, 'viewLink' => $viewLink);
}
Example #11
0
function vtDisplayWorkflowList($adb, $request, $requestUrl, $app_strings, $current_language)
{
    global $theme;
    $image_path = "themes/{$theme}/images/";
    $module = new VTWorkflowApplication("workflowlist");
    $util = new VTWorkflowUtils();
    $mod = return_module_language($current_language, $module->name);
    if (!$util->checkAdminAccess()) {
        $errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
        $util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
        return;
    }
    $smarty = new vtigerCRM_Smarty();
    $wfs = new VTWorkflowManager($adb);
    $smarty->assign("moduleNames", $util->vtGetModules($adb));
    $smarty->assign("returnUrl", $requestUrl);
    $listModule = $request['list_module'];
    $smarty->assign("listModule", $listModule);
    if ($listModule == null || strtolower($listModule) == "all") {
        $smarty->assign("workflows", $wfs->getWorkflows());
    } else {
        $smarty->assign("workflows", $wfs->getWorkflowsForModule($listModule));
    }
    $smarty->assign("MOD", array_merge(return_module_language($current_language, 'Settings'), return_module_language($current_language, $module->name)));
    $smarty->assign("APP", $app_strings);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE_NAME", $module->label);
    $smarty->assign("PAGE_NAME", $mod['LBL_WORKFLOW_LIST']);
    $smarty->assign("PAGE_TITLE", $mod['LBL_AVAILABLE_WORKLIST_LIST']);
    $smarty->assign("module", $module);
    $smarty->assign('MODULE', $module->name);
    $smarty->assign("CRON_TASK", Vtiger_Cron::getInstance('Workflow'));
    $smarty->display("{$module->name}/ListWorkflows.tpl");
}
Example #12
0
 public function setUp()
 {
     $this->markTestIncomplete("Disabling after discussing with Eddy.  Eddy will take a look at why this is breaking Stack 66 build");
     //create user
     $this->user = SugarTestUserUtilities::createAnonymousUser();
     $this->user->default_team_name = 'global';
     $this->user->is_admin = 1;
     $this->user->save();
     $this->user->retrieve($this->user->id);
     $GLOBALS['current_user'] = $this->user;
     //set some global values that will help with the view
     $_REQUEST['action'] = $GLOBALS['action'] = 'DetailView';
     $_REQUEST['module'] = $GLOBALS['module'] = 'Opportunities';
     $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], "Opportunities");
     //create opportunity
     $name = 'Test_51980_' . time();
     $this->opp = new Opportunity();
     $this->opp->name = $name;
     $this->opp->amount = '1000000';
     $this->opp->account_id = '1';
     $this->opp->team_id = '1';
     $this->opp->currency_id = -99;
     $this->opp->save();
 }
 function fill_in_additional_detail_fields()
 {
     global $current_language;
     $mod_strings = return_module_language($current_language, "ZuckerListingTemplate");
     $this->module_desc = $this->module_name;
     $this->order_desc = $this->get_summary_text();
 }
Example #14
0
 function fill_in_additional_detail_fields()
 {
     global $theme;
     global $current_language;
     global $timedate;
     global $app_list_strings;
     $this->uploadfile = $this->filename;
     $mod_strings = return_module_language($current_language, $this->object_name);
     global $img_name;
     global $img_name_bare;
     if (!$this->file_ext) {
         $img_name = SugarThemeRegistry::current()->getImageURL(strtolower($this->file_ext) . "_image_inline.gif");
         $img_name_bare = strtolower($this->file_ext) . "_image_inline";
     }
     //set default file name.
     if (!empty($img_name) && file_exists($img_name)) {
         $img_name = $img_name_bare;
     } else {
         $img_name = "def_image_inline";
         //todo change the default image.
     }
     $this->file_url_noimage = basename(UploadFile::get_url($this->filename, $this->id));
     if (!empty($this->status_id)) {
         $this->status = $app_list_strings['document_status_dom'][$this->status_id];
     }
 }
Example #15
0
function additionalDetailsTask($fields)
{
    static $mod_strings;
    global $app_list_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Tasks');
    }
    $overlib_string = '';
    if (!empty($fields['DATE_START'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_START_DATE_AND_TIME'] . '</b> ' . $fields['DATE_START'] . '<br>';
    }
    if (!empty($fields['PRIORITY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $app_list_strings['task_priority_dom'][$fields['PRIORITY']] . '<br>';
    }
    if (!empty($fields['STATUS'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_STATUS'] . '</b> ' . $app_list_strings['task_status_dom'][$fields['STATUS']] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    $editLink = "index.php?action=EditView&module=Tasks&record={$fields['ID']}";
    $viewLink = "index.php?action=DetailView&module=Tasks&record={$fields['ID']}";
    $return_module = empty($_REQUEST['module']) ? 'Tasks' : $_REQUEST['module'];
    $return_action = empty($_REQUEST['action']) ? 'ListView' : $_REQUEST['action'];
    $editLink .= "&return_module={$return_module}&return_action={$return_action}";
    $viewLink .= "&return_module={$return_module}&return_action={$return_action}";
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => $editLink, 'viewLink' => $viewLink);
}
Example #16
0
 function display()
 {
     ob_start();
     if (isset($GLOBALS['cal_strings'])) {
         return parent::display() . "Only one Calendar dashlet is allowed.";
     }
     require_once 'modules/Calendar/Calendar.php';
     require_once 'modules/Calendar/CalendarDisplay.php';
     require_once "modules/Calendar/CalendarGrid.php";
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (!ACLController::checkAccess('Calendar', 'list', true)) {
         ACLController::displayNoAccess(true);
     }
     $cal = new Calendar($this->view);
     $cal->dashlet = true;
     $cal->add_activities($GLOBALS['current_user']);
     $cal->load_activities();
     $display = new CalendarDisplay($cal, $this->id);
     $display->display_calendar_header(false);
     $display->display();
     $str = ob_get_contents();
     ob_end_clean();
     return parent::display() . $str;
 }
 public static function setUpBeforeClass()
 {
     global $mod_strings, $app_strings, $theme;
     $theme = SugarTestThemeUtilities::createAnonymousTheme();
     $mod_strings = return_module_language($GLOBALS['current_language'], 'Connectors');
     $app_strings = return_application_language($GLOBALS['current_language']);
 }
 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'Opportunities');
     $json = getJSONobj();
     parent::process();
     list($num_grp_sep, $dec_sep) = get_number_seperators();
     $this->ss->assign('NUM_GRP_SEP', $num_grp_sep);
     $this->ss->assign('DEC_SEP', $dec_sep);
     $this->ss->assign('CURRENCY_ID', $current_user->getPreference('currency'));
     $this->ss->assign("SALES_STAGE_OPTIONS", get_select_options_with_id($app_list_strings['sales_stage_dom'], ''));
     $this->ss->assign("LEAD_SOURCE_OPTIONS", get_select_options_with_id($app_list_strings['lead_source_dom'], ''));
     $this->ss->assign('prob_array', $json->encode($app_list_strings['sales_probability_dom']));
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"opportunitiesQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"opportunities\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_opportunities\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('opportunitiesQuickCreate');
     $focus = new Opportunity();
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
 }
 function init($module_name, $submodule = '')
 {
     global $app_list_strings;
     $this->module_name = $module_name;
     $mod_strings = return_module_language($GLOBALS['current_language'], $this->module_name);
     // needed solely so that listviewdefs that reference this can be included without error
     $class = $GLOBALS['beanList'][$this->module_name];
     require_once $GLOBALS['beanFiles'][$class];
     $this->module = new $class();
     $loaded = $this->_loadFromFile('ListView', 'modules/' . $this->module_name . '/metadata/listviewdefs.php', $this->module_name);
     $this->originalListViewDefs = $loaded['viewdefs'][$this->module_name];
     $this->_variables = $loaded['variables'];
     //		_pp($loaded);
     $this->customFile = 'custom/modules/' . $this->module_name . '/metadata/listviewdefs.php';
     if (file_exists($this->customFile)) {
         $loaded = $this->_loadFromFile('ListView', $this->customFile, $this->module_name);
         $this->listViewDefs = $loaded['viewdefs'][$this->module_name];
         $this->_variables = $loaded['variables'];
     } else {
         $this->listViewDefs =& $this->originalListViewDefs;
     }
     $this->fixKeys($this->originalListViewDefs);
     $this->fixKeys($this->listViewDefs);
     $this->language_module = $this->module_name;
 }
 function display()
 {
     global $current_language;
     if (empty($this->container_id)) {
         $child_reports = ReportContainer::get_root_reports();
     } else {
         $container = new ReportContainer();
         $container->retrieve($this->container_id);
         $child_reports = $container->get_linked_beans("reports", "ZuckerReport");
     }
     $mod_strings = return_module_language($current_language, "ZuckerReports");
     require_once 'include/ListView/ListView.php';
     $lv = new ListView();
     $lv->initNewXTemplate('modules/ZuckerReportContainer/DetailView.html', $mod_strings);
     $lv->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path . 'delete_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"'));
     $lv->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path . 'edit_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'));
     $lv->xTemplateAssign("RETURN_URL", "&return_module=ZuckerReportContainer&return_action=DetailView&return_id=" . $container->id);
     $lv->setHeaderTitle("");
     $lv->setHeaderText("");
     ob_start();
     $lv->processListViewTwo($child_reports, "reports", "REPORT");
     $str = ob_get_clean();
     ob_end_flush();
     return parent::display() . $str;
 }
 function process()
 {
     global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
     $mod_strings = return_module_language($current_language, 'Contracts');
     parent::process();
     if ($this->viaAJAX) {
         // override for ajax call
         $this->ss->assign('saveOnclick', "onclick='if(check_form(\"contractsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"contracts\"); else return false;'");
         $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_contracts\")';");
     }
     $this->ss->assign('viaAJAX', $this->viaAJAX);
     $this->javascript = new javascript();
     $this->javascript->setFormName('contractsQuickCreate');
     $focus = BeanFactory::getBean('Contracts');
     $this->javascript->setSugarBean($focus);
     $this->javascript->addAllFields('');
     $status_options = isset($focus->status) ? get_select_options_with_id($app_list_strings['contract_status_dom'], $focus->status) : get_select_options_with_id($app_list_strings['contract_status_dom'], '');
     $this->ss->assign('STATUS_OPTIONS', $status_options);
     $json = getJSONobj();
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'contractsQuickCreate', 'field_to_name_array' => array('id' => 'account_id', 'name' => 'account_name'));
     $encoded_popup_request_data = $json->encode($popup_request_data);
     $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
     $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'contractsQuickCreate', 'field_to_name_array' => array('id' => 'team_id', 'name' => 'team_name'));
     $this->ss->assign('encoded_team_popup_request_data', $json->encode($popup_request_data));
     $this->ss->assign('additionalScripts', $this->javascript->getScript(false));
 }
Example #22
0
 public function display()
 {
     global $current_user, $current_language, $sugar_flavor, $sugar_config;
     if (!$current_user->is_admin) {
         sugar_die(translate("LBL_MUST_BE_ADMIN"));
     }
     //RemoveTabSave: let dashboard pass since we are still altering it
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'RemoveTabSave') {
         if (isset($_REQUEST['TabToRemove'])) {
             $dashboardManager = BeanFactory::newBean("dash_DashboardManager");
             $dashboardManager->temp_unencoded_pages = $dashboardManager->deletePageByKey($_REQUEST['TabToRemove'], $current_user->getPreference('pages', 'Home'));
             $dashboardManager->temp_unencoded_dashlets = $current_user->getPreference('dashlets', 'Home');
             $dashboardManager->setDashboardForUser($current_user);
             $current_user->getPreference('pages', 'Home');
             $current_user->getPreference('dashlets', 'Home');
         }
     } elseif (isset($this->bean->fetched_row['id'])) {
         //set this dashboard for current user
         $this->bean->setDashboardForUser($current_user);
     } else {
         //set dashboard back to clean template
         $current_user->resetPreferences('Home');
     }
     parent::display();
     //get language for dashboard
     $mod_strings = return_module_language($current_language, 'Home');
     //render dashboard
     $lock_homepage = $sugar_config['lock_homepage'];
     $sugar_config['lock_homepage'] = false;
     require_once "modules/Home/index.php";
     $sugar_config['lock_homepage'] = $lock_homepage;
 }
Example #23
0
function display_conflict_between_objects($object_1, $object_2, $field_defs, $module_dir, $display_name)
{
    $mod_strings = return_module_language($GLOBALS['current_language'], 'OptimisticLock');
    $title = '<tr><td >&nbsp;</td>';
    $object1_row = '<tr class="oddListRowS1"><td><b>' . $mod_strings['LBL_YOURS'] . '</b></td>';
    $object2_row = '<tr class="evenListRowS1"><td><b>' . $mod_strings['LBL_IN_DATABASE'] . '</b></td>';
    $exists = false;
    foreach ($field_defs as $name => $ignore) {
        $value = $object_1[$name];
        // FIXME: Replace the comparison here with a function from SugarWidgets
        if (!is_scalar($value) || $name == 'team_name') {
            continue;
        }
        if ($value != $object_2->{$name} && !$object_2->{$name} instanceof Link) {
            $title .= '<td ><b>&nbsp;' . translate($field_defs[$name]['vname'], $module_dir) . '</b></td>';
            $object1_row .= '<td>&nbsp;' . $value . '</td>';
            $object2_row .= '<td>&nbsp;' . $object_2->{$name} . '</td>';
            $exists = true;
        }
    }
    if ($exists) {
        echo "<b>{$mod_strings['LBL_CONFLICT_EXISTS']}<a href='index.php?action=DetailView&module={$module_dir}&record={$object_1['id']}'  target='_blank'>{$display_name}</a> </b> <br><table  class='list view' border='0' cellspacing='0' cellpadding='2'>{$title}<td  >&nbsp;</td></tr>{$object1_row}<td><a href='index.php?&module=OptimisticLock&action=LockResolve&save=true'>{$mod_strings['LBL_ACCEPT_YOURS']}</a></td></tr>{$object2_row}<td><a href='index.php?&module={$object_2->module_dir}&action=DetailView&record={$object_2->id}'>{$mod_strings['LBL_ACCEPT_DATABASE']}</a></td></tr></table><br>";
    } else {
        echo "<b>{$mod_strings['LBL_RECORDS_MATCH']}</b><br>";
    }
}
Example #24
0
function getTopAccounts($maxval, $calCnt)
{
    $log = LoggerManager::getLogger('top accounts_list');
    $log->debug("Entering getTopAccounts() method ...");
    require_once "data/Tracker.php";
    require_once 'modules/Potentials/Potentials.php';
    require_once 'include/logging.php';
    require_once 'include/ListView/ListView.php';
    global $app_strings;
    global $adb;
    global $current_language;
    global $current_user;
    $current_module_strings = return_module_language($current_language, "Accounts");
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    $list_query = "select vtiger_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol, sum(vtiger_potential.amount) as amount from vtiger_potential inner join vtiger_crmentity on (vtiger_potential.potentialid=vtiger_crmentity.crmid) left join vtiger_account on (vtiger_potential.related_to=vtiger_account.accountid) left join vtiger_groups on (vtiger_groups.groupid = vtiger_crmentity.smownerid) where vtiger_crmentity.deleted=0 AND vtiger_crmentity.smownerid='" . $current_user->id . "' and vtiger_potential.sales_stage not in ('Closed Won', 'Closed Lost','" . $app_strings['LBL_CLOSE_WON'] . "','" . $app_strings['LBL_CLOSE_LOST'] . "')";
    if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3) {
        $sec_parameter = getListViewSecurityParameter('Accounts');
        $list_query .= $sec_parameter;
    }
    $list_query .= " group by vtiger_account.accountid, vtiger_account.accountname, vtiger_account.tickersymbol order by amount desc";
    $list_query .= " LIMIT 0," . $adb->sql_escape_string($maxval);
    if ($calCnt == 'calculateCnt') {
        $list_result_rows = $adb->query(mkCountQuery($list_query));
        return $adb->query_result($list_result_rows, 0, 'count');
    }
    $list_result = $adb->query($list_query);
    $open_accounts_list = array();
    $noofrows = $adb->num_rows($list_result);
    if ($noofrows) {
        for ($i = 0; $i < $noofrows; $i++) {
            $open_accounts_list[] = array('accountid' => $adb->query_result($list_result, $i, 'accountid'), 'accountname' => $adb->query_result($list_result, $i, 'accountname'), 'amount' => $adb->query_result($list_result, $i, 'amount'), 'tickersymbol' => $adb->query_result($list_result, $i, 'tickersymbol'));
        }
    }
    $title = array();
    $title[] = 'myTopAccounts.gif';
    $title[] = $current_module_strings['LBL_TOP_ACCOUNTS'];
    $title[] = 'home_myaccount';
    $header = array();
    $header[] = $current_module_strings['LBL_LIST_ACCOUNT_NAME'];
    $currencyid = fetchCurrency($current_user->id);
    $rate_symbol = getCurrencySymbolandCRate($currencyid);
    $rate = $rate_symbol['rate'];
    $curr_symbol = $rate_symbol['symbol'];
    $header[] = $current_module_strings['LBL_LIST_AMOUNT'] . '(' . $curr_symbol . ')';
    $entries = array();
    foreach ($open_accounts_list as $account) {
        $value = array();
        $account_fields = array('ACCOUNT_ID' => $account['accountid'], 'ACCOUNT_NAME' => $account['accountname'], 'AMOUNT' => $account['amount']);
        $Top_Accounts = strlen($account['accountname']) > 20 ? substr($account['accountname'], 0, 20) . '...' : $account['accountname'];
        $value[] = '<a href="index.php?action=DetailView&module=Accounts&record=' . $account['accountid'] . '">' . $Top_Accounts . '</a>';
        $value[] = convertFromDollar($account['amount'], $rate);
        $entries[$account['accountid']] = $value;
    }
    $values = array('ModuleName' => 'Accounts', 'Title' => $title, 'Header' => $header, 'Entries' => $entries);
    $log->debug("Exiting getTopAccounts method ...");
    if ($display_empty_home_blocks && count($entries) == 0 || count($entries) > 0) {
        return $values;
    }
}
Example #25
0
function additionalDetailsMeeting($fields)
{
    static $mod_strings;
    if (empty($mod_strings)) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Meetings');
    }
    $overlib_string = '';
    //Modify by jchi 6/27/2008 1515pm china time , bug 20626.
    if (!empty($fields['DATE_START'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DATE_TIME'] . '</b> ' . $fields['DATE_START'] . ' <br>';
    }
    if (isset($fields['DURATION_HOURS']) || isset($fields['DURATION_MINUTES'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DURATION'] . '</b> ';
        if (isset($fields['DURATION_HOURS'])) {
            $overlib_string .= $fields['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'] . ' ';
        }
        if (isset($fields['DURATION_MINUTES'])) {
            $overlib_string .= $fields['DURATION_MINUTES'] . $mod_strings['LBL_MINSS_ABBREV'];
        }
        $overlib_string .= '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
        $overlib_string .= '<br>';
    }
    $editLink = "index.php?action=EditView&module=Meetings&record={$fields['ID']}";
    $viewLink = "index.php?action=DetailView&module=Meetings&record={$fields['ID']}";
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => $editLink, 'viewLink' => $viewLink);
}
Example #26
0
function get_message_scope_dom($campaign_id, $campaign_name,$db=null, $mod_strings=array()) {

    if (empty($db)) {
        $db = DBManagerFactory::getInstance();
    }
    if (empty($mod_strings) or !isset($mod_strings['LBL_DEFAULT'])) {
        global $current_language;
        $mod_strings = return_module_language($current_language, 'Campaigns');
    }

    //find prospect list attached to this campaign..
    $query =  "SELECT prospect_list_id, prospect_lists.name ";
    $query .= "FROM prospect_list_campaigns ";
    $query .= "INNER join prospect_lists on prospect_lists.id = prospect_list_campaigns.prospect_list_id ";
    $query .= "WHERE prospect_lists.deleted = 0 ";
    $query .= "AND prospect_list_campaigns.deleted=0 ";
    $query .= "AND campaign_id='". $db->quote($campaign_id)."'";
    $query.=" and prospect_lists.list_type not like 'exempt%'";

    //add campaign to the result array.
    //$return_array[$campaign_id]= $campaign_name . ' (' . $mod_strings['LBL_DEFAULT'] . ')';

    $result=$db->query($query);
    while(($row=$db->fetchByAssoc($result))!= null) {
        $return_array[$row['prospect_list_id']]=$row['name'];
    }
    if (empty($return_array)) $return_array=array();
    else return $return_array;
}
function vtEditExpressions($adb, $appStrings, $current_language, $theme, $formodule = '')
{
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $smarty = new vtigerCRM_Smarty();
    $smarty->assign('APP', $appStrings);
    $mod = array_merge(return_module_language($current_language, 'FieldFormulas'), return_module_language($current_language, 'Settings'));
    $jsStrings = array('NEED_TO_ADD_A' => $mod['NEED_TO_ADD_A'], 'CUSTOM_FIELD' => $mod['LBL_CUSTOM_FIELD'], 'LBL_USE_FUNCTION_DASHDASH' => $mod['LBL_USE_FUNCTION_DASHDASH'], 'LBL_USE_FIELD_VALUE_DASHDASH' => $mod['LBL_USE_FIELD_VALUE_DASHDASH'], 'LBL_DELETE_EXPRESSION_CONFIRM' => $mod['LBL_DELETE_EXPRESSION_CONFIRM']);
    $smarty->assign("JS_STRINGS", Zend_Json::encode($jsStrings));
    $smarty->assign("MOD", $mod);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE_NAME", 'FieldFormulas');
    $smarty->assign("PAGE_NAME", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_TITLE", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_DESC", 'LBL_FIELDFORMULAS_DESCRIPTION');
    $smarty->assign("FORMODULE", $formodule);
    if (file_exists("modules/{$formodule}/{$formodule}.php")) {
        $focus = CRMEntity::getInstance($formodule);
        $validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, getTabid($formodule)));
        $smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
        $smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
        $smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
    }
    $smarty->display(vtlib_getModuleTemplate('FieldFormulas', 'EditExpressions.tpl'));
}
 public function configSave(ServiceBase $api, $args)
 {
     $module = 'dm_Duplicates';
     unset($args['__sugar_url']);
     //acl check, only allow if they are module admin
     if (!$api->user->isAdmin() && !$api->user->isDeveloperForModule($module)) {
         // No create access so we construct an error message and throw the exception
         $failed_module_strings = return_module_language($GLOBALS['current_language'], $module);
         $moduleName = $failed_module_strings['LBL_MODULE_NAME'];
         $args = null;
         if (!empty($moduleName)) {
             $args = array('moduleName' => $moduleName);
         }
         throw new SugarApiExceptionNotAuthorized($GLOBALS['app_strings']['EXCEPTION_CHANGE_MODULE_CONFIG_NOT_AUTHORIZED'], $args);
     }
     $admin = BeanFactory::getBean('Administration');
     $platform = 'base';
     foreach ($args as $name => $value) {
         if (is_array($value)) {
             $admin->saveSetting($module, $name, json_encode($value), $platform);
         } else {
             $admin->saveSetting($module, $name, $value, $platform);
         }
     }
     if ($this->skipMetadataRefresh === false) {
         MetaDataManager::refreshModulesCache(array($module));
     }
     return $admin->getConfigForModule($module, $platform, true);
 }
function additionalDetailsOpportunity($fields)
{
    global $current_language;
    $mod_strings = return_module_language($current_language, 'Opportunities');
    $overlib_string = '';
    if (!empty($fields['LEAD_SOURCE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>';
    }
    if (!empty($fields['PROBABILITY'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_PROBABILITY'] . '</b> ' . $fields['PROBABILITY'] . '<br>';
    }
    if (!empty($fields['NEXT_STEP'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_NEXT_STEP'] . '</b> ' . $fields['NEXT_STEP'] . '<br>';
    }
    if (!empty($fields['OPPORTUNITY_TYPE'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_TYPE'] . '</b> ' . $fields['OPPORTUNITY_TYPE'] . '<br>';
    }
    if (!empty($fields['DESCRIPTION'])) {
        $overlib_string .= '<b>' . $mod_strings['LBL_DESCRIPTION'] . '</b> ';
        $overlib_string .= substr($fields['DESCRIPTION'], 0, 300);
        if (strlen($fields['DESCRIPTION']) > 300) {
            $overlib_string .= '...';
        }
    }
    return array('fieldToAddTo' => 'NAME', 'string' => $overlib_string, 'editLink' => "index.php?action=EditView&module=Opportunities&return_module=Opportunities&record={$fields['ID']}", 'viewLink' => "index.php?action=DetailView&module=Opportunities&return_module=Opportunities&record={$fields['ID']}");
}
 function aSubPanel($name, $instance_properties, $parent_bean, $reload = false)
 {
     global $current_language;
     $this->_instance_properties = $instance_properties;
     $this->name = $name;
     $this->parent_bean = $parent_bean;
     //set language
     global $current_language;
     $mod_strings = return_module_language($current_language, $parent_bean->module_dir);
     $this->mod_strings = $mod_strings;
     if ($this->isCollection()) {
         $this->load_sub_subpanels();
         //load sub-panel definition.
     } else {
         $def_path = 'modules/' . $this->_instance_properties['module'] . '/subpanels/' . $this->_instance_properties['subpanel_name'] . '.php';
         if (!$reload) {
             require $def_path;
         } else {
             require $def_path;
         }
         if (isset($this->_instance_properties['override_subpanel_name']) && file_exists('custom/modules/' . $this->_instance_properties['module'] . '/subpanels/' . $this->_instance_properties['override_subpanel_name'] . '.php')) {
             $cust_def_path = 'custom/modules/' . $this->_instance_properties['module'] . '/subpanels/' . $this->_instance_properties['override_subpanel_name'] . '.php';
             if (!$reload) {
                 require $cust_def_path;
             } else {
                 require $cust_def_path;
             }
         }
         $this->panel_definition = $subpanel_layout;
         $this->load_module_info();
         //load module info from the module's bean file.
     }
 }