[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Accounts/ -> Account.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  
  12  document.write("<script type='text/javascript' src='include/js/Inventory.js'></"+"script>");
  13  document.write("<script type='text/javascript' src='include/js/Mail.js'></"+"script>");
  14  document.write("<script type='text/javascript' src='include/js/Merge.js'></"+"script>");
  15  
  16  function set_return(product_id, product_name) {
  17          window.opener.document.EditView.parent_name.value = product_name;
  18          window.opener.document.EditView.parent_id.value = product_id;
  19  }
  20  function set_return_specific(product_id, product_name) {
  21          
  22          //getOpenerObj used for DetailView 
  23      if(document.getElementById('from_link').value != '')
  24      {
  25          var fldName = window.opener.document.QcEditView.account_name;
  26          var fldId = window.opener.document.QcEditView.account_id;
  27      }else
  28      {    
  29          var fldName = window.opener.document.EditView.account_name;
  30          var fldId = window.opener.document.EditView.account_id;
  31      }
  32          fldName.value = product_name;
  33          fldId.value = product_id;
  34  }
  35  function add_data_to_relatedlist(entity_id,recordid) {
  36  
  37          opener.document.location.href="index.php?module=Emails&action=updateRelations&destination_module=Accounts&entityid="+entity_id+"&parid="+recordid;
  38  }
  39  function set_return_formname_specific(formname,product_id, product_name) {
  40          window.opener.document.EditView1.account_name.value = product_name;
  41          window.opener.document.EditView1.account_id.value = product_id;
  42  }
  43  function set_return_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country,bill_pobox,ship_pobox) {
  44          window.opener.document.EditView.account_name.value = account_name;
  45          window.opener.document.EditView.account_id.value = account_id;
  46          window.opener.document.EditView.bill_street.value = bill_street;
  47          window.opener.document.EditView.ship_street.value = ship_street;
  48          window.opener.document.EditView.bill_city.value = bill_city;
  49          window.opener.document.EditView.ship_city.value = ship_city;
  50          window.opener.document.EditView.bill_state.value = bill_state;
  51          window.opener.document.EditView.ship_state.value = ship_state;
  52          window.opener.document.EditView.bill_code.value = bill_code;
  53          window.opener.document.EditView.ship_code.value = ship_code;
  54          window.opener.document.EditView.bill_country.value = bill_country;
  55          window.opener.document.EditView.ship_country.value = ship_country;
  56          window.opener.document.EditView.bill_pobox.value = bill_pobox;
  57          window.opener.document.EditView.ship_pobox.value = ship_pobox;
  58  }
  59  //added to populate address
  60  function set_return_contact_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country,bill_pobox,ship_pobox ) {
  61          window.opener.document.EditView.account_name.value = account_name;
  62          window.opener.document.EditView.account_id.value = account_id;
  63          window.opener.document.EditView.mailingstreet.value = bill_street;
  64          window.opener.document.EditView.otherstreet.value = ship_street;
  65          window.opener.document.EditView.mailingcity.value = bill_city;
  66          window.opener.document.EditView.othercity.value = ship_city;
  67          window.opener.document.EditView.mailingstate.value = bill_state;
  68          window.opener.document.EditView.otherstate.value = ship_state;
  69          window.opener.document.EditView.mailingzip.value = bill_code;
  70          window.opener.document.EditView.otherzip.value = ship_code;
  71          window.opener.document.EditView.mailingcountry.value = bill_country;
  72          window.opener.document.EditView.othercountry.value = ship_country;
  73          window.opener.document.EditView.mailingpobox.value = bill_pobox;
  74          window.opener.document.EditView.otherpobox.value = ship_pobox;
  75  }
  76  
  77  //added by rdhital/Raju for emails
  78  function submitform(id){
  79          document.massdelete.entityid.value=id;
  80          document.massdelete.submit();
  81  }    
  82  
  83  function searchMapLocation(addressType)
  84  {
  85          var mapParameter = '';
  86          if (addressType == 'Main')
  87          {
  88          if(fieldname.indexOf('bill_street') > -1)
  89                          mapParameter = document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_street')]).innerHTML+' ';
  90                  if(fieldname.indexOf('bill_pobox') > -1)
  91                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_pobox')]).innerHTML+' ';
  92                  if(fieldname.indexOf('bill_city') > -1)
  93                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_city')]).innerHTML+' ';
  94          if(fieldname.indexOf('bill_state') > -1)
  95                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_state')]).innerHTML+' ';
  96                  if(fieldname.indexOf('bill_country') > -1)
  97                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_country')]).innerHTML+' ';
  98                  if(fieldname.indexOf('bill_code') > -1)
  99                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('bill_code')]).innerHTML+' ';
 100          }
 101          else if (addressType == 'Other')
 102          {
 103          if(fieldname.indexOf('ship_street') > -1)
 104                          mapParameter = document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_street')]).innerHTML+' ';
 105                  if(fieldname.indexOf('ship_pobox') > -1)
 106                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_pobox')]).innerHTML+' ';
 107                  if(fieldname.indexOf('ship_city') > -1)
 108                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_city')]).innerHTML+' ';
 109                  if(fieldname.indexOf('ship_state') > -1)
 110                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_state')]).innerHTML+' ';
 111          if(fieldname.indexOf('ship_country') > -1)
 112                          mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_country')]).innerHTML+' ';
 113                  if(fieldname.indexOf('bill_code') > -1)                                                                                            mapParameter = mapParameter + document.getElementById("dtlview_"+fieldlabel[fieldname.indexOf('ship_code')]).innerHTML+' ';
 114  
 115          }
 116       window.open('http://maps.google.com/maps?q='+mapParameter,'goolemap','height=450,width=700,resizable=no,titlebar,location,top=200,left=250');
 117  }
 118  //javascript function will open new window to display traffic details for particular url using alexa.com
 119  function getRelatedLink()
 120  {
 121      var param='';
 122      param = getObj("website").value;
 123      window.open('http://www.alexa.com/data/details/traffic_details?q=&url='+param,'relatedlink','height=400,width=700,resizable=no,titlebar,location,top=250,left=250');
 124  }
 125  
 126  /*
 127  * javascript function to populate fieldvalue in account editview
 128  * @param id1 :: div tag ID
 129  * @param id2 :: div tag ID
 130  */
 131  function populateData(id1,id2)
 132  {
 133      document.EditView.description.value = document.getElementById('summary').innerHTML;
 134      document.EditView.employees.value = getObj('emp').value;
 135      document.EditView.website.value = getObj('site').value;
 136      document.EditView.phone.value = getObj('Phone').value;
 137      document.EditView.fax.value = getObj('Fax').value;
 138      document.EditView.bill_street.value = getObj('address').value;
 139      
 140      showhide(id1,id2);
 141  }
 142  /*
 143  * javascript function to show/hide the div tag
 144  * @param argg1 :: div tag ID
 145  * @param argg2 :: div tag ID
 146  */
 147  function showhide(argg1,argg2)
 148  {
 149          var x=document.getElementById(argg1).style;
 150      var y=document.getElementById(argg2).style;
 151          if (y.display=="none")
 152          {
 153                  y.display="block"
 154          x.display="none"
 155  
 156          }
 157  }
 158  
 159  // JavaScript Document
 160  
 161  if (document.all) var browser_ie=true
 162  else if (document.layers) var browser_nn4=true
 163  else if (document.layers || (!document.all && document.getElementById)) var browser_nn6=true
 164  
 165  function getObj(n,d) {
 166    var p,i,x;
 167    if(!d)d=document;
 168    if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 169    if(!(x=d[n])&&d.all)x=d.all[n];
 170    for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 171    for(i=0;!x&&d.layers&&i<d.layers.length;i++)  x=getObj(n,d.layers[i].document);
 172    if(!x && d.getElementById) x=d.getElementById(n);
 173    return x;
 174  }
 175  
 176  
 177  function findPosX(obj) {
 178          var curleft = 0;
 179          if (document.getElementById || document.all) {
 180                  while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent;}
 181          }
 182          else if (document.layers) { curleft += obj.x; }
 183          return curleft;
 184  }
 185  
 186  
 187  function findPosY(obj) {
 188          var curtop = 0;
 189          if (document.getElementById || document.all) {
 190                  while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; }
 191          }
 192          else if (document.layers) {curtop += obj.y;}
 193          return curtop;
 194  }
 195  
 196  ScrollEffect = function(){ };
 197  ScrollEffect.lengthcount=202;
 198  ScrollEffect.closelimit=0;
 199  ScrollEffect.limit=0;
 200  
 201  
 202  function just(){
 203          ig=getObj("company");
 204          if(ScrollEffect.lengthcount > ScrollEffect.closelimit ){closet();return;}
 205          ig.style.display="block";
 206          ig.style.height=ScrollEffect.lengthcount+'px';
 207          ScrollEffect.lengthcount=ScrollEffect.lengthcount+10;
 208          if(ScrollEffect.lengthcount < ScrollEffect.limit){setTimeout("just()",25);}
 209          else{ getObj("innerLayer").style.display="block";return;}
 210  }
 211  
 212  function closet(){
 213          ig=getObj("company");
 214          getObj("innerLayer").style.display="none";
 215          ScrollEffect.lengthcount=ScrollEffect.lengthcount-10;
 216          ig.style.height=ScrollEffect.lengthcount+'px';
 217          if(ScrollEffect.lengthcount<20){ig.style.display="none";return;}
 218          else{setTimeout("closet()", 25);}
 219  }
 220  
 221  
 222  function fnDown(obj){
 223          var tagName = document.getElementById(obj);
 224          document.EditView.description.value = document.getElementById('summary').innerHTML;
 225          document.EditView.employees.value = getObj('emp').value;
 226          document.EditView.website.value = getObj('site').value;
 227          document.EditView.phone.value = getObj('Phone').value;
 228          document.EditView.fax.value = getObj('Fax').value;
 229          document.EditView.bill_street.value = getObj('address').value;
 230          if(tagName.style.display == 'none')
 231                  tagName.style.display = 'block';
 232          else
 233                  tagName.style.display = 'none';
 234  }
 235  
 236  function set_return_todo(product_id, product_name) {
 237          window.opener.document.createTodo.task_parent_name.value = product_name;
 238          window.opener.document.createTodo.task_parent_id.value = product_id;
 239  }
 240  


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