singlestoryblock.html.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * The singleproductstoryblock view file of block module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Mengyi Liu <liumengyi@easycorp.ltd>
  7. * @package block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. if(!$longBlock)
  12. {
  13. unset($config->block->story->dtable->fieldList['status']);
  14. unset($config->block->story->dtable->fieldList['category']);
  15. unset($config->block->story->dtable->fieldList['estimate']);
  16. unset($config->block->story->dtable->fieldList['stage']);
  17. }
  18. else
  19. {
  20. foreach($stories as $story) $story->estimate .= $config->hourUnit;
  21. }
  22. $method = $block->params->type == 'assignedTo' ? 'work' : 'contribute';
  23. blockPanel
  24. (
  25. setClass('singlestory-block list-block'),
  26. to::headingActions
  27. (
  28. hasPriv('my', $method) && $block->params->type != 'reviewBy' ? h::nav
  29. (
  30. setClass('toolbar'),
  31. btn
  32. (
  33. setClass('ghost toolbar-item size-sm z-10'),
  34. set::url(createLink('my', $method, "mode=story&browseType={$block->params->type}")),
  35. $lang->more,
  36. span(setClass('caret-right'))
  37. )
  38. ) : ''
  39. ),
  40. dtable
  41. (
  42. set::height(318),
  43. set::fixedLeftWidth($longBlock ? '0.5' : '0.8'),
  44. set::cols(array_values($config->block->story->dtable->fieldList)),
  45. set::data(array_values($stories))
  46. )
  47. );
  48. render();