[Vtigercrm-commits] [vtiger-commits] r9859 - in /vtigercrm/branches/5.0.3: Smarty/templates/Webmails.tpl modules/Webmails/ListView.php modules/Webmails/Webmail.php modules/Webmails/webmails.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Nov 18 06:00:53 EST 2006
Author: richie
Date: Sat Nov 18 04:00:45 2006
New Revision: 9859
Log:
* Modified to fix the description display
Modified:
vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl
vtigercrm/branches/5.0.3/modules/Webmails/ListView.php
vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php
vtigercrm/branches/5.0.3/modules/Webmails/webmails.js
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 Sat Nov 18 04:00:45 2006
@@ -158,7 +158,7 @@
</td>
</tr>
<tr>
- <td> </td>
+ <td colspan="2"> </td>
</tr>
<tr style="visibility:hidden" class="previewWindow">
<td> </td>
@@ -167,7 +167,7 @@
<!-- Table to display the Qualify, Reply, Forward, etc buttons - Starts -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
- <td width="75%">
+ <td width="75%" nowrap>
<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>
@@ -196,7 +196,10 @@
</table>
<!-- Table to display the Header details (From, To, Subject and date) - Ends -->
- <span id="body_area" style="width:95%"> </span></td>
+ <span id="body_area" style="width:95%">
+ <iframe id="email_description" width="100%" height="210" frameBorder="0"></iframe>
+ </span>
+ </td>
</tr>
</table>
</td>
Modified: vtigercrm/branches/5.0.3/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/ListView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/ListView.php Sat Nov 18 04:00:45 2006
@@ -87,34 +87,47 @@
if($_POST["command"] == "check_mbox") {
$adb->println("Inside check_mbox AJAX command");
- $search = imap_search($MailBox->mbox, "ALL NEW");
+ $criteria = 'ALL NEW';
+ $search = imap_search($MailBox->mbox, $criteria);
if($search === false) {echo "failed";flush();exit();}
+ $adb->println("imap_search($MailBox->mbox, $criteria) ===> ");
+ $adb->println($search);
+
$data = imap_fetch_overview($MailBox->mbox,implode(',',$search));
$num=sizeof($data);
+
+ $adb->println("fetched data using imap_fetch_overview ==>");
+ $adb->println($data);
$ret = '';
if($num > 0) {
$ret = '{"mails":[';
- for($i=0;$i<$num;$i++) {
- $ret .= '{"mail":';
- $ret .= '{';
- $ret .= '"mailid":"'.$data[$i]->msgno.'",';
- $ret .= '"subject":"'.substr($data[$i]->subject,0,40).'",';
- $ret .= '"date":"'.substr($data[$i]->date,0,30).'",';
- $ret .= '"from":"'.substr($data[$i]->from,0,20).'",';
- $ret .= '"to":"'.$data[$i]->to.'",';
- $email = new Webmail($MailBox->mbox,$data[$i]->msgno);
- if($email->has_attachments)
- $ret .= '"attachments":"1"}';
- else
- $ret .= '"attachments":"0"}';
- if(($i+1) == $num)
- $ret .= '}';
- else
- $ret .= '},';
+ for($i=0;$i<$num;$i++)
+ {
+ //Added condition to avoid show the deleted mails and readed mails
+ if($data[$i]->deleted == 0)// && $data[$i]->seen == 0)
+ {
+ $ret .= '{"mail":';
+ $ret .= '{';
+ $ret .= '"mailid":"'.$data[$i]->msgno.'",';
+ $ret .= '"subject":"'.substr($data[$i]->subject,0,40).'",';
+ $ret .= '"date":"'.substr($data[$i]->date,0,30).'",';
+ $ret .= '"from":"'.substr($data[$i]->from,0,20).'",';
+ $ret .= '"to":"'.$data[$i]->to.'",';
+ $email = new Webmail($MailBox->mbox,$data[$i]->msgno);
+ if($email->has_attachments)
+ $ret .= '"attachments":"1"}';
+ else
+ $ret .= '"attachments":"0"}';
+ if(($i+1) == $num)
+ $ret .= '}';
+ else
+ $ret .= '},';
+ }
}
$ret .= ']}';
+ $adb->println("Ret Value ==> $ret");
}
echo $ret;
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 Sat Nov 18 04:00:45 2006
@@ -55,7 +55,8 @@
$this->to = $this->headers["theader"]["to"];
$this->to_name = $this->headers["theader"]["to_name"];
- $this->db->println("Webmail TO: $this->to");
+ $this->db->println("Webmail TO:");
+ $this->db->println($this->to);
$this->from = $this->headers["theader"]["from"];
$this->fromname = $this->headers["theader"]["from_name"];
Modified: vtigercrm/branches/5.0.3/modules/Webmails/webmails.js
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/webmails.js (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/webmails.js Sat Nov 18 04:00:45 2006
@@ -27,8 +27,9 @@
$("webmail_subject").innerHTML = " "+webmail[mid]["subject"];
$("webmail_date").innerHTML = " "+webmail[mid]["date"];
- //Fix for webmails body display in IE - dartagnanlaf
- new Ajax.Request(
+ //Fix for webmails body display in IE - dartagnanlaf
+ /*
+ new Ajax.Request(
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
@@ -38,6 +39,12 @@
}
}
);
+ */
+
+ oiframe = $("email_description");
+ oiframe.src = 'index.php?module=Webmails&action=body&mailid='+mid+'&mailbox='+mailbox;
+ //$("body_area").appendChild(Builder.node('iframe',{src: 'index.php?module=Webmails&action=body&mailid='+mid+'&mailbox='+mailbox, width: '100%', height: '210', frameborder: '0'},'You must enable iframes'));
+
tmp = document.getElementsByClassName("previewWindow");
for(var i=0;i<tmp.length;i++) {
if(tmp[i].style.visibility === "hidden") {
@@ -267,6 +274,8 @@
for(var j=0;j<tels.length;j++) {
try {
if(tels[j].id.match(/row_/)) {
+ //we are deleting the row and add it - AVOID THIS DELTE - MICKIE
+ $("message_table").childNodes[1].deleteRow(tr,tels[j]);
$("message_table").childNodes[1].insertBefore(tr,tels[j]);
break;
}
@@ -350,7 +359,8 @@
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
- postBody: 'module=Webmails&action=ListView&mailbox=INBOX&command=move_msg&ajax=true&mailid='+nid+'&mvbox='+mvmbox,
+ postBody: 'module=Webmails&action=WebmailsAjax&file=ListView&mailbox=INBOX&command=move_msg&ajax=true&mailid='+nid+'&mvbox='+mvmbox,
+ //postBody: 'module=Webmails&action=ListView&mailbox=INBOX&command=move_msg&ajax=true&mailid='+nid+'&mvbox='+mvmbox,
onComplete: function(t) {
//alert(t.responseText);
}
More information about the vtigercrm-commits
mailing list