[Vtigercrm-commits] [vtiger-commits] r5041 - in /vtigercrm/trunk: ./ modules/Settings/ modules/Webmails/
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 8 08:21:04 EDT 2006
Author: mmbrich
Date: Sat Apr 8 06:21:02 2006
New Revision: 5041
Log:
removed "Show Body" from settings and use a dynamic Iframe to
show the body instead. This allows for faster loading and
only marks the message as read when it's actually been
read.
Closes #90
Modified:
vtigercrm/trunk/index.php
vtigercrm/trunk/modules/Settings/AddMailAccount.html
vtigercrm/trunk/modules/Settings/AddMailAccount.php
vtigercrm/trunk/modules/Settings/SaveMailAccount.php
vtigercrm/trunk/modules/Webmails/ListView.php
vtigercrm/trunk/modules/Webmails/body.php
vtigercrm/trunk/modules/Webmails/showOverviewUI.php
Modified: vtigercrm/trunk/index.php
==============================================================================
--- vtigercrm/trunk/index.php (original)
+++ vtigercrm/trunk/index.php Sat Apr 8 06:21:02 2006
@@ -265,7 +265,7 @@
{
$log->info("About to take action ".$action);
$log->debug("in $action");
- if(ereg("^Save", $action) || ereg("^Delete", $action) || ereg("^Choose", $action) || ereg("^Popup", $action) || ereg("^ChangePassword", $action) || ereg("^Authenticate", $action) || ereg("^Logout", $action) || ereg("^Export",$action) || ereg("^add2db", $action) || ereg("^result", $action) || ereg("^LeadConvertToEntities", $action) || ereg("^downloadfile", $action) || ereg("^massdelete", $action) || ereg("^updateLeadDBStatus",$action) || ereg("^AddCustomFieldToDB", $action) || ereg("^updateRole",$action) || ereg("^UserInfoUtil",$action) || ereg("^deleteRole",$action) || ereg("^UpdateComboValues",$action) || ereg("^fieldtypes",$action) || ereg("^app_ins",$action) || ereg("^minical",$action) || ereg("^minitimer",$action) || ereg("^app_del",$action) || ereg("^send_mail",$action) || ereg("^populatetemplate",$action) || ereg("^TemplateMerge",$action) || ereg("^testemailtemplateusage",$action) || ereg("^saveemailtemplate",$action) || ereg("^lookupemailtemplate",$action) || ereg("^deletewordtemplate",$action) || ereg("^deleteemailtemplate",$action) || ereg("^CurrencyDelete",$action) || ereg("^deleteattachments",$action) || ereg("^MassDeleteUsers",$action) || ereg("^UpdateFieldLevelAccess",$action) || ereg("^UpdateDefaultFieldLevelAccess",$action) || ereg("^UpdateProfile",$action) || ereg("^updateRelations",$action) || ereg("^updateNotificationSchedulers",$action) || ereg("^Star",$action) || ereg("^addPbProductRelToDB",$action) || ereg("^UpdateListPrice",$action) || ereg("^PriceListPopup",$action) || ereg("^SalesOrderPopup",$action) || ereg("^CreatePDF",$action) || ereg("^CreateSOPDF",$action) || ereg("^redirect",$action) || ereg("^webmail",$action) || ereg("^left_main",$action) || ereg("^delete_message",$action) || ereg("^mime",$action) || ereg("^move_messages",$action) || ereg("^folders_create",$action) || ereg("^imap_general",$action) || ereg("^mime",$action) || ereg("^download",$action) || ereg("^about_us",$action) || ereg("^SendMailAction",$action) || ereg("^CreateXL",$action) || ereg("^savetermsandconditions",$action) || ereg("^home_rss",$action) || ereg("^ConvertAsFAQ",$action) || ereg("^Tickerdetail",$action) || ereg("^".$module."Ajax",$action) || ereg("^chat",$action) || ereg("^vtchat",$action) || ereg("^updateCalendarSharing",$action) || ereg("^disable_sharing",$action) || ereg("^HeadLines",$action))
+ if(ereg("^Save", $action) || ereg("^Delete", $action) || ereg("^Choose", $action) || ereg("^Popup", $action) || ereg("^ChangePassword", $action) || ereg("^Authenticate", $action) || ereg("^Logout", $action) || ereg("^Export",$action) || ereg("^add2db", $action) || ereg("^result", $action) || ereg("^LeadConvertToEntities", $action) || ereg("^downloadfile", $action) || ereg("^massdelete", $action) || ereg("^updateLeadDBStatus",$action) || ereg("^AddCustomFieldToDB", $action) || ereg("^updateRole",$action) || ereg("^UserInfoUtil",$action) || ereg("^deleteRole",$action) || ereg("^UpdateComboValues",$action) || ereg("^fieldtypes",$action) || ereg("^app_ins",$action) || ereg("^minical",$action) || ereg("^minitimer",$action) || ereg("^app_del",$action) || ereg("^send_mail",$action) || ereg("^populatetemplate",$action) || ereg("^TemplateMerge",$action) || ereg("^testemailtemplateusage",$action) || ereg("^saveemailtemplate",$action) || ereg("^lookupemailtemplate",$action) || ereg("^deletewordtemplate",$action) || ereg("^deleteemailtemplate",$action) || ereg("^CurrencyDelete",$action) || ereg("^deleteattachments",$action) || ereg("^MassDeleteUsers",$action) || ereg("^UpdateFieldLevelAccess",$action) || ereg("^UpdateDefaultFieldLevelAccess",$action) || ereg("^UpdateProfile",$action) || ereg("^updateRelations",$action) || ereg("^updateNotificationSchedulers",$action) || ereg("^Star",$action) || ereg("^addPbProductRelToDB",$action) || ereg("^UpdateListPrice",$action) || ereg("^PriceListPopup",$action) || ereg("^SalesOrderPopup",$action) || ereg("^CreatePDF",$action) || ereg("^CreateSOPDF",$action) || ereg("^redirect",$action) || ereg("^webmail",$action) || ereg("^left_main",$action) || ereg("^delete_message",$action) || ereg("^mime",$action) || ereg("^move_messages",$action) || ereg("^folders_create",$action) || ereg("^imap_general",$action) || ereg("^mime",$action) || ereg("^download",$action) || ereg("^about_us",$action) || ereg("^SendMailAction",$action) || ereg("^CreateXL",$action) || ereg("^savetermsandconditions",$action) || ereg("^home_rss",$action) || ereg("^ConvertAsFAQ",$action) || ereg("^Tickerdetail",$action) || ereg("^".$module."Ajax",$action) || ereg("^chat",$action) || ereg("^vtchat",$action) || ereg("^updateCalendarSharing",$action) || ereg("^disable_sharing",$action) || ereg("^HeadLines",$action) || (ereg("^body",$action) && ereg("^Webmails",$module) ))
{
$skipHeaders=true;
if(ereg("^Popup", $action) || ereg("^ChangePassword", $action) || ereg("^Export", $action) || ereg("^downloadfile", $action) || ereg("^fieldtypes",$action) || ereg("^lookupemailtemplate",$action) || ereg("^about_us",$action) || ereg("^home_rss",$action) || ereg("^".$module."Ajax",$action) || ereg("^chat",$action)|| ereg("^vtchat",$action) || ereg("^massdelete", $action))
Modified: vtigercrm/trunk/modules/Settings/AddMailAccount.html
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddMailAccount.html (original)
+++ vtigercrm/trunk/modules/Settings/AddMailAccount.html Sat Apr 8 06:21:02 2006
@@ -80,12 +80,6 @@
</td>
</tr>
<tr>
- <td nowrap class="dataLabel">Show Body in "Quick View"</td>
- <td><input class="dataInput" type="radio" name="showbody" value="yes" {SHOWBODY} /> Yes (slower and marks all emails as "Seen")
- <input class="dataInput" type="radio" name="showbody" value="no" {NOSHOWBODY} /> No
- </td>
- </tr>
- <tr>
<td nowrap class="dataLabel"><FONT class="required">{APP.LBL_REQUIRED_SYMBOL}</FONT> {APP.LBL_LIST_USER_NAME}:</td>
<td align="left"> <input class="dataInput" type="text" name="server_username" value="{SERVERUSERNAME}" size="30" />
</td>
Modified: vtigercrm/trunk/modules/Settings/AddMailAccount.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddMailAccount.php (original)
+++ vtigercrm/trunk/modules/Settings/AddMailAccount.php Sat Apr 8 06:21:02 2006
@@ -72,10 +72,6 @@
if(strtolower($temprow['sslmeth']) == "novalidate-cert")
$xtpl->assign("NOVALIDATECERT", "CHECKED");
- if(strtolower($temprow['showbody']) == "yes")
- $xtpl->assign("SHOWBODY", "CHECKED");
- if(strtolower($temprow['showbody']) == "no")
- $xtpl->assign("NOSHOWBODY", "CHECKED");
}
}
}
Modified: vtigercrm/trunk/modules/Settings/SaveMailAccount.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/SaveMailAccount.php (original)
+++ vtigercrm/trunk/modules/Settings/SaveMailAccount.php Sat Apr 8 06:21:02 2006
@@ -23,7 +23,6 @@
$mails_per_page = $_REQUEST['mails_per_page'];
$ssltype = $_REQUEST["ssltype"];
$sslmeth = $_REQUEST["sslmeth"];
-$showbody = $_REQUEST["showbody"];
if(isset($_REQUEST['record']) && $_REQUEST['record']!='')
{
@@ -34,12 +33,12 @@
if(isset($_REQUEST['edit']) && $_REQUEST['edit'] && $_REQUEST['record']!='')
{
- $sql="update mail_accounts set display_name = '".$displayname."', mail_id = '".$email."', account_name = '".$account_name."', mail_protocol = '".$mailprotocol."', mail_username = '".$server_username."', mail_password='".$server_password."', mail_servername='".$mail_servername."', box_refresh='".$box_refresh."', mails_per_page='".$mails_per_page."', ssltype='".$ssltype."' , sslmeth='".$sslmeth."', showbody='".$showbody."' where account_id = '".$id."'";
+ $sql="update mail_accounts set display_name = '".$displayname."', mail_id = '".$email."', account_name = '".$account_name."', mail_protocol = '".$mailprotocol."', mail_username = '".$server_username."', mail_password='".$server_password."', mail_servername='".$mail_servername."', box_refresh='".$box_refresh."', mails_per_page='".$mails_per_page."', ssltype='".$ssltype."' , sslmeth='".$sslmeth."', showbody='no' where account_id = '".$id."'";
}
else
{
$account_id = $adb->getUniqueID("mail_accounts");
- $sql="insert into mail_accounts values(" .$account_id .",'".$current_user->id."','".$displayname."','".$email."','".$account_name."','".$mailprotocol."','".$server_username."','".$server_password."','".$mail_servername."','".$box_refresh."','".$mails_per_page."', '".$ssltype."', '".$sslmeth."', '".$showbody."','1','0')";
+ $sql="insert into mail_accounts values(" .$account_id .",'".$current_user->id."','".$displayname."','".$email."','".$account_name."','".$mailprotocol."','".$server_username."','".$server_password."','".$mail_servername."','".$box_refresh."','".$mails_per_page."', '".$ssltype."', '".$sslmeth."', 'no','1','0')";
}
$adb->query($sql);
Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Sat Apr 8 06:21:02 2006
@@ -1,3 +1,7 @@
+<?php
+if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
+if($_REQUEST["start"] && $_REQUEST["start"] != "") {$start=$_REQUEST["start"];} else {$start="1";}
+?>
<script type="text/javascript">
function add_to_vtiger(mid) {
$("status").style.display="block";
@@ -11,6 +15,10 @@
}
}
);
+}
+function showBody(mid) {
+ var el = $("body_"+mid);
+ el.innerHTML = '<iframe src="index.php?module=Webmails&action=body&mailid='+mid+'&mailbox=<?php echo $mailbox;?>" width="100%" height="210">You must enabled iframes</iframe>';
}
</script>
<?php
@@ -108,8 +116,6 @@
</script>
<?
-if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
-if($_REQUEST["start"] && $_REQUEST["start"] != "") {$start=$_REQUEST["start"];} else {$start="1";}
$viewname="20";
// CUSTOM VIEW
Modified: vtigercrm/trunk/modules/Webmails/body.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/body.php (original)
+++ vtigercrm/trunk/modules/Webmails/body.php Sat Apr 8 06:21:02 2006
@@ -41,7 +41,8 @@
if($command == "clear_flag")
$email->delFlag();
} else {
- echo ($email->body);
-}
+ echo $email->body;
+}
imap_close($mbox);
+
?>
Modified: vtigercrm/trunk/modules/Webmails/showOverviewUI.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/showOverviewUI.php (original)
+++ vtigercrm/trunk/modules/Webmails/showOverviewUI.php Sat Apr 8 06:21:02 2006
@@ -47,7 +47,7 @@
<td id="cellTabAttachments_<?php echo $num; ?>" class="dvtSelectedCell" align=center nowrap><a href="javascript:void(0);" onClick="switchClass('cellTabBody_<?php echo $num; ?>','off');switchClass('cellTabAttachments_<?php echo $num; ?>','on');gshow('showAttachmentsUI_<?php echo $num; ?>');ghide('showBodyUI_<?php echo $num; ?>');">General Information</a></td>
<?php if($showbody == "yes") {$extra_style="";} else {$extra_style="";} ?>
<td class="dvtTabCache" style="width:10px;<?php echo $extra_style;?>" nowrap> </td>
- <td style="<?php echo $extra_style;?>" id="cellTabBody_<?php echo $num; ?>" class="dvtUnSelectedCell" align=center nowrap><a href="javascript:void(0);" onClick="switchClass('cellTabBody_<?php echo $num; ?>','on');switchClass('cellTabAttachments_<?php echo $num; ?>','off');ghide('showAttachmentsUI_<?php echo $num; ?>');gshow('showBodyUI_<?php echo $num; ?>');">Body</a></td>
+ <td style="<?php echo $extra_style;?>" id="cellTabBody_<?php echo $num; ?>" class="dvtUnSelectedCell" align=center nowrap><a href="javascript:void(0);" onClick="switchClass('cellTabBody_<?php echo $num; ?>','on');switchClass('cellTabAttachments_<?php echo $num; ?>','off');ghide('showAttachmentsUI_<?php echo $num; ?>');gshow('showBodyUI_<?php echo $num; ?>');showBody(<?php echo $num; ?>);">Body</a></td>
<td class="dvtTabCache" style="width:100%"> </td>
</tr>
</table>
@@ -75,25 +75,9 @@
</table>
</td>
</tr>
- <td valign=top>
- <?
- if($showbody == "yes") {
- $webmail->loadMail();
- if(preg_match("/<style(.*)/i",$webmail->body) || preg_match("/<html(.*)/i",$webmail->body) ||preg_match("/<a (.*)/i",$webmail->body) || preg_match("/<img(.*)/i",$webmail->body))
- echo '<iframe src="index.php?module=Webmails&action=body&mailid='.$num.'&mailbox='.$mailbox.'" width="100%" height="210">'.$tmp.'</iframe>';
- else {
- echo '<div style="overflow:auto;height:210px;width:100%">';
- echo br2nl(($webmail->body));
- echo '</div>';
- }
- } else {
- echo '<div style="overflow:auto;height:210px">';
- echo 'You must enable body views in your email settings';
- echo 'to see the body of emails in the Quick View window';
- echo '</div>';
- }
- ?>
- </td>
+ <td valign=top>
+ <div style="width:100%" id="body_<?php echo $num; ?>">  Loading... </div>
+ </td>
</tr>
</table>
</DIV>
More information about the vtigercrm-commits
mailing list