Commit 6576e27a42d9599ebcb2203e3f42d072cfb9584a
1 parent
a2e48270
Exists in
master
Verificação de notebook
Showing
8 changed files
with
57 additions
and
6 deletions
Show diff stats
src/Cacic/CommonBundle/Controller/ComputadorController.php
| @@ -41,6 +41,7 @@ class ComputadorController extends Controller | @@ -41,6 +41,7 @@ class ComputadorController extends Controller | ||
| 41 | */ | 41 | */ |
| 42 | public function detalharAction( $idComputador ) | 42 | public function detalharAction( $idComputador ) |
| 43 | { | 43 | { |
| 44 | +// $logger = $this->container->get('logger'); | ||
| 44 | //if ( ! $request->isXmlHttpRequest() ) // Verifica se é uma requisição AJAX | 45 | //if ( ! $request->isXmlHttpRequest() ) // Verifica se é uma requisição AJAX |
| 45 | // throw $this->createNotFoundException( 'Página não encontrada!' ); | 46 | // throw $this->createNotFoundException( 'Página não encontrada!' ); |
| 46 | $d = $this->getDoctrine(); | 47 | $d = $this->getDoctrine(); |
| @@ -53,6 +54,9 @@ class ComputadorController extends Controller | @@ -53,6 +54,9 @@ class ComputadorController extends Controller | ||
| 53 | 54 | ||
| 54 | $coleta = $d->getRepository('CacicCommonBundle:ComputadorColeta')->getDadosColetaComputador( $computador ); | 55 | $coleta = $d->getRepository('CacicCommonBundle:ComputadorColeta')->getDadosColetaComputador( $computador ); |
| 55 | 56 | ||
| 57 | + //$isNotebook = $computador->getIsNotebook(); | ||
| 58 | + //$logger->debug("isNotebook%%%%%%%%%%% $isNotebook"); | ||
| 59 | + | ||
| 56 | $dadosColeta = array(); // Inicializa o array que agrupa os dados de coleta por Classe | 60 | $dadosColeta = array(); // Inicializa o array que agrupa os dados de coleta por Classe |
| 57 | $software = array(); // Coloca a coleta de software num array separado | 61 | $software = array(); // Coloca a coleta de software num array separado |
| 58 | $listaClasses = array(); | 62 | $listaClasses = array(); |
src/Cacic/CommonBundle/Entity/Computador.php
| @@ -689,4 +689,33 @@ class Computador | @@ -689,4 +689,33 @@ class Computador | ||
| 689 | { | 689 | { |
| 690 | return $this->software_coletado; | 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 | \ No newline at end of file | 722 | \ No newline at end of file |
src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php
| @@ -121,7 +121,7 @@ class ComputadorColetaRepository extends EntityRepository | @@ -121,7 +121,7 @@ class ComputadorColetaRepository extends EntityRepository | ||
| 121 | public function gerarRelatorioWMIDetalhe( $filtros, $classe ) | 121 | public function gerarRelatorioWMIDetalhe( $filtros, $classe ) |
| 122 | { | 122 | { |
| 123 | $qb = $this->createQueryBuilder('coleta') | 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 | ->innerJoin('coleta.classProperty', 'property') | 125 | ->innerJoin('coleta.classProperty', 'property') |
| 126 | ->innerJoin('property.idClass', 'classe') | 126 | ->innerJoin('property.idClass', 'classe') |
| 127 | ->innerJoin('coleta.computador', 'comp') | 127 | ->innerJoin('coleta.computador', 'comp') |
src/Cacic/CommonBundle/Resources/config/doctrine/Computador.orm.yml
| @@ -85,6 +85,11 @@ Cacic\CommonBundle\Entity\Computador: | @@ -85,6 +85,11 @@ Cacic\CommonBundle\Entity\Computador: | ||
| 85 | fixed: true | 85 | fixed: true |
| 86 | nullable: true | 86 | nullable: true |
| 87 | column: dt_debug | 87 | column: dt_debug |
| 88 | + isNotebook: | ||
| 89 | + type: text | ||
| 90 | + length: 3 | ||
| 91 | + nullable: true | ||
| 92 | + column: is_notebook | ||
| 88 | oneToMany: | 93 | oneToMany: |
| 89 | softwares: | 94 | softwares: |
| 90 | targetEntity: SoftwareEstacao | 95 | targetEntity: SoftwareEstacao |
src/Cacic/CommonBundle/Resources/views/Computador/detalhar.html.twig
| @@ -29,7 +29,9 @@ | @@ -29,7 +29,9 @@ | ||
| 29 | <tbody> | 29 | <tbody> |
| 30 | <tr> | 30 | <tr> |
| 31 | <th width="20%">{{ 'Nome do Computador'|trans }}</th> | 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 | </tr> | 35 | </tr> |
| 34 | <tr> | 36 | <tr> |
| 35 | <th>{{ 'Sistema Operacional'|trans }}</th> | 37 | <th>{{ 'Sistema Operacional'|trans }}</th> |
src/Cacic/RelatorioBundle/Resources/views/Hardware/rel_wmi_detalhe.html.twig
| @@ -28,10 +28,11 @@ | @@ -28,10 +28,11 @@ | ||
| 28 | <th width="10%">{{ "Local"|trans }}</th> | 28 | <th width="10%">{{ "Local"|trans }}</th> |
| 29 | <th width="10%">{{ "Subrede"|trans }}</th> | 29 | <th width="10%">{{ "Subrede"|trans }}</th> |
| 30 | <th width="10%">{{ "Propriedade"|trans }}</th> | 30 | <th width="10%">{{ "Propriedade"|trans }}</th> |
| 31 | + <th width="10%">{{ "Notebook"|trans }}</th> | ||
| 31 | <th>{{ "Valor"|trans }}</th> | 32 | <th>{{ "Valor"|trans }}</th> |
| 32 | </tr> | 33 | </tr> |
| 33 | </thead> | 34 | </thead> |
| 34 | - | 35 | + |
| 35 | <tbody> | 36 | <tbody> |
| 36 | {% for reg in dados %} | 37 | {% for reg in dados %} |
| 37 | <tr> | 38 | <tr> |
| @@ -44,7 +45,9 @@ | @@ -44,7 +45,9 @@ | ||
| 44 | <td>{{ reg.nmLocal }}</td> | 45 | <td>{{ reg.nmLocal }}</td> |
| 45 | <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td> | 46 | <td>{{ reg.nmRede }} / {{ reg.teIpRede }}</td> |
| 46 | <td>{{ reg.nmPropertyName }}</td> | 47 | <td>{{ reg.nmPropertyName }}</td> |
| 48 | + <td>{{ reg.isNotebook }}</td> | ||
| 47 | <td>{{ reg.teClassPropertyValue }}</td> | 49 | <td>{{ reg.teClassPropertyValue }}</td> |
| 50 | + | ||
| 48 | </tr> | 51 | </tr> |
| 49 | {% else %} | 52 | {% else %} |
| 50 | <tr> | 53 | <tr> |
src/Cacic/WSBundle/Controller/ColetaController.php
| @@ -105,17 +105,24 @@ class ColetaController extends Controller | @@ -105,17 +105,24 @@ class ColetaController extends Controller | ||
| 105 | 105 | ||
| 106 | foreach( $request->request->all() as $strClassName => $strClassValues) | 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 | //$teste = OldCacicHelper::deCrypt($request, $strClassValues); | 111 | //$teste = OldCacicHelper::deCrypt($request, $strClassValues); |
| 109 | //$logger->debug("444444444444444444444444444444444444444444444444444444444: $strClassName | \n $teste"); | 112 | //$logger->debug("444444444444444444444444444444444444444444444444444444444: $strClassName | \n $teste"); |
| 110 | //$logger->debug("444444444444444444444444444444444444444444444444444444444: $strClassName"); | 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 | // Verifico se o atributo sendo verificado é uma classe de coleta. | 123 | // Verifico se o atributo sendo verificado é uma classe de coleta. |
| 115 | // Se for, insiro os dados da coleta no objeto | 124 | // Se for, insiro os dados da coleta no objeto |
| 116 | if (in_array($strClassName, $arrClassesNames)) { | 125 | if (in_array($strClassName, $arrClassesNames)) { |
| 117 | - // Descriptografando os valores da requisição | ||
| 118 | - $strNewClassValues = OldCacicHelper::deCrypt($request, $strClassValues); | ||
| 119 | 126 | ||
| 120 | // A propriedade da coleta de software é multi valorada. Preciso tratar diferente | 127 | // A propriedade da coleta de software é multi valorada. Preciso tratar diferente |
| 121 | if ($strClassName == "SoftwareList") { | 128 | if ($strClassName == "SoftwareList") { |