Forums

Add Print Button to Print User Submitted Information

cruser 19 Jul, 2018
I have a work order form setup in ChronoformsV6 that allows users to submit requested work. I use a form in ConnectivityV6 to edit the information that user submitted so the order can be assigned to employees, status updates, etc. Once I have that information edited I need to be able to send the page containing the information to a printer so the page can be handed out to the employee. So far I cannot figure out how to add something like the code below without getting an error 404 in my admin console:
<a href="#" onclick="window.print();return false;">Print this page</a>
Can anyone please help? I've searched and searched and I help is what I need!
GreyHead 20 Jul, 2018
Hi cruser,

There is a FAQ here for CFv4 and v5 that might help you do this?

Bob
cruser 20 Jul, 2018
What I am trying to do should be done in Chronoforms and not in Connectivity?
healyhatman 21 Jul, 2018
You can do pretty much anything from CF in CC and vice versa.
cruser 23 Jul, 2018
And this where I am stuck. I just cannot wrap my mind around how to make this work in ConnectivityV6. If you have a way, please share!
healyhatman 23 Jul, 2018
Create a HTML view with the code Bob supplied, let's call this "print_link"

In your index event (or whatever event you want it shown in), in the place you want it shown, call the view with {view:print_link}
cruser 23 Jul, 2018
I cannot get the code in the FAQ's to work in CCV6, o be sure there is an easier way. Adding code from "Code for ChronoForms v4 using MooTools" section throws a 404 and adding code from "Code for ChronoForms v5 using jQuery" has no effect, nothing is displayed. Is there another way around this?
healyhatman 23 Jul, 2018
I put that code that YOU provided on my connection and it worked instantly. What's the problem exactly?
healyhatman 23 Jul, 2018
Don't event need to put it in a view, just put it straight into the event
cruser 23 Jul, 2018
ODD! Each time I save my connection with the simple print code I provided my site throws a 404 error.



Both CF and CC are V6 and both are validated on my domain.
cruser 23 Jul, 2018
The 404 error spawns when I save the connection with that print code in it.
healyhatman 23 Jul, 2018
Check your server's mod_security settings, it's probably filtering out a certain string and breaking it.
cruser 23 Jul, 2018
Could it be that? I can save the print code above anywhere else in the site (except CF and CC) without error.
healyhatman 23 Jul, 2018
That EXACT thing has happened to me multiple times so yes : check mod_security or the logs for same. NOT PHP error logs, but actual SERVER logs.
cruser 23 Jul, 2018
I removed onclick from the code and I can save without getting a 404 and the print link shows up. But without onclick the link does not work. How do I allow that?
cruser 23 Jul, 2018
Request:

POST /administrator/index.php?option=com_chronoconnectivity6&cont=connections&act=edit

Action Description:
Access denied with code 403 (phase 2).

Justification:
Pattern match "(?:< ?script|(?:<|< ?/)(?:(?:java|vb)script|about|applet|activex|chrome)|\\%env|< ?i?frame ?src ?= ?(?:ogg|gopher|data|php|zlib|(?:ht|f)tps?):/|(?:\\.add|\\@)import |asfunction\\:|background-image\\:|e(?:cma|xec)script|\\.fromcharcode|get(?:parentfolde ..." at ARGS:_formchunks[0].

***************************
This is what I see in ModSecurity Tools. I am assuming that when I save the print code in CF or CC that it is creating a pattern that matches a rule. If I update/change a rule am I allowing more vulnerabilities?
healyhatman 23 Jul, 2018
No idea sorry. Maybe? Don't think so though should be fine.
cruser 23 Jul, 2018
Rather than modding the rules, etc, I updated the views table in MYSQL by placing the code there and saved it. The print link works now. Thanks for the help healyhatman
cruser 23 Jul, 2018
The biggest issue with my "workaround" is that I cannot edit the connection via the url/administrator link, I have to edit in MYSQL.
This topic is locked and no more replies can be posted.