From 39cb8720b0340ef9ffee11267bc04ebe4c31dbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 22 Jan 2010 12:50:59 +0000 Subject: [PATCH] --- include/fop.class.php | 10 +++++++--- include/functions.inc.php | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/include/fop.class.php b/include/fop.class.php index ea838746b..c98735618 100644 --- a/include/fop.class.php +++ b/include/fop.class.php @@ -47,15 +47,19 @@ class fop $tmpxml = tempnam('/tmp', 'FAS_FOP'); $tmpxsl = tempnam('/tmp', 'FAS_FOP'); - file_put_contents($tmpxml, $xml); - file_put_contents($tmpxsl, $xsl); + $bytes1 = file_put_contents($tmpxml, $xml); + $bytes2 = file_put_contents($tmpxsl, $xsl); exec("fop -xml {$tmpxml} -xsl {$tmpxsl} -pdf {$tmppdf} 2>&1", $output); + //error_log("FOP Execute: fop -xml {$tmpxml} -xsl {$tmpxsl} -pdf {$tmppdf} 2>&1 b1:$bytes1 b2: $bytes2 Output: ".print_r($output, true)); @unlink($tmpxml); @unlink($tmpxsl); - + + /*if(count($output)>0) + exit(print_r($output, true));*/ + switch($destination) { case "D": // Download diff --git a/include/functions.inc.php b/include/functions.inc.php index cbf0e0265..170ff11f2 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -185,6 +185,22 @@ function montag($datum) return $datum; } +/** + * Springt zum naechsten Wochentag + * + * @param $timestamp + * @param $weekday Wochentag zu dem gesprungen werden soll (0-6, 0=Sonntag) + * @return timestamp + */ +function jump_weekday($timestamp, $weekday) +{ + $wt = date("w",$timestamp); + $jump = 7-$wt+$weekday; + if($jump>7) + $jump = $jump-7; + return jump_day($timestamp, $jump); +} + function jump_day($datum, $tage) { // Ein Tag sind 86400 Sekunden