diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch index f21eed9f2..678ced8a0 100644 --- a/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch +++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/Firefox - Internal Server.launch @@ -2,6 +2,7 @@ + diff --git a/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch b/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch index 2134fa92c..f7b0844d8 100644 --- a/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch +++ b/.metadata/.plugins/org.eclipse.debug.core/.launches/Internet Explorer - Internal Server.launch @@ -2,6 +2,7 @@ + diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fe9f6c1b6..06e5dac30 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -275,7 +275,12 @@ class ApplicationController < ActionController::Base end end end + def auth_login1(token = params[:token]) + if(!User.current.logged? && !token.nil?) + User.current =try_to_autologin1 + end + end def authorize_allowed(ctrl = params[:controller], action = params[:action], global = false) #modify by NWB if @project diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 8ee8d099e..8f00c49cd 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -17,6 +17,9 @@ class MyController < ApplicationController layout "users_base" + # edit + before_filter :auth_login1, :only => [:account] + # before_filter :require_login helper :issues diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5d43a4e20..4e81354f1 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -31,14 +31,16 @@ class ProjectsController < ApplicationController menu_item :feedback, :only => :feedback menu_item l(:label_course_file), :only => :index menu_item l(:label_course_news), :only => :index - +# edit + before_filter :authorize1, :only => [:show] +# before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches] # before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, # :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share, # :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index] #此条勿删 课程相关权限 ,:new_homework,:homework,:feedback,,:member - before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] + before_filter :authorize, :only => [: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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7b4d488a9..ee8711e7e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -29,6 +29,9 @@ class UsersController < ApplicationController #Ended by young + # edit + before_filter :auth_login1, :only => [:show] + # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] before_filter :require_admin, :except => [:show, :index, :search, :tag_save, :tag_saveEx,:user_projects, :user_newfeedback, :user_comments, :watch_bids, :watch_contests, :info, :user_watchlist, :user_fanslist,:update, :user_courses, :user_homeworks, :watch_projects, :show_score, :topic_score_index, :project_score_index, diff --git a/app/models/mailer.rb b/app/models/mailer.rb index b432461c7..bee0640da 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -109,9 +109,14 @@ class Mailer < ActionMailer::Base token = Token.new(:user => User.find_by_mail(recipients), :action => 'autologin') token.save - @token = token + @token = token @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value) + # edit + @issue_author_url = url_for(:controller => 'users', :action => 'show', :id => issue.author_id, :token => @token.value) + @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) + @user_url = url_for(:controller => 'my', :action => 'account', :user => User.find_by_mail(recipients) , :token => @token.value) + # cc = issue.watcher_recipients - issue.recipients subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index dd2de21b7..de7f4a837 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,33 +1,46 @@ +Trustie项目邮件 + + + + -<%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_header).html_safe %> -<%= yield %> -
-<%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %> +
+
+
+

亲爱的Trustie用户,您好!

+
+ <%= yield %> +
+
<%= link_to("退订该邮件?", @user_url) %>
+
+
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index f0dc88d8b..326a21aaa 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,15 +1,39 @@ -

<%= link_to(h("#{issue.tracker.name} ##{issue.project_index}: #{issue.subject}"), issue_url) %>

- + +

+ + <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> + 在 + <%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!

+
    -
  • <%=l(:field_author)%>: <%=h issue.author %>
  • -
  • <%=l(:field_status)%>: <%=h issue.status %>
  • -
  • <%=l(:field_priority)%>: <%=h issue.priority %>
  • -
  • <%=l(:field_assigned_to)%>: <%=h issue.assigned_to %>
  • -
  • <%=l(:field_category)%>: <%=h issue.category %>
  • -
  • <%=l(:field_fixed_version)%>: <%=h issue.fixed_version %>
  • -<% issue.custom_field_values.each do |c| %> -
  • <%=h c.custom_field.name %>: <%=h show_value(c) %>
  • -<% end %> +
  • 标题:<%= link_to(issue.subject, issue_url) %>
  • +
  • 来源:<%= link_to(h("#{issue.project.name}"),@project_url) %>项目缺陷
  • +
  • 内容: +

    <%= textilizable(issue, :description, :only_path => false) %>

    +
  • +
  • 附件: +

    + <% unless @issue.attachments.nil? %> + <% @issue.attachments.each do |attach| %> + <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
    + <% end %> + <% end %> + +

    +
+ +
+
+ +<%# issue.custom_field_values.each do |c| %> + diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index 3f0fce917..f51dad121 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -1,15 +1,8 @@ +
-<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => h(@issue.author)) %> -
    + <%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> - <% unless @issue.attachments.nil? %> - <% @issue.attachments.each do |attach| %> -
  • <%= l(:label_attachment) %><%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %><%= l(:label_added) %>
  • - <% end %> -<% end %> -
-
+
-<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> \ No newline at end of file diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index 4fb52b94c..07411a134 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -1,11 +1,11 @@ -<%= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> - +<%= link_to(h("#{@issue.author}"+"(#{@issue.author_id.firstname+@issue.author_id.lastname})"), @issue_author_url) %>在<%= link_to(h("#{@issue.project.name}"),@project_url) %> +<%#= l(:text_issue_added, :id => "##{@issue.project_index}", :author => @issue.author) %> !--> +<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> <% @issue.attachments.each do |attach| %> - <%= l(:label_attachment) %> <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %> <%= l(:label_added) %> <% end %> ---------------------------------------- - -<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> +<%= link_to( "我要回复", @issue_url) %> + <%#= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %>