0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

redmine4のWork Time pluginで、工数画面に出てくるチケットを1ボタンでまとめて非表示にする

Posted at

##■やりたいこと
 redmine4のWork Time pluginで、
 工数画面に出てくるチケットを1ボタンでまとめて非表示にしたい
 ・後で再表示できるようにCSSで制御する。
 ・view_customizeで実装する(JAVASCRIPT)。

##■環境:
Environment:
Redmine version 4.2.2.stable
Ruby version 2.6.8-p205 (2021-07-07) [x64-mingw32]
Rails version 5.2.6
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Git 2.33.0
Filesystem
Redmine plugins:
additionals 3.0.5-master
easy_gantt 1.13
redmine_work_time 0.4.1
view_customize 3.0.0

##■実装(view_customize)
パスのパターン:work_time
コード:
$(function() {
$('#time_input_table').each(function() {
var target = $(this);

var parents = 'time_entry_pos';
selectObj = document.getElementsByTagName('tr');
matchObj= new RegExp(parents);

// ボタンを追加して、ボタン押下時にチケットを非表示
var button = $('<input type="button" value="チケットを非表示">');

button.on('click', function() {
for(i=0; i < selectObj.length; i++){
if(selectObj[i].id.match(matchObj)){
selectObj[i].style.display = "none";
}
}
});
target.append($('<td>').append(button));
});
})

・ボタンを押す前
image.png

・ボタン押下後
image.png

##■確認結果

以上です、お疲れ様です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?