<?php use_helper('UrlFunctions'); ?>
<?php

if(isset($delete)){
  if($id){
    $o_DocumentoBean = new DocumentoBean();
    $o_DocumentoBean->setIdDocumento($id);
    
    $o_DocumentoBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_DocumentoSystemClass = new DocumentoSystemClass($o_DocumentoBean);
    $bResult = $o_DocumentoSystemClass->eliminarDocumento();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('tid/list')?>','001&delete=1&cod=<?=$o_DocumentoBean->getIdDocumento()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('tid/delete', "block=".$block."&error=1");
    }
  } 
}
