source: trunk/contactcenter/js/ccListParticipants.js @ 2

Revision 2, 5.0 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1  /***************************************************************************\
2  * eGroupWare - Contacts Center                                              *
3  * http://www.egroupware.org                                                 *
4  * Written by:                                                               *
5  *  - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net>         *
6  *  sponsored by Thyamad - http://www.thyamad.com                            *
7  * ------------------------------------------------------------------------- *
8  *  This program is free software; you can redistribute it and/or modify it  *
9  *  under the terms of the GNU General Public License as published by the    *
10  *  Free Software Foundation; either version 2 of the License, or (at your   *
11  *  option) any later version.                                               *
12  \***************************************************************************/
13
14        function cListParticipants ()
15        {
16                this.arrayWin = new Array();
17                this.el;
18        }
19
20       
21cListParticipants.prototype.showList = function(id, contact, email, title){
22        _this = this;
23       
24        id = id;
25       
26        div = document.getElementById(id+':cc_rectParticipants');
27        var el = document.createElement("DIV");                                                                 
28        el.style.visibility = "hidden";                                                                 
29        el.style.position = "absolute";
30        el.style.left = "0px";
31        el.style.top = "0px";
32        el.style.width = "0px";
33        el.style.height = "0px";                                                                       
34        el.className = "div_cc_rectParticipants";
35        el.id = id+':cc_rectParticipants';
36       
37        if(is_ie) {
38                el.style.width= "auto";
39                el.style.overflowY = "auto";                                                           
40                el.style.overflowX = "hidden";
41        }                                                                                                       
42                else {                                                                 
43                el.style.overflow = "-moz-scrollbars-vertical";
44        }
45               
46        if (title) {
47                document.body.appendChild(el);
48                var names = contact.split(",");
49                var email = email.split(",");
50                el.innerHTML = "";                                                             
51                el.innerHTML = "<br>&nbsp;&nbsp;<b><font color='BLUE'>"+title+"</font></b>"+
52                "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;<u>"+
53                Element('cc_participants').value+"</u>&nbsp;&nbsp;&nbsp;<br><br>";
54                                                       
55                if(names.length) {
56                        for (var d = 0; d < (names.length-1); d++) {                                                                                                                                                                                                                                                                                                   
57                                el.innerHTML +=
58                                "<font color='DARKBLUE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
59                                        "\"" + names[d]+ "\"" +
60                                        " &lt;"+email[d]+
61                                        "&gt;</font>&nbsp;&nbsp;&nbsp;<br>";                                                                                                                                   
62                        }
63                }
64                else {
65                        el.innerHTML += "<font color='DARKBLUE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
66                                "&lt;"+Element('cc_empty').value+"&gt;&nbsp;&nbsp;</font><br>";         
67                }
68                       
69                el.innerHTML += "<br>";
70               
71                if(div)
72                        this.showWindow(div);
73                else                                           
74                        _this.showWindow(el);
75        } else {
76                        var handler = function (responseText) {
77                                var contacts = unserialize(responseText);
78                                var title = contacts['names_ordered'];                 
79                                document.body.appendChild(el);
80                               
81                                el.innerHTML = "";     
82                                el.innerHTML = "<br>&nbsp;&nbsp;<b><font color='BLUE' nowrap>"+title+"</font></b>"+
83                                "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;<u>"+
84                                Element('cc_participants').value+"</u>&nbsp;&nbsp;&nbsp;<br><br>";     
85                               
86                                if(contacts.length) {
87                                        for (var d = 0; d < contacts.length; d++) {
88                                                el.innerHTML +=
89                                                "<font color='DARKBLUE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
90                                                contacts[d]+"</font>&nbsp;&nbsp;&nbsp;<br>";                                                                                                                                   
91                                        }
92                                }
93                                else {
94                                        el.innerHTML += "<font color='DARKBLUE'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
95                                        "&lt;"+Element('cc_empty').value+"&gt;&nbsp;&nbsp;</font><br>";         
96                                }
97                                el.innerHTML += "<br>";
98                                                               
99                                _this.showWindow(el);
100                        }               
101                               
102                        if(div)
103                                this.showWindow(div);
104                        else
105                                Connector.newRequest('get_catalog_participants_list', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_catalog_participants_list', 'POST', handler, 'id='+id);
106                }
107        }
108       
109        cListParticipants.prototype.showWindow = function (div)
110        {                                               
111                if(! div) {
112                        alert('Essa lista não possui nenhum participante.');
113                        return;
114                }
115                                                       
116                if(! this.arrayWin[div.id]) {
117                        div.style.width = "auto";
118                        div.style.height = "250px";
119                        var title = 'Listar Partipantes';               
120                        var wHeight = div.offsetHeight + "px";
121                        var wWidth =  div.offsetWidth   + "px";
122                        if(is_ie) {
123                                div.style.width = wWidth;
124                        }                       
125                        else {
126                                div.style.width = div.offsetWidth - 5;
127                        }
128
129                        win = new dJSWin({                     
130                                id: 'ccListParticipants_'+div.id,
131                                content_id: div.id,
132                                width: wWidth,
133                                height: wHeight,
134                                title_color: '#3978d6',
135                                bg_color: '#eee',
136                                title: title,                                           
137                                title_text_color: 'white',
138                                button_x_img: Element('cc_phpgw_img_dir').value+'/winclose.gif',
139                                border: true });
140                       
141                        this.arrayWin[div.id] = win;
142                        win.draw();                     
143                }
144                else {
145                        win = this.arrayWin[div.id];
146                }                       
147                                                       
148                win.open();                             
149        }
150       
151/* Build the Object */
152        var ccListParticipants ;
153        var cListParticipants_pre_load = document.body.onload;
154
155        if (is_ie)
156        {
157                document.body.onload = function (e)
158                {
159                        cListParticipants_pre_load();
160                        ccListParticipants = new cListParticipants();
161                       
162                };
163        }
164        else
165        {
166                ccListParticipants = new cListParticipants();
167        }
Note: See TracBrowser for help on using the repository browser.