Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Often a webform is used to gather information from the user that the administrator can use for different purposes. We are using webform to collect people that want to have a leaflet about our organization sent by postal service. It would be great if webform had the ability to mark submissions as read by some sort of toggle button?
Comment | File | Size | Author |
---|---|---|---|
#10 | webform-actions.png | 25.51 KB | arosboro |
Comments
Comment #1
quicksketchThis probably won't be added, but you can make a select component that is "Private" so that only administrators can see it and then change its value as submissions come in.
Comment #2
lsolesen CreditAttribution: lsolesen commentedOk. I already experimented a bit with that and it seems to work allright. The only thing though is that there is no way to see which submissions has been flagged from the overview.
Comment #3
athanor CreditAttribution: athanor commentedIn my case all submissions had to be reviewed by let's say "operators". So I use hook_webform_submission_actions to add a "Accept it" link to each submission. Action code changes the value of a new field, "status", in webform_submissions table.
To get better overview which submissions are accepted I replaced the IP address column from submission page to my "Status" column. Works fine.
I did try to this in my custom module but failed so I actually hacked few lines in webform.submissions.inc and webform.report.inc to accomplish this.
Comment #4
lsolesen CreditAttribution: lsolesen commentedCould you post the code?
Comment #5
quicksketchYeah, eventually this problem could be solved with Views, if #680386: Views integration for the webform_submitted_data table is completed.
Comment #6
athanor CreditAttribution: athanor commentedfunction webform_get_submissions($filters = array(), $header = NULL, $pager_count = 0) from webform.submissions.inc, added new line 701:
function webform_results_submissions($node, $user_filter, $pager_count) from webform.report.inc
replaced line 52 :
with:
in function theme_webform_results_submissions_header($variables) from webform.report.inc
changed the line 151 to:
same in function theme_webform_results_table_header($variables) from webform.report.inc
line 197: to
in my custom module hook_webform_submission_actions looks like this:
in my module_menu I registered menu item:
and function mymodule_submission_page($node, $submission) do the stuff I want and if everything is ok, changes the status field:
shows confimation message and redirects back to submission page.
Comment #7
quicksketchI've changed my position on this issue. After thinking about the way that other systems work (such as Gmail or any other e-mail system), they commonly provide two main toggles: "mark as read" and "flagged" (or "starred"). I think building this into the main Webform functionality would be similarly helpful. Rather than our current listing of submissions, turning it into a bulk-operation table could be enormously helpful. Then you could do things like "delete", "mark as read", or "flagged" to multiple submissions at the same time.
While the ability to use Views Bulk Operations to do this same thing should be supported, native support for "mark as read" sounds like a common enough thing that it would benefit the majority of users.
Comment #8
vernond CreditAttribution: vernond commented@quicksketch: A bundle of questions:
1) Are you thinking of adding this to submission view, table view, or both?
2) If both, will we be adding edit, view, delete actions into table view also?
3) Would the new actions (mark as read, starred et al) also be available in submission edit and view modes?
4) Do you envisage a new permission, or will 'access webform results' cover it adequately?
Regarding questions 1, 2 and 3: Or have I missed your point and the intention is to redesign the whole results interface?
Comment #9
quicksketchProbably just the listing of submissions. Viewing a submission would mark it "read". The table view would probably result in all submissions being marked read at the same time, which might not be desirable.
Yes I would think so.
Access webform results will be the same I think. Though I am wondering if we should have a toggle in the Webform settings somewhere (perhaps the e-mail configuration) for whether the submissions should be "marked as read" when an e-mail is sent.
I'm definitely not planning on an entire rewrite of the interface, just adding some abilities to the existing submission listings.
Comment #10
arosboro CreditAttribution: arosboro commentedI've implemented this feature request for a project I'm working on. I'd like the community to review it and accept this into a future webform 4.x release.
I'll post the patch when we've reviewed the functionality internally.
Comment #11
arosboro CreditAttribution: arosboro commentedHere is the patch. It changes the database schema, so don't install it on a production site. Only try this patch on a sandbox, or development server.
I only integrated views, I did not change the webform-ui. The new fields appear under webform submissions.
Comment #12
arosboro CreditAttribution: arosboro commentedFixed whitespace issues.
Comment #13
webnicola CreditAttribution: webnicola commentedThanks @arosboro!!
I tried to add this cool feature to 7.x-4.0-rc1 and ...
I changed the function 'webform_update_7409()' in 'webform_update_7418()' => 'Add columns to webform_submissions for "mark as read", "flag for follow up".'
Apparently everything seems to be going through. I created the view with the flag and mark as read.
But the links do not seem to work. The only thing that happens is the change of style font-weight normal to bold.
No flag, no mark as red, no data saved in the database.
Any suggestions? thanks
Comment #14
EKK CreditAttribution: EKK commentedThis is a great feature, Arosboro!
Did You get this module work in 7.x-4.0-rc1?
Comment #15
DanChadwick CreditAttribution: DanChadwick commentedwebnicola -- I have hidden the patch because applying it to a production site will result in subsequent database damage. It will cause the "real" update function to not run.
ANY SITE TO WHICH THE PATCH #11 or #12 IS APPLIED WILL BE DAMAGED.
I don't think a Mark as Read feature should be part of webform, but it certainly could be an add-on module, especially after we use views for the submission /result lists. Also, you can use a view as provided in the patch. I would like to see this moved into a module, such hook_schema_modify or another table.