@@ -1,26 +1,26 | |||
|
1 | 1 | class ProjectEnumerationsController < ApplicationController |
|
2 | 2 | before_filter :find_project_by_project_id |
|
3 | 3 | before_filter :authorize |
|
4 | ||
|
4 | ||
|
5 | 5 | def update |
|
6 | 6 | if request.put? && params[:enumerations] |
|
7 | 7 | Project.transaction do |
|
8 | 8 | params[:enumerations].each do |id, activity| |
|
9 | 9 | @project.update_or_create_time_entry_activity(id, activity) |
|
10 | 10 | end |
|
11 | 11 | end |
|
12 | 12 | flash[:notice] = l(:notice_successful_update) |
|
13 | 13 | end |
|
14 | ||
|
14 | ||
|
15 | 15 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project |
|
16 | 16 | end |
|
17 | 17 | |
|
18 | 18 | def destroy |
|
19 | 19 | @project.time_entry_activities.each do |time_entry_activity| |
|
20 | 20 | time_entry_activity.destroy(time_entry_activity.parent) |
|
21 | 21 | end |
|
22 | 22 | flash[:notice] = l(:notice_successful_update) |
|
23 | 23 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project |
|
24 | 24 | end |
|
25 | 25 | |
|
26 | 26 | end |
General Comments 0
You need to be logged in to leave comments.
Login now