The attached patch against DRUPAL-6--2 adds support to the print.module on the webform-submission-navigation links of the individual submission views. When the patch from #520682: Support print.module on results overview table is applied, the overview table may provide the link "Print" in addition to "View" for each submission. Admins will see "Previous submission" and "Next submission" links on each "View" or "Print" page. With this patch, the "Print" pages will provide these links to the printer-friendly versions instead of the normal nodes.

Comments

roball’s picture

StatusFileSize
new2.25 KB

Hm, the patch was missing - here it is. Tested successfully with Webform 6.x-2.8.

quicksketch’s picture

Status: Needs review » Needs work

New features are only being added to the 3.x branch (2.x is bug fixes only). If you can update this for the 3.x branch I'll be happy to add it. I'd suggest that you use a cleaner mechanism than if (preg_match("/^q=print\//", $_SERVER['QUERY_STRING'])) { though. How about if (arg(0) == 'print') {?

roball’s picture

Title: Support print.module on webform-submission-navigation » Support print.module
Version: 6.x-2.x-dev »
Status: Needs work » Needs review
StatusFileSize
new3.65 KB

OK - here is the patch against the HEAD branch (6.x-3.x-dev version), merged with #520682: Support print.module on results overview table. Would be great to get it committed.

What's bad with using preg_match()? (arg(0) == 'print') won't work on sites having the Drupal root directory accessed as a sub directory, resulting in URLs like www.yourdomain.tld/drupal/print/123/submission/456.

quicksketch’s picture

(arg(0) == 'print') won't work on sites having the Drupal root directory accessed as a sub directory

Sure it will, arg(0) gets you the first part of the "Drupal path", and works when Drupal is installed in a subdirectory and when clean URLs is on or off.

roball’s picture

StatusFileSize
new55.46 KB

Sorry - that was my feeling when I recognized that (arg(0) == 'print') didn't work on my site. For example, at https://www.iseki-food.eu/drupal/print/183/submission/130 arg() returns

Array
(
    [0] => node
    [1] => 183
    [2] => submission
    [3] => 130
)

while $_SERVER['QUERY_STRING'] returns

q=print/183/submission/130

so arg() can't be used to determine if the current URL has been parsed through the print.module, by replacing "node" in the URL by "print". Using $_SERVER['QUERY_STRING'] works, for both possible Clean URLs states.

acrollet’s picture

StatusFileSize
new2.11 KB

re-rolled with arg(0) against latest HEAD - tested working on a site that exists in a subdirectory...

roball’s picture

Adrian, please believe me - as posted in #5, arg(0) does NOT work on some sites, including the one I was referring to! My patch @ #3 DOES work, however and was fully tested successfully with all possible different scenarios. Too bad if a non-working patch would be prefered over a working one.

roball’s picture

quicksketch, did you change your plans to commit this patch to HEAD?

quicksketch’s picture

No I'll include it soon, I've just been extremely busy and working on Webform is always a bit of a daunting task. I reduced the issue queue from 700 down to 500 the past week, hopefully I'll get to implementing feature requests here again pretty soon.

roball’s picture

StatusFileSize
new3.65 KB

Excellent quicksketch! Thanks for all your work on this must-have module.

The attached patch has been tested successfully against the latest 6.x-3.x-dev version.

quicksketch’s picture

Status: Needs review » Fixed
StatusFileSize
new4.69 KB

I've totally borked this patch since it was last rolled, since a lot of things changed with #181077: Printable page for webform submissions. I updated it for the very latest and gave it a shot. It's pretty slick I have to say. I put in some extra help to make it so that we also support Print PDF, since it's nearly identical in implementation. So now we can print and PDF print submissions, pretty cool.

quicksketch’s picture

Title: Support print.module » Support print.module (Printable pages and PDFs)
roball’s picture

Thank you very much for committing the patch :-) Webform 6.x-3.x-dev (2010-Jan-22) is working great!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

irozner’s picture

i'm confused...
which patch i need to put for version 2.8?
can't wait for the 3.x
thanks

roball’s picture

irozner, my patch from reply #1 should work with the 2.x branch. The feature is officially available only in the 3.x branch.

roball’s picture

Version: » 6.x-3.8
Category: feature » bug
Status: Closed (fixed) » Active

Hm, I no longer see the "Print" entries with Webform 3.8. Any clues why?

quicksketch’s picture

Version: 6.x-3.8 » 6.x-3.x-dev
Category: bug » feature
Status: Active » Closed (fixed)

Please file a new issue for support requests or bug reports. This "feature request" has long been fixed.