[Vtigercrm-commits] [vtiger-commits] r10707 - in /vtigercrm/branches/5.0.3/modules/Webmails: ListView.php Webmails.js WebmailsAjax.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 17 10:48:31 EDT 2007
Author: richie
Date: Tue Apr 17 08:48:26 2007
New Revision: 10707
Log:
* Fixed some issues in webmails
Modified:
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
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 08:48:26 2007
@@ -295,7 +295,9 @@
$listview_entries = array();
$displayed_msgs=0;
-$new_msgs=0;
+$info = imap_mailboxmsginfo($MailBox->mbox);
+$unread_msgs = $info->Unread;
+//$new_msgs=0;
if(($numEmails) <= 0)
$listview_entries[0][] = '<td colspan="6" width="100%" align="center"><b>'.$mod_strings['LBL_NO_EMAILS'].'</b></td>';
else {
@@ -379,12 +381,12 @@
/* if($tmpval != "INBOX")
$boxes .= '<option value="'.$tmpval.'">'.$tmpval;
*/
- $_SESSION["mailboxes"][$tmpval] = $new_msgs;
+ $_SESSION["mailboxes"][$tmpval] = $unread_msgs;
if($numEmails==0) {$num=$numEmails;} else {$num=($numEmails-1);}
$folders .= '<li class="tabUnSelected" style="padding-left:0px;"><img src="'.$image_path.'/'.$img.'"align="absmiddle" /> <a href="javascript:changeMbox(\''.$tmpval.'\');" class="webMnu">'.$tmpval.'</a> <span id="'.$tmpval.'_count" style="font-weight:bold">';
- if($new_msgs > 0)
- $folders .= '(<span id="'.$tmpval.'_unread">'.$new_msgs.'</span>)</span> <span id="remove_'.$tmpval.'" style="position:relative;display:none">Remove</span></li>';
+ if($unread_msgs > 0)
+ $folders .= '(<span id="'.$tmpval.'_unread">'.$unread_msgs.'</span>)</span> <span id="remove_'.$tmpval.'" style="position:relative;display:none">Remove</span></li>';
} else {
$box = imap_status($MailBox->mbox, "{".$MailBox->imapServerAddress."}".$tmpval, SA_ALL);
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 08:48:26 2007
@@ -388,7 +388,7 @@
'index.php',
{queue: {position: 'end', scope: 'command'},
method: 'post',
- postBody: 'module=Webmails&action=WebmailsAjax&mailbox='+gCurrentFolder+'&command=move_msg&ajax=true&mailid='+nid.join(":")+'&mvbox='+mvmbox,
+ postBody: 'module=Webmails&action=WebmailsAjax&mailbox='+gCurrentFolder+'&start='+start+'&command=move_msg&ajax=true&mailid='+nid.join(":")+'&mvbox='+mvmbox,
onComplete: function(t) {
for(i=0;i<nid.length;i++)
{
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 08:48:26 2007
@@ -61,7 +61,7 @@
$MailBox = new MailBox($mailbox);
$elist = $MailBox->mailList;
$num_mails = $elist['count'];
- $start_page = ceil($num_mails/$MailBox->mails_per_page);
+ $start_page = cal_start($num_mails,$MailBox->mails_per_page);
imap_close($MailBox->mbox);
echo $start_page;
flush();
@@ -76,7 +76,7 @@
$MailBox = new MailBox($mailbox);
$elist = $MailBox->mailList;
$num_mails = $elist['count'];
- $start_page = ceil($num_mails/$MailBox->mails_per_page);
+ $start_page = cal_start($num_mails,$MailBox->mails_per_page);
imap_close($MailBox->mbox);
echo "start=".$start_page.";";
echo "id=".$mailid.";";
@@ -96,7 +96,7 @@
$MailBox = new MailBox($mailbox);
$elist = $MailBox->mailList;
$num_mails = $elist['count'];
- $start_page = ceil($num_mails/$MailBox->mails_per_page);
+ $start_page = cal_start($num_mails,$MailBox->mails_per_page);
imap_close($MailBox->mbox);
echo "start=".$start_page.";";
echo "ids='".$mailid."';";
@@ -118,8 +118,8 @@
$MailBox = new MailBox($mailbox);
$elist = $MailBox->mailList;
$num_mails = $elist['count'];
- $start_page = ceil($num_mails/$MailBox->mails_per_page);
- imap_close($MailBox->mbox);
+ $start_page = cal_start($num_mails,$MailBox->mails_per_page);
+ imap_close($MailBox->mbox);
echo $start_page;
flush();
exit();
@@ -152,9 +152,22 @@
flush();
exit();
}
-
imap_close($MailBox->mbox);
flush();
exit();
}
+function cal_start($num_mails,$mail_per_page) {
+ if(isset($_REQUEST['start']) && $_REQUEST['start']!=0) {
+ $pre_start = $_REQUEST['start'];
+ $cal = (($pre_start-1) * $mail_per_page);
+ if($num_mails > $cal)
+ $res = $pre_start;
+ else
+ $res = $pre_start - 1;
+ }
+ else
+ $res = 0;
+
+ return $res;
+}
?>
More information about the vtigercrm-commits
mailing list