From 0f4d2e40fb762a91b5133a5f45910c106b6f98a8 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 25 Mar 2016 19:09:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=9A=84=E8=AF=AD=E5=8F=A5=EF=BC=8C=E6=AF=8F?= =?UTF-8?q?=E4=B8=AA=E6=9D=A1=E4=BB=B6=E9=83=BD=E8=A6=81=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?escape'/';=E7=BB=84=E7=BB=87=E6=A0=8F=E7=9B=AE=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E6=96=87=E7=AB=A0margin=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/principal.rb | 2 +- app/views/org_document_comments/new.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/principal.rb b/app/models/principal.rb index 2c8465538..0c87ec0c6 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -44,7 +44,7 @@ class Principal < ActiveRecord::Base else pattern = "%#{q}%".gsub("/","//").gsub("_","/_") # sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ") - sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p) escape '/'" + sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) escape '/' or LOWER(login) LIKE LOWER(:p) escape '/' or LOWER(mail) LIKE LOWER(:p) escape '/'" params = {:p => pattern} if q =~ /^(.+)\s+(.+)$/ a, b = "#{$1}%", "#{$2}%" diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb index 24dd7dcfe..cf4ffddcf 100644 --- a/app/views/org_document_comments/new.html.erb +++ b/app/views/org_document_comments/new.html.erb @@ -38,7 +38,7 @@
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
- +
From ba25f41bcb846ed79fcc6185b4f21212cd2ad66a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Mar 2016 19:20:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=99=E5=B8=88?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E3=80=81=E5=AD=A6=E7=94=9F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_project_info.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index 06d6304d2..d94cbdcc7 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -1,6 +1,6 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> -<% teacher_num = 0 %> -<% student_num = 0 %> +<% teacher_num = TeacherAndAssistantCount(@course) %> +<% student_num = studentCount(@course) %>