[ PHPXref.com ] [ Generated: Sun Jul 20 20:55:40 2008 ] [ vtiger CRM 4.2.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> phprint.php (source)

   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.php");
  35  require_once ("include/utils.php");
  36  
  37    function insert_charset_header()
  38       {
  39       global $app_strings, $default_charset;
  40       $charset = $default_charset;
  41       
  42       if(isset($app_strings['LBL_CHARSET']))
  43       {
  44               $charset = $app_strings['LBL_CHARSET'];
  45       }
  46       header('Content-Type: text/html; charset='. $charset);
  47       }
  48       
  49  if (!isset($_GET['action']) || !isset($_GET['module'])) {
  50      die("Error: invalid print link");
  51  }
  52  $record = (isset($_GET['record'])) ? $_GET['record'] : "";
  53  //Added activity mode for events or tasks for Back

  54  if($_GET['module'] == 'Activities')
  55  {
  56          $activity_mode = '&activity_mode='.$_REQUEST['activity_mode'];
  57  }
  58  $url = $site_URL . "/index.php?module={$_GET['module']}&action={$_GET['action']}&record=$record$activity_mode";
  59  $lang_crm = (empty($_GET['lang_crm'])) ? $default_language : $_GET['lang_crm'];
  60  $app_strings = return_application_language($lang_crm);
  61  insert_charset_header();
  62  
  63  $fp = @fopen($url . "&PHPSESSID=" . $_GET['jt'], "rb") or die("Error opening $url<br><br>Is your \$site_URL correct in config.php?");
  64  
  65  $get = $page_str = FALSE;
  66  while ($data = fgets($fp, 4096)) {
  67          if (strpos($data, "<meta http-equiv=\"Content-Type") !== FALSE) {
  68              // Found character set to use

  69              $charset = $data;
  70          }
  71          if (strpos($data, $data_print['start_tag']) !== FALSE) {
  72              // Found start tag, begin collecting data

  73              $get = TRUE;
  74          }
  75          if ($get) {
  76              // Collect data into $page_str to be later processed

  77              $page_str .= $data;
  78          }
  79          if (strpos($data, $data_print['stop_tag']) !== FALSE) {
  80              // Found stop tag, stop collecting data

  81              $get = FALSE;
  82          }
  83  }
  84  
  85  fclose($fp);
  86  ?>
  87  <html>
  88  <head>
  89  <?php
  90  if (isset($charset)) {
  91      echo $charset . "\n";
  92  }
  93  else {
  94      echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $data_print['default_charset'] . "\">\n";
  95  }
  96  ?>
  97  <style type="text/css" media="all">
  98  IMG { display: none; }
  99  </style>
 100  </head>
 101  <body>
 102  <a href="<?php echo $url; ?>"><< <?php echo $app_strings['LBL_BACK']; ?></a><br><br>
 103  <?php
 104  echo $page_str;
 105  ?>
 106  <br><br><a href="<?php echo $url; ?>"><< <?php echo $app_strings['LBL_BACK']; ?></a>
 107  </body>
 108  </html>


[ Powered by PHPXref - Served by Debian GNU/Linux ]