diff --git a/app/controllers/system_messages_controller.rb b/app/controllers/system_messages_controller.rb index 588e13c5e..ae49b58a8 100644 --- a/app/controllers/system_messages_controller.rb +++ b/app/controllers/system_messages_controller.rb @@ -42,7 +42,7 @@ class SystemMessagesController < ApplicationController @system_messages.user_id = User.current.id respond_to do |format| if @system_messages.save - format.html {redirect_to system_messages_url(@project)} + format.html {redirect_to user_message_path(User.current, :type => "system_message")} flash[:notice] = l(:notice_successful_message) end end diff --git a/app/tasks/homework_endtime_task.rb b/app/tasks/homework_endtime_task.rb deleted file mode 100644 index 9b3d6e2ef..000000000 --- a/app/tasks/homework_endtime_task.rb +++ /dev/null @@ -1,23 +0,0 @@ -#coding=utf-8 -# - -class HomeworkEndtimeTask - def massage_for_endtime - desc "send a message for Job deadline" - task :message => :environment do - current_day = Date.today.day - homework_commons = HomeworkCommon.where("end_time >?",Date.today) - homework_commons.each do |homework_common| - if homework_common.end_time.day - Date.today < 2 && homework_common.end_time.year == Date.year - homework_common.course.student.each do |s| - homework_common.course_messages << CourseMessage.new(:user_id => s.student_id, :course_id => homework_common.course_id, :viewed => false, :course_message_id => homework_common.id, :course_message_type => "HomeworkEndtime") - end - end - end - end - handle_asynchronously :massage_for_endtime, :run_at => HomeworkEndtimeTask.new { 1.minutes.from_now } - end - - homwork_endtime = HomeworkEndtimeTask.new - homwork_endtime.massage_for_endtime -end diff --git a/config/routes.rb b/config/routes.rb index 2a0e1a492..1df7b0d2f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -265,7 +265,6 @@ RedmineApp::Application.routes.draw do collection do post 'create', :as => 'system_messages' get 'index', :as => 'index' - get 'show', :as => 'show' end end # match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages'