给禅道缺陷增加是否遗留及来源渠道自定义字段
by:授客 QQ:1033553122
实践环境
禅道项目管理软件9.2.1 、8.0开源Linux版
给数据库表zt_bug新增自定义字段
ALTER TABLE `zt_bug` ADD COLUMN isHistory VARCHAR(10) AFTER severity;
ALTER TABLE `zt_bug` ADD COLUMN channel VARCHAR(50) AFTER severity;
修改zentaopms/module/bug/lang/zh-cn.php
如下图,新增图示选框Bug字段,即在合适的位置插入以下代码
$lang->bug->source = 'Bug根源';
如下图,在合适的位置插入以下代码
$lang->bug->sourceList['codeerror'] = '产品设计缺陷';
$lang->bug->sourceList['bug'] = '程序编码错误';
说明:这里定义的'产品设计缺陷'和'程序编码错误'用于存放对应字段select下拉选框中的数据,上述'bug','productDesign',创建Bug/编辑Bug并保存后,会被存储到数据库中。
注意:笔者使用的禅道,语言设置的是中文,所以仅修改zh-cn.php,不修改英文en.php和tw.php
修改zentaopms/module/bug/view/create.html.php
如下图,把以下代码
/* Remove the unused types. */ unset($lang->bug->typeList['designchange']); unset($lang->bug->typeList['newfeature']); unset($lang->bug->typeList['trackthings']); echo html::select('type', $lang->bug->typeList, $type, "class='form-control'"); ?> bug->os?> bug->osList, $os, "class='form-control'");?> bug->browser?> bug->browserList, $browser, "class='form-control'");?>
bug->type;?>
修改为以下代码
bug->isHistoryList, $isHistory, "class='form-control'");?> bug->channel;?> bug->type;?> /* Remove the unused types. */ unset($lang->bug->typeList['designchange']); unset($lang->bug->typeList['newfeature']); unset($lang->bug->typeList['trackthings']); echo html::select('type', $lang->bug->typeList, $type, "class='form-control'"); ?> bug->os?> bug->osList, $os, "class='form-control'");?> bug->browser?> bug->browserList, $browser, "class='form-control'");?>
bug->isHistory;?>
修改效果
如上,以下带背景色部分导致“所有用户”这个按钮跑到右侧去了,我们希望它保持原样,挨着 当前指派 下拉选框,咋办?
解决方法如下:去掉带背景色部分的内容,即可
bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?>
效果
注意:后面发现按上面的方式更改create.html.php页面后,发现页面缩放后,会出现样式错乱的问题,解决方法:
1、 还原上述代码的更改
2、 在合适位置插入背景色部分的内容
bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?> bug->deadline?>
bug->isHistoryList, $isHistory, "class='form-control'");?> bug->channel;?> bug->channelList, $channel, "class='form-control'");?>
bug->isHistory;?>
config->global->flow != 'onlyTest'):?>
/* Remove the unused types. */ unset($lang->bug->typeList['designchange']); unset($lang->bug->typeList['newfeature']); unset($lang->bug->typeList['trackthings']); echo html::select('type', $lang->bug->typeList, $type, "class='form-control'"); ?> bug->os?> bug->osList, $os, "class='form-control'");?> bug->browser?> bug->browserList, $browser, "class='form-control'");?>
bug->type;?>
修改效果
当然,也可以这么改,如下
修改
config->global->flow != 'onlyTest'):?>
/* Remove the unused types. */ unset($lang->bug->typeList['designchange']); unset($lang->bug->typeList['newfeature']); unset($lang->bug->typeList['trackthings']); echo html::select('type', $lang->bug->typeList, $type, "class='form-control'"); ?> bug->os?> bug->osList, $os, "class='form-control'");?> bug->browser?> bug->browserList, $browser, "class='form-control'");?>
bug->type;?>
为
config->global->flow != 'onlyTest'):?>
bug->isHistoryList, $isHistory, "class='form-control'");?> bug->channel;?> bug->channelList, $channel, "class='form-control'");?> bug->type;?> /* Remove the unused types. */ unset($lang->bug->typeList['designchange']); unset($lang->bug->typeList['newfeature']); unset($lang->bug->typeList['trackthings']); echo html::select('type', $lang->bug->typeList, $type, "class='form-control'"); ?> bug->os?> bug->osList, $os, "class='form-control'");?> bug->browser?> bug->browserList, $browser, "class='form-control'");?>
bug->isHistory;?>
修改效果
修改zentaopms/module/bug/view/edit.html.php
如下图,在合适的位置插入以下代码
js::set('isHistory' , $bug->isHistory);
js::set('channel' , $bug->channel);
如下图,在合适的位置插入以下代码
bug->isHistory;?>
bug->isHistoryList, $bug->isHistory, "class='form-control'");?>
bug->channel;?>
bug->channelList, $bug->channel, "class='form-control'");?>
修改效果
修改zentaopms/module/bug/view/resolve.html.php
如下图,在合适的位置插入以下代码
bug->isHistory;?>
bug->isHistoryList, $bug->isHistory, "class='form-control' ");?>
修改效果
修改zentaopms/module/bug/view/view.html.php
在合适位置插入以下代码
bug->isHistoryList, $bug->isHistory);?>'>bug->isHistoryList, $bug->isHistory)?>
bug->channel;?>
bug->channelList, $bug->channel);?>'>bug->channelList, $bug->channel)?>
修改效果