Page 1 of 1

custom_fields

Posted: Thu Nov 19, 2020 1:29 pm
by junior2004
I am modifying print_ticket, I would like some fields with the fields added to the printout in one table and the rest of the information in the other table.
<? php foreach ($ ticket ['custom_fields'] as $ customField):?>
<tr>
<td> <? php echo $ customField ['name']; ?> </td>
<td> <? php echo $ customField ['value']; ?> </td>
</tr>
<? php endforeach; ?>
but then all my extra fields pop up.
How to select the selected additional fields?

Re: custom_fields

Posted: Thu Nov 19, 2020 1:40 pm
by Klemen
Access it like you would any multi-dimensional array.

$ticket['custom_fields'][0]['name']
$ticket['custom_fields'][1]['name']
$ticket['custom_fields'][2]['value']
etc...

Please note that teaching PHP is out of the scope of our support here.

Re: custom_fields

Posted: Fri Nov 20, 2020 7:55 am
by junior2004
I know that teaching is beyond your scope of support. But from yesterday there are matches and either one field is displayed to me, and then all empty fields, or I have duplicate fields.

Please, if you can still help me write an example.

<?php foreach ($tickets as $ticket): ?>
<p align="right"><span style="font-size: 15px">Customer:</span></p>
<table border="1" align=right>

<tr>
<td><?php echo $hesklang['name']; ?>:</td>
<td><?php echo $ticket['name']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['email']; ?>:</td>
<td><?php echo $ticket['email']; ?></td>
</tr>

<?php foreach ($ticket['custom_fields'][2] as $customField[2]): ?>
<tr>
<td><?php echo $ticket['custom_fields'][2]['name']; ?></td>
<td><?php echo $ticket['custom_fields'][2]['value']; ?></td>
</tr>
<?php endforeach; ?>

<tr>
<td><?php echo $hesklang['trackID']; ?>:</td>
<td><?php echo $ticket['trackid']; ?></td>
</tr>
<tr>
<td><?php echo $hesklang['subject']; ?>:</td>
<td><b><?php echo $ticket['subject']; ?></b></td>
</tr>

Re: custom_fields

Posted: Tue Nov 24, 2020 5:48 pm
by junior2004
Please help. that's the only thing I want to change. you think HESK is good and wants nothing else

Re: custom_fields

Posted: Sun Dec 27, 2020 12:01 pm
by junior2004
sorry but so far i haven't found a solution, please help

Re: custom_fields

Posted: Sun Dec 27, 2020 4:21 pm
by Klemen
Please hire a PHP developer to help you customize the script to fit your needs.