Re: Pending workflow task on Home Page [message #2441 is a reply to message #2439] |
Fri, 05 February 2010 12:41 |
AJM
Messages: 2371 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
This is tricky, but can be done. It comes in two parts:
(1) I have modified 'menu.xsl' so that if it finds a column called 'link_text' it will use this instead of constructing the default '<task_desc> where <context>'.
(2) By default the output will not contain a column called 'link_text', but by customising the '_cm_post_getData()' method in the 'wf_workitem_role' and/or 'wf_workitem_user' classes you can construct whatever text you like.
Here is a example of the custom code which I used in the 'wf_workitem_role' class:
// insert custom text into LINK_TEXT
foreach ($rows as $rownum => $rowdata) {
switch ($rowdata['task_id']) {
case 'x_person_addr(add)':
ini_set('include_path', ini_get('include_path') .PATH_SEPARATOR .'../xample');
$dbobject =& singleton::getInstance('x_person');
$data = $dbobject->getData($rowdata['context']);
if (!empty($data)) {
$data = $data[0];
$link_text = $rowdata['task_desc'] .' for ' .$data['first_name'] .' ' .$data['last_name'];
$rowdata['link_text'] = $link_text;
} // if
default:
break;
} // switch
$rows[$rownum] = $rowdata;
} // foreach
As you can see it is not that simple. I have to identify the database table from which I need to extract the extra data, create a table instance, then read the data.
Be aware that this is a modification to the standard class, so any changes you make may be overwritten if you reload the standard files.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|