mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
all file operations use methods of SeedDMS_Core_File
This commit is contained in:
parent
820370d713
commit
d06f33abeb
|
@ -2013,7 +2013,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
}
|
||||
foreach($resArr as $res) {
|
||||
$file = $this->_dms->contentDir . $this->getDir().'r'.$res['reviewLogID'];
|
||||
if(file_exists($file))
|
||||
if(SeedDMS_Core_File::file_exists($file))
|
||||
SeedDMS_Core_File::removeFile($file);
|
||||
}
|
||||
}
|
||||
|
@ -2042,7 +2042,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
}
|
||||
foreach($resArr as $res) {
|
||||
$file = $this->_dms->contentDir . $this->getDir().'a'.$res['approveLogID'];
|
||||
if(file_exists($file))
|
||||
if(SeedDMS_Core_File::file_exists($file))
|
||||
SeedDMS_Core_File::removeFile($file);
|
||||
}
|
||||
}
|
||||
|
@ -2085,7 +2085,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
return false;
|
||||
}
|
||||
|
||||
if (file_exists( $this->_dms->contentDir.$version->getPath() ))
|
||||
if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir.$version->getPath() ))
|
||||
if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir.$version->getPath() )) {
|
||||
$db->rollbackTransaction();
|
||||
return false;
|
||||
|
@ -2447,7 +2447,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
return false;
|
||||
}
|
||||
|
||||
if (file_exists( $this->_dms->contentDir . $file->getPath() )){
|
||||
if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir . $file->getPath() )){
|
||||
if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir . $file->getPath() )) {
|
||||
$db->rollbackTransaction();
|
||||
return false;
|
||||
|
@ -2514,7 +2514,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
|||
|
||||
// TODO: versioning file?
|
||||
|
||||
if (file_exists( $this->_dms->contentDir . $this->getDir() ))
|
||||
if (SeedDMS_Core_File::file_exists( $this->_dms->contentDir . $this->getDir() ))
|
||||
if (!SeedDMS_Core_File::removeDir( $this->_dms->contentDir . $this->getDir() )) {
|
||||
$db->rollbackTransaction();
|
||||
return false;
|
||||
|
@ -3665,7 +3665,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
}
|
||||
foreach($res as &$t) {
|
||||
$filename = $this->_dms->contentDir . $this->_document->getDir().'r'.$t['reviewLogID'];
|
||||
if(file_exists($filename))
|
||||
if(SeedDMS_Core_File::file_exists($filename))
|
||||
$t['file'] = $filename;
|
||||
else
|
||||
$t['file'] = '';
|
||||
|
@ -3845,7 +3845,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
}
|
||||
foreach($res as &$t) {
|
||||
$filename = $this->_dms->contentDir . $this->_document->getDir().'a'.$t['approveLogID'];
|
||||
if(file_exists($filename))
|
||||
if(SeedDMS_Core_File::file_exists($filename))
|
||||
$t['file'] = $filename;
|
||||
else
|
||||
$t['file'] = '';
|
||||
|
@ -5460,7 +5460,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
$dms = $this->_document->getDMS();
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
if(file_exists($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType)) {
|
||||
if(SeedDMS_Core_File::file_exists($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType)) {
|
||||
if(strlen($this->_fileType) < 2) {
|
||||
switch($this->_mimeType) {
|
||||
case "application/pdf":
|
||||
|
@ -5485,7 +5485,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
break;
|
||||
}
|
||||
}
|
||||
} elseif(file_exists($this->_document->getDir() . $this->_version . '.')) {
|
||||
} elseif(SeedDMS_Core_File::file_exists($this->_document->getDir() . $this->_version . '.')) {
|
||||
echo "no file";
|
||||
} else {
|
||||
echo $this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType;
|
||||
|
|
Loading…
Reference in New Issue
Block a user