Disabling PDF printing on otrs v6?

Moderator: crythias

Post Reply
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Disabling PDF printing on otrs v6?

Post by lido »

Hi there, on previous versions one could disable PDF printing and be able to use html views for printing.

We get some slightly complex html emails with some very long links and the PDF print view strips all html and places a bunch of multiple line links on the footernotes.

It would be of some value to be able to print emails without losing html formatting or maybe being able to define come css print styles, etc.

Is there anyway to achieve similar effect with otrs 6 or are we limited to PDF output?

Thanks.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Disabling PDF printing on otrs v6?

Post by reneeb »

Since OTRS5 there is only printing as PDF. But it is very easy to create an own addon based on the AgentTicketPrint.pm from OTRS4 to restore HTML printing...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: Disabling PDF printing on otrs v6?

Post by lido »

Hi @reneeb,

I'm guessing "very easy" is a relative term and it's really only easy if one has at least some Perl experience and preferably also some experience building OTRS modules in the first place, which from your signature I guess you do, but that unfortunately it's not my case.

I was really only wondering if there was any way to easily disable PDF printing and re-enable that functionality. But building a custom module based of another module (that's already outdated by 2 major versions so probably with a lot of api changes) is way out of my league :)

Still, thanks anyway for your reply and suggestion.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Disabling PDF printing on otrs v6?

Post by reneeb »

I've done that for a customer last week. I will build an addon and publish it on OPAR this evening...
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: Disabling PDF printing on otrs v6?

Post by lido »

Well, that would be very useful and greatly appreciated so thanks in advance for sharing.
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Disabling PDF printing on otrs v6?

Post by reneeb »

Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: Disabling PDF printing on otrs v6?

Post by lido »

Thanks for this, but since I'm using otrs v6 I can't seem to install the package. The error I get is:
Please note that your installed OTRS version is 6.0.0.rc1.
This package can only be installed on OTRS version 5.0.x or newer.
Which is strange, since 6 is newer than 5 but nevertheless the package doesn't appear to get installed.

Is there anyway to force it or install manually?
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Disabling PDF printing on otrs v6?

Post by reneeb »

The addon is currently only available for OTRS 5.0.x.
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: Disabling PDF printing on otrs v6?

Post by lido »

Hey, sure no problem.

Anyway, I've used the new otrs6 console command to migrate the xml config from your version to the new format that goes in Config/Files/XML instead of just Config/Files/.

Then I also had to change the code a bit mainly because v6 no longer has the "ArticleContentIndex" method. I managed to replace that with (what I assume is) the equivalent for v6 that i copied from some other file.

I then managed to get the html view/print dialog showing up, but my original issue was still present.

Although the print view did show in html and uses the browser's own print dialog, the ticket email articles themselves still have all html stripped, all inline links replaced with footnotes, no images, no formatting, etc.

Just to clarify, does your module (when correctly installed on a v5) show the full html email or is the module just to use the html print view but still does nothing to print the full html on an html email?

Thanks again.
Post Reply