From 174569b685f9335dbdea6514dcf50dc52b7fa216 Mon Sep 17 00:00:00 2001 From: daniel@ruoso.com Date: Thu, 20 May 2010 15:51:10 +0000 Subject: [PATCH] torna a possibliade de encaminhar para uma mesa uma configuracao. --- Fila-Web/lib/Fila/WebApp/Controller/CB/Atendente.pm | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Fila-Web/lib/Fila/WebApp/Controller/CB/Atendente.pm b/Fila-Web/lib/Fila/WebApp/Controller/CB/Atendente.pm index 58e7669..87869ca 100644 --- a/Fila-Web/lib/Fila/WebApp/Controller/CB/Atendente.pm +++ b/Fila-Web/lib/Fila/WebApp/Controller/CB/Atendente.pm @@ -22,7 +22,9 @@ use Encode; use base 'Catalyst::Controller::SOAP'; __PACKAGE__->config->{wsdl} = - {wsdl => Fila::WebApp->path_to('schemas/FilaWeb.wsdl')}; + { wsdl => Fila::WebApp->path_to('schemas/FilaWeb.wsdl') }; +__PACKAGE__->config->{pode_encaminhar_para_mesa} = 1; +__PACKAGE__->mk_accessors('pode_encaminhar_para_mesa'); sub registrar_no_show : WSDLPort('FilaWebAtendenteCallback') { my ($self, $c) = @_; @@ -58,13 +60,17 @@ sub listar_no_show : WSDLPort('FilaWebAtendenteCallback') { sub listar_guiches_encaminhar : WSDLPort('FilaWebAtendenteCallback') { my ($self, $c) = @_; - $c->model('SOAP')->transport->addrs(['motor@gestao.fila.vhost/ws/gestao/guiche']); - my $lista_guiches = $c->model('SOAP::Gestao::Guiche') - ->listar_guiches({ local => {} }); + if ($self->pode_encaminhar_para_mesa) { + $c->model('SOAP')->transport->addrs(['motor@gestao.fila.vhost/ws/gestao/guiche']); + my $lista_guiches = $c->model('SOAP::Gestao::Guiche') + ->listar_guiches({ local => {} }); - if ($lista_guiches->{Fault}) { - $c->stash->{error_message} = $lista_guiches->{Fault}{faultstring}; - return $c->forward('/render/error_message'); + if ($lista_guiches->{Fault}) { + $c->stash->{error_message} = $lista_guiches->{Fault}{faultstring}; + return $c->forward('/render/error_message'); + } + + $c->stash->{lista_guiches_encaminhar} = $lista_guiches; } $c->model('SOAP')->transport->addrs(['motor@gestao.fila.vhost/ws/gestao/guiche']); @@ -72,17 +78,16 @@ sub listar_guiches_encaminhar : WSDLPort('FilaWebAtendenteCallback') { ->listar_categorias({ local => {} }); if ($lista_categorias->{Fault}) { - $c->stash->{error_message} = $lista_guiches->{Fault}{faultstring}; + $c->stash->{error_message} = $lista_categorias->{Fault}{faultstring}; return $c->forward('/render/error_message'); } + $c->stash->{lista_categorias_encaminhar} = $lista_categorias; + $c->model('SOAP')->transport->addrs(['motor@gestao.fila.vhost/ws/gestao/atendente']); $c->stash->{status_guiche} = $c->model('SOAP::Gestao::Atendente') ->status_guiche({ guiche => {} }); - $c->stash->{lista_guiches_encaminhar} = $lista_guiches; - $c->stash->{lista_categorias_encaminhar} = $lista_categorias; - $c->stash->{template} = 'cb/atendente/refresh.tt'; $c->forward($c->view()); -- libgit2 0.21.2