Commit 3cc425e0be6d671434d9567449aef02baa891632

Authored by Gedeson Wasley
1 parent 71ee0a6e
Exists in master and in 1 other branch 3.1

Correção de Relatórios

src/Cacic/RelatorioBundle/Controller/FaturamentoController.php
... ... @@ -18,7 +18,17 @@
18 18  
19 19 $form = $this->createForm( new LogPesquisaType() );
20 20  
  21 + return $this->render( 'CacicRelatorioBundle:Faturamento:index.html.twig',
  22 + array(
  23 + 'locale'=> $locale,
  24 + 'form' => $form->createView()
  25 + )
  26 + );
  27 + }
21 28  
  29 + public function faturamentoRelatorioAction(Request $request){
  30 + $locale = $request->getLocale();
  31 + $form = $this->createForm( new LogPesquisaType() );
22 32 if ( $request->isMethod('POST') )
23 33 {
24 34 $form->bind( $request );
... ... @@ -31,12 +41,11 @@
31 41  
32 42 $logs = $this->getDoctrine()->getRepository( 'CacicCommonBundle:LogAcesso')
33 43 ->pesquisar( $data['dtAcaoInicio'], $data['dtAcaoFim'], $filtroLocais);
34   -
35 44 }
36 45  
37   - return $this->render( 'CacicRelatorioBundle:Faturamento:index.html.twig',
  46 + return $this->render( 'CacicRelatorioBundle:Faturamento:acessoResultado.html.twig',
38 47 array(
39   - 'locale'=> $locale,
  48 + 'idioma'=> $locale,
40 49 'form' => $form->createView(),
41 50 'data' =>$data,
42 51 'logs' => ( isset( $logs ) ? $logs : null )
... ... @@ -72,6 +81,19 @@
72 81  
73 82 $form = $this->createForm( new LogPesquisaType() );
74 83  
  84 + return $this->render( 'CacicRelatorioBundle:Faturamento:inativos.html.twig',
  85 + array(
  86 + 'locale'=> $locale,
  87 + 'form' => $form->createView()
  88 + )
  89 + );
  90 + }
  91 +
  92 + public function inativosRelatorioAction(Request $request){
  93 + $locale = $request->getLocale();
  94 +
  95 + $form = $this->createForm( new LogPesquisaType() );
  96 +
75 97  
76 98 if ( $request->isMethod('POST') )
77 99 {
... ... @@ -88,9 +110,9 @@
88 110  
89 111 }
90 112  
91   - return $this->render( 'CacicRelatorioBundle:Faturamento:inativos.html.twig',
  113 + return $this->render( 'CacicRelatorioBundle:Faturamento:inativosResultado.html.twig',
92 114 array(
93   - 'locale'=> $locale,
  115 + 'idioma'=> $locale,
94 116 'form' => $form->createView(),
95 117 'data' =>$data,
96 118 'logs' => ( isset( $logs ) ? $logs : null )
... ...
src/Cacic/RelatorioBundle/Controller/SoftwareController.php
... ... @@ -157,7 +157,7 @@ class SoftwareController extends Controller
157 157 $dados = $this->getDoctrine()
158 158 ->getRepository('CacicCommonBundle:Software')
159 159 ->gerarRelatorioSoftwaresPorOrgao( $request->get('form') );
160   -
  160 +
161 161 return $this->render(
162 162 'CacicRelatorioBundle:Software:rel_orgao.html.twig',
163 163 array(
... ...
src/Cacic/RelatorioBundle/Resources/config/routing.yml
... ... @@ -5,6 +5,14 @@ cacic_relatorio_autorizacoes:
5 5 cacic_relatorio_faturamento:
6 6 pattern: /faturamento
7 7 defaults: { _controller: CacicRelatorioBundle:Faturamento:index }
  8 + requirements:
  9 + _method: GET
  10 +
  11 +cacic_relatorio_resultado:
  12 + pattern: /faturamento
  13 + defaults: { _controller: CacicRelatorioBundle:Faturamento:faturamentoRelatorio }
  14 + requirements:
  15 + _method: POST
8 16  
9 17 cacic_relatorio_faturamento_listar:
10 18 pattern: /software/faturamento/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
... ... @@ -121,6 +129,14 @@ cacic_relatorio_hardware_wmi_detalhe:
121 129 cacic_relatorio_inativos:
122 130 pattern: /inativos
123 131 defaults: { _controller: CacicRelatorioBundle:Faturamento:inativos }
  132 + requirements:
  133 + _method: GET
  134 +
  135 +cacic_relatorio_inativos_rel:
  136 + pattern: /inativos
  137 + defaults: { _controller: CacicRelatorioBundle:Faturamento:inativosRelatorio }
  138 + requirements:
  139 + _method: POST
124 140  
125 141 cacic_relatorio_inativos_listar:
126 142 pattern: /inativos/{idRede}/{dtAcaoInicio}/{dtAcaoFim}
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/acessoResultado.html.twig
  1 +{% extends 'CacicRelatorioBundle::base.html.twig' %}
  2 +
  3 +{% block body %}
  4 +
1 5 <div class="row-fluid">
2 6 <div class="span12">
3 7 <div class="box grad_colour_black">
4 8 <h2 class="box_head round_top"><i class="icon-list"></i> {{'Resultado do Faturamento' |trans }}</h2>
5 9 <div class="block box_content round_bottom padding_10">
6 10  
  11 + <h2 class="">{{ 'Relatório de Faturamento'|trans }}</h2>
  12 + <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("m/d/Y H\\hi") }}{% endif %}</h5>
  13 +
  14 + <hr />
7 15  
8 16 <form id="faturamento" class="form-horizontal" method="post" >
9 17  
... ... @@ -55,4 +63,6 @@
55 63 </div> <!-- /block -->
56 64 </div> <!-- /box -->
57 65 </div> <!-- /span -->
58   -</div> <!-- /row -->
59 66 \ No newline at end of file
  67 +</div> <!-- /row -->
  68 +
  69 +{% endblock %}
60 70 \ No newline at end of file
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativos.html.twig
... ... @@ -17,7 +17,7 @@
17 17  
18 18 <h4>{{ "Período para verificação de computadores inativos"|trans }}</h4><br />
19 19  
20   - <form id={{ 'formFaturamento'|trans }} class="form-horizontal" action="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" method="post" >
  20 + <form id={{ 'formFaturamento'|trans }} class="form-horizontal" method="post" target="_blank">
21 21  
22 22 <div class="control-group">
23 23 <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label>
... ... @@ -81,11 +81,6 @@
81 81  
82 82 </div> <!-- /row -->
83 83  
84   - {% if logs is not null %}
85   - {% include 'CacicRelatorioBundle:Faturamento:inativosResultado.html.twig' %}
86   -
87   - {% endif %}
88   -
89 84 {% endblock %}
90 85  
91 86 {% block javascripts %}
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/inativosResultado.html.twig
  1 +{% extends 'CacicRelatorioBundle::base.html.twig' %}
  2 +
  3 +{% block body %}
  4 +
1 5 <div class="row-fluid">
2 6 <div class="span12">
3 7 <div class="box grad_colour_black">
4 8 <h2 class="box_head round_top"><i class="icon-list"></i> {{'Total de estações inativas' |trans }}</h2>
5 9 <div class="block box_content round_bottom padding_10">
6 10  
  11 + <h2 class="">{{ 'Relatório sem Coletas'|trans }}</h2>
  12 + <h5>{{ 'Relatório gerado em'|trans }} {% if idioma == 'pt_BR' %}{{ "now"|date("d/m/Y H\\hi") }}{% else %}{{ "now"|date("m/d/Y H\\hi") }}{% endif %}</h5>
  13 +
  14 + <hr />
  15 +
7 16  
8 17 <form id="faturamento" class="form-horizontal" method="post" >
9 18  
... ... @@ -56,3 +65,5 @@
56 65 </div> <!-- /box -->
57 66 </div> <!-- /span -->
58 67 </div> <!-- /row -->
  68 +
  69 +{% endblock %}
59 70 \ No newline at end of file
... ...
src/Cacic/RelatorioBundle/Resources/views/Faturamento/index.html.twig
... ... @@ -17,7 +17,7 @@
17 17  
18 18 <h4>{{ "Filtros para faturamento mensal"|trans }}</h4><br />
19 19  
20   - <form id={{ 'formFaturamento'|trans }} class="form-horizontal" action="{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" method="post" >
  20 + <form id={{ 'formFaturamento'|trans }} class="form-horizontal" method="post" target="_blank">
21 21  
22 22 <div class="control-group">
23 23 <label for="log_acesso_periodo" class="control-label">{{ 'Período'|trans }}</label>
... ... @@ -81,11 +81,6 @@
81 81  
82 82 </div> <!-- /row -->
83 83  
84   - {% if logs is not null %}
85   - {% include 'CacicRelatorioBundle:Faturamento:acessoResultado.html.twig' %}
86   -
87   - {% endif %}
88   -
89 84 {% endblock %}
90 85  
91 86 {% block javascripts %}
... ...
src/Cacic/RelatorioBundle/Resources/views/Software/rel_inventariados.html.twig
... ... @@ -10,6 +10,7 @@
10 10 <table class="table table-striped table-bordered">
11 11 <thead>
12 12 <tr>
  13 + <th width="5%" style="text-align: center"></th>
13 14 <th width="30%">{{ "Software"|trans }}</th>
14 15 <th width="20%">{{ "Local"|trans }}</th>
15 16 <th width="20%" style="text-align: center">{{ "Máquinas"|trans }}</th>
... ... @@ -21,6 +22,7 @@
21 22 {% for reg in dados %}
22 23  
23 24 <tr>
  25 + <td style="text-align: center">{{ loop.index }}</td>
24 26 <td><a href="{{ path('cacic_relatorio_software_lista') }}/{{ reg['nmSoftware'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank">{{ reg['nmSoftware'] }}</a></td>
25 27 <td>{{ reg['nmLocal'] }}</td>
26 28 <td style="text-align: center"><a href="{{ path('cacic_relatorio_software_lista') }}/{{ reg['nmSoftware'] }}/{{ reg['nmLocal'] }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank">{{ reg['numComp'] }}</a></td>
... ...
src/Cacic/RelatorioBundle/Resources/views/Software/rel_software_lista.html.twig
... ... @@ -10,6 +10,7 @@
10 10 <table class="table table-striped table-bordered">
11 11 <thead>
12 12 <tr>
  13 + <th width="5%" style="text-align: center"></th>
13 14 <th width="15%">{{ "Computador"|trans }}</th>
14 15 <th width="10%">{{ "MAC Address"|trans }}</th>
15 16 <th width="10%">{{ "Endereço IP"|trans }}</th>
... ... @@ -23,6 +24,7 @@
23 24 <tbody>
24 25 {% for reg in dados %}
25 26 <tr>
  27 + <td style="text-align: center">{{ loop.index }}</td>
26 28 <td>
27 29 <b><a href="{{ path('cacic_computador_detalhar') }}/{{ reg.1 }}" title="{{ "Todas as informações do computador"|trans }}" target="_blank">{{ reg.nmComputador }}</a></b>
28 30 </td>
... ...
src/Cacic/RelatorioBundle/Resources/views/Software/rel_tipo.html.twig
... ... @@ -21,7 +21,7 @@
21 21 <tr>
22 22 <td style="text-align: center"><span class="red">{{ reg.teDescricaoTipoSoftware }}</span></td>
23 23 <td><span class="blue">{{ reg.nmSoftware }}</span></td>
24   - <td style="text-align: center"><b><a href="{{ path('cacic_relatorio_software_lista', {'software': reg['nmSoftware']}) }}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank">
  24 + <td style="text-align: center"><b><a href="{{ path('cacic_relatorio_software_lista') }}/{{reg['nmSoftware']}}" title="{{ "Relatório de coletas do software"|trans }}" target="_blank">
25 25 {{ reg.numComp }}</a></b></td>
26 26 </tr>
27 27 {% else %}
... ...