Redmine it!
redmine插件开发简介
最稳妥的学习应该是先看官方文档,官方还给了一个具体的插件开发教程,不过如果一步不差按照教程敲代码,其实会发现还是有些问题的,需要稍稍改动。
这里,我自己编写了一个简单的插件,基于redmine-3.4.6-passenger版本。
####
插件名称:field_value_adaption
依赖插件:select_to_select2
插件作用:在issue的自定义字段中,根据某个自定义字段的值,自动填写其他自定义字段的值,这些值存在数据库中,如下数据库,当自定义字段1的值选择’便签’时,自动将686,626填写进入自定义子字段4,
数据库设计:
| Id | field_selector | value | field_selector_by | value_by |
| —— | —— | —— | —— | —— |
| 1 | #issue_custom_field_values_1 | 便签 | #issue_custom_field_values_4 | 686,626 |
| 2 | #issue_custom_field_values_1 | 天气 | #issue_custom_field_values_4 | 691 |
####
控制器 adaption
模型 field_value_relation
#设置开发环境变量
1 |
|
1 |
|
#需要在redmine根目录下执行以下代码,默认是/usr/src/redmine
#新建插件
1 |
|
#新建数据库
1 |
|
#迁移数据库
1 |
|
#将数据库编码设置成utf-8,如果没有中文输入,则没必要修改
1 |
|
#插入数据,可以直接在数据库中插入
1 |
|
#创建控制器
1 |
|
修改控制器代码
1 |
|
编写plugins/field_value_adaption/app/views/adaption/get.js.erb
1 |
|
配置路由
1 |
|
配置issue页面发送请求的js plugins/field_value_adaption/assets/javascripts/fields_adaption_get.js
1 |
|
使用hook机制,在所有载入的url包含issue的请求中调用上述js
plugins/field_value_adaption/lib/fields_adaption_hook_listener.rb
1 |
|
在init.rb中应用该hook
1 |
|
Redmine it!的更多相关文章
- bitnami redmine版本由2.3.1升级至3.2.2过程
环境: 操作系统为ubuntu13.**版本,非长期支持版. 安装目录:/opt/redmine-2.3.1-0/ 所有者用户:root 安装过程: 1. 备份2.3.1数据库 sudo /opt/r ...
- redmine整合GIT版本库
redmine整合GIT版本库 服务器的环境: Ubuntu 11.10 64位 Redmine 1.4.5.stable.10943 git version 1.7.5.4 + gitolite ...
- Centos 6.5 部署 redmine 3.3
验证ruby版本 如果有就卸载安装最新的 yum install gcc* openssl openssl-devel -y wget https://ruby.taobao.org/mirrors/ ...
- Redmine 插件安装
将对应的插件都复制进redmine的plugins 安装对应所需要的GEMS bundle install --without development test rmagick 执行插件合并 bund ...
- redmine问题集锦
当我新建LDAP认证模式时,遇到如下错误:
- Redmine新建问题速度慢
Redmine有时候新建问题 ,更新指派人的时候反应很慢, 很大原因应该是发送邮件方式不对. 1.一种方式是改为异步发送 2.另外检测到Redmine日志 ,会发现发送邮件失败 ,也会导致发 ...
- Testlink与Redmine关联
TestLink是一个开源的测试管理工具,它可以有效地管理整个测试流程(测试需求, 测试计划, 测试用例, 测试执行, 测试结果分析),但不能和开发流程统一起来,从而不能及时参与到开发中去,不能使项目 ...
- redmine常见问题
1.测试Pop3邮件收件任务:rake redmine:email:receive_pop3 RAILS_ENV="production" host=pop.cecgw.cn po ...
- Bitnami Redmine插件记录
1.bitnami安装时自带了开发环境,如ruby.rails.devkit. 为了版本兼容,应使用bitnami的命令行. 2.通过use_redmine启动命令行:运行Bitnami\redmin ...
- redmine export long csv file failed: 502 proxy error
After modified the file \apps\redmine\conf\httpd-vhosts.conf: <VirtualHost *:8080> ServerName ...
随机推荐
- 我的第一次JAVA实训——校园公用房管理系统
老铁们,昨天电脑没电了.这是上周答应的大项目. 别打脸. 详细内容我之后再写,下面是代码地址. Github地址 附:一个寂寞 以上
- rabbit-mq cluster安装
Centos6.5 安装 RabbitMQ3.6.5 一.安装编译工具 yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel op ...
- js样式添加
document.getElementsByName("spans")[index].style.color = "blue";
- CodeForces 382B 数学推导
这个题目题意简单,但是TLE得哭哭的... 输入 a b w x c五个数,最终要使得c<=a, 每一秒可以进行一个操作,如果b>=x,则 b=b-x,同时 c--;如果b<x,则a ...
- 【转载】Github上优秀的.NET Core项目
Github上优秀的.NET Core项目 Github上优秀的.NET Core开源项目的集合.内容包括:库.工具.框架.模板引擎.身份认证.数据库.ORM框架.图片处理.文本处理.机器学习.日志. ...
- Mybatis 使用分页查询亿级数据 性能问题 DB使用ORACLE
一般用到了mybatis框架分页就不用自己写了 直接用RowBounds对象就可以实现,但这个性能确实很低 今天我用到10w级得数据分页查询,到后面几页就迭代了很慢 用于记录 1.10万级数据如下 [ ...
- P3810 【模板】三维偏序(陌上花开)(CDQ分治)
题目背景 这是一道模板题 可以使用bitset,CDQ分治,K-DTree等方式解决. 题目描述 有 nn 个元素,第 ii 个元素有 a_iai.b_ibi.c_ici 三个属性,设 f(i) ...
- PAT Advanced 1074 Reversing Linked List (25) [链表]
题目 Given a constant K and a singly linked list L, you are supposed to reverse the links of every K e ...
- PowerShell创建 Profile
profile主要用于个性化常用的函数.别名等等.每次加载powershell的时候,都会执行profile中的内容. 查看是否有profile: $profile 如果结果是false说明没有.则创 ...
- Spring核心实现篇
一.Spring Framework的核心:IoC容器的实现 1.1Spring IoC的容器概述 1.1.1 IoC容器和控制反转模式 依赖控制反转的实现有很多种方式.在Spring中,IOC容器是 ...