From 0aae731eef3283c89b6c7be7b62c5408ce519fad Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 6 Nov 2014 14:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug<=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=90=8E=E5=86=85=E5=AE=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8F=98=E4=B8=BA=E5=85=A8=E9=83=A8=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E5=8F=88=E5=B9=B6=E6=9C=AA=E6=98=BE=E7=A4=BA=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E8=B5=84=E6=BA=90>=20Signed-off-by:=20alan=20<5475334?= =?UTF-8?q?34@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 2 +- app/views/files/_project_file.html.erb | 2 +- app/views/users/new.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 6bbcd727f..09e093177 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1359,7 +1359,7 @@ class Issue < ActiveRecord::Base # Callback on file attachment def attachment_added(obj) - if @current_journal && !obj.new_record? + if @current_journal && !obj.new_record? && @current_journal.journalized_id == obj.author_id @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename) end end diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb index 315314828..bc5b15ab1 100644 --- a/app/views/files/_project_file.html.erb +++ b/app/views/files/_project_file.html.erb @@ -52,7 +52,7 @@ <% if attachmenttypes.any? %>       - <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"), + <%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), :onchange => "attachmenttypes_searchex(this.value)" %> <% end %> <% if sufixtypes.any? %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index e718956f1..4311fd962 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -14,7 +14,7 @@ <% if @auth_sources.present? && @auth_sources.any?(&:searchable?) %> <%= javascript_tag do %> - observeAutocompleteField('user_login', '<%= escape_javascript autocomplete_for_new_user_auth_sources_path %>', { + ('user_login', '<%= escape_javascript autocomplete_for_new_user_auth_sources_path %>', { select: function(event, ui) { $('input#user_firstname').val(ui.item.firstname); $('input#user_lastname').val(ui.item.lastname);