[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Potentials/ -> Save.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/modules/Potentials/Save.php,v 1.6 2005/03/15 10:02:12 shaw Exp $
  17   * Description:  TODO: To be written.
  18   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
  19   * All Rights Reserved.
  20   * Contributor(s): ______________________________________..
  21   ********************************************************************************/
  22  
  23  require_once ('modules/Potentials/Potentials.php');
  24  require_once ('include/logging.php');
  25  require_once ('include/database/PearDatabase.php');
  26  
  27  $local_log =& LoggerManager::getLogger('index');
  28  
  29  $focus = new Potentials();
  30  global $current_user;
  31  $currencyid=fetchCurrency($current_user->id);
  32  $rate_symbol = getCurrencySymbolandCRate($currencyid);
  33  $rate = $rate_symbol['rate'];
  34  $curr_symbol= $rate_symbol['symbol'];
  35  
  36  setObjectValuesFromRequest(&$focus);
  37  
  38  if(isset($_REQUEST['amount']))
  39  {
  40      $value = convertToDollar($_REQUEST['amount'],$rate);
  41      $focus->column_fields['amount'] = $value;
  42  }
  43  
  44  $focus->save("Potentials");
  45  $return_id = $focus->id;
  46  
  47  if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
  48  if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = $_REQUEST['return_module'];
  49  else $return_module = "Potentials";
  50  if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = $_REQUEST['return_action'];
  51  else $return_action = "DetailView";
  52  if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id'];
  53  
  54  $local_log->debug("Saved record with id of ".$return_id);
  55  
  56  //code added for returning back to the current view after edit from list view
  57  if($_REQUEST['return_viewname'] == '') $return_viewname='0';
  58  if($_REQUEST['return_viewname'] != '')$return_viewname=$_REQUEST['return_viewname'];
  59  
  60  //Added to send mail to the vtiger_potential-owner about the Potential
  61  $status = sendNotificationToOwner('Potentials',&$focus);
  62  
  63  header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&viewname=$return_viewname");
  64  
  65  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7