zaterdag 5 mei 2007

table with case data

In the discription of the table, a field "table with case data" is included. This field was created to link the workflow to existing apps.
For example the notes app is used for a certain step. The form to be loaded to perform the task would then be notes.uinotes.edit, but for this form, the number of the note to be edited must be passed as an http variable. So where can we find the number of the note?
To be able to find the number of the note, the case has to be linked to the note. So a link between the case number and note number must be created. For example, the case number could be added as a new field to the notes table. In that case the "table with case data" is the notes table. Of course a new table could be created containing two field: case number and note number.

In the steps-table, a field is included called "link". In the above example the link would be the field name of the note number. The SQL statement to determine the record number to be passed to the form can than be:
SELECT {link} FROM {case_data} WHERE case_num={case_num}
for example for the notes app:
SELECT note_id FROM phpgw_notes WHERE case_num=20

So to use the notes app for a step in the process, only these modifications have to be done to the notes app:

  • add case_num to the notes table (or make separate table to link case_num and note_id)

  • get case_num and task_num from http variables

  • call the 'task_complete' function after the note has been edited

Geen opmerkingen: