source: trunk/calendar/templates/default/js/edit.js @ 5143

Revision 5143, 4.6 KB checked in by wmerlotto, 12 years ago (diff)

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus. Calendar: adicionando arquivos.

Line 
1/******************************************************************************\
2|**************************   MODULO   AGENDA   *******************************|
3|********** SCRIPT REFERENTE A CAIXA DE INCLUSAO DE PARTICIPANTES  ************|
4\******************************************************************************/
5
6// Variaveis Locais
7        var select_in  = document.getElementById('user_list');
8        var select_out  = document.getElementById('user_list_in');     
9        var users_out = select_out ? select_out.cloneNode(true) : '';
10        var finderTimeout = '';
11                                                                                                                                               
12// Funcoes     
13       
14        function sChangeHour(pSelect)
15        {
16            if(pSelect.selectedIndex < 1)
17                return;
18           
19            var hour = pSelect.options[pSelect.selectedIndex].value;                         
20            var sHour = hour.split(':');           
21           
22            var hHour,mHour;
23            if(pSelect.name == 'sEndHour')
24            {
25                hHour = document.getElementById('end_hour');
26                mHour = document.getElementById('end_minute');
27            }
28            else if(pSelect.name == 'sStartHour')
29            {
30                hHour = document.getElementById('start_hour');
31                mHour = document.getElementById('start_minute');
32            }   
33           
34            hHour.value = sHour[0];
35            mHour.value = sHour[1];
36        }
37       
38        function showExParticipants(el,path){
39                document.getElementById('tbl_ext_participants').style.display='';
40                el.style.display='none';
41        }
42       
43        function hideExParticipants(el,path){
44                document.getElementById('a_ext_participants').style.display = '';
45                document.getElementById('tbl_ext_participants').style.display ='none';
46        }
47                                                       
48        function optionFinderTimeout(obj){
49
50                clearTimeout(finderTimeout);   
51                var oWait = document.getElementById("wait");
52                oWait.innerHTML = 'Buscando...';
53                finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500);
54        }
55        function optionFinder(id) {     
56                var oWait = document.getElementById("wait");
57                var oText = document.getElementById(id);
58                for(var i = 0;i < select_out.options.length; i++)                               
59                        select_out.options[i--] = null;
60                                                                                                                                                                                       
61                for(i = 0; i < users_out.length; i++){                                                                                                                                                                                 
62                        if(users_out[i].text.substring(0 ,oText.value.length).toUpperCase() == oText.value.toUpperCase()) {
63                                sel = select_out.options;                                               
64                                option = new Option(users_out[i].text,users_out[i].value);                             
65                                sel[sel.length] = option;
66                        }
67                }
68                oWait.innerHTML = '&nbsp;';
69        }                       
70                                                                       
71        function rem()
72        {
73                for(var i = 0;i < select_in.options.length; i++)                               
74                        if(select_in.options[i].selected)
75                                select_in.options[i--] = null;                                                                                                                                 
76        }
77       
78               
79    function show_disponibility() {
80                 
81        participants = "";
82                    combo = document.getElementById('user_list');
83                    if(combo.length==0) {
84                        var msg_ = document.getElementById("set_participants").value;
85                                alert(msg_);
86                        return;
87                    }
88                                         
89                    for (i=0;i<combo.length;i++) {
90                        participants+=combo[i].value+",";
91                    }
92                    url = 'index.php?menuaction=calendar.uicalendar.disponibility&participants='+participants+'&date='+document.getElementById('start[str]').value;
93                                 
94                    //alert(url);
95                    document.getElementById('frame_disponibility').src = url;
96                    document.getElementById('disponibility').style.display='';
97                    //window.open(url);
98        }
99
100
101       
102        function openListUsers(newWidth,newHeight, owner){                                     
103                newScreenX  = screen.width - newWidth;         
104                newScreenY  = 0;               
105                window.open('calendar/templates/default/listUsers.php?owner='+owner,"","width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");
106        }
107
108        function adicionaListaCalendar()
109        {
110                var select = window.document.getElementById('user_list_in');
111                var selectOpener = window.opener.document.getElementById('user_list');
112                for (i = 0 ; i < select.length ; i++) {                         
113
114                        if (select.options[i].selected) {
115                                isSelected = false;
116
117                                for(var j = 0;j < selectOpener.options.length; j++) {                                                                                                                                                   
118                                        if(selectOpener.options[j].value == select.options[i].value){
119                                                isSelected = true;                                             
120                                                break; 
121                                        }
122                                }
123
124                                if(!isSelected){
125
126                                        option = window.opener.document.createElement('option');
127                                        option.value =select.options[i].value;
128                                        option.text = select.options[i].text;
129                                        selectOpener.options[selectOpener.options.length] = option;     
130                                }
131                               
132                        }
133                }
134                selectOpener.options[selectOpener.options.length-1].selected = true;
135        }
136       
137// Fim       
Note: See TracBrowser for help on using the repository browser.