 |
vtiger The Honest Open Source CRM
|
| Previous topic :: Next topic |
| Author |
Message |
Brett Shadbolt
Joined: 02 Jun 2005
Posts: 18
|
| Posted: Thu Jul 28, 2005 3:51 am Post subject: Customising fields in webforms |
|
|
Hi Guys,
I am playing with the webforms for lead and contact and would like to know how to customise the fields in the forms.
e.g. I want to also ask for first name and maybe even 1 or more custom fields.
I have tried editing index.php and send_data.php to add the field names but it doesn't work, obviously I am missing something somewhere.
Cheers,
Brett Shadbolt |
|
| Back to top |
|
tcape
Joined: 21 Aug 2005
Posts: 2
|
| Posted: Sun Aug 21, 2005 1:51 pm Post subject: Customising fields in webforms |
|
|
Log in as admin, click settings, go to Studio, click Lead custom Fields, create a custom field...
Same goes for contacts.....
The custom fileds will show up on the web form under custom information
Not sure how to edit the pre-created fields.... |
|
| Back to top |
|
Brett Shadbolt
Joined: 02 Jun 2005
Posts: 18
|
| Posted: Mon Aug 22, 2005 7:33 am Post subject: Customising fields in webforms |
|
|
Hi Tcape,
Thanks for the suggestion, but I'm not looking at the custom fields in the vtiger application itself - I'm interesting in customising the webforms which vtiger has made available for collecting leads from a website.
With 4.23 they release 2 new webforms, one for contacts and one for leads, the intention being that these be placed within a website to collect new contacts/leads. I want to know how to modify these forms and the info they collect.
Cheers,
Brett |
|
| Back to top |
|
alkatraz
Guest
|
| Posted: Mon Sep 26, 2005 12:10 am Post subject: Re: Customising fields in webforms |
|
|
| any update on this? |
|
| Back to top |
|
problemauto
Guest
Joined: 27 Oct 2005
Posts: 14
|
| Posted: Thu Oct 27, 2005 3:16 pm Post subject: Re: Customising fields in webforms |
|
|
Hello,
I did it on my website, it is not so complicated. You have to modify your webforms adding for example firstname with a text input field in the webform.
After that if you want to recover this data in vtiger, you have to modify send_data.php to add this new data :
Line 30 :
if($_REQUEST['create'] == 'lead')
{
$lastname = $_POST['lastname'];
$firstname = $_POST['firstname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$country = $_POST['country'];
$description = "WebForm : ".$_POST['description'];
Finally, you will have also to modify function "create_lead_from_webform" in contactserialize.php to add also this new field.
Line 975 :
function create_lead_from_webform($lastname,$firstname,$email,$phone,$company,$country,$description)
{
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
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;
$focus->column_fields['description'] = $description;
and Line 480
$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'),
array('return'=>'xsd:string'),
$NAMESPACE);
I hope that's all. I do not remenber any other modification.
Good luck
Problemauto |
|
| Back to top |
|
jpattoncook
Guest
Joined: 06 Oct 2005
Posts: 70
Location: Utah
|
| Posted: Tue Nov 29, 2005 6:37 am Post subject: Re: Customising fields in webforms |
|
|
I did it on my website, it is not so complicated. You have to modify your webforms adding for example firstname with a text input field in the webform.
After that if you want to recover this data in vtiger, you have to modify send_data.php to add this new data :
Finally, you will have also to modify function "create_lead_from_webform" in contactserialize.php to add also this new field.
Line 975 :
function create_lead_from_webform($lastname,$firstname,$email,$phone,$company,$country,$description)
{
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
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;
$focus->column_fields['description'] = $description;
and Line 480
$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'),
array('return'=>'xsd:string'),
$NAMESPACE);
Problemauto[/quote]
Where is the control point in the code for mapping fields/columns to tables?
Is it taken care of by contactserialize.php?
Or at some other level?
I'd like to add more to the form and store the data in a new table but I don't know the mechanism for mapping the logical to physical. |
|
| Back to top |
|
philgaertner
Guest
Joined: 04 Mar 2006
Posts: 4
|
| Posted: Sat Mar 04, 2006 4:39 pm Post subject: Re: Customising fields in webforms |
|
|
Forgive my Newbieness here. But can you post the changes to the webform code to add the firstname field to the form? I tried myself but found that the fields were not showing up correctly inside vtiger in the leads area. EG: email ended up in company name etc...
problemauto wrote: Hello,
I did it on my website, it is not so complicated. You have to modify your webforms adding for example firstname with a text input field in the webform.
After that if you want to recover this data in vtiger, you have to modify send_data.php to add this new data :
Line 30 :
if($_REQUEST['create'] == 'lead')
{
$lastname = $_POST['lastname'];
$firstname = $_POST['firstname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$country = $_POST['country'];
$description = "WebForm : ".$_POST['description'];
Finally, you will have also to modify function "create_lead_from_webform" in contactserialize.php to add also this new field.
Line 975 :
function create_lead_from_webform($lastname,$firstname,$email,$phone,$company,$country,$description)
{
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
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;
$focus->column_fields['description'] = $description;
and Line 480
$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'),
array('return'=>'xsd:string'),
$NAMESPACE);
I hope that's all. I do not remenber any other modification.
Good luck
Problemauto |
|
| Back to top |
|
philgaertner
Guest
Joined: 04 Mar 2006
Posts: 4
|
| Posted: Wed Mar 08, 2006 3:32 pm Post subject: Re: Customising fields in webforms |
|
|
| anyone??? |
|
| Back to top |
|
Joe e-CAP
Guest
Joined: 02 Feb 2006
Posts: 68
Location: Minnesota
|
| Posted: Fri Apr 28, 2006 9:58 pm Post subject: Re: Customising fields in webforms |
|
|
[quote="jpattoncook"]
After that if you want to recover this data in vtiger, you have to modify send_data.php to add this new data :
Finally, you will have also to modify function "create_lead_from_webform" in contactserialize.php to add also this new field.
Line 975 :
function create_lead_from_webform($lastname,$firstname,$email,$phone,$company,$country,$description)
{
global $adb;
$adb->println("Create New Lead from Web Form - Starts");
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;
$focus->column_fields['description'] = $description;
and Line 480
$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'),
array('return'=>'xsd:string'),
$NAMESPACE);
Make sure you have everything in the same order in contactserialize.php,
index.php, and in send data.php
it does make a diffrence had the same problem with mine but it was becasue i did not know i needed to add my fields to contactserialize |
|
| Back to top |
|
Naesstrom
Guest
Joined: 27 Nov 2006
Posts: 9
|
| Posted: Thu Jan 11, 2007 10:33 am Post subject: Re: Customising fields in webforms |
|
|
Hi everyone!
I thought I should try this since we wanted some more fields when customers fill in the webform but I can't find contactserialize.php... where is it? |
|
| Back to top |
|
| |
|