linkstory.html.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * The linkStory 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. $buildModule = $app->tab == 'project' ? 'projectbuild' : 'build';
  12. $cols = array();
  13. foreach($config->build->defaultFields['linkStory'] as $field) $cols[$field] = zget($config->story->dtable->fieldList, $field, array());
  14. $cols = array_map(function($col){$col['show'] = true; return $col;}, $cols);
  15. $cols['title']['link'] = $this->createLink('story', 'view', "storyID={id}&version=0&param={objectID}");
  16. $cols['title']['nestedToggle'] = false;
  17. $cols['title']['data-toggle'] = 'modal';
  18. $cols['title']['data-size'] = 'lg';
  19. $cols['assignedTo']['type'] = 'user';
  20. foreach($allStories as $story)
  21. {
  22. $story->objectID = $this->app->tab == 'execution' ? $build->execution : $build->project;
  23. $story->estimate = $story->estimate . $config->hourUnit;
  24. }
  25. jsVar('childrenAB', $lang->story->childrenAB);
  26. jsVar('grades', $grades);
  27. jsVar('showGrade', $showGrade);
  28. searchForm
  29. (
  30. set('zui-key', 'searchForm'),
  31. set::module('story'),
  32. set::simple(true),
  33. set::show(true),
  34. set::onSearch(jsRaw("window.onSearchLinks.bind(null, 'story')"))
  35. );
  36. dtable
  37. (
  38. setID('unlinkStoryList'),
  39. set::userMap($users),
  40. set::cols($cols),
  41. set::orderBy($orderBy),
  42. set::sortLink(createLink($buildModule, 'linkStory', "buildID={$build->id}&browseType=$browseType&param=$param&orderBy={name}_{sortType}")),
  43. set::data(array_values($allStories)),
  44. set::loadPartial(true),
  45. set::extraHeight('+144'),
  46. set::onRenderCell(jsRaw('window.renderStoryCell')),
  47. set::checkedRows($checkedRows),
  48. set::footToolbar(array('items' => array(array
  49. (
  50. 'text' => $lang->productplan->linkStory,
  51. 'btnType' => 'primary',
  52. 'className' => 'size-sm linkObjectBtn',
  53. 'data-type' => 'linkStory',
  54. 'data-url' => createLink($buildModule, 'linkStory', "buildID={$build->id}&browseType=$browseType&param=$param"),
  55. 'zui-on-click' => 'handleLinkObjectClick($target)'
  56. )))),
  57. set::footer(array('checkbox', 'toolbar', array('html' => html::a(helper::createLink($buildModule, 'view', "buildID=$build->id&type=story"). "#app={$app->tab}", $lang->goback, '', "class='btn size-sm'")), 'flex', 'pager')),
  58. set::footPager(usePager())
  59. );