From 196c3b48b1d5ee5361dd17378302c863c43ebcf8 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 19 May 2015 16:11:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E2=80=9C=E5=BC=95=E5=85=A5=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E5=BC=95=E5=85=A5=E6=88=91=E7=9A=84?= =?UTF-8?q?=E5=85=B6=E5=AE=83=E9=A1=B9=E7=9B=AE=E2=80=9D=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 11 +++-------- app/controllers/projects_controller.rb | 12 +++++++----- app/views/files/_project_file_list.html.erb | 12 ++++++++---- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index b6035ca51..8acca7f81 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -84,15 +84,10 @@ class IssuesController < ApplicationController @issue_pages = Paginator.new @issue_count, @limit, params['page'] @offset ||= @issue_pages.offset @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], - :order => sort_clause, - :offset => @offset, - :limit => @limit) + :order => sort_clause, + :offset => @offset, + :limit => @limit) @issue_count_by_group = @query.issue_count_by_group - - - - - respond_to do |format| format.js format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f8d08c7f5..c79d0862f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -31,7 +31,7 @@ class ProjectsController < ApplicationController before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] - before_filter :file, :statistics, :watcherlist + before_filter :file, :statistics #:watcherlist # 除非项目内人员,不可查看成员, TODO: 完了写报表里去 before_filter :memberAccess, only: :member @@ -681,10 +681,12 @@ class ProjectsController < ApplicationController end def watcherlist - if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin? - render_403 - else - @users -= watched.watcher_users if @watched + unless @project.nil? + if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin? + render_403 + else + @users -= watched.watcher_users if @watched + end end end diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb index 1042be584..d32d2319f 100644 --- a/app/views/files/_project_file_list.html.erb +++ b/app/views/files/_project_file_list.html.erb @@ -20,12 +20,16 @@
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> - <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> - <% if authority_pubilic_for_files(project, file) %> + <% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %> + <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> + <% else %> + <%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> + <% end %> + <% if authority_pubilic_for_files(project, file) %> - <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> + <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> - <% end %> + <% end %> <% end %>