- Edited
Hi, I'm pretty new to osTicket, but have been having a lot of fun building and modding a version for a project im working on, however have got the stage where i need a few hints/push in the right direction :)I have customized the individual users page (within staff section) 'includes/user-view.inc.php' which calls the template file 'templates/tickets.tmpl.php' so now it is displaying three tables (one for each of my helpdesk topics). However within these tables, i want to include fields from the custom form data that i have assigned for each helptopic. I think i could use a few pointers for SQL. (all code extracts are from 'includes/templates/tickets.tmpl.php' unless otherwise specified)I've added 'IF(form_entry.object_type = "T",form_entry.id, "") as fe_id ' to the $select variable (~line7)and .' LEFT JOIN '.TABLE_PREFIX.'form_entry form_entry ON (form_entry.object_id = ticket.ticket_id) ' to the $from statement (line19) at the top of the file.so for each ticket I can get the form_entry id related. (the IF statement is just in case a ticket and user have the same object_id).However, from here i'm not sure how i join the form_entry.id (alias fe_id ) to all the entries in the form_entry_values table, and pull those through into the array for each ticket. I guess i need to write some SQL to select form_entry_values.field_id and form_entry_values.value where fe_id=form_entry_values.entry_id - but this will return multiple rows so im not sure how to handle JOINing those... any help would be appreciated!!I can provide longer code examples if its helpful....Perhaps this is a long winded way of doing this? Are there functions i could use to short circuit the process?