diff --git a/db/update18.3.sql b/db/update18.3.sql index 683a54fda4..eb65de6bc4 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -253,6 +253,11 @@ INNER JOIN zt_project AS t2 ON t1.`project` = t2.`id` SET t1.`addedDate` = t2.`openedDate`, t1.`addedBy` = t2.`openedBy` WHERE t1.`type` = 'project' AND t1.`main` = '1'; +UPDATE zt_doc AS t1 +INNER JOIN zt_project AS t2 ON t1.`execution` = t2.`id` +SET t1.`project` = t2.`project` +WHERE t1.`execution` != '0' AND t1.`project` = '0'; + /* Update the execution master library. */ UPDATE zt_doclib AS t1 INNER JOIN zt_project AS t2 ON t1.`execution` = t2.`id` @@ -485,6 +490,11 @@ CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; ALTER TABLE `zt_effort` +CHANGE `left` `left` float NOT NULL DEFAULT '0', +CHANGE `consumed` `consumed` float NOT NULL DEFAULT '0', +CHANGE `product` `product` text NULL, +CHANGE `project` `project` mediumint unsigned NOT NULL DEFAULT '0', +CHANGE `execution` `execution` mediumint unsigned NOT NULL DEFAULT '0', CHANGE `begin` `begin` smallint(4) unsigned zerofill NOT NULL DEFAULT '0', CHANGE `end` `end` smallint(4) unsigned zerofill NOT NULL DEFAULT '0'; @@ -601,6 +611,9 @@ CHANGE `assignedBy` `assignedBy` char(30) NOT NULL DEFAULT '', CHANGE `assignedDate` `assignedDate` datetime NULL; ALTER TABLE `zt_kanbanlane` +ALTER TABLE `zt_kanbanlane` +CHANGE `groupby` `groupby` char(30) NOT NULL DEFAULT '', +CHANGE `extra` `extra` char(30) NOT NULL DEFAULT '', CHANGE `lastEditedTime` `lastEditedTime` datetime NULL; ALTER TABLE `zt_kanbanregion` @@ -700,6 +713,7 @@ CHANGE `assignedTo` `assignedTo` varchar(30) NOT NULL DEFAULT '', CHANGE `reviewers` `reviewers` text NULL; ALTER TABLE `zt_pipeline` +CHANGE `password` `password` varchar(255) NULL, CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; @@ -765,6 +779,14 @@ ALTER TABLE `zt_researchreport` CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; +ALTER TABLE `zt_repo` +CHANGE `commits` `commits` mediumint unsigned NOT NULL DEFAULT '0'; +CHANGE `account` `account` varchar(30) NOT NULL DEFAULT '', +CHANGE `password` `password` varchar(30) NOT NULL DEFAULT ''; +CHANGE `lastSync` `lastSync` datetime NULL, +CHANGE `job` `job` mediumint unsigned NOT NULL DEFAULT '0', +CHANGE `deleted` `deleted` tinyint(1) NOT NULL DEFAULT '0'; + ALTER TABLE `zt_review` CHANGE `reviewedBy` `reviewedBy` varchar(255) NOT NULL DEFAULT '', CHANGE `auditedBy` `auditedBy` varchar(255) NOT NULL DEFAULT '', @@ -1033,6 +1055,8 @@ CHANGE `editedBy` `editedBy` char(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; ALTER TABLE `zt_workflowfield` +CHANGE `default` `default` varchar(100) NOT NULL DEFAULT '', +CHANGE `rules` `rules` varchar(255) NOT NULL DEFAULT '', CHANGE `expression` `expression` text NULL, CHANGE `placeholder` `placeholder` varchar(100) NOT NULL DEFAULT '', CHANGE `desc` `desc` text NULL, diff --git a/db/zentao.sql b/db/zentao.sql index bbd81106d4..4b7ed00332 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -742,15 +742,15 @@ CREATE TABLE IF NOT EXISTS `zt_effort` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `objectType` varchar(30) NOT NULL, `objectID` mediumint(8) unsigned NOT NULL, - `product` text NOT NULL, - `project` mediumint(8) unsigned NOT NULL, - `execution` mediumint(8) unsigned NOT NULL, + `product` text NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `execution` mediumint(8) unsigned NOT NULL DEFAULT '0', `account` varchar(30) NOT NULL, `work` text, `vision` varchar(10) NOT NULL DEFAULT 'rnd', `date` date NOT NULL, - `left` float NOT NULL, - `consumed` float NOT NULL, + `left` float NOT NULL DEFAULT '0', + `consumed` float NOT NULL DEFAULT '0', `begin` smallint(4) unsigned zerofill NOT NULL DEFAULT '0', `end` smallint(4) unsigned zerofill NOT NULL DEFAULT '0', `extra` text, @@ -1071,8 +1071,8 @@ CREATE TABLE IF NOT EXISTS `zt_kanbanlane` ( `type` char(30) NOT NULL, `region` mediumint(8) unsigned NOT NULL, `group` mediumint(8) unsigned NOT NULL, - `groupby` char(30) NOT NULL, - `extra` char(30) NOT NULL, + `groupby` char(30) NOT NULL DEFAULT '', + `extra` char(30) NOT NULL DEFAULT '', `name` varchar(255) NOT NULL DEFAULT '', `color` char(30) NOT NULL, `order` smallint(6) NOT NULL DEFAULT '0', @@ -1224,11 +1224,11 @@ CREATE TABLE IF NOT EXISTS `zt_pipeline` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, `type` char(30) NOT NULL, `name` varchar(50) NOT NULL, - `url` varchar(255) DEFAULT NULL, - `account` varchar(30) DEFAULT NULL, - `password` varchar(255) NOT NULL, - `token` varchar(255) DEFAULT NULL, - `private` char(32) DEFAULT NULL, + `url` varchar(255) NULL, + `account` varchar(30) NULL, + `password` varchar(255) NULL, + `token` varchar(255) NULL, + `private` char(32) NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, `editedBy` varchar(30) NOT NULL DEFAULT '', @@ -1468,21 +1468,21 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( `client` varchar(100) NOT NULL, `serviceHost` varchar(50) NOT NULL, `serviceProject` varchar(100) NOT NULL, - `commits` mediumint(8) unsigned NOT NULL, - `account` varchar(30) NOT NULL, - `password` varchar(30) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` varchar(30) NOT NULL DEFAULT '', + `password` varchar(30) NOT NULL DEFAULT '', `encrypt` varchar(30) NOT NULL DEFAULT 'plain', `acl` text NOT NULL, `synced` tinyint(1) NOT NULL DEFAULT '0', - `lastSync` datetime NOT NULL, + `lastSync` datetime NULL, `desc` text NOT NULL, `extra` char(30) NOT NULL, `preMerge` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '0', - `job` mediumint unsigned NOT NULL, + `job` mediumint unsigned NOT NULL DEFAULT '0', `fileServerUrl` text COLLATE 'utf8_general_ci' NULL, `fileServerAccount` varchar(40) NOT NULL default '', `fileServerPassword` varchar(100) NOT NULL default '', - `deleted` tinyint(1) NOT NULL, + `deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_repobranch`; @@ -12293,8 +12293,8 @@ CREATE TABLE IF NOT EXISTS `zt_workflowfield` ( `control` varchar(20) NOT NULL, `expression` text NULL, `options` text NOT NULL, - `default` varchar(100) NOT NULL, - `rules` varchar(255) NOT NULL, + `default` varchar(100) NOT NULL DEFAULT '', + `rules` varchar(255) NOT NULL DEFAULT '', `placeholder` varchar(100) NOT NULL DEFAULT '', `order` smallint(5) unsigned NOT NULL, `searchOrder` smallint(5) unsigned NOT NULL DEFAULT '0', diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 0e9c1d6dd5..8bc9a8f122 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1789,12 +1789,14 @@ class baseSQL { if($this->inCondition and !$this->conditionIsTrue) return $this; - if($this->method == 'insert') + /* DMDB replace will use $this->data. */ + if($this->method == 'insert' or $this->method == 'replace') { $this->setField = $set; $this->data->$set = ''; } - else + + if($this->method != 'insert') { /* Add ` to avoid keywords of mysql. */ if(strpos($set, '=') === false) @@ -1977,12 +1979,13 @@ class baseSQL { if($this->inCondition and !$this->conditionIsTrue) return $this; - if($this->method == 'insert') + if($this->method == 'insert' or $this->method == 'replace') { $field = $this->setField; $this->data->$field = $value; } - else + + if($this->method != 'insert') { $this->sql .= " = " . $this->quote($value); } diff --git a/module/block/control.php b/module/block/control.php index 1e69560ff9..52c0ccf256 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -2150,6 +2150,7 @@ class block extends control public function printProductDocBlock() { $this->loadModel('doc'); + $this->session->set('docList', $this->createLink('doc', 'index'), 'doc'); /* Set project status and count. */ $count = isset($this->params->count) ? (int)$this->params->count : 15; @@ -2170,9 +2171,19 @@ class block extends control if($this->doc->checkPrivDoc($doc)) $docGroup[$doc->product][$doc->id] = $doc; } + $hasDataProducts = $hasDataInvolveds = array(); + foreach($products as $productID => $product) + { + if(isset($docGroup[$productID]) and count($docGroup[$productID]) > 0) + { + $hasDataProducts[$productID] = $product; + if(isset($involveds[$productID])) $hasDataInvolveds[$productID] = $product; + } + } + $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->products = $products; - $this->view->involveds = $involveds; + $this->view->products = $hasDataProducts; + $this->view->involveds = $hasDataInvolveds; $this->view->docGroup = $docGroup; } @@ -2186,6 +2197,7 @@ class block extends control { $this->loadModel('doc'); $this->app->loadLang('project'); + $this->session->set('docList', $this->createLink('doc', 'index'), 'doc'); /* Set project status and count. */ $count = isset($this->params->count) ? (int)$this->params->count : 15; @@ -2212,9 +2224,19 @@ class block extends control if($this->doc->checkPrivDoc($doc)) $docGroup[$doc->project][$doc->id] = $doc; } + $hasDataProjects = $hasDataInvolveds = array(); + foreach($projects as $projectID => $project) + { + if(isset($docGroup[$projectID]) and count($docGroup[$projectID]) > 0) + { + $hasDataProjects[$projectID] = $project; + if(isset($involveds[$projectID])) $hasDataInvolveds[$projectID] = $project; + } + } + $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->projects = $projects; - $this->view->involveds = $involveds; + $this->view->projects = $hasDataProjects; + $this->view->involveds = $hasDataInvolveds; $this->view->docGroup = $docGroup; } diff --git a/module/block/view/doccollectlistblock.html.php b/module/block/view/doccollectlistblock.html.php index 2a2920e7c9..08790f8563 100644 --- a/module/block/view/doccollectlistblock.html.php +++ b/module/block/view/doccollectlistblock.html.php @@ -28,7 +28,7 @@
doc->noDoc;?>
doc->noDoc;?>