[TYPO3-mvc] frontend plugin and pdf_generator2

Reginaldo Arredondo reggiearre at googlemail.com
Thu Dec 30 03:36:33 CET 2010


Hi Franz,

thanks for the fast answer!

Do you directly see the booking details after the search, or do you first
> get a overview of found bookings and can click on a detail view?


Yes, you directly see the booking details after the search. The index view
is a search form with three input fields. (bookingnumber, billnumber,
containernumber) The user has to fill in at least one of the fields and
click on the submit button.
The showAction then searches for a booking by bookingnumber, billnumber or
containernumber (I did that with stacked IFs and ELSEs) and the found
booking is displayed in detail.



 How can I manage to insert a variable in the url so pdf_generator2 knows
>> which single view to generate as PDF?
>>
>
> Depends on the logic of your extension. If the pdf should directly be
> generated out of the search results you might have to switch the form to use
> 'get' method instead of 'post' and your PDF should work. If you have a
> detailView button, well, then simply pass the booking number via _GET
> parameters if you do different currently.
>

The PDF should be generated out of the detailed view. Once a user searched
for a booking and sees its details, I want to provide the possibility to
click on the PDF generator link (in my case an image) and see the detailed
view (in other words: the current page) as PDF.

I changed the method of the search form to get.
<f:form controller="Booking" action="show" method="get">
Bookingnumber: <f:form.textbox name="bookingnumber" />
Billnumber: <f:form.textbox name="billnumber" />
Containernumber: <f:form.textbox name="containernumber" />
<f:form.submit value="Search" />
</f:form>

Now I get this url:
http://127.0.0.1/bn_quicksite_2.1/customer-service/freight-tracking/?tx_rafreighttracking_publicsearch[__referrer][extensionName]=RaFreighttracking&tx_rafreighttracking_publicsearch[__referrer][controllerName]=Booking&tx_rafreighttracking_publicsearch[__referrer][actionName]=index&tx_rafreighttracking_publicsearch[__hmac]=a%3A5%3A{s%3A13%3A%22bookingnumber%22%3Bi%3A1%3Bs%3A10%3A%22billnumber%22%3Bi%3A1%3Bs%3A15%3A%22containernumber%22%3Bi%3A1%3Bs%3A6%3A%22action%22%3Bi%3A1%3Bs%3A10%3A%22controller%22%3Bi%3A1%3B}d471aabc4734fb6330b8cd7b9a45eb00a792ed4e&tx_rafreighttracking_publicsearch[bookingnumber]=SA001&tx_rafreighttracking_publicsearch[billnumber]=&tx_rafreighttracking_publicsearch[containernumber]=&=Search

The good thing: now the variables I need for the PDF generation are in the
url.
But the detailed view is not shown. -  The actionName is "index" in the url
although I set it to "show" in the form. Why is that?
I didn´t change anything but the method in the form. If I change it back to
post, the detailed view is shown.

Is this the way you suggested?

Is there a way to just add the bookingnumber, billnumber and containernumber
variables to the PDF generation link?

Maybe it is possible to add these variables to the url while using the post
method:
http://127.0.0.1/bn_quicksite_2.1/customer-service/freight-tracking/?tx_rafreighttracking_publicsearch[action]=show&tx_rafreighttracking_publicsearch[controller]=Booking
-- add variables here=>
&tx_rafreighttracking_publicsearch[bookingnumber]=SA001&tx_rafreighttracking_publicsearch[billnumber]=&tx_rafreighttracking_publicsearch[containernumber]=&cHash="cHash
string"

Thanks again for your help, I am trying to do this right since almost 2
weeks now.

regards,
Reggie


More information about the TYPO3-project-typo3v4mvc mailing list