[Vtigercrm-commits] [vtiger-commits] r5181 - in /vtigercrm/trunk: Smarty/templates/Webmails.tpl modules/Webmails/ListView.php modules/Webmails/body.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 18 00:58:14 EDT 2006
Author: mmbrich
Date: Mon Apr 17 22:58:12 2006
New Revision: 5181
Log:
Enabled the Qualify button
Enabled a "Show Hidden" and "Expunge Mailbox" link, by not expunging the mailbox each time we delete a message it will keep a bug from appearing due to invalid mailids
Other misc fixes/features.
Modified:
vtigercrm/trunk/Smarty/templates/Webmails.tpl
vtigercrm/trunk/modules/Webmails/ListView.php
vtigercrm/trunk/modules/Webmails/body.php
Modified: vtigercrm/trunk/Smarty/templates/Webmails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Webmails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Webmails.tpl Mon Apr 17 22:58:12 2006
@@ -1,9 +1,9 @@
<!-- USER SETTINGS PAGE STARTS HERE -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" height="100%">
<tr>
- <td class="showPanelBg" valign="top" width="95%" style="padding-left:20px; "><br />
- <span class="lvtHeaderText">Home> Web Mail </span>
- <hr noshade="noshade" size="1" />
+ <td class="showPanelBg" valign="top" width="95%" style="padding-left:20px; ">
+ <span class="lvtHeaderText">{$CATEGORY} -> {$MODULE} </span>
+ <span id="status" style="display:none"><img src="{$IMAGE_PATH}busy.gif"> Executing Command...</span><hr noshade="noshade" size="1" /><br />
</td>
<td width="5%" class="showPanelBg"> </td>
</tr>
@@ -21,7 +21,7 @@
<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="35%" cellpadding="0" cellspacing="0" border="0">
+ <table width="55%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<img src="{$IMAGE_PATH}check_mail.gif" align="absmiddle" />
@@ -34,6 +34,14 @@
<td>
<img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
<a href="#" class="webMnu">Settings</a>
+ </td>
+ <td>
+ <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
+ <a href="javascript:;" onclick="window.location = window.location+'&show_hidden=true';" class="webMnu">Show Hidden</a>
+ </td>
+ <td>
+ <img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
+ <a href="javascript:;" onclick="runEmailCommand('expunge','0');" class="webMnu">Expunge Mailbox</a>
</td>
</tr>
</table>
@@ -106,7 +114,7 @@
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="75%">
- <input type="button" name="Qualify2" value=" Qualify " class="classWebBtn" />
+ <span id="qualify_button"><input type="button" name="Qualify2" value=" Qualify " class="classWebBtn" /></span>
<span id="reply_button"><input type="button" name="reply" value=" Reply to Sender " class="classWebBtn" /></span>
<span id="reply_button_all"><input type="button" name="reply" value=" Reply to All " class="classWebBtn" /></span>
<input type="button" name="forward" value=" Forward " class="classWebBtn" />
Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Mon Apr 17 22:58:12 2006
@@ -19,16 +19,22 @@
$("delete_button").innerHTML = '<input type="button" name="Button" value=" Delete " class="classWebBtn" onclick="runEmailCommand(\'delete_msg\','+mid+');"/>';
$("reply_button_all").innerHTML = '<input type="button" name="reply" value=" Reply to All " class="classWebBtn" onclick="window.location = \'index.php?module=Webmails&action=EditView&mailid='+mid+'&reply=all&return_action=index&return_module=Webmails\';" />';
$("reply_button").innerHTML = '<input type="button" name="reply" value=" Reply to Sender " class="classWebBtn" onclick="window.location = \'index.php?module=Webmails&action=EditView&mailid='+mid+'&reply=single&return_action=index&return_module=Webmails\';" />';
+ $("qualify_button").innerHTML = '<input type="button" name="Qualify2" value=" Qualify " onclick="showRelationships('+mid+');" class="classWebBtn" />';
+
+}
+function showRelationships(mid) {
+ // just add to vtiger for now
+ add_to_vtiger(mid);
}
function add_to_vtiger(mid) {
- //$("status").style.display="block";
+ $("status").style.display="block";
new Ajax.Request(
'index.php',
{queue: {position:'front', scope: 'command', limit:1},
method: 'post',
postBody: 'module=Webmails&action=Save&mailid='+mid+'&ajax=true',
onComplete: function(t) {
- //$("status").style.display="none";
+ $("status").style.display="none";
}
}
);
@@ -52,7 +58,6 @@
}
$temprow = $adb->fetch_array($mailInfo);
-//print_r($temprow);
$login_username= $temprow["mail_username"];
$secretkey=$temprow["mail_password"];
$imapServerAddress=$temprow["mail_servername"];
@@ -62,6 +67,7 @@
$ssltype=$temprow["ssltype"];
$sslmeth=$temprow["sslmeth"];
$account_name=$temprow["account_name"];
+$show_hidden=$_REQUEST["show_hidden"];
?>
<script language="Javascript" type="text/javascript" src="modules/Webmails/js/ajax_connection.js"></script>
@@ -84,7 +90,7 @@
var command;
var id;
function runEmailCommand(com,id) {
- //$("status").style.display="block";
+ $("status").style.display="block";
command=com;
id=id;
new Ajax.Request(
@@ -96,6 +102,11 @@
resp = t.responseText;
if(resp.match(/ajax failed/)) {return;}
switch(command) {
+ 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;
+ break;
case 'delete_msg':
var parent = $("row_"+id).parentNode;
var node = $("row_"+id);
@@ -123,7 +134,7 @@
break;
}
- //$("status").style.display="none";
+ $("status").style.display="none";
}
}
);
@@ -165,11 +176,7 @@
$save_path='/usr/local/share/vtiger/modules/Webmails/tmp';
$user_dir=$save_path."/".$_SESSION["authenticated_user_id"];
-if($_REQUEST["expunge"]) {
- imap_expunge($mbox);
- SureRemoveDir($user_dir);
-}
-
+
$elist = fullMailList($mbox);
//print_r($elist);
$numEmails = $elist["count"];
@@ -194,6 +201,7 @@
?>
<script type="text/javascript">
var webmail = new Array();
+var msgCount = "<?php echo $numEmails;?>";
<?
$mails = array();
if (is_array($overview)) {
@@ -217,7 +225,6 @@
$listview_entries[0][] = '<td colspan="6" width="100%" align="center"><b>No Emails In This Folder</b></td>';
else {
$i=1;
-//print_r($thread_view);
// Main loop to create listview entries
while ($i<$c) {
$num = $mails[$start_message]->msgno;
@@ -234,7 +241,13 @@
$detailParams = 'record='.$record_id.'&mailbox='.$mailbox.'&mailid='.$num.'&parenttab=My Home Page';
$defaultParams = 'parenttab=My Home Page&mailbox='.$mailbox.'&start='.$start.'&viewname='.$viewname;
- $flags = "<tr id='row_".$mails[$start_message]->msgno."'><td colspan='1'><input type='checkbox' name='checkbox_".$mails[$start_message]->msgno."'></td><td colspan='1'>";
+ if ($mails[$start_message]->deleted && !$show_hidden)
+ $flags = "<tr id='row_".$mails[$start_message]->msgno."' class='deletedRow' style='display:none'><td colspan='1'><input type='checkbox' name='checkbox_".$mails[$start_message]->msgno."'></td><td colspan='1'>";
+ elseif ($mails[$start_message]->deleted && $show_hidden)
+ $flags = "<tr id='row_".$mails[$start_message]->msgno."' class='deletedRow'><td colspan='1'><input type='checkbox' name='checkbox_".$mails[$start_message]->msgno."'></td><td colspan='1'>";
+ else
+ $flags = "<tr id='row_".$mails[$start_message]->msgno."'><td colspan='1'><input type='checkbox' name='checkbox_".$mails[$start_message]->msgno."'></td><td colspan='1'>";
+
// Attachment Icons
if(getAttachmentDetails($start_message,$mbox))
$flags.='<img src="modules/Webmails/images/stock_attach.png" border="0" width="14px" height="14"> ';
@@ -263,10 +276,9 @@
$listview_entries[$num] = array();
$listview_entries[$num][] = $flags."</td>";
- //$listview_entries[$num][] = $flags."</table></td>";
if ($mails[$start_message]->deleted) {
- $listview_entries[$num][] = '<td colspan="1" align="left" id="deleted_subject_'.$num.'"><s><a href="javascript:;" onclick="load_webmail(\''.$num.'\');">'.substr($mails[$start_message]->subject,0,50).'</a></s></td>';
+ $listview_entries[$num][] = '<td colspan="1" align="left" id="deleted_subject_'.$num.'"><s><a href="javscript:;" onclick="load_webmail(\''.$num.'\');">'.substr($mails[$start_message]->subject,0,50).'</a></s></td>';
$listview_entries[$num][] = '<td colspan="1" align="left" nowrap id="deleted_date_'.$num.'"><s>'.$mails[$start_message]->date.'</s></td>';
$listview_entries[$num][] = '<td colspan="1" align="left" id="deleted_from_'.$num.'"><s>'.substr($from,0,30).'</s></td>';
} elseif(!$mails[$start_message]->seen || $mails[$start_message]->recent) {
@@ -283,6 +295,7 @@
$listview_entries[$num][] = '<td colspan="1" nowrap align="center" id="deleted_td_'.$num.'"><a href="javascript:void(0);" onclick="runEmailCommand(\'undelete_msg\','.$num.');"><img src="modules/Webmails/images/gnome-fs-trash-full.png" border="0" width="14" height="14" alt="del" id="del_img_'.$num.'"></a></td>';
else
$listview_entries[$num][] = '<td nowrap colspan="1" align="center" id="ndeleted_td_'.$num.'"><a href="javascript:void(0);" onclick="runEmailCommand(\'delete_msg\','.$num.');"><img src="modules/Webmails/images/gnome-fs-trash-empty.png" border="0" width="14" height="14" alt="del" id="del_img_'.$num.'"></a></td>';
+
$i++;
Modified: vtigercrm/trunk/modules/Webmails/body.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/body.php (original)
+++ vtigercrm/trunk/modules/Webmails/body.php Mon Apr 17 22:58:12 2006
@@ -30,10 +30,8 @@
$command = $_POST["command"];
if($command == "expunge")
imap_expunge($mbox);
- if($command == "delete_msg") {
+ if($command == "delete_msg")
$email->delete();
- imap_expunge($mbox);
- }
if($command == "undelete_msg")
$email->unDeleteMsg();
if($command == "set_flag")
More information about the vtigercrm-commits
mailing list