[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Webmails/ -> CallRelatedList.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 Initial Developer of the Original Code is FOSS Labs.
   6    * Portions created by FOSS Labs are Copyright (C) FOSS Labs.
   7    * Portions created by vtiger are Copyright (C) vtiger.
   8    * All Rights Reserved.
   9    *
  10    ********************************************************************************/
  11  
  12  global $current_user;
  13  require_once ('Smarty_setup.php');
  14  require_once ('modules/Leads/Leads.php');
  15  require_once ('include/utils/utils.php');
  16  require_once ('include/utils/UserInfoUtil.php');
  17  require_once ('data/Tracker.php');
  18  require_once ('include/upload_file.php');
  19  require_once ('include/database/PearDatabase.php');
  20  require_once ('include/utils/utils.php');
  21  require_once ('modules/Webmails/Webmail.php');
  22  require_once ('modules/Webmails/MailParse.php');
  23  
  24  global $log;
  25  global $app_strings;
  26  global $mod_strings;
  27  
  28  if($_REQUEST["record"]) {$mailid=$_REQUEST["record"];} else {$mailid=$_REQUEST["mailid"];}
  29  
  30  $mailInfo = getMailServerInfo($current_user);
  31  $temprow = $adb->fetch_array($mailInfo);
  32  $imapServerAddress=$temprow["mail_servername"];
  33  $start_message=$_REQUEST["start_message"];
  34  $box_refresh=$temprow["box_refresh"];
  35  $mails_per_page=$temprow["mails_per_page"];
  36  
  37  if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
  38  
  39  global $mbox;
  40  $mbox = getImapMbox($mailbox,$temprow);
  41  
  42  
  43  $email = new Webmail($mbox, $mailid);
  44  $from = $email->from;
  45  $subject=$email->subject;
  46  $date=$email->date;
  47  $to=$email->to;
  48  $cc_list=$email->cc_list;
  49  $reply_to=$email->replyTo;
  50  
  51  
  52  $block["Leads"]= "";
  53  global $adb;
  54  if($email->relationship != 0 && $email->relationship["type"] == "Leads") {
  55      $q = "SELECT vtiger_leaddetails.firstname, vtiger_leaddetails.lastname, vtiger_leaddetails.email, vtiger_leaddetails.company, vtiger_crmentity.smownerid from vtiger_leaddetails left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid WHERE vtiger_leaddetails.leadid='".$email->relationship["id"]."'";
  56      $rs = $adb->query($q);
  57      $block["Leads"]["header"]= array("0"=>"First Name","1"=>"Last Name","2"=>"Company Name","3"=>"Email Address","4"=>"Assigned To");
  58      $block["Leads"]["entries"]= array("0"=>array($adb->query_result($rs,0,'firstname'),"1"=>$adb->query_result($rs,0,'lastname'),2=>$adb->query_result($rs,0,'company'),3=>$adb->query_result($rs,0,'email'),4=>$adb->query_result($rs,0,'smownerid')));
  59  }
  60  $block["Contacts"]= "";
  61  if($email->relationship != 0 && $email->relationship["type"] == "Contacts") {
  62      $q = "SELECT vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_contactdetails.email, vtiger_contactdetails.title, vtiger_crmentity.smownerid from vtiger_contactdetails left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid WHERE vtiger_contactdetails.contactid='".$email->relationship["id"]."'";
  63      $rs = $adb->query($q);
  64      $block["Contacts"]["header"]= array("0"=>"First Name","1"=>"Last Name","2"=>"Title","3"=>"Email Address","4"=>"Assigned To");
  65      $block["Contacts"]["entries"]= array("0"=>array($adb->query_result($rs,0,'firstname'),"1"=>$adb->query_result($rs,0,'lastname'),2=>$adb->query_result($rs,0,'title'),3=>$adb->query_result($rs,0,'email'),4=>$adb->query_result($rs,0,'smownerid')));
  66  }
  67  $block["Accounts"]= "";
  68  if($email->relationship != 0 && $email->relationship["type"] == "Accounts") {
  69      $q = "SELECT acccount.accountname, vtiger_account.email1, vtiger_account.website, vtiger_account.industry, vtiger_crmentity.smownerid from vtiger_account left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid WHERE vtiger_account.accountid='".$email->relationship["id"]."'";
  70      $rs = $adb->query($q);
  71      $block["Accounts"]["header"]= array("0"=>"Account Name","1"=>"Email","2"=>"Web Site","3"=>"Industry","4"=>"Assigned To");
  72      $block["Accounts"]["entries"]= array("0"=>array($adb->query_result($rs,0,'accountname'),"1"=>$adb->query_result($rs,0,'email'),2=>$adb->query_result($rs,0,'website'),3=>$adb->query_result($rs,0,'industry'),4=>$adb->query_result($rs,0,'smownerid')));
  73  }
  74  
  75  global $mod_strings;
  76  global $app_strings;
  77  global $theme;
  78  $theme_path="themes/".$theme."/";
  79  $image_path=$theme_path."images/";
  80  require_once ($theme_path.'layout_utils.php');
  81  
  82  $smarty = new vtigerCRM_Smarty;
  83  $smarty->assign("CATEGORY","My Home Page");
  84  $smarty->assign("id",$_REQUEST["record"]);
  85  $smarty->assign("NAME","From: ".$from);
  86  $smarty->assign("RELATEDLISTS", $block);
  87  $smarty->assign("SINGLE_MOD","Webmails");
  88  $smarty->assign("REDIR_MOD","Webmails");
  89  $smarty->assign("MODULE", "Webmails");
  90  $smarty->assign("ID",$_REQUEST["record"] );
  91  $smarty->assign("MOD",$mod_strings);
  92  $smarty->assign("APP",$app_strings);
  93  $smarty->assign("THEME", $theme);
  94  $smarty->assign("IMAGE_PATH", $image_path);
  95  
  96  $check_button = Button_Check($module);
  97  $smarty->assign("CHECK", $check_button);
  98  $smarty->display("RelatedLists.tpl");
  99  ?>


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