iTx Technologies offre gratuitement
cet espace pour SugarCRM !

title

Body

[fermer]

/install/ -> license.php (source)

   1  <?php
   2  //if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
   3  /*********************************************************************************
   4   * SugarCRM is a customer relationship management program developed by
   5   * SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
   6   * 
   7   * This program is free software; you can redistribute it and/or modify it under
   8   * the terms of the GNU General Public License version 3 as published by the
   9   * Free Software Foundation with the addition of the following permission added
  10   * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
  11   * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
  12   * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
  13   * 
  14   * This program is distributed in the hope that it will be useful, but WITHOUT
  15   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16   * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  17   * details.
  18   * 
  19   * You should have received a copy of the GNU General Public License along with
  20   * this program; if not, see http://www.gnu.org/licenses or write to the Free
  21   * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22   * 02110-1301 USA.
  23   * 
  24   * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
  25   * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
  26   * 
  27   * The interactive user interfaces in modified source and object code versions
  28   * of this program must display Appropriate Legal Notices, as required under
  29   * Section 5 of the GNU General Public License version 3.
  30   * 
  31   * In accordance with Section 7(b) of the GNU General Public License version 3,
  32   * these Appropriate Legal Notices must retain the display of the "Powered by
  33   * SugarCRM" logo. If the display of the logo is not reasonably feasible for
  34   * technical reasons, the Appropriate Legal Notices must display the words
  35   * "Powered by SugarCRM".
  36   ********************************************************************************/
  37  
  38  
  39  global $sugar_version, $js_custom_version;
  40  if( !isset( $install_script ) || !$install_script ){
  41      die('Unable to process script directly.');
  42  }
  43  
  44  // setup session variables (and their defaults) if this page has not yet been submitted
  45  if(!isset($_SESSION['license_submitted']) || !$_SESSION['license_submitted']){
  46      $_SESSION['setup_license_accept'] = false;
  47  }
  48  
  49  $checked = (isset($_SESSION['setup_license_accept']) && !empty($_SESSION['setup_license_accept'])) ? 'checked="on"' : '';
  50  
  51  require_once ("install/install_utils.php");
  52  $langDropDown = get_select_options_with_id($supportedLanguages, $current_language);
  53  $license_file = getLicenseContents("LICENSE.txt");
  54  
  55  $out =<<<EOQ
  56  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  57  <html>
  58  <head>
  59     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  60     <meta http-equiv="Content-Style-Type" content="text/css">
  61     <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</title>
  62     <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
  63     <link rel="stylesheet" href="install/install.css" type="text/css">
  64     <script src="include/javascript/sugar_grp1_yui.js?s={$sugar_version}&c={$js_custom_version}"></script>
  65     <link rel='stylesheet' type='text/css' href='include/javascript/yui/build/container/assets/container.css' />
  66     <script type="text/javascript" src="install/license.js"></script>
  67  </head>
  68  
  69  <body onload="javascript:toggleNextButton();document.getElementById('defaultFocus').focus();">
  70  <div id='licenseDiv'>
  71  <form action="install.php" method="post" name="setConfig" id="form">
  72  <form action="welcome.php" method="post" name="setLang" id="langForm">
  73    <table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
  74      <tr><td colspan="2" id="help"><a href="{$help_url}" target='_blank'>{$mod_strings['LBL_HELP']} </a></td></tr>
  75      <tr>
  76        <th width="500">
  77          <p><img src="include/images/sugar_md.png" alt="SugarCRM" border="0"></p>
  78        {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</th>
  79        <th width="200" height="30" style="text-align: right;"><a href="http://www.sugarcrm.com" target="_blank">
  80            <IMG src="include/images/sugarcrm_login.png" width="145" height="30" alt="SugarCRM" border="0"></a>
  81        </th>
  82      </tr>
  83      <tr>
  84      <td>
  85          {$mod_strings['LBL_WELCOME_CHOOSE_LANGUAGE']}: <select name="language" onchange='this.form.submit()';>{$langDropDown}</select>
  86        </td>
  87        <td >
  88          &nbsp;
  89        </td>
  90      </tr>
  91      <tr>
  92        <td colspan="2">
  93          <textarea cols="80" rows="20" readonly>{$license_file}</textarea>
  94        </td>
  95      </tr>
  96  
  97      <tr>
  98        <td align=left>
  99          <input type="checkbox" class="checkbox" name="setup_license_accept" id="defaultFocus" onClick='toggleNextButton();' {$checked} />
 100          <a href='javascript:void(0)' onClick='toggleLicenseAccept();toggleNextButton();'>{$mod_strings['LBL_LICENSE_I_ACCEPT']}</a>
 101        </td>
 102        <td align=right>
 103          <input type="button" class="button" name="print_license" value="{$mod_strings['LBL_LICENSE_PRINTABLE']}"
 104              onClick='window.open("install.php?page=licensePrint&language={$current_language}");' />
 105        </td>
 106      </tr>
 107      <tr>
 108        <td align="right" colspan="2">
 109          <hr>
 110          <input type="hidden" name="current_step" value="{$next_step}">
 111          <table cellspacing="0" cellpadding="0" border="0" class="stdTable">
 112            <tr>
 113              <td>
 114                  <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_BACK']}"  onclick="document.getElementById('form').submit();" />
 115                  <input class="acceptButton" type="button" name="goto" value="{$mod_strings['LBL_NEXT']}" id="button_next" disabled="disabled" onclick="callSysCheck();"/>
 116                  <input type="hidden" name="goto" id='hidden_goto' value="{$mod_strings['LBL_BACK']}" />
 117              </td>
 118            </tr>
 119          </table>
 120        </td>
 121      </tr>
 122  
 123    </table>
 124  </form>
 125  </div>
 126  
 127  <script>
 128  var msgPanel;
 129  function callSysCheck(){
 130  
 131              //begin main function that will be called
 132              ajaxCall = function(msg_panel){
 133                  //create success function for callback
 134  
 135                  getPanel = function() {
 136                  var args = {    width:"300px",
 137                                  modal:true,
 138                                  fixedcenter: true,
 139                                  constraintoviewport: false,
 140                                  underlay:"shadow",
 141                                  close:false,
 142                                  draggable:true,
 143  
 144                                  effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:.5}
 145                                 } ;
 146                          msg_panel = new YAHOO.widget.Panel('p_msg', args);
 147                          //If we haven't built our panel using existing markup,
 148                          //we can set its content via script:
 149                          msg_panel.setHeader("{$mod_strings['LBL_LICENSE_CHKENV_HEADER']}");
 150                          msg_panel.setBody(document.getElementById("checkingDiv").innerHTML);
 151                          msg_panel.render(document.body);
 152                          msgPanel = msg_panel;
 153                  }
 154  
 155  
 156                  passed = function(url){
 157                      document.setConfig.goto.value="{$mod_strings['LBL_NEXT']}";
 158                      document.getElementById('hidden_goto').value="{$mod_strings['LBL_NEXT']}";
 159                      document.setConfig.current_step.value="{$next_step}";
 160                      document.setConfig.submit();
 161                      window.focus();
 162                  }
 163                  success = function(o) {
 164                      if (o.responseText.indexOf('passed')>=0){
 165                          if ( YAHOO.util.Selector.query('button', 'p_msg', true) != null )
 166                              YAHOO.util.Selector.query('button', 'p_msg', true).style.display = 'none'; 
 167                          scsbody =  "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
 168                          scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
 169                          scsbody += "<div id='cntDown'>{$mod_strings['LBL_THREE']}</div>";
 170                          scsbody += "</td></tr></table>";
 171                          scsbody += "<script>countdown(3);<\/script>";
 172                          msgPanel.setBody(scsbody);
 173                          msgPanel.render();
 174                          countdown(3);
 175                          window.setTimeout('passed("install.php?goto=next")', 2500);
 176  
 177                      }else{
 178                          //turn off loading message
 179                          msgPanel.hide();
 180                          document.getElementById('sysCheckMsg').style.display = '';
 181                          document.getElementById('licenseDiv').style.display = 'none';
 182                          document.getElementById('sysCheckMsg').innerHTML=o.responseText;
 183                      }
 184  
 185  
 186                  }//end success
 187  
 188                  //set loading message and create url
 189                  postData = "checkInstallSystem=true&to_pdf=1&sugar_body_only=1";
 190  
 191                  //if this is a call already in progress, then just return
 192                      if(typeof ajxProgress != 'undefined'){
 193                          return;
 194                      }
 195  
 196                  getPanel();
 197                  msgPanel.show;
 198                  var ajxProgress = YAHOO.util.Connect.asyncRequest('POST','install.php', {success: success, failure: success}, postData);
 199  
 200  
 201              };//end ajaxCall method
 202                ajaxCall();
 203              return;
 204  }
 205  
 206      function countdown(num){
 207          scsbody =  "<table cellspacing='0' cellpadding='0' border='0' align='center'><tr><td>";
 208          scsbody += "<p>{$mod_strings['LBL_LICENSE_CHECK_PASSED']}</p>";
 209          scsbody += "<div id='cntDown'>{$mod_strings['LBL_LICENSE_REDIRECT']}"+num+"</div>";
 210          scsbody += "</td></tr></table>";
 211          msgPanel.setBody(scsbody);
 212          msgPanel.render();
 213          if(num >0){
 214               num = num-1;
 215               setTimeout("countdown("+num+")",1000);
 216          }
 217      }
 218  
 219  </script>
 220  
 221             <div id="checkingDiv" style="display:none">
 222             <table cellspacing="0" cellpadding="0" border="0">
 223                 <tr><td>
 224                      <p><img src='install/processing.gif'> <br>{$mod_strings['LBL_LICENSE_CHECKING']}</p>
 225                  </td></tr>
 226              </table>
 227              </div>
 228  
 229            <div id='sysCheckMsg'><div>
 230  
 231  
 232  </body>
 233  </html>
 234  EOQ;
 235  
 236  echo $out;
 237  ?>


Generé en: Thu Mar 4 09:44:50 2010 | Cross-referenced par PHPXref 0.7