[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Users/ -> saveemailtemplate.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  require_once ('include/database/PearDatabase.php');
  12  require_once ('include/utils/utils.php');
  13  
  14  global $log;
  15  $db = new PearDatabase();
  16      $log->debug("the foldername is ".$folderName);
  17  $folderName = $_REQUEST["foldername"];
  18  $templateName = $_REQUEST["templatename"];
  19        $log->debug("the templatename is ".$templateName);
  20  $templateid = $_REQUEST["templateid"];
  21        $log->debug("the templateid is ".$templateid);
  22  $description = $_REQUEST["description"];
  23        $log->debug("the description is ".$description);
  24  $subject = $_REQUEST["subject"];
  25        $log->debug("the subject is ".$subject);  
  26  $body = $_REQUEST["body"];
  27        $log->debug("the body is ".$body);  
  28  if ($body !='')
  29  {
  30      $body = to_html($body);
  31        $log->info("the body value is set ");  
  32  }
  33  if(isset($templateid) && $templateid !='')
  34  {
  35      $log->info("the templateid is set");  
  36      $sql = "update vtiger_emailtemplates set foldername = '".$folderName."', templatename ='".$templateName."', subject ='".$subject."', description ='".$description."', body ='".$body."' where templateid =".$templateid;
  37      $adb->query($sql);
  38   
  39      $log->info("about to invoke the detailviewemailtemplate file");  
  40      header("Location:index.php?module=Users&action=detailviewemailtemplate&parenttab=Settings&templateid=".$templateid);
  41  }
  42  else
  43  {
  44      $templateid = $db->getUniqueID('vtiger_emailtemplates');
  45      $sql = "insert into vtiger_emailtemplates values ('". $folderName. "','".$templateName."','".$subject."','".$description."','".$body."',0,".$templateid.")";
  46      $adb->query($sql);
  47  
  48       $log->info("added to the db the emailtemplate");
  49      header("Location:index.php?module=Users&action=detailviewemailtemplate&parenttab=Settings&templateid=".$templateid);
  50  }
  51  ?>


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