Commit 573abfd83bbe63d56b127c9651ef58c3e9e25133
1 parent
bf61d75c
Exists in
master
coloca o timeout para o chamando e o concluido
git-svn-id: http://svn.softwarepublico.gov.br/svn/sistemadeatendimento/sistema/trunk@23 63db2ce5-8a6c-0410-abb9-a418dd412890
Showing
5 changed files
with
91 additions
and
1 deletions
Show diff stats
@@ -0,0 +1,10 @@ | @@ -0,0 +1,10 @@ | ||
1 | +V1.2 | ||
2 | + | ||
3 | +* Adicionado o encaminhamento para categoria, faz-se necessária a | ||
4 | + criação da tabela categoria_encaminhamento. | ||
5 | + | ||
6 | +* Adicionados os campos timeout_chamando e timeout_concluido no | ||
7 | + guiche, onde será possível configurar, para cada guichê, o tempo que | ||
8 | + ele irá passar nesses estados antes de automaticamente marcar como | ||
9 | + ausente e tornar-se disponível, respectivamente. | ||
10 | + |
Fila-Web/root/header.tt
@@ -23,11 +23,37 @@ | @@ -23,11 +23,37 @@ | ||
23 | <link rel="stylesheet" href="/static/css/main.css" type="text/css" > | 23 | <link rel="stylesheet" href="/static/css/main.css" type="text/css" > |
24 | <SCRIPT LANGUAGE='javascript'> | 24 | <SCRIPT LANGUAGE='javascript'> |
25 | var page_loaded = 0; | 25 | var page_loaded = 0; |
26 | +var waiting_for = ''; | ||
27 | +var timeout = 0; | ||
28 | +var timeout_callback; | ||
26 | function disconnected_so_move_away() { | 29 | function disconnected_so_move_away() { |
27 | if (page_loaded) { | 30 | if (page_loaded) { |
28 | window.location='about:blank'; | 31 | window.location='about:blank'; |
29 | } | 32 | } |
30 | -} | 33 | +} |
34 | + | ||
35 | +function check_timeout() { | ||
36 | + if (timeout == 0) { | ||
37 | + if (waiting_for) { | ||
38 | + timeout_callback(); | ||
39 | + } | ||
40 | + $('aviso_timeout').replace('<DIV id="aviso_timeout"></DIV>'); | ||
41 | + } else { | ||
42 | + $('aviso_timeout').replace('<DIV id="aviso_timeout" class="aviso_timeout">' + | ||
43 | + timeout + ' segundos para ' + waiting_for +'</DIV>'); | ||
44 | + | ||
45 | + window.setTimeout(function() { check_timeout() }, 1000); | ||
46 | + timeout--; | ||
47 | + } | ||
48 | +} | ||
49 | + | ||
50 | +function set_timeout(tempo, motivo, callback) { | ||
51 | + waiting_for = motivo; | ||
52 | + timeout = tempo; | ||
53 | + timeout_callback = callback; | ||
54 | + check_timeout(); | ||
55 | +} | ||
56 | + | ||
31 | </script> | 57 | </script> |
32 | </HEAD> | 58 | </HEAD> |
33 | <BODY onload='disconnected_so_move_away()'> | 59 | <BODY onload='disconnected_so_move_away()'> |
@@ -37,4 +63,5 @@ function disconnected_so_move_away() { | @@ -37,4 +63,5 @@ function disconnected_so_move_away() { | ||
37 | <DIV id="header2"> </DIV> | 63 | <DIV id="header2"> </DIV> |
38 | </div> | 64 | </div> |
39 | </DIV> | 65 | </DIV> |
66 | + <DIV id="aviso_timeout"></DIV> | ||
40 | <DIV id="content_main"> | 67 | <DIV id="content_main"> |
Fila-Web/root/render/status_atendente.tt
@@ -38,6 +38,8 @@ | @@ -38,6 +38,8 @@ | ||
38 | </table> | 38 | </table> |
39 | </DIV> | 39 | </DIV> |
40 | 40 | ||
41 | + | ||
42 | + | ||
41 | [% IF status_guiche.guiche.estado == 'concluido' || status_guiche.guiche.estado == 'disponivel' %] | 43 | [% IF status_guiche.guiche.estado == 'concluido' || status_guiche.guiche.estado == 'disponivel' %] |
42 | [% IF lista_no_show %] | 44 | [% IF lista_no_show %] |
43 | <h3 id="TitAtendAtrasados" class="titulos">Atendimentos Atrasados:</h3><br> | 45 | <h3 id="TitAtendAtrasados" class="titulos">Atendimentos Atrasados:</h3><br> |
@@ -323,3 +325,15 @@ | @@ -323,3 +325,15 @@ | ||
323 | [% END %] | 325 | [% END %] |
324 | 326 | ||
325 | $('header2').replace("[% bloco_senha | js %]"); | 327 | $('header2').replace("[% bloco_senha | js %]"); |
328 | + | ||
329 | + [% IF status_guiche.guiche.estado == 'concluido' %] | ||
330 | + set_timeout([% status_guiche.guiche.timeout_concluido %],'disponivel',function() { | ||
331 | + new Ajax.Request('/cb/atendente/disponivel', { asynchronous: 1 }); | ||
332 | + }); | ||
333 | + [% ELSIF status_guiche.guiche.estado == 'chamando' %] | ||
334 | + set_timeout([% status_guiche.guiche.timeout_chamando %],'chamando',function() { | ||
335 | + new Ajax.Request('/cb/atendente/registrar_no_show', { asynchronous: 1 }); | ||
336 | + }); | ||
337 | + [% ELSE %] | ||
338 | + set_timeout(0,'',null); | ||
339 | + [% END %] |
Fila-Web/root/static/css/main.css
@@ -216,3 +216,14 @@ background: url('../images/bt_enviar_chat.jpg') no-repeat; width: 182px; height: | @@ -216,3 +216,14 @@ background: url('../images/bt_enviar_chat.jpg') no-repeat; width: 182px; height: | ||
216 | #ConteudoAjuda a { color: blue; text-decoration: underline; font-weight : bold;} | 216 | #ConteudoAjuda a { color: blue; text-decoration: underline; font-weight : bold;} |
217 | #ConteudoAjuda p { text-indent: 30px; margin: 15px 15px 0 15px; text-align: justify;} | 217 | #ConteudoAjuda p { text-indent: 30px; margin: 15px 15px 0 15px; text-align: justify;} |
218 | 218 | ||
219 | +.aviso_timeout { | ||
220 | + color: red; | ||
221 | + position: absolute; | ||
222 | + left: 400px; | ||
223 | + top: 20px; | ||
224 | + font-weight: bold; | ||
225 | + background-color: white; | ||
226 | + padding: 20px; | ||
227 | + border: solid 1px black; | ||
228 | + font-size: 20px; | ||
229 | +} | ||
219 | \ No newline at end of file | 230 | \ No newline at end of file |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +diff -uNard /srv/perl/lib/site_perl/5.10.0/Net/XMPP2/Connection.pm /usr/share/perl5/Net/XMPP2/Connection.pm | ||
2 | +--- /srv/perl/lib/site_perl/5.10.0/Net/XMPP2/Connection.pm 2008-08-01 07:11:23.000000000 -0300 | ||
3 | ++++ /usr/share/perl5/Net/XMPP2/Connection.pm 2009-06-09 17:01:13.000000000 -0300 | ||
4 | +@@ -609,7 +609,6 @@ | ||
5 | + return $self->{writer}->send_iq ( | ||
6 | + $iqnode->attr ('id'), $type, $create_cb, | ||
7 | + (defined $iqnode->attr ('from') ? (to => $iqnode->attr ('from')) : ()), | ||
8 | +- (defined $iqnode->attr ('to') ? (from => $iqnode->attr ('to')) : ()), | ||
9 | + %attrs | ||
10 | + ); | ||
11 | + } | ||
12 | +diff -uNard /srv/perl/lib/site_perl/5.10.0/Net/XMPP2/Parser.pm /usr/share/perl5/Net/XMPP2/Parser.pm | ||
13 | +--- /srv/perl/lib/site_perl/5.10.0/Net/XMPP2/Parser.pm 2008-04-11 11:43:42.000000000 -0300 | ||
14 | ++++ /usr/share/perl5/Net/XMPP2/Parser.pm 2009-06-09 17:42:55.000000000 -0300 | ||
15 | +@@ -163,8 +163,12 @@ | ||
16 | + | ||
17 | + sub cb_start_tag { | ||
18 | + my ($self, $p, $el, %attrs) = @_; | ||
19 | +- my $node = Net::XMPP2::Node->new ($p->namespace ($el), $el, \%attrs, $self); | ||
20 | ++ | ||
21 | ++ my %prefixes = map { $p->expand_ns_prefix($_) => $_ } $p->new_ns_prefixes; | ||
22 | ++ my $node = Net::XMPP2::Node->new ($p->namespace ($el), $el, \%attrs, $self, \%prefixes); | ||
23 | ++ | ||
24 | + $node->append_raw ($p->recognized_string); | ||
25 | ++ | ||
26 | + if (not @{$self->{nodestack}}) { | ||
27 | + $self->{stream_cb}->($node); | ||
28 | + } |