edit.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * The edit control file of client 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 Gang Liu <liugang@easycorp.ltd>
  7. * @package client
  8. * @link https://www.zentao.net
  9. */
  10. class client extends control
  11. {
  12. /**
  13. * 编辑一个客户端版本。
  14. * Edit a client version.
  15. *
  16. * @param int $clientID
  17. * @access public
  18. * @return void
  19. */
  20. public function edit($clientID)
  21. {
  22. $this->checkSafeFile();
  23. if($_POST)
  24. {
  25. $this->post->set('desc', mb_substr($this->post->desc, 0, 100));
  26. $this->client->update($clientID);
  27. if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
  28. return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'load' => true));
  29. }
  30. $this->view->title = $this->lang->client->edit;
  31. $this->view->client = $this->client->getByID($clientID);
  32. $this->display();
  33. }
  34. }