微信通知显示被删除修改
This commit is contained in:
parent
7c9f5a4f2d
commit
168a47fabb
|
@ -1,3 +1,4 @@
|
||||||
|
#encoding: utf-8
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||||
#
|
#
|
||||||
|
@ -212,6 +213,18 @@ class NewsController < ApplicationController
|
||||||
@news.safe_attributes = params[:news]
|
@news.safe_attributes = params[:news]
|
||||||
@news.save_attachments(params[:attachments])
|
@news.save_attachments(params[:attachments])
|
||||||
if @news.save
|
if @news.save
|
||||||
|
@course.members.each do |m|
|
||||||
|
if m.user_id != User.current.id
|
||||||
|
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||||
|
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{@news.course_id}").count
|
||||||
|
if count == 0
|
||||||
|
ws = WechatService.new
|
||||||
|
content = @news.title
|
||||||
|
ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", @news.course.name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if params[:asset_id]
|
if params[:asset_id]
|
||||||
ids = params[:asset_id].split(',')
|
ids = params[:asset_id].split(',')
|
||||||
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
|
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
|
||||||
|
|
|
@ -167,17 +167,17 @@ class News < ActiveRecord::Base
|
||||||
# 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
|
# 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
|
||||||
def act_as_system_message
|
def act_as_system_message
|
||||||
if self.course
|
if self.course
|
||||||
self.course.members.each do |m|
|
# self.course.members.each do |m|
|
||||||
if m.user_id != self.author_id
|
# if m.user_id != self.author_id
|
||||||
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
# #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
|
||||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||||
if count == 0
|
# if count == 0
|
||||||
ws = WechatService.new
|
# ws = WechatService.new
|
||||||
content = self.title
|
# content = self.title
|
||||||
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
|
# ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
else
|
else
|
||||||
if !self.project.nil?
|
if !self.project.nil?
|
||||||
self.project.members.each do |m|
|
self.project.members.each do |m|
|
||||||
|
|
Loading…
Reference in New Issue