From b51a083517d8e6a394f0613449cf2b28d049e164 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Wed, 13 Aug 2014 16:37:24 -0400 Subject: [PATCH] ProcessMaker-BE "FilesManager - Correccion de bug en deleteProcessFilesManager()" - Correccion de bug en deleteProcessFilesManager() --- .../ProcessMaker/BusinessModel/FilesManager.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php b/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php index e10995b0e..2953a3ba1 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/FilesManager.php @@ -412,17 +412,11 @@ class FilesManager if ($path == '') { throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('prf_uid'))); } - $sFile = end(explode("/",$path)); - $sPath = str_replace($sFile,'',$path); - $sSubDirectory = substr(str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))),0,-1); - $sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath); - if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) { - $sMainDirectory = 'mailTemplates'; - } else { - $sMainDirectory = 'public'; + + if (file_exists($path)) { + unlink($path); } - $oProcessMap = new \processMap(new \DBConnection()); - $oProcessMap->deleteFile($sProcessUID, $sMainDirectory, $sSubDirectory, $sFile); + $rs = \ProcessFilesPeer::doDelete($criteria); } catch (Exception $e) { throw $e;