Closed (fixed)
Project:
Webform Report
Version:
6.x-2.0-beta5
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2010 at 15:12 UTC
Updated:
20 Feb 2011 at 23:40 UTC
| Comment | File | Size | Author |
|---|---|---|---|
| report.jpg | 212.39 KB | vako |
Comments
Comment #1
jimbullington commentedI've just added a PHP Code option in the 6.x-2.x-dev version. You may be able to use that do what you want.
Comment #2
vako commentedProbably I'm one of the users who don't know how to use the PHP code option. Can this module just borrow the code from the other module and incorporate it? No need to 're-invent the wheel', the code is already working in the Petition Node module.
Comment #3
jimbullington commentedSorry, I just don't think this option has a place in a general purpose module like this one - which is why I added the PHP Code option.
If you can email me (jimb at jrbcs dot com) a screen shot of your report criteria, I can probably help you come up with the PHP code you need.
Comment #4
vako commentedHi Jim, thanks for the quick response and offer for help. However I don't want you to invest too much time on it. I was hoping that it can become a feature of the module itself and not just a code for a single person like me...;)
What I want to do is put the flag of the country of each person who fills a form, provided they select their country from a pull-down list or better yet, according to their IP address the flag should automatically be generated. This is already done in the Petition Module that I indicated before and the capture of the IP address is done in the IP2CC module. you can see the report of the Petition module on the attached image to my initial post above.
I prefer to use Webform Report since it can serve many purposes and not just petitions.
Comment #5
jimbullington commentedI think this feature is just too specialized for the module. This is why I put in the PHP code option. I think over time we can develop some code examples that will help people use this option successfully.
Here is some example code that would address your requirement:
In this example I have a report with 5 columns (indexes 0 through 4), the last column being the Submitters IP Address. I get the ip address from this column
$row[4]['data']and feed it into ip2cc_get_country, which returns the country. Then I'm feeding the code into theme_countryicons_icon(), which returns the icon(flag). I'm adding three columns to the report, Country Name, Country Code, and the icon (flag). The example could be reworked to add the flag icon to an existing column, etc.Hope this helps.
Comment #6
jimbullington commentedI think this feature is just too specialized for the module. This is why I put in the PHP code option. I think over time we can develop some code examples that will help people use this option successfully.
Here is some example code that would address your requirement:
In this example I have a report with 5 columns (indexes 0 through 4), the last column being the Submitters IP Address. I get the ip address from this column
$row[4]['data']and feed it into ip2cc_get_country, which returns the country. Then I'm feeding the code into theme_countryicons_icon(), which returns the icon(flag). I'm adding three columns to the report, Country Name, Country Code, and the icon (flag). The example could be reworked to add the flag icon to an existing column, etc.Hope this helps.
Comment #7
jimbullington commentedI think this feature is just too specialized for the module. This is why I put in the PHP code option. I think over time we can develop some code examples that will help people use this option successfully.
Here is some example code that would address your requirement:
In this example I have a report with 5 columns (indexes 0 through 4), the last column being the Submitters IP Address. I get the ip address from this column
$row[4]['data']and feed it into ip2cc_get_country, which returns the country. Then I'm feeding the code into theme_countryicons_icon(), which returns the icon(flag). I'm adding three columns to the report, Country Name, Country Code, and the icon (flag). The example could be reworked to add the flag icon to an existing column, etc.Hope this helps.
Comment #8
jimbullington commentedSorry about the repeated posts - my browser locked up...
Comment #9
vako commentedThanks Jim, I added this code and made sure the IP2CC module is installed, what else needs to be done on Webform and Webform Report modules? i.e.: I already have the Country field but nothing showing up yet.
Comment #10
jimbullington commentedI had to enable Country API, IP to Country, and Country Icons. If you have a select for country, however, the code will have to be modified. As I said before, a screenshot of your Report Criteria would help.
Comment #11
vako commentedWhen I use this PHP code, the search option generates an error related to this code. please see the http://drupal.org/node/299414#comment-4050338
Comment #12
jimbullington commentedThe PHP code needs to start with
and end with.Comment #13
vako commentedThanks a lot Jim, your support is fantastic and I salute your knowledge with Drupal. We are lucky to have someone like you in this forum.
You are one of the best of the support groups here.
My issue is resolved and all your quick and efficient help is much appreciated.
Comment #14
jimbullington commented