Revision: 222
http://tutos.svn.sourceforge.net/tutos/?rev=222&view=rev
Author: gokohnert
Date: 2011-07-04 15:54:09 +0000 (Mon, 04 Jul 2011)
Log Message:
-----------
use export__headers as a global header generation for all forms of output (PDF/XLS/CSV)
Modified Paths:
--------------
trunk/php/address_overview.php
trunk/php/base.pinc
trunk/php/bugtracking/bug_overview.php
trunk/php/expense/expense.pinc
trunk/php/expense/expense_overview.php
trunk/php/group/group_show.php
trunk/php/invoice/invoice_show.php
trunk/php/product_contacts.php
trunk/php/report-engine/rep_envelope/rep_envelope.pinc
trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc
trunk/php/report-engine/rep_index/rep_index.pinc
trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc
trunk/php/report-engine/rep_spine/rep_spine.pinc
trunk/php/scrum/log_overview.php
trunk/php/stuff/stuff_overview.php
trunk/php/team.pinc
trunk/php/team_overview.php
trunk/php/team_show.php
trunk/php/testmanager/de.p3
trunk/php/testmanager/testrun_show.php
trunk/php/testmanager/testsuite_show.php
trunk/php/timetrack/timetrack.pinc
trunk/php/timetrack/timetrack_overview.php
Modified: trunk/php/address_overview.php
===================================================================
--- trunk/php/address_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/address_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -49,13 +49,7 @@
}
$r .= "</address_set>\n";
} elseif ( $this->format == 'csv' ) {
- Header('Content-Disposition: inline; filename="TUTOS_adr_export_'.uniqid().'.csv"');
- Header("Content-Description: Upload from TUTOS" );
- Header("Content-Type: text/csv");
- Header("Expires: -1");
- Header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- Header("Pragma: public");
-
+ export_headers('TUTOS_adr_export','csv');
# Header("Content-Type: text/plain");
$n = $this->result->numrows();
$x = 0;
Modified: trunk/php/base.pinc
===================================================================
--- trunk/php/base.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/base.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -418,11 +418,7 @@
* Header for Export as XML
*/
function exportXMLHeader ($contentsize = 0) {
- Header('Expires: 0');
- Header('Pragma: no-cache');
- Header('Content-type: text/xml');
- Header('Content-Disposition: attachment; filename="'. $this->gettype() .'.xml"');
- Header('Content-Description: XML Export from TUTOS' );
+ export_headers('TUTOS_'.$this->gettype(),'xml');
if ($contentsize > 0) {
Header('Content-Length: '. $contentsize);
}
Modified: trunk/php/bugtracking/bug_overview.php
===================================================================
--- trunk/php/bugtracking/bug_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/bugtracking/bug_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2010 by Gero Kohnert
+ * Copyright 1999 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -185,11 +185,7 @@
include_once '../../libs/excel/Worksheet.php';
include_once '../../libs/excel/Workbook.php';
- header("Content-type: application/vnd.ms-excel");
- header("Content-Disposition: attachment; filename=BugExport.xls");
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
+ export_headers('TUTOS_BugExport','xls');
$tmpname = tempnam ($tutos[sessionpath], "bugexport");
$workbook = new Workbook($tmpname);
Modified: trunk/php/expense/expense.pinc
===================================================================
--- trunk/php/expense/expense.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/expense/expense.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -327,12 +327,15 @@
function getCategory ($c = "") {
global $lang;
- if ( ! empty($c) ) {
- return " ". $lang['ExpenseCategories'][$c] ." ";
+ if ( empty($c) ) {
+ $c = $this->category;
}
- return " ". $lang['ExpenseCategories'][$this->category] ." ";
+ return (isset($lang['ExpenseCategories'][$c]) ? $lang['ExpenseCategories'][$c]:'?'.$c);
}
+ /**
+ * ask for the method of payment
+ */
function askMOP () {
$r = ExpenseAskMOP($this->mop,0);
return $r;
Modified: trunk/php/expense/expense_overview.php
===================================================================
--- trunk/php/expense/expense_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/expense/expense_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -35,11 +35,7 @@
global $lang,$tutos;
$r = '';
- Header("Content-type: text");
- Header("Content-Disposition: attachment; filename=\"TUTOS_expense_export.csv\"");
- Header("Content-Description: Upload from TUTOS" );
- Header("Expires: -1"); // required by google chrome
- Header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
+ export_headers('TUTOS_expense_export','csv');
$n = $this->result->numrows();
$a = 0;
@@ -218,7 +214,7 @@
$r .= ' <td> '. $b->getAdrRefLink() ."</td>\n";
if ($this->head['category']) {
- $r .= ' <td>'. $b->getCategory() ." </td>\n";
+ $r .= ' <td> '. $b->getCategory() ." </td>\n";
}
if ($this->head['quantity']) {
Modified: trunk/php/group/group_show.php
===================================================================
--- trunk/php/group/group_show.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/group/group_show.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,4 +1,4 @@
-<?php
+x<?php
/**
* Copyright 2001 - 2011 by Gero Kohnert
*
@@ -64,16 +64,8 @@
}
- Header("Content-Type: text/csv");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send CSV file');
- }
- Header("Content-Disposition: inline; filename=\"". $this->obj->name .".csv\"");
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->obj->name,'csv');
Header('Content-Length: '.strlen($data));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -198,16 +190,9 @@
$pdf->Close();
$data = $pdf->Output('','S');
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $this->obj->name .'_'.Date('YmdHi').'.pdf"');
- Header("Content-Description: Upload from TUTOS" );
+
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: -1");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -225,12 +210,8 @@
}
if ($this->format == 'pdf') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->pdf();
} else if ($this->format == 'csv') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->csv();
}
$r .= $this->DataTableStart();
Modified: trunk/php/invoice/invoice_show.php
===================================================================
--- trunk/php/invoice/invoice_show.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/invoice/invoice_show.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2002 - 2010 by Gero Kohnert
+ * Copyright 2002 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -69,15 +69,8 @@
$r = '';;
if ( $this->format == "pdf" ) {
$data = $this->obj->getPDF();
- Header("Content-Type: application/pdf");
- if(headers_sent())
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- Header('Content-Disposition: inline; filename="'. $this->obj->name .'.pdf"');
- Header('Content-Description: Upload from TUTOS' );
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
} else if ( $this->format == "xml" ) {
$r = $this->obj->exportXML();
Modified: trunk/php/product_contacts.php
===================================================================
--- trunk/php/product_contacts.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/product_contacts.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -198,16 +198,9 @@
}
$pdf->Close();
$data = $pdf->buffer;
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $this->obj->name.'_'.Date('YmdHi').'.pdf');
- Header("Content-Description: Upload from TUTOS" );
+
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
/**
@@ -439,5 +432,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/report-engine/rep_envelope/rep_envelope.pinc
===================================================================
--- trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,10 +1,10 @@
<?php
/**
- * Copyright 2004 - 2009 by Gero Kohnert
+ * Copyright 2004 - 2011 by Gero Kohnert
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; version 2 of the License.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
*
*
* SVN Info $Id$
@@ -34,7 +34,7 @@
$pdf=new tutospdf($this->dbconn,"P",array(90,45));
$pdf->Open();
-# $pdf->setAuthor($this->obj->creator->getFullName());
+ # $pdf->setAuthor($this->obj->creator->getFullName());
$pdf->setTitle(myiconv($this->obj->getFullName()));
$pdf->setSubject(myiconv($this->obj->getFullName()));
$pdf->setDisplayMode('real');
@@ -66,13 +66,7 @@
$pdf->Close();
$data = $pdf->buffer;
- header("Expires: 0");
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header("Content-Disposition: inline; filename=\"". $this->obj->getFullName() .".pdf\"");
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->obj->getFullName(),'pdf');
Header('Content-Length: '.strlen($data));
return $data;
}
@@ -109,6 +103,6 @@
return $lang['rep_envelope_info'];
}
-}
+ }
?>
\ No newline at end of file
Modified: trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc
===================================================================
--- trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,9 +1,9 @@
<?php
/**
- * Copyright 2006 by Gero Kohnert
+ * Copyright 2006 - 2011 by Gero Kohnert
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2 of the License.
*
*
@@ -40,52 +40,52 @@
function new_sheet(&$wb,$id,$title) {
global $lang;
- $this->ws[$id] =& $wb->add_worksheet($title);
+ $this->ws[$id] =& $wb->add_worksheet(myiconv($title));
$this->ws[$id]->set_landscape();
$this->ws[$id]->set_header('report');
$this->ws[$id]->set_footer("TUTOS");
$row = 0;
$this->ws[$id]->set_column(REP_GROUP_EXCEL_COMPANY,REP_GROUP_EXCEL_COMPANY,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY, $lang['Company'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,myiconv($lang['Company']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_TITLE,REP_GROUP_EXCEL_TITLE,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE, $lang['AdrTitle'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,myiconv($lang['AdrTitle']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_FNAME,REP_GROUP_EXCEL_FNAME,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME, $lang['AdrFirstName'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,myiconv($lang['AdrFirstName']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_LNAME,REP_GROUP_EXCEL_LNAME,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME, $lang['AdrLastName'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,myiconv($lang['AdrLastName']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_STREET,REP_GROUP_EXCEL_STREET,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET, $lang['Street'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET,myiconv($lang['Street']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_ZIP,REP_GROUP_EXCEL_ZIP,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP, $lang['ZIP'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP,myiconv($lang['ZIP']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_CITY,REP_GROUP_EXCEL_CITY,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY, $lang['City'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY,myiconv($lang['City']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_COUNTRY,REP_GROUP_EXCEL_COUNTRY,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY, $lang['Country'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY,myiconv($lang['Country']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL1,REP_GROUP_EXCEL_EMAIL1,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $lang['AdrEmail'].'1',$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1,myiconv($lang['AdrEmail']).'1',$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL2,REP_GROUP_EXCEL_EMAIL2,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $lang['AdrEmail'].'2',$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2,myiconv($lang['AdrEmail']).'2',$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE1,REP_GROUP_EXCEL_PHONE1,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $lang['Phone'].'1',$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1,myiconv($lang['Phone']).'1',$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE2,REP_GROUP_EXCEL_PHONE2,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $lang['Phone'].'2',$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2,myiconv($lang['Phone']).'2',$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_FAX,REP_GROUP_EXCEL_FAX,25);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $lang['AdrFax'],$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX,myiconv($lang['AdrFax']),$this->format2);
$this->ws[$id]->set_column(REP_GROUP_EXCEL_ID,REP_GROUP_EXCEL_ID,15);
- $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,'ID',$this->format2);
+ $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,myiconv('ID'),$this->format2);
return;
}
@@ -98,11 +98,7 @@
require_once '../../libs/excel/Worksheet.php';
require_once '../../libs/excel/Workbook.php';
- header("Content-type: application/vnd.ms-excel");
- header("Content-Disposition: attachment; filename=report.xls");
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
+ export_headers('TUTOS_'.$this->obj->name,'xls');
$tmpname = tempnam ($tutos[sessionpath], "report");
$workbook = new Workbook($tmpname);
@@ -126,9 +122,10 @@
$row = 1;
$id = -1;
- foreach ($this->obj->member as $i => $o) {
+ foreach ($this->obj->member as $i => $xx) {
+ $o = $xx[0];
+ if (!is_object($o)) continue;
$o->read_locs_data();
-
foreach ($o->location as $i2 => $o2) {
$this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-'. $o2->id ,$this->format2);
if ($o->gettype() == "address") {
@@ -186,7 +183,7 @@
fclose($fh);
@unlink($tmpname);
- return;
+ return;
}
function complete() {
Modified: trunk/php/report-engine/rep_index/rep_index.pinc
===================================================================
--- trunk/php/report-engine/rep_index/rep_index.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/report-engine/rep_index/rep_index.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,10 +1,10 @@
<?php
/**
- * Copyright 2004 - 2007 by Gero Kohnert
+ * Copyright 2004 - 2011 by Gero Kohnert
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; version 2 of the License.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
*
* SVN Info $Id$
* $Author$
@@ -53,7 +53,7 @@
$pdf->SetY($y);
$pdf->SetX(120);
$pdf->SetFont('Arial','B',$fs+5);
- $pdf->Cell(90,$h,$i,'B',0,'R');
+ $pdf->Cell(90,$h,$i,'B',0,'R');
$pdf->SetFont('Arial','B',$fs+1);
foreach($j as $i2 => $line) {
@@ -149,13 +149,7 @@
$pdf->Close();
$data = $pdf->buffer;
- header("Expires: 0");
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\"");
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
return $data;
}
@@ -181,6 +175,6 @@
global $lang;
return $lang['rep_index_info'];
}
-}
+ }
?>
\ No newline at end of file
Modified: trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc
===================================================================
--- trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2004 - 2009 by Gero Kohnert
+ * Copyright 2004 - 2011 by Gero Kohnert
*
*
* SVN Info $Id$
@@ -48,7 +48,7 @@
$ws = array();
$row = array();
-# read the data
+ // read the data
$q = "SELECT * from ". $this->dbconn->prefix ."products";
check_dbacl($this->dbconn, $q, $current_user->id);
$result = $this->dbconn->Exec($q);
@@ -58,16 +58,12 @@
require_once '../../libs/excel/Worksheet.php';
require_once '../../libs/excel/Workbook.php';
- header("Content-type: application/vnd.ms-excel");
- header("Content-Disposition: attachment; filename=report.xls");
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
+ export_headers('TUTOS_report','xls');
$tmpname = tempnam ($tutos[sessionpath], "report");
$workbook = new Workbook($tmpname);
-# header
+ // header
$this->format1 =& $workbook->add_format();
$this->format1->set_size(12);
$this->format1->set_bold(1);
@@ -76,7 +72,7 @@
$this->format1->set_align('center');
$this->format1->set_pattern();
-# default
+ // default
$this->format2 =& $workbook->add_format();
$this->format2->set_size(8);
$this->format2->set_align('left');
@@ -85,7 +81,7 @@
$this->new_sheet($workbook,-1,"OTHER");
$row[-1] = 2;
foreach($lang['ProdClasses2'] as $i => $j) {
- $this->new_sheet($workbook,$i,$j);
+ $this->new_sheet($workbook,$i,myiconv($j));
$row[$i] = 2;
}
@@ -100,10 +96,10 @@
$id = current($p->cl[2]);
}
if (! isset($this->ws[$id])) {
- $this->new_sheet($workbook,$id,$id);
+ $this->new_sheet($workbook,$id,myiconv($id));
$row[$id] = 2;
}
-# &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line
+ # &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line
$this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2);
@@ -139,7 +135,7 @@
fclose($fh);
@unlink($tmpname);
$result->free();
- return;
+ return;
}
function complete() {
@@ -163,6 +159,6 @@
return $lang['rep_prod_excel_info'];
}
-}
+ }
?>
\ No newline at end of file
Modified: trunk/php/report-engine/rep_spine/rep_spine.pinc
===================================================================
--- trunk/php/report-engine/rep_spine/rep_spine.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/report-engine/rep_spine/rep_spine.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,10 +1,10 @@
<?php
/**
- * Copyright 2004 - 2007 by Gero Kohnert
+ * Copyright 2004 - 2011 by Gero Kohnert
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; version 2 of the License.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; version 2 of the License.
*
* SVN Info $Id$
* $Author$
@@ -12,148 +12,143 @@
class rep_spine extends rep_base {
- function rep_spine($dbconn,$report) {
- $this->init($dbconn,$report);
- $this->format = "pdf";
- $this->obj = -1;
- $this->fid = -1;
+ function rep_spine($dbconn,$report) {
+ $this->init($dbconn,$report);
+ $this->format = "pdf";
+ $this->obj = -1;
+ $this->fid = -1;
- if (isset($_GET['id'])) {
- $this->obj = getObject($this->dbconn,$_GET['id']);
+ if (isset($_GET['id'])) {
+ $this->obj = getObject($this->dbconn,$_GET['id']);
+ }
+ if (isset($_GET['fid'])) {
+ $this->fid = $_GET['fid'];
+ }
}
- if (isset($_GET['fid'])) {
- $this->fid = $_GET['fid'];
- }
- }
- function show() {
- global $tutos,$lang;
+ function show() {
+ global $tutos,$lang;
- $this->obj->readroles();
+ $this->obj->readroles();
- $pdf=new tutospdf($this->dbconn);
- $pdf->Open();
- $pdf->setAuthor($this->obj->creator->getFullName());
- $pdf->setTitle($this->obj->getFullName());
- $pdf->setSubject($this->obj->getFullName());
- $pdf->SetAutoPageBreak(false,0);
+ $pdf=new tutospdf($this->dbconn);
+ $pdf->Open();
+ $pdf->setAuthor($this->obj->creator->getFullName());
+ $pdf->setTitle($this->obj->getFullName());
+ $pdf->setSubject($this->obj->getFullName());
+ $pdf->SetAutoPageBreak(false,0);
- $pdf->header = false;
- $pdf->footer = false;
+ $pdf->header = false;
+ $pdf->footer = false;
- $pdf->AddPage();
- $xoff = 4;
- $yoff = 6;
- $pos = $_GET['pos']; // Feld Nummer
- $w = 40; // Breite
+ $pdf->AddPage();
+ $xoff = 4;
+ $yoff = 6;
+ $pos = $_GET['pos']; // Feld Nummer
+ $w = 40; // Breite
- $h = 0;
- $pdf->SetY($yoff + 20);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',22);
- $pdf->Cell($w,$h,$lang['rep_spine_company'],'',0,'C');
+ $h = 0;
+ $pdf->SetY($yoff + 20);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',22);
+ $pdf->Cell($w,$h,$lang['rep_spine_company'],'',0,'C');
- $pdf->SetY($yoff + 45);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',12);
- $pdf->Cell($w,$h,$lang['rep_spine_department'],'',0,'C');
+ $pdf->SetY($yoff + 45);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',12);
+ $pdf->Cell($w,$h,$lang['rep_spine_department'],'',0,'C');
- $pdf->SetY($yoff + 60);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',15);
- $xx = explode("/",$this->obj->desc2);
- $pdf->Cell($w,$h,$xx[0],'',0,'C');
- $pdf->SetY($yoff + 65);
- $pdf->SetX($xoff + $pos * $w);
- if (isset($xx[1])) {
- $pdf->Cell($w,$h,$xx[1],'',0,'C');
- }
- $pdf->SetY($yoff + 85);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','',7);
- $pdf->Cell($w,$h,$lang['rep_spine_title'],'',0,'C');
+ $pdf->SetY($yoff + 60);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',15);
+ $xx = explode("/",$this->obj->desc2);
+ $pdf->Cell($w,$h,$xx[0],'',0,'C');
+ $pdf->SetY($yoff + 65);
+ $pdf->SetX($xoff + $pos * $w);
+ if (isset($xx[1])) {
+ $pdf->Cell($w,$h,$xx[1],'',0,'C');
+ }
+ $pdf->SetY($yoff + 85);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','',7);
+ $pdf->Cell($w,$h,$lang['rep_spine_title'],'',0,'C');
- $pdf->SetY($yoff + 110);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',10);
- $pdf->Cell($w,$h,$this->obj->getFullName(),'',0,'C');
+ $pdf->SetY($yoff + 110);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',10);
+ $pdf->Cell($w,$h,$this->obj->getFullName(),'',0,'C');
- //Ordnernummer
- $pdf->SetFont('Arial','B',9);
- $i1 = 0;
- foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) {
- $pdf->SetY($yoff + 175+ $i1*5);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->Cell($w,$h,$j->getFullName(),'',0,'C');
- $i1++;
- }
+ //Ordnernummer
+ $pdf->SetFont('Arial','B',9);
+ $i1 = 0;
+ foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) {
+ $pdf->SetY($yoff + 175+ $i1*5);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->Cell($w,$h,$j->getFullName(),'',0,'C');
+ $i1++;
+ }
- //Ordnernummer
- $pdf->SetY($yoff + 195);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',10);
- $pdf->Cell($w,$h,$this->fid,'',0,'C');
+ //Ordnernummer
+ $pdf->SetY($yoff + 195);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',10);
+ $pdf->Cell($w,$h,$this->fid,'',0,'C');
- $pdf->SetY($yoff + 222);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','B',35);
- $pdf->Cell($w,$h,"O",'',0,'C');
+ $pdf->SetY($yoff + 222);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','B',35);
+ $pdf->Cell($w,$h,"O",'',0,'C');
- $pdf->SetY($yoff + 259);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','',7);
- $pdf->Cell($w,$h,$lang['rep_spine_subline1_head'],'',0,'C');
+ $pdf->SetY($yoff + 259);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','',7);
+ $pdf->Cell($w,$h,$lang['rep_spine_subline1_head'],'',0,'C');
- $pdf->SetY($yoff + 274);
- $pdf->SetX($xoff + $pos * $w);
- $pdf->SetFont('Arial','',7);
- $pdf->Cell($w,$h,$lang['rep_spine_subline2_head'],'',0,'C');
+ $pdf->SetY($yoff + 274);
+ $pdf->SetX($xoff + $pos * $w);
+ $pdf->SetFont('Arial','',7);
+ $pdf->Cell($w,$h,$lang['rep_spine_subline2_head'],'',0,'C');
- $pdf->Close();
- $data = $pdf->buffer;
- header("Expires: 0");
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
+ $pdf->Close();
+ $data = $pdf->buffer;
+
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
+ Header('Content-Length: '.strlen($data));
+ return $data;
}
- Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\"");
- Header("Content-Description: Upload from TUTOS" );
- Header('Content-Length: '.strlen($data));
- return $data;
- }
- function complete() {
- if ($this->obj == -1) return false;
- return true;
- }
+ function complete() {
+ if ($this->obj == -1) return false;
+ return true;
+ }
- function ask_form() {
- global $lang;
- $r = "";
- $r .= $lang['rep_spine_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />";
- $r .= $lang['rep_spine_pos'] .":<select name=\"pos\">\n";
- $r .= " <option value=\"0\">1</option>\n";
- $r .= " <option value=\"1\">2</option>\n";
- $r .= " <option value=\"2\">3</option>\n";
- $r .= " <option value=\"3\">4</option>\n";
- $r .= " <option value=\"4\">5</option>\n";
- $r .= "</select>\n";
- $r .= "<br />\n";
- return $r;
- }
+ function ask_form() {
+ global $lang;
+ $r = "";
+ $r .= $lang['rep_spine_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />";
+ $r .= $lang['rep_spine_pos'] .":<select name=\"pos\">\n";
+ $r .= " <option value=\"0\">1</option>\n";
+ $r .= " <option value=\"1\">2</option>\n";
+ $r .= " <option value=\"2\">3</option>\n";
+ $r .= " <option value=\"3\">4</option>\n";
+ $r .= " <option value=\"4\">5</option>\n";
+ $r .= "</select>\n";
+ $r .= "<br />\n";
+ return $r;
+ }
- function getFullname() {
- global $lang;
- return $lang['rep_spine_name'];
- }
+ function getFullname() {
+ global $lang;
+ return $lang['rep_spine_name'];
+ }
- function getInfo() {
- global $lang;
- return $lang['rep_spine_info'];
+ function getInfo() {
+ global $lang;
+ return $lang['rep_spine_info'];
+ }
+
}
-}
-
-?>
+?>
\ No newline at end of file
Modified: trunk/php/scrum/log_overview.php
===================================================================
--- trunk/php/scrum/log_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/scrum/log_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -37,14 +37,7 @@
$r = '';
- Header('Content-Disposition: inline; filename="TUTOS_backlog_export_'.uniqid().'.csv"');
- Header("Content-Description: Upload from TUTOS" );
- Header("Content-Type: text/csv");
-# Header("Content-Type: text/plain");
- Header("Expires: -1");
- Header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- Header("Pragma: public");
-
+ export_headers('TUTOS_backlog_export','csv');
$n = $this->result->numrows();
$x = 0;
$r .= txt2csv('ID');
Modified: trunk/php/stuff/stuff_overview.php
===================================================================
--- trunk/php/stuff/stuff_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/stuff/stuff_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2004 - 2010 by Gero Kohnert
+ * Copyright 2004 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -173,17 +173,8 @@
$this->pdf->Close();
$r = $this->pdf->buffer;
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $this->name.'_'.Date('YmdHi').'.pdf"');
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->name,'pdf');
Header('Content-Length: '.strlen($r));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
-
return $r;
}
@@ -570,5 +561,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/team.pinc
===================================================================
--- trunk/php/team.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/team.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -491,7 +491,7 @@
}
}
- acl_raise($this,$this->id,$tutos[seeok]);
+ acl_raise($this,$this->id,$tutos[useok]);
$msg .= parent::save();
return $msg;
Modified: trunk/php/team_overview.php
===================================================================
--- trunk/php/team_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/team_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2010 by Gero Kohnert
+ * Copyright 1999 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -239,5 +239,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/team_show.php
===================================================================
--- trunk/php/team_show.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/team_show.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2010 by Gero Kohnert
+ * Copyright 1999 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -153,16 +153,8 @@
$pdf->Close();
$data = $pdf->buffer;
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $this->obj->name.'_'.Date('YmdHi').'.pdf"');
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -174,8 +166,6 @@
$r = '';
if ($this->format == 'pdf') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->pdf();
}
Modified: trunk/php/testmanager/de.p3
===================================================================
--- trunk/php/testmanager/de.p3 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/testmanager/de.p3 2011-07-04 15:54:09 UTC (rev 222)
@@ -57,7 +57,7 @@
$lang['TestsuiteDeleteI'] = 'delete testsuite %s';
$lang['TestsuiteMod'] = 'modify this testsuite';
$lang['TestsuiteLinkInfo'] = 'a testsuite for %s';
-$lang['TestsuiteSearch'] = 'Testsuite Search';
+$lang['TestsuiteSearch'] = 'Testspezifikation Suche';
$lang['TestsuiteSearchI'] = 'Search for testsuite';
$lang['TestsuiteSelInfo'] = '(leere Eingabe zeigt alles)';
$lang['TestsuiteCSVExport'] = 'CSV Export';
Modified: trunk/php/testmanager/testrun_show.php
===================================================================
--- trunk/php/testmanager/testrun_show.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/testmanager/testrun_show.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -196,16 +196,8 @@
$data = $pdf->Output('','S');
$pdf->Close();
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $this->obj->name .'_'.Date('YmdHi').'.pdf"');
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$this->obj->name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: -1");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -216,8 +208,6 @@
global $lang,$tutos;
if ($this->format == 'pdf') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->pdf_info();
}
if ($this->format == 'stat') {
Modified: trunk/php/testmanager/testsuite_show.php
===================================================================
--- trunk/php/testmanager/testsuite_show.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/testmanager/testsuite_show.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2000 - 2010 by Gero Kohnert
+ * Copyright 2000 - 2011 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -160,16 +160,8 @@
$data = $this->obj->fillCSV();
$name = preg_replace("#\r\n#","_",$this->obj->name);
$name = preg_replace("#\n#","_",$name);
- Header("Content-Type: text/csv");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send CSV file');
- }
- Header("Content-Disposition: inline; filename=\"". $name .".csv\"");
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$name,'csv');
Header('Content-Length: '.strlen($data));
- header("Expires: 0");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -198,16 +190,8 @@
$pdf->Close();
$name = preg_replace("#\r\n#","_",$this->obj->name);
$name = preg_replace("#\n#","_",$name);
- Header("Content-Type: application/pdf");
- if(headers_sent()) {
- Fatal_Error('Some data has already been output to browser, can\'t send PDF file');
- }
- Header('Content-Disposition: inline; filename="'. $name.'_'.Date('YmdHi').'.pdf"');
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_'.$name,'pdf');
Header('Content-Length: '.strlen($data));
- header("Expires: -1");
- header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
- header("Pragma: public");
return $data;
}
@@ -218,13 +202,9 @@
global $lang,$tutos;
if ($this->format == 'pdf') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->pdf_info();
}
if ($this->format == 'csv') {
- Header("Expires: 0");
- Header("Pragma: no-cache");
return $this->csv_info();
}
if ($this->mode == 'simulate') {
Modified: trunk/php/timetrack/timetrack.pinc
===================================================================
--- trunk/php/timetrack/timetrack.pinc 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/timetrack/timetrack.pinc 2011-07-04 15:54:09 UTC (rev 222)
@@ -666,16 +666,28 @@
global $lang;
if ( $this->ref->id > 0 ) {
- $r = $this->ref->getFullName();
+ $ref = $this->ref->getFullName();
} else {
- $r = $lang['HistoryDeleted'];
+ $ref = $lang['HistoryDeleted'];
}
if ( $this->worker->id > 0 ) {
$w = $this->worker->getFullName();
} else {
$w = $lang['HistoryDeleted'];
}
- return $this->id .",\"". $w ."\",\"". $r ."\",\"". $this->desc ."\",". $this->volume .",". $this->cph .",\"". $this->currency ."\",". $this->state .",". $this->wday->getYYYYMMDD() ."\n";
+ $r = '';
+ $r .= txt2csv($this->id);
+ $r .= txt2csv($w);
+ $r .= txt2csv($ref);
+ $r .= txt2csv($this->desc);
+ $r .= txt2csv($this->volume);
+ $r .= txt2csv($this->cph);
+ $r .= txt2csv($this->currency);
+ $r .= txt2csv($this->state);
+ $r .= txt2csv($this->wday->getYYYYMMDD());
+ $r .= "\r\n";
+
+ return $r;
}
/**
Modified: trunk/php/timetrack/timetrack_overview.php
===================================================================
--- trunk/php/timetrack/timetrack_overview.php 2011-07-04 15:52:28 UTC (rev 221)
+++ trunk/php/timetrack/timetrack_overview.php 2011-07-04 15:54:09 UTC (rev 222)
@@ -378,11 +378,20 @@
global $lang,$tutos;
$r = '';
- Header("Content-type: text");
- Header("Content-Disposition: attachment; filename=\"TUTOS_timetrack_export.csv\"");
- Header("Content-Description: Upload from TUTOS" );
+ export_headers('TUTOS_timetrack_export','csv');
$n = $this->result->numrows();
$a = 0;
+
+ $r .= txt2csv('ID');
+ $r .= txt2csv('TimetrackWorker');
+ $r .= txt2csv('TimetrackRef');
+ $r .= txt2csv('Description');
+ $r .= txt2csv('TaskVolumeDone');
+ $r .= txt2csv('TTcph');
+ $r .= txt2csv('Currency');
+ $r .= txt2csv('TTState');
+ $r .= txt2csv('TimetrackDate');
+ $r .= "\r\n";
while ( $a < $n ) {
$tt = new timetrack($this->dbconn);
$tt->read_result($this->result,$a);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|