Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

osTicket v1.10 Ticket Print

Hi there

Has someone modded or can someone assist me in modding the custom data font size on ticket print?

Check my attached picture, underneath "Jobcard details", i would like to make that font/table smaller 

Essentially i would like to make the items on the below code appear smaller:

<!-- Custom Data -->

<?php
foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) {
    // Skip core fields shown earlier in the ticket view
    $answers = $form->getAnswers()->exclude(Q::any(array(
        'field__flags__hasbit' => DynamicFormField::FLAG_EXT_STORED,
        'field__name__in' => array('subject', 'priority')
    )));
    if (count($answers) == 0)
        continue;
    ?>
       <table class="custom-data" cellspacing="0" cellpadding="4" width="100%" border="0">
        <tr><td colspan="2" class="headline flush-left"><?php echo  $form->getTitle(); ?></th></tr>
        <?php foreach($answers as $a) {
            if (!($v = $a->display())) continue; ?>
            <tr>
                <th><?php
    echo $a->getField()->get('label');
                ?>:</th>
                <td><?php
    echo $v;
                ?></td>
            </tr>
            <?php } ?>
        </table>
    <?php
    $idx++;
} ?>

Kind Regards
Noobie

Comments

  • No attached picture.

    Are you really running a RC (release candidate)?  You should really upgrade to the stable.

    I would think that you would need to alter /include/class.pdf.php 
  • Hi i have now attached the image. and sorry i am running the stable version.... not the RC


    screenshot.jpg
    748 x 393 - 48K
  • Ah okay.  I think that the font size may be in /include/mpdf/config.php

    I think that the fonts avail are in /include/mpdf/config_fonts.php

  • Thank you
  • Hi found the proper place to change it

    its actually in ticket-print.tmpl around line 51 you just have to add a "font-size: ##px" line there and it changes the whole custom data table size... now to figure out how to split the table into two
  • Hopefully you are documenting where you are making your changes.

    Is your question answered here?
  • @Synt4xError i am  making backups of all the files i edit and keeping notes of where i make my changes

    thanx
  • Hi! I'm trying to modify the size of the fonts inside the PDF, using "ticket-print.tmpl" file.
    But, I can see changes only in the "Ticket Detail" field.

    How can I reduce the font of the content and notes?
    Thanks.
  • @Genius95 please open your own thread as your solution may be different from LeratoSelepe.

    Prior to opening your thread;

    Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance. The more information you give us the better we will be able to assist you. Thank you.

  • Hi all,

    Anyone know how to add custom variable that created in User Information in PDF file? I want to change "Source" by my custom field in pdf file.

    image

  • You cannot change the source of the ticket... its where the ticket was generated from.
  • @ninhadidas to clarify, are you saying when you print a ticket to PDF you want additional information to appear, or you want the additional information to appear in the ticket view?
  • edited June 8
    @Sam_Parris yes, when I print a ticket to PDF, I want additional information appear, such as information field in User Information form
  • @ntozier: I mean change Source by other information or add more information that I mention above.
  • @ninhadidas go to include\staff\templates\ticket-print.tmpl.php line 128

    This is the ticket metadata, you can then edit what information appears in the top portion of the printout.
  • Yes, you would have to edit the core source files (specifically the file mentioned above by @Sam_Parris)
  • @Sam_Parris & @ntozier:

    I've already edited ticket-print.tmpl.php but I don't know the variable of the field that I created in Contact Information form, pls check the image for detail.

    Thank you.

    image


  • You would need to look in your database tables to find where these variables are stored and what name would pull them out.
  • In a normal message you would use 

    %{ticket.VARIABLE}
    I have no idea if this works in anyplace other then in message templates though, as I have never tried it.
  • edited June 12

    Hi @Sam_Parris:

    This is my database table for the fields that I created

    image



Sign In or Register to comment.