zoukankan      html  css  js  c++  java
  • 禅道 给禅道缺陷增加缺陷责任人字段

    给禅道缺陷增加缺陷责任人字段

    by:授客 QQ1033553122

    实践环境

    禅道项目管理软件9.2.1 、8.0开源Linux版

     

    给数据库表zt_bug新增自定义字段

    ALTER TABLE `zt_bug` ADD COLUMN personLiable VARCHAR(50) AFTER resolvedBy;

    修改zentaopms/module/bug/lang/zh-cn.php

    如下图,新增图示选框Bug字段,即在合适的位置插入以下代码

    $lang->bug->personLiable     = '责任人';

     

     

     

     

    注意:笔者使用的禅道,语言设置的是中文,所以仅修改zh-cn.php,不修改英文en.php和tw.php

    修改zentaopms/module/bug/view/create.html.php

    如下图,在合适的位置插入以下代码

    <tr>

      <th><nobr><?php echo $lang->bug->personLiable;?></nobr></th>

      <td>

        <div class='input-group'>

          <?php echo html::select('personLiable', $projectMembers, $personLiable, "class='from-control chosen'");?>

          <span class='input-group-btn'><?php echo html::commonButton($lang->bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?></span>

        </div>

    </td>

    </tr>

     

     

     

    修改效果

     

     

     

    修改zentaopms/module/bug/view/edit.html.php

    如下图,在合适的位置插入以下代码

    js::set('personLiable'           , $bug->personLiable);

     

     

    如下图,在合适的位置插入以下代码

    <tr>

      <th><?php echo $lang->bug->personLiable;?></th>

      <td><?php echo html::select('personLiable', $users, $bug->personLiable, "class='form-control chosen'");?></td>

    </tr>

     

     

    修改效果

     

     

     

    修改zentaopms/module/bug/view/resolve.html.php

    如下图,在合适的位置插入以下代码

    <tr>

        <th><?php echo $lang->bug->personLiable;?></th>

        <td>

            <?php if($bug->personLiable):?>

                <?php echo html::select('personLiable', $users, $bug->personLiable, "class='form-control chosen'");?>

            <?php endif;?>

            <?php if(!$bug->personLiable):?>

                <?php echo html::select('personLiable', $users, $bug->assignedTo, "class='form-control chosen'");?>

    <?php endif;?>

         </td>

    </tr>

     

     

     

    说明:如果解决Bug时,当前“责任人”为空,则当前责任人初始值设置为当前“指派给”

     

    修改效果

     

     

     

    修改zentaopms/module/bug/view/view.html.php

    在合适位置插入以下代码

    <tr>

    <th><?php echo $lang->bug->personLiable;?></th>

        <td><?php if($bug->personLiable) echo $users[$bug->personLiable];?></td>

    </tr>

     

     

     

    修改效果

     

     

     

     

    修改zentaopms/module/bug/config.php

    给config->bug->create->requiredFields 增加personLiable字段(创建Bug时,“指派给”,“责任人”必填)

    config->bug->create->requiredFields  = 'title,openedBuild,assignedTo;

     

    修改

    $config->bug->edit->requiredFields    = $config->bug->create->requiredFields;

    $config->bug->edit->requiredFields    = 'title,openedBuild,assignedTo,personLiable';

     

    说明:编辑页面相关字段的必填设置,按原始代码设置的话,同创建页面,但是创建Bug时,我并不想让责任人字段必填,所以做了如上更改。

     

    为$config->bug->resolve->requiredFields增加personLiable字段(解决Bug时,“责任人”必填)

    $config->bug->resolve->requiredFields = 'resolution,source,personLiable';

     

    在合适的位置增加以下代码(增加“责任人”搜索字段)

    $config->bug->search['fields']['personLiable']   = $lang->bug->personLiable;

     

     

     

    在合适的位置增加以下代码(设置“责任人”搜索字段可选值,即责任人可选列表)

    $config->bug->search['params']['personLiable']  = array('operator' => '=',       'control' => 'select', 'values' => 'users');

     

     

     

    修改zentaopms/module/bug/control.php

    修改public function export($productID, $orderBy)函数代码,如下,在合适位置增加以下代码,解决导出报表,新增字段列的值不为设置的枚举选项值,而是为索引值问题。

     

    if(isset($users[$bug->personLiable])) $bug->personLiable = $users[$bug->personLiable];

     

     

     

  • 相关阅读:
    路由的使用
    组件之间的参数传递
    vue组件的全局注册和局部注册
    git版本回退(回退至上个版本,回退至指定版本) git放弃本地所有未提交的修改
    vue工程中的文件
    新建vue项目(webpack-simple)
    NPM install -save 和 -save-dev 傻傻分不清
    动态增加表单vue element ui
    JAVA声明一个对象数组
    调用测试用
  • 原文地址:https://www.cnblogs.com/shouke/p/12656425.html
Copyright © 2011-2022 走看看