custom_fields

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
junior2004
Posts: 6
Joined: Sun Nov 15, 2020 11:55 am

custom_fields

Post 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?
Klemen
Site Admin
Posts: 10135
Joined: Fri Feb 11, 2005 4:04 pm

Re: custom_fields

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
junior2004
Posts: 6
Joined: Sun Nov 15, 2020 11:55 am

Re: custom_fields

Post 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>
junior2004
Posts: 6
Joined: Sun Nov 15, 2020 11:55 am

Re: custom_fields

Post by junior2004 »

Please help. that's the only thing I want to change. you think HESK is good and wants nothing else
junior2004
Posts: 6
Joined: Sun Nov 15, 2020 11:55 am

Re: custom_fields

Post by junior2004 »

sorry but so far i haven't found a solution, please help
Klemen
Site Admin
Posts: 10135
Joined: Fri Feb 11, 2005 4:04 pm

Re: custom_fields

Post by Klemen »

Please hire a PHP developer to help you customize the script to fit your needs.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply