//===================================================== //REGRAS NÃO VALEM PARA USUÁRIO CUJO NOME SEJA IGUAL A: //UM POR LINHA, ENTRE ASPAS DUPLAS, COM VIRGULA AO FINAL //DE CADA LINHA. //NOME DEVE SER EXATAMENTE IGUAL AO CADASTRO DO //ACCELERO //===================================================== const usuarioExclusion = [ "Master", ]; //===================================================== //MANTER OS SEGUINTES CONTROLADORES SELECIONÁVEIS: //UM POR LINHA, ENTRE ASPAS DUPLAS, COM VIRGULA AO FINAL //DE CADA LINHA. //NOME PODE SER PARCIAL. SERÃO MANTIDOS OS CONTROLADORES //CUJO NOME COMEÇA COM... //===================================================== const controladoresAManter = [ "10 - CAMP - TOTEM VEICULO", "11 - CAMPOLIM - FACIAL PEDESTRES (P01)", "15 - SER CRIANÇA - TOTEM VEICULO", "20 - SER CRIANÇA CHECK-IN INTERNO", ]; //===================================================== //TIRAR O "//" DA LINHA ABAIXO PRA HABILITAR A CUSTOMIZAÇÃO //===================================================== ColegioSerMonitorChegadas(usuarioExclusion, controladoresAManter) //===================================================== //NÃO MEXER DAQUI PRA BAIXO //===================================================== function ColegioSerMonitorChegadas(usuarioExclusion, controladoresAManter) { console.log("Starting customization...") const user = $('.user-presentation').text(); if (user.length === 0) { window.setTimeout(() => ColegioSerMonitorChegadas(usuarioExclusion, controladoresAManter), 500); return; } if (usuarioExclusion.includes($('.user-presentation').text())) return; if ($('h3:contains("Monitor de chegadas")').length === 0) { window.setTimeout(() => ColegioSerMonitorChegadas(usuarioExclusion, controladoresAManter), 2000); return; } console.log("Applying customization...") MonitorChegadasLoop(controladoresAManter) } function MonitorChegadasLoop(controladoresAManter) { removeControladoresFromMonitorBloqueio(controladoresAManter); forceValuesOfEventoTipo(); forceValuesOfAreas(); forceValuesOfPhotos(); forceValuesOfShowAssociated(); $('.btn-clear-search').hide(); $('.btn-clear-search').after("
"); $('.reenableOptions').on('dblclick', MonitorReenableOptions) window.setTimeout(() => MonitorChegadasLoop(controladoresAManter), 1000); } function MonitorReenableOptions() { $('[data-name=letID]').prop('disabled', false); const arrAreID = $('[data-name=arrAreID]'); arrAreID.prop('disabled', false); arrAreID.closest('.form-group').show(); $('#levMonitorPhotos').prop('disabled', false); $('#levMonitorShowAll').prop('disabled', false); $('[data-name=arrConID]').removeClass('selectDoneLoading').removeClass('loading'); SNFWHelpers.getRemoteSelectData($('[data-name=arrConID]')); } function forceValuesOfEventoTipo() { const wrapper = $('[data-element=LogEvento]:not(.donecleanup-eventotipo)'); if (wrapper.length === 0) return; const el = $('[data-name=letID]'); if (!el.hasClass('selectDoneLoading')) return; wrapper.addClass('donecleanup-eventotipo'); el.changeVal('34'); el.prop('disabled', true); } function forceValuesOfAreas() { const wrapper = $('[data-element=LogEvento]:not(.donecleanup-areas)'); if (wrapper.length === 0) return; const el = $('[data-name=arrAreID]'); if (!el.hasClass('selectDoneLoading')) return; wrapper.addClass('donecleanup-areas'); el.changeVal(null); el.prop('disabled', true); el.closest('.form-group').hide(); } function forceValuesOfPhotos() { const wrapper = $('[data-element=LogEvento]:not(.donecleanup-showphotos)'); if (wrapper.length === 0) return; const el = $('#levMonitorPhotos'); wrapper.addClass('donecleanup-showphotos'); el.changeVal('1'); el.prop('disabled', true); } function forceValuesOfShowAssociated() { const wrapper = $('[data-element=LogEvento]:not(.donecleanup-showassociated)'); if (wrapper.length === 0) return; const el = $('#levMonitorShowAll'); wrapper.addClass('donecleanup-showassociated'); el.changeVal('0'); el.prop('disabled', true); } function removeControladoresFromMonitorBloqueio(controladoresAManter) { const wrapper = $('[data-element=LogEvento]:not(.donecleanup-controladores)'); if (wrapper.length === 0) return; const el = $('[data-name=arrConID]'); if (el.hasClass('selectDoneLoading')) { wrapper.addClass('donecleanup-controladores'); $(el).find('option'); for(const opt of $(el).find('option')) { const name = opt.innerText; if (controladoresAManter.includes(name)) continue; $(opt).remove(); } $(el).selectpicker('destroy'); $(el).selectpicker(); } }