@ -5794,29 +5794,30 @@ function rcube_webmail()
if ( id === null || ! this . env . contacts [ id ] || ! this . ksearch _input )
if ( id === null || ! this . env . contacts [ id ] || ! this . ksearch _input )
return ;
return ;
var trigger = false , insert = '' , delim = ', ' ;
var trigger = false , insert = '' , delim = ', ' ,
contact = this . env . contacts [ id ] ;
this . ksearch _destroy ( ) ;
this . ksearch _destroy ( ) ;
// insert all members of a group
// insert all members of a group
if ( typeof this . env . contact s[ id ] === 'object' && this . env . contact s[ id ] . type == 'group' && ! this . env . contacts [ id ] . email ) {
if ( typeof contact === 'object' && contact . type == 'group' && ! contact . email && contact . id ) {
insert + = this . env . contact s[ id ] . name + delim ;
insert = contact . name + delim ;
this . group2expand [ this . env . contact s[ id ] . id ] = $ . extend ( { input : this . ksearch _input } , this . env . contact s[ id ] ) ;
this . group2expand [ contact . id ] = $ . extend ( { input : this . ksearch _input } , contact ) ;
this . http _request ( 'mail/group-expand' , { _source : this . env . contact s[ id ] . source , _gid : this . env . contact s[ id ] . id } , false ) ;
this . http _request ( 'mail/group-expand' , { _source : contact . source , _gid : contact . id } , false ) ;
}
}
else if ( typeof this . env . contact s[ id ] === 'object' && this . env . contact s[ id ] . name ) {
else if ( typeof contact === 'object' && contact . name ) {
insert = this . env . contact s[ id ] . name + delim ;
insert = contact . name + delim ;
trigger = true ;
trigger = true ;
}
}
else if ( typeof this . env . contact s[ id ] === 'string' ) {
else if ( typeof contact === 'string' ) {
insert = this . env . contact s[ id ] + delim ;
insert = contact + delim ;
trigger = true ;
trigger = true ;
}
}
this . ksearch _input _replace ( this . ksearch _value , insert ) ;
this . ksearch _input _replace ( this . ksearch _value , insert ) ;
if ( trigger ) {
if ( trigger ) {
this . triggerEvent ( 'autocomplete_insert' , { field : this . ksearch _input , insert : insert , data : this . env . contacts [ id ] , search : this . ksearch _value _last , result _type : 'person' } ) ;
this . triggerEvent ( 'autocomplete_insert' , { field : this . ksearch _input , insert : insert , data : contact , search : this . ksearch _value _last , result _type : 'person' } ) ;
this . ksearch _value _last = null ;
this . ksearch _value _last = null ;
this . compose _type _activity ++ ;
this . compose _type _activity ++ ;
}
}