Commit 3a24f9f7fe92cd2d6f94aa3826d04d6834694111
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing
6 changed files
with
25 additions
and
22 deletions
Show diff stats
.gitignore
src/Cacic/CommonBundle/Entity/SoftwareRepository.php
@@ -227,22 +227,23 @@ class SoftwareRepository extends EntityRepository | @@ -227,22 +227,23 @@ class SoftwareRepository extends EntityRepository | ||
227 | { | 227 | { |
228 | // Monta a Consulta básica... | 228 | // Monta a Consulta básica... |
229 | $qb = $this->createQueryBuilder('sw') | 229 | $qb = $this->createQueryBuilder('sw') |
230 | - ->select( 'comp.nmComputador', 'sw.nmSoftware', 'so.sgSo', 'r.teIpRede', 'l.nmLocal', 'pci.teEtiqueta', 'pci.idEtiqueta','comp.idComputador','so.inMswindows') | ||
231 | - ->innerJoin('CacicCommonBundle:SoftwareEstacao', 'se','WITH','sw.idSoftware = se.idSoftware') | ||
232 | - ->innerJoin('CacicCommonBundle:Computador', 'comp','WITH','se.idComputador = comp.idComputador') | 230 | + ->select( 'DISTINCT(comp.nmComputador), sw.nmSoftware,class.nmPropertyName, coleta.teClassPropertyValue, so.sgSo, r.teIpRede, r.nmRede, l.nmLocal, comp.idComputador,so.inMswindows') |
231 | + ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software') | ||
232 | + ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty') | ||
233 | + ->innerJoin('CacicCommonBundle:ComputadorColeta', 'coleta','WITH', 'prop.classProperty = coleta.classProperty') | ||
234 | + ->innerJoin('CacicCommonBundle:Computador', 'comp','WITH','prop.computador = comp.idComputador') | ||
233 | ->leftJoin('CacicCommonBundle:So', 'so','WITH','comp.idSo = so.idSo') | 235 | ->leftJoin('CacicCommonBundle:So', 'so','WITH','comp.idSo = so.idSo') |
234 | ->leftJoin('CacicCommonBundle:Rede', 'r','WITH', 'comp.idRede = r.idRede') | 236 | ->leftJoin('CacicCommonBundle:Rede', 'r','WITH', 'comp.idRede = r.idRede') |
235 | ->innerJoin('CacicCommonBundle:Local','l','WITH', 'r.idLocal = l.idLocal') | 237 | ->innerJoin('CacicCommonBundle:Local','l','WITH', 'r.idLocal = l.idLocal') |
236 | - ->innerJoin('CacicCommonBundle:PatrimonioConfigInterface','pci','WITH','l.idLocal = pci.local') | ||
237 | - ->groupBy('comp.nmComputador, sw.nmSoftware, so.sgSo, r.teIpRede, l.nmLocal, pci.teEtiqueta, pci.idEtiqueta,comp.idComputador,so.inMswindows') | ||
238 | - ->orderBy('sw.nmSoftware, l.nmLocal, pci.idEtiqueta'); | 238 | + ->groupBy('comp.nmComputador, sw.nmSoftware, class.nmPropertyName, coleta.teClassPropertyValue,so.sgSo, r.teIpRede, l.nmLocal, r.nmRede, comp.idComputador,so.inMswindows') |
239 | + ->orderBy('r.teIpRede, l.nmLocal, sw.nmSoftware'); | ||
239 | 240 | ||
240 | /* | 241 | /* |
241 | * Verifica os filtros que foram parametrizados | 242 | * Verifica os filtros que foram parametrizados |
242 | */ | 243 | */ |
243 | 244 | ||
244 | if ( array_key_exists('softwares', $filtros) && !empty($filtros['softwares']) ) | 245 | if ( array_key_exists('softwares', $filtros) && !empty($filtros['softwares']) ) |
245 | - $qb->andWhere('sw.idSoftware IN (:softwares)')->setParameter('softwares', explode( ',', $filtros['softwares'] )); | 246 | + $qb->andWhere('class.idClassProperty IN (:softwares)')->setParameter('softwares', explode( ',', $filtros['softwares'] )); |
246 | 247 | ||
247 | if ( array_key_exists('locais', $filtros) && !empty($filtros['locais']) ) | 248 | if ( array_key_exists('locais', $filtros) && !empty($filtros['locais']) ) |
248 | $qb->andWhere('l.idLocal IN (:locais)')->setParameter('locais', explode( ',', $filtros['locais'] )); | 249 | $qb->andWhere('l.idLocal IN (:locais)')->setParameter('locais', explode( ',', $filtros['locais'] )); |
@@ -250,8 +251,9 @@ class SoftwareRepository extends EntityRepository | @@ -250,8 +251,9 @@ class SoftwareRepository extends EntityRepository | ||
250 | if ( array_key_exists('so', $filtros) && !empty($filtros['so']) ) | 251 | if ( array_key_exists('so', $filtros) && !empty($filtros['so']) ) |
251 | $qb->andWhere('comp.idSo IN (:so)')->setParameter('so', explode( ',', $filtros['so'] )); | 252 | $qb->andWhere('comp.idSo IN (:so)')->setParameter('so', explode( ',', $filtros['so'] )); |
252 | 253 | ||
253 | - if ( array_key_exists('pci', $filtros) && !empty($filtros['pci']) ) | ||
254 | - $qb->andWhere('pci.idEtiqueta IN (:pci)')->setParameter('pci', explode( ',', $filtros['pci'] )); | 254 | + if ( array_key_exists('conf', $filtros) && !empty($filtros['conf']) ) |
255 | + $qb->andWhere('class.idClassProperty IN (:conf)')->setParameter('conf', explode( ',', $filtros['conf'] )); | ||
256 | + | ||
255 | 257 | ||
256 | return $qb->getQuery()->execute(); | 258 | return $qb->getQuery()->execute(); |
257 | } | 259 | } |
src/Cacic/CommonBundle/Form/Type/UsbDeviceType.php
@@ -19,7 +19,7 @@ class UsbDeviceType extends AbstractType | @@ -19,7 +19,7 @@ class UsbDeviceType extends AbstractType | ||
19 | $builder->add('idUsbVendor', 'entity', | 19 | $builder->add('idUsbVendor', 'entity', |
20 | array( | 20 | array( |
21 | 'empty_value' => 'Selecione o Fabricante', | 21 | 'empty_value' => 'Selecione o Fabricante', |
22 | - 'required' => false, | 22 | + 'required' => true, |
23 | 'class' => 'CacicCommonBundle:UsbVendor', | 23 | 'class' => 'CacicCommonBundle:UsbVendor', |
24 | 'property' => 'nmUsbVendor', | 24 | 'property' => 'nmUsbVendor', |
25 | 'label'=>'Identificador do Fabricante') | 25 | 'label'=>'Identificador do Fabricante') |
src/Cacic/CommonBundle/Resources/views/UorgType/index.html.twig
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | </tr> | 41 | </tr> |
42 | {% else %} | 42 | {% else %} |
43 | <tr> | 43 | <tr> |
44 | - <td colspan="2" style="text-align: center;">{{ "Nenhum registro encontrado"|trans }}</td> | 44 | + <td colspan="3" style="text-align: center;">{{ "Nenhum registro encontrado"|trans }}</td> |
45 | </tr> | 45 | </tr> |
46 | {% endfor %} | 46 | {% endfor %} |
47 | </tbody> | 47 | </tbody> |
src/Cacic/RelatorioBundle/Controller/DefaultController.php
@@ -57,20 +57,17 @@ class DefaultController extends Controller | @@ -57,20 +57,17 @@ class DefaultController extends Controller | ||
57 | ->getRepository('CacicCommonBundle:Software') | 57 | ->getRepository('CacicCommonBundle:Software') |
58 | ->gerarRelatorioPatrimonio( $filtros ); | 58 | ->gerarRelatorioPatrimonio( $filtros ); |
59 | 59 | ||
60 | - | ||
61 | - | ||
62 | - | 60 | + // Debug::dump($filtros);die; |
63 | return $this->render( | 61 | return $this->render( |
64 | 'CacicRelatorioBundle:Default:rel_patrimonio.html.twig', | 62 | 'CacicRelatorioBundle:Default:rel_patrimonio.html.twig', |
65 | array( | 63 | array( |
66 | 'idioma'=>$locale, | 64 | 'idioma'=>$locale, |
67 | - 'dados' => $dados, | ||
68 | - 'menu' => (bool) strlen( $filtros['pci']), | 65 | + 'dados' => $dados,/* |
66 | + 'menu' => (bool) strlen( $filtros['pci']),*/ | ||
69 | 'exibirColunaSoftware' => (bool) strlen( $filtros['softwares'] | 67 | 'exibirColunaSoftware' => (bool) strlen( $filtros['softwares'] |
70 | 68 | ||
71 | ) | 69 | ) |
72 | ) | 70 | ) |
73 | ); | 71 | ); |
74 | } | 72 | } |
75 | - | ||
76 | } | 73 | } |
src/Cacic/RelatorioBundle/Resources/views/Default/rel_patrimonio.html.twig
@@ -10,10 +10,11 @@ | @@ -10,10 +10,11 @@ | ||
10 | <table class="table table-striped table-bordered"> | 10 | <table class="table table-striped table-bordered"> |
11 | <thead> | 11 | <thead> |
12 | <tr> | 12 | <tr> |
13 | - <th width="20%">{{ "Nome Computador"|trans }}</th> | ||
14 | - <th width="20%">{{ "S.O"|trans }}</th> | ||
15 | - <th width="20%">{{ "I.P"|trans }}</th> | ||
16 | - <th width="20%">{{ "Local"|trans }}</th> | 13 | + <th width="5%" style="text-align: center"></th> |
14 | + <th width="10%">{{ "Nome Computador"|trans }}</th> | ||
15 | + <th width="10%">{{ "S.O"|trans }}</th> | ||
16 | + <th width="20%">{{ "Sub-rede"|trans }}</th> | ||
17 | + <th width="10%">{{ "Local"|trans }}</th> | ||
17 | {% if ( exibirColunaSoftware ) %} | 18 | {% if ( exibirColunaSoftware ) %} |
18 | <th width="20%">{{ "Software"|trans }}</th> | 19 | <th width="20%">{{ "Software"|trans }}</th> |
19 | {% endif %} | 20 | {% endif %} |
@@ -27,6 +28,7 @@ | @@ -27,6 +28,7 @@ | ||
27 | {% for reg in dados %} | 28 | {% for reg in dados %} |
28 | 29 | ||
29 | <tr> | 30 | <tr> |
31 | + <td style="text-align: center">{{ loop.index }}</td> | ||
30 | <td><b> | 32 | <td><b> |
31 | <a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank"> | 33 | <a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank"> |
32 | {{ reg['nmComputador'] }} | 34 | {{ reg['nmComputador'] }} |
@@ -34,7 +36,7 @@ | @@ -34,7 +36,7 @@ | ||
34 | </td> | 36 | </td> |
35 | <td><span class="{% if reg['inMswindows'] == 'S' %}red{% else %}blue{% endif %}">{{ reg['sgSo'] }}</span></td> | 37 | <td><span class="{% if reg['inMswindows'] == 'S' %}red{% else %}blue{% endif %}">{{ reg['sgSo'] }}</span></td> |
36 | <td><a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank"> | 38 | <td><a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank"> |
37 | - {{ reg["teIpRede"] }} | 39 | + {{ reg['teIpRede'] }}/{{ reg['nmRede'] }} |
38 | </a></td> | 40 | </a></td> |
39 | <td>{{ reg['nmLocal'] }}</td> | 41 | <td>{{ reg['nmLocal'] }}</td> |
40 | {% if ( exibirColunaSoftware ) %} | 42 | {% if ( exibirColunaSoftware ) %} |