[Vtigercrm-commits] [vtiger-commits] r10702 - in /vtigercrm/branches/5.0.3: Smarty/templates/ modules/Webmails/ modules/Webmails/language/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 17 04:01:43 EDT 2007
Author: richie
Date: Tue Apr 17 02:01:28 2007
New Revision: 10702
Log:
* Fixed the issues in mail delete and navigation, Fixed #3246#3551
Added:
vtigercrm/branches/5.0.3/Smarty/templates/ListViewAjax.tpl
vtigercrm/branches/5.0.3/modules/Webmails/ListViewAjax.php
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/Webmails.js
vtigercrm/branches/5.0.3/modules/Webmails/WebmailsAjax.php
vtigercrm/branches/5.0.3/modules/Webmails/language/en_us.lang.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 Tue Apr 17 02:01:28 2007
@@ -50,7 +50,7 @@
</tr>
<tr>
<td width="20%" class="big mailSubHeader"><b>{$MOD.LBL_EMAIL_FOLDERS}</b></td>
- <td width="80%" class="big mailSubHeader"><span style="float:left">{$ACCOUNT} > {$MAILBOX}</span> <span style="float:right">{$NAVIGATION}</span></td>
+ <td width="80%" class="big mailSubHeader"><span style="float:left">{$ACCOUNT} > {$MAILBOX}</span> <span style="float:right"><div id="nav">{$NAVIGATION}</div></span></td>
</tr>
<tr>
<td rowspan="6" valign="top" class="hdrNameBg">
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 Tue Apr 17 02:01:28 2007
@@ -195,8 +195,15 @@
{
imap_mail_move($MailBox->mbox,$mailid,$_REQUEST["mvbox"]);
}
+ imap_expunge($MailBox->mbox);
imap_close($MailBox->mbox);
- echo "SUCCESS";
+ $MailBox = new MailBox($mailbox);
+ $elist = $MailBox->mailList;
+ $num_mails = $elist['count'];
+ $start_page = ceil($num_mails/$MailBox->mails_per_page);
+ imap_close($MailBox->mbox);
+ echo "start=".$start_page.";";
+ echo "id=".$mailid.";";
flush();
exit();
}
@@ -254,6 +261,7 @@
// these are mainly used in the preview window and could be ajaxified/
// during the preview window load instead.
var msgCount = "<?php echo $numEmails;?>";
+var start = "<?php echo $_REQUEST['start'];?>";
<?php
$mails = array();
if (is_array($overview))
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 Tue Apr 17 02:01:28 2007
@@ -388,7 +388,7 @@
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
- postBody: 'module=Webmails&action=WebmailsAjax&file=ListView&mailbox='+gCurrentFolder+'&command=move_msg&ajax=true&mailid='+nid.join(":")+'&mvbox='+mvmbox,
+ postBody: 'module=Webmails&action=WebmailsAjax&mailbox='+gCurrentFolder+'&command=move_msg&ajax=true&mailid='+nid.join(":")+'&mvbox='+mvmbox,
onComplete: function(t) {
for(i=0;i<nid.length;i++)
{
@@ -396,6 +396,8 @@
new Effect.Fade(oRow,{queue: {position: 'end', scope: 'effect'},duration: '0.5'});
}
$("status").style.display = "none";
+ start = t.responseText;
+ runEmailCommand("reload",0);
}
}
);
@@ -442,6 +444,10 @@
function runEmailCommand(com,id) {
command=com;
id=id;
+ if(com=="reload")
+ var file="ListViewAjax";
+ else
+ var file="";
if(com == 'delete_msg')
{
if(!confirm(alert_arr.DELETE+" "+alert_arr.MAIL+" ?"))
@@ -452,19 +458,35 @@
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
- postBody: 'module=Webmails&action=WebmailsAjax&command='+command+'&mailid='+id+'&mailbox='+mailbox,
+ postBody: 'module=Webmails&action=WebmailsAjax&start='+start+'&command='+command+'&mailid='+id+'&file='+file+'&mailbox='+mailbox,
onComplete: function(t) {
resp = t.responseText;
id=resp;
if(resp.match(/ajax failed/)) {return;}
switch(command) {
+ case 'reload':
+ $("rssScroll").innerHTML = resp;
+ var unread_count = parseInt($(mailbox+"_tempcount").innerHTML);
+ if(unread_count > 0) {
+ $(mailbox+"_unread").innerHTML = unread_count;
+ }
+ else{
+ $(mailbox+"_count").innerHTML = "";
+ }
+ $("nav").innerHTML = $("navTemp").innerHTML;
+ $("navTemp").innerHTML = '';
+ $(mailbox+"_tempcount").innerHTML = "";
+ break;
case 'expunge':
// NOTE: we either have to reload the page or count up from the messages that
// are deleted and moved or we introduce a bug from invalid mail ids
- window.location = window.location;
+ //window.location = window.location;
+ start = resp;
+ runEmailCommand("reload",0);
break;
case 'delete_multi_msg':
- var ids=resp;
+ var ids;
+ eval(resp);
var rows = ids.split(":");
for(i=0;i<rows.length;i++) {
var id = rows[i];
@@ -497,10 +519,14 @@
}catch(g){}
$("status").style.display="none";
+ if(i == ((rows.length)-2)){
+ runEmailCommand("reload",0);
+ }
}
break;
case 'delete_msg':
- id=resp;
+ //id=resp;
+ eval(resp);
var row = $("row_"+id);
if(row.className == "unread_email") {
var unread = parseInt($(mailbox+"_unread").innerHTML);
@@ -531,6 +557,7 @@
tmp[i].style.visibility="hidden";
}
}
+ runEmailCommand("reload",0);
break;
case 'undelete_msg':
id=resp;
Modified: vtigercrm/branches/5.0.3/modules/Webmails/WebmailsAjax.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/WebmailsAjax.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/WebmailsAjax.php Tue Apr 17 02:01:28 2007
@@ -29,6 +29,10 @@
}
exit();
}
+if(isset($_REQUEST['file']) && $_REQUEST['file']!='' && !isset($_REQUEST['ajax'])){
+ include("modules/".$_REQUEST['module']."/".$_REQUEST['file'].".php");
+ exit();
+}
$mailid = $_REQUEST["mailid"];
if(isset($_REQUEST["mailbox"]) && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
@@ -54,17 +58,28 @@
}
*/
imap_expunge($MailBox->mbox);
+ $MailBox = new MailBox($mailbox);
+ $elist = $MailBox->mailList;
+ $num_mails = $elist['count'];
+ $start_page = ceil($num_mails/$MailBox->mails_per_page);
imap_close($MailBox->mbox);
+ echo $start_page;
flush();
exit();
}
if($command == "delete_msg") {
$adb->println("DELETE SINGLE WEBMAIL MESSAGE $mailid");
$MailBox = new MailBox($mailbox);
- imap_mail_move($MailBox->mbox,$mailid,"Deleted");
+ imap_delete($MailBox->mbox,$mailid);
+ imap_expunge($MailBox->mbox);
$email = new Webmails($MailBox->mbox,$mailid);
+ $MailBox = new MailBox($mailbox);
+ $elist = $MailBox->mailList;
+ $num_mails = $elist['count'];
+ $start_page = ceil($num_mails/$MailBox->mails_per_page);
imap_close($MailBox->mbox);
- echo $mailid;
+ echo "start=".$start_page.";";
+ echo "id=".$mailid.";";
flush();
exit();
}
@@ -72,16 +87,44 @@
$MailBox = new MailBox($mailbox);
$tlist = explode(":",$mailid);
foreach($tlist as $id) {
- imap_mail_move($MailBox->mbox,$id,"Trash");
+ imap_delete($MailBox->mbox,$id);
$adb->println("DELETE MULTI MESSAGE $id");
$email = new Webmails($MailBox->mbox,$id);
$email->delete();
}
+ imap_expunge($MailBox->mbox);
+ $MailBox = new MailBox($mailbox);
+ $elist = $MailBox->mailList;
+ $num_mails = $elist['count'];
+ $start_page = ceil($num_mails/$MailBox->mails_per_page);
imap_close($MailBox->mbox);
- echo $mailid;
+ echo "start=".$start_page.";";
+ echo "ids='".$mailid."';";
flush();
exit();
}
+ if($_POST["command"] == "move_msg" && $_POST["ajax"] == "true") {
+ $MailBox = new MailBox($mailbox);
+ if(isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != '')
+ {
+ $mailids = explode(':',$_REQUEST["mailid"]);
+ }
+ foreach($mailids as $mailid)
+ {
+ imap_mail_move($MailBox->mbox,$mailid,$_REQUEST["mvbox"]);
+ }
+ imap_expunge($MailBox->mbox);
+ imap_close($MailBox->mbox);
+ $MailBox = new MailBox($mailbox);
+ $elist = $MailBox->mailList;
+ $num_mails = $elist['count'];
+ $start_page = ceil($num_mails/$MailBox->mails_per_page);
+ imap_close($MailBox->mbox);
+ echo $start_page;
+ flush();
+ exit();
+ }
+
if($command == "undelete_msg") {
$MailBox = new MailBox($mailbox);
$email = new Webmails($MailBox->mbox,$mailid);
Modified: vtigercrm/branches/5.0.3/modules/Webmails/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/language/en_us.lang.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/language/en_us.lang.php Tue Apr 17 02:01:28 2007
@@ -45,7 +45,7 @@
'LBL_TO'=>'To :',
'LBL_CHK_MAIL'=>'Check Mail',
'LBL_COMPOSE'=>'Compose',
-'LBL_SETTINGS'=>'Incmg. MailServer Settings',
+'LBL_SETTINGS'=>'Incoming MailServer Settings',
'LBL_EMAIL_FOLDERS'=>'Email Folders',
'LBL_INBOX'=>'Inbox',
'LBL_SENT_MAILS'=>'Sent Mails',
More information about the vtigercrm-commits
mailing list