Commit 6576e27a42d9599ebcb2203e3f42d072cfb9584a

Authored by Mauro Santos
1 parent a2e48270
Exists in master

Verificação de notebook

src/Cacic/CommonBundle/Controller/ComputadorController.php
... ... @@ -41,6 +41,7 @@ class ComputadorController extends Controller
41 41 */
42 42 public function detalharAction( $idComputador )
43 43 {
  44 +// $logger = $this->container->get('logger');
44 45 //if ( ! $request->isXmlHttpRequest() ) // Verifica se é uma requisição AJAX
45 46 // throw $this->createNotFoundException( 'Página não encontrada!' );
46 47 $d = $this->getDoctrine();
... ... @@ -53,6 +54,9 @@ class ComputadorController extends Controller
53 54  
54 55 $coleta = $d->getRepository('CacicCommonBundle:ComputadorColeta')->getDadosColetaComputador( $computador );
55 56  
  57 + //$isNotebook = $computador->getIsNotebook();
  58 + //$logger->debug("isNotebook%%%%%%%%%%% $isNotebook");
  59 +
56 60 $dadosColeta = array(); // Inicializa o array que agrupa os dados de coleta por Classe
57 61 $software = array(); // Coloca a coleta de software num array separado
58 62 $listaClasses = array();
... ...
src/Cacic/CommonBundle/Entity/Computador.php
... ... @@ -689,4 +689,33 @@ class Computador
689 689 {
690 690 return $this->software_coletado;
691 691 }
  692 +
  693 + /**
  694 + * @var string
  695 + */
  696 + private $isNotebook;
  697 +
  698 +
  699 + /**
  700 + * Set isNotebook
  701 + *
  702 + * @param string $isNotebook
  703 + * @return Computador
  704 + */
  705 + public function setIsNotebook($isNotebook)
  706 + {
  707 + $this->isNotebook = $isNotebook;
  708 +
  709 + return $this;
  710 + }
  711 +
  712 + /**
  713 + * Get isNotebook
  714 + *
  715 + * @returnn string
  716 + */
  717 + public function getIsNotebook()
  718 + {
  719 + return $this->isNotebook;
  720 + }
692 721 }
693 722 \ No newline at end of file
... ...
src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php
... ... @@ -121,7 +121,7 @@ class ComputadorColetaRepository extends EntityRepository
121 121 public function gerarRelatorioWMIDetalhe( $filtros, $classe )
122 122 {
123 123 $qb = $this->createQueryBuilder('coleta')
124   - ->select('IDENTITY(coleta.computador), property.nmPropertyName, coleta.teClassPropertyValue, comp.nmComputador, comp.teNodeAddress, comp.teIpComputador, so.idSo, so.inMswindows, so.sgSo, rede.idRede, rede.nmRede, rede.teIpRede, local.nmLocal, local.idLocal')
  124 + ->select('IDENTITY(coleta.computador), property.nmPropertyName, coleta.teClassPropertyValue, comp.nmComputador, comp.isNotebook, comp.teNodeAddress, comp.teIpComputador, so.idSo, so.inMswindows, so.sgSo, rede.idRede, rede.nmRede, rede.teIpRede, local.nmLocal, local.idLocal')
125 125 ->innerJoin('coleta.classProperty', 'property')
126 126 ->innerJoin('property.idClass', 'classe')
127 127 ->innerJoin('coleta.computador', 'comp')
... ...
src/Cacic/CommonBundle/Resources/config/doctrine/Computador.orm.yml
... ... @@ -85,6 +85,11 @@ Cacic\CommonBundle\Entity\Computador:
85 85 fixed: true
86 86 nullable: true
87 87 column: dt_debug
  88 + isNotebook:
  89 + type: text
  90 + length: 3
  91 + nullable: true
  92 + column: is_notebook
88 93 oneToMany:
89 94 softwares:
90 95 targetEntity: SoftwareEstacao
... ...
src/Cacic/CommonBundle/Resources/views/Computador/detalhar.html.twig
... ... @@ -29,7 +29,9 @@
29 29 <tbody>
30 30 <tr>
31 31 <th width="20%">{{ 'Nome do Computador'|trans }}</th>
32   - <td colspan="3">{{ computador.nmComputador }}</td>
  32 + <td width="30%">{{ computador.nmComputador }}</td>
  33 + <th width="20%">{{ 'Notebook'|trans }}</th>
  34 + <td width="30%">{{ computador.isNotebook }}</td>
33 35 </tr>
34 36 <tr>
35 37 <th>{{ 'Sistema Operacional'|trans }}</th>
... ...
src/Cacic/RelatorioBundle/Resources/views/Hardware/rel_wmi_detalhe.html.twig
... ... @@ -28,10 +28,11 @@
28 28 <th width="10%">{{ "Local"|trans }}</th>
29 29 <th width="10%">{{ "Subrede"|trans }}</th>
30 30 <th width="10%">{{ "Propriedade"|trans }}</th>
  31 + <th width="10%">{{ "Notebook"|trans }}</th>
31 32 <th>{{ "Valor"|trans }}</th>
32 33 </tr>
33 34 </thead>
34   -
  35 +
35 36 <tbody>
36 37 {% for reg in dados %}
37 38 <tr>
... ... @@ -44,7 +45,9 @@
44 45 <td>{{ reg.nmLocal }}</td>
45 46 <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td>
46 47 <td>{{ reg.nmPropertyName }}</td>
  48 + <td>{{ reg.isNotebook }}</td>
47 49 <td>{{ reg.teClassPropertyValue }}</td>
  50 +
48 51 </tr>
49 52 {% else %}
50 53 <tr>
... ...
src/Cacic/WSBundle/Controller/ColetaController.php
... ... @@ -105,17 +105,24 @@ class ColetaController extends Controller
105 105  
106 106 foreach( $request->request->all() as $strClassName => $strClassValues)
107 107 {
  108 + // Descriptografando os valores da requisição
  109 + $strNewClassValues = OldCacicHelper::deCrypt($request, $strClassValues);
  110 +
108 111 //$teste = OldCacicHelper::deCrypt($request, $strClassValues);
109 112 //$logger->debug("444444444444444444444444444444444444444444444444444444444: $strClassName | \n $teste");
110 113 //$logger->debug("444444444444444444444444444444444444444444444444444444444: $strClassName");
111   - //error_log("444444444444444444444444444444444444444444444444444444: $strClassName");
  114 + //error_log("44444444444444444444444444444444444444444444444444444: $strClassName");
112 115  
  116 + //Verifica se é notebook ou não o computador através da bateria
  117 + if ($strClassName == "isNotebook"){
  118 + $computador->setIsNotebook($strNewClassValues);
  119 + $this->getDoctrine()->getManager()->persist($computador);
  120 + $this->getDoctrine()->getManager()->flush();
  121 + }
113 122  
114 123 // Verifico se o atributo sendo verificado é uma classe de coleta.
115 124 // Se for, insiro os dados da coleta no objeto
116 125 if (in_array($strClassName, $arrClassesNames)) {
117   - // Descriptografando os valores da requisição
118   - $strNewClassValues = OldCacicHelper::deCrypt($request, $strClassValues);
119 126  
120 127 // A propriedade da coleta de software é multi valorada. Preciso tratar diferente
121 128 if ($strClassName == "SoftwareList") {
... ...
web/web 0 → 120000
... ... @@ -0,0 +1 @@
  1 +/srv/cacic/web
0 2 \ No newline at end of file
... ...