* Copyright 2002 GForge, LLC
* http://gforge.org/
*
- * @version $Id$
*/
/*
Total rewrite in OO and GForge coding guidelines 12/2002 by Tim Perdue
*/
-//pm_header(array('title'=>'Browse Tasks','pagename'=>$pagename,'group_project_id'=>$group_project_id,'sectionvals'=>$g->getPublicName()));
-
?>
-<html>
-<body>
-<?php
-/*
- creating a custom technician box which includes "any" and "unassigned"
-*/
-
-$res_tech=$pg->getTechnicians();
-$tech_id_arr=util_result_column_to_array($res_tech,0);
-$tech_id_arr[]='0'; //this will be the 'any' row
+<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?>
-$tech_name_arr=util_result_column_to_array($res_tech,1);
-$tech_name_arr[]=$Language->getText('pm','any');
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-$tech_box=html_build_select_box_from_arrays ($tech_id_arr,$tech_name_arr,'_assigned_to',$_assigned_to,true,$Language->getText('pm','unassigned'));
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en ">
-/*
- creating a custom category box which includes "any" and "none"
-*/
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title><?php echo _('Gantt Chart');?></title>
+ </head>
+ <body>
+<?php
-$res_cat=$pg->getCategories();
+$_assigned_to = getIntFromRequest('_assigned_to', 0);
+$_category_id = getIntFromRequest('_category_id');
+$_order = getIntFromRequest('_order');
+$_resolution = getStringFromRequest('_resolution');
+$_size = getIntFromRequest('_size', 800);
+$_status = getIntFromRequest('_status', 100);
+$_order = getStringFromRequest('_order');
-$cat_id_arr=util_result_column_to_array($res_cat,0);
-$cat_id_arr[]='0'; //this will be the 'any' row
+$tech_box=html_build_select_box($pg->getTechnicians(),'_assigned_to',$_assigned_to,true,_('Unassigned'), true, _('Any'));
-$cat_name_arr=util_result_column_to_array($res_cat,1);
-$cat_name_arr[]=$Language->getText('pm','any');
+$status_box=html_build_select_box($pg->getStatuses(),'_status',$_status, false, '', true, _('Any'));
-$cat_box=html_build_select_box_from_arrays ($cat_id_arr,$cat_name_arr,'_category_id',$_category_id,true,$Language->getText('pm','none').$Language->getText('pm','none'));
+$cat_box=html_build_select_box($pg->getCategories(), '_category_id', $_category_id, true, _('None'), true, _('Any'));
/*
Creating a custom sort box
*/
$title_arr=array();
-$title_arr[]=$Language->getText('pm','task_id');
-$title_arr[]=$Language->getText('pm','summary');
-$title_arr[]=$Language->getText('pm','start_date');
-$title_arr[]=$Language->getText('pm','end_date');
-$title_arr[]=$Language->getText('pm','percent_complete');
+$title_arr[]=_('Task Id');
+$title_arr[]=_('Task Summary');
+$title_arr[]=_('Start Date');
+$title_arr[]=_('End Date');
+$title_arr[]=_('Percent Complete');
$order_col_arr=array();
$order_col_arr[]='project_task_id';
$order_col_arr[]='percent_complete';
$order_box=html_build_select_box_from_arrays ($order_col_arr,$title_arr,'_order',$_order,false);
+$dispres_col_arr=array();
+$dispres_col_arr[]='Years';
+$dispres_col_arr[]='Months';
+$dispres_col_arr[]='Weeks';
+$dispres_col_arr[]='Days';
+
$dispres_title_arr=array();
-$dispres_title_arr[]=$Language->getText('pm_ganttpage','months');
-$dispres_title_arr[]=$Language->getText('pm_ganttpage','weeks');
-$dispres_title_arr[]=$Language->getText('pm_ganttpage','days');
+$dispres_title_arr[]=_('Years');
+$dispres_title_arr[]=_('Months');
+$dispres_title_arr[]=_('Weeks');
+$dispres_title_arr[]=_('Days');
if (!$_resolution) {
- $_resolution='Weeks';
+ $_resolution=_('Months');
}
-$dispres_box=html_build_select_box_from_arrays ($dispres_title_arr,$dispres_title_arr,'_resolution',$_resolution,false);
+$dispres_box=html_build_select_box_from_arrays ($dispres_col_arr,$dispres_title_arr,'_resolution',$_resolution,false);
/*
Graph Size Box
$size_title_arr[]='800 x 600';
$size_title_arr[]='1024 x 768';
$size_title_arr[]='1600 x 1200';
-if (!$_size) {
- $_size='800';
-}
+
$size_box=html_build_select_box_from_arrays ($size_col_arr,$size_title_arr,'_size',$_size,false);
+
/*
Show the new pop-up boxes to select assigned to and/or status
*/
-echo '<table width="10%" border="0">
- <form action="'. $PHP_SELF .'?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=ganttpage" method="post">
- <input type="hidden" name="set" value="custom">
+ global $_size;
+ if ($_size==640) {
+ $gantt_width=740;
+ $gantt_height=620;
+ } elseif ($_size==1024) {
+ $gantt_width=1084;
+ $gantt_height=920;
+ } elseif ($_size==1600) {
+ $gantt_width=1660;
+ $gantt_height=1340;
+ } else {
+ $gantt_width=860;
+ $gantt_height=740;
+ }
+ //echo "XX $_size $gantt_width $gantt_height XX";
+ ?>
+ <script type="text/javascript">
+<!--
+ function setSize(width,height) {
+ if (window.outerWidth) {
+ window.outerWidth = width;
+ window.outerHeight = height;
+ window.resize();
+ }
+ else if (window.resizeTo) {
+ window.resizeTo(width,height);
+ }
+ else {
+ alert("Not supported.");
+ }
+ }
+ window.setSize(<?php echo $gantt_width; ?>,<?php echo $gantt_height; ?>);
+//-->
+ </script>
+ <?php
+
+echo ' <form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=ganttpage" method="post">
+ <table width="10%" border="0" class="tableheading">
<tr>
- <td><font size="-1">'.$Language->getText('pm_ganttpage','assignee').':<br />'. $tech_box .'</td>
- <td><font size="-1">'.$Language->getText('pm','status').':<br />'. $pg->statusBox('_status',$_status,'Any') .'</td>
- <td><font size="-1">'.$Language->getText('pm','category').':<br />'. $cat_box .'</td>
- <td><font size="-1">'.$Language->getText('pm_ganttpage','sort_on').':<br />'. $order_box .'</td>
- <td><font size="-1">'.$Language->getText('pm_ganttpage','resolution').':<br />'. $dispres_box .'</td>
- <td><font size="-1">'.$Language->getText('pm_ganttpage','size').':<br />'. $size_box .'</td>
- <td><font size="-1"><input type="SUBMIT" name="SUBMIT" value="'.$Language->getText('general','browse').'"></td>
- </tr></form></table>';
-
-echo '<img src="'. $PHP_SELF .
- '?func=ganttchart&group_id='.$group_id.
- '&group_project_id='.$group_project_id.
- '&_assigned_to='.$_assigned_to.
- '&_order='.$_order.
- '&_resolution='.$_resolution.
- '&_category_id='.$_category_id.
- '&_size='.$_size.
- '&rand='.time().'">';
+ <td>'._('Assignee').'<br />'. $tech_box .'</td>
+ <td>'._('Status').'<br />'. $status_box .'</td>
+ <td>'._('Category').'<br />'. $cat_box .'</td>
+ <td>'._('Sort On').'<br />'. $order_box .'</td>
+ <td>'._('Resolution').'<br />'. $dispres_box .'</td>
+ <td>'._('Size').'<br />'. $size_box .'</td>
+ <td><input type="submit" name="submit" value="'._('Browse').'" /></td>
+ </tr></table></form>';
+
+echo '<img src="'. getStringFromServer('PHP_SELF') .
+ '?func=ganttchart&group_id='.$group_id.
+ '&group_project_id='.$group_project_id.
+ '&_assigned_to='.$_assigned_to.
+ '&_status='.$_status.
+ '&_order='.$_order.
+ '&_resolution='.$_resolution.
+ '&_category_id='.$_category_id.
+ '&_size='.$_size.
+ '&rand='.time().'" alt="'. _('Gantt Chart').'" />';
//pm_footer(array());
?>