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. $cols = array();
  12. foreach($config->productplan->defaultFields['linkStory'] as $field) $cols[$field] = zget($config->story->dtable->fieldList, $field, array());
  13. $cols = array_map(function($col){$col['show'] = true; return $col;}, $cols);
  14. $cols['title']['link'] = $this->createLink('story', 'storyView', "storyID={id}");
  15. $cols['title']['title'] = $lang->productplan->storyTitle;
  16. $cols['title']['nestedToggle'] = true;
  17. $cols['title']['data-toggle'] = 'modal';
  18. $cols['title']['data-size'] = 'lg';
  19. $cols['plan']['name'] = 'planTitle';
  20. $cols['plan']['sortType'] = false;
  21. $cols['assignedTo']['type'] = 'user';
  22. $cols['module']['type'] = 'text';
  23. $cols['module']['map'] = $modules;
  24. foreach($allStories as $story) $story->estimate = helper::formatHours($story->estimate) . $config->hourUnit;
  25. $config->product->search['fields']['title'] = $lang->productplan->storyTitle;
  26. searchForm
  27. (
  28. set('zui-key', 'searchForm'),
  29. set::module('story'),
  30. set::simple(true),
  31. set::show(true),
  32. set::onSearch(jsRaw("window.onSearchLinks.bind(null, 'story')"))
  33. );
  34. dtable
  35. (
  36. setID('unlinkStoryList'),
  37. set::userMap($users),
  38. set::cols($cols),
  39. set::data(array_values($allStories)),
  40. set::orderBy($orderBy),
  41. set::sortLink(inlink('linkStory', "planID={$plan->id}&browseType=$browseType&param=$param&orderBy={name}_{sortType}")),
  42. set::noNestedCheck(),
  43. set::onRenderCell(jsRaw('window.renderStoryCell')),
  44. set::extraHeight('+144'),
  45. set::loadPartial(true),
  46. set::footToolbar(array('items' => array(array
  47. (
  48. 'text' => $lang->productplan->linkStory,
  49. 'btnType' => 'secondary',
  50. 'className' => 'size-sm linkObjectBtn',
  51. 'data-type' => 'story',
  52. 'data-url' => inlink('linkStory', "planID={$plan->id}&browseType=$browseType&param=$param&orderBy=$orderBy"),
  53. 'zui-on-click' => 'handleLinkObjectClick($target)'
  54. ))
  55. )),
  56. set::footer(array('checkbox', 'toolbar', array('html' => html::a(inlink('view', "planID=$plan->id&type=story"), $lang->goback, '', "class='btn size-sm'")), 'flex', 'pager')),
  57. set::footPager(usePager())
  58. );
  59. render();