Posted by Robertas on March 18, 2010 at 12:45pm
| Project: | Drupal.org CVS applications |
| Component: | miscellaneous |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
| Issue tags: | module review |
Issue Summary
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
Comments
#1
#2
Hello, 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.
#3
Attached 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.
#4
See 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.#5
Attached file has been fixed of problems that kiam wrote about.
Only include_once() has not been changed not to break the program.
#6
This 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!
#7
I would like to see a code review.
#8
I'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 ?
#9
Installation 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?
#10
You need to make sure you put configuration parameters right. Then it should work.
#11
Dear Robertas,
I have some custom fields under Leads in vTiger ie ICQ, Skype. How can I add them to webform?
#12
#13
I'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!
#14
Thank 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 .
#15
>>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?
#16
When 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.
#17
Ok - 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.
#18
Went back to Webform 6.x-2.9 - deleted everything - reinstalled - advanced settings are there now :-)
#19
Does one have to change webform2vtiger_fields.inc file for custom fields?
#20
Keep in mind the purpose of this issue queue. For other questions, please contact the module author through the contact form.
#21
<?php$message = 'Failed: response code was ' . $result->code;
watchdog('vtigerCRM', $message, WATCHDOG_ERROR);
?>
The function
watchdog()is still not correctly called; see how the function is called in actions_synchronize(), or book_admin_edit_submit().<?phpinclude drupal_get_path('module', 'webform2vtiger') . '/webform2vtiger_fields.inc';
?>
There is a Drupal function to load files containing PHP code that should be used instead of
include().#22
I 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.
#23
#24
#25
Hi,
I take it this is not ready for production yet. I'm very interested and would test it. Thanks, Robertas.
#26
Hello
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
#27
Hello
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.
#29
This CVS application has been declined; you will not get any support for the proposed module, here.
#30
Hello Robertas. May I know if you have any plan to upgrade your module to make it compatible with webform 3?
Regards
#31
Hi 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
#32
any news related to this integration using webform v.3x ??
#33
Once 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:
$webform2vtiger_available_fields = array('none' => 'Do Not Map',
[...]
'cf_539' => 'Skype' // added custom field
);
After that you should be able on your drupal webform edit that new field and map it to you vTiger custom field.
#34
Wrong 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
#35
Yes - you have to edit this file.
#36
Just 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!
#37
Please put configuration as follows:
The domain location of vtiger CRM:
crm.our-domain.com
The directory location of vtiger CRM:
(I mean - blank)
Robertas