Link Here
|
1 |
--- share/pnp/include/function.inc.php.orig 2008-06-18 12:02:41.000000000 +0400 |
1 |
--- share/pnp/include/function.inc.php.orig 2008-10-11 18:13:34.000000000 +0400 |
2 |
+++ share/pnp/include/function.inc.php 2008-08-16 23:35:30.000000000 +0400 |
2 |
+++ share/pnp/include/function.inc.php 2008-12-24 01:03:58.000000000 +0300 |
3 |
@@ -819,114 +819,15 @@ |
3 |
@@ -982,123 +982,6 @@ |
4 |
} |
4 |
} |
5 |
|
5 |
|
6 |
function doPDF($display,$data) { |
6 |
function doPDF($display,$data) { |
Link Here
|
54 |
- $pdf->AddPage(); |
54 |
- $pdf->AddPage(); |
55 |
- if($use_bg){$pdf->useTemplate($tplIdx);} |
55 |
- if($use_bg){$pdf->useTemplate($tplIdx);} |
56 |
- } |
56 |
- } |
57 |
- |
57 |
- if($d['source'] == 1){ |
58 |
- $pdf->SetFont('Arial', '', 10); |
58 |
- $pdf->SetFont('Arial', '', 10); |
59 |
- $pdf->CELL(120, 5, $d["n_hostname"]." / ".$d["n_servicedesc"] , 0, 1); |
59 |
- $pdf->CELL(120, 5, $d["n_hostname"]." / ".$d["n_servicedesc"] , 0, 1); |
60 |
- $pdf->SetFont('Arial', '', 8); |
60 |
- $pdf->SetFont('Arial', '', 8); |
61 |
- $pdf->CELL(120, 5, $d["view_title"]. " (" . $d["f_start"]." - ".$d["f_end"].")", 0, 1); |
61 |
- $pdf->CELL(120, 5, $d["view_title"]. " (" . $d["f_start"]." - ".$d["f_end"].")", 0, 1); |
62 |
- |
62 |
- $pdf->CELL(120, 5, _DATASOURCE ." ".$d["ds_name"], 0, 1); |
|
|
63 |
- }else{ |
64 |
- $pdf->SetFont('Arial', '', 8); |
65 |
- $pdf->CELL(120, 5, _DATASOURCE ." ".$d["ds_name"], 0, 1); |
66 |
- } |
63 |
- $img = saveImage($d['rrd_opts']); |
67 |
- $img = saveImage($d['rrd_opts']); |
64 |
- $Y = $pdf->GetY(); |
68 |
- $Y = $pdf->GetY(); |
65 |
- $cell_height = ($img['height'] * 0.23); |
69 |
- $cell_height = ($img['height'] * 0.23); |
Link Here
|
96 |
- $pdf->AddPage(); |
100 |
- $pdf->AddPage(); |
97 |
- if($use_bg){$pdf->useTemplate($tplIdx);} |
101 |
- if($use_bg){$pdf->useTemplate($tplIdx);} |
98 |
- } |
102 |
- } |
99 |
- $pdf->SetFont('Arial', '', 10); |
103 |
- if($d['source'] == 1){ |
100 |
- $pdf->CELL(120, 7, $d["hostname"]." / ".$d["servicedesc"] , 0, 1); |
104 |
- $pdf->SetFont('Arial', '', 10); |
101 |
- $pdf->SetFont('Arial', '', 8); |
105 |
- $pdf->CELL(120, 5, $d["n_hostname"]." / ".$d["n_servicedesc"] , 0, 1); |
102 |
- $pdf->CELL(120, 5, $d["f_start"]." - ".$d["f_end"], 0, 1); |
106 |
- $pdf->SetFont('Arial', '', 8); |
|
|
107 |
- $pdf->CELL(120, 5, $d["view_title"]. " (" . $d["f_start"]." - ".$d["f_end"].")", 0, 1); |
108 |
- $pdf->CELL(120, 5, _DATASOURCE ." ".$d["ds_name"], 0, 1); |
109 |
- }else{ |
110 |
- $pdf->SetFont('Arial', '', 8); |
111 |
- $pdf->CELL(120, 5, _DATASOURCE ." ".$d["ds_name"], 0, 1); |
112 |
- } |
103 |
- |
113 |
- |
104 |
- $img = saveImage($d['rrd_opts']); |
114 |
- $img = saveImage($d['rrd_opts']); |
105 |
- $Y = $pdf->GetY(); |
115 |
- $Y = $pdf->GetY(); |
Link Here
|
110 |
- unlink($img['name']); |
120 |
- unlink($img['name']); |
111 |
- } |
121 |
- } |
112 |
- } |
122 |
- } |
113 |
- |
123 |
- $pdf->Output("pnp4nagios.pdf","I"); |
114 |
- $pdf->Output(); |
124 |
exit; |
115 |
+ print "<html>\n"; |
|
|
116 |
+ print "<head>\n"; |
117 |
+ print "<title>Failed</title>\n"; |
118 |
+ print "</head>\n"; |
119 |
+ print "<body>\n"; |
120 |
+ print "<h1>Failed</h1>\n"; |
121 |
+ print "</body>\n"; |
122 |
+ print "<html>\n"; |
123 |
+ exit(0); |
124 |
} |
125 |
} |
125 |
|
126 |
|
126 |
function doStrip($string) { |
127 |
@@ -1350,23 +1233,6 @@ |
127 |
@@ -1173,23 +1074,6 @@ |
|
|
128 |
} |
128 |
} |
129 |
|
129 |
|
130 |
function doPDFIcon($type){ |
130 |
function doPDFIcon($type){ |
Link Here
|
139 |
- |
139 |
- |
140 |
- switch($type){ |
140 |
- switch($type){ |
141 |
- case "PAGE": |
141 |
- case "PAGE": |
142 |
- print "<a href=\"index.php?page=$page&display=$display&view=$view&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n"; |
142 |
- print "<a href=\"index.php?page=$page&display=$display&view=$view&end=$end&start=$start&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n"; |
143 |
- break; |
143 |
- break; |
144 |
- default: |
144 |
- default: |
145 |
- print "<a href=\"index.php?host=$hostname&srv=$servicedesc&display=$display&view=$view&source=$source&end=$end&start=$start&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n"; |
145 |
- print "<a href=\"index.php?host=$hostname&srv=$servicedesc&display=$display&view=$view&source=$source&end=$end&start=$start&do=pdf\"><img src=\"images/pdf.png\" HEIGHT=\"32px\" WIDTH=\"32px\" title=\"Display PDF\" ></a>\n"; |