OSTicket Version: v1.10 (901e5ea)Hi,I have added in the option to print off a customer ticket from a thermal printer, which is just a small ticket with company details, ticket number, date created so our customers can call up and inquire about their jobs (if anyone is interested in how we go about this I can put some more detail in). We want a custom field to be printed on it as well; in this case an "item" field that we list the type of device eg. laptop, phone etc.My question is how can I show just one custom field? The code from ticket-vew-inc.php is what I'm using but it lists all custom fields and I need to be able to just show individual fields as required.  My coding ability isn't up to this task, any help would be greatly appreciated!The code in question:<?phpforeach (DynamicFormEntry:($ticket->getId()) as $form) {    // Skip core fields shown earlier in the ticket view    // TODO: Rewrite getAnswers() so that one could write    //       ->getAnswers()->filter(not(array('field__name__in'=>    //           array('email', ...))));    $answers = $form->getAnswers()->exclude(Q:(array(        'field__flags__hasbit' => DynamicFormField:,        'field__name__in' => array('subject', 'priority')    )));    $displayed = array();    foreach($answers as $a) {        if (!($v = $a->display()))            continue;        $displayed = array($a->getLocal('label'), $v);    }    if (count($displayed) == 0)        continue;    ?>    <table class="ticket_info custom-data" cellspacing="0" cellpadding="0" width="940" border="0">    <thead>        <th colspan="2"><?php echo Format:($form->getTitle()); ?></th>    </thead>    <tbody><?php    foreach ($displayed as $stuff) {        list($label, $v) = $stuff;?>        <tr>            <td width="200"><?phpecho Format:($label);            ?>:</th>            <td><?phpecho $v;            ?></td>        </tr><?php } ?>    </tbody>    </table><?php } ?>

a month later

Tag me when this gets answered... or did you figure it out

Write a Reply...