Permalink
Browse files

Merge branch 'master' of git://github.com/software-project/scrum-pm

  • Loading branch information...
2 parents 86062f1 + dff3caa commit 7d88fef2267736fb009923b6541d9945dd950451 root committed Mar 21, 2010
View
30 app/controllers/issue_sprints_controller.rb
@@ -64,16 +64,21 @@ def update_task
value = obj.find(params[:value]) unless params[:value].blank?
task = Issue.find(params[:task_id])
eval "task.#{params[:field]}=#{value ? value.id : "nil"}"
- task.save!
- @issue_statuses = IssueStatus.find(:all)
- @project_users = User.find(:all, :joins => :members, :conditions => ["members.project_id = ?", @project.id])
- status = done_ratio_to_status(task)
-
- render :update do |page|
- page.replace "task_wrap_#{task.id}", ""
- page.insert_html :bottom, "tasks_#{ status }_us_#{task.user_story_id}", :partial => "shared/task_view",
- :locals => {:task => task, :issue_statuses => @issue_statuses,
- :project_users => @project_users}
+ if task.save
+ @issue_statuses = IssueStatus.find(:all)
+ @project_users = User.find(:all, :joins => :members, :conditions => ["members.project_id = ?", @project.id])
+ status = done_ratio_to_status(task)
+
+ render :update do |page|
+ page.replace "task_wrap_#{task.id}", ""
+ page.insert_html :bottom, "tasks_#{ status }_us_#{task.user_story_id}", :partial => "shared/task_view",
+ :locals => {:task => task, :issue_statuses => @issue_statuses,
+ :project_users => @project_users}
+ end
+ else
+ render :update do |page|
+ page.insert_html :top, "content", content_tag('div', t(:error_changing_status), :class => "error", :id => "errorExplanation")
+ end
end
end
@@ -96,10 +101,15 @@ def status_change
@issue_statuses = IssueStatus.find(:all)
@project_users = User.find(:all, :joins => :members, :conditions => ["members.project_id = ?", @project.id])
render :update do |p|
+ p.replace "task_wrap_#{issue.id}", ""
p.insert_html :bottom, "tasks_#{params[:status_id]}_us_#{issue.user_story_id}", :partial => "shared/task_view",
:locals => {:task => issue, :issue_statuses => @issue_statuses,
:project_users => @project_users}
end
+ else
+ render :update do |page|
+ page.insert_html :top, "content", content_tag('div', t(:error_changing_status), :class => "error", :id => "errorExplanation")
+ end
end
end
end
View
2 app/controllers/sprints_controller.rb
@@ -28,7 +28,7 @@ def index
def show
unless @sprint.nil?
@unassigned_tasks = Issue.find(:all,
- :conditions => ["user_story_id IS NULL AND (fixed_version_id = ? || project_id = ?)", @sprint.id, @project.id ])
+ :conditions => ["user_story_id IS NULL AND (fixed_version_id = ? OR project_id = ?)", @sprint.id, @project.id ])
@issue_statuses = IssueStatus.find(:all)
@project_users = User.find(:all, :joins => :members, :conditions => ["members.project_id = ?", @project.id])
View
1 config/locales/en.yml
@@ -46,3 +46,4 @@ en:
upload_a_diagram: Upload A Diagram
new_diagram: New diagram
unassigned_issues: Unassigned issues
+ error_changing_status: Error while changing status. You may not have persmissions.
View
3 config/locales/pl.yml
@@ -44,4 +44,5 @@ pl:
you_have_to_create_sprint_first: Musisz dodać najpierw sprint.
upload_a_diagram: Wgraj diagram
new_diagram: Nowy diagram
- unassigned_issues: Nieprzypisane zadania
+ unassigned_issues: Nieprzypisane zadania
+ error_changing_status: Błąd podczas zmiany statusu. Możesz nie mieć prawa do tej zmiany.

0 comments on commit 7d88fef

Please sign in to comment.