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

Robertas’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new13.1 KB
avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review

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.

Robertas’s picture

StatusFileSize
new10.12 KB

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

  • Copy the webform2vtiger directory to the Drupal modules directory for your site
  • Login as an administrator. Enable the module in the "administer" -> "build" -> "modules"
  • Get vtiger CRM application unique key: it is found in variable $application_unique_key in vTiger configuration file [vTiger base]/config.inc.php
  • Configure your vtiger CRM settings in the "administer" -> "site configuration" -> "Webform to vtiger CRM" (admin/settings/webform2vtiger). Enter the url, path and unique application key of your vtiger CRM in the webform2vtiger settings at http://example.com/admin/settings/webform2vtiger.
  • Make new Drupal webform. Fields of webform can be binded to available vtiger CRM fields, using the dropdown button by each field setting (advanced settings).

 

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.

avpaderno’s picture

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 to t(), 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.

Robertas’s picture

Status: Needs work » Needs review
StatusFileSize
new4.72 KB

Attached file has been fixed of problems that kiam wrote about.
Only include_once() has not been changed not to break the program.

alladdin’s picture

Status: Needs review » Reviewed & tested by the community

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!

avpaderno’s picture

Status: Reviewed & tested by the community » Needs review

I would like to see a code review.

tigron’s picture

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 ?

stoltoguzzi’s picture

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?

Robertas’s picture

Component: miscellaneous » Miscellaneous
Status: Closed (won't fix) » Needs review

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?

You need to make sure you put configuration parameters right. Then it should work.

alladdin’s picture

Category: task » support

Dear Robertas,

I have some custom fields under Leads in vTiger ie ICQ, Skype. How can I add them to webform?

avpaderno’s picture

Category: support » task
kindafun’s picture

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!

ytin’s picture

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 .

baff’s picture

StatusFileSize
new76.66 KB
new48.97 KB

>>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?

ytin’s picture

StatusFileSize
new65.58 KB

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.

baff’s picture

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.

baff’s picture

Went back to Webform 6.x-2.9 - deleted everything - reinstalled - advanced settings are there now :-)

baff’s picture

Title: Robertas [Robertas] » Robertas [Robertas]: Custom Fields

Does one have to change webform2vtiger_fields.inc file for custom fields?

avpaderno’s picture

Title: Robertas [Robertas]: Custom Fields » Robertas [Robertas]

Keep in mind the purpose of this issue queue. For other questions, please contact the module author through the contact form.

avpaderno’s picture

Status: Needs review » Needs work
  1.         $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().

  2.   include 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().

riggatoney’s picture

Title: Robertas [Robertas] » vtigercrm 5.3, drupal 6+, webform2vtiger, PHP 5.3.1 -- FIX
StatusFileSize
new149.49 KB

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.

avpaderno’s picture

Title: vtigercrm 5.3, drupal 6+, webform2vtiger, PHP 5.3.1 -- FIX » Robertas [Robertas]
avpaderno’s picture

Status: Needs work » Closed (won't fix)
jsmm’s picture

Hi,
I take it this is not ready for production yet. I'm very interested and would test it. Thanks, Robertas.

surbhipatel’s picture

StatusFileSize
new232.66 KB
new180.13 KB
new187.56 KB

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

surbhipatel’s picture

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.

avpaderno’s picture

This CVS application has been declined; you will not get any support for the proposed module, here.

alvinet’s picture

Hello Robertas. May I know if you have any plan to upgrade your module to make it compatible with webform 3?

Regards

d0ngix’s picture

Component: Miscellaneous » miscellaneous

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

drhus’s picture

any news related to this integration using webform v.3x ??

Robertas’s picture

I have some custom fields under Leads in vTiger ie ICQ, Skype. How can I add them to webform?

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.

Robertas’s picture

Component: Miscellaneous » miscellaneous
Status: Needs review » Closed (won't fix)

I have followed the your instruction above but avail no luck.

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

Robertas’s picture

Yes - you have to edit this file.

#19
Posted by baff on August 2, 2010 at 4:10pm

Does one have to change webform2vtiger_fields.inc file for custom fields?

Robertas’s picture

StatusFileSize
new7.89 KB

any news related to this integration using webform v.3x ??

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!

Robertas’s picture

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

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

dsud’s picture

hello,
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,

Robertas’s picture

Please post all issues with webform2vtiger module and feature requests on the project page:
http://drupal.org/project/webform2vtiger

andylarks’s picture

Firstly, 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.

andylarks’s picture

Issue summary: View changes

Added link to module project page.

avpaderno’s picture

Component: miscellaneous » new project application
avpaderno’s picture

Status: Closed (won't fix) » Closed (duplicate)
Related issues: +#1345938: Webform2vTiger