storyactive.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * The bug change 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 storyActiveEntry extends entry
  13. {
  14. /**
  15. * POST method.
  16. *
  17. * @param int $storyID
  18. * @access public
  19. * @return string
  20. */
  21. public function post($storyID)
  22. {
  23. $control = $this->loadController('story', 'activate');
  24. $fields = 'assignedTo,status,comment';
  25. $this->batchSetPost($fields);
  26. $control->activate($storyID);
  27. $data = $this->getData();
  28. if(!$data || !isset($data->result)) return $this->send400('error');
  29. if($data->result == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
  30. $story = $this->loadModel('story')->getByID($storyID);
  31. return $this->send(200, $story);
  32. }
  33. }