ajaxgetdropmenu.html.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * The ajaxgetdropmenu file of testtask module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  5. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Mengyi Liu<liumengyi@easycorp.ltd>
  7. * @package testtask
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $data = array();
  12. foreach($testtasks as $testtask)
  13. {
  14. if($objectType == 'project' && $testtask->project != $objectID && empty($testtask->joint)) continue;
  15. if($objectType == 'execution' && $testtask->execution != $objectID && empty($testtask->joint)) continue;
  16. $item = array();
  17. $item['id'] = $testtask->id;
  18. $item['name'] = $testtask->name;
  19. $item['text'] = $testtask->name;
  20. $item['title'] = $testtask->name;
  21. $item['active'] = $currentTaskID == $testtask->id;
  22. $item['keys'] = zget($testtasksPinyin, $testtask->id, '');
  23. $item['url'] = sprintf($link, $testtask->id);
  24. $item['type'] = 'item';
  25. $item['data-app'] = $app->tab;
  26. $data[] = $item;
  27. }
  28. $json = array();
  29. $json['data'] = $data;
  30. renderJson($json);