bugfree.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * The baisc model file of bugfree convert 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 convert
  9. * @version $Id: bugfree.php 4129 2013-01-18 01:58:14Z wwccss $
  10. * @link https://www.zentao.net
  11. */
  12. class bugfreeConvertModel extends convertModel
  13. {
  14. public $map = array();
  15. public $filePath = '';
  16. static public $info = array();
  17. /**
  18. * Connect to db auto.
  19. *
  20. * @access public
  21. * @return void
  22. */
  23. public function __construct()
  24. {
  25. parent::__construct();
  26. parent::connectDB();
  27. }
  28. /**
  29. * Check table.
  30. *
  31. * @access public
  32. * @return bool
  33. */
  34. public function checkTables()
  35. {
  36. return true;
  37. }
  38. /**
  39. * Check the install path.
  40. *
  41. * @access public
  42. * @return bool
  43. */
  44. public function checkPath()
  45. {
  46. $this->setPath();
  47. return file_exists($this->filePath);
  48. }
  49. /**
  50. * Set the path of attachments.
  51. *
  52. * @access public
  53. * @return bool
  54. */
  55. public function setPath()
  56. {
  57. $this->filePath = realpath($this->post->installPath) . DS . 'BugFile' . DS;
  58. }
  59. /**
  60. * Excute the convert.
  61. *
  62. * @param int $version
  63. * @access public
  64. * @return void
  65. */
  66. public function execute($version)
  67. {
  68. }
  69. /**
  70. * Clear rows added in converting.
  71. *
  72. * @access public
  73. * @return void
  74. */
  75. public function clear()
  76. {
  77. foreach($this->session->state as $table => $maxID)
  78. {
  79. $this->dao->dbh($this->dbh)->delete()->from($table)->where('id')->gt($maxID)->exec();
  80. }
  81. }
  82. }