Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
I've been studying the workflow task in the development wiki, and the suggested github commit on adding tags, but I don't understand the 'getFieldNames' method. It simply returns an array (are the values database columns in the tasks table?), and later on they get cheched on as if they were class attributes. Is this some magic function in the system that checks if a particular entry in the database is there or something? Something that is automatically invoked when the workflow starts?
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
11-24-2015, 10:00 PM
(This post was last modified: 11-24-2015, 10:16 PM by Guido1982.)
As you were replying, I was taking another look at the smarty template and saw a connection. I will take another look at the files on github and try to understand the relation. But I was correct in assuming this function is 'magic' and enables you to very simply create and store values.
Okay, I've been playing with the workflow task and I think I understand:
The Smarty TPL file and the task Class work together:the TPL file sets some input fields with name attributes, and the Class collects these via the function 'getFieldNames()'. The task can then perform certain choices based on the selection of those inputs. At the same time, when editing a task, the smarty '$task->addrel' gets previously set task fields so that when you edit a task it is set the way you left it last.
Is that a correct summary of what's going on?