clonemeagain / osticket-plugin-archiver

Plugin for osTicket which can automatically archive tickets before delete, and allows for auto-pruning of old tickets
GNU General Public License v2.0
18 stars 14 forks source link

Logo missing from PDF #4

Closed clonemeagain closed 6 years ago

clonemeagain commented 7 years ago

Can't see the top-left logo, likely another cron related global missing..

clonemeagain commented 7 years ago

Hmm, this is actually https://github.com/osTicket/osTicket/issues/3770 not me.. phew! Also: https://github.com/osTicket/osTicket/issues/3699

Irritating. I'm working on it.

clonemeagain commented 7 years ago

Open /include/mpdf/mpdf.php, find line 9942, change

        $data = $this->$v[1];

into

        $data = $this->{$v[1]};

Then it works.

Seems to be different in the later versions of MPDF.. will be fun when osTicket joins the composer world. :-)

clonemeagain commented 7 years ago

Added the following to my /include/staff/templates/ticket-print.tmpl.php

To fix the alignment while using my custom logo: line 129 changed to:

<h1 class="flush-right">Ticket #<?php echo $ticket->getNumber(); ?></h1>

To add attached images into the PDF: Added after line 240 foreach ($files as $A){

    if(in_array(strtolower ( pathinfo ( $A->file->name, PATHINFO_EXTENSION ) ), array('png','jpg','svg'))){
        echo "<div><img src=\"cid:" . $A->file->key . '" /></div>'; 
    }
    ?>