[Vtigercrm-commits] [vtiger-commits] r6952 - /vtigercrm/trunk/modules/Emails/Email.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 7 10:03:39 EDT 2006
Author: saraj
Date: Wed Jun 7 08:03:35 2006
New Revision: 6952
Log:
ajax functionality has been modified
Modified:
vtigercrm/trunk/modules/Emails/Email.js
Modified: vtigercrm/trunk/modules/Emails/Email.js
==============================================================================
--- vtigercrm/trunk/modules/Emails/Email.js (original)
+++ vtigercrm/trunk/modules/Emails/Email.js Wed Jun 7 08:03:35 2006
@@ -10,82 +10,27 @@
var gFolderid = 1;
var gselectedrowid = 0;
-function massDelete()
-{
- var delete_selected_row = false;
- x = document.massdelete.selected_id.length;
- idstring = "";
- if ( x == undefined)
- {
-
- if (document.massdelete.selected_id.checked)
- {
- if(document.massdelete.selected_id.value == gselectedrowid)
- {
- gselectedrowid = 0;
- delete_selected_row = true;
- }
- idstring = document.massdelete.selected_id.value;
- xx = 1;
- }
- else
- {
- alert("Please select atleast one entity");
- return false;
- }
- }
- else
- {
- xx = 0;
- for(i = 0; i < x ; i++)
- {
- if(document.massdelete.selected_id[i].checked)
- {
- if(document.massdelete.selected_id[i].value == gselectedrowid)
- {
- gselectedrowid = 0;
- delete_selected_row = true;
- }
- idstring = document.massdelete.selected_id[i].value +";"+idstring
- xx++
- }
- }
- if (xx != 0)
- {
- document.massdelete.idlist.value=idstring;
- }
- else
- {
- alert("Please select atleast one entity");
- return false;
- }
- }
- if(confirm("Are you sure you want to delete the selected "+xx+" records ?"))
- {
- getObj('search_text').value = '';
- show("status");
- if(!delete_selected_row)
- var ajaxObj = new VtigerAjax(ajaxSaveResponse);
- else
- var ajaxObj = new VtigerAjax(ajaxDelResponse);
- var urlstring ="module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring;
- ajaxObj.process("index.php?",urlstring);
- }
- else
- {
- return false;
- }
-}
function DeleteEmail(id)
{
if(confirm("Are you sure you want to delete ?"))
{
getObj('search_text').value = '';
gselectedrowid = 0;
- show("status");
- var ajaxObj = new VtigerAjax(ajaxDelResponse);
- var urlstring ="module=Users&action=massdelete&return_module=Emails&folderid="+gFolderid+"&idlist="+id;
- ajaxObj.process("index.php?",urlstring);
+ $("status").style.display="inline";
+ new Ajax.Request(
+ 'index.php',
+ {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+ method: 'post',
+ postBody: "module=Users&action=massdelete&return_module=Emails&folderid="+gFolderid+"&idlist="+id,
+ onComplete: function(response) {ldelim}
+ $("status").style.display="none";
+ $('EmailDetails').innerHTML = '<table valign="top" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="forwardBg"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td colspan="2"> </td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
+ $("subjectsetter").innerHTML='';
+ $("email_con").innerHTML=response.responseText;
+ execJS($('email_con'));
+ {rdelim}
+ {rdelim}
+ );
}
else
{
@@ -98,8 +43,19 @@
var osearch_field = document.getElementById('search_field');
var search_field = osearch_field.options[osearch_field.options.selectedIndex].value;
var search_text = document.getElementById('search_text').value;
- var ajaxObj = new VtigerAjax(ajaxDelResponse);
- var urlstring ="module=Emails&action=EmailsAjax&ajax=true&file=ListView&folderid="+gFolderid+"&search=true&search_field="+search_field+"&search_text="+search_text;
- ajaxObj.process("index.php?",urlstring);
+ new Ajax.Request(
+ 'index.php',
+ {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
+ method: 'post',
+ postBody: "module=Emails&action=EmailsAjax&ajax=true&file=ListView&folderid="+gFolderid+"&search=true&search_field="+search_field+"&search_text="+search_text,
+ onComplete: function(response) {ldelim}
+ $("status").style.display="none";
+ $('EmailDetails').innerHTML = '<table valign="top" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="forwardBg"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td colspan="2"> </td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
+ $("subjectsetter").innerHTML='';
+ $("email_con").innerHTML=response.responseText;
+ execJS($('email_con'));
+ {rdelim}
+ {rdelim}
+ );
}
More information about the vtigercrm-commits
mailing list