source: trunk/expressoMail1_2/js/QuickCatalogSearch.js @ 342

Revision 342, 21.2 KB checked in by niltonneto, 16 years ago (diff)

Algumas validações de condições nulas, para não gerar erro.
Otimizações para eliminar códigos duplicados.
Outros ajustes.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1        function emQuickCatalogSearch ()
2        {
3                this.arrayWin = new Array();
4                this.el;
5                this.cc_contacts = new Array();
6                this.cc_groups  = new Array();
7        }
8
9        emQuickCatalogSearch.prototype.showList = function(data, begin, end){
10                id = '1';
11                _this = this;
12
13                var el = document.createElement("DIV");
14                el.style.visibility = "hidden";
15                el.style.position = "absolute";
16                el.style.left = "0px";
17                el.style.top = "0px";
18                el.style.width = "0px";
19                el.style.height = "0px";
20                el.id = 'window_QuickCatalogSearch';
21                document.body.appendChild(el);
22                el.innerHTML = "";
23               
24                if (document.getElementById('select_QuickCatalogSearch') == null){
25
26                        var title_innerHTML = get_lang('Select a name') + ':';
27                        if (data.quickSearch_only_in_userSector)
28                                title_innerHTML += "<font color='BLACK' nowrap> ("+get_lang('Showing only the results found in your organization')+".)</font>"
29
30                        var title = document.createElement("SPAM");
31                        title.id = 'window_QuickCatalogSearch_title';
32                        title.innerHTML = "&nbsp;&nbsp;<b><font color='BLUE' nowrap>"+title_innerHTML+"</font></b><br>&nbsp;&nbsp;";
33                        el.appendChild(title);
34                       
35                        var cmb = document.createElement("SELECT");
36                        cmb.id = "select_QuickCatalogSearch";
37                        cmb.style.width = "685px"; // na comunidade valor eh 585px
38                        cmb.size = "12";
39                        cmb.onkeypress = function (e)
40                        {
41                                if (is_ie)
42                                {
43                                        if ((window.event.keyCode) == 13)
44                                        {
45                                                QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);
46                                        }
47                                        else if ((window.event.keyCode) == 27)
48                                        {
49                                                QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);
50                                        }
51                                }
52                                else
53                                {
54                                        if ((e.keyCode) == 13)
55                                        {
56                                                QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);
57                                        }
58                                        else if ((e.keyCode) == 27)
59                                        {
60                                                QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);
61                                        }
62                                }
63                        };
64                        el.appendChild(cmb);
65
66                        var space = document.createElement('SPAN');
67                        space.innerHTML = "<BR>&nbsp;&nbsp;";
68                        el.appendChild(space);
69
70                        var butt = document.createElement('BUTTON');
71                        var buttext = document.createTextNode('OK');
72                        butt.id = "QuickCatalogSearch_button_ok";
73                        butt.appendChild(buttext);
74                        butt.onclick = function () {QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);};
75                        el.appendChild(butt);
76
77                        var space = document.createElement('SPAN');
78                        space.innerHTML = "&nbsp;&nbsp;";
79                        el.appendChild(space);
80
81                        var butt = document.createElement('BUTTON');
82                        butt.id = "QuickCatalogSearch_button_close";
83                        var buttext = document.createTextNode(get_lang('Close'));
84                        butt.appendChild(buttext);
85                        butt.onclick = function () {QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);};
86                        el.appendChild(butt);
87                }
88                else{
89                        var title_innerHTML = get_lang('Select a name') + ':';
90                        if (data.quickSearch_only_in_userSector)
91                                title_innerHTML += "<font color='BLACK' nowrap> ("+get_lang('Showing only the results found in your organization')+".)</font>"
92
93                        var title = Element('window_QuickCatalogSearch_title');
94                        title.innerHTML = "&nbsp;&nbsp;<b><font color='BLUE' nowrap>"+title_innerHTML+"</font></b><br>&nbsp;&nbsp;";
95                       
96                        var cmb = document.getElementById('select_QuickCatalogSearch');
97                        cmb.onkeypress = function (e)
98                        {
99                                if (is_ie)
100                                {
101                                        if ((window.event.keyCode) == 13)
102                                        {
103                                                QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);
104                                        }
105                                        else if ((window.event.keyCode) == 27)
106                                        {
107                                                QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);
108                                        }
109                                }
110                                else
111                                {
112                                        if ((e.keyCode) == 13)
113                                        {
114                                                QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);
115                                        }
116                                        else if ((e.keyCode) == 27)
117                                        {
118                                                QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);
119                                        }
120                                }
121                        };
122
123                        for (i=0; i<cmb.length; i++)
124                                cmb.options[i--] = null;
125                       
126                        var butt_ok = document.getElementById("QuickCatalogSearch_button_ok");
127                        var butt_close = document.getElementById("QuickCatalogSearch_button_close");
128                        butt_ok.onclick = function () {QuickCatalogSearch.transfer_result(data.field, data.ID, begin, end);};
129                        butt_close.onclick = function () {QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);};
130                }
131
132                for (i=0; i<data.length; i++){
133                        var Op = document.createElement("OPTION");
134                        Op.text = data[i].cn + ' (' + data[i].mail + ')';
135                        if (data[i].phone != '')
136                                Op.text += ' - ' + data[i].phone;
137                        if (data[i].ou != '')
138                                Op.text += ' - ' + data[i].ou; // adicionado "data[i].ou" para exibir setor (F9)
139                        Op.value = '"' + data[i].cn + '" ' + '<' + data[i].mail + '>';
140                        cmb.options.add(Op);
141                }
142                cmb.options[0].selected = true;
143                _this.showWindow(el);
144        }
145       
146        emQuickCatalogSearch.prototype.showWindow = function (div)
147        {
148                if(! div) {
149                        alert(get_lang('The list has no participant.'));
150                        return;
151                }
152                                                       
153                if(! this.arrayWin[div.id]) {
154                        div.style.width = "700px";
155                        div.style.height = "230px";
156                        var title = get_lang('The results were found in the Global Catalog')+':';
157                        var wHeight = div.offsetHeight + "px";
158                        var wWidth =  div.offsetWidth   + "px";
159                        div.style.width = div.offsetWidth - 5;
160
161                        win = new dJSWin({                     
162                                id: 'QuickCatalogSearch_'+div.id,
163                                content_id: div.id,
164                                width: wWidth,
165                                height: wHeight,
166                                title_color: '#3978d6',
167                                bg_color: '#eee',
168                                title: title,                                           
169                                title_text_color: 'white',
170                                button_x_img: '../phpgwapi/images/winclose.gif',
171                                border: true });
172                       
173                        this.arrayWin[div.id] = win;
174                        win.draw();
175                }
176                else {
177                        win = this.arrayWin[div.id];
178                }
179                //document.getElementById('QuickCatalogSearch_window_QuickCatalogSearch').style.display = "";
180                win.open();
181                document.getElementById('select_QuickCatalogSearch').focus();
182        }
183       
184        emQuickCatalogSearch.prototype.transfer_result = function (field, ID, begin, end){
185                cm = document.getElementById('select_QuickCatalogSearch');
186                option_selected = cm.options[cm.selectedIndex].value + ", ";
187                emailList = document.getElementById(field + "_" + ID).value;
188               
189                new_emailList = emailList.substring(0, begin) + option_selected + emailList.substring((parseInt(end) + 2), emailList.length);
190                document.getElementById(field + "_" + ID).value = new_emailList;
191                document.getElementById(field + "_" + ID).focus();
192               
193                //document.getElementById('QuickCatalogSearch_window_QuickCatalogSearch').style.display = "none";
194                this.arrayWin['window_QuickCatalogSearch'].close();
195        }
196       
197        emQuickCatalogSearch.prototype.close_QuickSearch_window = function (field, ID){
198                //document.getElementById('QuickCatalogSearch_window_QuickCatalogSearch').style.display = "none";
199                document.getElementById(field + "_" + ID).focus();
200                this.arrayWin['window_QuickCatalogSearch'].close();
201        }
202
203        emQuickCatalogSearch.prototype.close_window = function(id) {
204                this.arrayWin[id].close();
205                var group_values = Element('list_values');
206                var user_values = Element('user_values');       
207        }
208        emQuickCatalogSearch.prototype.showCatalogList = function (border_id){
209                var el = Element('catalog_list');
210
211                if(el) {
212                        Element('border_id').value = border_id;
213                        win = this.arrayWin[el.id];
214                        win.open();
215                        return;         
216                }
217                var border_input   = document.createElement("INPUT");
218                border_input.type  = 'hidden';
219                border_input.id    = 'border_id';
220                border_input.value = border_id;
221                document.body.appendChild(border_input);
222                el = document.createElement("DIV");             
223                el.id = 'catalog_list';
224                document.body.appendChild(el);                 
225                el.style.visibility = "hidden";
226                el.style.position = "absolute";
227                el.style.width = "700px";
228                el.style.height = is_ie ? "360px" : "375px";           
229                el.style.left = "0px";
230                el.style.top = "0px";                   
231                el.innerHTML = "<table border='0' cellpading='0' cellspacing='0' width='100%'>"+
232                                           "<tr><td id='td1' style='cursor:pointer' align='center' onclick='QuickCatalogSearch.select_div(\"tab1\")'><a href='#' class='catalog' onclick='QuickCatalogSearch.select_div(\"tab1\");'>"+get_lang('Global Catalog')+"</a></td>"+
233                                           "<td id='td2' style='background:#cecece;cursor:pointer' onclick='QuickCatalogSearch.select_div(\"tab2\")' align='center'><a href='#' class='catalog' onclick='QuickCatalogSearch.select_div(\"tab2\");'>"+get_lang('Personal Catalog')+"</a></td></tr>"+
234                                           '</table>'+
235                                           '<div id="tab1" align="center"><br>'+
236                                           '<table border="0" cellpading="0" cellspacing="0">'+
237                                           '<tr><td>'+get_lang("Select an organization and click on button <b>Search</b>")+'&nbsp;:</td></tr>'+
238                                        '<tr><td><select style="width:150px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select>&nbsp'+
239                                        '<select id="select_organization" style="width:100px" name="select_organization"></select>&nbsp;'+   
240                                        '<input type="text" id="search_for" name="search_for" value="" size="30" maxlength="20"/>&nbsp;<input type="button" onclick="QuickCatalogSearch.searchCatalogList(true)" class="button" value="'+get_lang('Search')+'">&nbsp;<input style="display:none" type="button" onclick="QuickCatalogSearch.searchCatalogList(false)" class="button" value="'+get_lang('List All')+'"></td></tr>'+
241                                           //'<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type" type="radio" name="type" value="l"/>'+get_lang('Public Lists')+'&nbsp;&nbsp;<input type="radio" name="type" value="u" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" checked/>'+get_lang('Users')+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
242                                           '<span style="visibility:hidden;background:#cc4444" id=msg_search>&nbsp;&nbsp;<font face="Verdana" size="1" color="WHITE">'+get_lang('Search in Catalog')+'...</font>&nbsp;</span></td></tr>'+
243                                           '<tr><td>'+
244                                           '<span id="list_span"><select multiple style="display:none;width:450px" size="14" id="list_values"></select></span>'+
245                                           '<span id="user_span"><select multiple style="width:580px" size="14" id="user_values"></select></span>'+
246                                           '</td></tr>'+
247                                           '<tr><td nowrap><center>'+get_lang('Click here to add into the fields')+':&nbsp;<input type="button" class="button" value="'+get_lang('TO')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'to\')">&nbsp;'+
248                                           '<input type="button" class="button" value="'+get_lang('CC')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'cc\')">&nbsp;'+
249                                           '<input type="button" class="button" value="'+get_lang('CCo')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'cco\')">'+
250                                           '</center></td></tr><tr><td nowrap><center><input type="button" value="'+get_lang('Close')+'" onClick="javascript:QuickCatalogSearch.close_window(\'catalog_list\')"></center></td></tr>'+
251                                           '</table>'+
252                                           '</div>'+
253                                           '<div style="display:none" id="tab2" align="center">'+
254                                           '<br><br><br>'+
255                                           '<table border="0" cellpading="0" cellspacing="0">'+
256                                           '<tr><td>'+get_lang("Select the type of contact that you want to view")+'&nbsp;:</td></tr>'+
257                                           '<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type" type="radio" name="type" value="p"/>' + get_lang('People') + '&nbsp;&nbsp;<input type="radio" name="type" value="g" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)"/>' + get_lang('Groups') + ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+
258                                           '<tr><td>'+
259                                           '<span id="personal_span"><select multiple style="width:400px" size="14" id="list_personal"></select></span>'+
260                                           '<span id="groups_span"><select multiple style="display:none;width:400px" size="14" id="list_groups"></select></span>'+
261                                           '</td></tr>'+
262                                           '<tr><td nowrap><center>'+get_lang('Click here to add into the fields')+':&nbsp;<input type="button" class="button" value="'+get_lang('TO')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'to1\')">&nbsp;'+
263                                           '<input type="button" class="button" value="'+get_lang('CC')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'cc1\')">&nbsp;'+
264                                           '<input type="button" class="button" value="'+get_lang('CCo')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'cco1\')">'+
265                                           '</center></td></tr><tr><td nowrap><center><input type="button" value="'+get_lang('Close')+'" onClick="javascript:QuickCatalogSearch.close_window(\'catalog_list\')"></center></td></tr>'+
266                                           '</table>'+
267                                           '</div>';
268
269                var title = get_lang('Search in the Global Catalog');
270                var wHeight = el.offsetHeight - (is_ie ? 10 : 0) + "px";
271                var wWidth =  el.offsetWidth   + "px";
272                el.style.width = el.offsetWidth;
273               
274                Element('search_for').onkeypress = function (e) {
275                        if ((is_ie && (window.event.keyCode == 13)) || (!is_ie && e.keyCode == 13)) {
276                                QuickCatalogSearch.searchCatalogList(true);
277                        }
278                };
279
280                win = new dJSWin({                     
281                        id: 'win_'+el.id,
282                        content_id: el.id,
283                        width: wWidth,
284                        height: wHeight,
285                        title_color: '#3978d6',
286                        bg_color: '#eee',
287                        title: title,                                           
288                        title_text_color: 'white',
289                        button_x_img: '../phpgwapi/images/winclose.gif',
290                        border: true });
291                       
292                this.arrayWin[el.id] = win;             
293                win.draw();
294                win.open();
295
296                var handler_catalogs = function(data){
297                        var user_catalog = "Catalogo Geral";
298
299                        if(data.length <= 1)
300                                Element('select_catalog').style.display = 'none';
301                        else {
302                                for(i = 0; i < data.length; i++) {             
303                                        Element('select_catalog').options[i] = new Option(data[i],i);
304                                        if(user_catalog.toUpperCase() == data[i].toUpperCase())
305                                                Element('select_catalog').options[i].selected = true;
306                                }
307                        }
308                }
309                cExecute ("$this.ldap_functions.get_catalogs", handler_catalogs);               
310               
311                this.update_organizations();
312       
313                var handler_cc_contacts= function(data){
314                        if(data && data.length > 0){
315                                var aux = data.split(",");
316                                for(var i=0; i< aux.length; i++){
317                                        QuickCatalogSearch.cc_contacts[QuickCatalogSearch.cc_contacts.length] = aux[i];                         
318                                }
319                        }
320                }
321                cExecute("$this.db_functions.get_cc_contacts",handler_cc_contacts);
322
323                var handler_cc_groups = function(data){
324                        if(data && data.length > 0){
325                                var aux = data.split(",");
326                                for(var i=0; i < data.length; i++){
327                                        QuickCatalogSearch.cc_groups[QuickCatalogSearch.cc_groups.length] = aux[i];                                                             
328                                }       
329                        }
330                }
331                cExecute("$this.db_functions.get_cc_groups",handler_cc_groups);
332       
333        }
334       
335        emQuickCatalogSearch.prototype.select_div = function(element){
336                if(element == 'tab1'){
337                   Element('tab1').style.display = '';
338                   Element('tab2').style.display = 'none';
339                   Element('td1').style.background = '#eee';   
340                   Element('td2').style.background = '#cecece';
341                }
342                if(element == 'tab2'){
343                   Element('tab1').style.display = 'none';
344                   Element('tab2').style.display = '';
345                   Element('td1').style.background = '#cecece';
346                   Element('td2').style.background = '#eee';               
347
348                }
349        }
350       
351        emQuickCatalogSearch.prototype.load_catalog = function(){
352       
353                var _this = this;
354                var content = new Array;
355                var select = Element('list_personal').style.display == 'none'? Element('list_groups'): Element('list_personal');
356               
357                if(Element('list_personal').style.display == 'none'){
358                        content = _this.cc_groups;
359                }else{
360                        content = _this.cc_contacts;
361                }
362                if(select.options.length > 0){
363                        for(var i=0; i < select.options.length; i++){
364                                select.options[i] = null;
365                                i--;
366                        }
367                }
368                for(var i=0; i < content.length; i++){
369                        if(content[i] != undefined){
370                                var aux = content[i].split(";");
371                                var opt = new Option(aux[0] + ' (' + aux[1] + ')','"' + aux[0] + '" ' + '<' + aux[1] + '>',false,false);
372                                select[select.length] = opt;
373                        }
374                }
375                content.splice(0,(content.lenght));
376        }
377
378        emQuickCatalogSearch.prototype.update_organizations = function(){
379
380                       
381                while(Element('select_organization').options.length > 0) {
382                        Element('select_organization').remove(0);
383                }
384               
385               
386                var handler_org = function(data){
387                        Element('select_organization').options[0] = new Option(get_lang('all'),'all');
388                        if (data != null){
389                       
390                        for(x = 0; x < data.length; x++) {
391                                Element('select_organization').options[x+1] = new Option(data[x].toUpperCase(),data[x]);
392                                }
393                        }
394                       
395                }
396               
397                cExecute ("$this.ldap_functions.get_organizations&referral=false&catalog="+Element('select_catalog').value, handler_org);
398               
399        }
400
401        emQuickCatalogSearch.prototype.changeOptions = function(type){ 
402
403                switch(type){
404                        case 'u':
405                                Element('list_values').style.display = 'none';
406                                Element('user_values').style.display = '';
407                                break;
408                       
409                        case 'l':               
410                                Element('user_values').style.display = 'none';
411                                Element('list_values').style.display = '';             
412                                break;
413
414                        case 'p':
415                                Element('list_personal').style.display = '';
416                                Element('list_groups').style.display = 'none'
417                                QuickCatalogSearch.load_catalog();                             
418                                break;
419                       
420                        case 'g':
421                                Element('list_personal').style.display = 'none';
422                                Element('list_groups').style.display = ''
423                                QuickCatalogSearch.load_catalog();
424                                break;
425                }
426
427        }
428
429        emQuickCatalogSearch.prototype.addContacts = function(field) {
430               
431                var border_id   = Element('border_id').value;
432                var select              = Element('user_values').style.display == 'none' ? Element('list_values') : Element('user_values');
433                if(field == "to1" || field == "cc1" || field == "cco1"){
434                        field = field.substr(0,field.length - 1);
435                        var select = Element('list_personal').style.display == 'none' ? Element('list_groups') : Element('list_personal');
436                }
437                var fieldOpener = Element(field+"_"+border_id);
438                var not_selected = true;               
439                for (i = 0 ; i < select.length ; i++) {                 
440                        if (select.options[i].selected && select.options[i].value != '-1') {
441                                if(fieldOpener.value.length > 0 && (fieldOpener.value.lastIndexOf(',') != (fieldOpener.value.length -1))){
442                                        fieldOpener.value += ",";
443                                }
444                                fieldOpener.value += select.options[i].value + ",";
445                                not_selected = false;
446                                select.options[i].selected = false;
447                        }
448                }
449               
450                if(not_selected)
451                        return false;
452                       
453                if(field != 'to'){
454                        a_link = Element("a_"+field+"_link_"+border_id);
455                        if(a_link)
456                                a_link.onclick();                       
457                }                               
458        }
459       
460        emQuickCatalogSearch.prototype.searchCatalogList = function (itemSearch){
461
462                if(itemSearch && Element('search_for').value.length < 4){
463                        alert(get_lang('your search argument must be longer than 4 characters.'));
464                        Element('search_for').focus();
465                        return false;
466                }
467                var organization = Element('select_organization').value;               
468                var search               = itemSearch ? Element('search_for').value : '';
469                var catalog              = Element('select_catalog').value;
470                var max_result   = 300;
471
472                var handler_searchResults = function(data){
473
474                        Element('msg_search').style.visibility = 'hidden';
475                        if(data.error){
476                                alert(get_lang('More than %1 results. Please, try to refine your search.',max_result));
477                                return false;
478                        }
479                       
480                        var group = Element('list_span');
481                        var user  = Element('user_span');       
482                        if(is_ie){
483                                group.innerHTML = '';
484                                user.innerHTML = '';
485                        }
486                        else {
487                                group = Element('list_values');
488                                user  = Element('user_values');
489                                for(var i = 0;i < group.options.length; i++)                           
490                                        group.options[i--] = null;
491                                for(var i = 0;i < user.options.length; i++)                             
492                                        user.options[i--] = null;
493                        }
494
495                        var arr         = new Array(max_result);
496                        var display     = Element('type').value == 'l'? 'display:none;' : '';
497
498                        for(i = 0; data.groups && i < data.groups.length; i++) {                       
499                                if(is_ie)
500                                        arr[i] = '<option value="'+'&quot;'+data.groups[i].name+'&quot; &lt;'+data.groups[i].email+'&gt;">'+data.groups[i].name+' ('+data.groups[i].email+')'+'</option>';
501                                else
502                                        group.options[i] = new Option(data.groups[i].name+' ('+data.groups[i].email+')','"'+data.groups[i].name+'" <'+data.groups[i].email+'>');
503                        }
504       
505                        if(is_ie)
506                                group.innerHTML = '<select multiple style="'+display+'width:400px" size="14" id="list_values">'+ arr.join() +'</select>';
507
508                        arr = new Array(max_result);
509                        display = display ? "" : "display:none;";
510                       
511                        for(i = 0; data.users && i < data.users.length; i++) {                 
512                                if(is_ie){
513                                        arr[i] = '<option value="'+'&quot;'+data.users[i].name+'&quot; &lt;'+data.users[i].email+'&gt;">'+data.users[i].name+' ('+data.users[i].email+')'+'</option>';
514                                }
515                                else{
516       
517                                /*******************************************************************************************/
518                                /* O resultado pratico do bloco de codigo a seguir eh a exibicao dos valores em tela,
519                                ja que vai verificar se o departamento e o email estao vazios ou nulos e a partir dai o
520                                resultado apresentado em tela sera exibido de maneira mais apresentavel;
521                                */
522                                        //verifica se departamento eh null ou nao;
523                                        var departamento_nulo = 'false';
524                                        if((data.users[i].department == null) || (data.users[i].department == '')) {
525                                                data.users[i].department = '';
526                                                departamento_nulo = 'true';
527                                        }
528                                        else {
529                                                data.users[i].department = ' - ' + data.users[i].department;
530                                        }
531
532                                        //verifica se email eh null ou nao;
533                                        if((data.users[i].email == null) || (data.users[i].email == '')) {
534                                                if(departamento_nulo = 'true') {
535                                                        data.users[i].email = '';
536                                                }
537                                                else {
538                                                        data.users[i].email = ' - ';
539                                                }
540                                        }
541                                        else {
542                                                data.users[i].email = ' (' + data.users[i].email + ') ';
543                                        }
544
545                                        user.options[i] = new Option(data.users[i].name+data.users[i].email+data.users[i].department,'"'+data.users[i].name+'" <'+data.users[i].email+'>'); // incluido data.users[i].department para exibir setor na opcao "Pesquisar" do email;
546                                }
547                        }
548       
549                        if(is_ie)
550                                user.innerHTML = '<select multiple style="'+display+'width:400px" size="14" id="user_values">'+ arr.join() +'</select>';
551                }
552
553                Element('msg_search').style.visibility = 'visible';
554                cExecute ("$this.ldap_functions.catalogsearch&max_result="+max_result+"&organization="+organization+"&search_for="+search+"&catalog="+catalog, handler_searchResults);
555        }
556
557       
558/* Build the Object */
559        var QuickCatalogSearch;
560        QuickCatalogSearch = new emQuickCatalogSearch();
Note: See TracBrowser for help on using the repository browser.