Commit 6a12a3d22fb61d994828af55347ed6801be3e1e6
1 parent
01c83dba
Exists in
master
and in
1 other branch
[Refact] Refazendo download de documento.
Showing
1 changed file
with
15 additions
and
13 deletions
Show diff stats
rn/MdWsSeiDocumentoRN.php
... | ... | @@ -307,23 +307,25 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
307 | 307 | throw new InfraException('Documento sem conteúdo!'); |
308 | 308 | } |
309 | 309 | }else{ |
310 | - $documentoDTOAssinatura = new DocumentoDTO(); | |
311 | - $documentoDTOAssinatura->retStrConteudoAssinatura(); | |
312 | - $documentoDTOAssinatura->setDblIdDocumento($protocoloDTOParam->getDblIdProtocolo()); | |
310 | + $documentoDTO = new DocumentoDTO(); | |
311 | + $documentoDTO->setDblIdDocumento($protocoloDTOParam->getDblIdProtocolo()); | |
312 | + $documentoDTO->setObjInfraSessao(SessaoSEI::getInstance()); | |
313 | + $documentoDTO->setStrLinkDownload('controlador.php?acao=documento_download_anexo'); | |
313 | 314 | |
314 | - $documentoRN = new DocumentoRN(); | |
315 | - $documentoDTOAssinatura = $documentoRN->consultarRN0005($documentoDTOAssinatura); | |
316 | - $html = $documentoDTOAssinatura->getStrConteudoAssinatura(); | |
315 | + $html = $documentoRN->consultarHtmlFormulario($documentoDTO); | |
317 | 316 | |
318 | - AuditoriaSEI::getInstance()->auditar('documento_visualizar'); | |
317 | + $aditoriaProtocoloDTO = new AuditoriaProtocoloDTO(); | |
318 | + $aditoriaProtocoloDTO->setStrRecurso('visualizar_documento'); | |
319 | + $aditoriaProtocoloDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
320 | + $aditoriaProtocoloDTO->setDblIdProtocolo($protocoloDTOParam->getDblIdProtocolo()); | |
321 | + $aditoriaProtocoloDTO->setNumIdAnexo(null); | |
322 | + $aditoriaProtocoloDTO->setDtaAuditoria(InfraData::getStrDataAtual()); | |
323 | + $aditoriaProtocoloDTO->setNumVersao(null); | |
319 | 324 | |
320 | - $strNomeDownload = $documentoDTO->getStrProtocoloDocumentoFormatado().'_'.$documentoDTO->getStrNomeSerie(); | |
321 | - if (!InfraString::isBolVazia($documentoDTO->getStrNumero())) { | |
322 | - $strNomeDownload .= '_' .$documentoDTO->getStrNumero(); | |
323 | - } | |
325 | + $aditoriaProtocoloRN = new AuditoriaProtocoloRN(); | |
326 | + $aditoriaProtocoloRN->auditarVisualizacao($aditoriaProtocoloDTO); | |
324 | 327 | |
325 | - var_dump($html);exit; | |
326 | - InfraPagina::montarHeaderDownload($strNomeDownload.'.html', 'attachment'); | |
328 | + InfraPagina::montarHeaderDownload(null, null, 'Content-Type: text/html; charset=iso-8859-1'); | |
327 | 329 | die($html); |
328 | 330 | } |
329 | 331 | }catch (Exception $e){ | ... | ... |