mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
PDF-Export prueft ob style in DB vorhanden
Wenn in der DB ein style hinterlegt ist, wird dieses verwendet, ansonsten das xsl-style, welches übergeben wird.
This commit is contained in:
+36
-16
@@ -341,14 +341,24 @@ if (!isset($_REQUEST["archive"]))
|
||||
|
||||
// Wenn ein Style XSL uebergeben wurde wird ein zweites XML File erstellt mit den
|
||||
// Styleanweisungen und ebenfalls zum Zip hinzugefuegt
|
||||
if(isset($_GET['style_xsl']))
|
||||
if(isset($_GET['style_xsl']) || $vorlage->style!='')
|
||||
{
|
||||
$style_xsl=$_GET['style_xsl'];
|
||||
$style_vorlage = new vorlage();
|
||||
$style_vorlage->getAktuelleVorlage($xsl_stg_kz, $style_xsl, $version);
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($style_vorlage->text))
|
||||
die('unable to load xsl');
|
||||
//Wenn die Spalte style in der DB befuellt ist, wird dieses verwendet
|
||||
if($vorlage->style!='')
|
||||
{
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($vorlage->style))
|
||||
die('unable to load xsl from tbl_vorlagestudiengang');
|
||||
}
|
||||
else
|
||||
{
|
||||
$style_xsl=$_GET['style_xsl'];
|
||||
$style_vorlage = new vorlage();
|
||||
$style_vorlage->getAktuelleVorlage($xsl_stg_kz, $style_xsl, $version);
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($style_vorlage->text))
|
||||
die('unable to load xsl');
|
||||
}
|
||||
|
||||
// Configure the transformer
|
||||
$style_proc = new XSLTProcessor;
|
||||
@@ -380,7 +390,7 @@ if (!isset($_REQUEST["archive"]))
|
||||
if(copy($zipfile, $tempname_zip))
|
||||
{
|
||||
exec("zip $tempname_zip content.xml");
|
||||
if(isset($_GET['style_xsl']))
|
||||
if(isset($_GET['style_xsl']) || $vorlage->style!='')
|
||||
exec("zip $tempname_zip styles.xml");
|
||||
|
||||
clearstatcache();
|
||||
@@ -464,7 +474,7 @@ if (!isset($_REQUEST["archive"]))
|
||||
fclose($handle);
|
||||
|
||||
unlink('content.xml');
|
||||
if(isset($_GET['style_xsl']))
|
||||
if(isset($_GET['style_xsl']) || $vorlage->style!='')
|
||||
unlink('styles.xml');
|
||||
unlink($tempname_zip);
|
||||
if($output=='pdf' || $output=='doc')
|
||||
@@ -595,12 +605,22 @@ else
|
||||
// Styleanweisungen und ebenfalls zum Zip hinzugefuegt
|
||||
if(isset($_GET['style_xsl']))
|
||||
{
|
||||
$style_xsl=$_GET['style_xsl'];
|
||||
$style_vorlage = new vorlage();
|
||||
$style_vorlage->getAktuelleVorlage($xsl_stg_kz, $style_xsl, $version);
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($style_vorlage->text))
|
||||
die('unable to load xsl');
|
||||
//Wenn die Spalte style in der DB befuellt ist, wird dieses verwendet
|
||||
if($vorlage->style!='')
|
||||
{
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($vorlage->style))
|
||||
die('unable to load xsl from tbl_vorlagestudiengang');
|
||||
}
|
||||
else
|
||||
{
|
||||
$style_xsl=$_GET['style_xsl'];
|
||||
$style_vorlage = new vorlage();
|
||||
$style_vorlage->getAktuelleVorlage($xsl_stg_kz, $style_xsl, $version);
|
||||
$style_xsl_doc = new DOMDocument;
|
||||
if(!$style_xsl_doc->loadXML($style_vorlage->text))
|
||||
die('unable to load xsl');
|
||||
}
|
||||
|
||||
// Configure the transformer
|
||||
$style_proc = new XSLTProcessor;
|
||||
@@ -632,7 +652,7 @@ else
|
||||
if(copy($zipfile, $tempname_zip))
|
||||
{
|
||||
exec("zip $tempname_zip content.xml");
|
||||
if(isset($_GET['style_xsl']))
|
||||
if(isset($_GET['style_xsl']) || $vorlage->style!='')
|
||||
exec("zip $tempname_zip styles.xml");
|
||||
|
||||
clearstatcache();
|
||||
|
||||
@@ -240,12 +240,15 @@ class vorlage extends basis_db
|
||||
*/
|
||||
public function getOEsFromVorlage($vorlage_kurzbz=null)
|
||||
{
|
||||
$qry ="SELECT
|
||||
oe_kurzbz
|
||||
$qry ="SELECT DISTINCT
|
||||
tbl_organisationseinheit.*
|
||||
FROM
|
||||
public.tbl_vorlagestudiengang
|
||||
JOIN
|
||||
public.tbl_organisationseinheit USING (oe_kurzbz)
|
||||
WHERE
|
||||
vorlage_kurzbz=".$this->db_add_param($vorlage_kurzbz);
|
||||
vorlage_kurzbz=".$this->db_add_param($vorlage_kurzbz)."
|
||||
ORDER BY oe_kurzbz";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
@@ -253,6 +256,12 @@ class vorlage extends basis_db
|
||||
{
|
||||
$obj = new vorlage();
|
||||
$obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$obj->oe_parent_kurzbz = $row->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
$obj->mailverteiler = $this->db_parse_bool($row->mailverteiler);
|
||||
$obj->lehre = $this->db_parse_bool($row->lehre);
|
||||
|
||||
$this->result[]= $obj;
|
||||
}
|
||||
@@ -428,6 +437,10 @@ class vorlage extends basis_db
|
||||
$this->text = $row->text;
|
||||
$this->mimetype = $row->mimetype;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->style = $row->style;
|
||||
$this->berechtigung = $row->berechtigung;
|
||||
$this->anmerkung_vorlagestudiengang = $row->anmerkung_vorlagestudiengang;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -195,6 +195,12 @@ echo '</SELECT>';
|
||||
$organisationseinheit = new vorlage();
|
||||
$organisationseinheit->getOEsFromVorlage($vorlage_kurzbz);
|
||||
|
||||
if ($organisationseinheit->result=='')
|
||||
{
|
||||
$organisationseinheit = new organisationseinheit();
|
||||
$organisationseinheit->getAll();
|
||||
}
|
||||
|
||||
echo "<SELECT name='oe_kurzbz' id='organisationseinheit' onchange='window.location.href=this.value'>";
|
||||
if($oe_kurzbz==$default_oe)
|
||||
$selected='selected';
|
||||
|
||||
Reference in New Issue
Block a user