use SeedDMS_Core_Document::isType() to check for documents

This commit is contained in:
Uwe Steinmann 2020-04-01 18:29:48 +02:00
parent c69490daba
commit 48cc8d80e8

View File

@ -83,7 +83,7 @@ $(document).ready( function() {
if($extraheader = $this->callHook('extraDownloadHeader'))
$downmgr->addHeader($extraheader);
foreach($entries as $entry) {
if(get_class($entry) == $dms->getClassname('document')) {
if($entry->isType('document')) {
$extracols = $this->callHook('extraDownloadColumns', $entry);
if(isset($_GET['includecontent']) && $_GET['includecontent'] && $rawcontent = $this->callHook('rawcontent', $entry->getLatestContent())) {
$downmgr->addItem($entry->getLatestContent(), $extracols, $rawcontent);
@ -156,10 +156,10 @@ $(document).ready( function() {
if($showsinglesearchhit && count($entries) == 1) {
$entry = $entries[0];
if(get_class($entry) == $dms->getClassname('document')) {
if($entry->isType('document')) {
header('Location: ../out/out.ViewDocument.php?documentid='.$entry->getID());
exit;
} elseif(get_class($entry) == $dms->getClassname('folder')) {
} elseif($entry->isType('folder')) {
header('Location: ../out/out.ViewFolder.php?folderid='.$entry->getID());
exit;
}