From 91199908ce8f2e9fad8a10abdc0fd3bff04adb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Thu, 9 Jun 2022 08:57:56 +0800 Subject: [PATCH] * Code for task #56547. --- db/update17.0.sql | 1 + db/zentao.sql | 1 + module/doc/control.php | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 db/update17.0.sql mode change 100644 => 100755 module/doc/control.php diff --git a/db/update17.0.sql b/db/update17.0.sql new file mode 100644 index 0000000000..5573f26123 --- /dev/null +++ b/db/update17.0.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_review` ADD docVersion smallint(6) NOT NULL AFTER `doc`; diff --git a/db/zentao.sql b/db/zentao.sql index 2c8f08a0f3..c73404403f 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -9420,6 +9420,7 @@ CREATE TABLE IF NOT EXISTS `zt_review` ( `object` mediumint(8) NOT NULL, `template` mediumint(8) NOT NULL, `doc` mediumint(8) DEFAULT NULL, + `docVersion` smallint(6) DEFAULT NULL, `status` char(30) NOT NULL, `reviewedBy` varchar(255) NOT NULL, `auditedBy` varchar(255) NOT NULL, diff --git a/module/doc/control.php b/module/doc/control.php old mode 100644 new mode 100755 index 89c931c78e..101676c2de --- a/module/doc/control.php +++ b/module/doc/control.php @@ -792,6 +792,28 @@ class doc extends control return print($select); } + /** + * Ajax get docs by lib. + * + * @param int $libID + * @access public + * @return void + */ + public function ajaxGetDocs($libID) + { + if(!$libID) return print(html::select('doc', '', '', "class='form-control chosen'")); + + $docIdList = $this->doc->getPrivDocs($libID, 0); + $docs = $this->dao->select('id, title')->from(TABLE_DOC) + ->where('lib')->eq($libID) + ->andWhere('deleted')->eq(0) + ->andWhere('id')->in($docIdList) + ->orderBy('`order` asc') + ->fetchPairs(); + + return print(html::select('doc', $docs, '', "class='form-control chosen'")); + } + /** * Ajax save draft. *