Commit 3a24f9f7fe92cd2d6f94aa3826d04d6834694111

Authored by Eduardo Santos
2 parents d82d3373 acc1f019
Exists in master and in 1 other branch 3.1

Merge remote-tracking branch 'origin/master'

.gitignore
... ... @@ -19,6 +19,8 @@ composer.phar
19 19 # Ignore SVN
20 20 *.svn
21 21 .*.swp
  22 +.*.swo
  23 +.*.save
22 24 *~
23 25  
24 26 # Ignora toda a pasta Web
... ...
src/Cacic/CommonBundle/Entity/SoftwareRepository.php
... ... @@ -227,22 +227,23 @@ class SoftwareRepository extends EntityRepository
227 227 {
228 228 // Monta a Consulta básica...
229 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 235 ->leftJoin('CacicCommonBundle:So', 'so','WITH','comp.idSo = so.idSo')
234 236 ->leftJoin('CacicCommonBundle:Rede', 'r','WITH', 'comp.idRede = r.idRede')
235 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 242 * Verifica os filtros que foram parametrizados
242 243 */
243 244  
244 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 248 if ( array_key_exists('locais', $filtros) && !empty($filtros['locais']) )
248 249 $qb->andWhere('l.idLocal IN (:locais)')->setParameter('locais', explode( ',', $filtros['locais'] ));
... ... @@ -250,8 +251,9 @@ class SoftwareRepository extends EntityRepository
250 251 if ( array_key_exists('so', $filtros) && !empty($filtros['so']) )
251 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 258 return $qb->getQuery()->execute();
257 259 }
... ...
src/Cacic/CommonBundle/Form/Type/UsbDeviceType.php
... ... @@ -19,7 +19,7 @@ class UsbDeviceType extends AbstractType
19 19 $builder->add('idUsbVendor', 'entity',
20 20 array(
21 21 'empty_value' => 'Selecione o Fabricante',
22   - 'required' => false,
  22 + 'required' => true,
23 23 'class' => 'CacicCommonBundle:UsbVendor',
24 24 'property' => 'nmUsbVendor',
25 25 'label'=>'Identificador do Fabricante')
... ...
src/Cacic/CommonBundle/Resources/views/UorgType/index.html.twig
... ... @@ -41,7 +41,7 @@
41 41 </tr>
42 42 {% else %}
43 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 45 </tr>
46 46 {% endfor %}
47 47 </tbody>
... ...
src/Cacic/RelatorioBundle/Controller/DefaultController.php
... ... @@ -57,20 +57,17 @@ class DefaultController extends Controller
57 57 ->getRepository('CacicCommonBundle:Software')
58 58 ->gerarRelatorioPatrimonio( $filtros );
59 59  
60   -
61   -
62   -
  60 + // Debug::dump($filtros);die;
63 61 return $this->render(
64 62 'CacicRelatorioBundle:Default:rel_patrimonio.html.twig',
65 63 array(
66 64 'idioma'=>$locale,
67   - 'dados' => $dados,
68   - 'menu' => (bool) strlen( $filtros['pci']),
  65 + 'dados' => $dados,/*
  66 + 'menu' => (bool) strlen( $filtros['pci']),*/
69 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 <table class="table table-striped table-bordered">
11 11 <thead>
12 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 18 {% if ( exibirColunaSoftware ) %}
18 19 <th width="20%">{{ "Software"|trans }}</th>
19 20 {% endif %}
... ... @@ -27,6 +28,7 @@
27 28 {% for reg in dados %}
28 29  
29 30 <tr>
  31 + <td style="text-align: center">{{ loop.index }}</td>
30 32 <td><b>
31 33 <a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank">
32 34 {{ reg['nmComputador'] }}
... ... @@ -34,7 +36,7 @@
34 36 </td>
35 37 <td><span class="{% if reg['inMswindows'] == 'S' %}red{% else %}blue{% endif %}">{{ reg['sgSo'] }}</span></td>
36 38 <td><a href="{{ path("cacic_computador_detalhar") }}/{{ reg['idComputador'] }}" target="_blank">
37   - {{ reg["teIpRede"] }}
  39 + {{ reg['teIpRede'] }}/{{ reg['nmRede'] }}
38 40 </a></td>
39 41 <td>{{ reg['nmLocal'] }}</td>
40 42 {% if ( exibirColunaSoftware ) %}
... ...