@@ -17,7 +17,7 @@ user_sql.adminSettingsUI = function()
17
17
$ ( '#sqlDiv' ) . tabs ( ) ;
18
18
19
19
// Attach auto-completion to all column fields
20
- $ ( '#col_username, #col_password, #col_displayname, #col_active, #col_email, #col_gethome, #col_group_name, #col_group_username ' ) . autocomplete ( {
20
+ $ ( '#col_username, #col_password, #col_displayname, #col_active, #col_email, #col_gethome' ) . autocomplete ( {
21
21
source : function ( request , response )
22
22
{
23
23
var post = $ ( '#sqlForm' ) . serializeArray ( ) ;
@@ -53,7 +53,51 @@ user_sql.adminSettingsUI = function()
53
53
{
54
54
$ ( this ) . autocomplete ( "search" ) ;
55
55
}
56
- } ) ;
56
+ } ) ;
57
+
58
+ // Attach auto-completion to all group column fields
59
+ $ ( '#col_group_name, #col_group_username' ) . autocomplete ( {
60
+ source : function ( request , response )
61
+ {
62
+ var post = $ ( '#sqlForm' ) . serializeArray ( ) ;
63
+ var domain = $ ( '#sql_domain_chooser option:selected' ) . val ( ) ;
64
+
65
+ post . push ( {
66
+ name : 'groupTable' ,
67
+ value : 'true'
68
+ } ) ;
69
+
70
+ post . push ( {
71
+ name : 'function' ,
72
+ value : 'getColumnAutocomplete'
73
+ } ) ;
74
+
75
+ post . push ( {
76
+ name : 'domain' ,
77
+ value : domain
78
+ } ) ;
79
+
80
+ post . push ( {
81
+ name : 'request' ,
82
+ value : request . term
83
+ } ) ;
84
+
85
+ // Ajax foobar
86
+ $ . post ( OC . filePath ( 'user_sql' , 'ajax' , 'settings.php' ) , post , response , 'json' ) ;
87
+ } ,
88
+ minLength : 0 ,
89
+ open : function ( ) {
90
+ $ ( this ) . attr ( 'state' , 'open' ) ;
91
+ } ,
92
+ close : function ( ) {
93
+ $ ( this ) . attr ( 'state' , 'closed' ) ;
94
+ }
95
+ } ) . focus ( function ( ) {
96
+ if ( $ ( this ) . attr ( 'state' ) != 'open' )
97
+ {
98
+ $ ( this ) . autocomplete ( "search" ) ;
99
+ }
100
+ } ) ;
57
101
58
102
// Attach auto-completion to all table fields
59
103
$ ( '#sql_table, #sql_group_table' ) . autocomplete ( {
0 commit comments