Support from Acquia helps fund testing for Drupal Acquia logo

Comments

diaxpro’s picture

Hi, I'm working on something like that, so far I have managed to show totals for the grid type, the next thing I do is to select, to have a while to upload a patch.

diaxpro’s picture

Component: Miscellaneous » Code
FileSize
6.02 KB
1.47 KB
28.48 KB
14.78 KB

Let me explain exactly does this patch, if the creator wishes to integrate to module would be happy to participate in any shortcomings.

This patch adds two new columns to the table webform_report, statistics and roles.

  • Statistics: Stores like columns, the components on which we want to take statistics with options and displays.
  • Roles: This column lets you store that roles will be able to access the webform_report so that we can delegate access to certain reports and certain roles.


If you already have installed webform_report, update module will be added by these two new fields to the table and if you have not installed it yet installed them.

When we apply the patch in the creation of webform report we see that now we have new statistics section where we can add fields in the webform, but only the grid , select and  textfield types.

 Once you add the field in the column can select between viewing display submissions (if not select any box submissions will be by default) and percentages (these options are only for grid and select) and options in the field we can add total, this total is the number of submissions * field key, and another is to show the average.

In the grid fields and select can also select which items or questions depends on the type we want to show. The default add them all.

In all these fields we add the filters are applied to select. Be prepared so that they can combine different filters affect the statistics correctly. If we add 3 filters the results have to be 3.

Was added to the final, the selection of roles we want to see the statistics.

And also supports export independent of the statistics and the columns.

I welcome your opinions and recommendations. A greeting.

diaxpro’s picture

FileSize
28.44 KB

Sorry but in file webform_report.inc_.patch in line 26
if( _webform_report_get_role_access($row->nid) || user_access('access webform reports') || $row->uid ==$user->uid)
change for
if( user_access('access webform reports') || $row->uid ==$user->uid)

this function
_webform_report_get_role_access($row->nid) is for other patch to module webform, control access to results by roles

And in webform_report_criteria.inc.patch in line 29

 -				if($c['type'] == 'grid' || $c['type'] == 'select' )
+				if($c['type'] == 'grid' || $c['type'] == 'select'  || $c['type']=='textfield')

Sorry.

jimbullington’s picture

Thank you for the patches!

Can you please remove the role restrictions from this patch and post another set of patches? It does not seem to apply to this issue - I think it belongs under a separate issue if you want to pursue it.

diaxpro’s picture

I re-created the patch deleting everything related to the restriction of roles. I could not prove it, if there are any problems please comment. I hope to be useful.

Regards.

DrewMathers’s picture

Status: Active » Needs work

I got

Parse error: syntax error, unexpected T_VARIABLE in /home/xxxxxx/public_html/sites/all/modules/webform_report/webform_report.module on line 296

Putting in the missing comma on 295 fixes the problem.


If you apply any filter (even one that displays all records) all statistics go to 0.

The Total label displays "Total Ponderate".

When the patches are applied, all items on the report are displayed in a single column.

Tesira’s picture

Is the statistic section lost in the 7.x Version of the modul?
I search for a possibility to get the sum of a culomn.

divan009’s picture

Issue summary: View changes

I am also looking for this for 7.x