testtask.max.html.hook.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace zin;
  3. query('dtable')->each(function($node)
  4. {
  5. $node->setProp('key', 'testtask');
  6. $node->setProp('plugins', array('cellspan'));
  7. $node->setProp('getCellSpan', jsRaw('window.getCellSpan'));
  8. $node->setProp('onRenderCell', jsRaw('window.onRenderCell'));
  9. $data = $node->prop('data');
  10. $testtasks = array();
  11. foreach($data as $testtask)
  12. {
  13. if($testtask->joint && !empty($testtask->productGroup))
  14. {
  15. $trowspan = 0;
  16. foreach($testtask->productGroup as $builds) $trowspan += count($builds);
  17. $testtask->trowspan = $trowspan;
  18. foreach($testtask->productGroup as $builds)
  19. {
  20. $testtask->prowspan = count($builds);
  21. foreach($builds as $build)
  22. {
  23. $testtaskInfo = clone $testtask;
  24. $testtaskInfo->build = $build->id;
  25. $testtaskInfo->product = $build->product;
  26. $testtaskInfo->buildName = $build->name;
  27. $testtaskInfo->projectName = $build->projectName;
  28. $testtaskInfo->executionName = $build->executionName;
  29. $testtaskInfo->productName = $build->productName;
  30. $testtasks[] = $testtaskInfo;
  31. }
  32. }
  33. }
  34. else
  35. {
  36. $testtasks[] = $testtask;
  37. }
  38. }
  39. $node->setProp('data', $testtasks);
  40. });