Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
chenfeiCF
2015-11-13 11:20:36 +08:00
16 changed files with 93 additions and 84 deletions

View File

@@ -5,27 +5,28 @@ ALTER TABLE `zt_product` ADD `type` varchar(30) COLLATE 'utf8_general_ci' NOT NU
ALTER TABLE `zt_projectproduct` ADD `branch` mediumint(8) unsigned NOT NULL;
ALTER TABLE `zt_productplan` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_build` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_release` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_bug` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_case` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_module` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `root`;
ALTER TABLE `zt_story` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_build` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `product`;
ALTER TABLE `zt_release` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `product`;
ALTER TABLE `zt_bug` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `product`;
ALTER TABLE `zt_case` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `product`;
ALTER TABLE `zt_module` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `root`;
ALTER TABLE `zt_story` ADD `branch` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `product`;
CREATE TABLE `zt_branch` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
`product` mediumint unsigned NOT NULL,
`name` varchar(255) COLLATE 'utf8_general_ci' NOT NULL,
`deleted` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '0'
);
CREATE TABLE `zt_storystage` (
`story` mediumint unsigned NOT NULL,
`branch` mediumint unsigned NOT NULL,
`stage` varchar(50) COLLATE 'utf8_general_ci' NOT NULL
);
CREATE TABLE IF NOT EXISTS `zt_branch` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`product` mediumint(8) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `zt_storystage` (
`story` mediumint(8) unsigned NOT NULL,
`branch` mediumint(8) unsigned NOT NULL,
`stage` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `zt_story` ADD INDEX `product` (`product`, `module`, `type`, `pri`), DROP INDEX `product`;
ALTER TABLE `zt_story` ADD `plan` text COLLATE 'utf8_general_ci' NOT NULL AFTER `module`;
UPDATE `zt_story` SET `plan`='' WHERE `plan`='0';
ALTER TABLE `zt_release` DROP INDEX `name`;
ALTER TABLE `zt_user` ADD `ranzhi` char(30) COLLATE 'utf8_general_ci' NOT NULL AFTER `locked`;
ALTER TABLE `zt_user` ADD `ranzhi` char(30) COLLATE 'utf8_general_ci' NOT NULL DEFAULT '' AFTER `locked`;

View File

@@ -13,10 +13,20 @@ CREATE TABLE IF NOT EXISTS `zt_action` (
`read` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_branch`;
CREATE TABLE IF NOT EXISTS `zt_branch` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`product` mediumint(8) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_bug`;
CREATE TABLE IF NOT EXISTS `zt_bug` (
`id` mediumint(8) NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`module` mediumint(8) unsigned NOT NULL default '0',
`project` mediumint(8) unsigned NOT NULL default '0',
`plan` mediumint(8) unsigned NOT NULL default '0',
@@ -65,6 +75,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` (
CREATE TABLE IF NOT EXISTS `zt_build` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`project` mediumint(8) unsigned NOT NULL default '0',
`name` char(150) NOT NULL,
`scmPath` char(255) NOT NULL,
@@ -89,6 +100,7 @@ CREATE TABLE IF NOT EXISTS `zt_burn` (
CREATE TABLE IF NOT EXISTS `zt_case` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`module` mediumint(8) unsigned NOT NULL default '0',
`path` mediumint(8) unsigned NOT NULL default '0',
`story` mediumint(30) unsigned NOT NULL default '0',
@@ -323,6 +335,7 @@ CREATE TABLE IF NOT EXISTS `zt_mailqueue` (
CREATE TABLE IF NOT EXISTS `zt_module` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`root` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`name` char(60) NOT NULL default '',
`parent` mediumint(8) unsigned NOT NULL default '0',
`path` char(255) NOT NULL default '',
@@ -337,6 +350,7 @@ CREATE TABLE IF NOT EXISTS `zt_product` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(90) NOT NULL,
`code` varchar(45) NOT NULL,
`type` varchar(30) NOT NULL default 'normal',
`status` varchar(30) NOT NULL default '',
`desc` text NOT NULL,
`PO` varchar(30) NOT NULL,
@@ -355,6 +369,7 @@ CREATE TABLE IF NOT EXISTS `zt_product` (
CREATE TABLE IF NOT EXISTS `zt_productplan` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL,
`branch` mediumint(8) unsigned NOT NULL,
`title` varchar(90) NOT NULL,
`desc` text NOT NULL,
`begin` date NOT NULL,
@@ -401,6 +416,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` (
CREATE TABLE IF NOT EXISTS `zt_projectproduct` (
`project` mediumint(8) unsigned NOT NULL,
`product` mediumint(8) unsigned NOT NULL,
`branch` mediumint(8) unsigned NOT NULL,
PRIMARY KEY (`project`,`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_projectstory`;
@@ -415,22 +431,25 @@ CREATE TABLE IF NOT EXISTS `zt_projectstory` (
CREATE TABLE IF NOT EXISTS `zt_release` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`build` mediumint(8) unsigned NOT NULL,
`name` char(30) NOT NULL default '',
`date` date NOT NULL,
`stories` text NOT NULL,
`bugs` text NOT NULL,
`leftBugs` text NOT NULL,
`desc` text NOT NULL,
`status` varchar(20) NOT NULL default 'normal',
`deleted` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_story`;
CREATE TABLE IF NOT EXISTS `zt_story` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`product` mediumint(8) unsigned NOT NULL default '0',
`branch` mediumint(8) unsigned NOT NULL default '0',
`module` mediumint(8) unsigned NOT NULL default '0',
`plan` mediumint(8) unsigned NOT NULL default '0',
`plan` text NOT NULL default '',
`source` varchar(20) NOT NULL,
`fromBug` mediumint(8) unsigned NOT NULL default '0',
`title` varchar(255) NOT NULL,
@@ -459,7 +478,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` (
`version` smallint(6) NOT NULL default '1',
`deleted` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `product` (`product`,`module`,`plan`,`type`,`pri`),
KEY `product` (`product`,`module`,`type`,`pri`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_storyspec`;
@@ -471,6 +490,12 @@ CREATE TABLE IF NOT EXISTS `zt_storyspec` (
`verify` text NOT NULL,
UNIQUE KEY `story` (`story`,`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_storystage`;
CREATE TABLE IF NOT EXISTS `zt_storystage` (
`story` mediumint(8) unsigned NOT NULL,
`branch` mediumint(8) unsigned NOT NULL,
`stage` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_task`;
CREATE TABLE IF NOT EXISTS `zt_task` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
@@ -621,6 +646,7 @@ CREATE TABLE IF NOT EXISTS `zt_user` (
`last` int(10) unsigned NOT NULL default '0',
`fails` tinyint(5) NOT NULL default '0',
`locked` datetime NOT NULL default '0000-00-00 00:00:00',
`ranzhi` char(30) NOT NULL default '',
`deleted` enum('0','1') NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `account` (`account`),
@@ -846,6 +872,8 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(1, 'product', 'roadmap'),
(1, 'product', 'view'),
(1, 'product', 'updateOrder'),
(1, 'branch', 'manage'),
(1, 'branch', 'delete'),
(1, 'productplan', 'batchUnlinkBug'),
(1, 'productplan', 'batchUnlinkStory'),
(1, 'productplan', 'browse'),
@@ -904,6 +932,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(1, 'release', 'unlinkBug'),
(1, 'release', 'unlinkStory'),
(1, 'release', 'view'),
(1, 'release', 'changeStatus'),
(1, 'report', 'bugAssign'),
(1, 'report', 'bugCreate'),
(1, 'report', 'index'),
@@ -1027,6 +1056,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(1, 'user', 'todo'),
(1, 'user', 'unlock'),
(1, 'user', 'view'),
(1, 'user', 'unbind'),
(2, 'action', 'editComment'),
(2, 'api', 'getModel'),
(2, 'bug', 'activate'),
@@ -1655,6 +1685,8 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(5, 'product', 'roadmap'),
(5, 'product', 'view'),
(5, 'product', 'updateOrder'),
(5, 'branch', 'manage'),
(5, 'branch', 'delete'),
(5, 'productplan', 'batchUnlinkBug'),
(5, 'productplan', 'batchUnlinkStory'),
(5, 'productplan', 'browse'),
@@ -1713,6 +1745,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(5, 'release', 'unlinkBug'),
(5, 'release', 'unlinkStory'),
(5, 'release', 'view'),
(5, 'release', 'changeStatus'),
(5, 'report', 'bugAssign'),
(5, 'report', 'bugCreate'),
(5, 'report', 'index'),
@@ -2083,6 +2116,8 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(7, 'product', 'roadmap'),
(7, 'product', 'view'),
(7, 'product', 'updateOrder'),
(7, 'branch', 'manage'),
(7, 'branch', 'delete'),
(7, 'productplan', 'batchUnlinkBug'),
(7, 'productplan', 'batchUnlinkStory'),
(7, 'productplan', 'browse'),
@@ -2124,6 +2159,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(7, 'release', 'unlinkBug'),
(7, 'release', 'unlinkStory'),
(7, 'release', 'view'),
(7, 'release', 'changeStatus'),
(7, 'report', 'bugAssign'),
(7, 'report', 'bugCreate'),
(7, 'report', 'index'),
@@ -2557,6 +2593,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(9, 'user', 'todo'),
(9, 'user', 'unlock'),
(9, 'user', 'view'),
(9, 'user', 'unbind'),
(10, 'action', 'editComment'),
(10, 'api', 'getModel'),
(10, 'bug', 'activate'),

View File

@@ -89,7 +89,12 @@ class branch extends control
*/
public function delete($branchID, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->branch->confirmDelete, inlink('delete', "branchID=$branchID&confirm=yes")));
if($confirm == 'no')
{
$this->app->loadLang('product');
$productType = $this->branch->getProductType($branchID);
die(js::confirm(str_replace('%branch%', $this->lang->product->branchName[$productType], $this->lang->branch->confirmDelete), inlink('delete', "branchID=$branchID&confirm=yes")));
}
$this->branch->delete(TABLE_BRANCH, $branchID);
die(js::reload('parent'));

View File

@@ -3,6 +3,7 @@ $lang->branch->common = 'Branch';
$lang->branch->manage = 'Branch manage';
$lang->branch->delete = 'Branch delete';
$lang->branch->manageTitle = '%s Manage';
$lang->branch->all = 'All';
$lang->branch->confirmDelete = 'Branch deletion, will affect the branch of the demand, module, plan, release, Bug, testcase and so on, please consider carefully. Are you sure delete the branch?';
$lang->branch->confirmDelete = '%branch% deletion, will affect the %branch% of the demand, module, plan, release, Bug, testcase and so on, please consider carefully. Are you sure delete the %branch%?';

View File

@@ -6,4 +6,4 @@ $lang->branch->delete = '分支删除';
$lang->branch->manageTitle = '%s管理';
$lang->branch->all = '所有';
$lang->branch->confirmDelete = '分支删除,会影响关联该分支的需求、模块、计划、发布、Bug、用例等等请慎重考虑。是否删除改分支?';
$lang->branch->confirmDelete = '%branch%删除,会影响关联该%branch%的需求、模块、计划、发布、Bug、用例等等请慎重考虑。是否删除该%branch%';

View File

@@ -3,6 +3,7 @@ $lang->branch->common = '分支';
$lang->branch->manage = '分支管理';
$lang->branch->delete = '分支刪除';
$lang->branch->all = '所有';
$lang->branch->manageTitle = '%s管理';
$lang->branch->all = '所有';
$lang->branch->confirmDelete = '分支刪除,會影響關聯該分支的需求、模組、計劃、發佈、Bug、用例等等請慎重考慮。是否刪除改分支?';
$lang->branch->confirmDelete = '%branch%刪除,會影響關聯該%branch%的需求、模組、計劃、發佈、Bug、用例等等請慎重考慮。是否刪除該%branch%';

View File

@@ -99,4 +99,19 @@ class branchModel extends model
return $branchGroups;
}
/**
* Get product bype by branch.
*
* @param int $branchID
* @access public
* @return void
*/
public function getProductType($branchID)
{
return $this->dao->select('t2.type')->from(TABLE_BRANCH)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->where('t1.id')->eq($branchID)
->fetch('type');
}
}

View File

@@ -255,37 +255,6 @@ class build extends control
if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, "class='form-control'"));
}
/**
* AJAX: get builds of a branch in html select.
*
* @param int $productID
* @param int $branchID
* @param string $operation the operation of creating a release or editing.
* @param string $build build to selected.
* @access public
* @return string
*/
public function ajaxGetBranchBuilds($productID, $branchID, $operation, $build = '')
{
$builds = $this->build->getProductBuildPairs($productID, $branchID, 'notrunk', false);
$releasedBuilds = $this->loadModel('release')->getReleaseBuilds($productID, $branchID);
if($operation == 'editRelease')
{
foreach($releasedBuilds as $buildID)
{
if($build == $buildID) continue;
unset($builds[$buildID]);
}
}
if($operation == 'createRelease')
{
foreach($releasedBuilds as $buildID) unset($builds[$buildID]);
}
die(html::select('build', $builds, $build, "class='form-control'"));
}
/**
* Link stories
*

View File

@@ -177,7 +177,7 @@ $lang->product->menu->plan = array('link' => '計劃|productplan|browse|produ
$lang->product->menu->release = array('link' => '發佈|release|browse|productID=%s', 'subModule' => 'release');
$lang->product->menu->roadmap = '路線圖|product|roadmap|productID=%s';
$lang->product->menu->doc = array('link' => '文檔|product|doc|productID=%s', 'subModule' => 'doc');
$lang->product->menu->branch = '分支|branch|manage|productID=%s';
$lang->product->menu->branch = '%branch%|branch|manage|productID=%s';
$lang->product->menu->module = '模組|tree|browse|productID=%s&view=story';
$lang->product->menu->view = array('link' => '概況|product|view|productID=%s', 'alias' => 'edit');
$lang->product->menu->project = "{$lang->projectCommon}|product|project|status=all&productID=%s";

View File

@@ -48,6 +48,7 @@ $lang->group->copyOptions['copyPriv'] = '複製權限';
$lang->group->copyOptions['copyUser'] = '複製用戶';
$lang->group->versions[''] = '修改歷史';
$lang->group->versions['7_4'] = '禪道7.4';
$lang->group->versions['7_3'] = '禪道7.3';
$lang->group->versions['7_2'] = '禪道7.2';
$lang->group->versions['7_1'] = '禪道7.1';

View File

@@ -15,6 +15,7 @@ $lang->my->profile = '我的檔案';
$lang->my->dynamic = '我的動態';
$lang->my->editProfile = '修改檔案';
$lang->my->changePassword = '修改密碼';
$lang->my->unbind = '解除然之綁定';
$lang->my->taskMenu = new stdclass();
$lang->my->taskMenu->assignedToMe = '指派給我';

View File

@@ -90,6 +90,7 @@ $lang->product->typeList['normal'] = '正常';
$lang->product->typeList['branch'] = '多分支';
$lang->product->typeList['platform'] = '多平台';
$lang->product->branchName['normal'] = '';
$lang->product->branchName['branch'] = '分支';
$lang->product->branchName['platform'] = '平台';

View File

@@ -2,26 +2,3 @@ $(document).ready(function()
{
$("a.preview").modalTrigger({width:1000, type:'iframe'});
})
/**
* Load branch builds.
*
* @param int $branchID
* @access public
* @return void
*/
function loadBranchBuilds(branchID)
{
if(page == 'create')
{
oldReleasedBuild = $('#build').val() ? $('#build').val() : 0;
link = createLink('build', 'ajaxGetBranchBuilds', 'productID=' + productID + '&branchID=' + branchID + '&operation=createRelease&build=' + oldReleasedBuild);
$('#buildBox').load(link, function(){$('#build').chosen(defaultChosenOptions);});
}
else
{
link = createLink('build', 'ajaxGetBranchBuilds', 'productID=' + productID + '&branchID=' + branchID + '&operation=editRelease&build=' + oldReleasedBuild);
$('#buildBox').load(link, function(){$('#build').chosen(defaultChosenOptions);});
}
}

View File

@@ -59,7 +59,7 @@ $lang->release->exportTypeList['bug'] = 'Bug';
$lang->release->exportTypeList['leftbug'] = '遺留Bug';
$lang->release->statusList[''] = '';
$lang->release->statusList['normal'] = '正常維護';
$lang->release->statusList['normal'] = '正常';
$lang->release->statusList['terminate'] = '停止維護';
$lang->release->changeStatusList['normal'] = '激活';

View File

@@ -94,3 +94,4 @@ $lang->upgrade->fromVersions['7_1'] = '7.1';
$lang->upgrade->fromVersions['7_2'] = '7.2';
$lang->upgrade->fromVersions['7_2_4'] = '7.2.4';
$lang->upgrade->fromVersions['7_2_5'] = '7.2.5';
$lang->upgrade->fromVersions['7_3'] = '7.3';

View File

@@ -38,7 +38,7 @@ $lang->user->mobile = '手機';
$lang->user->phone = '電話';
$lang->user->address = '通訊地址';
$lang->user->zipcode = '郵編';
$lang->user->join = '入職時間';
$lang->user->join = '入職日期';
$lang->user->visits = '訪問次數';
$lang->user->ip = '最後IP';
$lang->user->last = '最後登錄';
@@ -140,7 +140,6 @@ $lang->user->placeholder->account = '英文、數字和下劃線的組合,
$lang->user->placeholder->password1 = '六位以上';
$lang->user->placeholder->role = '職位影響內容和用戶列表的順序。';
$lang->user->placeholder->group = '分組決定用戶的權限列表。';
$lang->user->placeholder->join = '入職日期';
$lang->user->placeholder->commiter = '版本控制系統(subversion)中的帳號';
$lang->user->placeholder->verify = '需要輸入你的密碼加以驗證';