[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/Smarty/templates/ -> AddProductToPriceBooks.tpl (source)

   1  <!--*********************************************************************************
   2  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   3   * ("License"); You may not use this file except in compliance with the License
   4   * The Original Code is:  vtiger CRM Open Source
   5   * The Initial Developer of the Original Code is vtiger.
   6   * Portions created by vtiger are Copyright (C) vtiger.
   7   * All Rights Reserved.
   8  *
   9   ********************************************************************************/
  10  -->
  11  {literal}
  12  <script language="javascript">
  13  function addtopricebook()
  14  {
  15      x = document.addToPB.selected_id.length;
  16      prod_array = new Array(x);
  17      idstring = "";
  18      if ( x == undefined)
  19      {
  20          if (document.addToPB.selected_id.checked)
  21          {
  22              yy = document.addToPB.selected_id.value+"_listprice";
  23              document.addToPB.idlist.value=document.addToPB.selected_id.value;
  24              var elem = document.addToPB.elements;
  25              var ele_len =elem.length;
  26              var i=0,j=0;
  27      
  28              for(i=0; i<ele_len; i++)
  29              {    
  30                  if(elem[i].name == yy)
  31                  {
  32                      if (elem[i].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) 
  33                      {
  34                          alert("List Price cannot be empty");
  35                                     return false;    
  36                      }    
  37                      else if(isNaN(elem[i].value))
  38                                          {
  39                                                  alert("Invalid List Price");
  40                                                  return false;
  41                                          }
  42  
  43                  }
  44              }    
  45              
  46          }
  47          else 
  48          {
  49              alert("Please select at least one entity");
  50              return false;
  51          }
  52      }
  53      else
  54      {
  55          xx = 0;
  56          for(i = 0; i < x ; i++)
  57          {
  58              if(document.addToPB.selected_id[i].checked)
  59              {
  60                  idstring = document.addToPB.selected_id[i].value +";"+idstring;
  61                   prod_array[xx] = document.addToPB.selected_id[i].value;
  62                  
  63                  xx++;    
  64              }
  65          }
  66          if (xx != 0)
  67          {
  68              document.addToPB.idlist.value=idstring;
  69              var elem = document.addToPB.elements;
  70                          var ele_len =elem.length;
  71                          var i=0,j=0;
  72  
  73                          for(i=0; i<ele_len; i++)
  74                          {
  75                                  for(j=0; j < xx; j++)
  76                                  {
  77                                          var xy= prod_array[j]+"_listprice";
  78                                          if(elem[i].name == xy)
  79                                          {
  80                          if (elem[i].value.replace(/^\s+/g, '').replace(/\s+$/g, '').length==0) 
  81                          {
  82                              alert("List Price cannot be empty");
  83                                      return false;    
  84                          }
  85                          else if(isNaN(elem[i].value))
  86                                              {
  87                                                      alert("Invalid List Price");
  88                                                      return false;
  89                                              }
  90      
  91                                          }
  92                                  }
  93                          }
  94  
  95          }
  96          else
  97          {
  98              alert("Please select at least one entity");
  99              return false;
 100          }
 101      }
 102  {/literal}
 103  document.addToPB.action="index.php?module=Products&action=addPbProductRelToDB&return_module=Products&return_action=DetailView&return_id={$RETURN_ID}"
 104  {rdelim}
 105  
 106  
 107  function updateAllListPrice(unitprice)
 108  {ldelim}
 109          var fieldname_array = new Array({$FIELD_NAME_ARRAY});
 110          var unitprice,fieldname;
 111      var id;
 112      var fieldinfo;
 113      var checkid;
 114  
 115          for(j=0; j<fieldname_array.length; j++)
 116          {ldelim}
 117          fieldinfo = fieldname_array[j].split("_");
 118          id = fieldinfo[0];
 119          checkid = "check_"+id;
 120  
 121                  fieldname=fieldname_array[j];
 122                  updateListPrice(unitprice,fieldname,document.getElementById(checkid));
 123          {rdelim}
 124  {rdelim}
 125  
 126  </script>
 127  <script language="javascript" src="modules/Products/Product.js"></script>
 128  <table width="95%" border="0" cellpadding="0" cellspacing="0">
 129  <tr><td colspan="3">&nbsp;</td></tr>
 130  <tr>
 131          <td>&nbsp;</td>
 132          <td class="showPanelBg">
 133  {$PRICEBOOKLISTHEADER}
 134  <table border="0" cellpadding="0" cellspacing="0"  width="100%">
 135    <tr height="20"> 
 136      <td  class="listFormHeaderLinks">
 137       <table border="0" cellpadding="0" cellspacing="0" width="100%">
 138          <tr>
 139              <td>&nbsp;{$RECORD_COUNTS}</td>
 140                 {$NAVIGATION}
 141          </tr>
 142       </table>
 143      </td>
 144     </tr>
 145     <tr>
 146                 <td>
 147                      <table style="background-color: rgb(204, 204, 204);" class="small" border="0" cellpadding="3" cellspacing="1" width="90%" align="center">
 148                               {$LISTHEADER}
 149                               {$LISTENTITY}
 150                      </table>
 151              </td>
 152     </tr>   
 153     <tr><td>&nbsp;</td></tr>
 154     </form>
 155  </table>
 156  
 157  </form>
 158  </table>
 159  </td>
 160  <td>&nbsp;</td>
 161  </tr>
 162  </table>
 163  
 164  


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