Skip to content

Commit

Permalink
refactor: adicionando travas de exclusao nos mapeamentos de hipotese …
Browse files Browse the repository at this point in the history
…legal do modulo PEN
  • Loading branch information
NinetiesPaul committed Feb 14, 2024
1 parent 7e226f5 commit a95176b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
12 changes: 8 additions & 4 deletions src/pen_map_hipotese_legal_envio_listar.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@
foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) {

$objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap);
$objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
$resultado = $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
}
}
else {

$objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']);
$objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
$resultado = $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
}

$objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO);

$mensagem = sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO);
if (!$resultado) {
$mensagem = "Não é permitido excluir ou desativar essa hipotese legal";
}
$objPagina->adicionarMensagem($mensagem, InfraPagina::$TIPO_MSG_AVISO);

header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem']));
exit(0);
Expand Down
12 changes: 8 additions & 4 deletions src/pen_map_hipotese_legal_recebimento_listar.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,20 @@
foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) {

$objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap);
$objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
$resultado = $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
}
}
else {

$objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']);
$objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
$resultado = $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO);
}

$objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO);

$mensagem = sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO);
if (!$resultado) {
$mensagem = "Não é permitido excluir ou desativar essa hipotese legal";
}
$objPagina->adicionarMensagem($mensagem, InfraPagina::$TIPO_MSG_AVISO);

header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.htmlspecialchars($_GET['acao_retorno']).'&acao_origem='.htmlspecialchars($_GET['acao_origem'])));
exit(0);
Expand Down
4 changes: 4 additions & 0 deletions src/rn/PenRelHipoteseLegalRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,8 @@ public function getIdHipoteseLegalEmUso(PenRelHipoteseLegalDTO $objFiltroDTO, $s
}
return $arrIdBarramento;
}

public function excluir(PenRelHipoteseLegalDTO $objDTO){
return false;
}
}

0 comments on commit a95176b

Please sign in to comment.