Project:Drupal.org CVS applications
Component:miscellaneous
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)
Issue tags:module review

Issue Summary

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

Comments

#1

Status:postponed (maintainer needs more info)» needs review
AttachmentSize
webform2vtiger.zip 13.1 KB

#2

Status:needs review» needs work

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

Status:needs work» needs review

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.

AttachmentSize
webform2vtiger.tar_.gz 10.12 KB

#4

Status:needs review» needs work

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.

#5

Status:needs work» needs review

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

AttachmentSize
webform2vtiger.tar_.gz 4.72 KB

#6

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!

#7

Status:reviewed & tested by the community» needs review

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

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.

#11

Category:task» support request

Dear Robertas,

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

#12

Category:support request» task

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

AttachmentSize
fields.jpg 48.97 KB
last_name.jpg 76.66 KB

#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.

AttachmentSize
vtigerform.png 65.58 KB

#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

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

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

#20

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.

#21

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

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

#22

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

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.

AttachmentSize
vtigercrm-510-on-php530-experiment-20100105.zip 149.49 KB

#23

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

#24

Status:needs work» closed (won't fix)

#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

AttachmentSize
accesskey.png 187.56 KB
webformtovtigerconfig.png 180.13 KB
webformtovtigerconfig.png 232.66 KB

#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

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

#32

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

#33

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.

#34

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

#35

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?

#36

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!

AttachmentSize
webform2vtiger module for webform 6.14 7.89 KB

#37

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

nobody click here