CVS edit link for Robertas
I have written working module (webform2vtiger) for integrations of drupal webforms with vtiger CRM Webforms. I would like to contribute this module to community for further development and testing.
I am using this module myself on a commerce site and it is very helpfull.
This new module is based in part on webform2sugar however has its own speficics dues to vtiger using different variable names, paths, application key, no compaigns for new leads etc. Since I do not use sugarCRM, I am not able to extend the webform2sugar module for vtiger and test it on both sugarCRM and vtiger CRM, since I use only vtiger. In addition these two modules seem to be growing more and more apart.
I thought I will share the code on drupal.org rather than on some other site.
Thanks!
Robertas Peteraitis
P.S. Module webform2vtiger is already created http://drupal.org/project/webform2vtiger
Comments
Comment #1
Robertas commentedComment #2
avpadernoHello, and thanks for applying for a CVS account. I am adding the review tags, and some volunteers will review your code, pointing out what needs to be changed.
As per http://drupal.org/cvs-application/requirements, the motivation message should be expanded to contain more details about the features of the proposed module, and it should include also a comparison with the existing solutions.
Comment #3
Robertas commentedAttached file is a bit improved and cleaned-up version of the module.
At this time there is no module for integration of vtiger CRM with Drupal on drupal.org . An other sites I was able to find Drupal module vtiger_forms ( http://drupal.org/node/541442 ) that is a very basic "proof of concept" type of example and as such does not really fit for a real-life business applications.
Webform2vtiger extends the Webform module with the ability to capture webform results as a new lead in vtiger CRM.
Requirements
Quickstart
Notice:
-You need at least to bind all required vtiger CRM fields for new leads - 'Last name', 'email' and 'company'. Else vtiger CRM doesn't save any lead!
-You can bind each vtiger CRM field just once in the same webform.
Comment #4
avpadernoSee http://drupal.org/coding-standards to understand how a module should be written. In particular, see the part about the namespace respect (how functions, Drupal variables, and global variables should be named), how the code should be formatted, and which Unicode functions should be used.
The license file should be removed as it cannot be committed in Drupal.org repository.
Messages passed to
watchdog()should not be passed tot(), as that is already done by the function.The function
ereg()is deprecated in PHP5.3, and it should not be used.Instead of
include_once(), the code should probably use the function made available from Drupal.Menu titles, and descriptions should not be passed to
t()as that is already done by Drupal core code.Comment #5
Robertas commentedAttached file has been fixed of problems that kiam wrote about.
Only include_once() has not been changed not to break the program.
Comment #6
alladdin commentedThis module has been installed and tested on our web-site (drupal 6.16).
It is very simple and efficient. Much more powerful than integration which is available from vtiger official web-site.
I have some troulbles getting it working but the problem was in wrong files attributes assigned to /vtigercrm/modules/Webforms folder and included files.
Integration is working fine now and without any bugs (as I can see at this point).
Thank you Robertas!
Comment #7
avpadernoI would like to see a code review.
Comment #8
tigron commentedI'm testing it out to see how it goes, so far installation flawless. Should I follow here or is there a thread somewhere else for the module ?
Comment #9
stoltoguzzi commentedInstallation was ok, now I can fill in a drupal webform and submit it.
in the logs I see:
Valid response recieved from vtiger CRM
Content of response (an empty response is a good thing!):
but in Vtiger there is no entry (Leads?)
any idea where to search for?
Comment #10
Robertas commentedYou need to make sure you put configuration parameters right. Then it should work.
Comment #11
alladdin commentedDear Robertas,
I have some custom fields under Leads in vTiger ie ICQ, Skype. How can I add them to webform?
Comment #12
avpadernoComment #13
kindafun commentedI'm having problems following the instructions to successful linkage with vTiger. When submitting a webform I get the following message:
Failed to add entry in to vtiger CRM.
Error Code: INVALID_USER_CREDENTIALS
Error Message: Invalid username or password
I have put in the vTiger Unique Application Key, domain, and path to vTiger. In the vTiger Webforms configuration file [vTiger base]/modules/Webforms/Webforms.config.php I put in the user access key for my admin account.
I wish to have anonymous visitors to my site submit a webform with their contact info and have it populate vTiger.
Robertas, thank you very much for creating this module!
Comment #14
ytin commentedThank you Robertas. It's working on my site without any problems. The directions need a li'l more clarification though. Here's what I had to make it working. I have installed vtiger as a subdomain so my installation was at crm.example.com .
1) Install webform2vtiger as you install a drupal module.
2) Copy the unique application key from the file "config.inc.php" under the root of your vtiger installation so in my case it was at crm.example.com/config.inc.php or write it down so that we can use it in step 5 when we go to Drupal Admin backend.
3) Login to your vtiger installation (I logged in as an admin) , on the right top corner you will see "My preferences" click on that and then under the "User Advanced Option" you will see an access key. Copy or write it down.
4) In your vtiger installation go to modules/Webforms/Webforms.config.php so for my site I opened up crm.example.com/modules/Webforms/Webforms.config.php . If in step 3 you logged in as an admin in your vtiger installation then in the Webforms.config.php the variable value for $defaultUserName should be "admin" and the value of the variable $defaultUserAccessKey should be the value you copied in Step 3. Make these changes and upload the file back up to your site.
5) Now go to admin section of your drupal site, and go to admin/settings/webform2vtiger. You will see three textboxes.
In the first box, "vtiger Unique Application Key" copy the key you got from Step 2.
In the second box, "domain location of your vtiger installation" enter example.com and not crm.example.com if your vtiger installation is in a subdomain. The subdomain part should go in the third textbox.
In the third box, "the directory location of vtiger crm" enter just the "crm" without any slashes.
6) Now go setup a webform as you normally do using the webform module, under Advanced setting of each field, you will have an opportunity to map the webform field to the vtiger lead form field. You MUST map these three fields for this module to work, Last Name, Company Name and Email Address. IT WON'T WORK IF YOU DO NOT MAP THESE THREE FIELDS.
Once you have done all these steps, it will work. I have tested it using Drupal 6.16 and Vtiger 5.1 .
Comment #15
baff commented>>6) Now go setup a webform as you normally do using the webform module, under Advanced setting of >>each field, you will have an opportunity to map the webform field to the vtiger lead form field. You >>MUST map these three fields for this module to work, Last Name, Company Name and Email Address. >>IT WON'T WORK IF YOU DO NOT MAP THESE THREE FIELDS.
Tried to install everything. What I do not get rigth is Nr. 6
I do not find under Advanced setting of each field, you will have an opportunity to map the webform field to the vtiger lead form field.
Should I find this under webform/components or webform/configure
E.g I have created an Last Name as a webform field - but I do not find advanced settings wher to map to vtiger ...
Maybe I did something wrong and thats why those mapping fields are not there?
Comment #16
ytin commentedWhen you go and edit a component in webform (such as a textfield) you should see it at the bottom of that page. Here's how it looks on my website.
Comment #17
baff commentedOk - I don't Advanced settings at all.
I am using Webform 6.x-3.0-beta6 - I will try an older one, because my webform form looks different to yours.
Comment #18
baff commentedWent back to Webform 6.x-2.9 - deleted everything - reinstalled - advanced settings are there now :-)
Comment #19
baff commentedDoes one have to change webform2vtiger_fields.inc file for custom fields?
Comment #20
avpadernoKeep in mind the purpose of this issue queue. For other questions, please contact the module author through the contact form.
Comment #21
avpadernoThe function
watchdog()is still not correctly called; see how the function is called in actions_synchronize(), or book_admin_edit_submit().There is a Drupal function to load files containing PHP code that should be used instead of
include().Comment #22
riggatoney commentedI was trying to implement this forever, only to find out vtigercrm doesn't support 5.3.1
the patch is located here, along with attached on the post:
http://forge.vtiger.com/frs/?group_id=238&release_id=617
I did the following:
1) Deleted vtiger crm folder
2) Uploaded new vtiger crm
3) Uploaded the files in the patch zip
4) Reinstalled vtiger
Everything worked including webform integration.
Comment #23
avpadernoComment #24
avpadernoComment #25
jsmm commentedHi,
I take it this is not ready for production yet. I'm very interested and would test it. Thanks, Robertas.
Comment #26
surbhipatel commentedHello
I have the pdf VTiger-DrupalWFVT Integration pdf. I installed vtiger crm 5.2.0 on my server http://openxcelluk.info/vtigercrm and installed webform and webform2vtiger on http://openxcelluk.info/test . I create the webform by mapping the fields to vtiger .Link to form is http://openxcelluk.info/test/node/140 .But I don't know why some how the lead is not generated in my crm
Below I am attaching my screen shots of webform2vtiger configuration page, My preference access key page,webform.config.php
Please help me out were I am wrong in the configuration of this module
Comment #27
surbhipatel commentedHello
When I checked the recent log entries I get the following error Invalid argument supplied for foreach() in /home/purvi/public_html/test/includes/common.inc on line 924.
Comment #29
avpadernoThis CVS application has been declined; you will not get any support for the proposed module, here.
Comment #30
alvinet commentedHello Robertas. May I know if you have any plan to upgrade your module to make it compatible with webform 3?
Regards
Comment #31
d0ngix commentedHi Robertas,
I have followed the your instruction above but avail no luck.
I just want to have some clarifications in the configuration (admin/settings/webform2vtiger).
Our vtiger was parked in a subdomain (crm.our-domain.com). Our main domain is www.our-domain.com.
Should I configure it as per below?
The domain location of vtiger CRM:
crm.our-domain.com
The directory location of vtiger CRM:
crm.our-domain.com
Thank you in advance.
Kind regards,
-d0ngix
Comment #32
drhus commentedany news related to this integration using webform v.3x ??
Comment #33
Robertas commentedOnce you add some custom fields to vTiger Leads, first you have to learn they "machine name". When you open lead in Firefox and use firebug you can inspect that custom field and see its name, for example cf_539.
Then you edit file webform2vtiger_fields.inc from this module and add this field and corresponding name, for example:
After that you should be able on your drupal webform edit that new field and map it to you vTiger custom field.
Comment #34
Robertas commentedWrong Application Key might be a problem. Please note where you get it:
Application key is found in variable application_unique_key in vTiger configuration file [vTiger base]/config.inc.php vTiger user access key, available in 'My Preference' page of vTiger after you log in with user that is used to submit data. The same user and key should be put in vTiger Webforms configuration file [vTiger base]/modules/Webforms/Webforms.config.php
Comment #35
Robertas commentedYes - you have to edit this file.
Comment #36
Robertas commentedJust today I upgrade this module so it would work with webform 3.14 and hopefully with all 3.x
The upgraded webform2vtiger module is attached to this post.
Enjoy!
Comment #37
Robertas commentedPlease put configuration as follows:
The domain location of vtiger CRM:
crm.our-domain.com
The directory location of vtiger CRM:
(I mean - blank)
Robertas
Comment #38
dsud commentedhello,
I want to integrate with Drupal 7 vtiger5.4, can you help me as there is a module that can do this integration for Drupal 6, which interests me is for Drupal 7. I can add some code that sends data in Drupal 7 webform to vtiger5.4 leads?
and thank you,
Comment #39
Robertas commentedPlease post all issues with webform2vtiger module and feature requests on the project page:
http://drupal.org/project/webform2vtiger
Comment #40
andylarks commentedFirstly, Robertas, thank you so much for this module!!!
I'm getting stuck with vTiger returning: INVALID_USER_CREDENTIALS - but I'm pretty sure that the login details are just fine.
I have: Webform 6.x-3.18, and Webform2vTiger 6.x-1.0-rc1, against vTiger 5.4
Anyone have any ideas? I am wondering whether it has anything to do with my vTiger install being on https?
Help REALLY appreciated!
Thanks
A.
Comment #40.0
andylarks commentedAdded link to module project page.
Comment #41
avpadernoComment #42
avpaderno