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. *