Defect #1345 » wt-1345.patch
plugins/redmine_work_time/app/controllers/work_time_controller.rb Tue Aug 26 12:12:11 2014 +0200 → plugins/redmine_work_time/app/controllers/work_time_controller.rb Fri Sep 12 14:04:52 2014 +0200 | ||
---|---|---|
UserIssueMonth.create(:uid=>uid, :issue=>@add_issue_id,
|
||
:odr=>UserIssueMonth.count(:conditions=>["uid=:u",{:u=>uid}])+1)
|
||
end
|
||
else
|
||
Rails.logger.info("WorkTime plugin warning: not enough rights for adding issue #" + @add_issue_id + " for user '" + User.current.name + "'")
|
||
end
|
||
end
|
||
end
|
plugins/redmine_work_time/app/views/work_time/ajax_select_ticket.html.erb Tue Aug 26 12:12:11 2014 +0200 → plugins/redmine_work_time/app/views/work_time/ajax_select_ticket.html.erb Fri Sep 12 14:04:52 2014 +0200 | ||
---|---|---|
<%=issueHtml.html_safe%>
|
||
<a href="#"
|
||
onclick="JavaScript:
|
||
showModalDialog(
|
||
window.open(
|
||
'<%=url_for(:controller=>"issues", :action=>"show", :id=>issue.id)%>',
|
||
window,
|
||
"",
|
||
'');
|
||
return false;">
|
||
?
|
plugins/redmine_work_time/app/views/work_time/ajax_select_tickets.html.erb Tue Aug 26 12:12:11 2014 +0200 → plugins/redmine_work_time/app/views/work_time/ajax_select_tickets.html.erb Fri Sep 12 14:04:52 2014 +0200 | ||
---|---|---|
<%=issueHtml.html_safe%>
|
||
<a href="#"
|
||
onclick="JavaScript:
|
||
showModalDialog(
|
||
windo.open(
|
||
'<%=url_for(:controller=>"issues", :action=>"show", :id=>issue.id)%>',
|
||
window,
|
||
"",
|
||
'');
|
||
return false;">
|
||
?
|
plugins/redmine_work_time/app/views/work_time/popup_update_done_ratio.html.erb Tue Aug 26 12:12:11 2014 +0200 → plugins/redmine_work_time/app/views/work_time/popup_update_done_ratio.html.erb Fri Sep 12 14:04:52 2014 +0200 | ||
---|---|---|
<h2><%=l(:label_update_issue_done_ratios)%></h2>
|
||
<a href="#"
|
||
onclick="JavaScript:
|
||
showModalDialog(
|
||
window.open(
|
||
'<%=url_for(:controller=>"issues", :action=>"show", :id=>@issue.id)%>',
|
||
window,
|
||
"",
|
||
'');
|
||
return false;">
|
||
<%= @issueHtml.html_safe %>
|
plugins/redmine_work_time/assets/javascripts/work_time.js Tue Aug 26 12:12:11 2014 +0200 → plugins/redmine_work_time/assets/javascripts/work_time.js Fri Sep 12 14:04:52 2014 +0200 | ||
---|---|---|
// global variables for funtions called after closing a popup
|
||
var g_ajax_url;
|
||
var g_req_url;
|
||
var g_child_url;
|
||
var g_rep_url;
|
||
var g_issue_id;
|
||
function ticket_pos(url, issue, pos, max)
|
||
{
|
||
var new_pos = prompt("Destination No.", pos);
|
||
... | ... | |
function set_ticket_relay(pop_url, req_url, child_id)
|
||
{
|
||
var parent_id = showModalDialog(pop_url, window, "dialogWidth:600px;dialogHeight:480px");
|
||
g_req_url = req_url;
|
||
g_child_url = child_url;
|
||
var parent_id = window.open(pop_url,"", "width=600,height=480");
|
||
}
|
||
function set_ticket_relay_post(parent_id){
|
||
if (parent_id != null) {
|
||
set_ticket_relay_core(req_url, child_id, parent_id);
|
||
set_ticket_relay_core(g_req_url, g_child_id, parent_id);
|
||
}
|
||
}
|
||
function set_ticket_relay_by_issue_relation(req_url) {
|
||
if (typeof jQuery == "function") {
|
||
$('[data-has-parent="false"]').each(function(i, v) {
|
||
... | ... | |
function update_done_ratio(pop_url, rep_url, issue_id)
|
||
{
|
||
var done_ratio = showModalDialog(pop_url+"&issue_id="+issue_id,
|
||
window, "dialogWidth:500px;dialogHeight:150px");
|
||
if(done_ratio!=null){
|
||
g_rep_url = rep_url;
|
||
g_issue_id = issue_id;
|
||
var done_ratio = window.open(pop_url+"&issue_id="+issue_id,
|
||
"", "width:500,height=150");
|
||
}
|
||
function update_done_ratio_post(done_ratio){
|
||
if(done_ratio != null){
|
||
if( typeof jQuery == "function" ) {
|
||
jQuery.ajax({
|
||
url:rep_url+"&issue_id="+issue_id+"&done_ratio="+done_ratio,
|
||
url:g_rep_url+"&issue_id="+g_issue_id+"&done_ratio="+done_ratio,
|
||
data:{asynchronous:true, method:'get'},
|
||
success:function(response){
|
||
jQuery('#done_ratio'+issue_id).html(response);
|
||
jQuery('#done_ratio'+g_issue_id).html(response);
|
||
}
|
||
});
|
||
}
|
||
else {
|
||
new Ajax.Updater('done_ratio'+issue_id,
|
||
rep_url+"&issue_id="+issue_id+"&done_ratio="+done_ratio,
|
||
new Ajax.Updater('done_ratio'+g_issue_id,
|
||
g_rep_url+"&issue_id="+g_issue_id+"&done_ratio="+done_ratio,
|
||
{asynchronous:true, method:'get'});
|
||
}
|
||
var drs = document.getElementsByName("done_ratio"+issue_id);
|
||
var drs = document.getElementsByName("done_ratio"+g_issue_id);
|
||
for(var i = 0; i < drs.length; i++) {
|
||
drs[i].innerHTML = "["+done_ratio+"%]";
|
||
drs[i].innerHTML = "["+window['done_ratio']+"%]";
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
var add_ticket_count = 1;
|
||
function add_ticket(pop_url, ajax_url)
|
||
{
|
||
var tickets = showModalDialog(pop_url, window, "dialogWidth:600px;dialogHeight:480px");
|
||
g_ajax_url = ajax_url;
|
||
var tickets = window.open(pop_url, "tickets", "width=600,height=480");
|
||
}
|
||
function add_ticket_post(tickets){
|
||
for(i=0; i<tickets.length;i++) {
|
||
if( typeof jQuery == "function" ) {
|
||
jQuery.ajax({
|
||
url:ajax_url+"&add_issue="+tickets[i]+"&count="+add_ticket_count,
|
||
url:g_ajax_url+"&add_issue="+tickets[i]+"&count="+add_ticket_count,
|
||
data:{asynchronous:true, method:'get'},
|
||
success:function(response){
|
||
jQuery('#time_input_table_bottom').before(response);
|
||
... | ... | |
}
|
||
else {
|
||
new Ajax.Updater('time_input_table_bottom',
|
||
ajax_url+"&add_issue="+tickets[i]+"&count="+add_ticket_count,
|
||
g_ajax_url+"&add_issue="+tickets[i]+"&count="+add_ticket_count,
|
||
{insertion:Insertion.Before, method:'get'});
|
||
}
|
||
add_ticket_count ++;
|
||
}
|
||
}
|
||
function dup_ticket(ajax_url, insert_pos, id)
|
||
{
|
||
if( typeof jQuery == "function" ) {
|
||
... | ... | |
//---------------------------------------- for popup_update_done_ratio.html.erb
|
||
function ratio_inputed()
|
||
{
|
||
returnValue = document.getElementById("input_ratio").value;
|
||
window.opener.update_done_ratio_post(document.getElementById("input_ratio").value);
|
||
// returnValue = document.getElementById("input_ratio").value;
|
||
close();
|
||
}
|
||
//--------------- for popup_select_ticket.html.erb, ajax_select_ticket.html.erb
|
||
function ticket_inputed()
|
||
{
|
||
returnValue = document.getElementById("input_id").value;
|
||
window.opener.set_ticket_relay_post(document.getElementById("input_id").value);
|
||
// returnValue = document.getElementById("input_id").value;
|
||
close();
|
||
}
|
||
... | ... | |
{
|
||
var vals = document.getElementById("input_ids").value;
|
||
var tickets = vals.split(',');
|
||
returnValue=tickets;
|
||
window.opener.add_ticket_post(tickets);
|
||
// returnValue=tickets;
|
||
close();
|
||
}
|
||