ajaxgetdropmenu.html.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * The ajaxgetdropmenu view file of workflowgroup 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 Yuting Wang<wangyuting@easycorp.ltd>
  7. * @package workflowgroup
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $data = array();
  12. /* 处理分组数据。Process grouped data. */
  13. foreach($workflowGroups as $groupID => $groupName)
  14. {
  15. $item = array();
  16. $item['id'] = $groupID;
  17. $item['text'] = $groupName;
  18. $item['type'] = 'workflowgroup';
  19. $item['keys'] = zget($groupsPinyin, $groupName, '');
  20. $item['active'] = $groupID == $currentGroupID || (empty($groupID) && empty($currentGroupID));
  21. $data[] = $item;
  22. }
  23. /**
  24. * 定义最终的 JSON 数据。
  25. * Define the final json data.
  26. */
  27. $json = array();
  28. $json['data'] = $data;
  29. $json['searchHint'] = $lang->searchAB;
  30. $json['link'] = $link;
  31. $json['itemType'] = 'workflowgroup';
  32. /**
  33. * 渲染 JSON 字符串并发送到客户端。
  34. * Render json data to string and send to client.
  35. */
  36. renderJson($json);