*
* Copyright 2002 (c) GForge Development Team
*
- * @version $Id$
- *
* @todo some locales start the week with "Monday", and not "Sunday".
* @todo display holidays.
*/
require_once('../env.inc.php');
-require_once('pre.php');
+require_once $gfwww.'include/pre.php';
$group_id = getIntFromRequest('group_id');
$group_project_id = getIntFromRequest('group_project_id');
}
-$months = array(1 => 'january', 'february', 'march', 'april', 'may', 'june',
- 'july', 'august', 'september', 'october', 'november', 'december');
+$months = array(1 => _('January'), _('February'), _('March'), _('April'), _('May'), _('June'),
+ _('July'), _('August'), _('September'), _('October'), _('November'), _('December'));
if ($group_id && $group_project_id) {
- require_once('common/pm/ProjectTaskFactory.class.php');
- require_once('common/pm/ProjectGroup.class.php');
+ require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
+ require_once $gfcommon.'pm/ProjectGroup.class.php';
$g =& group_get_object($group_id);
if (!$g || !is_object($g)) {
function make_task_link($task, $type) {
global $HTML, $group_id, $group_project_id;
return '<a title="'. sprintf(_('Task summary: %s'), $task->getSummary())
- . '" href="'.$GLOBALS['sys_urlprefix'].'/pm/task.php?func=detailtask&project_task_id=' . $task->getID()
- . '&group_id=' . $group_id
- . '&group_project_id=' .$group_project_id
+ . '" href="'.util_make_url ('/pm/task.php?func=detailtask&project_task_id=' . $task->getID() . '&group_id=' . $group_id . '&group_project_id=' .$group_project_id)
. '">' . ($type == 'begin' ?
sprintf(_('Task %d begins'), $task->getID()) :
sprintf(_('Task %d ends'), $task->getID()) )
*
*/
function display_month($m, $y) {
- global $months, $today, $month, $day, $year, $Language, $HTML,
+ global $months, $today, $month, $day, $year, $HTML,
$pt_arr, $group_id, $group_project_id;
- $dow = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
+ $dow = array(_('Sunday'), _('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday'));
+
+ $tstamp = mktime(0, 0, 0, $m + 1, 0, $y) ;
- $date = getdate(mktime(0, 0, 0, $m + 1, 0, $y));
+ $date = getdate($tstamp);
$days_in_month = $date['mday'];
- $date = getdate(mktime(0, 0, 0, $m, 1, $y));
+ $date = getdate($tstamp);
$first_dow = $date['wday'];
$m = $date['mon'];
?>
<table align="center" cellpadding="1" cellspacing="1" border="1" width="100%">
<tr>
- <th colspan="7"><?php echo $Language->getText("calendar", $months[$m]) . " $y"; ?></th>
+ <th colspan="7"><?php echo date (_('F Y'), $tstamp); ?></th>
</tr>
<tr>
<?php
reset($dow);
while (list ($key, $val) = each ($dow)) {
- print "\t\t\t<th width=\"14%\">" . $Language->getText("calendar", $val) . "</th>\n";
+ print "\t\t\t<th width=\"14%\">$val</th>\n";
}
?>
</tr>
if ($curr_date == $today['mday']
&& $y == $today['year']
&& $m == $today['mon']) {
- $colour = " today";
+ $colour = "today";
} elseif ($curr_date == $day
&& $y == $year
&& $m == $month) {
- $colour = " day";
+ $colour = "day";
}
- print "\t\t\t<td valign=\"top\" class=" . $colour . ">$curr_date";
+ print "\t\t\t<td valign=\"top\" class=\"" . $colour . "\">$curr_date";
$cell_contents = '';
$rows = count($pt_arr);
for ($i = 0; $i < $rows; $i++) {
<select name="month">
<?php
for ($i = 1; $i <= 12; $i++) {
- print "\t\t\t\t<option value=\"$i\"" . ($month == $i ? ' selected="selected"' : '') . ">" . $Language->getText("calendar", $months[$i]) . "</option>\n";
+ print "\t\t\t\t<option value=\"$i\"" . ($month == $i ? ' selected="selected"' : '') . ">" . $months[$i] . "</option>\n";
}
?>
</select>