/******************************************************************************\ |************************** MODULO AGENDA *******************************| |********** SCRIPT REFERENTE A CAIXA DE INCLUSAO DE PARTICIPANTES ************| \******************************************************************************/ // Variaveis Locais var select_in = document.getElementById('user_list'); var select_out = document.getElementById('user_list_in'); var users_out = select_out.cloneNode(true); var finderTimeout = ''; // Funcoes function showExParticipants(el,path){ document.getElementById('tbl_ext_participants').style.display=''; el.style.display='none'; } function hideExParticipants(el,path){ document.getElementById('a_ext_participants').style.display = ''; document.getElementById('tbl_ext_participants').style.display ='none'; } function optionFinderTimeout(obj){ clearTimeout(finderTimeout); var oWait = document.getElementById("wait"); oWait.innerHTML = 'Buscando...'; finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); } function optionFinder(id) { var oWait = document.getElementById("wait"); var oText = document.getElementById(id); for(var i = 0;i < select_out.options.length; i++) select_out.options[i--] = null; for(i = 0; i < users_out.length; i++){ if(users_out[i].text.substring(0 ,oText.value.length).toUpperCase() == oText.value.toUpperCase()) { sel = select_out.options; option = new Option(users_out[i].text,users_out[i].value); sel[sel.length] = option; } } oWait.innerHTML = ' '; } function rem() { for(var i = 0;i < select_in.options.length; i++) if(select_in.options[i].selected) select_in.options[i--] = null; } function submitValues(){ for(i = 0; i < select_in.length; i++) select_in.options[i].selected = true; } function openListUsers(newWidth,newHeight, owner){ newScreenX = screen.width - newWidth; newScreenY = 0; window.open('calendar/templates/celepar/listUsers.php?owner='+owner,"","width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no"); } function adicionaListaCalendar() { var select = window.document.getElementById('user_list_in'); var selectOpener = window.opener.document.getElementById('user_list'); for (i = 0 ; i < select.length ; i++) { if (select.options[i].selected) { isSelected = false; for(var j = 0;j < selectOpener.options.length; j++) { if(selectOpener.options[j].value == select.options[i].value){ isSelected = true; break; } } if(!isSelected){ option = window.opener.document.createElement('option'); option.value =select.options[i].value; option.text = select.options[i].text; selectOpener.options[selectOpener.options.length] = option; } } } selectOpener.options[selectOpener.options.length-1].selected = true; } function changeViewMode(chValue){ switch (chValue){ case 'hourAppointment': var names=new Array('title','priority','location','alarmhours','alarmminutes','recur_type','rpt_use_end','recur_interval','rpt_label'); for (var i=0; i < names.length; i++) { var Field = document.getElementsByName('cal['+names[i]+']'); if (Field[0]) Field[0].parentNode.parentNode.style.display = "none"; } Field = document.getElementsByName('participants[]'); Field[0].parentNode.parentNode.style.display = "none"; Field[1].parentNode.parentNode.style.display = "none"; Field = document.getElementById('txt_loading'); Field.parentNode.parentNode.style.display = "none"; Field = document.getElementsByName('cal[rpt_day][]'); Field[0].parentNode.parentNode.style.display = "none"; break; default: var names=new Array('title','priority','location','alarmhours','alarmminutes','recur_type','rpt_use_end','recur_interval','rpt_label'); for (var i=0; i < names.length; i++) { var Field = document.getElementsByName('cal['+names[i]+']'); if (Field[0]) Field[0].parentNode.parentNode.style.display = ""; } Field = document.getElementsByName('participants[]'); Field[0].parentNode.parentNode.style.display = ""; Field[1].parentNode.parentNode.style.display = ""; Field = document.getElementById('txt_loading'); Field.parentNode.parentNode.style.display = ""; Field = document.getElementsByName('cal[rpt_day][]'); Field[0].parentNode.parentNode.style.display = ""; break; } } function updateTitleField(select){ var typeField = document.getElementsByName('cal[type]'); if (typeField[0].value != 'hourAppointment') return; var titleField = document.getElementsByName('cal[title]'); var optionsArray = select.childNodes; titleField[0].value = ''; for(option in optionsArray) if (optionsArray[option].selected) titleField[0].value += optionsArray[option].text + ' '; } // Fim