options.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * The options entry point of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package entries
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class optionsEntry extends entry
  13. {
  14. /**
  15. * GET method.
  16. *
  17. * @param string $type
  18. * @access public
  19. * @return string
  20. */
  21. public function get($type = '')
  22. {
  23. if(!$type) return $this->sendError(400, 'error');
  24. $options = array();
  25. switch($type)
  26. {
  27. case 'bug':
  28. $this->app->loadLang('bug');
  29. $options['type'] = $this->lang->bug->typeList;
  30. $options['pri'] = $this->lang->bug->priList;
  31. $options['severity'] = $this->lang->bug->severityList;
  32. $options['modules'] = new stdclass();
  33. $product = $this->param('product', 0);
  34. if($product) $options['modules'] = $this->loadModel('tree')->getOptionMenu($product, 'bug');
  35. $execution = $this->param('execution', 0);
  36. $options['build'] = $this->loadModel('build')->getBuildPairs(array($product), 'all', '', $execution, 'execution');
  37. break;
  38. }
  39. return $this->send(200, array('options' => $options));
  40. }
  41. }