mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
bugfixes
This commit is contained in:
@@ -68,21 +68,6 @@ foreach($prestudent_ids as $pid)
|
||||
if(!$prestudent->load($pid))
|
||||
cleanUpAndDie($p->t('tools/studentWurdeNichtGefunden')."(".$pid.")", $tmpDir);
|
||||
|
||||
/*
|
||||
* Deckblatt
|
||||
*/
|
||||
$filename = $tmpDir . "/".uniqid();
|
||||
$doc = new dokument_export('Bewerberakt');
|
||||
$doc->addDataArray(array('vorname' => $prestudent->vorname, 'nachname' => $prestudent->nachname),'bewerberakt');
|
||||
|
||||
if(!$doc->create('pdf'))
|
||||
die($doc->errormsg);
|
||||
// $doc->temp_filename = $filename;
|
||||
$document = $doc->output(false);
|
||||
$filename = $tmpDir.'/'.uniqid();
|
||||
file_put_contents($filename, $document);
|
||||
$doc->close();
|
||||
$allDocs[] = $filename;
|
||||
|
||||
|
||||
/*
|
||||
@@ -100,25 +85,24 @@ foreach($prestudent_ids as $pid)
|
||||
AND prestudent_id='.$db->db_add_param($pid, FHC_INTEGER).';
|
||||
';
|
||||
|
||||
$preDocs = array();
|
||||
$result = $db->db_query($query);
|
||||
while($row = $db->db_fetch_object($result))
|
||||
{
|
||||
|
||||
|
||||
$filename = "";
|
||||
if($row->dms_id != null)
|
||||
if($row->inhalt != null)
|
||||
{
|
||||
$filename = $tmpDir . "/".uniqid();
|
||||
$fileData = base64_decode($row->inhalt);
|
||||
file_put_contents($filename, $fileData);
|
||||
}
|
||||
else if($row->dms_id != null)
|
||||
{
|
||||
$dms = new dms();
|
||||
$dms->load($row->dms_id);
|
||||
|
||||
$filename = DMS_PATH . $dms->filename;
|
||||
}
|
||||
else if($row->inhalt != null)
|
||||
{
|
||||
$filename = $tmpDir . "/".uniqid();
|
||||
$fileData = base64_decode($row->inhalt);
|
||||
file_put_contents($filename, $fileData);
|
||||
}
|
||||
|
||||
|
||||
if($filename == "")
|
||||
@@ -146,16 +130,30 @@ foreach($prestudent_ids as $pid)
|
||||
{
|
||||
$fullFilename = $row->titel;
|
||||
}
|
||||
else
|
||||
cleanUpAndDie("falscher typ TODO", $tmpDir);
|
||||
|
||||
// only filled, if the file is supported
|
||||
if($fullFilename != "")
|
||||
{
|
||||
$allDocs[] = $fullFilename;
|
||||
$preDocs[] = $fullFilename;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Deckblatt
|
||||
*/
|
||||
$filename = $tmpDir . "/".uniqid();
|
||||
$doc = new dokument_export($_GET["vorlage_kurzbz"]);
|
||||
$doc->addDataArray(array('vorname' => $prestudent->vorname, 'nachname' => $prestudent->nachname),"bewerberakt");
|
||||
|
||||
if(!$doc->create('pdf'))
|
||||
die($doc->errormsg);
|
||||
|
||||
$document = $doc->output(false);
|
||||
$filename = $tmpDir.'/'.uniqid();
|
||||
file_put_contents($filename, $document);
|
||||
$doc->close();
|
||||
$allDocs[] = $filename;
|
||||
$allDocs = array_merge($allDocs, $preDocs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ class dokument_export
|
||||
case 'pdf':
|
||||
$this->temp_filename='out.pdf';
|
||||
exec("unoconv -e IsSkipEmptyPages=false --stdout -f pdf $tempname_zip > ".$this->temp_filename, $out, $ret);
|
||||
|
||||
if($ret!=0)
|
||||
{
|
||||
$this->errormsg = 'Dokumentenkonvertierung ist derzeit nicht möglich. Bitte informieren Sie den Administrator';
|
||||
@@ -341,8 +342,9 @@ class dokument_export
|
||||
if($this->styles_xsl!='')
|
||||
unlink('styles.xml');
|
||||
|
||||
unlink('out.zip');
|
||||
unlink($this->temp_filename);
|
||||
if(file_exists("out.zip"))
|
||||
unlink('out.zip');
|
||||
|
||||
if(count($this->images)>0)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ class Pdf
|
||||
}
|
||||
if(finfo_file($finfo, $f) != "application/pdf")
|
||||
{
|
||||
$this->errormsg = "Wrong format: '$f'";
|
||||
$this->errormsg = "Wrong format(".finfo_file($finfo, $f)."): '$f'";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user