linkbug.html.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * The linkBug view file of productplan 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 Wang Yidong <yidong@easycorp.ltd>
  7. * @package productplan
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $cols = array();
  12. foreach($config->productplan->defaultFields['linkBug'] as $field) $cols[$field] = zget($config->bug->dtable->fieldList, $field, array());
  13. $cols = array_map(function($col){$col['show'] = true; return $col;}, $cols);
  14. $cols['assignedTo']['type'] = 'user';
  15. $cols['title']['data-toggle'] = 'modal';
  16. $cols['title']['data-size'] = 'lg';
  17. foreach($cols as $colKey => $colConfig) $cols[$colKey]['sort'] = true;
  18. searchForm
  19. (
  20. set('zui-key', 'searchForm'),
  21. set::module('bug'),
  22. set::simple(true),
  23. set::show(true),
  24. set::onSearch(jsRaw("window.onSearchLinks.bind(null, 'bug')"))
  25. );
  26. dtable
  27. (
  28. setID('unlinkBugList'),
  29. set::userMap($users),
  30. set::checkable(true),
  31. set::cols($cols),
  32. set::data(array_values($allBugs)),
  33. set::loadPartial(true),
  34. set::extraHeight('+144'),
  35. set::footToolbar(array
  36. (
  37. 'items' => array(array
  38. (
  39. 'text' => $lang->productplan->linkBug,
  40. 'btnType' => 'secondary',
  41. 'className' => 'size-sm linkObjectBtn',
  42. 'data-type' => 'bug',
  43. 'data-url' => inlink('linkBug', "planID=$plan->id&browseType=$browseType&param=$param&orderBy=$orderBy"),
  44. 'zui-on-click' => 'handleLinkObjectClick($target)'
  45. ))
  46. )),
  47. set::footer(array('checkbox', 'toolbar', array('html' => html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=$orderBy"), $lang->goback, '', "class='btn size-sm'")), 'flex', 'pager')),
  48. set::footPager(usePager())
  49. );
  50. render();