//Variable global que indica si el mapa ha sido cargado var mapLoad=0; var mapEdit=0; var idBandTime=100; //Variable global para detener un proceso medido con barra de progreso var progressStop=true; function editFormValue(objForm, field, val) { switch(field) { case 'page': objForm.page.value=val; break; } } function formSubmit(objForm, wID, action, formParser, funcValidate){ //objForm.page.value=action; var arrInputs = objForm.getElementsByTagName('input'); var arrSelect = objForm.getElementsByTagName('select'); var sParams = ''; for(var i=0; i < arrInputs.length; i++){ if(arrInputs[i].name != "" && arrInputs[i].type != 'button' && !(arrInputs[i].type == 'checkbox' && arrInputs[i].checked == false) && !(arrInputs[i].type == 'radio' && arrInputs[i].checked == false)){ sParams = sParams + '&' + arrInputs[i].name + '=' + encodeURIComponent(arrInputs[i].value); } } for(var i=0; i < arrSelect.length; i++){ sParams = sParams + '&' + arrSelect[i].name + '=' + arrSelect[i].value; } if(formParser){ myTaskMgr.windows(wID).ajax.parser = formParser; } else { myTaskMgr.windows(wID).ajax.parser = ajaxFormParser; } switch(action) { case 'fiscalization3': case 'external_data': case 'external_meters': case 'billing': UARXCreateLoading(wID, "Completado 0%"); var progress_id=objForm.progress_id.value; break; default: UARXCreateLoading(wID, "Enviando formulario..."); break; } switch (action) { case 'billings': myTaskMgr.windows(wID).post("/contents/billings.php?", sParams); break; case 'companies': myTaskMgr.windows(wID).post("/contents/companies.php?", sParams); break; case 'users': myTaskMgr.windows(wID).post("/contents/users.php?", sParams); break; case 'external_data': progressStop=false; updateProgress('external_data', 0, progress_id); myTaskMgr.windows(wID).post("/contents/external_data.php?step=2", "uid=" + sParams); break; case 'external_meters': progressStop=false; updateProgress('external_meters', 0, progress_id); myTaskMgr.windows(wID).post("/contents/external_meters.php?step=2", "uid=" + sParams); break; case 'billing0': myTaskMgr.windows(wID).post("/contents/new_billing.php?step=1", "uid=" + sParams); break; case 'billing': progressStop=false; updateProgress('new_billing', 0, progress_id); myTaskMgr.windows(wID).post("/contents/new_billing.php?step=2", "uid=" + sParams); break; case 'billing2': myTaskMgr.windows(wID).post("/contents/new_billing.php?step=3", "uid=" + sParams); break; case 'fiscalization': myTaskMgr.windows(wID).post("/contents/new_fiscalization.php?step=2", "uid=" + sParams); break; case 'fiscalization2': myTaskMgr.windows(wID).post("/contents/new_fiscalization.php?step=3", "uid=" + sParams); break; case 'fiscalization3': progressStop=false; updateProgress('new_fiscalization', 0, progress_id); myTaskMgr.windows(wID).post("/files/fiscalization.php?", "uid=" + sParams); break; case 'meter': myTaskMgr.windows(wID).post("/actions/do.meter_ade.php", "uid=" + sParams); setTimeout('myTaskMgr.windows("main").ajax.parser = ajaxHTMLParser; UARXCreateLoading("main", "Cargando..."); myTaskMgr.windows("main").get("/contents/meters.php?silent=1")', 800); break; case 'meters': myTaskMgr.windows(wID).post("/contents/meters.php?", sParams); break; case 'concentrator': myTaskMgr.windows(wID).post("/actions/do.concentrator_ade.php", "uid=" + sParams); setTimeout('myTaskMgr.windows("main").ajax.parser = ajaxHTMLParser; UARXCreateLoading("main", "Cargando..."); myTaskMgr.windows("main").get("/contents/concentrators.php?silent=1")', 800); break; case 'concentrators': myTaskMgr.windows(wID).post("/contents/concentrators.php?", sParams); break; case 'contactor': myTaskMgr.windows(wID).post("/actions/do.contactor.php", "uid=" + sParams); break; case 'find_companies': myTaskMgr.windows(wID).post("/contents/find_co_results.php?", sParams); break; case 'meter_params': myTaskMgr.windows(wID).post("/actions/do."+action+".php", sParams); break; case 'communication': myTaskMgr.windows(wID).post("/actions/do.communication_ade.php", sParams); break; case 'roles': myTaskMgr.windows(wID).post("/actions/do.role_ade.php", "uid=" + sParams); myTaskMgr.windows("roles").ajax.parser = ajaxHTMLParser; setTimeout('UARXCreateLoading("roles", "Cargando..."); myTaskMgr.windows("roles").get("/contents/roles.php?silent=1")', 800); break; case 'tariff': myTaskMgr.windows(wID).post("/actions/do.tariff_ade.php", "uid=" + sParams); setTimeout('menu("tariffs")', 600); break; case 'band': var description=document.getElementById("descriptionEditTariff").value; var idTariff=document.getElementById("idEditTariff").value; myTaskMgr.windows(wID).post("/actions/do.band_ade.php", "uid=" + sParams); myTaskMgr.windows(wID).ajax.parser = ajaxHTMLParser; setTimeout('UARXCreateLoading("edit_tariff", "Cargando..."); myTaskMgr.windows("edit_tariff").get("/contents/edit_tariff.php?silent=1&id='+idTariff+'&description='+encodeURIComponent(description)+'");', 800); break; case 'mapping': var idTariff=document.getElementById("idEditMapping").value; myTaskMgr.windows(wID).post("/actions/do.mapping_ade.php", "uid=" + sParams); myTaskMgr.windows(wID).ajax.parser = ajaxHTMLParser; setTimeout('showMappingEdit('+idTariff+');', 600); break; case 'mapping_band': var idTariff=document.getElementById("idEditMappingBand").value; var billingModule=document.getElementById("billingModuleMappingBand").value; myTaskMgr.windows(wID).post("/actions/do.mapping_ade.php", "uid=" + sParams); myTaskMgr.windows(wID).ajax.parser = ajaxHTMLParser; setTimeout('showMappingEdit('+idTariff+',\''+billingModule+'\');', 600); break; case 'holiday': var idTariff=document.getElementById("idEditHolidayTariff").value; myTaskMgr.windows(wID).post("/actions/do.holiday_ade.php", "uid=" + sParams); myTaskMgr.windows(wID).ajax.parser = ajaxHTMLParser; setTimeout('showHolidays('+idTariff+');', 600); break; default: myTaskMgr.windows(wID).post("/actions/do."+action+"_ade.php", "uid=" + sParams); break; } }