mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-16 14:41:39 +00:00
add download of documents
This commit is contained in:
parent
a178ab9bc0
commit
394a23fa57
|
@ -28,12 +28,29 @@ class SeedDMS_Controller_TransmittalDownload extends SeedDMS_Controller_Common {
|
||||||
$transmittal = $this->params['transmittal'];
|
$transmittal = $this->params['transmittal'];
|
||||||
|
|
||||||
$items = $transmittal->getItems();
|
$items = $transmittal->getItems();
|
||||||
foreach($items as $item) {
|
if($items) {
|
||||||
$content = $item->getContent();
|
include("../inc/inc.ClassDownloadMgr.php");
|
||||||
$document = $content->getDocument();
|
$downmgr = new SeedDMS_Download_Mgr();
|
||||||
if ($document->getAccessMode($user) >= M_READ) {
|
|
||||||
echo $document->getName();
|
foreach($items as $item) {
|
||||||
|
$content = $item->getContent();
|
||||||
|
$document = $content->getDocument();
|
||||||
|
if ($document->getAccessMode($user) >= M_READ) {
|
||||||
|
$downmgr->addItem($content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filename = tempnam('/tmp', '');
|
||||||
|
$downmgr->createArchive($filename);
|
||||||
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
header("Content-Length: " . filesize($filename));
|
||||||
|
header("Content-Disposition: attachment; filename=\"export-" .date('Y-m-d') . ".zip\"");
|
||||||
|
header("Content-Type: application/zip");
|
||||||
|
header("Cache-Control: must-revalidate");
|
||||||
|
|
||||||
|
readfile($filename);
|
||||||
|
unlink($filename);
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user