1 | <?php |
---|
2 | /** |
---|
3 | * ProjectManager - Gantchart creation |
---|
4 | * |
---|
5 | * As ganttcharts contain an image-map and the image, we save the image as a temporary file. |
---|
6 | * This for performance reasons, it saves a second creation / script-run. |
---|
7 | * This script reads and output the temporary file/image and unlinks it after. |
---|
8 | * If the temp. image is not found, it creates a new one. |
---|
9 | * It can be used standalone, eg. from SiteMgr. |
---|
10 | * |
---|
11 | * @link http://www.egroupware.org |
---|
12 | * @author Ralf Becker <RalfBecker-AT-outdoor-training.de> |
---|
13 | * @package projectmanager |
---|
14 | * @copyright (c) 2005 by Ralf Becker <RalfBecker-AT-outdoor-training.de> |
---|
15 | * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License |
---|
16 | * @version $Id: ganttchart.php 22355 2006-08-26 16:30:45Z ralfbecker $ |
---|
17 | */ |
---|
18 | |
---|
19 | error_reporting(E_ALL & ~E_NOTICE); |
---|
20 | |
---|
21 | $tmp = $GLOBALS['phpgw_info']['server']['temp_dir']; |
---|
22 | if (!$tmp || !is_dir($tmp) || !is_writable($tmp)) |
---|
23 | { |
---|
24 | @unlink($tmp = tempnam('','test')); // get the systems temp-dir |
---|
25 | $tmp = dirname($tmp); |
---|
26 | } |
---|
27 | if (isset($_GET['img']) && is_readable($ganttchart = $tmp.'/'.basename($_GET['img']))) |
---|
28 | { |
---|
29 | header('Content-type: image/png'); |
---|
30 | readfile($ganttchart); |
---|
31 | @unlink($ganttchart); |
---|
32 | exit; |
---|
33 | } |
---|
34 | |
---|
35 | $GLOBALS['phpgw_info'] = array( |
---|
36 | 'flags' => array( |
---|
37 | 'currentapp' => 'projectmanager', |
---|
38 | 'noheader' => True, |
---|
39 | 'nonavbar' => True |
---|
40 | )); |
---|
41 | include('../header.inc.php'); |
---|
42 | |
---|
43 | ExecMethod('projectmanager.ganttchart.create'); |
---|
44 | |
---|
45 | $GLOBALS['phpgw']->common->phpgw_exit(); |
---|