|
|
@ -89,6 +89,7 @@ class MessagesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
# Create a new topic
|
|
|
|
# Create a new topic
|
|
|
|
def new
|
|
|
|
def new
|
|
|
|
|
|
|
|
if User.current.logged?
|
|
|
|
@message = Message.new
|
|
|
|
@message = Message.new
|
|
|
|
@message.author = User.current
|
|
|
|
@message.author = User.current
|
|
|
|
@message.board = @board
|
|
|
|
@message.board = @board
|
|
|
@ -101,28 +102,6 @@ class MessagesController < ApplicationController
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
|
|
|
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
# # 与我相关动态的记录add start
|
|
|
|
|
|
|
|
# if(@board && @board.course) #项目的先不管
|
|
|
|
|
|
|
|
# teachers = searchTeacherAndAssistant(@board.course)
|
|
|
|
|
|
|
|
# for teacher in teachers
|
|
|
|
|
|
|
|
# if(teacher.user_id != User.current.id)
|
|
|
|
|
|
|
|
# notify = ActivityNotify.new()
|
|
|
|
|
|
|
|
# if(@board.course)
|
|
|
|
|
|
|
|
# notify.activity_container_id = @board.course_id
|
|
|
|
|
|
|
|
# notify.activity_container_type = 'Course'
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
# notify.activity_container_id = @board.project_id
|
|
|
|
|
|
|
|
# notify.activity_container_type = 'Project'
|
|
|
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
# notify.activity_id = @message.id
|
|
|
|
|
|
|
|
# notify.activity_type = 'Message'
|
|
|
|
|
|
|
|
# notify.notify_to = teacher.user_id
|
|
|
|
|
|
|
|
# notify.is_read = 0
|
|
|
|
|
|
|
|
# notify.save()
|
|
|
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
# 与我相关动态的记录add end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
|
|
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
|
|
|
render_attachment_warning_if_needed(@message)
|
|
|
|
render_attachment_warning_if_needed(@message)
|
|
|
@ -156,6 +135,9 @@ class MessagesController < ApplicationController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
redirect_to signin_path
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Reply to a topic
|
|
|
|
# Reply to a topic
|
|
|
|