Commit dc6410564f3a04c894f696e3921f0400db9c6c5f

Authored by daniel@ruoso.com
1 parent 8cd739df
Exists in master

implementa filtro na lista de servicos por javascript

git-svn-id: http://svn.softwarepublico.gov.br/svn/sistemadeatendimento/sistema/trunk@37 63db2ce5-8a6c-0410-abb9-a418dd412890
Fila-Web/root/header.tt
@@ -67,6 +67,29 @@ function set_timeout(tempo, motivo, callback) { @@ -67,6 +67,29 @@ function set_timeout(tempo, motivo, callback) {
67 } 67 }
68 } 68 }
69 69
  70 +function aplicar_filtro_servicos(text) {
  71 + var rx;
  72 + if (text) {
  73 + rx = new RegExp(text,"i");
  74 + }
  75 + var servicos = $$('#servicos ul li ul li');
  76 + var len = servicos.length;
  77 + var index = 0;
  78 + for (index = 0; index < len; ++index) {
  79 + var item = servicos[index];
  80 + if (text) {
  81 + var value = item.firstChild.data;
  82 + if (value.match(rx) == null) {
  83 + item.addClassName('escondido');
  84 + } else {
  85 + item.removeClassName('escondido');
  86 + }
  87 + } else {
  88 + item.removeClassName('escondido');
  89 + }
  90 + }
  91 +}
  92 +
70 </script> 93 </script>
71 </HEAD> 94 </HEAD>
72 <BODY onload='disconnected_so_move_away()'> 95 <BODY onload='disconnected_so_move_away()'>
Fila-Web/root/render/status_atendente.tt
@@ -57,7 +57,8 @@ @@ -57,7 +57,8 @@
57 57
58 [% IF status_guiche.guiche.estado == 'concluido' || status_guiche.guiche.estado == 'disponivel' %] 58 [% IF status_guiche.guiche.estado == 'concluido' || status_guiche.guiche.estado == 'disponivel' %]
59 [% IF lista_servicos %] 59 [% IF lista_servicos %]
60 - <h3 id="TitServicos" class="titulos">Serviços:</h3><br> 60 + <h3 id="TitServicos" class="titulos">Serviços (utilize o campo para filtrar):</h3><br>
  61 + <INPUT TYPE="text" NAME="filter" ONKEYUP="apply_filter(this.value)" />
61 <DIV ID="servicos"> 62 <DIV ID="servicos">
62 <UL> 63 <UL>
63 [% SET classe_servico = 0 %] 64 [% SET classe_servico = 0 %]