diff --git a/include/client/templates/ticket-print.tmpl.php b/include/client/templates/ticket-print.tmpl.php index a1173b217b48111ebc8857129cd9c8e4fe74a56a..d8a4f164316118f40779af197123df8eff9c6026 100644 --- a/include/client/templates/ticket-print.tmpl.php +++ b/include/client/templates/ticket-print.tmpl.php @@ -160,14 +160,10 @@ div.hr { <?php foreach (DynamicFormEntry::forTicket($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 = array_filter($form->getAnswers(), function ($a) { - return !in_array($a->getField()->get('name'), - array('email','subject','name','priority')) - && !$a->getField()->get('private'); - }); + $answers = $form->getAnswers()->exclude(Q::any(array( + 'field__flags__hasbit' => DynamicFormField::FLAG_EXT_STORED | DynamicFormField::FLAG_CLIENT_VIEW, + 'field__name__in' => array('subject', 'priority'), + ))); if (count($answers) == 0) continue; ?> diff --git a/include/staff/templates/ticket-print.tmpl.php b/include/staff/templates/ticket-print.tmpl.php index 11323c4a14b60077e7e208cc41f0b1434726882e..97074ed2682031b73672ecd817a5ba0085f30394 100644 --- a/include/staff/templates/ticket-print.tmpl.php +++ b/include/staff/templates/ticket-print.tmpl.php @@ -183,13 +183,10 @@ div.hr { <?php foreach (DynamicFormEntry::forTicket($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 = array_filter($form->getAnswers(), function ($a) { - return !in_array($a->getField()->get('name'), - array('email','subject','name','priority')); - }); + $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; ?>