sugarview.php
来自「SugarCRM5.1 开源PHP客户关系管理系统」· PHP 代码 · 共 532 行 · 第 1/2 页
PHP
532 行
echo "<!-- crmprint -->"; $jsalerts = new jsAlerts(); echo $jsalerts->getScript(); if (file_exists('themes/' . $GLOBALS['theme'] . '/footer.php')) include ('themes/' . $GLOBALS['theme'] . '/footer.php'); else include ('themes/default/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($GLOBALS['current_language'], 'Users'); echo "<table cellpadding='0' cellspacing='0' width='100%' border='0' class='underFooter'>"; if ($this->action != 'Login' && $showThemePicker) { //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", "", (!empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_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']; } else { $authenticated_user_theme = $GLOBALS['sugar_config']['default_theme']; } echo get_select_options_with_id(unserialize($_SESSION['avail_themes']), $authenticated_user_theme); echo '</select></td></tr>'; echo '</td></tr></table>'; } echo '<tr><td align="center">'; if (SugarConfig::getInstance()->get('calculate_response_time', false)) { $this->displayStatistics(); } echo "</td></tr>"; // Under the License referenced above, you are required to leave in all copyright statements in both // the code and end-user application. echo "<tr><td align='center' class='copyRight'>"; echo '© 2004-2008 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="body"> 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"; echo $attribLinkImg; // End Required Image echo "</td></tr></table>\n"; echo "</body></html>"; } function displayBody() { } /** * Called from process(). This method will display subpanels. */ function displaySubPanels() { if (isset($this->bean) && !empty($this->bean->id) && (file_exists('modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/Ext/Layoutdefs/layoutdefs.ext.php'))) { $GLOBALS['focus'] = $this->bean; require_once ('include/SubPanel/SubPanelTiles.php'); $subpanel = new SubPanelTiles($this->bean, $this->module); echo $subpanel->display(); } } /** * Called from process(). This method will display the search form on the left of the page. */ function displaySearch() { global $app_list_strings; require_once ('modules/SavedSearch/SavedSearch.php'); $savedSearch = new SavedSearch(); $json = getJSONobj(); $savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect($this->module))); $str = "<script> YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects); </script>"; echo $str; } function buildModuleList() { if (!empty($GLOBALS['current_user']) && empty($GLOBALS['modListHeader'])) $GLOBALS['modListHeader'] = query_module_access_list($GLOBALS['current_user']); } /** * private method used in process() to determine the value of a passed in option * * @param string option - the option that we want to know the valye of * @param bool default - what the default value should be if we do not find the option * * @return bool - the value of the option */ function _getOption($option, $default = false) { if (!empty($this->options) && isset($this->options['show_all'])) { return $this->options['show_all']; } elseif (!empty($this->options) && isset($this->options[$option])) { return $this->options[$option]; } else return $default; } /** * Check for the existence of a Menu.php file * * @param string $module - the module to check. * @return boolean - true if a Menu.php file exists, false otherwise. */ private function _menuExists($module) { if (!file_exists('modules/' . $module . '/Menu.php') && !file_exists('custom/modules/' . $module . 'Ext/Menus/menu.ext.php') && !file_exists('custom/application/Ext/Menus/menu.ext.php')) return false; else return true; } /** * track * Private function to track information about the view request */ private function track() { if (empty($this->responseTime)) { $this->calculateFooterMetrics(); } if (empty($GLOBALS['current_user']->id)) { return; } require_once ('modules/Trackers/TrackerManager.php'); $trackerManager = TrackerManager::getInstance(); $timeStamp = gmdate("Y-m-d H:i:s"); $monitor = $trackerManager->getMonitor('tracker'); $monitor->setValue('action', strtolower($this->action)); $monitor->setValue('user_id', $GLOBALS['current_user']->id); $monitor->setValue('module_name', $this->module); $monitor->setValue('date_modified', $timeStamp); $monitor->setValue('session_id', session_id()); if (isset($this->bean) && isset($this->bean->id)) { $monitor->setValue('item_id', $this->bean->id); $monitor->setValue('item_summary', $this->bean->get_summary_text()); $monitor->setValue('visible', (($monitor->action == 'detailview') || ($monitor->action == 'editview')) ? 1 : 0); }
$trackerManager->save(); } private function calculateFooterMetrics() { $endTime = microtime(true); $deltaTime = $endTime - $GLOBALS['startTime']; $this->responseTime = number_format(round($deltaTime, 2), 2); // Print out the resources used in constructing the page. $included_files = get_included_files(); // take all of the included files and make a list that does not allow for duplicates based on case // I believe the full get_include_files result set appears to have one entry for each file in real // case, and one entry in all lower case. $list_of_files_case_insensitive = array(); foreach($included_files as $key => $name) { // preserve the first capitalization encountered. $list_of_files_case_insensitive[mb_strtolower($name) ] = $name; } $this->fileResources = sizeof($list_of_files_case_insensitive); } private function displayStatistics() { $endTime = microtime(true); $deltaTime = $endTime - $GLOBALS['startTime']; $response_time_string = $GLOBALS['app_strings']['LBL_SERVER_RESPONSE_TIME'] . " " . number_format(round($deltaTime, 2), 2) . " " . $GLOBALS['app_strings']['LBL_SERVER_RESPONSE_TIME_SECONDS']; echo $response_time_string; echo '</td></tr>'; if (!empty($sugar_config['show_page_resources'])) { // Print out the resources used in constructing the page. $included_files = get_included_files(); // take all of the included files and make a list that does not allow for duplicates based on case // I believe the full get_include_files result set appears to have one entry for each file in real // case, and one entry in all lower case. $list_of_files_case_insensitive = array(); foreach($included_files as $key => $name) { // preserve the first capitalization encountered. $list_of_files_case_insensitive[mb_strtolower($name) ] = $name; } echo "<tr><td align=\"center\">" . ($GLOBALS['app_strings']['LBL_SERVER_RESPONSE_RESOURCES'] . '(' . DBManager::getQueryCount() . ',' . sizeof($list_of_files_case_insensitive) . ')<br>') . "</td></tr>"; // Display performance of the internal and external caches.... echo "<tr><td align=\"center\">External cache (hits/total=ratio) local ({$GLOBALS['external_cache_request_local_hits']}/{$GLOBALS['external_cache_request_local_total']}=" . round($GLOBALS['external_cache_request_local_hits']*100/$GLOBALS['external_cache_request_local_total'], 0) . "%)"; if ($GLOBALS['external_cache_request_external_total']) { // Only display out of process cache results if there was at least one attempt to retrieve from the out of process cache (this signifies that it was enabled). echo " external ({$GLOBALS['external_cache_request_external_hits']}/{$GLOBALS['external_cache_request_external_total']}=" . round($GLOBALS['external_cache_request_external_hits']*100/$GLOBALS['external_cache_request_external_total'], 0) . "%)<br>"; } } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?