mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
add method getWrongFiletypeDocumentContent()
This commit is contained in:
parent
901fcaef5e
commit
efec0c36bf
|
@ -3567,6 +3567,46 @@ class SeedDMS_Core_DMS {
|
||||||
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns document content which has the incorrect file type
|
||||||
|
*
|
||||||
|
* This method is for finding document content with an incorrect
|
||||||
|
* or missing file type. It just checks documents contents
|
||||||
|
* with a certain mime type.
|
||||||
|
* @return bool|SeedDMS_Core_Document[]
|
||||||
|
*/
|
||||||
|
function getWrongFiletypeDocumentContent() { /* {{{ */
|
||||||
|
$queryStr = "SELECT * FROM `tblDocumentContent` WHERE `mimeType` in ('application/pdf', 'image/png', 'image/gif', 'image/jpg')";
|
||||||
|
$resArr = $this->db->getResultArray($queryStr);
|
||||||
|
if ($resArr === false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/** @var SeedDMS_Core_Document[] $versions */
|
||||||
|
$versions = array();
|
||||||
|
foreach($resArr as $row) {
|
||||||
|
$expect = '';
|
||||||
|
switch($row['mimeType']) {
|
||||||
|
case "application/pdf":
|
||||||
|
case "image/png":
|
||||||
|
case "image/gif":
|
||||||
|
case "image/jpg":
|
||||||
|
$expect = substr($row['mimeType'], -3, 3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if($expect) {
|
||||||
|
if($row['fileType'] != '.'.$expect) {
|
||||||
|
/** @var SeedDMS_Core_Document $document */
|
||||||
|
$document = new $this->classnames['document']($row['document'], '', '', '', '', '', '', '', '', '', '', '');
|
||||||
|
$document->setDMS($this);
|
||||||
|
$version = new $this->classnames['documentcontent']($row['id'], $document, $row['version'], $row['comment'], $row['date'], $row['createdBy'], $row['dir'], $row['orgFileName'], $row['fileType'], $row['mimeType'], $row['fileSize'], $row['checksum']);
|
||||||
|
$versions[] = $version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $versions;
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns document content which is duplicated
|
* Returns document content which is duplicated
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user