0

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

Bham
  • 309
  • 5
  • 21
  • Wouldn't be easier to let them save the ticket first, before allowing them to add tasks? Specially if you won't store the tasks to the DB before they have saved the ticket, anyway. If not, then show us your session solution and we might be able to help you from there. – M. Eriksson Oct 05 '16 at 15:37
  • @Magnus Eriksson. I was thinking about this to, to store the ticket first and then the option to add tickets, but this is a extra activity and i want to this with as little as possible activities. – Bham Oct 05 '16 at 16:33
  • What do you mean with "little as possible activities"? For you or for them? For you, this would be much easier, for them, you can just store the ticket automatically with the "temp" status until they save the ticket "for real". – M. Eriksson Oct 06 '16 at 05:43

0 Answers0