/** * This method will be called from the controller and is not meant to be overridden. */ public function process() { LogicHook::initialize(); $this->_checkModule(); //trackView has to be here in order to track for breadcrumbs $this->_trackView(); //For the ajaxUI, we need to use output buffering to return the page in an ajax friendly format if ($this->_getOption('json_output')) { ob_start(); if (!empty($_REQUEST['ajax_load']) && !empty($_REQUEST['loadLanguageJS'])) { echo $this->_getModLanguageJS(); } } if ($this->_getOption('show_header')) { $this->displayHeader(); } else { $this->renderJavascript(); } $this->_buildModuleList(); $this->preDisplay(); $this->displayErrors(); $this->display(); if (!empty($this->module)) { $GLOBALS['logic_hook']->call_custom_logic($this->module, 'after_ui_frame'); } else { $GLOBALS['logic_hook']->call_custom_logic('', 'after_ui_frame'); } // We have to update jsAlerts as soon as possible if (!isset($_SESSION['isMobile']) && ($this instanceof ViewList || $this instanceof ViewDetail || $this instanceof ViewEdit)) { $jsAlerts = new jsAlerts(); echo $jsAlerts->getScript(); } if ($this->_getOption('show_subpanels') && !empty($_REQUEST['record'])) { $this->_displaySubPanels(); } if ($this->action === 'Login') { //this is needed for a faster loading login page ie won't render unless the tables are closed ob_flush(); } if ($this->_getOption('show_footer')) { $this->displayFooter(); } $GLOBALS['logic_hook']->call_custom_logic('', 'after_ui_footer'); if ($this->_getOption('json_output')) { $content = ob_get_clean(); $module = $this->module; $ajax_ret = array('content' => mb_detect_encoding($content) == "UTF-8" ? $content : utf8_encode($content), 'menu' => array('module' => $module, 'label' => translate($module), $this->getMenu($module)), 'title' => $this->getBrowserTitle(), 'action' => isset($_REQUEST['action']) ? $_REQUEST['action'] : "", 'record' => isset($_REQUEST['record']) ? $_REQUEST['record'] : "", 'favicon' => $this->getFavicon()); if (SugarThemeRegistry::current()->name == 'Classic' || SugarThemeRegistry::current()->classic) { $ajax_ret['moduleList'] = $this->displayHeader(true); } if (empty($this->responseTime)) { $this->_calculateFooterMetrics(); } $ajax_ret['responseTime'] = $this->responseTime; $json = getJSONobj(); echo $json->encode($ajax_ret); $GLOBALS['app']->headerDisplayed = false; ob_flush(); } //Do not track if there is no module or if module is not a String $this->_track(); }
/** * Called from process(). This method will display the footer on the page. */ public function displayFooter() { if (empty($this->responseTime)) { $this->_calculateFooterMetrics(); } global $sugar_config; global $app_strings; global $mod_strings; $themeObject = SugarThemeRegistry::current(); //decide whether or not to show themepicker, default is to show $showThemePicker = true; if (isset($sugar_config['showThemePicker'])) { $showThemePicker = $sugar_config['showThemePicker']; } echo "<!-- crmprint -->"; $jsalerts = new jsAlerts(); if (!isset($_SESSION['isMobile'])) { echo $jsalerts->getScript(); } $ss = new Sugar_Smarty(); $ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"])); $ss->assign('MOD', return_module_language($GLOBALS['current_language'], 'Users')); $bottomLinkList = array(); if (isset($this->action) && $this->action != "EditView") { $bottomLinkList['print'] = array($app_strings['LNK_PRINT'] => getPrintLink()); } $bottomLinkList['backtotop'] = array($app_strings['LNK_BACKTOTOP'] => 'javascript:SUGAR.util.top();'); $bottomLinksStr = ""; foreach ($bottomLinkList as $key => $value) { foreach ($value as $text => $link) { $href = $link; if (substr($link, 0, 11) == "javascript:") { $onclick = " onclick=\"" . substr($link, 11) . "\""; $href = "javascript:void(0)"; } else { $onclick = ""; } $imageURL = SugarThemeRegistry::current()->getImageURL($key . '.gif'); $bottomLinksStr .= "<a href=\"{$href}\""; $bottomLinksStr .= isset($onclick) ? $onclick : ""; $bottomLinksStr .= "><img src='{$imageURL}' alt=''>"; //keeping alt blank on purpose for 508 (text will be read instead) $bottomLinksStr .= " " . $text . "</a>"; } } $ss->assign("BOTTOMLINKS", $bottomLinksStr); if (SugarConfig::getInstance()->get('calculate_response_time', false)) { $ss->assign('STATISTICS', $this->_getStatistics()); } // Under the License referenced above, you are required to leave in all copyright statements in both // the code and end-user application. $copyright = '© 2004-2012 SugarCRM Inc. The Program is provided AS IS, without warranty. Licensed under <a href="LICENSE.txt" target="_blank" class="copyRightLink">AGPLv3</a>.<br>This program is free software; you can redistribute it and/or modify it under the terms of the <br><a href="LICENSE.txt" target="_blank" class="copyRightLink"> GNU Affero General Public License version 3</a> as published by the Free Software Foundation, including the additional permission set forth in the source code header.<br>'; // The interactive user interfaces in modified source and object code // versions of this program must display Appropriate Legal Notices, as // required under Section 5 of the GNU General Public License version // 3. In accordance with Section 7(b) of the GNU General Public License // version 3, these Appropriate Legal Notices must retain the display // of the "Powered by SugarCRM" logo. If the display of the logo is // not reasonably feasible for technical reasons, the Appropriate // Legal Notices must display the words "Powered by SugarCRM". $attribLinkImg = "<img style='margin-top: 2px' border='0' width='120' height='34' src='include/images/poweredby_sugarcrm_65.png' alt='Powered By SugarCRM'>\n"; // handle resizing of the company logo correctly on the fly $companyLogoURL = $themeObject->getImageURL('company_logo.png'); $companyLogoURL_arr = explode('?', $companyLogoURL); $companyLogoURL = $companyLogoURL_arr[0]; $company_logo_attributes = sugar_cache_retrieve('company_logo_attributes'); if (!empty($company_logo_attributes)) { $ss->assign("COMPANY_LOGO_MD5", $company_logo_attributes[0]); $ss->assign("COMPANY_LOGO_WIDTH", $company_logo_attributes[1]); $ss->assign("COMPANY_LOGO_HEIGHT", $company_logo_attributes[2]); } else { // Always need to md5 the file $ss->assign("COMPANY_LOGO_MD5", md5_file($companyLogoURL)); list($width, $height) = getimagesize($companyLogoURL); if ($width > 212 || $height > 40) { $resizePctWidth = ($width - 212) / 212; $resizePctHeight = ($height - 40) / 40; if ($resizePctWidth > $resizePctHeight) { $resizeAmount = $width / 212; } else { $resizeAmount = $height / 40; } $ss->assign("COMPANY_LOGO_WIDTH", round($width * (1 / $resizeAmount))); $ss->assign("COMPANY_LOGO_HEIGHT", round($height * (1 / $resizeAmount))); } else { $ss->assign("COMPANY_LOGO_WIDTH", $width); $ss->assign("COMPANY_LOGO_HEIGHT", $height); } // Let's cache the results sugar_cache_put('company_logo_attributes', array($ss->get_template_vars("COMPANY_LOGO_MD5"), $ss->get_template_vars("COMPANY_LOGO_WIDTH"), $ss->get_template_vars("COMPANY_LOGO_HEIGHT"))); } $ss->assign("COMPANY_LOGO_URL", getJSPath($companyLogoURL) . "&logo_md5=" . $ss->get_template_vars("COMPANY_LOGO_MD5")); // Bug 38594 - Add in Trademark wording $copyright .= 'SugarCRM is a trademark of SugarCRM, Inc. All other company and product names may be trademarks of the respective companies with which they are associated.<br />'; //rrs bug: 20923 - if this image does not exist as per the license, then the proper image will be displayed regardless, so no need //to display an empty image here. if (file_exists('include/images/poweredby_sugarcrm_65.png')) { $copyright .= $attribLinkImg; } // End Required Image $ss->assign('COPYRIGHT', $copyright); // here we allocate the help link data $help_actions_blacklist = array('Login'); // we don't want to show a context help link here if (!in_array($this->action, $help_actions_blacklist)) { $url = 'javascript:void(window.open(\'index.php?module=Administration&action=SupportPortal&view=documentation&version=' . $GLOBALS['sugar_version'] . '&edition=' . $GLOBALS['sugar_flavor'] . '&lang=' . $GLOBALS['current_language'] . '&help_module=' . $this->module . '&help_action=' . $this->action . '&key=' . $GLOBALS['server_unique_key'] . '\'))'; $label = (isset($GLOBALS['app_list_strings']['moduleList'][$this->module]) ? $GLOBALS['app_list_strings']['moduleList'][$this->module] : $this->module) . ' ' . $app_strings['LNK_HELP']; $ss->assign('HELP_LINK', SugarThemeRegistry::current()->getLink($url, $label, "id='help_link_two'", 'help-dashlet.png', 'class="icon"', null, null, '', 'left')); } // end $ss->display(SugarThemeRegistry::current()->getTemplate('footer.tpl')); }
$subpanel = $_REQUEST['subpanel']; $record = $_REQUEST['record']; $module = $_REQUEST['module']; $collection = array(); if (isset($_REQUEST['collection_basic']) && $_REQUEST['collection_basic'][0] != 'null') { $_REQUEST['collection_basic'] = explode(',', $_REQUEST['collection_basic'][0]); $collection = $_REQUEST['collection_basic']; } if (empty($_REQUEST['inline'])) { insert_popup_header($theme); } //require_once('include/SubPanel/SubPanelDefinitions.php'); //require_once($beanFiles[$beanList[$_REQUEST['module']]]); //$focus=new $beanList[$_REQUEST['module']]; //$focus->retrieve($record); include 'custom/include/SubPanel/SubPanel.php'; $layout_def_key = ''; if (!empty($_REQUEST['layout_def_key'])) { $layout_def_key = $_REQUEST['layout_def_key']; } $subpanel_object = new CustomSubPanel($module, $record, $subpanel, null, $layout_def_key, $collection); $subpanel_object->setTemplateFile('custom/include/SubPanel/SubPanelDynamic.html'); echo empty($_REQUEST['inline']) ? $subpanel_object->get_buttons() : ''; $subpanel_object->display(); $jsAlerts = new jsAlerts(); if (!isset($_SESSION['isMobile'])) { echo $jsAlerts->getScript(); } if (empty($_REQUEST['inline'])) { insert_popup_footer($theme); }
public function testGetDeclinedAlertsForUser() { global $app_list_strings; $app_list_strings['reminder_max_time'] = 5000; $m = $this->createNewMeeting(); //Decline the meeting $query = "UPDATE meetings_users SET deleted = 0, accept_status = 'decline' " . "WHERE meeting_id = '{$m->id}' AND user_id = '{$this->_user->id}'"; $m->db->query($query); $alerts = new jsAlerts(); $script = $alerts->getScript(); $this->assertNotRegExp("/addAlert.*\"{$m->name}\"/", $script); }
/** * Called from process(). This method will display the footer on the page. */ public function displayFooter() { if (empty($this->responseTime)) { $this->_calculateFooterMetrics(); } global $sugar_config; global $app_strings; //decide whether or not to show themepicker, default is to show $showThemePicker = true; if (isset($sugar_config['showThemePicker'])) { $showThemePicker = $sugar_config['showThemePicker']; } echo "<!-- crmprint -->"; $jsalerts = new jsAlerts(); if (!isset($_SESSION['isMobile'])) { echo $jsalerts->getScript(); } $ss = new Sugar_Smarty(); $ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"])); $ss->assign('MOD', return_module_language($GLOBALS['current_language'], 'Users')); $bottomLinkList = array(); if (isset($this->action) && $this->action != "EditView") { $bottomLinkList['print'] = array($app_strings['LNK_PRINT'] => 'javascript:void window.open(\'index.php?' . $GLOBALS['request_string'] . '\',\'printwin\',\'menubar=1,status=0,resizable=1,scrollbars=1,toolbar=0,location=1\')'); } $bottomLinkList['backtotop'] = array($app_strings['LNK_BACKTOTOP'] => '#top'); $bottomLinksStr = ""; foreach ($bottomLinkList as $key => $value) { foreach ($value as $text => $link) { $href = $link; if (substr($link, 0, 11) == "javascript:") { $onclick = " onclick=\"" . substr($link, 11) . "\""; $href = "#"; } else { $onclick = ""; } $imageURL = SugarThemeRegistry::current()->getImageURL($key . '.gif'); $bottomLinksStr .= "<a href=\"{$href}\""; $bottomLinksStr .= isset($onclick) ? $onclick : ""; $bottomLinksStr .= "><img src='{$imageURL}' alt='{$text}'></a>"; $bottomLinksStr .= " <a href=\"{$href}\" class=\"bottomLink\""; $bottomLinksStr .= isset($onclick) ? $onclick : ""; $bottomLinksStr .= ">" . $text . "</a>"; } } $ss->assign("BOTTOMLINKS", $bottomLinksStr); if (SugarConfig::getInstance()->get('calculate_response_time', false)) { $ss->assign('STATISTICS', $this->_getStatistics()); } // Under the License referenced above, you are required to leave in all copyright statements in both // the code and end-user application. $copyright = '© 2004-2011 SugarCRM Inc. The Program is provided AS IS, without warranty. Licensed under <a href="LICENSE.txt" target="_blank" class="copyRightLink">AGPLv3</a>.<br>This program is free software; you can redistribute it and/or modify it under the terms of the <br><a href="LICENSE.txt" target="_blank" class="copyRightLink"> GNU Affero General Public License version 3</a> as published by the Free Software Foundation, including the additional permission set forth in the source code header.<br>'; // The interactive user interfaces in modified source and object code // versions of this program must display Appropriate Legal Notices, as // required under Section 5 of the GNU General Public License version // 3. In accordance with Section 7(b) of the GNU General Public License // version 3, these Appropriate Legal Notices must retain the display // of the "Powered by SugarCRM" logo. If the display of the logo is // not reasonably feasible for technical reasons, the Appropriate // Legal Notices must display the words "Powered by SugarCRM". $attribLinkImg = "<img style='margin-top: 2px' border='0' width='106' height='23' src='include/images/poweredby_sugarcrm.png' alt='Powered By SugarCRM'>\n"; // Bug 38594 - Add in Trademark wording $copyright .= 'SugarCRM is a trademark of SugarCRM, Inc. All other company and product names may be trademarks of the respective companies with which they are associated.<br />'; //rrs bug: 20923 - if this image does not exist as per the license, then the proper image will be displaye regardless, so no need //to display an empty image here. if (file_exists('include/images/poweredby_sugarcrm.png')) { $copyright .= $attribLinkImg; } // End Required Image $ss->assign('COPYRIGHT', $copyright); $ss->display(SugarThemeRegistry::current()->getTemplate('footer.tpl')); }
$GLOBALS['log']->debug('---------> BEGING INCLUDING REQUESTED PAGE: [' . $currentModuleFile . '] <------------'); include $currentModuleFile; $GLOBALS['log']->debug('---------> END INCLUDING REQUESTED PAGE: [' . $currentModuleFile . '] <------------'); //// END DISPLAY REQUESTED PAGE /////////////////////////////////////////////////////////////////////// } if (isset($focus) && is_subclass_of($focus, 'SugarBean') && $focus->bean_implements('ACL')) { ACLController::addJavascript($focus->module_dir, '', $focus->isOwner($current_user->id)); } } else { // avoid js error when set_focus is not defined echo '<script>function set_focus(){return;}</script><p class="error">Warning: You do not have permission to access this module.</p>'; } if (!$skipFooters) { echo "<!-- crmprint -->"; echo $jsalerts->getScript(); include 'themes/' . $theme . '/footer.php'; if (!isset($_SESSION['avail_themes'])) { $_SESSION['avail_themes'] = serialize(get_themes()); } if (!isset($_SESSION['avail_languages'])) { $_SESSION['avail_languages'] = serialize(get_languages()); } $user_mod_strings = return_module_language($current_language, 'Users'); echo "<table cellpadding='0' cellspacing='0' width='100%' border='0' class='underFooter'>"; if ($_REQUEST['action'] != 'Login') { //set theme echo "<tr><td align='center'><table border='0'><tr><td width='40%' align='right'>{$user_mod_strings['LBL_THEME']} </td>"; echo "<td width='60%' align='left'><select OnChange='location.href=\"index.php?" . str_replace("&print=true", "", $GLOBALS['request_string']) . "&usertheme=\"+this.value' style='width: 120px; font-size: 10px' name='usertheme'>"; if (isset($_SESSION['authenticated_user_theme']) && !empty($_SESSION['authenticated_user_theme'])) { $authenticated_user_theme = $_SESSION['authenticated_user_theme'];
/** * Called from process(). This method will display the footer on the page. */ function displayFooter() { if (empty($this->responseTime)) { $this->calculateFooterMetrics(); } global $sugar_config; global $app_strings; //decide whether or not to show themepicker, default is to show $showThemePicker = true; if (isset($sugar_config['showThemePicker'])) { $showThemePicker = $sugar_config['showThemePicker']; } echo "<!-- crmprint -->"; $jsalerts = new jsAlerts(); if (!isset($_SESSION['isMobile'])) { echo $jsalerts->getScript(); } $ss = new Sugar_Smarty(); $ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"])); $ss->assign('MOD', return_module_language($GLOBALS['current_language'], 'Users')); if (SugarConfig::getInstance()->get('calculate_response_time', false)) { $ss->assign('STATISTICS', $this->_getStatistics()); } // Under the License referenced above, you are required to leave in all copyright statements in both // the code and end-user application. $copyright = '© 2004-2009 SugarCRM Inc. The Program is provided AS IS, without warranty. Licensed under <a href="LICENSE.txt" target="_blank" class="copyRightLink">GPLv3</a>.<br>This program is free software; you can redistribute it and/or modify it under the terms of the <br><a href="LICENSE.txt" target="_blank" class="copyRightLink"> GNU General Public License version 3</a> as published by the Free Software Foundation including the additional permission set forth in the source code header.<br>'; // The interactive user interfaces in modified source and object code // versions of this program must display Appropriate Legal Notices, as // required under Section 5 of the GNU General Public License version // 3. In accordance with Section 7(b) of the GNU General Public License // version 3, these Appropriate Legal Notices must retain the display // of the "Powered by SugarCRM" logo. If the display of the logo is // not reasonably feasible for technical reasons, the Appropriate // Legal Notices must display the words "Powered by SugarCRM". $attribLinkImg = "<img style='margin-top: 2px' border='0' width='106' height='23' src='include/images/poweredby_sugarcrm.png' alt='Powered By SugarCRM'>\n"; //rrs bug: 20923 - if this image does not exist as per the license, then the proper image will be displaye regardless, so no need //to display an empty image here. if (file_exists('include/images/poweredby_sugarcrm.png')) { $copyright .= $attribLinkImg; } // End Required Image $ss->assign('COPYRIGHT', $copyright); $ss->display(SugarThemeRegistry::current()->getTemplate('footer.tpl')); }