Currently I'm working on a ticket system in PHP where a ticket could have underlying tasks.
Visually i've a form thats needs te be filled in with ticket information like: subject, impact, etc. There is a button to add tasks that opens a popup to fill the task information like name, desc, etc.
My question and problem is what is the best way to temporarily store the task(s), becuase the ticket is not saved yet, so the parent ticket id is unknown.
Currently when the task popup is filled in, and pressed store, an javascript(json) object is returned to the ticket page. Now i need to figure out whats te best way to hold this tasks, because when i refresh the page there gone.
Also i need to create a overview on the ticketpage with underlying tasks, with the option to edit or remove the task but thats for later.
I've tried to store the tasks in a temp session but couldn't figure what to do when a task needs to be removed or edit.
Also I've tried to store the json object in a hidden input and when the form is submitted store it into his input value.
How I'm thinking to store a ticket with tasks is a ticket has/could have an array with tasks. When inserting the ticket there is a function to get last_insert_id, then a foreach through the taks array and store them with the ticket_id (last_insert_id)
Maybe there is someone with some good tips that could help me out