[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Leads/ -> ConvertLead.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  require_once ('data/Tracker.php');
  13  require_once ('include/utils/utils.php');
  14  require_once ('include/database/PearDatabase.php');
  15  require_once ('include/utils/UserInfoUtil.php');
  16  
  17  global $mod_strings,$app_strings,$log,$current_user,$theme;
  18  
  19  $theme_path="themes/".$theme."/";
  20  $image_path=$theme_path."images/";
  21  require_once ($theme_path.'layout_utils.php');
  22  
  23  if(isset($_REQUEST['record']))
  24  {
  25      $id = $_REQUEST['record'];
  26      $log->debug(" the id is ".$id);
  27  }
  28  $category = getParentTab();
  29  //Retreive lead details from database
  30  $sql = "SELECT firstname, lastname, company, smownerid from vtiger_leaddetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_leaddetails.leadid where vtiger_leaddetails.leadid =".$id;
  31  $result = $adb->query($sql);
  32  $row = $adb->fetch_array($result);
  33  
  34  $firstname = $row["firstname"];
  35  $log->debug(" the firstname is ".$firstname);
  36  $lastname = $row["lastname"];
  37  $log->debug(" the lastname is ".$lastname);
  38  $company = $row["company"];
  39  $log->debug(" the company is  ".$company);
  40  $potentialname = $row["company"] ."-";
  41  $log->debug(" the vtiger_potentialname is ".$potentialname);
  42  $userid = $row["smownerid"];
  43  $log->debug(" the userid is ".$userid);
  44  
  45  //Retreiving the current user id
  46  $modified_user_id = $current_user->id;
  47  $log->info("Convert Lead view");
  48  
  49  $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
  50  
  51  $sales_stage_query="select * from vtiger_sales_stage";
  52  $sales_stage_result = $adb->query($sales_stage_query);
  53  $noofsalesRows = $adb->num_rows($sales_stage_result);
  54  $sales_stage_fld = '';
  55  for($j = 0; $j < $noofsalesRows; $j++)
  56  {
  57  
  58          $sales_stageValue=$adb->query_result($sales_stage_result,$j,strtolower(sales_stage));
  59  
  60          if($value == $sales_stageValue)
  61          {
  62                  $chk_val = "selected";
  63          }
  64          else
  65          {
  66                  $chk_val = '';
  67          }
  68  
  69          $sales_stage_fld.= '<OPTION value="'.$sales_stageValue.'" '.$chk_val.'>'.$sales_stageValue.'</OPTION>';
  70  }
  71  $convertlead = '<form name="ConvertLead" method="POST" action="index.php">
  72      <input type="hidden" name="module" value="Leads">
  73      <input type="hidden" name="record" value="'.$id.'">
  74      <input type="hidden" name="action">
  75      <input type="hidden" name="parenttab" value="'.$category.'">
  76      <input type="hidden" name="current_user_id" value="'.$modified_user_id.'">
  77      
  78      <div id="orgLay" style="display: block;" class="layerPopup" >
  79      <table width="100%" border="0" cellpadding="5" cellspacing="0" class="layerHeadingULine">
  80          <tr>
  81              <td class="genHeaderSmall" align="left"><IMG src="'.$image_path.'Leads.gif">'.$mod_strings['LBL_CONVERT_LEAD'].' '.$firstname.' '.$lastname.'</td>
  82              <td align="right"><a href="javascript:fninvsh(\'orgLay\');"><img src="'.$image_path.'close.gif" align="absmiddle" border="0"></a></td>
  83          </tr>
  84          </table>
  85      
  86      <table border=0 cellspacing=0 cellpadding=0 width=95% align=center> 
  87      <tr>
  88          <td class=small >
  89              <table border=0 celspacing=0 cellpadding=5 width=100% align=center bgcolor=white>
  90                  <tr>
  91                          <td colspan="2" class="detailedViewHeader"><b>'.$mod_strings['LBL_CONVERT_LEAD_INFORMATION'].'</b></td>
  92                  </tr>
  93                  <tr>
  94                          <td align="right" class="dvtCellLabel" width="50%">'.$app_strings['LBL_ASSIGNED_TO'].'</td>
  95                             <td class="dvtCellInfo" width="50%">
  96                                  <select name="assigned_user_id" class="detailedViewTextBox">'.get_select_options_with_id(get_user_array(false), $userid).'</select>
  97                          </td>
  98                  </tr>
  99                  <tr>
 100                      <td align="right" class="dvtCellLabel">'.$mod_strings['LBL_ACCOUNT_NAME'].'</td>
 101                      <td class="dvtCellInfo"><input type="text" name="account_name" class="detailedViewTextBox" value="'.$company.'" readonly="readonly"></td>
 102              </tr>';
 103  
 104  if(isPermitted("Potentials",'EditView') == 'yes')
 105  {
 106  $convertlead .='<tr>
 107              <td align="right" class="dvtCellLabel">'.$mod_strings['LBL_DO_NOT_CREATE_NEW_POTENTIAL'].'</td>
 108              <td class="dvtCellInfo"><input type="checkbox" name="createpotential" onClick="fnSlide2(\'ch\',\'cc\')"></td>
 109          </tr>
 110          <tr>
 111              <td colspan="2" id="ch" height="100" style="padding:0px;" >
 112                  <div style="display:block;" id="cc"  >
 113                      <table width="100%" border="0" cellpadding="5" cellspacing="0" >
 114                          <tr>
 115                              <td align="right" class="dvtCellLabel" width="53%"><font color="red">*</font>'.$mod_strings['LBL_POTENTIAL_NAME'].'</td>
 116                              <td class="dvtCellInfo" width="47%">
 117                              <input name="potential_name" class="detailedViewTextBox" value="'.$potentialname.'" tabindex="3">
 118                                                          </td>
 119                          </tr>
 120                          <tr>
 121                              <td align="right" class="dvtCellLabel"><font color="red">*</font>'.$mod_strings['LBL_POTENTIAL_CLOSE_DATE'].'</td>
 122                              <td class="dvtCellInfo">
 123                                  <input name="closedate" style="border: 1px solid rgb(186, 186, 186);" id="jscal_field_closedate" type="text" tabindex="4" size="10" maxlength="10" value="'.$focus->closedate.'">
 124                                  <img src="'.$image_path.'calendar.gif" id="jscal_trigger_closedate" >
 125                                  <font size=1><em old="(yyyy-mm-dd)">('.$current_user->date_format.')</em></font>
 126                              <script id="conv_leadcal">
 127                                  getCalendarPopup(\'jscal_trigger_closedate\',\'jscal_field_closedate\',\''.$date_format.'\')
 128                              </script>
 129                              </td>
 130                          </tr>
 131                          <tr>
 132                              <td align="right" class="dvtCellLabel">'.$mod_strings['LBL_POTENTIAL_AMOUNT'].'</td>
 133                              <td class="dvtCellInfo"><input type="text" name="potential_amount" class="detailedViewTextBox">'.$potential_amount.'</td>
 134                          </tr>
 135                          <tr>
 136                              <td align="right" class="dvtCellLabel"><font color="red">*</font>'.$mod_strings['LBL_POTENTIAL_SALES_STAGE'].'</td>
 137                              <td class="dvtCellInfo"><select name="potential_sales_stage" class="detailedViewTextBox">'.$sales_stage_fld.'</select></td>
 138                          </tr>
 139                      </table>
 140                  </div>
 141              </td>
 142          </tr>';
 143  }
 144  $convertlead .='</table>
 145              </td>
 146          </tr>
 147      </table>
 148      <table border=0 cellspacing=0 cellpadding=5 width=100% class="layerPopupTransport">
 149      <tr>
 150              <td align="center">
 151                  <input name="Save" value=" '.$app_strings['LBL_SAVE_BUTTON_LABEL'].' " onclick="this.form.action.value=\'LeadConvertToEntities\'; return verify_data(ConvertLead)" type="submit"  class="crmbutton save small">&nbsp;&nbsp;
 152                  <input type="button" name=" Cancel " value=" '.$app_strings['LBL_CANCEL_BUTTON_LABEL'].' " onClick="hide(\'orgLay\')" class="crmbutton cancel small">
 153              </td>
 154          </tr>
 155      </table>
 156  </div></form>';
 157  echo $convertlead;
 158  
 159  ?>


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