[Vtigercrm-commits] [vtiger-commits] r6405 - in /vtigercrm/trunk: Smarty/templates/Webmails.tpl modules/Webmails/ListView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 25 06:51:54 EDT 2006
Author: mmbrich
Date: Thu May 25 04:51:53 2006
New Revision: 6405
Log:
fixed some bugs in the delete/undelete functions, added popups for compose, reply
Modified:
vtigercrm/trunk/Smarty/templates/Webmails.tpl
vtigercrm/trunk/modules/Webmails/ListView.php
Modified: vtigercrm/trunk/Smarty/templates/Webmails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Webmails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Webmails.tpl Thu May 25 04:51:53 2006
@@ -40,7 +40,7 @@
</td>
<td width="10%">
<img src="{$IMAGE_PATH}compose.gif" align="absmiddle" />
- <a href="index.php?module=Emails&action=EditView&return_action=DetailView&parenttab=My Home Page" class="webMnu">{$MOD.LBL_COMPOSE}</a>
+ <a href="javascript:;" onclick="OpenCompose('','create');" class="webMnu">{$MOD.LBL_COMPOSE}</a>
</td>
<td width="10%">
<img src="{$IMAGE_PATH}webmail_settings.gif" align="absmiddle" />
@@ -182,5 +182,26 @@
<td> </td>
</tr>
</table>
+<script>
+function OpenCompose(id,mode)
+{ldelim}
+ switch(mode)
+ {ldelim}
+ case 'edit':
+ url = 'index.php?module=Webmails&action=EditView&record='+id;
+ break;
+ case 'create':
+ url = 'index.php?module=Webmails&action=EditView';
+ break;
+ case 'forward':
+ url = 'index.php?module=Webmails&action=EditView&record='+id+'&forward=true';
+ break;
+ case 'reply':
+ url = 'index.php?module=Webmails&action=EditView&record='+id+'&reply=true';
+ break;
+ {rdelim}
+ openPopUp('xComposeEmail',this,url,'createemailWin',820,652,'menubar=no,toolbar=no,location=no,status=no,resizable=no');
+{rdelim}
+</script>
+
<!-- END -->
-
Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Thu May 25 04:51:53 2006
@@ -1,4 +1,4 @@
-<script language="JavaScript" type="text/javascript" src="include/js/prototype.js"></script>
+<script language="JavaScript" type="text/javascript" src="include/js/prototype_fade.js"></script>
<?php
if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
if($_REQUEST["start"] && $_REQUEST["start"] != "") {$start=$_REQUEST["start"];} else {$start="1";}
@@ -64,9 +64,9 @@
var els = document.getElementsByClassName("deletedRow");
for(var i=0;i<els.length;i++) {
if(els[i].style.display == "none")
- els[i].style.display ='';
+ new Effect.Appear(els[i],{queue:{position:'end',scope:'effect',limit:'1'}});
else
- els[i].style.display = 'none';
+ new Effect.Fade(els[i],{queue:{position:'end',scope:'effect',limit:'1'}});
}
}
</script>
@@ -138,9 +138,20 @@
window.location = window.location;
break;
case 'delete_msg':
- var parent = $("row_"+id).parentNode;
- var node = $("row_"+id);
- parent.removeChild(node);
+ var row = $("row_"+id);
+ row.className = "deletedRow";
+ try {
+ $("ndeleted_subject_"+id).innerHTML = "<s>"+$("ndeleted_subject_"+id).innerHTML+"</s>";
+ $("ndeleted_date_"+id).innerHTML = "<s>"+$("ndeleted_date_"+id).innerHTML+"</s>";
+ $("ndeleted_from_"+id).innerHTML = "<s>"+$("ndeleted_from_"+id).innerHTML+"</s>";
+ }catch(e){
+ $("deleted_subject_"+id).innerHTML = "<s>"+$("deleted_subject_"+id).innerHTML+"</s>";
+ $("deleted_date_"+id).innerHTML = "<s>"+$("deleted_date_"+id).innerHTML+"</s>";
+ $("deleted_from_"+id).innerHTML = "<s>"+$("deleted_from_"+id).innerHTML+"</s>";
+ }
+
+ $("del_link_"+id).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="del"></a>';
+ new Effect.Fade(row,{queue:{position:'end',scope:'effect',limit:'1'}});
tmp = document.getElementsByClassName("previewWindow");
for(var i=0;i<tmp.length;i++) {
if(tmp[i].style.visibility === "visible") {
@@ -150,9 +161,11 @@
break;
case 'undelete_msg':
var node = $("row_"+id);
+ node.className='';
node.style.display = '';
var newhtml = remove(remove(node.innerHTML,'<s>'),'</s>');
node.innerHTML=newhtml;
+ $("del_link_"+id).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"></a>';
break;
case 'clear_flag':
var nm = "clear_td_"+id;
@@ -326,7 +339,8 @@
elseif (preg_match("/^fw:/i",$mails[$start_message]->subject))
$flags.='<img src="modules/Webmails/images/stock_mail-forward.png" border="0" width="10" height="13"> ';
else
- $flags.='<a href="xindex.php?module=Webmails&action=DetailView&'.$detailParams.'"><img src="modules/Webmails/images/stock_mail-read.png" border="0" width="10" height="11"></a> ';
+ $flags.='<a href="javascript:;" onclick="OpenCompose(\''.$mails[$start_message]->msgno.'\',\'reply\');"><img src="modules/Webmails/images/stock_mail-read.png" border="0" width="10" height="11"></a> ';
+ //$flags.='<a href="index.php?module=Webmails&action=DetailView&'.$detailParams.'"><img src="modules/Webmails/images/stock_mail-read.png" border="0" width="10" height="11"></a> ';
// Add to Vtiger
if($mails[$start_message]->flagged)
@@ -356,9 +370,9 @@
}
if($mails[$start_message]->deleted)
- $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>';
+ $listview_entries[$num][] = '<td colspan="1" nowrap align="center" id="deleted_td_'.$num.'"><span id="del_link_'.$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"></a></span></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>';
+ $listview_entries[$num][] = '<td nowrap colspan="1" align="center" id="ndeleted_td_'.$num.'"><span id="del_link_'.$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"></a></span></td>';
More information about the vtigercrm-commits
mailing list