mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
XML für Dokumentenvorlagen werden automatisch erweitert um die
Information ob das Dokument anschließend signiert wird.
This commit is contained in:
+10
-22
@@ -319,22 +319,14 @@ if (!isset($_REQUEST["archive"]))
|
||||
|
||||
$dokument->setFilename($filename);
|
||||
|
||||
if (!$dokument->create($output))
|
||||
die($dokument->errormsg);
|
||||
|
||||
if ($sign === true)
|
||||
{
|
||||
if ($dokument->sign($user))
|
||||
{
|
||||
$dokument->output();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $dokument->errormsg;
|
||||
}
|
||||
$dokument->sign($user);
|
||||
}
|
||||
else
|
||||
|
||||
if ($dokument->create($output))
|
||||
$dokument->output();
|
||||
|
||||
$dokument->close();
|
||||
}
|
||||
}
|
||||
@@ -413,18 +405,14 @@ else
|
||||
|
||||
if ($sign === true)
|
||||
{
|
||||
if ($dokument->sign($user))
|
||||
{
|
||||
$doc = $dokument->output(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$errormsg = $dokument->errormsg;
|
||||
}
|
||||
$dokument->sign($user);
|
||||
}
|
||||
else
|
||||
|
||||
if ($dokument->create($output))
|
||||
$doc = $dokument->output(false);
|
||||
else
|
||||
$error = true;
|
||||
|
||||
$dokument->close();
|
||||
|
||||
if(!$error)
|
||||
|
||||
@@ -127,7 +127,8 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
<label value="Dokument" control="student-zeugnis-menulist-dokument"/>
|
||||
<menulist id="student-zeugnis-menulist-dokument"
|
||||
datasources="../rdf/vorlage.rdf.php" flex="1"
|
||||
ref="http://www.technikum-wien.at/vorlage" >
|
||||
ref="http://www.technikum-wien.at/vorlage"
|
||||
style="min-width:300px" >
|
||||
<template>
|
||||
<menupopup>
|
||||
<menuitem value="rdf:http://www.technikum-wien.at/vorlage/rdf#vorlage_kurzbz"
|
||||
|
||||
@@ -38,6 +38,9 @@ class dokument_export
|
||||
private $sourceDir;
|
||||
public $errormsg;
|
||||
private $unoconv_version;
|
||||
private $sign;
|
||||
private $sign_user;
|
||||
private $sign_profile;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -299,6 +302,9 @@ class dokument_export
|
||||
|
||||
}
|
||||
|
||||
if($this->sign)
|
||||
return $this->_sign();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -476,12 +482,26 @@ class dokument_export
|
||||
}
|
||||
|
||||
/**
|
||||
* Schickt das Dokument an den Signaturserver um dieses mit einer Amtssignatur zu versehen
|
||||
* Es koennen nur PDFs signiert werden
|
||||
* Markiert das Dokument zur Signatur
|
||||
* Fuegt automatisch einen XML Tag fuer Signatur zun Dokument hinzu
|
||||
* @param $user User der die Signatur erstellen will
|
||||
* @param $profile Signaturprofil mit der das Dokument signiert werden soll (Optional)
|
||||
*/
|
||||
public function sign($user, $profile = null)
|
||||
{
|
||||
$this->sign = true;
|
||||
$this->sign_user = $user;
|
||||
$this->sign_profile = $profile;
|
||||
|
||||
$signblock = $this->xml_data->createElement("signed","true");
|
||||
$this->xml_data->documentElement->appendChild($signblock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schickt das Dokument an den Signaturserver um dieses mit einer Amtssignatur zu versehen
|
||||
* Es koennen nur PDFs signiert werden
|
||||
*/
|
||||
private function _sign()
|
||||
{
|
||||
if($this->outputformat != 'pdf')
|
||||
{
|
||||
@@ -496,13 +516,13 @@ class dokument_export
|
||||
$data->document = base64_encode($file_data);
|
||||
|
||||
// Signatur Profil
|
||||
if(!is_null($profile))
|
||||
$data->profile = $profile;
|
||||
if(!is_null($this->sign_profile))
|
||||
$data->profile = $this->sign_profile;
|
||||
else
|
||||
$data->profile = SIGNATUR_DEFAULT_PROFILE;
|
||||
|
||||
// Username des Endusers der die Signatur angefordert hat
|
||||
$data->user = $user;
|
||||
$data->user = $this->sign_user;
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user