[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Emails/ -> ChooseEmail.php (source)

   1  <?php
   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  $pmodule=$_REQUEST['pmodule'];
  13  $entityid=$_REQUEST['entityid'];
  14  
  15  if ($pmodule=='Accounts')
  16  {
  17      $querystr="select fieldid,fieldlabel,columnname,tablename from vtiger_field where tabid=6 and uitype=13;"; 
  18  }
  19  elseif ($pmodule=='Contacts')
  20  {
  21      $querystr="select fieldid,fieldlabel,columnname from vtiger_field where tabid=4 and uitype=13;";
  22  }
  23  elseif ($pmodule=='Leads')
  24  {
  25      $querystr="select fieldid,fieldlabel,columnname from vtiger_field where tabid=7 and uitype=13;";
  26  }
  27  $result=$adb->query($querystr);
  28  $numrows = $adb->num_rows($result);
  29  
  30  if ($pmodule=='Accounts')
  31  {
  32      require_once ('modules/Accounts/Accounts.php');
  33      $myfocus = new Accounts();
  34      $myfocus->retrieve_entity_info($entityid,"Accounts");
  35  }
  36  elseif ($pmodule=='Contacts')
  37  {
  38      require_once ('modules/Contacts/Contacts.php');
  39      $myfocus = new Contacts();
  40      $myfocus->retrieve_entity_info($entityid,"Contacts");
  41  }
  42  elseif ($pmodule=='Leads')
  43  {
  44      require_once ('modules/Leads/Leads.php');
  45      $myfocus = new Leads();
  46      $myfocus->retrieve_entity_info($entityid,"Leads");
  47  }
  48  ?>
  49  <script language="javascript">
  50  function passemail()
  51  {        
  52      y=window.opener.document.EditView.parent_id.value+"<?php echo $entityid;?>";
  53      z=window.opener.document.EditView.parent_name.value;
  54      <?php 
  55      for ($x=0;$x<$numrows;$x++)
  56      {
  57          $temp=$adb->query_result($result,$x,'columnname');
  58          $temp1=br2nl($myfocus->column_fields[$temp]);
  59          if ($pmodule=='Accounts')
  60          {
  61              $fullname=br2nl($myfocus->column_fields['accountname']);
  62          }
  63          elseif ($pmodule=='Contacts')
  64          {
  65              $fname=br2nl($myfocus->column_fields['firstname']);
  66              $lname=br2nl($myfocus->column_fields['lastname']);
  67              $fullname=$lname.' '.$fname;
  68          }
  69          elseif ($pmodule=='Leads')
  70          {
  71              $fname=br2nl($myfocus->column_fields['firstname']);
  72              $lname=br2nl($myfocus->column_fields['lastname']);
  73              $fullname=$lname.' '.$fname;
  74          }
  75  ?>
  76          if (document.choosemails.emails<?php echo $x;?>.checked)
  77          {
  78                  y=y+"@<?php echo $adb->query_result($result,$x,'fieldid');?>";
  79                  z=z+"<?php echo $fullname.'<'.$temp1.'> ;';?>";
  80          }
  81  <?php 
  82      } 
  83  ?>
  84      
  85      window.opener.document.EditView.parent_id.value=y+"|";
  86      window.opener.document.EditView.parent_name.value=z;
  87      window.close();
  88  }
  89  </script>
  90  
  91  <form name="choosemails" method="post">
  92  <h4>The following emails are available for the selected record. Please choose the ones you would like to use.</h4>
  93  <div align="center">
  94     <table cellpadding="0" cellspacing="0" border="0">
  95      <?php 
  96      for ($i=0;$i<$numrows;$i++)
  97      {
  98          $temp=$adb->query_result($result,$i,'columnname');
  99          $temp1=br2nl($myfocus->column_fields[$temp]);
 100          echo '<tr><td>'.$adb->query_result($result,$i,'fieldlabel').' </td><td>&nbsp;&nbsp;&nbsp;<input name="emails'.$i.'" type="checkbox" title="Raju"></td><td>'.$temp1.'</tr>';
 101      }
 102      ?>
 103     </table>
 104  
 105  <input type="button" name="OK" onClick="passemail()" value="OK">
 106  </div>
 107  </form>


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