diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index 87bbcb2f3..f5e3314bb 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -55,8 +55,8 @@ class BlogCommentsController < ApplicationController
if params[:in_act]
redirect_to user_path(params[:user_id])
else
- if params[:is_homepage]
- redirect_to user_blogs_path(params[:user_id])
+ if @article.id.eql?(User.find(params[:user_id]).blog.homepage_id)
+ redirect_to user_path(params[:user_id])
else
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
end
diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb
index d051a91f7..bae0232a5 100644
--- a/app/controllers/org_subfields_controller.rb
+++ b/app/controllers/org_subfields_controller.rb
@@ -109,7 +109,8 @@ class OrgSubfieldsController < ApplicationController
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
if @org_subfield.subfield_subdomain_dir
@sub_dir = @org_subfield.subfield_subdomain_dir
- @sub_dir.update_attribute(:name, params[:sub_dir_name])
+ @sub_dir = SubfieldSubdomainDir.update(@sub_dir.id, :name => params[:sub_dir_name])
+ #@sub_dir.update_attribute(:name, params[:sub_dir_name])
else
@sub_dir = SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 85fc42f66..6e2da311f 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -302,7 +302,7 @@ class OrganizationsController < ApplicationController
def org_resources_subfield
@org = Organization.find(params[:id])
- if params[:send_type].present? and params[:send_type] == 'news'
+ if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@subfield = @org.org_subfields.where("field_type = 'Post'")
else
@subfield = @org.org_subfields.where('field_type = "Resource" ')
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 190784f26..22b58fe49 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1854,16 +1854,6 @@ class UsersController < ApplicationController
def share_news_to_project
news = News.find(params[:send_id])
project_ids = params[:project_ids]
- # project_ids.each do |project_id|
- # if Project.find(project_id).news.map(&:id).exclude?(news.id)
- # project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
- # news.attachments.each do |attach|
- # project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
- # :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
- # :is_public => attach.is_public, :quotes => 0)
- # end
- # end
- # end
project_ids.each do |project_id|
project = Project.find(project_id)
if project.news.map(&:id).exclude?(news.id)
@@ -1889,6 +1879,53 @@ class UsersController < ApplicationController
OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'News', :org_act_id => org_news.id, :user_id => User.current.id)
end
+ def share_message_to_course
+ @message = Message.find(params[:send_id])
+ course_ids = params[:course_ids]
+ course_ids.each do |course_id|
+ course = Course.find(course_id)
+ if course.news.map(&:id).exclude?(@message.id)
+ message = Message.create(:board_id => course.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_message_to_project
+ @message = Message.find(params[:send_id])
+ project_ids = params[:project_ids]
+ project_ids.each do |project_id|
+ project = Project.find(project_id)
+ if project.news.map(&:id).exclude?(@message.id)
+ message = Message.create(:board_id => project.boards.first.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ end
+ end
+ end
+
+ def share_message_to_org
+ field_id = params[:subfield]
+ @message = Message.find(params[:send_id])
+ @message.quotes = @message.quotes.nil? ? 1 : (@message.quotes + 1)
+ @message.save
+ board = OrgSubfield.find(field_id).boards.first
+ mes = Message.create(:board_id => board.id, :subject => @message.subject, :content => @message.content, :author_id => User.current.id)
+ @message.attachments.each do |attach|
+ mes.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
+ :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
+ :is_public => attach.is_public, :quotes => 0)
+ end
+ OrgActivity.create(:container_type => 'OrgSubfield', :container_id => field_id.to_i, :org_act_type=>'Message', :org_act_id => mes.id, :user_id => User.current.id)
+ end
+
def change_org_subfield
end
@@ -2130,9 +2167,9 @@ class UsersController < ApplicationController
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
- @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
else
- @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon','OrgSubfield','Principal')").order("created_on desc")
end
elsif params[:type] == "5" #用户资源
if User.current.id.to_i == params[:id].to_i
@@ -2238,7 +2275,7 @@ class UsersController < ApplicationController
@user = User.current
if !params[:search].nil? #发送到有栏目类型为资源的组织中
search = "%#{params[:search].to_s.strip.downcase}%"
- if params[:send_type].present? and params[:send_type] == 'news'
+ if params[:send_type].present? and (params[:send_type] == 'news' or params[:send_type] == 'message')
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Post'").count > 0}
else
@orgs = @user.organizations.where("name like ?", search).select{|org| OrgSubfield.where("organization_id = #{org.id} and field_type='Resource'").count > 0}
diff --git a/app/models/subfield_subdomain_dir.rb b/app/models/subfield_subdomain_dir.rb
index 9897e19ac..2ec93fe05 100644
--- a/app/models/subfield_subdomain_dir.rb
+++ b/app/models/subfield_subdomain_dir.rb
@@ -1,4 +1,5 @@
class SubfieldSubdomainDir < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_subfield
+ validates_exclusion_of :name, :in => %w(setting members org_document_comments)
end
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 8cb547b13..d4d12232e 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -185,20 +185,6 @@
}
-
- function org_id_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- $(".orgDirection").text(orgDirection + sendText);
- }
- function subfield_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- var sendColumn = $("input[name='subfield']:checked").next().text();
- $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
- }
-
-
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index 48cd4ab53..2fa627c73 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -5,7 +5,7 @@
- <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank" %>
+ <%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message >0 %>
<%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %>
<% end %>
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index 66d4bd0d0..022b8c76b 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -60,7 +60,7 @@
) if @message.course_destroyable_by?(User.current) %>
<% end %>
-
<%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+
<%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
@@ -175,4 +175,4 @@
postContent = postContent.replace(/ /g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
-
\ No newline at end of file
+
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
index f46e7d5ab..fab0f752e 100644
--- a/app/views/messages/_org_subfield_show.html.erb
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -58,7 +58,7 @@
}
$(function() {
- init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
+ init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
showNormalImage('message_description_<%= @topic.id %>');
});
@@ -68,7 +68,7 @@
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
- <% if @message.org_subfield_editable_by?(User.current) %>
+ <% if User.current.logged? %>
@@ -89,6 +89,7 @@
:class => 'postOptionLink'
) if @message.org_subfield_editable_by?(User.current) %>
+ <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%>
@@ -204,4 +205,4 @@
postContent = postContent.replace(/ /g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
-
\ No newline at end of file
+
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index 187e1670e..a0e9db171 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -115,7 +115,7 @@
) if @message.destroyable_by?(User.current) %>
<% end %>
-
<%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
+
<%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id},#{User.current.id},'message');", :class => 'postOptionLink' %>
diff --git a/app/views/org_subfields/show.html.erb b/app/views/org_subfields/show.html.erb
index 82203b4de..7d3a2b969 100644
--- a/app/views/org_subfields/show.html.erb
+++ b/app/views/org_subfields/show.html.erb
@@ -178,20 +178,6 @@
}
-
- function org_id_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- $(".orgDirection").text(orgDirection + sendText);
- }
- function subfield_click(){
- var sendText = $("input[name='org_id']:checked").next().text();
- var orgDirection = "目标地址:"
- var sendColumn = $("input[name='subfield']:checked").next().text();
- $(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
- }
-
-
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
diff --git a/app/views/org_subfields/update_sub_dir.js.erb b/app/views/org_subfields/update_sub_dir.js.erb
index 7960ca26c..3d42c260b 100644
--- a/app/views/org_subfields/update_sub_dir.js.erb
+++ b/app/views/org_subfields/update_sub_dir.js.erb
@@ -1,11 +1,6 @@
-<% if @exist == false %>
+<% if @exist == false and @sub_dir.valid? %>
$('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>');
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>');
-// $('#sub_dir_show_<%= @org_subfield.id %>').show();
-// $('#sub_dir_edit_<%= @org_subfield.id %>').hide();
<% else %>
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>');
-// alert("该目录已存在,请重新输入");
-// $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>');
-// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
<% end %>
\ No newline at end of file
diff --git a/app/views/organizations/_org_subfield_message.html.erb b/app/views/organizations/_org_subfield_message.html.erb
index 349f7c86e..a14138903 100644
--- a/app/views/organizations/_org_subfield_message.html.erb
+++ b/app/views/organizations/_org_subfield_message.html.erb
@@ -13,7 +13,6 @@
<% end %>
TO
<%= link_to activity.board.org_subfield.name.to_s+" | 帖子栏目讨论区",organization_path(activity.board.org_subfield.organization, :org_subfield_id => activity.board.org_subfield.id), :class => "newsBlue ml15 mr5"%>
-
<% if activity.parent_id.nil? %>
@@ -44,6 +43,31 @@
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
+
+
+
+ <% if User.current.logged? %>
+
+ <%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'message')") %>
+
+ <%= link_to(
+ l(:button_edit),
+ {:controller => 'messages', :action => 'edit', :id => activity, :board_id => activity.board_id},
+ :class => 'postOptionLink'
+ ) if activity.org_subfield_editable_by?(User.current) %>
+
+
+ <%= delete_link(
+ {:controller => 'messages', :action => 'destroy', :id => activity, :board_id => activity.board_id},
+ :data => {:confirm => l(:text_are_you_sure)},
+ :class => 'postOptionLink'
+ ) if activity.org_subfield_editable_by?(User.current) %>
+
+
+ <% end %>
+
+
+
diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb
index ea7fbbb30..e12bf3849 100644
--- a/app/views/organizations/new.html.erb
+++ b/app/views/organizations/new.html.erb
@@ -30,14 +30,15 @@
公开 :
-
+
(打钩为公开,不打钩则不公开,若不公开,仅组织成员可见该组织。)
允许游客下载:
-
+
(打钩为允许游客下载文件)
+
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index 9ec118bec..b9b2f9b4c 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -63,11 +63,12 @@
公开 :
- class="ml3" />
+ class="ml3" />
下载支持 :
- class="ml3" />
+ name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
允许游客下载
+ <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
保存
<% end %>
@@ -187,4 +188,13 @@
$("#apply_hint").text("子域名命名不规范,只能包含字母、数字和下划线,请重新输入");
}
}
+
+// $(document).ready(function(){
+// if ( $("#is_public").attr("checked") != true){
+// alert($(this).attr("checked"));
+// $("#allow_download").attr("checked", false);
+// $("#allow_download").attr("disabled", true);
+// $("#allow_down_hint").html("");
+// }
+// });
\ No newline at end of file
diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb
index de8c0a4d2..c8e91c1a2 100644
--- a/app/views/tags/_tag_list.html.erb
+++ b/app/views/tags/_tag_list.html.erb
@@ -3,7 +3,7 @@
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
- <%= tag %>
+ <%= tag %>
<% case object_flag %>
<% when '10' %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index dbc9c3041..8487a44d9 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -79,9 +79,7 @@
) if activity.course_destroyable_by?(User.current) %>
<% end %>
-
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
-
+ <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
index 1e9f1bb68..c5d93e0a5 100644
--- a/app/views/users/_project_issue.html.erb
+++ b/app/views/users/_project_issue.html.erb
@@ -52,7 +52,7 @@
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<%# 局部刷新:修改xissue属性 %>
- <% if is_project_manager?(User.current, activity.project) %>
+ <% if User.current.member_of?(activity.project) %>
<% unless params[:action] == "index" %>
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
diff --git a/app/views/users/_project_issue_detail.html.erb b/app/views/users/_project_issue_detail.html.erb
index b682a74ea..1235b4e53 100644
--- a/app/views/users/_project_issue_detail.html.erb
+++ b/app/views/users/_project_issue_detail.html.erb
@@ -1,115 +1,115 @@
-
-
-
-
-
- <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
-
- 优先级 :
- <%= activity.priority.name %>
- <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
- {:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
- {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
-
- <% end %>
-
- <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
-
- 完成度 :
- <%= activity.done_ratio %>%
- <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
- {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
- {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
- <% end %>
-
-
-
-
-
-
-
- 计划完成 :
- <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
-
-
- 目标版本 :
- <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
-
-
-
+
+
+
+
+
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
+
+ 优先级 :
+ <%= activity.priority.name %>
+ <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
+ {:include_blank => false,:selected=>@priority_id ? @priority_id : 0},
+ {:onchange=>"remote_function('#issue_query_prior_form_#{activity.id}');",:id=>"priority_id",:name=>"priority_id",:class=>"w70 undis issueEdit"}) %>
+
+ <% end %>
+
+ <%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "ratio"},:remote=>'true', :method => :put, :id=>"issue_query_done_form_#{activity.id}", :class => 'query_form') do %>
+
+ 完成度 :
+ <%= activity.done_ratio %>%
+ <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
+ {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
+ {:onchange=>"remote_function('#issue_query_done_form_#{activity.id}');",:id=>"done_ratio",:name=>"done_ratio",:class=>"w70 undis issueEdit"}) %>
+ <% end %>
+
+
+
+
+
+
+
+ 计划完成 :
+ <%= format_date(activity.due_date)? format_date(activity.due_date) : "--" %>
+
+
+ 目标版本 :
+ <%= (activity.fixed_version ? link_to_user_version(activity.fixed_version) : "--") %>
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index d4a7a9e60..ec36854cb 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -71,9 +71,7 @@
) if activity.destroyable_by?(User.current) %>
<% end %>
-
- <%= link_to "发送",messages_join_org_subfield_path(:message_id => activity.id) , :remote=> true,:class => 'postOptionLink' %>
-
+
<%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
diff --git a/app/views/users/_share_message_to_course.html.erb b/app/views/users/_share_message_to_course.html.erb
new file mode 100644
index 000000000..eda4a9b97
--- /dev/null
+++ b/app/views/users/_share_message_to_course.html.erb
@@ -0,0 +1,56 @@
+
+
+
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+
+
+
+
+ <%= form_tag search_user_course_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+ <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
+ <% end %>
+
+ <%= form_tag share_message_to_course_user_path(user),:remote=>true,:id=>'course_list_form' %>
+
+
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+ <% if !courses.empty? %>
+ <% courses.each do |course| %>
+
+ <% end %>
+
+
+
+
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
+
+
+
+
+ <% end %>
+
+
diff --git a/app/views/users/_share_message_to_org.html.erb b/app/views/users/_share_message_to_org.html.erb
new file mode 100644
index 000000000..da3c7a072
--- /dev/null
+++ b/app/views/users/_share_message_to_org.html.erb
@@ -0,0 +1,59 @@
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+ <%= form_tag search_user_org_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_org_form' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+ <% end %>
+
+
+<%= form_tag share_message_to_org_user_path(user),:remote=>true,:id=>'orgs_list_form' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+
+
+ <%= render :partial => 'users/org_resources_subfield',:locals => {:subfield=>nil}%>
+
+
+
+
+
+
+
+
+
目标地址:
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();',:onclick=>"check_des(event);" %>
+
+
+
+<%end %>
\ No newline at end of file
diff --git a/app/views/users/_share_message_to_project.html.erb b/app/views/users/_share_message_to_project.html.erb
new file mode 100644
index 000000000..4b79a779c
--- /dev/null
+++ b/app/views/users/_share_message_to_project.html.erb
@@ -0,0 +1,53 @@
+
+
+
发送到
+
+
+ 课程
+ 项目
+ 组织
+
+
+
+
+
+
+ <%= form_tag search_user_project_user_path(user),:method => 'get',
+ :remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+
+
+ <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>
+ <% end %>
+
+ <%= form_tag share_message_to_project_user_path(user), :remote => true, :id=>'projects_list_form' %>
+
+ <%= hidden_field_tag(:send_id, send_id) %>
+ <%= hidden_field_tag(:send_ids, send_ids) %>
+
+ <% if !projects.empty? %>
+ <% projects.each do |project| %>
+
+ <% end %>
+
+
+
+
+
+ <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %>
+
+
+
+
+ <% end %>
+
+
diff --git a/app/views/users/_show_detail_info.html.erb b/app/views/users/_show_detail_info.html.erb
index dc6599884..9de431336 100644
--- a/app/views/users/_show_detail_info.html.erb
+++ b/app/views/users/_show_detail_info.html.erb
@@ -6,11 +6,16 @@
<%= user %>
-
+ <% if (user.user_extensions && (user.user_extensions.identity != 2) ) %>
+
+ <% end %>
+
<%= user.show_name %>
- <%= user.user_extensions.technical_title %>
+ <% if user.user_extensions && user.user_extensions.identity %>
+ <%= get_user_roll(user) %>
+ <% end %>
diff --git a/app/views/users/_user_message_org.html.erb b/app/views/users/_user_message_org.html.erb
index 5bf1c8950..e3b656a46 100644
--- a/app/views/users/_user_message_org.html.erb
+++ b/app/views/users/_user_message_org.html.erb
@@ -12,7 +12,7 @@
<%= ma.content %>
- <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
+ <%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"申请已批准",
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
:id => "agree_apply_subdomain_#{ma.id}",
:method => 'post',
diff --git a/app/views/users/search_user_course.js.erb b/app/views/users/search_user_course.js.erb
index 138eab6f9..eed7499d5 100644
--- a/app/views/users/search_user_course.js.erb
+++ b/app/views/users/search_user_course.js.erb
@@ -11,8 +11,10 @@
//$("#upload_box").css('display','block');
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_popup' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_course' ,:locals => {:courses=>@course,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/search_user_org.js.erb b/app/views/users/search_user_org.js.erb
index fb6efec9a..877629e34 100644
--- a/app/views/users/search_user_org.js.erb
+++ b/app/views/users/search_user_org.js.erb
@@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_orgs' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_org' ,:locals => {:orgs=>@orgs,:user=>@user,:send_id=>@send_id,:send_ids=>@send_ids})%>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/search_user_project.js.erb b/app/views/users/search_user_project.js.erb
index 926b7aa58..f80be34f8 100644
--- a/app/views/users/search_user_project.js.erb
+++ b/app/views/users/search_user_project.js.erb
@@ -1,7 +1,9 @@
<% if params[:send_type].present? && params[:send_type] == 'news' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_news_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
-<% else %>
+<% elsif params[:send_type] == 'file' %>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/resource_share_for_project_popup', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
+<% elsif params[:send_type] == 'message' %>
+ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/share_message_to_project', :locals => {:projects => @projects, :user => @user, :send_id => @send_id, :send_ids => @send_ids}) %>');
<% end %>
showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/users/share_message_to_course.js.erb b/app/views/users/share_message_to_course.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_course.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/app/views/users/share_message_to_org.js.erb b/app/views/users/share_message_to_org.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_org.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/app/views/users/share_message_to_project.js.erb b/app/views/users/share_message_to_project.js.erb
new file mode 100644
index 000000000..5a5046dfa
--- /dev/null
+++ b/app/views/users/share_message_to_project.js.erb
@@ -0,0 +1,2 @@
+hideModal();
+alert("发送成功!");
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index b9b9805b2..550642120 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -542,6 +542,9 @@ RedmineApp::Application.routes.draw do
post 'share_news_to_course'
post 'share_news_to_project'
post 'share_news_to_org'
+ post 'share_message_to_course'
+ post 'share_message_to_project'
+ post 'share_message_to_org'
get 'resource_preview'
get 'rename_resource'
get 'search_user_project'
@@ -1128,6 +1131,7 @@ RedmineApp::Application.routes.draw do
match "/system_log" ,:to => 'system_log#index'
match 'system_log/clear'
get 'upload_files_menu', :to => 'files#upload_files_menu'
+ get '/manual/feedback', to:redirect("http://forge.trustie.net/forums/1/memos/1168")
##ended by lizanle
resources :git_callback do
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index f982d92f6..7f60b11b4 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1032,6 +1032,7 @@ function subfield_click(){
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
+//send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids, send_type) {
$('#'+fieldId).each(function() {
var $this = $(this);
@@ -1107,6 +1108,7 @@ function show_send(id, user_id, send_type){
//id 发送的id
//发送的id数组
+//send_type:发送的类型,file对应文件,message对应帖子,news对应通知或新闻
function chooseSendType(res_id,res_ids, user_id, send_type){
sendType = $(".resourcesSendType").val();
@@ -1135,3 +1137,17 @@ function chooseSendType(res_id,res_ids, user_id, send_type){
}
lastSendType = sendType;
}
+
+//组织新建和配置中,选择组织为私有后,disbled掉允许游客下载选项
+function disable_down(source, des, hint){
+ if (source.attr("checked")){
+ des.attr("disabled", false);
+ hint.html("");
+ }
+ else{
+ des.attr("checked", false);
+ des.attr("disabled", true);
+ hint.html("(私有组织不允许游客下载资源)");
+
+ }
+}
diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js
index 0eac4b01e..bc28aa2bd 100644
--- a/public/javascripts/create_kindeditor.js
+++ b/public/javascripts/create_kindeditor.js
@@ -10,16 +10,16 @@ function sd_create_editor(params){
resizeType : 1,minWidth:"1px",width:"94%",
height:"33px",// == undefined ? "30px":paramsHeight+"px",
minHeight:"33px",// == undefined ? "30px":paramsHeight+"px",
+ width:params.width,
items:['emoticons','fontname',
'forecolor', 'hilitecolor', 'bold', '|', 'justifyleft', 'justifycenter', 'insertorderedlist','insertunorderedlist', '|',
'formatblock', 'fontsize', '|','indent', 'outdent',
- '|','imagedirectupload'],
+ '|','imagedirectupload','more'],
afterChange:function(){//按键事件
-
var edit = this.edit;
var body = edit.doc.body;
edit.iframe.height(paramsHeight);
- this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
+ //this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
},
afterBlur:function(){
//params.toolbar_container.hide();