[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 <?php 2 /********************************************************************************* 3 * The contents of this file are subject to the SugarCRM Public License Version 1.1.2 4 * ("License"); You may not use this file except in compliance with the 5 * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL 6 * Software distributed under the License is distributed on an "AS IS" basis, 7 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 8 * the specific language governing rights and limitations under the License. 9 * The Original Code is: SugarCRM Open Source 10 * The Initial Developer of the Original Code is SugarCRM, Inc. 11 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.; 12 * All Rights Reserved. 13 * Contributor(s): ______________________________________. 14 ********************************************************************************/ 15 /********************************************************************************* 16 * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/phprint.php,v 1.5 2005/03/14 07:50:04 samk Exp $ 17 * Description: Main file and starting point for the application. Calls the 18 * theme header and footer files defined for the user as well as the module as 19 * defined by the input parameters. 20 ********************************************************************************/ 21 22 if (substr(phpversion(), 0, 1) == "5") { 23 ini_set("zend.ze1_compatibility_mode", "1"); 24 } 25 26 if (ini_get("allow_url_fopen") != 1) { 27 die("You must have the allow_url_fopen directive in your php.ini file enabled"); 28 } 29 30 $data_print['start_tag'] = "<!-- startscrmprint -->"; 31 $data_print['stop_tag'] = "<!-- stopscrmprint -->"; 32 $data_print['default_charset'] = "utf-8"; 33 34 require_once ("config.inc.php"); 35 require_once ("include/utils/utils.php"); 36 37 /** Function to set, character set in the header, as given in include/language/*_lang.php 38 */ 39 function insert_charset_header() 40 { 41 global $app_strings, $default_charset; 42 $charset = $default_charset; 43 44 if(isset($app_strings['LBL_CHARSET'])) 45 { 46 $charset = $app_strings['LBL_CHARSET']; 47 } 48 header('Content-Type: text/html; charset='. $charset); 49 } 50 51 if (!isset($_GET['action']) || !isset($_GET['module'])) { 52 die("Error: invalid print link"); 53 } 54 $record = (isset($_GET['record'])) ? $_GET['record'] : ""; 55 //Added activity mode for events or tasks for Back 56 if($_GET['module'] == 'Activities') 57 { 58 $activity_mode = '&activity_mode='.$_REQUEST['activity_mode']; 59 } 60 $url = $site_URL . "/index.php?module={$_GET['module']}&action={$_GET['action']}&record=$record$activity_mode"; 61 $lang_crm = (empty($_GET['lang_crm'])) ? $default_language : $_GET['lang_crm']; 62 $app_strings = return_application_language($lang_crm); 63 insert_charset_header(); 64 65 $fp = @fopen($url . "&PHPSESSID=" . $_GET['jt'], "rb") or die("Error opening $url<br><br>Is your \$site_URL correct in config.php?"); 66 67 $get = $page_str = FALSE; 68 while ($data = fgets($fp, 4096)) { 69 if (strpos($data, "<meta http-equiv=\"Content-Type") !== FALSE) { 70 // Found character set to use 71 $charset = $data; 72 } 73 if (strpos($data, $data_print['start_tag']) !== FALSE) { 74 // Found start tag, begin collecting data 75 $get = TRUE; 76 } 77 if ($get) { 78 // Collect data into $page_str to be later processed 79 $page_str .= $data; 80 } 81 if (strpos($data, $data_print['stop_tag']) !== FALSE) { 82 // Found stop tag, stop collecting data 83 $get = FALSE; 84 } 85 } 86 87 fclose($fp); 88 ?> 89 <html> 90 <head> 91 <?php 92 if (isset($charset)) { 93 echo $charset . "\n"; 94 } 95 else { 96 echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $data_print['default_charset'] . "\">\n"; 97 } 98 ?> 99 <style type="text/css" media="all"> 100 IMG { display: none; } 101 .bodySmall{display: none;} 102 input{ display:none; } 103 </style> 104 </head> 105 <body> 106 <!--a href="<?php echo $url; ?>"><< <?php echo $app_strings['LBL_BACK']; ?></a><br><br--> 107 <?php 108 echo $page_str; 109 ?> 110 <br><br><!--a href="<?php echo $url; ?>"><< <?php echo $app_strings['LBL_BACK']; ?></a--> 111 </body> 112 </html>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |