annotate app/controllers/project_enumerations_controller.rb @ 45:65d9e2cabaa3 luisf

Added tipoftheday to the config/settings in order to correct previous issues. Tip of the day is now working correctly. Added the heading strings to the locales files.
author luisf
date Tue, 23 Nov 2010 11:50:01 +0000
parents 40f7cfd4df19
children cbb26bc654de
rev   line source
chris@22 1 class ProjectEnumerationsController < ApplicationController
chris@22 2 before_filter :find_project_by_project_id
chris@22 3 before_filter :authorize
chris@22 4
chris@22 5 def update
chris@22 6 if request.put? && params[:enumerations]
chris@22 7 Project.transaction do
chris@22 8 params[:enumerations].each do |id, activity|
chris@22 9 @project.update_or_create_time_entry_activity(id, activity)
chris@22 10 end
chris@22 11 end
chris@22 12 flash[:notice] = l(:notice_successful_update)
chris@22 13 end
chris@22 14
chris@22 15 redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
chris@22 16 end
chris@22 17
chris@22 18 def destroy
chris@22 19 @project.time_entry_activities.each do |time_entry_activity|
chris@22 20 time_entry_activity.destroy(time_entry_activity.parent)
chris@22 21 end
chris@22 22 flash[:notice] = l(:notice_successful_update)
chris@22 23 redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
chris@22 24 end
chris@22 25
chris@22 26 end