diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 788237444..326ae0f42 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -207,9 +207,9 @@ class CoursesController < ApplicationController #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? if params[:incourse] @results = searchStudent_by_name(@course, q) - else - group = CourseGroup.find(params[:search_group_id]) - @results = searchgroupstudent_by_name(group, @course, q) + elsif params[:ingroup] + @group = CourseGroup.find(params[:search_group_id]) + @results = searchgroupstudent_by_name(@group, @course, q) end @result_count = @results.count @results = paginateHelper @results diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index bf3810030..a1199a55a 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -184,7 +184,7 @@ module CoursesHelper end members end - def searchgroupstudent_by_name(group, project, q) + def searchgroupstudent_by_name(group, project, name) members = [] group.members.each do |m| if m && m.user && m.user.allowed_to?(:as_student,project) diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 68baa2ccd..ca0fed9c2 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -1,40 +1,4 @@ -