Forums » Development »
Reloading after change issue priority when I create new task
Added by Peter Drábik over 9 years ago
Hi, I need your help.
When I create a new task, and while I'm changing some attributes - after changing them - there is a window with loading, but when I changeing priority - window with loading... does not appear. I need this feature, because I set issue due date based on the priority. Can you help me? Sorry for my bad english. Thanks
Environment:
Redmine version 3.1.0.stable
Ruby version 2.0.0-p353 (2013-11-22) [x86_64-linux]
Rails version 4.2.3
Environment production
Database adapter Mysql2
SCM:
Subversion 1.6.11
Mercurial 2.2.2
Git 1.7.12.4
Filesystem
Redmine plugins:
progressive_projects_list 2.0.1
redmine_agile 1.3.9
redmine_checklists 3.1.1
redmine_issue_control_panel 0.3.0
redmine_issue_history 1.0.0
redmine_theme_changer 0.2.0
sidebar_hide 0.0.7
I have this code:
if @issue.priority_id==1
@issue.due_date ||= Date.today + 10
end
and I put them in issues_controller.rb
after
def new
Replies (1)
RE: Reloading after change issue priority when I create new task - Added by Peter Drábik over 9 years ago
I think I solved this by adding: onchange => "updateIssueFrom ('# {escape_javascript update_issue_form_path (project,issue)}')" in the views / issue / _attributes.html.erb
<% if @issue.safe_attribute? 'priority_id' >
<p><= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(Herve Harster, @issue)}')", :disabled => !@issue.leaf? ></p>
< end %>
What do you say to such a this solution?