@ -615,6 +615,10 @@ class CoursesController < ApplicationController
end
defshow
#更新创建课程消息状态
create_course_messages=@course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?",User.current.id,'Course',@course.id,0)
no_evaluation=CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?",User.current.id,@homework.course,"NoEvaluation",0)
@ -128,12 +128,12 @@ class UsersController < ApplicationController
#课程相关消息
when'homework'
@message_alls=CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage') and user_id =?",@user).order("created_at desc")
@message_alls=CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','NoEvaluation') and user_id =?",@user).order("created_at desc")
when'course_message'
@message_alls=CourseMessage.where("course_message_type =? and user_id =?","Message",@user).order("created_at desc")
when'course_news'
# 课程通知包含发布的通知和回复的通知
@message_alls=CourseMessage.where("course_message_type =? or course_message_type =?","News","Comment").where("user_id =?",@user).order("created_at desc")
@message_alls=CourseMessage.where("course_message_type in (?, ? ,?)","News","Comment","Course").where("user_id =?",@user).order("created_at desc")
when'poll'
@message_alls=CourseMessage.where("course_message_type =? and user_id =?","Poll",@user).order("created_at desc")
@ -145,7 +145,7 @@ class UsersController < ApplicationController
when'forge_news'
@message_alls=ForgeMessage.where("forge_message_type in (?,?) and user_id =?","News","Comment",@user).order("created_at desc")
when'apply'
@message_alls=ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject') and user_id =?",@user).order("created_at desc")
@message_alls=ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?",@user).order("created_at desc")
#贴吧消息
when'forum'
@ -881,8 +881,8 @@ class UsersController < ApplicationController
@ -198,7 +198,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
//gcm files count and add delete_all link
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
varcontainerid=$(inputEl).data('containerid');
if(containerid==undefined){
varcount=$('#attachments_fields>span').length;
@ -233,7 +233,7 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}));
}
}
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ end
}
//gcm
@ -260,24 +260,24 @@ function removeFile() {
}
//gcm delete all file
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
//modify by yutao 2015-5-14 <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
functionremoveAll(containerid){
if(confirm(deleteallfiles)){
if(containerid==undefined){
$(".remove-upload").removeAttr("data-confirm");
$(".remove-upload").click();
}else{
vararr=$(".remove-upload").filter(function(){
return$(this).data('containerid')==containerid;
});
arr.removeAttr("data-confirm");
arr.click();
}
if(confirm(deleteallfiles)){
if(containerid==undefined){
$(".remove-upload").removeAttr("data-confirm");
$(".remove-upload").click();
}else{
vararr=$(".remove-upload").filter(function(){
return$(this).data('containerid')==containerid;
});
arr.removeAttr("data-confirm");
arr.click();
}
// return false;
}
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
//gcm
// return false;
}
//modify by yutao 2015-5-14 <20><>1<EFBFBD><31>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>ϴ<EFBFBD><CFB4>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ end