 |
vtiger The Honest Open Source CRM
|
| Previous topic :: Next topic |
| Author |
Message |
j0nnnnn0
Joined: 29 Sep 2006
Posts: 17
Location: Switzerland
|
| Posted: Thu Oct 05, 2006 1:41 pm Post subject: Joomla Modules mod_lead - adding a required field |
|
|
I'm trying to do add in the vtiger to joomla module mod_lead a first name field.
I think my code is correct. However after generating the lead and synchronising within Vtiger, the firstname field is beeing seen as the email field, and all subsequent fields are pushed back, any idea why?
I use the same name field as in vtiger i.e Firtname = firstname
Now looking at how the mod_lead php files function there shouldn't be too many issues
I added in mod_lead.php
Code: if($_REQUEST["Lead"]) {
$lead = new VtigerLead();
$result = $lead->addLead($_REQUEST["lastname"],$_REQUEST["firstname"],$_REQUEST["email"],
and...
Code: <label for="mod_lead_lastname">
<?php echo _LAST_NAME; ?>:
</label>
<br />
<input name="lastname" id="mod_lead_lastname" type="text" class="inputbox" alt="lastname" />
<br />
<label for="mod_lead_firstname">
<?php echo _FIRST_NAME; ?>:
</label>
<br />
<input name="firstname" id="mod_lead_firstname" type="text" class="inputbox" alt="firstname" />
<br />
<label for="mod_lead_email">....
---
I add in VTigerLead.class.php
Code: function addLead($lastname,$firstname,$email,$phone,$company,$country,$description='')
{
$this->data = array(
'lastname' => $lastname,
'firstname' => $firstname,
'email' => $email,....
--- and finally I added in in Lead_english
Code: DEFINE('_LAST_NAME','Last Name');
DEFINE('_FIRST_NAME','First Name');
DEFINE('_PHONE','Phone');....
This should be it normally? However it is not working, any idea where I'm going wrong? |
|
| Back to top |
|
j0nnnnn0
Joined: 29 Sep 2006
Posts: 17
Location: Switzerland
|
| Posted: Sun Oct 08, 2006 5:03 pm Post subject: Re: Joomla Modules mod_lead - adding a required field |
|
|
OK We have a result :-)
The changes to mod_lead were right, we needed to do the same to the jportal.php file found within the additional SOAP files needed to make the integration to Joomla work
http://vtigerforge.fosslabs.com/frs/?group_id=12
soap.tar.gz
it is towards the END of the jportal
in jportal.php (from SOAP files)
+ sign = the lines added/edited
Code: $server->register(
'create_lead_from_webform',
array(
'lastname'=>'xsd:string',
+ 'firstname'=>'xsd:string',
'email'=>'xsd:string',
'phone'=>'xsd:string',
'company'=>'xsd:string',
'country'=>'xsd:string',
'description'=>'xsd:string',
'assigned_user_id'=>'xsd:string'
),
array('return'=>'xsd:string'),
$NAMESPACE);
+ function create_lead_from_webform($lastname, $firstname, $email, $phone, $company, $country, $description, $assigned_user_id) {
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
if($assigned_user_id == '')
{
//if the user id is empty then assign it to the admin user
$assigned_user_id = $adb->query_result($adb->query("select id from vtiger_users where user_name='admin'"),0,'id');
}
require_once("modules/Leads/Lead.php");
$focus = new Lead();
$focus->column_fields['lastname'] = $lastname;
+ $focus->column_fields['firstname'] = $firstname;
$focus->column_fields['email'] = $email;
$focus->column_fields['phone'] = $phone;
$focus->column_fields['company'] = $company;
$focus->column_fields['country'] = $country; |
|
| Back to top |
|
| |
|