-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf_review.php
88 lines (79 loc) · 4.07 KB
/
pdf_review.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?
// ReqHeap - a simple requirement management program.
//
// Copyright (C) 2007 Slav Peev , Matthias Gunter
// Programmed by i-nature.com
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// -----------------------------------------------------------------
//
// Page: "pdf review" - converting project into review file
session_start();
include ("admin/inc/conn.php");//include settings file
include ("admin/inc/func.php");//include functions file
if ($r_id=="") echo "No review selected";
else
{
//getting which fields to display
$fields="";
if ($description==1) $fields.="1";else $fields.="0";
if ($project==1) $fields.="1";else $fields.="0";
if ($subproject==1) $fields.="1";else $fields.="0";
if ($release==1) $fields.="1";else $fields.="0";
if ($test_case==1) $fields.="1";else $fields.="0";
if ($stakeholder==1) $fields.="1";else $fields.="0";
if ($glossary==1) $fields.="1";else $fields.="0";
if ($state==1) $fields.="1";else $fields.="0";
if ($type==1) $fields.="1";else $fields.="0";
if ($priority==1) $fields.="1";else $fields.="0";
if ($assign_to==1) $fields.="1";else $fields.="0";
if ($rid==1) $fields.="1";else $fields.="0";
if ($version==1) $fields.="1";else $fields.="0";
if ($component==1) $fields.="1";else $fields.="0";
if ($source==1) $fields.="1";else $fields.="0";
if ($risk==1) $fields.="1";else $fields.="0";
if ($complexity==1) $fields.="1";else $fields.="0";
if ($weight==1) $fields.="1";else $fields.="0";
if ($open_points==1) $fields.="1";else $fields.="0";
if ($keywords==1) $fields.="1";else $fields.="0";
if ($satisfaction==1) $fields.="1";else $fields.="0";
if ($dissatisfaction==1) $fields.="1";else $fields.="0";
if ($depends==1) $fields.="1";else $fields.="0";
if ($conflicts==1) $fields.="1";else $fields.="0";
if ($author==1) $fields.="1";else $fields.="0";
if ($url==1) $fields.="1";else $fields.="0";
if ($parent==1) $fields.="1";else $fields.="0";
if ($position==1) $fields.="1";else $fields.="0";
if ($userfields==1) $fields.="1";else $fields.="0";
if ($creation_date==1) $fields.="1";else $fields.="0";
if ($last_change==1) $fields.="1";else $fields.="0";
if ($accepted_date==1) $fields.="1";else $fields.="0";
if ($accepted_user==1) $fields.="1";else $fields.="0";
if ($comments==1) $fields.="1";else $fields.="0";
$query="select r_name from reviews where r_id=".$r_id;
$rs = mysql_query($query) or die(mysql_error());
if($row=mysql_fetch_array($rs)) $pdf_name=htmlspecialchars($row['r_name']);
$pdf_name=substr($pdf_name,0,25)."_".date("d_m_Y");
if (strstr(rawurlencode($pdf_name.".pdf"),'%')) $pdf_name="project_".date("d_m_Y");
if ($mode=="") $mode="landscape";
include ("ini/params.php");//include configuration file
$filename = PROJECT_URL."/print_review.php?r_id=".$r_id."|".$filter1."|".$filter2."|".$filter4."|".$filter5."|".$filter6."|".$filter7."|".$filter8."|".$order."|".$_SESSION['chlang']."|".$ids."|".$fields;
//$url = PDF_SCRIPT_URL."dompdf.php?input_file=".PROJECT_URL."/test4.html&save_file=1&paper=letter&orientation=".$mode."&output_file=" . rawurlencode($pdf_name.".pdf");
//$filename="../test1.html";
$url = PDF_SCRIPT_URL."dompdf.php?input_file=".$filename."&paper=letter&orientation=".$mode."&output_file=" . rawurlencode($pdf_name.".pdf");
header("Location:".$url);
?>
<script>document.location.href='<?=$url?>'</script>
<?}?>