XSLFO Lib Tabellen mit Zeilenumbruch werden nun korrekt erstellt

This commit is contained in:
Andreas Österreicher
2007-08-31 13:46:03 +00:00
parent fd1082d62c
commit b9dffd5e7d
10 changed files with 254 additions and 127 deletions
+1 -1
View File
@@ -1760,7 +1760,7 @@ if(!$error)
{
if(is_numeric($person_id))
{
$qry = "SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id='$person_id' ORDER BY zustellung LIMIT 1";
$qry = "SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id='$person_id' ORDER BY zustellung DESC LIMIT 1";
if($result = pg_query($conn, $qry))
{
if($row = pg_fetch_object($result))
+23 -2
View File
@@ -21,7 +21,10 @@ mike.toggweiler@tegonal.com
http://xslf2pdf.tegonal.com
*/ ?>
<?PHP
$max_line_height_for_that_row=0;
class FO_Block extends FO_LayoutObject{
static $CHILDNODES = array(
//FO_BidiOverride,
//FO_Character,
@@ -46,11 +49,16 @@ class FO_Block extends FO_LayoutObject{
}
function initAttributes($node) {
global $height_of_current_row;
//echo $node->parentNode->nodeName.'<br>';
if($node->parentNode->nodeName!='fo:table-cell')
$height_of_current_row=0;
$this->initAttribute($node, "text-align");
$this->initAttribute($node, "content-width");
}
function processContent($text) {
global $max_line_height_for_that_row;
$talign = $this->getContext("text-align");
//oesi - add attribute content-width
$colwidth = $this->getContext("content-width");
@@ -78,10 +86,23 @@ class FO_Block extends FO_LayoutObject{
// echo "Draw at:$x:$x2:$y<br>";
$pdf = $this->getPdf();
$lineHeight = $this->getContext("line-height");
list($width, $height, $nb, $sx, $sy, $lx, $ly) =
$pdf->Text2($x2, $y, $text, $align, $lineHeight, $x, $colwidth);
//echo "Wrote block:$x:$y:$height:$lineHeight:".$pdf->FontSize.":".$pdf->FontSizePt."<br>";
//echo "Wrote block:$colwidth:$height:$lineHeight:".$pdf->FontSize.":".$pdf->FontSizePt."$text<br>";
//oesi - wenn die hoehe einer Spalte groesser ist, dann muss der Border
//fuer die ganze row groesser gezeichnet werden.
//berechnung von max_line_heigth_for_that_row in fo_layout.php
if($max_line_height_for_that_row!=0 && $max_line_height_for_that_row!=1)
{
//echo "aendere hoehe fuer $text : $max_line_height_for_that_row<br>";
$height=$lineHeight*$max_line_height_for_that_row;
}
else
{
//echo "<br>$text : $max_line_height_for_that_row";
}
$this->setLocalContext("content_height", $height);
$this->setLocalContext("content_width", $width);
$this->setLocalContext("lx", $lx);
+179 -89
View File
@@ -27,7 +27,7 @@ class FO_LayoutObject extends FO_FlowContainer {
var $_oldFontStyle;
var $_oldColor;
var $_buffer;
function initDefaultAttributes($node) {
//read attributes
$this->initLocalAttribute($node, "border-top-style");
@@ -57,7 +57,7 @@ class FO_LayoutObject extends FO_FlowContainer {
$this->initLocalSizeAttribute($node, "space-before.optimum");
$this->initLocalSizeAttribute($node, "space-after.optimum");
$this->initLocalAttribute($node, "break-before");
$this->initLocalAttribute($node, "break-after");
$this->initLocalAttribute($node, "break-after");
$this->initSizeAttribute($node, "line-height");
$this->initLocalSizeAttribute($node, "padding-top");
//$this->initLocalSizeAttribute($node, "padding-bottom");
@@ -71,64 +71,154 @@ class FO_LayoutObject extends FO_FlowContainer {
//echo str_replace('EURO',chr(128),utf8_decode($str));
return str_replace('EURO',chr(128),utf8_decode($str));
}
function parse(DOMNode $node)
//oesi - Bei Tabellen wird die Hoehe der Row im vorhinein berechnet
function BerechneTabellenHoehe($child)
{
global $max_line_height_for_that_row;
//var_dump($child);
$pdf = $this->getPdf();
$anzahl_lines_max=0;
$output = '';
//alle Zellen durchlaufen
foreach($child->childNodes as $cell)
{
if($cell->childNodes)
{
foreach($cell->childNodes as $block)
{
//Blockelement heraussuchen
if($block->nodeName=='fo:block')
{
//Width des block Elements holen
if($block->attributes->getNamedItem('content-width'))
{
//Schriftgroesse des Elements holen bzw des uebergeordneten
if($block->attributes->getNamedItem('font-size'))
$font_size=$block->attributes->getNamedItem('font-size')->nodeValue;
else
$font_size=$this->getContext("font-size");
//wenn schriftgroesse in pt angegeben ist dann in mm umrechnen
if(strstr($font_size,'pt'))
$font_size = $font_size/72*25.4;
$content_width = $block->attributes->getNamedItem('content-width')->nodeValue;
//$output .= $block->nodeValue;
$anzahl_lines=0;
//sonderzeichen konvertieren
$line = $this->convert($block->nodeValue);
//Zeilenumbrueche loeschen
$line = str_replace("\n",'', trim($line));
//Lines nach Newlines splitten
$lines = explode('\n', $line);
foreach ($lines as $line)
{
do
{
/*$x = $this->getContext("x");
$x2 = $this->getContext("startx");
if (!$x2) {
$x2 = $x;
}*/
//echo "x2:$x2<br>";
$w = $content_width-1;
//Anzahl der zeichen holen die in dieser zeile noch platz haben
$noc = $pdf->GetNumberOfChars($w, $line, $font_size);
//wenn das wort nicht abgeteilt werden kann dann ueber den rand hinausschreiben
if($noc==-1)
$noc = strlen($line);
//Zeile abteilen
$showLine = substr($line, 0, $noc);
$output.= "w=$w noc=$noc fontsize=$font_size<br>$showLine ($line)";
$textWidth = $pdf->GetStringWidth($showLine);
//Rest der Line als neue Line
$line = trim(substr($line, $noc));
//Anzahl der verbleibenden zeichen ermitteln
$width = $pdf->GetNumberOfChars($w, $line, $font_size);
$anzahl_lines++;
} while($width>0);
}
$output.= " Breaks $anzahl_lines <br><br>";
//Wenn die Anzahl der benoetigten Zeilen in dieser Zelle
//Groesser als die bisher groesste ist dann aendern
if($anzahl_lines_max<$anzahl_lines)
$anzahl_lines_max = $anzahl_lines;
break;
}
}
}
}
}
//Groesse der Zellen in Globale Variable schreiben
$max_line_height_for_that_row = $anzahl_lines_max;
//echo $output." - Line breaks $anzahl_lines_max times<br>";
}
function parse(DOMNode $node) {
//set default attributes
$this->initDefaultAttributes($node);
$this->initAttributes($node);
$this->initialize();
$acceptPageBreak = $this->getContext("acceptPageBreak");
$pos = $this->getPosition();
list($x, $y, $width, $height) = $pos[0];
list($xOrig, $yOrig, $width, $height) = $pos[1];
//automatic page break if component exceeds page limits
$pdf = $this->getPdf();
if ($yOrig > $pdf->PageBreakTrigger && $pdf->AcceptPageBreak() && $acceptPageBreak)
{
$pdf->AddPage();
$this->handleEvent("sync-position");
$this->parse($node);
return;
if ($yOrig > $pdf->PageBreakTrigger &&
$pdf->AcceptPageBreak() &&
$acceptPageBreak) {
$pdf->AddPage();
$this->handleEvent("sync-position");
$this->parse($node);
return;
}
//update to inner position
$this->setContext("x", $x);
$this->setContext("y", $y);
//draw us
$this->setColor();
$this->setFont();
$this->setFont();
$this->startCapture();
foreach($node->childNodes as $child)
foreach($node->childNodes as $child)
{
if ($child->nodeType == self::NODE_TYPE_TEXT)
{
if ($child->nodeType == self::NODE_TYPE_TEXT)
{
$this->preParseContent($child->textContent);
//oesi - add function utf8_decode for special chars (umlaut)
$this->processContent($this->convert($child->nodeValue));
$this->postParseContent($child->textContent);
}
else
{
}
else
{
//oesi - Bei Table-rows im vorhinein die hoehe berechnen
if($child->nodeName=='fo:table-row')
$this->BerechneTabellenHoehe($child);
$this->processChildNode($child, $this->getChildNodes());
}
}
}
//oesi - hack for ExternalGraphic Tag to show without content
if($this instanceof FO_ExternalGraphic)
$this->processContent('');
//endhack
$contentBuffer = $this->endCapture();
$contentBuffer = $this->endCapture();
//update to outer position
$this->setContext("x", $xOrig);
$this->setContext("y", $yOrig);
//recalc positions
$pos2 = $this->getPosition();
//merge with X and y values of the original psoition
@@ -139,17 +229,17 @@ class FO_LayoutObject extends FO_FlowContainer {
//automatic page break if component exceeds page limits
$pdf = $this->getPdf();
if ($pos2[1][3] < $pdf->PageBreakTrigger &&
$pos2[1][3]+$this->getContext("y") > $pdf->PageBreakTrigger &&
if ($pos2[1][3] < $pdf->PageBreakTrigger &&
$pos2[1][3]+$this->getContext("y") > $pdf->PageBreakTrigger &&
$pdf->AcceptPageBreak() && $acceptPageBreak) {
$pdf->AddPage();
$this->handleEvent("sync-position");
$this->parse($node);
return;
}
$this->drawBordersAndBackground($pos2);
//update to outer positions
$this->setLocalContext("width", $pos2[1][2]);
$this->setLocalContext("height", $pos2[1][3]);
@@ -169,10 +259,10 @@ class FO_LayoutObject extends FO_FlowContainer {
function preParseContent($content) {
}
function postParseContent($textcontent) {
}
/**
* Draw borders and backgrounds according to the positions
* May be overwritten to specify behaviour
@@ -180,7 +270,7 @@ class FO_LayoutObject extends FO_FlowContainer {
function drawBordersAndBackground($pos) {
list($x, $y, $width, $height) = $pos[1];
$this->drawBackground($x, $y, $width, $height);
$this->drawBorders($x, $y, $width, $height);
$this->drawBorders($x, $y, $width, $height);
}
function getChildNodes() {
@@ -191,12 +281,12 @@ class FO_LayoutObject extends FO_FlowContainer {
function initialize() {
$break_before = $this->getContext("break-before");
$this->handleBreak($break_before);
}
}
function closeDown() {
$pdf = $this->getPdf();
if ($this->_oldFont) {
$pdf->SetFont($this->_oldFont, $this->_oldFontStyle,
$pdf->SetFont($this->_oldFont, $this->_oldFontStyle,
$this->_oldFontSize);
}
else if ($this->_oldFontSize) {
@@ -210,7 +300,7 @@ class FO_LayoutObject extends FO_FlowContainer {
$space_after = $this->getContext("space-after.optimum");
// echo "Space-after:".$space_after.":".get_class($this).":".$this->getContext("height")."<br>";
if ($space_after) {
$this->setLocalContext("height", $this->getContext("height") +
$this->setLocalContext("height", $this->getContext("height") +
$space_after);
}
$break_after = $this->getContext("break-after");
@@ -226,9 +316,9 @@ class FO_LayoutObject extends FO_FlowContainer {
}
function endCapture() {
if (!$this->_buffer) {
if (!$this->_buffer) {
return;
}
}
$partBuffer = $this->getPdf()->endCapture($this->_buffer);
$this->_buffer = NULL;
return $partBuffer;
@@ -243,23 +333,23 @@ class FO_LayoutObject extends FO_FlowContainer {
}
function getPosition() {
$space_before = $this->getContext("space-before.optimum");
$space_before = $this->getContext("space-before.optimum");
$height = $this->getContext("line-height");
$pdf = $this->getPdf();
$pdf = $this->getPdf();
$bw_top = $this->getContext("border-top-width");
$bw_left = $this->getContext("border-left-width");
$bw_right = $this->getContext("border-right-width");
$bw_bottom = $this->getContext("border-bottom-width");
$padding_left = $this->getContext("padding-left");
$padding_top = $this->getContext("padding-top");
$bw_bottom = $this->getContext("border-bottom-width");
$padding_left = $this->getContext("padding-left");
$padding_top = $this->getContext("padding-top");
$bw = $this->getContext("border-width");
$xx = $this->getContext("x");
$yy = $this->getContext("y");
$height2 = $this->getContext("height");
if (!$height || $height < $height2) {
$height2 = $this->getContext("height");
if (!$height || $height < $height2) {
$height = $height2;
}
$width = $this->getContext("width");
@@ -267,7 +357,7 @@ class FO_LayoutObject extends FO_FlowContainer {
if (!$bw_bottom) {$bw_bottom = $bw;}
if (!$bw_right) {$bw_right = $bw;}
if (!$bw_left) {$bw_left = $bw;}
sscanf($bw_top, "%f%s", $wt, $unit);
sscanf($bw_left, "%f%s", $wl, $unit);
sscanf($bw_right, "%f%s", $wr, $unit);
@@ -276,7 +366,7 @@ class FO_LayoutObject extends FO_FlowContainer {
$yy += $wt;
$height += $wt+$wb;
$width += $wl+$wr;
if ($space_before) {
//echo "Spacebefore:$space_before<br>";
$yy += $space_before;
@@ -289,27 +379,27 @@ class FO_LayoutObject extends FO_FlowContainer {
$yy += $padding_top;
}
return
return
array(
//inner coordinates
array($xx, $yy, $width-$wl-$wr, $height-$wt-$wb),
array($xx, $yy, $width-$wl-$wr, $height-$wt-$wb),
//outer coordinates
array($xx-$wl, $yy-$wr, $width, $height));
array($xx-$wl, $yy-$wr, $width, $height));
}
function setColor() {
$pdf = $this->getPdf();
$this->_oldColor = $pdf->GetTextColor();
$color = $this->getContext("color");
$color = $this->getContext("color");
if ($color) {
$this->setTextColor($color, $pdf);
}
}
function setFont() {
$pdf = $this->getPdf();
$pdf = $this->getPdf();
$this->_oldFont = $pdf->GetFontFamily();
$this->_oldFontStyle = $pdf->GetFontStyle();
$this->_oldFontStyle = $pdf->GetFontStyle();
$this->_oldFontSize = $pdf->GetFontSizePt();
$weight = $this->getContext("font-weight");
$style = $this->getContext("font-style");
@@ -320,7 +410,7 @@ class FO_LayoutObject extends FO_FlowContainer {
}
else {
$f = $this->_oldFont;
}
}
if ($weight || $style) {
if ($weight) {
$st = "B";
@@ -328,7 +418,7 @@ class FO_LayoutObject extends FO_FlowContainer {
if ($style) {
//TODO: check which styles are supported
}
}
}
else {
$st = $this->_oldFontStyle;
}
@@ -337,13 +427,13 @@ class FO_LayoutObject extends FO_FlowContainer {
}
else {
$sz = $this->_oldFontSize;
}
if ($pdf->FontExists($f, $st)) {
}
if ($pdf->FontExists($f, $st)) {
$pdf->SetFont($f, $st, $sz);
}
else if ($pdf->FontExists($this->_oldFont, $st)) {
else if ($pdf->FontExists($this->_oldFont, $st)) {
$pdf->SetFont($this->_oldFont, $st, $sz);
}
}
else {
//adjust only size
$pdf->SetFontSize($sz);
@@ -359,14 +449,14 @@ class FO_LayoutObject extends FO_FlowContainer {
$bc_top = $this->getContext("border-top-color");
$bc_left = $this->getContext("border-left-color");
$bc_right = $this->getContext("border-right-color");
$bc_bottom = $this->getContext("border-bottom-color");
$bc = $this->getContext("border-color");
$bc_bottom = $this->getContext("border-bottom-color");
$bc = $this->getContext("border-color");
$bw_top = $this->getContext("border-top-width");
$bw_left = $this->getContext("border-left-width");
$bw_right = $this->getContext("border-right-width");
$bw_bottom = $this->getContext("border-bottom-width");
$bw_bottom = $this->getContext("border-bottom-width");
$bw = $this->getContext("border-width");
$pdf = $this->getPdf();
if (!$bs_top) {$bs_top = $bs;}
if (!$bs_bottom) {$bs_bottom = $bs;}
@@ -385,7 +475,7 @@ class FO_LayoutObject extends FO_FlowContainer {
sscanf($bw_left, "%f%s", $wl, $unit);
sscanf($bw_right, "%f%s", $wr, $unit);
sscanf($bw_bottom, "%f%s", $wb, $unit);
$wt /= 2;
$wt /= 2;
$wl /= 2;
$wr /= 2;
$wb /= 2;
@@ -394,13 +484,13 @@ class FO_LayoutObject extends FO_FlowContainer {
$height -= $wt+$wb;
$x += $wl;
$y += $wt;
$this->drawLine($x, $y, $x+$width, $y, $bs_top, $bc_top,
$this->drawLine($x, $y, $x+$width, $y, $bs_top, $bc_top,
$bw_top, $pdf);
$this->drawLine($x, $y, $x, $y+$height, $bs_left,
$this->drawLine($x, $y, $x, $y+$height, $bs_left,
$bc_left, $bw_left,$pdf);
$this->drawLine($x, $y+$height, $x+$width, $y+$height,
$this->drawLine($x, $y+$height, $x+$width, $y+$height,
$bs_bottom, $bc_bottom, $bw_bottom, $pdf);
$this->drawLine($x+$width, $y, $x+$width, $y+$height,
$this->drawLine($x+$width, $y, $x+$width, $y+$height,
$bs_right, $bc_right,$bw_right, $pdf);
}
@@ -415,12 +505,12 @@ class FO_LayoutObject extends FO_FlowContainer {
$pdf->Rect($x, $y, $width, $height, "F");
list($r, $g, $b) = $this->parseColor($oldColor);
$pdf->SetFillColor($r, $g, $b);
}
}
else if ($bg_img) {
$this->NotYetSupported("background-image");
}
}
function drawLine($x, $y, $x2, $y2, $style, $color, $width, &$pdf) {
$oldColor = $pdf->GetDrawColor();
$oldLineWidth = $pdf->GetLineWidth();
@@ -462,20 +552,20 @@ class FO_LayoutObject extends FO_FlowContainer {
function setDrawColor($color, &$pdf) {
if ($color == '') {
return;
}
list($r, $g, $b) = $this->parseColor($color);
}
list($r, $g, $b) = $this->parseColor($color);
$pdf->SetDrawColor($r, $g, $b);
}
function setTextColor($color, &$pdf) {
if ($color == '') {
return;
}
list($r, $g, $b) = $this->parseColor($color);
}
list($r, $g, $b) = $this->parseColor($color);
$pdf->SetTextColor($r, $g, $b);
}
}
function handleBreak($break) {
function handleBreak($break) {
if (!$break) {
return;
}
@@ -483,11 +573,11 @@ class FO_LayoutObject extends FO_FlowContainer {
switch($break) {
case "page":
$pdf->AddPage();
$this->handleEvent("sync-position");
$this->handleEvent("sync-position");
return;
default:
$this->NotYetSupported("Break:$break");
}
}
}
}
@@ -504,7 +594,7 @@ class FO_PageSequence extends FO_Object {
static $CHILDNODES = array(
'FO_Flow'
);
function parse(DOMNode $node) {
$masterRef = $node->attributes->getNamedItem("master-reference");
if ($masterRef) {
@@ -515,7 +605,7 @@ class FO_PageSequence extends FO_Object {
$pdf->AddPage();
$this->handleEvent("sync-position");
$this->processChildNodes($node, self::$CHILDNODES);
}
}
}
class FO_FlowContainer extends FO_Object {
@@ -524,20 +614,20 @@ class FO_FlowContainer extends FO_Object {
$acceptPageBreak = $this->getContext("acceptPageBreak");
$this->setLocalContext("width", $obj->getContext("width"));
$height = $this->getContext("height")+$obj->getContext("height");
$this->setLocalContext("height", $height);
$this->setLocalContext("height", $height);
$y = $this->getContext("y")+$obj->getContext("height");
$pdf = $this->getPdf();
if ($height < $pdf->PageBreakTrigger &&
$y > $pdf->PageBreakTrigger &&
$pdf->AcceptPageBreak() &&
if ($height < $pdf->PageBreakTrigger &&
$y > $pdf->PageBreakTrigger &&
$pdf->AcceptPageBreak() &&
$acceptPageBreak) {
$pdf->AddPage();
$this->handleEvent("sync-position");
//echo "Page break on .".get_class($obj)."<br>";
}
else {
$this->setContext("y", $y);
else {
$this->setContext("y", $y);
//echo "Move :".get_class($obj).":".$y.":".$obj->getContext("height")."<br>;";
}
}
@@ -555,7 +645,7 @@ class FO_Flow extends FO_FlowContainer {
function parse(DOMNode $node) {
//TODO: use attributes
$this->processChildNodes($node, self::$CHILDNODES);
}
}
}
class FO_BlockContainer extends FO_LayoutObject {
@@ -573,7 +663,7 @@ class FO_BlockContainer extends FO_LayoutObject {
$this->initLocalSizeAttribute($node, "height");
$this->initLocalSizeAttribute($node, "width");
}
function getChildNodes() {
return self::$CHILDNODES;
}
@@ -595,7 +685,7 @@ class FO_BlockContainer extends FO_LayoutObject {
}
class FO_ListBlock extends FO_LayoutObject {
}
?>
+9 -3
View File
@@ -98,6 +98,7 @@ class FO_Table extends FO_LayoutObject {
}
function postParse(FO_Object $obj) {
global $max_line_height_for_that_row;
if ($obj instanceof FO_TableHeader) {
$this->setLocalContext("width", $obj->getContext("width"));
$this->setLocalContext("height", $this->getContext("height")+
@@ -111,6 +112,7 @@ class FO_Table extends FO_LayoutObject {
$obj->getContext("height"));
$this->setContext("y", $this->getContext("y") +
$obj->getContext("height"));
$max_line_height_for_that_row=1;
}
else if($obj instanceof FO_TableColumn) {
$col = $obj->getContext("column");
@@ -163,7 +165,8 @@ class FO_TableRow extends FO_LayoutObject {
$col->setContext("column", $this->colIndex++);
}
function postParse(FO_Object $obj) {
function postParse(FO_Object $obj) {
if ($obj instanceof FO_TableCell) {
$this->setContext("x", $this->getContext("x")+
$obj->getContext("width"));
@@ -172,8 +175,9 @@ class FO_TableRow extends FO_LayoutObject {
if ($this->getContext("height") < $obj->getContext("height")) {
$this->setLocalContext("height", $obj->getContext("height"));
}
}
}
else if ($obj instanceof FO_TableRow) {
$this->setLocalContext("width", $obj->getContext("width"));
$this->setLocalContext("height", $this->getContext("height")+
$obj->getContext("height"));
@@ -217,7 +221,7 @@ class FO_TableBody extends FO_LayoutObject {
function getChildNodes() {
return self::$CHILDNODES;
}
function postParse(FO_Object $obj) {
if ($obj instanceof FO_TableRow) {
$this->setLocalContext("width", $obj->getContext("width"));
@@ -227,6 +231,8 @@ class FO_TableBody extends FO_LayoutObject {
$obj->getContext("height"));
}
}
}
class FO_TableCell extends FO_LayoutObject {
+19 -5
View File
@@ -133,14 +133,17 @@ class MyPdf extends FPDF {
* Get the number of characters having space whithin the
* given width, respecting not to break words
*/
function GetNumberOfChars($width, $s) {
function GetNumberOfChars($width, $s, $fontsize=null) {
//Get width of a string in the current font
// $s=(string)$s;
if($fontsize==null)
$fontsize=$this->FontSize;
//echo "width:$width s:$s font:$fontsize";
$cw=&$this->CurrentFont['cw'];
$w=0;
$wordPos = 0;
$l=strlen($s);
$width = $width*1000/$this->FontSize;
$width = $width*1000/$fontsize;
for($i=0;$i<$l;$i++) {
$w+=$cw[$s{$i}];
if ($s{$i} == ' ') {
@@ -179,19 +182,23 @@ class MyPdf extends FPDF {
}
else
$pw = $this->GetPageWidth();
//echo "x: $x width: $width pw: $pw<br>";
$nb = 0;
$maxWidth = 0;
$sx = $x;
$sy = $y;
foreach($lines as $line)
{
$width = $this->GetStringWidth($line);
do
{
$w=$this->w-$this->rMargin-$x;
//$w=$this->w-$this->rMargin-$x;
$w = $pw-$x; //oesi - changed
//echo "w:$w<br>";
//$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
$noc = $this->GetNumberOfChars($w, $line);
//echo "noc:$noc:$x:$w:".strlen($line).":$line<br>";
//echo "noc:$noc xNewLine: $xNewLine x:$x w:$w strlen:".strlen($line)." line:$line<br>";
if ($noc == -1)
{
if ($x == $xNewLine)
@@ -201,6 +208,7 @@ class MyPdf extends FPDF {
}
else
{
//echo "NEWLINE";
if ($nb == 0)
{
$sy += $height;
@@ -216,6 +224,7 @@ class MyPdf extends FPDF {
$showLine = substr($line, 0, $noc);
$textWidth = $this->GetStringWidth($showLine);
//echo "showline: $showLine<br>";
// echo "wmax:$nb:$x:$w:$textWidth:$showLine<br>";
switch ($align)
{
@@ -240,7 +249,12 @@ class MyPdf extends FPDF {
}
$y += $height;
$nb++;
$x = $xNewLine;
//oesi - wenn er die zeileumbricht dann soll in der naechsten zeile um
//1 eingerueckt werden sonst schaut des in einer tablle nicht gut aus
if($width!=0)
$x = $xNewLine+1;
else
$x = $xNewLine;
} while ($width > 0);
}
//$this->y = $y;
+6 -6
View File
@@ -103,9 +103,9 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <zulassungsvoraussetzungen_deutsch><![CDATA[Allgemeine Universitätsreife (vgl. $4 Abs. 3 FHStG idgF),\nBerufsreifeprüfung bzw. Studienberechtigungsprüfung oder\neinschlägige berufliche Qualifikation (Lehrabschluss bzw. Abschluss\neiner berufsbildenden mittleren Schule mit Zulassungsprüfung). Die\nAufnahme erfolgt auf Basis eines Auswahlverfahrens (Werdegang,\nEignungstest, Bewerbungsgespräch).]]></zulassungsvoraussetzungen_deutsch>';
echo ' <zulassungsvoraussetzungen_englisch><![CDATA[Austrian or quivalent foreign school leaving certificate\n(Reifeprüfung), university entrance examination certificate\n(Studienberechtigungsprüfung), certificate or quivalent relevant\nprofessional qualification (Berufsreifeprüfung) plus entrance\nexamination equal to the university entrance examination. There is a\nselection procedure prior to admission (including entrance exam and\ninterview, professional background is considered).]]></zulassungsvoraussetzungen_englisch>';
echo ' <anforderungen_deutsch><![CDATA[Das Studium erfordert die positive Absolvierung von\nLehrveranstaltungen (Vorlesungen, Übungen, Seminare, Projekte,\nintegrierte Lehrveranstaltungen) im Ausmass von jeweils 30 ECTS pro\nSemester gemäß dem vorgeschriebenen Studienplan. Die Ausbildung\nintegriert technische, wirtschaftliche, organisatorische und\npersönlichkeitsbildende Elemente. Das Studium beinhaltet ein\nfacheinschlägiges Berufpraktikum. Im Rahmen des Studiums ist eine\nDiplomarbeit zu verfassen und eine abschließende Prüfung\n(Diplomprüfung) zu absolvieren. Curriculum des Studienganges\ngemäß dem vom FHR mit Kennzahl '.sprintf('%04s', $row->studiengang_kz).' genehmigten Antrag.]]></anforderungen_deutsch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures,\nlabs, seminars, projekct work, and integrated courses) to the extend of\n30 ECTS per semester according to the curriculum. The programm\nintegrates technical, economical, management and personal study\nelements. Included in the program is a relevant work placement. The\ndegree is awarded upon the successful completion of a diploma these\nand the final examination. Curriculum of the program according to the application as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')]]></anforderungen_englisch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures, labs, seminars, projekct work, and integrated courses) to the extend of 30 ECTS per semester according to the curriculum. The programm integrates technical, economical, management and personal study elements. Included in the program is a relevant work placement. The degree is awarded upon the successful completion of a diploma these and the final examination. Curriculum of the program according to the application as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')]]></anforderungen_englisch>';
echo ' <zugangsberechtigung_deutsch><![CDATA[Der Abschluss des Diplomstudiengangs berechtigt zu einem facheinschlägigen Doktoratsstudium, Magister- bzw. Master-Studium\noder postgradualen Studium (in Abhängigkeit vom Studium mit\neventuellen Zusatzprüfungen). Die Qualifikation entspricht einem\nMaster of Science in Engineering, MSc.]]></zugangsberechtigung_deutsch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Diploma Degree Program qualifies the graduate to apply for admission to a relevant Doctoral Degree Program, Master Degree Program or postgraduate studies (depending on the\nprogram additional qualifying exams may be required). The Diplioma\nDegree Program is a graduate program, the qualification is equvalent to\nMaster of Science in Engineering, MSc]]></zugangsberechtigung_englisch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Diploma Degree Program qualifies the graduate to apply for admission to a relevant Doctoral Degree Program, Master Degree Program or postgraduate studies (depending on the program additional qualifying exams may be required). The Diplioma Degree Program is a graduate program, the qualification is equvalent to Master of Science in Engineering, MSc]]></zugangsberechtigung_englisch>';
echo ' <niveau_deutsch>Diplomstudium (UNESCO ISCED 5A)</niveau_deutsch>';
echo ' <niveau_englisch>Diploma degree program (UNESCO ISCED 5A)</niveau_englisch>';
}
@@ -114,9 +114,9 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <zulassungsvoraussetzungen_deutsch><![CDATA[Die fachliche Zugangsvoraussetzung (vgl. $4 Abs. 2 FHStG idgF) zu\neinem FH-Masterstudiengang ist ein abgeschlossener\nfacheinschlägiger FH-Bachelorstudiengang oder der Abschluss eines\ngleichwertigen Studiums an einer anerkannten inländischen oder\nausländischen postsekundären Bildungseinrichtung. Die Aufnahme in\nden Studiengang erfolgt auf Basis eines Aufnahmeverfahrens.]]></zulassungsvoraussetzungen_deutsch>';
echo ' <zulassungsvoraussetzungen_englisch><![CDATA[\nAdmission to the master\'s degree program is granted on the basis of\nthe successful completion of a relevant post-secondary degree\nacknoledgement to be its equivalent. Admission is on the basis of a\nselection process.\n\n]]></zulassungsvoraussetzungen_englisch>';
echo ' <anforderungen_deutsch><![CDATA[Das Studium erfordert die positive Absolvierung von\nLehrveranstaltungen(Vorlesungen, Übungen, Seminare, Projekte,\nintegrierte Lehrveranstaltungen) im Ausmass von jeweils 30 ECTS pro\nSemester gemäß dem vorgeschriebenen Studienplan. Die Ausbildung\nintegriert technische, wirtschaftliche, organisatorische und\npersönlichkeitsbildende Elemente. Im Rahmen des Studiums ist eine\nDiplomarbeit zu verfassen und eine abschließende Prüfung\n(Diplomprüfung) zu absolvieren. Curriculum des Studienganges\ngemäß dem vom FHR mit Kennzahl '.sprintf('%04s', $row->studiengang_kz).' genehmigten Antrag.\n]]></anforderungen_deutsch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures,\nlabs, seminars, projekct work, and integrated courses) to the extend of\n30 ECTS per semester according to the curriculum. The programm\nintegrates technical, economical, management and personal study\nelements. The degree is awarded upon the successful completion of a diploma these and the final examination. Curriculum of the program according to the application as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')\n]]></anforderungen_englisch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures, labs, seminars, projekct work, and integrated courses) to the extend of 30 ECTS per semester according to the curriculum. The programm\nintegrates technical, economical, management and personal study\nelements. The degree is awarded upon the successful completion of a diploma these and the final examination. Curriculum of the program according to the application as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')]]></anforderungen_englisch>';
echo ' <zugangsberechtigung_deutsch><![CDATA[Der Abschluss des Masterstudiengangs berechtigt zu einem facheinschlägigen Doktoratsstudium an Universität (in Abhängigkeit\nvom Studium mit eventuellen Zusatzprüfungen)]]></zugangsberechtigung_deutsch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Master Degree Program qualifies the graduate to apply for admission to a relevant Doctoral Degree Program\nat an University (depending on the program additional qualifying exams\nmay be required).\n\n\n\n]]></zugangsberechtigung_englisch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Master Degree Program qualifies the graduate to apply for admission to a relevant Doctoral Degree Program at an University (depending on the program additional qualifying exams may be required).\n\n\n\n]]></zugangsberechtigung_englisch>';
echo ' <niveau_deutsch>Masterstudium (UNESCO ISCED 5A)</niveau_deutsch>';
echo ' <niveau_englisch>Master degree program (UNESCO ISCED 5A)</niveau_englisch>';
}
@@ -125,9 +125,9 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <zulassungsvoraussetzungen_deutsch><![CDATA[Allgemeine Universitätsreife (vgl. $4 Abs. 3 FHStG idgF),\nBerufsreifeprüfung bzw. Studienberechtigungsprüfung oder\neinschlägige berufliche Qualifikation (Lehrabschluss bzw. Abschluss\neiner berufsbildenden mittleren Schule mit Zulassungsprüfung). Die\nAufnahme erfolgt auf Basis eines Auswahlverfahrens (Werdegang,\nEignungstest, Bewerbungsgespräch).]]></zulassungsvoraussetzungen_deutsch>';
echo ' <zulassungsvoraussetzungen_englisch><![CDATA[Austrian or quivalent foreign school leaving certificate\n(Reifeprüfung), university entrance examination certificate\n(Studienberechtigungsprüfung), certificate or quivalent relevant\nprofessional qualification (Berufsreifeprüfung) plus entrance\nexamination equal to the university entrance examination. There is a\nselection procedure prior to admission (including entrance exam\nand interview, professional background is considered).]]></zulassungsvoraussetzungen_englisch>';
echo ' <anforderungen_deutsch><![CDATA[Das Studium erfordert die positive Absolvierung von\nLehrveranstaltungen (Vorlesungen, Übungen, Seminare, Projekte,\nintegrierte Lehrveranstaltungen) im Ausmass von jeweils 30 ECTS pro\nSemester gemäß dem vorgeschriebenen Studienplan. Die Ausbildung\nintegriert technische, wirtschaftliche, organisatorische und\npersönlichkeitsbildende Elemente. Das Studium beinhaltet ein\nfacheinschlägiges Berufpraktikum. Im Rahmen des Studiums sind\nzwei Bachelorarbeiten zu verfassen und eine abschließende Prüfung\n(Bachelorprüfung) zu absolvieren. Curriculum des Studienganges\ngemäß dem vom FHR mit Kennzahl '.sprintf('%04s', $row->studiengang_kz).' genehmigten Antrag.]]></anforderungen_deutsch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures,\nlabs, seminars, projekct work, and integrated courses) to the extend of\n30 ECTS per semester according to the curriculum. The programm\nintegrates technical, economical, management and personal study\nelements. Included in the program is a relevant work placement. The\ndegree is awarded upon the successful completion of 2 bachelor these\nand the final examination. Curriculum of the program according to the\napplication as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')]]></anforderungen_englisch>';
echo ' <anforderungen_englisch><![CDATA[The programm requires the positive completion of all courses (lectures, labs, seminars, projekct work, and integrated courses) to the extend of 30 ECTS per semester according to the curriculum. The programm integrates technical, economical, management and personal study elements. Included in the program is a relevant work placement. The degree is awarded upon the successful completion of 2 bachelor these and the final examination. Curriculum of the program according to the application as approved by the Fachhochschul Council (Classification number: '.sprintf('%04s', $row->studiengang_kz).')]]></anforderungen_englisch>';
echo ' <zugangsberechtigung_deutsch><![CDATA[Der Abschluss des Diplomstudiengangs berechtigt zu einem facheinschlägigen Magister- bzw. Master-Studium an einer fachhochschulischen Einrichtung oder Universität (mit eventuellen Zusatzprüfungen).]]></zugangsberechtigung_deutsch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Bachlor Degree Program qualifies the graduate to apply for admission to a relevant Master Degree Program\nat a University of Applied Sciences or a University (depending on the program additional qualifying exams may be required).\n\n\n]]></zugangsberechtigung_englisch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Bachlor Degree Program qualifies the graduate to apply for admission to a relevant Master Degree Program at a University of Applied Sciences or a University (depending on the program additional qualifying exams may be required).\n\n]]></zugangsberechtigung_englisch>';
echo ' <niveau_deutsch>Bachelorstudium (UNESCO ISCED 5A)</niveau_deutsch>';
echo ' <niveau_englisch>Bachelor degree program (UNESCO ISCED 5A)</niveau_englisch>';
@@ -306,7 +306,7 @@
<fo:table-row line-height="10pt">
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"> 5.2 \n \n \n</fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"> Beruflicher Status \n Professional status conferred \n \n</fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"> Zugang zu akademischen Berufen nach Maßgabe der berufsrechtlichen \n Vorschriften; Diplom im Sinne der Richtlinie 89/48/EWG \n Access to academic professions according to the professional \n regulation; Diploma in the sense of directive RL 89/48/EEC</fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt">Zugang zu akademischen Berufen nach Maßgabe der berufsrechtlichen Vorschriften; Diplom im Sinne der Richtlinie 89/48/EWG Access to academic professions according to the professional regulation; Diploma in the sense of directive RL 89/48/EEC</fo:block></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
+3 -3
View File
@@ -140,9 +140,9 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="lehreinheit">
<fo:table-row line-height="10pt">
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"><xsl:text> </xsl:text><xsl:value-of select="lehreinheit_id" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"><xsl:text> </xsl:text><xsl:value-of select="lehrveranstaltung" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt"><xsl:text> </xsl:text><xsl:value-of select="fachbereich" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="12mm"><xsl:text> </xsl:text><xsl:value-of select="lehreinheit_id" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="65mm"><xsl:text> </xsl:text><xsl:value-of select="lehrveranstaltung" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="40mm"><xsl:text> </xsl:text><xsl:value-of select="fachbereich" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="20mm" text-align="center"><xsl:value-of select="gruppe" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="12mm" text-align="right"><xsl:value-of select="stunden" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="8pt" content-width="10mm" text-align="right"><xsl:value-of select="satz" /></fo:block></fo:table-cell>
+7 -11
View File
@@ -44,7 +44,7 @@
</fo:block>
</fo:block-container>
<fo:block-container position="absolute" top="85mm" left="177mm">
<fo:block line-height="14pt" font-family="sans-serif" font-size="10pt" font-weight="bold">
<fo:block content-width="80mm" line-height="14pt" font-family="sans-serif" font-size="10pt" font-weight="bold">
<xsl:value-of select="matrikelnr" />
</fo:block>
</fo:block-container>
@@ -54,7 +54,7 @@
</fo:block>
</fo:block-container>
<fo:block-container position="absolute" top="90mm" left="189mm">
<fo:block line-height="14pt" font-family="sans-serif" font-size="10pt" font-weight="bold">
<fo:block content-width="80mm" line-height="14pt" font-family="sans-serif" font-size="10pt" font-weight="bold">
<xsl:value-of select="studiengang_kz" />
</fo:block>
</fo:block-container>
@@ -71,9 +71,7 @@
</fo:table-cell>
<fo:table-cell>
<fo:block font-family="sans-serif" font-size="12pt" content-width="45mm" text-align="left">
<fo:inline font-weight="900">
<xsl:value-of select="name" />
</fo:inline>
<fo:inline font-weight="900"><xsl:value-of select="name" /></fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
@@ -105,19 +103,17 @@
<fo:table-row line-height="14pt">
<fo:table-cell border-width="0.2mm" border-style="solid">
<fo:block font-size="14pt" font-weight="bold">
Lehrveranstaltung\n
Lehrveranstaltung
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid">
<fo:block font-size="14pt" font-weight="bold" content-width="30mm" text-align="center">
Note\n
Note
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid">
<fo:block font-size="14pt" font-weight="bold" content-width="25mm" text-align="center">
Anzahl\n SWS
</fo:block>
<fo:block font-size="14pt" font-weight="bold" content-width="25mm" text-align="center">Anzahl\n SWS</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid">
<fo:block font-size="14pt" font-weight="bold" content-width="25mm" text-align="center">
@@ -237,7 +233,7 @@
<xsl:template match="unterrichtsfach">
<fo:table-row line-height="16pt">
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="12pt"><xsl:text> </xsl:text><xsl:value-of select="bezeichnung" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="12pt" content-width="85mm"><xsl:text> </xsl:text><xsl:value-of select="bezeichnung" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="12pt" content-width="30mm" text-align="center"><xsl:text> </xsl:text><xsl:value-of select="note" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="12pt" content-width="25mm" text-align="center"><xsl:text> </xsl:text><xsl:value-of select="sws" /></fo:block></fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid" ><fo:block font-size="12pt" content-width="25mm" text-align="center"><xsl:text> </xsl:text><xsl:value-of select="ects" /></fo:block></fo:table-cell>
@@ -538,19 +538,19 @@ if($result = pg_query($conn, $qry))
echo '</SELECT>';
echo '</td></tr>';
echo '<tr><td>Anmerkungen</td><td><textarea id="anmerkung" name="anmerkungen">'.$anmerkungen.'</textarea></td></tr>';
echo '<tr><tr><td></td><td>';
echo '<tr><td></td><td>';
if(($geburtsdatum=='' && $vorname=='' && $nachname=='') || $geburtsdatum_error)
echo '<input type="submit" name="showagain" value="Vorschlag laden"</td></tr>';
echo '<input type="submit" name="showagain" value="Vorschlag laden"></td></tr>';
else
echo '<input type="submit" name="save" value="Speichern"</td></tr>';
?>
echo '<input type="submit" name="save" value="Speichern"></td></tr>';
echo '
</table>
</td>
<td valign="top">
<!--Vorschlaege-->
<?php
';
//Vorschlaege laden
if($geburtsdatum!='')
{