mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
raw content can be set for files added to archive
Setting the raw content will take the meta data from the document content but use the file content as passed by the third optional parameter of addItem()
This commit is contained in:
parent
3a615b6e06
commit
d7af33f579
|
@ -51,6 +51,7 @@ class SeedDMS_Download_Mgr {
|
|||
$this->items = array();
|
||||
$this->header = array('Dokumenten-Nr.', 'Dokumentenname', 'Dateiname', 'Status', 'Int. Version', 'Prüfer', 'Prüfdatum', 'Prüfkommentar', 'Prüfstatus', 'Freigeber', 'Freigabedatum', 'Freigabekommentar', 'Freigabestatus');
|
||||
$this->extracols = array();
|
||||
$this->rawcontents = array();
|
||||
$this->extraheader = array();
|
||||
}
|
||||
|
||||
|
@ -58,9 +59,10 @@ class SeedDMS_Download_Mgr {
|
|||
$this->extraheader = $extraheader;
|
||||
} /* }}} */
|
||||
|
||||
public function addItem($item, $extracols) { /* {{{ */
|
||||
public function addItem($item, $extracols=array(), $rawcontent='') { /* {{{ */
|
||||
$this->items[$item->getID()] = $item;
|
||||
$this->extracols[$item->getID()] = $extracols;
|
||||
$this->rawcontents[$item->getID()] = $rawcontent;
|
||||
} /* }}} */
|
||||
|
||||
public function createToc($file) { /* {{{ */
|
||||
|
@ -193,7 +195,10 @@ class SeedDMS_Download_Mgr {
|
|||
$filename = preg_replace('/[^A-Za-z0-9_-]/', '_', $document->getName()).'.'.$oext;
|
||||
}
|
||||
$filename = $prefixdir."/".$document->getID().'-'.$item->getVersion().'-'.$filename; //$lc->getOriginalFileName();
|
||||
$zip->addFile($dms->contentDir.$item->getPath(), utf8_decode($filename));
|
||||
if($this->rawcontents[$item->getID()]) {
|
||||
$zip->addFromString(utf8_decode($filename), $this->rawcontents[$item->getID()]);
|
||||
} else
|
||||
$zip->addFile($dms->contentDir.$item->getPath(), utf8_decode($filename));
|
||||
}
|
||||
|
||||
$zip->addFile($file, $prefixdir."/metadata.xls");
|
||||
|
|
Loading…
Reference in New Issue
Block a user