edit.ipd.html.hook.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace zin;
  3. global $app, $lang;
  4. $story = data('story');
  5. query('#category')->closest('tr')->after(
  6. h::tr
  7. (
  8. h::th(setClass('py-1.5 pr-2 font-normal nowrap text-right'), $lang->story->duration),
  9. h::td(setClass('py-1.5 pl-2 w-full'), picker(set::name('duration'), set::items($lang->demand->durationList), set::value($story->duration)))
  10. ),
  11. h::tr
  12. (
  13. h::th(setClass('py-1.5 pr-2 font-normal nowrap text-right'), $lang->story->BSA),
  14. h::td(setClass('py-1.5 pl-2 w-full'), picker(set::name('BSA'), set::items($lang->demand->bsaList), set::value($story->BSA)))
  15. )
  16. );
  17. $roadmaps = $app->control->loadModel('roadmap')->getPairs($story->product, $story->branch, 'noclosed', 0, $story->roadmap);
  18. $roadmapNode = h::tr
  19. (
  20. h::th(setClass('py-1.5 pr-2 font-normal nowrap text-right'), $lang->story->roadmap),
  21. h::td
  22. (
  23. inputGroup
  24. (
  25. setClass('py-1.5 pl-2'),
  26. span(setID('roadmapIdBox'), setClass('w-full'), picker(set::name('roadmap'), set::items($roadmaps), set::value($story->roadmap), set::disabled(!in_array($story->stage, array('wait', 'inroadmap', 'incharter'))))),
  27. empty($roadmaps) && in_array($story->stage, array('wait', 'inroadmap', 'incharter')) ? btn(set::url(createLink('roadmap', 'create', "productID={$story->product}", '', true)), setData(array('toggle' => 'modal', 'type' => 'iframe', 'size' => 'lg')), icon('plus')) : null,
  28. empty($roadmaps) && in_array($story->stage, array('wait', 'inroadmap', 'incharter')) ? btn(set('onclick', "loadProductRoadmaps({$story->product}, {$story->branch})"), setClass('refresh'), icon('refresh')) : null
  29. )
  30. ),
  31. !in_array($story->stage, array('wait', 'inroadmap', 'incharter')) ? formHidden('roadmap', $story->roadmap) : null
  32. );
  33. query('#grade')->closest('tr')->after($roadmapNode);
  34. query('#product')->prop('disabled', !in_array($story->stage, array('wait', 'inroadmap', 'incharter')));
  35. query('#branch')->prop('disabled', !in_array($story->stage, array('wait', 'inroadmap', 'incharter')));