diff --git a/db/standard/zentao17.7.sql b/db/standard/zentao17.7.sql index 32e0edfa70..68e0850ff9 100644 --- a/db/standard/zentao17.7.sql +++ b/db/standard/zentao17.7.sql @@ -1489,7 +1489,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2187,7 +2187,7 @@ CREATE TABLE `zt_project` ( `displayCards` smallint(6) NOT NULL DEFAULT '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/standard/zentao17.8.sql b/db/standard/zentao17.8.sql index 32e0edfa70..68e0850ff9 100644 --- a/db/standard/zentao17.8.sql +++ b/db/standard/zentao17.8.sql @@ -1489,7 +1489,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2187,7 +2187,7 @@ CREATE TABLE `zt_project` ( `displayCards` smallint(6) NOT NULL DEFAULT '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/standard/zentao18.0.sql b/db/standard/zentao18.0.beta1.sql similarity index 99% rename from db/standard/zentao18.0.sql rename to db/standard/zentao18.0.beta1.sql index cae78ceb4e..03eda84c01 100644 --- a/db/standard/zentao18.0.sql +++ b/db/standard/zentao18.0.beta1.sql @@ -1232,6 +1232,8 @@ CREATE TABLE `zt_im_chat` ( `pinnedMessages` text NOT NULL, `mergedChats` text NOT NULL DEFAULT '', `adminInvite` enum('0','1') NOT NULL DEFAULT '0', + `avatar` text NOT NULL DEFAULT '', + `archiveDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `gid` (`gid`), KEY `name` (`name`), @@ -1490,7 +1492,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2192,7 +2194,7 @@ CREATE TABLE `zt_project` ( `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `multiple` enum('0', '1') NOT NULL DEFAULT '1', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/update17.6.2.sql b/db/update17.6.2.sql index 3217d8b7db..7807d1bbcd 100644 --- a/db/update17.6.2.sql +++ b/db/update17.6.2.sql @@ -62,10 +62,10 @@ CREATE TABLE `zt_ticketrelation` ( ALTER TABLE `zt_product` ADD `ticket` varchar(30) NOT NULL AFTER `feedback`; ALTER TABLE `zt_kanban` ADD `colWidth` smallint(4) NOT NULL DEFAULT '264' AFTER `fluidBoard`; -ALTER TABLE `zt_kanban` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '180' AFTER `colWidth`; +ALTER TABLE `zt_kanban` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '200' AFTER `colWidth`; ALTER TABLE `zt_kanban` ADD `maxColWidth` smallint(4) NOT NULL DEFAULT '384' AFTER `minColWidth`; ALTER TABLE `zt_project` ADD `colWidth` smallint(4) NOT NULL DEFAULT '264' AFTER `fluidBoard`; -ALTER TABLE `zt_project` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '180' AFTER `colWidth`; +ALTER TABLE `zt_project` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '200' AFTER `colWidth`; ALTER TABLE `zt_project` ADD `maxColWidth` smallint(4) NOT NULL DEFAULT '384' AFTER `minColWidth`; REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'syncProduct', '{"feedback":{},"ticket":{}}'); diff --git a/db/zentao.sql b/db/zentao.sql index 557a6663ad..31412ef369 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6407,8 +6407,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_message` ( KEY `mgid` (`gid`), KEY `mcgid` (`cgid`), KEY `muser` (`user`), - KEY `mtype` (`type`), - UNIQUE `unique_msg`(`index`, `cgid`) + KEY `mtype` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_message_backup`; diff --git a/lib/zfile/zfile.class.php b/lib/zfile/zfile.class.php index 8e24357a7a..4903d50df4 100644 --- a/lib/zfile/zfile.class.php +++ b/lib/zfile/zfile.class.php @@ -223,7 +223,7 @@ class zfile * * @param string $patern * @access public - * @return avoid + * @return void */ public function batchRemoveFile($patern) { diff --git a/module/admin/config.php b/module/admin/config.php index 197e7da4e2..8fa6c10599 100644 --- a/module/admin/config.php +++ b/module/admin/config.php @@ -1,14 +1,4 @@ url = new stdclass(); -$config->url->community = 'https://www.zentao.net'; -$config->url->ask = 'https://www.zentao.net/ask-browse.html'; -$config->url->document = 'https://www.zentao.net/help-book-zentaopmshelp.html'; -$config->url->feedback = 'https://www.zentao.net/forum-board-1074.html'; -$config->url->faq = 'https://www.zentao.net/ask-faq.html'; -$config->url->extension = 'https://www.zentao.net/extension-browse.html'; -$config->url->donation = 'https://www.zentao.net/help-donation.html'; -$config->url->service = 'https://www.cnezsoft.com/article-browse-1078.html'; - $config->admin->apiRoot = 'https://www.zentao.net'; $config->admin->log = new stdclass(); diff --git a/module/backup/control.php b/module/backup/control.php index e7ab01797e..26713a2d5e 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -337,11 +337,12 @@ class backup extends control { $this->app->loadLang('extension'); - $search = dirname($this->app->getBasePath()) . DS; + $search = $this->app->getBasePath(); $pos = strpos($statusFile, $search); - if($pos !== false) $statusFile = substr_replace($statusFile, '', $pos, strlen($search)); + $okFile = $statusFile; + if($pos !== false) $okFile = substr_replace($statusFile, '', $pos, strlen($search)); - $this->view->error = sprintf($this->lang->extension->noticeOkFile, $statusFile, $statusFile); + $this->view->error = sprintf($this->lang->extension->noticeOkFile, $okFile, $statusFile); return print($this->display()); } diff --git a/module/build/control.php b/module/build/control.php index 0abe7eb54e..d7ca71bae2 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -54,7 +54,7 @@ class build extends control if(defined('TUTORIAL')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); // Fix bug #21095. - $buildID = $this->build->create($executionID, $projectID); + $buildID = $this->build->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); @@ -72,6 +72,8 @@ class build extends control if($this->app->tab == 'project') { $this->project->setMenu($projectID); + $executions = $this->execution->getPairs($projectID, 'all', 'stagefilter'); + $executionID = empty($executionID) ? key($executions) : $executionID; $productGroups = $this->product->getProducts($projectID); $branchGroups = $this->project->getBranchesByProject($projectID); $this->session->set('project', $projectID); @@ -79,6 +81,7 @@ class build extends control elseif($this->app->tab == 'execution') { $execution = $this->execution->getByID($executionID); + $executions = $this->execution->getPairs($execution->project); $projectID = $execution->project; $productGroups = $this->product->getProducts($executionID); $branchGroups = $this->project->getBranchesByProject($executionID); @@ -89,6 +92,7 @@ class build extends control { $execution = $this->execution->getByID($executionID); $projectID = $execution ? $execution->project : 0; + $executions = $this->execution->getPairs($projectID); $productGroups = $this->product->getProducts($executionID); $branchGroups = $this->project->getBranchesByProject($executionID); } @@ -119,6 +123,7 @@ class build extends control $this->view->executionID = $executionID; $this->view->products = $products; $this->view->projectID = $projectID; + $this->view->executions = $executions; $this->view->lastBuild = $this->build->getLast($executionID, $projectID); $this->view->productGroups = $productGroups; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); @@ -255,7 +260,7 @@ class build extends control $bugPager = new pager($type == 'bug' ? $recTotal : 0, $recPerPage, $type == 'bug' ? $pageID : 1); $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('id')->in($build->bugs) + ->where('id')->in($build->allBugs) ->andWhere('deleted')->eq(0) ->beginIF($type == 'bug')->orderBy($sort)->fi() ->page($bugPager) @@ -264,7 +269,7 @@ class build extends control /* Get stories and stages. */ $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); $stories = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY) - ->where('id')->in($build->stories) + ->where('id')->in($build->allStories) ->andWhere('deleted')->eq(0) ->beginIF($type == 'story')->orderBy($sort)->fi() ->page($storyPager) @@ -277,10 +282,14 @@ class build extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($build->project); + $objectType = 'project'; + $objectID = $build->project; } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($build->execution); + $objectType = 'execution'; + $objectID = $build->execution; } $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); @@ -297,18 +306,6 @@ class build extends control $this->executeHooks($buildID); - if($this->app->tab == 'execution') - { - $objectType = 'execution'; - $objectID = $build->execution; - } - else - { - $objectType = 'project'; - $objectID = $build->project; - } - - /* Assign. */ $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. $this->view->users = $this->loadModel('user')->getPairs('noletter'); @@ -611,11 +608,11 @@ class build extends control $executionID = $build->execution ? $build->execution : $build->project; if($browseType == 'bySearch') { - $allStories = $this->story->getBySearch($build->product, $build->branch, $queryID, 'id', $executionID, 'story', $build->stories, $pager); + $allStories = $this->story->getBySearch($build->product, $build->branch, $queryID, 'id', $executionID, 'story', $build->allStories, $pager); } else { - $allStories = $this->story->getExecutionStories($executionID, $build->product, 0, 't1.`order`_desc', 'byBranch', $build->branch, 'story', $build->stories, $pager); + $allStories = $this->story->getExecutionStories($executionID, $build->product, 0, 't1.`order`_desc', 'byBranch', $build->branch, 'story', $build->allStories, $pager); } $this->view->allStories = $allStories; @@ -735,11 +732,11 @@ class build extends control $executionID = $build->execution ? $build->execution : $build->project; if($browseType == 'bySearch') { - $allBugs = $this->bug->getBySearch($build->product, $build->branch, $queryID, 'id_desc', $build->bugs, $pager, $build->project); + $allBugs = $this->bug->getBySearch($build->product, $build->branch, $queryID, 'id_desc', $build->allBugs, $pager, $build->project); } else { - $allBugs = $this->bug->getExecutionBugs($executionID, 0, 'all', $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->bugs, $pager); + $allBugs = $this->bug->getExecutionBugs($executionID, 0, 'all', $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->allBugs, $pager); } $this->view->allBugs = $allBugs; diff --git a/module/build/js/create.js b/module/build/js/create.js index 24e9448c82..c70dafe3f1 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -15,5 +15,55 @@ $().ready(function() $('#builds').chosen(); }); }); + + $('input[name=type]').change(function() + { + if($(this).val() == 'execution') + { + $('#execution').closest('tr').show(); + $('#buildBox').closest('tr').hide(); + loadProducts($('#execution').val()); + } + else + { + $('#execution').closest('tr').hide(); + $('#buildBox').closest('tr').show(); + loadProducts($('#project').val()); + } + }); $('#product').change(); }); + +/** + * Load products. + * + * @param int $executionID + * @access public + * @return void + */ +function loadProducts(executionID) +{ + $('#product').remove(); + $('#product_chosen').remove(); + $('#branch').remove(); + $('#branch_chosen').remove(); + $('#noProduct').remove(); + $.get(createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data) + { + if(data) + { + if(data.indexOf("required") != -1) + { + $('#productBox').addClass('required'); + } + else + { + $('#productBox').removeClass('required'); + } + + $('#productBox').append(data); + $('#product').chosen(); + loadBranches($("#product").val()); + } + }); +} diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 39f5f213c7..b6987753bd 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -33,6 +33,7 @@ $lang->build->project = 'Project'; $lang->build->branch = 'Platform/Branch'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->type = 'Type'; $lang->build->builds = 'Linked Builds'; $lang->build->name = 'Name'; $lang->build->date = 'Datum'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, erstellt von $actor $lang->backhome = 'zurück'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index df6d81e8d1..9a1e7727cc 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -34,6 +34,7 @@ $lang->build->branch = 'Platform/Branch'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; $lang->build->builds = 'Linked Builds'; +$lang->build->type = 'Type'; $lang->build->name = 'Name'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, created by $actor, $lang->backhome = 'back'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 30ed628f70..e5e151b4e4 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -33,6 +33,7 @@ $lang->build->project = 'Project'; $lang->build->branch = 'Plateforme/Branche'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->type = 'Type'; $lang->build->builds = 'Linked Builds'; $lang->build->name = 'Nom'; $lang->build->date = 'Date'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, Build $extra créé $lang->backhome = 'Retour'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 0be8d8c8b5..13da7f11b3 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -33,6 +33,7 @@ $lang->build->project = '所属项目'; $lang->build->branch = '平台/分支'; $lang->build->branchName = '所属%s'; $lang->build->execution = '所属' . $lang->executionCommon; +$lang->build->type = '版本类型'; $lang->build->builds = '关联版本'; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; @@ -71,3 +72,7 @@ $lang->build->action = new stdclass(); $lang->build->action->buildopened = '$date, 由 $actor 创建版本 $extra。' . "\n"; $lang->backhome = '返回'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/model.php b/module/build/model.php index 695656a2f1..af0ee2b178 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -31,6 +31,7 @@ class buildModel extends model ->fetch(); if(!$build) return false; + $build = $this->linkChildBuilds($build); $build = $this->loadModel('file')->replaceImgURL($build, 'desc'); $build->files = $this->file->getByObject('build', $buildID); if($setImgSize) $build->desc = $this->file->setImgSize($build->desc); @@ -302,42 +303,31 @@ class buildModel extends model /** * Create a build * - * @param int $executionID - * @param int $projectID * @access public * @return void */ - public function create($executionID = 0, $projectID = 0) + public function create() { $build = new stdclass(); $build->stories = ''; $build->bugs = ''; - if($projectID && !$executionID) - { - $project = $this->loadModel('project')->getByID($projectID); - if(!$project->multiple) $executionID = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->fetch('id'); - } - else if($executionID && !$projectID) - { - $execution = $this->loadModel('execution')->getByID($executionID); - $projectID = $execution->project; - } - $build = fixer::input('post') - ->setDefault('project', $projectID) + ->setDefault('project', 0) + ->setDefault('execution', 0) ->setDefault('product', 0) ->setDefault('branch', 0) ->setDefault('builds', '') ->cleanInt('product,branch') - ->add('execution', $executionID) ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::now()) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) ->join('builds', ',') - ->remove('resolvedBy,allchecker,files,labels,uid') + ->remove('resolvedBy,allchecker,files,labels,type,uid') ->get(); + if($this->post->type == 'project') $build->execution = 0; + $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_BUILD)->data($build) ->autoCheck() @@ -349,7 +339,6 @@ class buildModel extends model if(!dao::isError()) { $buildID = $this->dao->lastInsertID(); - $this->linkChildBuilds($buildID, $build->builds); $this->file->updateObjectID($this->post->uid, $buildID, 'build'); $this->file->saveUpload('build', $buildID); $this->loadModel('score')->create('build', 'create', $buildID); @@ -389,8 +378,6 @@ class buildModel extends model if(isset($build->branch) and $oldBuild->branch != $build->branch) $this->dao->update(TABLE_RELEASE)->set('branch')->eq($build->branch)->where('build')->eq($buildID)->exec(); if(!dao::isError()) { - $addBuilds = array_diff(explode(',', $build->builds), explode(',', $oldBuild->builds)); - if($addBuilds) $this->linkChildBuilds($buildID, $addBuilds); $this->file->updateObjectID($this->post->uid, $buildID, 'build'); return common::createChanges($oldBuild, $build); } @@ -569,28 +556,28 @@ class buildModel extends model /** * Bugs and stories associated with child builds. * - * @param int $buildID - * @param string $childBuildIDList + * @param object $build * @access public - * @return void + * @return object */ - public function linkChildBuilds($buildID, $childBuildIDList) + public function linkChildBuilds($build) { - $build = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->eq($buildID)->fetch(); - $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($childBuildIDList)->fetchAll(); + $build->allBugs = $build->bugs; + $build->allStories = $build->stories; + $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); foreach($childBuilds as $childBuild) { - if($childBuild->bugs) $build->bugs .= ",{$childBuild->bugs}"; - if($childBuild->stories) $build->stories .= ",{$childBuild->stories}"; + if($childBuild->bugs) $build->allBugs .= ",{$childBuild->bugs}"; + if($childBuild->stories) $build->allStories .= ",{$childBuild->stories}"; } - $build->bugs = explode(',', $build->bugs); - $build->bugs = join(',', array_unique(array_filter($build->bugs))); - $build->stories = explode(',', $build->stories); - $build->stories = join(',', array_unique(array_filter($build->stories))); + $build->allBugs = explode(',', $build->allBugs); + $build->allBugs = join(',', array_unique(array_filter($build->allBugs))); + $build->allStories = explode(',', $build->allStories); + $build->allStories = join(',', array_unique(array_filter($build->allStories))); - $this->dao->update(TABLE_BUILD)->data($build)->where('id')->eq($buildID)->exec(); + return $build; } /** diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 6a26488df3..e7b45afe8f 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -19,6 +19,14 @@