[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Emails/ -> Email.js (source)

   1  /*********************************************************************************
   2  
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   ********************************************************************************/
  10  
  11  var gFolderid = 1;
  12  var gselectedrowid = 0;
  13  function gotoWebmail()
  14  {
  15      new Ajax.Request(
  16          'index.php',
  17          {queue: {position: 'end', scope: 'command'},
  18                      method: 'post',
  19              postBody: "module=Webmails&action=WebmailsAjax&config_chk=true",
  20              onComplete: function(response) {
  21                  if(response.responseText != 'SUCESS')
  22                      $('mailconfchk').style.display = 'block';
  23                  else
  24                      window.location.href = "index.php?module=Webmails&action=index&parenttab=My Home Page";
  25              }
  26          }
  27      );
  28  
  29  }
  30  
  31  function setSubject(subject)
  32  {
  33      document.getElementById("subjectsetter").innerHTML=subject
  34  }
  35  
  36  function getEmailContents(id)
  37  {
  38      $("status").style.display="inline";
  39      var rowid = 'row_'+id;
  40      getObj(rowid).className = 'emailSelected';
  41      if(gselectedrowid != 0 && gselectedrowid != id)
  42      {
  43          var prev_selected_rowid = 'row_'+gselectedrowid;
  44          getObj(prev_selected_rowid).className = 'prvPrfHoverOff';
  45      }
  46      gselectedrowid = id;
  47      new Ajax.Request(
  48          'index.php',
  49          {queue: {position: 'end', scope: 'command'},
  50              method: 'post',
  51              postBody: 'module=Emails&action=EmailsAjax&file=DetailView&mode=ajax&record='+id,
  52              onComplete: function(response) {
  53                          $("status").style.display="none";
  54                          $("EmailDetails").innerHTML = response.responseText;
  55                      }
  56              }
  57          );
  58  }
  59  
  60  function getListViewEntries_js(module,url)
  61  {
  62      $("status").style.display="inline";
  63      new Ajax.Request(
  64          'index.php',
  65          {queue: {position: 'end', scope: 'command'},
  66                      method: 'post',
  67              postBody: "module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url,
  68              onComplete: function(response) {
  69                  $("status").style.display="none";
  70                  $("email_con").innerHTML=response.responseText;
  71                  execJS(document.getElementById('email_con'));
  72              }
  73          }
  74      );
  75  
  76  }
  77  
  78  function massDelete()
  79  {
  80          var delete_selected_row = false;
  81          x = document.massdelete.selected_id.length;
  82          idstring = "";
  83          if ( x == undefined)
  84          {
  85  
  86                  if (document.massdelete.selected_id.checked)
  87                  {
  88                      if(document.massdelete.selected_id.value == gselectedrowid)
  89                      {
  90                          gselectedrowid = 0;
  91                          delete_selected_row = true;                        
  92                      }
  93                          idstring = document.massdelete.selected_id.value;
  94                          xx = 1;
  95                  }
  96                  else
  97                  {
  98                          alert("Please select at least one entity");
  99                          return false;
 100                  }
 101          }
 102          else
 103          {
 104                  xx = 0;
 105                  for(i = 0; i < x ; i++)
 106                  {
 107                          if(document.massdelete.selected_id[i].checked)
 108                          {
 109                              if(document.massdelete.selected_id[i].value == gselectedrowid)
 110                              {
 111                                  gselectedrowid = 0;
 112                                  delete_selected_row = true;                        
 113                              }
 114                              idstring = document.massdelete.selected_id[i].value +";"+idstring
 115                              xx++
 116                          }
 117                  }
 118                  if (xx != 0)
 119                  {
 120                          document.massdelete.idlist.value=idstring;
 121                  }
 122                  else
 123                  {
 124                          alert("Please select at least one entity");
 125                          return false;
 126                  }
 127          }
 128          if(confirm("Are you sure you want to delete the selected "+xx+" records ?"))
 129          {    
 130              getObj('search_text').value = '';
 131              show("status");
 132              if(!delete_selected_row)
 133              {
 134                  new Ajax.Request(
 135                          'index.php',
 136                          {queue: {position: 'end', scope: 'command'},
 137                          method: 'post',
 138                          postBody: "module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring,
 139                          onComplete: function(response) {
 140                          $("status").style.display="none";
 141                          $("email_con").innerHTML=response.responseText;
 142                          execJS(document.getElementById('email_con'));
 143                          }
 144                          }
 145                          );
 146              }
 147              else    
 148              {
 149                  new Ajax.Request(
 150                          'index.php',
 151                          {queue: {position: 'end', scope: 'command'},
 152                                  method: 'post',
 153                                  postBody: "module=Users&action=massdelete&folderid="+gFolderid+"&return_module=Emails&idlist="+idstring,
 154                                  onComplete: function(response) {
 155                                                  $("status").style.display="none";
 156                                                  $('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">&nbsp;</td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
 157                                                  $("subjectsetter").innerHTML='';
 158                                                  $("email_con").innerHTML=response.responseText;
 159                                                  execJS($('email_con'));
 160                                  }
 161                          }
 162                  );
 163              }
 164          }
 165          else
 166          {
 167              return false;
 168          }
 169  }
 170  
 171  function DeleteEmail(id)
 172  {
 173      if(confirm("Are you sure you want to delete ?"))
 174      {    
 175          getObj('search_text').value = '';
 176          gselectedrowid = 0;
 177          $("status").style.display="inline";
 178                  new Ajax.Request(
 179                          'index.php',
 180                          {queue: {position: 'end', scope: 'command'},
 181                                  method: 'post',
 182                                  postBody: "module=Users&action=massdelete&return_module=Emails&folderid="+gFolderid+"&idlist="+id,
 183                                  onComplete: function(response) {
 184                                                  $("status").style.display="none";
 185                                                  $('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">&nbsp;</td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
 186                                                  $("subjectsetter").innerHTML='';
 187                                                  $("email_con").innerHTML=response.responseText;
 188                                                  execJS($('email_con'));
 189                                  }
 190                          }
 191                  );
 192      }
 193      else
 194      {
 195          return false;
 196      }
 197  }
 198  function Searchfn()
 199  {
 200      gselectedrowid = 0;
 201      var osearch_field = document.getElementById('search_field');
 202      var search_field = osearch_field.options[osearch_field.options.selectedIndex].value;
 203      var search_text = document.getElementById('search_text').value;
 204      new Ajax.Request(
 205                  'index.php',
 206                  {queue: {position: 'end', scope: 'command'},
 207                          method: 'post',
 208                          postBody: "module=Emails&action=EmailsAjax&ajax=true&file=ListView&folderid="+gFolderid+"&search=true&search_field="+search_field+"&search_text="+search_text,
 209                          onComplete: function(response) {
 210                                          $("status").style.display="none";
 211                                          $('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">&nbsp;</td></tr></tbody></table></td></tr><tr><td style="padding-top: 10px;" bgcolor="#ffffff" height="300" valign="top"></td></tr></tbody></table>';
 212                                          $("subjectsetter").innerHTML='';
 213                                          $("email_con").innerHTML=response.responseText;
 214                                          execJS($('email_con'));
 215                          }
 216                  }
 217          );
 218  }
 219  


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7