Posted by dfahrney on August 24, 2008 at 6:56pm
| Project: | Webform Report |
| Version: | 6.x-2.0-rc1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Is there a way to add a search field to the reports. I flat out love the module but would like to have a way for the user to enter say a phone number and be able to search it and have the report display all records that match the requested data ?
Thanks
Dale
Comments
#1
#2
Any progress on this?
#3
any progress?? or any other way for searching through entries of submitted forms please help!!
#4
I am interested in this as well.
Although we can always do a Ctrl-F and search, but it's not the same, specially if there are multiple pages.
#5
With 6.x-2.0-beta4 you can set up a filter, but it is not yet exposed to users.
You can also sort by any column, and users can change that by clicking the column header.
So it's closer!
#6
Thank you, will try it soon.
#7
This would be fantastic!
#8
The attached patch does the following:
The patch was created in Beta5.
Please leave feedback!
#9
patch is working great!
#10
I'm unable to apply this patch.
I'm new to Cygwin and after issuing the command
patch -p0 < 299414.patchit's telling me:
bash: patch: command not foundany easier way to apply this patch? it's too long to do it manually.
#11
I don't use cygwin - you probably need to specify the complete path to the patch program, however.
I applied the patch to beta5 and attached the affected files. Hope this helps.
#12
Thanks Jim.
I applied the patch, but unfortunately the search only works under FireFox but not in IE 8, Chrome and Opera.
#13
The hidden fields are showing up in the Columns to search drop down (date and time that I used in the sort option).
Another suggestion is to keep the search section expanded once a search has been performed, because it is keeping the last search in memory and might confuse people.
#14
Thank you for the feeback.
The fix to exclude hidden columns is simple enough...
However, I don't understand why it only works in FF. When I tried to display your page in FF, I could not get the search column to drop down...
I have noted another issue - the search form does not work in a cached page. This may be the problem you are running into. Unless someone can think of a better idea, I think I will only display the search form to authenticated users - maybe I could check $GLOBALS['conf']['cache'] and display if caching is disabled (0).
#15
Is it working under IE for anyone else?
I use Boost cache and have excluded this page from caching, maybe that's why it's working under FF.
I know there is an unknown issue with my site and drop-down list, but a workaround is to use the up/down arrow keys for now.
#16
I replaced the files with the original beta5 files, so no traces of any patch.
Now even if we click on any of the column-headers, it's not sorting in that order. I'm not sure if this functionality worked before or not. Did anyone test this sorting?
#17
#18
Reopening, as the search field doesnt work at all here with 6.x-2.0-rc1, using postgresql database.
I'm viewing the report as admin (with firefox, fwiw), and regardless of what i put in the search field (and in the dropdown column selection) all submissions are shown. This is with default drupal install, i didn't specifically enable caching, and it's the same whether i configure filters or not.
There's also a 'Display Report Filter Form' checkbox option on the report criteria tab which does nothing (i looked at the code). Maybe it should be hidden/removed until it's implemented.
Sorting works fine. The filters themselves work fine.
#19
Thank you for the feedback!
There's also a 'Display Report Filter Form' checkbox option on the report criteria tab which does nothing (i looked at the code). Maybe it should be hidden/removed until it's implemented
This was inadvertently left from an earlier patch revision - I will take it out.
I'm viewing the report as admin (with firefox, fwiw), and regardless of what i put in the search field (and in the dropdown column selection) all submissions are shown. This is with default drupal install, i didn't specifically enable caching, and it's the same whether i configure filters or not.
The search appears to be working for me - can you insert some debug prints and post the output? I'm interested in the value of the $_SESSION variable around line 120 in webform_report.inc.
#20
Oh, i just found where it comes from. In fact it will only work on english websites :)
Fix is easy: in webform_report_search_form_submit(), replace 'Search' by t('Search') in the check for $form_state['values']['op']. Bam, it works. There could probably be a cleaner solution..
#21
Thank you posting the fix. I've created a patch, can you try it?
I refactored the search form and changed the submit to:
if ($form_state['values']['op'] == $form_state['values']['search']) {#22
Your patch works for me, thanks.
#23
Committed to CVS
#24
Using FireFox browser with the February 4th version of 6.x-2.x-dev and a special PHP code that was provided. When I do a search, it comes with the following error:
if (function_exists('ip2cc_get_country') && function_exists('theme_countryicons_icon')) { $headers[5] = 'Country Name'; $headers[6] = 'Country Code'; $headers[7] = 'Country Icon'; foreach($rows as $i => $row) { $ip = $row[4]['data']; $c = ip2cc_get_country($ip); $rows[$i][5]['data'] = $c->country_name; $rows[$i][6]['data'] = $c->country_code2; $rows[$i][7]['data'] = theme_countryicons_icon($c->country_code2); } }
If you go back and hit refresh the search works and displays the correct rows. However the error above stays above the header of the site.
The search doesn't work at all for IE 8 but displays the same error.
Tried it on two different sites with the same issue.
#25
The PHP code needs to start with
<?phpand end with
?>
#26
Yes, that was it, I changed the PHP code and it is working now under FireFox, however IE 8 still doesn't provide any results, just gives the full list.
#27
I think is a problem with caching. If I'm logged into the site, the search works - both in both FF and IE8. But it does not work for anonymous users.
I think I either need to disable this feature for anonymous users or disable caching when this feature is turned on.
What does the community think?
#28
#29
Caching is important, however search is a powerful option and most of the sites might need it.
My suggestion is to disable caching when this feature is on.
If it's not too hard, you might provide an option for the admin to choose between the two.
#30
The code will be change to disable the search form for anonymous users if site caching is enabled. If you want to change this behaviour, site caching will need to be disabled or the module can be altered to turn off site caching under certain conditions.
#31
Automatically closed -- issue fixed for 2 weeks with no activity.