3 * FusionForge : Project Management Facility
5 * Copyright 1999/2000, Sourceforge.net Tim Perdue
6 * Copyright 2002 GForge, LLC, Tim Perdue
7 * Copyright 2010, FusionForge Team
8 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
9 * http://fusionforge.org
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 require_once $gfwww.'include/note.php';
28 require_once $gfcommon.'reporting/report_utils.php';
29 require_once $gfcommon.'reporting/Report.class.php';
31 if (getStringFromRequest('commentsort') == 'anti') {
32 $sort_comments_chronologically = false;
34 $sort_comments_chronologically = true;
37 pm_header(array('title'=>_('Modify Task'),'pagename'=>'pm_modtask','group_project_id'=>$group_project_id));
43 <form id="modtaskform" action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&group_project_id=$group_project_id"; ?>" method="post">
44 <input type="hidden" name="func" value="postmodtask" />
45 <input type="hidden" name="project_task_id" value="<?php echo $project_task_id; ?>" />
46 <input type="hidden" name="duration" value="<?php echo $pt->getDuration(); ?>" />
47 <input type="hidden" name="parent_id" value="<?php echo $pt->getParentID(); ?>" />
49 <table class="fullwidth mod_task">
52 <td><strong><?php echo _('Submitted by') ?>:</strong><br />
53 <?php echo $pt->getSubmittedRealName(); ?> (<?php echo $pt->getSubmittedUnixName(); ?>)</td>
54 <td><input type="submit" value="<?php echo _('Submit') ?>" name="submit" /></td>
55 <td><strong>Task ID:</strong> <?php echo $project_task_id; ?> @ <?php
56 echo forge_get_config ('web_host') ; ?></td>
61 <strong><?php echo _('Category') ?></strong><br />
62 <?php echo $pg->categoryBox('category_id',$pt->getCategoryID()); ?> <?php util_make_link ('/pm/admin/?<?php echo "group_id=$group_id&add_cat=1&group_project_id='.$group_project_id,_('admin')); ?>
66 <strong><?php echo _('Subproject'); ?>:</strong><br />
67 <?php echo $pg->groupProjectBox('new_group_project_id',$group_project_id,false); ?>
71 <strong><a href="<?php echo util_make_url("/pm/t_follow.php/" . $project_task_id); ?>">Permalink</a>:</strong><br />
72 <?php echo util_make_url("/pm/t_follow.php/" . $project_task_id); ?>
78 <strong><?php echo _('Percent Complete') ?>:</strong><br />
79 <?php echo $pg->percentCompleteBox('percent_complete',$pt->getPercentComplete()); ?>
83 <strong><?php echo _('Priority') ?>:</strong><br />
84 <?php echo build_priority_select_box('priority',$pt->getPriority()); ?>
88 <strong>Task Detail Information (JSON):</strong><br />
89 <a href="<?php echo util_make_url("/pm/t_lookup.php?tid=" . $project_task_id); ?>">application/json</a>
91 <a href="<?php echo util_make_url("/pm/t_lookup.php?text=1&tid=" . $project_task_id); ?>">text/plain</a>
97 <strong><?php echo _('Task Summary') ?>:</strong><br />
98 <input type="text" name="summary" size="65" maxlength="65" value="<?php echo $pt->getSummary(); ?>" />
101 <a href="<?php echo getStringFromServer('PHP_SELF')."?func=deletetask&project_task_id=$project_task_id&group_id=$group_id&group_project_id=$group_project_id"; ?>"><?php echo _('Delete this task') ?></a>
104 <?php echo util_make_link("/export/rssAboTask.php?tid=" .
105 $project_task_id, html_image('ic/rss.png',
106 16, 16, array('border' => '0')) . " " .
107 _('Subscribe to task'));
114 <strong><?php echo _('Original Comment') ?>:</strong><br />
116 $sanitizer = new TextSanitizer();
117 $body = $sanitizer->SanitizeHtml($pt->getDetails());
119 if (strpos($body,'<') === false) {
120 echo nl2br($pt->getDetails());
126 <strong><?php echo _('Add A Comment') ?>:</strong><?php echo notepad_button('document.forms.modtaskform.details') ?><br />
128 $GLOBALS['editor_was_set_up']=false;
130 $params['name'] = 'details';
131 $params['width'] = "800";
132 $params['height'] = "300";
133 $params['body'] = "";
134 $params['group'] = $group_id;
135 plugin_hook("text_editor",$params);
136 if (!$GLOBALS['editor_was_set_up']) {
137 echo '<textarea name="details" rows="5" cols="80"></textarea>';
139 unset($GLOBALS['editor_was_set_up']);
146 <strong><?php echo _('Start Date') ?>:</strong><br />
148 echo $pg->showMonthBox ('start_month',date('m', $pt->getStartDate()));
149 echo $pg->showDayBox ('start_day',date('d', $pt->getStartDate()));
150 echo $pg->showYearBox ('start_year',date('Y', $pt->getStartDate()));
151 echo $pg->showHourBox ('start_hour',date('G', $pt->getStartDate()));
152 echo $pg->showMinuteBox ('start_minute',date('i',$pt->getStartDate()));
153 ?><br /><?php echo _('The system will modify your start/end dates if you attempt to create a start date earlier than the end date of any tasks you depend on.') ?>
154 <br /><a href="calendar.php?group_id=<?php echo $group_id; ?>&group_project_id=<?php echo $group_project_id; ?>" target="_blank"><?php echo _('View Calendar') ?></a>
160 <strong><?php echo _('End Date') ?>:</strong><br />
162 echo $pg->showMonthBox ('end_month',date('m', $pt->getEndDate()));
163 echo $pg->showDayBox ('end_day',date('d', $pt->getEndDate()));
164 echo $pg->showYearBox ('end_year',date('Y', $pt->getEndDate()));
165 echo $pg->showHourBox ('end_hour',date('G', $pt->getEndDate()));
166 echo $pg->showMinuteBox ('end_minute',date('i', $pt->getEndDate()));
173 <strong><?php echo _('Assigned to') ?>:</strong><br />
176 List of possible users that this one could be assigned to
178 echo $pt->multipleAssignedBox ();
182 <td class="top" colspan="2">
183 <strong><?php echo _('Dependent on task') ?>:</strong><br />
186 List of possible tasks that this one could depend on
189 echo $pt->multipleDependBox();
191 <?php echo _('You should choose only tasks which must be completed before this task can start.') ?>
197 <strong><?php echo _('Estimated Hours') ?>:</strong><br />
198 <input type="text" name="hours" size="5" value="<?php echo $pt->getHours(); ?>" />
202 <strong><?php echo _('Status') ?>:</strong><br />
204 echo $pg->statusBox('status_id', $pt->getStatusID(), false );
209 //will add duration and parent selection boxes
212 <strong><?php echo _('Estimated Hours') ?>:</strong><br />
213 <input type="text" name="hours" size="5" value="<?php echo $pt->getHours(); ?>" />
217 <strong><?php echo _('Status') ?></strong><br />
219 // echo $pg->statusBox('status_id', $pt->getStatusID(), false );
226 <?php echo $pt->showDependentTasks(); ?>
232 <?php echo $pt->showRelatedArtifacts(); ?>
238 <?php echo $pt->showMessages($sort_comments_chronologically, "/pm/task.php?func=detailtask&project_task_id=$project_task_id&group_id=$group_id&group_project_id=$group_project_id"); ?>
242 $hookParams['task_id'] = $project_task_id;
243 $hookParams['group_id'] = $group_id;
244 plugin_hook("task_extra_detail", $hookParams);
248 <?php echo $pt->showHistory(); ?>
253 <td colspan="3" style="text-align:center">
254 <input type="submit" value="<?php echo _('Submit') ?>" name="submit" />
261 <h3><?php echo _('Time tracking'); ?></h3>
264 $title_arr = array();
265 $title_arr[]=_('Week');
266 $title_arr[]=_('Day');
267 $title_arr[]=_('Estimated Hours');
268 $title_arr[]=_('Category');
269 $title_arr[]=_('User');
274 $report=new Report();
275 if ($report->isError()) {
276 exit_error($report->getErrorMessage(),'pm');
279 echo '<form id="time-tracking" action="/reporting/timeadd.php" method="post">
280 <input type="hidden" name="project_task_id" value="'.$project_task_id.'" />
281 <input type="hidden" name="submit" value="1" />';
282 echo $HTML->listTableTop ($title_arr);
283 echo '<tr '.$HTML->boxGetAltRowStyle($xi++).'>
284 <td class="align-center">'. report_weeks_box($report, 'week') .'</td>
285 <td class="align-center">'. report_day_adjust_box($report, 'days_adjust') .'</td>
286 <td class="align-center"><input id="time-tracking-hours" type="text" required="required" name="hours" value="" size="3" maxlength="3" /></td>
287 <td class="align-center">'.report_time_category_box('time_code',false).'</td>
289 <td class="align-center"><input type="submit" name="add" value="'._('Add').'" /><input type="submit" name="cancel" value="'._('Cancel').'" /></td>
292 //setenv("TZ=" . $user_timezone); //restore the user's timezone
295 // Display Time Recorded for this task
299 $res=db_query_params ('SELECT users.realname, rep_time_tracking.report_date, rep_time_tracking.hours, rep_time_category.category_name
300 FROM users,rep_time_tracking,rep_time_category
302 users.user_id=rep_time_tracking.user_id
303 AND rep_time_tracking.time_code=rep_time_category.time_code
304 AND rep_time_tracking.project_task_id=$1',
305 array($project_task_id));
307 for ($i=0; $i<db_numrows($res); $i++) {
310 <tr '.$HTML->boxGetAltRowStyle($xi++).'>
312 <td>'.date(_('Y-m-d H:i'),db_result($res,$i,'report_date')).'</td>
313 <td>'.db_result($res,$i,'hours').'</td>
314 <td>'.db_result($res,$i,'category_name').'</td>
315 <td>'.db_result($res,$i,'realname').'</td>
316 <td> </td></tr>';
317 $total_hours += db_result($res,$i,'hours');
322 <tr '.$HTML->boxGetAltRowStyle($xi++).'>
323 <td><strong>'._('Total').':</strong></td>
325 <td>'.$total_hours.'</td>
328 <td> </td></tr>';
330 echo $HTML->listTableBottom();
337 // c-file-style: "bsd"