php events in list , several operations

We have a need to change behaviour of 2-3 fields per row in certain lists. But we can only operate on one field in one php event plugin giving the desired result. We need to have one plugin for each "operation". That is per design?
 
Hi
Could you explain exactly what you are doing? I don't fully understand the question or the situation that it arises from.
Thanks
 
We tried to do this in one operation in onLoadData:

foreach ($group1 as $rowx)
{
// First part
$c = 'awhrm-daytype-'.$rowx->d6zoe_awhrm_workingtime___daytype;
$rowx->d6zoe_awhrm_workingtime___workingdate = '<div class="'.$c.'">' . $rowx->d6zoe_awhrm_workingtime___workingdate . '</div>';
// Second part
if ( $rowx->d6zoe_awhrm_workingtime___timecode_raw < 1) {
$d = 'awhrm-timecode-warning';
$rowx->d6zoe_awhrm_workingtime___Hours = '<div class="'.$d.'">' . $rowx->d6zoe_awhrm_workingtime___Hours . '</div>';
}
}
Second part gives no result at all. But putting it in its own php_event its working fine.
 
I don't see any reason in Fabrik why that shouldn't work.
To start with I'd try passing $rowx by reference in the foreach loop:

PHP:
foreach ($group1 as &$rowx)

then I'd go and debug the code to ensure that $rowx->d6zoe_awhrm_workingtime___timecode_raw was actually less than 1. I'd also cast that test value to a number as you might be comparing a string to a number.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top