storyreviewerrequired.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * The story reviewer required entry point of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2025 禅道软件(青岛)有限公司(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 Ruogu Liu <liuruogu@chandao.com>
  8. * @package entries
  9. * @version 1
  10. * @link https://www.zentao.net
  11. */
  12. class storyreviewerrequiredEntry extends entry
  13. {
  14. /**
  15. * GET method.
  16. *
  17. * @param string $storyType
  18. * @access public
  19. * @return string
  20. */
  21. public function get($storyType = '')
  22. {
  23. if(empty($storyType)) $storyType = $this->param('type', 'story');
  24. if(!in_array($storyType, array('story', 'requirement', 'epic'))) return $this->sendError(400, 'Invalid story type. Must be one of: story, requirement, epic.');
  25. $this->loadModel('story');
  26. $reviewerRequired = $this->story->checkForceReview($storyType);
  27. return $this->send(200, array('storyType' => $storyType, 'reviewerRequired' => (bool)$reviewerRequired));
  28. }
  29. }