mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 19:36:41 +02:00
MDL-61028 core_search: Allow filtering search by user (front-end)
Creates a new 'Users' field in the search filters form. This field requires new JavaScript and, to implement this, a new AJAX-callable web service to search for users by name, with detailed restrictions based on the current user's access to view profiles.
This commit is contained in:
parent
71d985ab7d
commit
a6cacdd266
9 changed files with 417 additions and 1 deletions
1
search/amd/build/form-search-user-selector.min.js
vendored
Normal file
1
search/amd/build/form-search-user-selector.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
define(["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h,i={query:e},j=a(d).attr("withincourseid");"undefined"!=typeof j&&""!==a("#id_searchwithin").val()?i.courseid=j:i.courseid=0,h=b.call([{methodname:"core_search_get_relevant_users",args:i}]),h[0].then(function(b){var d=[];return a.each(b,function(a,b){d.push(c.render("core_search/form-user-selector-suggestion",b))}),a.when.apply(a.when,d).then(function(){var c=arguments,d=0;a.each(b,function(a,b){b._label=c[d++]}),f(b)})}).fail(g)}}});
|
Loading…
Add table
Add a link
Reference in a new issue