[Vtigercrm-commits] [vtiger-commits] r9828 - in /vtigercrm/branches/5.0.3: Smarty/templates/Webmails.tpl modules/Webmails/Webmail.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Nov 13 10:24:45 EST 2006
Author: richie
Date: Mon Nov 13 08:24:22 2006
New Revision: 9828
Log:
Formatted
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl
vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php
Modified: vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl
==============================================================================
--- vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl (original)
+++ vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl Mon Nov 13 08:24:22 2006
@@ -12,178 +12,208 @@
<!-- USER SETTINGS PAGE STARTS HERE -->
{include file='Buttons_List1.tpl'}
<table width="100%" border="0" cellpadding="0" cellspacing="0" height="100%">
- <tr>
- <td class="showPanelBg" valign="top" width="95%" style="padding-left:20px; ">
- </td>
- <td width="5%" class="showPanelBg"> </td>
- </tr>
- <tr>
- <td width="95%" style="padding-left:20px;" valign="top">
- <!-- module Select Table -->
+ <tr>
+ <td class="showPanelBg" valign="top" width="95%" style="padding-left:20px; "> </td>
+ <td width="5%" class="showPanelBg"> </td>
+ </tr>
+ <tr>
+ <td width="95%" style="padding-left:20px;" valign="top">
+ <!-- module Select Table -->
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="7" height="6" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}top_left.jpg" align="top" /></td>
+ <td bgcolor="#EBEBEB" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;height:6px;"></td>
+ <td width="8" height="6" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}top_right.jpg" width="8" height="6" align="top" /></td>
+ </tr>
+ <tr>
+ <td bgcolor="#EBEBEB" width="7"></td>
+ <td bgcolor="#ECECEC" style="padding-left:10px;height:20px;vertical-align:middle;">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="3" style="padding:10px;vertical-align:middle;">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td width="10%">
+ <img src="{$IMAGE_PATH}check_mail.gif" align="absmiddle" />
+ <a href="javascript:;" class="webMnu" onclick="check_for_new_mail('{$MAILBOX}');" >{$MOD.LBL_CHK_MAIL}</a>
+ </td>
+ <td width="10%">
+ <img src="{$IMAGE_PATH}compose.gif" align="absmiddle" />
+ <a href="javascript:;" onclick="OpenCompose('','create');" class="webMnu">{$MOD.LBL_COMPOSE}</a>
+ </td>
+ <td width="10%">
+ <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
+ <a href="index.php?module=Settings&action=AddMailAccount&record={$USERID}" class="webMnu">{$MOD.LBL_SETTINGS}</a>
+ </td>
+ <td width="12%">
+ <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
+ <a href="javascript:;" onclick="show_hidden();" class="webMnu">{$MOD.LBL_SHOW_HIDDEN}</a>
+ </td>
+ <td width="18%">
+ <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
+ <a href="javascript:;" onclick="runEmailCommand('expunge','0');" class="webMnu">{$MOD.LBL_EXPUNGE_MAILBOX}</a>
+ </td>
+ <td><img src="{$IMAGE_PATH}webmail_header.gif" align="right"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" bgcolor="#949494" style="overflow:auto"><span class="subHdr"><b>{$MOD.LBL_EMAIL_FOLDERS}</b></span> </td>
+ <td width="2%"> </td>
+ <td width="60%" class="subHdr"><span style="float:left"><strong>{$ACCOUNT} > {$MAILBOX} </strong></span> <span style="float:right">{$NAVIGATION}</span></td>
+ </tr>
+ <tr>
+ <td rowspan="6" valign="top" bgcolor="#FFFFFF" style="padding:10px; ">
+ <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <span onmouseover="show_addfolder();" onmouseout="show_addfolder();" style="cursor:pointer;"><b class="txtGreen">{$MOD.LBL_MY_MAILS}</b> <span id="folderOpts" style="position:absolute;display:none">Add Folder[X]</span></span>
+
+ <ul style="list-style-type:none;">
+
+ {foreach item=row from=$BOXLIST}
+ {foreach item=row_values from=$row}
+ {$row_values}
+ {/foreach}
+ {/foreach}
+ </ul><br />
+
+ <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <b class="txtGreen">{$MOD.LBL_SENT_MAILS}</b>
+ <ul style="list-style-type:none;">
+ <li>
+ <img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
+ <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_LEADS}</a> <b></b>
+ </li>
+ <li>
+ <img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
+ <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_ACCOUNTS}</a> <b></b>
+ </li>
+ <li>
+ <img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
+ <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_CONTACTS}</a>
+ </li>
+ </ul><br />
+ <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <b class="txtGreen">{$MOD.LBL_TRASH}</b>
+ <ul style="list-style-type:none;">
+ <li>
+ <img src="{$IMAGE_PATH}webmail_trash.gif" align="absmiddle" />
+ <a href="#" class="webMnu">{$MOD.LBL_JUNK_MAILS}</a> <b></b>
+ </li>
+ </ul>
+
+ </td>
+ <td> </td>
+ <td class="delBg">
+
+ <!-- Table to display Delete, Move To and Search buttons and options - Starts -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="7" height="6" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}top_left.jpg" align="top" /></td>
- <td bgcolor="#EBEBEB" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;height:6px;"></td>
- <td width="8" height="6" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}top_right.jpg" width="8" height="6" align="top" /></td>
- </tr>
- <tr>
- <td bgcolor="#EBEBEB" width="7"></td>
- <td bgcolor="#ECECEC" style="padding-left:10px;height:20px;vertical-align:middle;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="3" style="padding:10px;vertical-align:middle;">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td width="10%">
- <img src="{$IMAGE_PATH}check_mail.gif" align="absmiddle" />
- <a href="javascript:;" class="webMnu" onclick="check_for_new_mail('{$MAILBOX}');" >{$MOD.LBL_CHK_MAIL}</a>
- </td>
- <td width="10%">
- <img src="{$IMAGE_PATH}compose.gif" align="absmiddle" />
- <a href="javascript:;" onclick="OpenCompose('','create');" class="webMnu">{$MOD.LBL_COMPOSE}</a>
- </td>
- <td width="10%">
- <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
- <a href="index.php?module=Settings&action=AddMailAccount&record={$USERID}" class="webMnu">{$MOD.LBL_SETTINGS}</a>
- </td>
- <td width="12%">
- <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
- <a href="javascript:;" onclick="show_hidden();" class="webMnu">{$MOD.LBL_SHOW_HIDDEN}</a>
- </td>
- <td width="18%">
- <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
- <a href="javascript:;" onclick="runEmailCommand('expunge','0');" class="webMnu">{$MOD.LBL_EXPUNGE_MAILBOX}</a>
- </td>
- <td><img src="{$IMAGE_PATH}webmail_header.gif" align="right"/></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td width="22%" bgcolor="#949494" style="overflow:auto"><span class="subHdr"><b>{$MOD.LBL_EMAIL_FOLDERS}</b></span> </td>
- <td width="2%"> </td>
- <td width="60%" class="subHdr"><span style="float:left"><strong>{$ACCOUNT} > {$MAILBOX} </strong></span> <span style="float:right">{$NAVIGATION}</span></td>
- </tr>
- <tr>
- <td rowspan="6" valign="top" bgcolor="#FFFFFF" style="padding:10px; ">
- <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <span onmouseover="show_addfolder();" onmouseout="show_addfolder();" style="cursor:pointer;"><b class="txtGreen">{$MOD.LBL_MY_MAILS}</b> <span id="folderOpts" style="position:absolute;display:none">Add Folder[X]</span></span>
-
- <ul style="list-style-type:none;">
-
- {foreach item=row from=$BOXLIST}
- {foreach item=row_values from=$row}
- {$row_values}
- {/foreach}
- {/foreach}
- </ul><br />
-
- <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <b class="txtGreen">{$MOD.LBL_SENT_MAILS}</b>
- <ul style="list-style-type:none;">
- <li><img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
- <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_LEADS}</a> <b></b>
- </li>
- <li><img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
- <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_ACCOUNTS}</a> <b></b>
- </li>
- <li><img src="{$IMAGE_PATH}webmail_uparrow.gif" align="absmiddle" />
- <a href="index.php?module=Emails&action=ListView" class="webMnu">{$MOD.LBL_TO_CONTACTS}</a>
- </li>
- </ul><br />
- <img src="{$IMAGE_PATH}webmail_root.gif" align="absmiddle" /> <b class="txtGreen">{$MOD.LBL_TRASH}</b>
- <ul style="list-style-type:none;">
- <li><img src="{$IMAGE_PATH}webmail_trash.gif" align="absmiddle" />
- <a href="#" class="webMnu">{$MOD.LBL_JUNK_MAILS}</a> <b></b>
- </li>
- </ul>
-
- </td>
- <td> </td>
- <td class="delBg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="45%">
- <input type="button" name="mass_del" value=" {$MOD.LBL_DELETE} " class="crmbutton small delete" onclick="mass_delete();"/>
- <input type="button" name="Button2" value=" {$MOD.LBL_MOVE_TO} " class="crmbutton small edit" onclick="move_messages();"/> {$FOLDER_SELECT}
- </td>
- {if $DEGRADED_SERVICE eq 'false'}
- <td width="75%" align="right">
- <font color="#000000">{$APP.LBL_SEARCH}</font> <input type="text" name="srch" class="importBox" id="search_input"/>
- <select name="optionSel" class="importBox" id="search_type"><option selected value="SUBJECT">in Subject</option><option value="BODY">in Body</option><option value="TO">in To:</option><option value="CC">in CC:</option><option value="BCC">in BCC:</option><option value="FROM">in From:</option></select>
- <input type="button" name="find" value=" {$APP.LBL_FIND_BUTTON} " class="crmbutton small create" onclick="search_emails();" />
- </td>
- {/if}
- </tr>
- </table></td>
- </tr>
- <tr>
- <td> </td>
- <td style="padding:1px;" align="left">
+ <tr>
+ <td width="45%">
+ <input type="button" name="mass_del" value=" {$MOD.LBL_DELETE} " class="crmbutton small delete" onclick="mass_delete();"/>
+ <input type="button" name="Button2" value=" {$MOD.LBL_MOVE_TO} " class="crmbutton small edit" onclick="move_messages();"/> {$FOLDER_SELECT}
+ </td>
+ {if $DEGRADED_SERVICE eq 'false'}
+ <td width="50%" align="right" nowrap>
+ <font color="#000000">{$APP.LBL_SEARCH}</font>
+ <input type="text" name="srch" class="importBox" id="search_input"/>
+ <select name="optionSel" class="importBox" id="search_type">
+ <option selected value="SUBJECT">in Subject</option>
+ <option value="BODY">in Body</option>
+ <option value="TO">in To:</option>
+ <option value="CC">in CC:</option>
+ <option value="BCC">in BCC:</option>
+ <option value="FROM">in From:</option>
+ </select>
+ </td>
+ <td width="5%">
+ <input type="button" name="find" value=" {$APP.LBL_FIND_BUTTON} " class="crmbutton small create" onclick="search_emails();" />
+ </td>
+ {/if}
+ </tr>
+ </table>
+ <!-- Table to display Delete, Move To and Search buttons and options - Ends -->
+
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td style="padding:1px;" align="left">
<div id="rssScroll">
- <table class="rssTable" cellspacing="0" cellpadding="0" border="0" width="100%" id="message_table">
- <tr>
- <th><input type="checkbox" name="checkbox" value="checkbox" onclick="select_all();"/></th>
- {foreach item=element from=$LISTHEADER}
- {$element}
- {/foreach}
- </tr>
- {foreach item=row from=$LISTENTITY}
- {foreach item=row_values from=$row}
- {$row_values}
- {/foreach}
- {/foreach}
- </table>
- </div>
- </td>
- </tr>
- <tr>
- <td></td>
- <td height="5"></td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr style="visibility:hidden" class="previewWindow">
- <td> </td>
- <td class="forwardBg">
+
+ <!-- Table to display the mails list - Starts -->
+ <table class="rssTable" cellspacing="0" cellpadding="0" border="0" width="100%" id="message_table">
+ <tr>
+ <th><input type="checkbox" name="checkbox" value="checkbox" onclick="select_all();"/></th>
+ {foreach item=element from=$LISTHEADER}
+ {$element}
+ {/foreach}
+ </tr>
+ {foreach item=row from=$LISTENTITY}
+ {foreach item=row_values from=$row}
+ {$row_values}
+ {/foreach}
+ {/foreach}
+ </table>
+ <!-- Table to display the mails list - Ends -->
+
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr style="visibility:hidden" class="previewWindow">
+ <td> </td>
+ <td class="forwardBg">
+
+ <!-- Table to display the Qualify, Reply, Forward, etc buttons - Starts -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
+ <tr>
<td width="75%">
- <span id="qualify_button"><input type="button" name="Qualify2" value=" {$MOD.LBL_QUALIFY_BUTTON} " class="crmbutton small create" /></span>
- <span id="reply_button"><input type="button" name="reply" value=" {$MOD.LBL_REPLY_TO_SENDER} " class="crmbutton small edit" /></span>
- <span id="reply_button_all"><input type="button" name="reply" value=" {$MOD.LBL_REPLY_ALL} " class="crmbutton small edit" /></span>
- <span id="forward_button"><input type="button" name="forward" value=" {$MOD.LBL_FORWARD_BUTTON} " class="crmbutton small edit" /></span>
- <span id="download_attach_button"><input type="button" name="download" value=" {$MOD.LBL_DOWNLOAD_ATTCH_BUTTON} " class="crmbutton small save" /></span>
+ <span id="qualify_button"><input type="button" name="Qualify2" value=" {$MOD.LBL_QUALIFY_BUTTON} " class="crmbutton small create" /></span>
+ <span id="reply_button"><input type="button" name="reply" value=" {$MOD.LBL_REPLY_TO_SENDER} " class="crmbutton small edit" /></span>
+ <span id="reply_button_all"><input type="button" name="reply" value=" {$MOD.LBL_REPLY_ALL} " class="crmbutton small edit" /></span>
+ <span id="forward_button"><input type="button" name="forward" value=" {$MOD.LBL_FORWARD_BUTTON} " class="crmbutton small edit" /></span>
+ <span id="download_attach_button"><input type="button" name="download" value=" {$MOD.LBL_DOWNLOAD_ATTCH_BUTTON} " class="crmbutton small save" /></span>
</td>
<td width="25%" align="right"><span id="delete_button"><input type="button" name="Button" value=" {$APP.LBL_DELETE_BUTTON} " class="crmbutton small delete" /></span></td>
- </tr>
+ </tr>
</table>
- </td>
- </tr>
- <tr style="visibility:hidden" class="previewWindow">
- <td> </td>
- <td height="300" bgcolor="#FFFFFF" valign="top" style="padding-top:10px;">
+ <!-- Table to display the Qualify, Reply, Forward, etc buttons - Ends -->
+
+ </td>
+ </tr>
+ <tr style="visibility:hidden" class="previewWindow">
+ <td> </td>
+ <td height="300" bgcolor="#FFFFFF" valign="top" style="padding-top:10px;">
+
+ <!-- Table to display the Header details (From, To, Subject and date) - Starts -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="20%" align="right"><b>{$MOD.LBL_FROM}</b></td><td id="from_addy"> </td></tr>
<tr><td width="20%" align="right"><b>{$MOD.LBL_TO}</b></td><td id="to_addy"> </td></tr>
<tr><td align="right"><b>{$MOD.LBL_SUBJECT}</b></td><td id="webmail_subject"></td></tr>
<tr><td align="right"><b>{$MOD.LBL_DATE}</b></td><td id="webmail_date"></td>
- <td id="full_view"><a href="javascript:;">Full Window View</a></td></tr>
+ <td id="full_view"><a href="javascript:;"> Full Email View</a></td></tr>
<tr><td align="right" style="border-bottom:1px solid #666666;" colspan="3"> </td></tr>
</table>
- <span id="body_area" style="width:95%"> </span></td>
- </tr>
- </table>
- </td>
- <td bgcolor="#EBEBEB" width="8"></td>
- </tr>
- <tr>
- <td width="7" height="8" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}bottom_left.jpg" align="bottom" /></td>
- <td bgcolor="#ECECEC" height="8" style="font-size:1px;" ></td>
- <td width="8" height="8" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}bottom_right.jpg" align="bottom" /></td>
- </tr>
- </table><br />
- </td>
- <td> </td>
- </tr>
+ <!-- Table to display the Header details (From, To, Subject and date) - Ends -->
+
+ <span id="body_area" style="width:95%"> </span></td>
+ </tr>
+ </table>
+ </td>
+ <td bgcolor="#EBEBEB" width="8"></td>
+ </tr>
+ <tr>
+ <td width="7" height="8" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}bottom_left.jpg" align="bottom" /></td>
+ <td bgcolor="#ECECEC" height="8" style="font-size:1px;" ></td>
+ <td width="8" height="8" style="font-size:1px;font-family:Arial, Helvetica, sans-serif;"><img src="{$IMAGE_PATH}bottom_right.jpg" align="bottom" /></td>
+ </tr>
+ </table>
+ <br />
+ </td>
+ <td> </td>
+ </tr>
</table>
+
<script>
function OpenCompose(id,mode)
{ldelim}
Modified: vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php Mon Nov 13 08:24:22 2006
@@ -1,4 +1,4 @@
-<?php
+<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
@@ -10,36 +10,36 @@
********************************************************************************/
-include_once('config.php');
-require_once('include/logging.php');
-require_once('include/database/PearDatabase.php');
-require_once('data/SugarBean.php');
-require_once('data/CRMEntity.php');
-
-class Webmail extends CRMEntity {
- var $log;
- var $db;
+include_once('config.php');
+require_once('include/logging.php');
+require_once('include/database/PearDatabase.php');
+require_once('data/SugarBean.php');
+require_once('data/CRMEntity.php');
+
+class Webmail extends CRMEntity {
+ var $log;
+ var $db;
var $headers;
- var $mailid;
- var $to = array();
- var $to_name = array();
- var $from;
- var $fromname;
- var $fromaddr;
- var $reply_to = array();
- var $reply_to_name = array();
- var $cc_list = array();
- var $cc_list_name = array();
- var $subject;
- var $date;
- var $body_type;
- var $body;
- var $attachments = array();
- var $inline = array();
- var $mbox;
- var $email;
- var $relationship = array();
+ var $mailid;
+ var $to = array();
+ var $to_name = array();
+ var $from;
+ var $fromname;
+ var $fromaddr;
+ var $reply_to = array();
+ var $reply_to_name = array();
+ var $cc_list = array();
+ var $cc_list_name = array();
+ var $subject;
+ var $date;
+ var $body_type;
+ var $body;
+ var $attachments = array();
+ var $inline = array();
+ var $mbox;
+ var $email;
+ var $relationship = array();
var $has_attachments = false;
@@ -197,20 +197,20 @@
$res = $this->db->query($sql,true,"Error: "."<BR>$query");
$numRows = $this->db->num_rows($res);
if($numRows > 0)
- return array('type'=>"Leads",'id'=>$this->db->query_result($res,0,"leadid"),'name'=>$this->db->query_result($res,0,"firstname")." ".$this->db->query_result($res,0,"lastname"));
-
- // contacts search
- $sql = "SELECT * from vtiger_contactdetails left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid where vtiger_contactdetails.email = '".trim($this->from)."' AND vtiger_crmentity.deleted='0'";
- $res = $this->db->query($sql,true,"Error: "."<BR>$query");
+ return array('type'=>"Leads",'id'=>$this->db->query_result($res,0,"leadid"),'name'=>$this->db->query_result($res,0,"firstname")." ".$this->db->query_result($res,0,"lastname"));
+
+ // contacts search
+ $sql = "SELECT * from vtiger_contactdetails left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid where vtiger_contactdetails.email = '".trim($this->from)."' AND vtiger_crmentity.deleted='0'";
+ $res = $this->db->query($sql,true,"Error: "."<BR>$query");
$numRows = $this->db->num_rows($res);
if($numRows > 0)
return array('type'=>"Contacts",'id'=>$this->db->query_result($res,0,"contactid"),'name'=>$this->db->query_result($res,0,"firstname")." ".$this->db->query_result($res,0,"lastname"));
- // vtiger_accounts search
- $sql = "SELECT * from vtiger_account left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_account.email1 = '".trim($this->from)."' OR vtiger_account.email1='".trim($this->from)."' AND vtiger_crmentity.deleted='0'";
- $res = $this->db->query($sql,true,"Error: "."<BR>$query");
- $numRows = $this->db->num_rows($res);
- if($numRows > 0)
+ // vtiger_accounts search
+ $sql = "SELECT * from vtiger_account left join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_account.accountid where vtiger_account.email1 = '".trim($this->from)."' OR vtiger_account.email1='".trim($this->from)."' AND vtiger_crmentity.deleted='0'";
+ $res = $this->db->query($sql,true,"Error: "."<BR>$query");
+ $numRows = $this->db->num_rows($res);
+ if($numRows > 0)
return array('type'=>"Accounts",'id'=>$this->db->query_result($res,0,"accountid"),'name'=>$this->db->query_result($res,0,"accountname"));
return 0;
@@ -230,25 +230,25 @@
$endwhile = false;
- while (!$endwhile) {
- if (!$parts[$i]) {
- if (count($stack) > 0) {
- $parts = $stack[count($stack)-1]["p"];
- $i = $stack[count($stack)-1]["i"] + 1;
- array_pop($stack);
- } else {
- $endwhile = true;
- }
- }
- if (!$endwhile) {
-
- $partstring = "";
- foreach ($stack as $s) {
- $partstring .= ($s["i"]+1) . ".";
- }
- $partstring .= ($i+1);
-
- if (strtoupper($parts[$i]->disposition) == "INLINE")
+ while (!$endwhile) {
+ if (!$parts[$i]) {
+ if (count($stack) > 0) {
+ $parts = $stack[count($stack)-1]["p"];
+ $i = $stack[count($stack)-1]["i"] + 1;
+ array_pop($stack);
+ } else {
+ $endwhile = true;
+ }
+ }
+ if (!$endwhile) {
+
+ $partstring = "";
+ foreach ($stack as $s) {
+ $partstring .= ($s["i"]+1) . ".";
+ }
+ $partstring .= ($i+1);
+
+ if (strtoupper($parts[$i]->disposition) == "INLINE")
$inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>imap_fetchbody($this->mbox, $this->mailid, $partstring),"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes);
}
if ($parts[$i]->parts) {
@@ -259,9 +259,9 @@
$i++;
}
}
- }
- return $inline;
- }
+ }
+ return $inline;
+ }
private function dl_attachments() {
$struct = imap_fetchstructure($this->mbox, $this->mailid);
@@ -345,7 +345,7 @@
$replace = array("","","","=","<a target='_blank' ","");
if (!$endwhile) {
- $partstring = "";
+ $partstring = "";
foreach ($stack as $s) {
$partstring .= ($s["i"]+1) . ".";
}
More information about the vtigercrm-commits
mailing list