Page 1 of 1

Adding more custom fields?

Posted: Thu May 10, 2007 7:21 pm
by soopafly
Script URL: local
Version of script: .94
Hosting company:local
URL of phpinfo.php:local
URL of session_test.php:local
What terms did you try when SEARCHING for a solution: the search here

Write your message below:

Hello,
Adding custom fields to this release has been a godsend to myself and I'm sure others. I could imagine in the future needing even more than five custom fields. Is this possible with a few hacks?

Posted: Sat May 12, 2007 11:26 pm
by Klemen
You can try adding a few more rows to the hesk_categories table with names "custom6", "custom7", etc. Then you need to change the "5" in

Code: Select all

($i=1;$i<=5;$i++)
to for example "7":

Code: Select all

($i=1;$i<=7;$i++)
This code is found once in admin_settings.php and twice in admin_settings_save.php, need to edit all three of them.

Besides that I think all the code is written to allow more fields, but can't guarantee it, you will need to try yourself.

And make sure you BACKUP your database and files before editing them.

Posted: Tue May 15, 2007 12:07 am
by soopafly
Very very close! The extra custom fields are there in the form, but it's not writing to the database

I've also added this line to admin_settings_save.php

Code: Select all

        'custom6'  => array('use'=>0,'req'=>0,'name'=>'Custom field 6','maxlen'=>255)

Posted: Tue May 15, 2007 12:29 am
by soopafly
Ah!! I figured it out. In submit_ticket.php, I've added "custom 6" to these lines

Code: Select all

`trackid`,`name`,`email`,`category`,`priority`,`subject`,`message`,`dt`,`lastchange`,`ip`,`status`,`attachments`,`custom1`,`custom2`,`custom3`,`custom4`,`custom5`,`custom6`