[Vtigercrm-commits] [vtiger-commits] r7601 - in /vtigercrm/trunk: Smarty/templates/Emails.tpl include/js/general.js modules/Emails/Email.js
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 28 04:15:09 EDT 2006
Author: richie
Date: Wed Jun 28 02:15:02 2006
New Revision: 7601
Log:
issue in email massdelete has been fixed
Modified:
vtigercrm/trunk/Smarty/templates/Emails.tpl
vtigercrm/trunk/include/js/general.js
vtigercrm/trunk/modules/Emails/Email.js
Modified: vtigercrm/trunk/Smarty/templates/Emails.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Emails.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Emails.tpl Wed Jun 28 02:15:02 2006
@@ -11,53 +11,6 @@
-->*}
<!-- USER SETTINGS PAGE STARTS HERE -->
<script language="javascript">
-function gotoWebmail()
-{ldelim}
- new Ajax.Request(
- 'index.php',
- {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
- method: 'post',
- postBody: "module=Webmails&action=WebmailsAjax&file=ListView&config_chk=true",
- onComplete: function(response) {ldelim}
- if(response.responseText != 'SUCESS')
- $('mailconfchk').style.display = 'block';
- else
- window.location.href = "index.php?module=Webmails&action=index&parenttab=My Home Page";
- {rdelim}
- {rdelim}
- );
-
-{rdelim}
-
-function setSubject(subject)
-{ldelim}
- document.getElementById("subjectsetter").innerHTML=subject
-{rdelim}
-
-function getEmailContents(id)
-{ldelim}
- $("status").style.display="inline";
- var rowid = 'row_'+id;
- getObj(rowid).className = 'prvPrfHoverOn';
- if(gselectedrowid != 0 && gselectedrowid != id)
- {ldelim}
- var prev_selected_rowid = 'row_'+gselectedrowid;
- getObj(prev_selected_rowid).className = 'prvPrfHoverOff';
- {rdelim}
- gselectedrowid = id;
- new Ajax.Request(
- 'index.php',
- {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
- method: 'post',
- postBody: 'module=Emails&action=EmailsAjax&file=DetailView&mode=ajax&record='+id,
- onComplete: function(response) {ldelim}
- $("status").style.display="none";
- $("EmailDetails").innerHTML = response.responseText;
- {rdelim}
- {rdelim}
- );
-{rdelim}
-
function ShowFolders(folderid)
{ldelim}
$("status").style.display="inline";
@@ -109,23 +62,6 @@
);
{rdelim}
-function getListViewEntries_js(module,url)
-{ldelim}
- $("status").style.display="inline";
- new Ajax.Request(
- 'index.php',
- {ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
- method: 'post',
- postBody: "module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url,
- onComplete: function(response) {ldelim}
- $("status").style.display="none";
- $("email_con").innerHTML=response.responseText;
- execJS(document.getElementById('email_con'));
- {rdelim}
- {rdelim}
- );
-
-{rdelim}
</script>
{include file='Buttons_List.tpl'}
<script language="JavaScript" type="text/javascript" src="modules/Emails/Email.js"></script>
Modified: vtigercrm/trunk/include/js/general.js
==============================================================================
--- vtigercrm/trunk/include/js/general.js (original)
+++ vtigercrm/trunk/include/js/general.js Wed Jun 28 02:15:02 2006
@@ -1685,3 +1685,30 @@
}
}
+var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
+var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
+var bMoz = (navigator.appName == 'Netscape');
+function execJS(node) {
+ var st = node.getElementsByTagName('SCRIPT');
+ var strExec;
+ for(var i=0;i<st.length; i++) {
+ if (bSaf) {
+ strExec = st[i].innerHTML;
+ }
+ else if (bOpera) {
+ strExec = st[i].text;
+ }
+ else if (bMoz) {
+ strExec = st[i].textContent;
+ }
+ else {
+ strExec = st[i].text;
+ }
+ try {
+ eval(strExec);
+ } catch(e) {
+ alert(e);
+ }
+ }
+}
+
Modified: vtigercrm/trunk/modules/Emails/Email.js
==============================================================================
--- vtigercrm/trunk/modules/Emails/Email.js (original)
+++ vtigercrm/trunk/modules/Emails/Email.js Wed Jun 28 02:15:02 2006
@@ -10,6 +10,164 @@
var gFolderid = 1;
var gselectedrowid = 0;
+function gotoWebmail()
+{
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: "module=Webmails&action=WebmailsAjax&file=ListView&config_chk=true",
+ onComplete: function(response) {
+ if(response.responseText != 'SUCESS')
+ $('mailconfchk').style.display = 'block';
+ else
+ window.location.href = "index.php?module=Webmails&action=index&parenttab=My Home Page";
+ }
+ }
+ );
+
+}
+
+function setSubject(subject)
+{
+ document.getElementById("subjectsetter").innerHTML=subject
+}
+
+function getEmailContents(id)
+{
+ $("status").style.display="inline";
+ var rowid = 'row_'+id;
+ getObj(rowid).className = 'prvPrfHoverOn';
+ if(gselectedrowid != 0 && gselectedrowid != id)
+ {
+ var prev_selected_rowid = 'row_'+gselectedrowid;
+ getObj(prev_selected_rowid).className = 'prvPrfHoverOff';
+ }
+ gselectedrowid = id;
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: 'module=Emails&action=EmailsAjax&file=DetailView&mode=ajax&record='+id,
+ onComplete: function(response) {
+ $("status").style.display="none";
+ $("EmailDetails").innerHTML = response.responseText;
+ }
+ }
+ );
+}
+
+function getListViewEntries_js(module,url)
+{
+ $("status").style.display="inline";
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: "module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url,
+ onComplete: function(response) {
+ $("status").style.display="none";
+ $("email_con").innerHTML=response.responseText;
+ execJS(document.getElementById('email_con'));
+ }
+ }
+ );
+
+}
+
+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)
+ {
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: "module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring,
+ onComplete: function(response) {
+ $("status").style.display="none";
+ $("email_con").innerHTML=response.responseText;
+ execJS(document.getElementById('email_con'));
+ }
+ }
+ );
+ }
+ else
+ {
+ new Ajax.Request(
+ 'index.php',
+ {queue: {position: 'end', scope: 'command'},
+ method: 'post',
+ postBody: "module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring,
+ onComplete: function(response) {
+ $("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'));
+ }
+ }
+ );
+ }
+ }
+ else
+ {
+ return false;
+ }
+}
+
function DeleteEmail(id)
{
if(confirm("Are you sure you want to delete ?"))
More information about the vtigercrm-commits
mailing list