[Vtigercrm-commits] [vtiger-commits] r5039 - in /vtigercrm/trunk: Smarty/templates/ListView.tpl modules/Webmails/ListView.php modules/Webmails/body.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 8 07:26:52 EDT 2006
Author: mmbrich
Date: Sat Apr 8 05:26:51 2006
New Revision: 5039
Log:
removed expunge command (added to the delete command)
added row id to template so that elements can be
removed from the table easier.
changed delete command to remove child element from
table and also run an IMAP expunge after deleting
(making it permanent)
Modified:
vtigercrm/trunk/Smarty/templates/ListView.tpl
vtigercrm/trunk/modules/Webmails/ListView.php
vtigercrm/trunk/modules/Webmails/body.php
Modified: vtigercrm/trunk/Smarty/templates/ListView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ListView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ListView.tpl Sat Apr 8 05:26:51 2006
@@ -325,7 +325,7 @@
{/foreach}
</tr>
{foreach item=entity key=entity_id from=$LISTENTITY}
- <tr bgcolor=white onMouseOver="this.className='lvtColDataHover'" onMouseOut="this.className='lvtColData'" >
+ <tr bgcolor=white onMouseOver="this.className='lvtColDataHover'" onMouseOut="this.className='lvtColData'" id="row_{$entity_id}">
<td><input type="checkbox" NAME="selected_id" value= '{$entity_id}' onClick=toggleSelectAll(this.name,"selectall")></td>
{foreach item=data from=$entity}
<td>{$data}</td>
Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Sat Apr 8 05:26:51 2006
@@ -61,54 +61,9 @@
if(resp.match(/ajax failed/)) {return;}
switch(command) {
case 'delete_msg':
- var nm = "ndeleted_td_"+id;
- var el = $(nm);
- var el_sub = $("ndeleted_subject_"+id);
- var el_date = $("ndeleted_date_"+id);
- var el_from = $("ndeleted_from_"+id);
- tmp = el_sub.innerHTML;
- el_sub.innerHTML = "<s>"+tmp+"</s>";
- el_sub.id = "deleted_subject_"+id;
- tmp = el_date.innerHTML;
- el_date.innerHTML = "<s>"+tmp+"</s>";
- el_date.id = "deleted_date_"+id;
-
- tmp = el_from.innerHTML;
- el_from.innerHTML = "<s>"+tmp+"</s>";
- el_from.id = "deleted_from_"+id;
- el.innerHTML = '<a href="javascript:void(0);" onclick="runEmailCommand(\'undelete_msg\','+id+');"><img src="modules/Webmails/images/gnome-fs-trash-full.png" border="0" width="14" height="14" alt="undel" id="del_img_'+id+'"></a> ';
- el.id = "deleted_td_"+id;
- break;
- case 'undelete_msg':
- var nm = "deleted_td_"+id;
- var el = $(nm);
- var el_sub = $("deleted_subject_"+id);
- var el_date = $("deleted_date_"+id);
- var el_from = $("deleted_from_"+id);
-
- tmp = el_sub.innerHTML;
- t1 = tmp.indexOf("<s>");
- t2 = tmp.indexOf("<\/s>");
- tmp1 = tmp.substr((t1+3),(t2-3));
- el_sub.innerHTML = tmp1;
- el_sub.id="ndeleted_subject_"+id;
-
- tmp = el_date.innerHTML;
- t1 = tmp.indexOf("<s>");
- t2 = tmp.indexOf("<\/s>");
- tmp1 = tmp.substr((t1+3),(t2-3));
- el_date.innerHTML = tmp1;
- el_date.id="ndeleted_date_"+id;
-
- tmp = el_from.innerHTML;
- t1 = tmp.indexOf("<s>");
- t2 = tmp.indexOf("<\/s>");
- tmp1 = tmp.substr((t1+3),(t2-3));
- el_from.innerHTML = tmp1;
- el_from.id="ndeleted_from_"+id;
-
- el.innerHTML = '<a href="javascript:void(0);" onclick="runEmailCommand(\'delete_msg\','+id+');"><img src="modules/Webmails/images/gnome-fs-trash-empty.png" border="0" width="14" height="14" alt="del" id="ndel_img_'+id+'"></a> ';
- el.id="ndeleted_td_"+id;
+ var parent = $("row_"+id).parentNode;
+ var node = $("row_"+id);
+ parent.removeChild(node);
break;
case 'clear_flag':
var nm = "clear_td_"+id;
@@ -333,11 +288,6 @@
}
$boxes .= '</select>';
}
-$navigationOutput .= '<td size="10%"><form method="POST" name="expungeForm"> <input type="hidden" name="expunge" value="1">';
-$navigationOutput .= '<input type="hidden" name="mailbox" value="'.$mailbox.'">';
-$navigationOutput .= ' </td>';
-$navigationOutput .= '<td align="right"><a href="javascript:document.expungeForm.submit();" >Expunge Mailbox</a>';
-$navigationOutput .= '</form></td>';
$navigationOutput .= '<td size="100%"> ';
$navigationOutput .= $boxes;
$navigationOutput .= ' </td>';
Modified: vtigercrm/trunk/modules/Webmails/body.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/body.php (original)
+++ vtigercrm/trunk/modules/Webmails/body.php Sat Apr 8 05:26:51 2006
@@ -30,8 +30,10 @@
$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