ajaxgetexecutionswitchermenu.html.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * The ajaxGetExecutionSwitcherMenu view file of execution 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 Shujie Tian <tianshujie@easycorp.ltd>
  7. * @package execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. /**
  12. * 定义每个分组下的选项数据列表。
  13. * Define the grouped data list.
  14. */
  15. $data = array('normal' => array(), 'closed' => array());
  16. foreach($executions as $execution)
  17. {
  18. $item = array();
  19. $item['id'] = $execution->id;
  20. $item['text'] = $execution->name;
  21. $item['active'] = $executionID == $execution->id;
  22. $item['type'] = 'execution';
  23. $item['icon'] = 'kanban';
  24. $item['keys'] = zget(common::convert2Pinyin(array($execution->name)), $execution->name, '');
  25. if($execution->status == 'closed')
  26. {
  27. $data['closed'][] = $item;
  28. }
  29. else
  30. {
  31. $data['normal'][] = $item;
  32. }
  33. }
  34. /**
  35. * 定义每个分组名称信息,包括可展开的已关闭分组。
  36. * Define every group name, include expanded group.
  37. */
  38. $tabs = array();
  39. $tabs[] = array('name' => 'closed', 'text' => $lang->execution->closedExecution);
  40. $tabs[] = array('name' => 'normal', 'text' => '');
  41. $json = array();
  42. $json['data'] = $data;
  43. $json['tabs'] = $tabs;
  44. $json['searchHint'] = $lang->searchAB;
  45. $json['expandName'] = 'closed';
  46. $json['itemType'] = 'execution';
  47. $json['link'] = array('execution' => sprintf($link, '{id}'));
  48. renderJson($json);