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 * Copyright 2015, Franck Villaume - TrivialDev
10 * http://fusionforge.org
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 require_once $gfwww.'include/note.php';
29 require_once $gfcommon.'reporting/report_utils.php';
30 require_once $gfcommon.'reporting/Report.class.php';
34 if (getStringFromRequest('commentsort') == 'anti') {
35 $sort_comments_chronologically = false;
37 $sort_comments_chronologically = true;
40 pm_header(array('title' => _('Modify Task'), 'pagename' => 'pm_modtask', 'group_project_id' => $group_project_id));
44 echo $HTML->openForm(array('action' => '/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id, 'id' => 'modtaskform', 'method' => 'post'));
47 <input type="hidden" name="func" value="postmodtask" />
48 <input type="hidden" name="project_task_id" value="<?php echo $project_task_id; ?>" />
49 <input type="hidden" name="duration" value="<?php echo $pt->getDuration(); ?>" />
50 <input type="hidden" name="parent_id" value="<?php echo $pt->getParentID(); ?>" />
52 <table class="fullwidth mod_task">
55 <td><strong><?php echo _('Submitted by') . _(': '); ?></strong><br />
56 <?php echo $pt->getSubmittedRealName(); ?> (<?php echo $pt->getSubmittedUnixName(); ?>)</td>
57 <td><input type="submit" value="<?php echo _('Submit') ?>" name="submit" /></td>
58 <td><strong>Task ID:</strong> <?php echo $project_task_id; ?> @ <?php
59 echo forge_get_config ('web_host') ; ?></td>
64 <strong><?php echo _('Category') . _(': '); ?></strong><br />
65 <?php echo $pg->categoryBox('category_id',$pt->getCategoryID()); ?>
66 <?php echo util_make_link('/pm/admin/?group_id='.$group_id.'&add_cat=1&group_project_id='.$group_project_id,_('Admin')); ?>
70 <strong><?php echo _('Subproject') . _(': '); ?></strong><br />
71 <?php echo $pg->groupProjectBox('new_group_project_id',$group_project_id,false); ?>
75 <strong><?php echo util_make_link('/pm/t_follow.php/'.$project_task_id, _('Permalink'))._(':'); ?></strong><br />
76 <?php echo util_make_url("/pm/t_follow.php/" . $project_task_id); ?>
82 <strong><?php echo _('Percent Complete') . _(': '); ?></strong><br />
83 <?php $pg->percentCompleteBox('percent_complete',$pt->getPercentComplete()); ?>
87 <strong><?php echo _('Priority') . _(': '); ?></strong><br />
88 <?php build_priority_select_box('priority',$pt->getPriority()); ?>
92 <strong><? echo _('Task Detail Information (JSON)')._(': '); ?></strong><br />
93 <?php echo util_make_link('/pm/t_lookup.php?tid='.$project_task_id, 'application/json').
95 util_make_link('/pm/t_lookup.php?text=1&tid='.$project_task_id, 'text/plain') ?>
101 <strong><?php echo _('Task Summary') . _(': '); ?></strong><br />
102 <input type="text" name="summary" size="65" maxlength="65" value="<?php echo $pt->getSummary(); ?>" />
105 <?php echo util_make_link('/pm/task.php?func=deletetask&project_task_id='.$project_task_id.'&group_id='.$group_id.'&group_project_id='.$group_project_id, $HTML->getDeletePic(_('Delete this task'), _('Delete this task')).' '._('Delete this task')); ?>
108 <?php echo util_make_link('/export/rssAboTask.php?tid='.$project_task_id,
109 html_image('ic/rss.png', 16, 16, array('border' => '0')).' '._('Subscribe to task'));
116 <strong><?php echo _('Original Comment') . _(': '); ?></strong><br />
118 $sanitizer = new TextSanitizer();
119 $body = $sanitizer->SanitizeHtml($pt->getDetails());
121 if (strpos($body,'<') === false) {
122 echo nl2br($pt->getDetails());
128 <strong><?php echo _('Add A Comment') . _(': '); ?></strong><?php echo notepad_button('document.forms.modtaskform.details') ?><br />
130 $GLOBALS['editor_was_set_up']=false;
132 $params['name'] = 'details';
133 $params['width'] = "800";
134 $params['height'] = "300";
135 $params['body'] = "";
136 $params['group'] = $group_id;
137 plugin_hook("text_editor",$params);
138 if (!$GLOBALS['editor_was_set_up']) {
139 echo '<textarea name="details" rows="5" cols="80"></textarea>';
141 unset($GLOBALS['editor_was_set_up']);
148 <strong><?php echo _('Start Date') . _(': '); ?></strong><br />
150 $pg->showMonthBox ('start_month',date('m', $pt->getStartDate()));
151 $pg->showDayBox ('start_day',date('d', $pt->getStartDate()));
152 $pg->showYearBox ('start_year',date('Y', $pt->getStartDate()));
153 $pg->showHourBox ('start_hour',date('G', $pt->getStartDate()));
154 $pg->showMinuteBox ('start_minute',date('i',$pt->getStartDate()));
155 ?><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.') ?>
156 <br /><?php util_make_link('/pm/calendar.php?group_id='.$group_id.'&group_project_id='.$group_project_id, _('View Calendar'), array('target' => '_blank')) ?>
162 <strong><?php echo _('End Date') . _(': '); ?></strong><br />
164 $pg->showMonthBox ('end_month',date('m', $pt->getEndDate()));
165 $pg->showDayBox ('end_day',date('d', $pt->getEndDate()));
166 $pg->showYearBox ('end_year',date('Y', $pt->getEndDate()));
167 $pg->showHourBox ('end_hour',date('G', $pt->getEndDate()));
168 $pg->showMinuteBox ('end_minute',date('i', $pt->getEndDate()));
175 <strong><?php echo _('Assigned to') . _(': '); ?></strong><br />
178 List of possible users that this one could be assigned to
180 echo $pt->multipleAssignedBox ();
184 <td class="top" colspan="2">
185 <strong><?php echo _('Dependent on task') . _(': '); ?></strong><br />
188 List of possible tasks that this one could depend on
191 echo $pt->multipleDependBox();
193 <?php echo _('You should choose only tasks which must be completed before this task can start.') ?>
199 <strong><?php echo _('Estimated Hours') . _(': '); ?></strong><br />
200 <input type="number" name="hours" size="5" value="<?php echo $pt->getHours(); ?>" />
204 <strong><?php echo _('Status') . _(': '); ?></strong><br />
206 echo $pg->statusBox('status_id', $pt->getStatusID(), false );
213 <?php $pt->showDependentTasks(); ?>
219 <?php $pt->showRelatedArtifacts(); ?>
225 <?php $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); ?>
229 $hookParams['task_id'] = $project_task_id;
230 $hookParams['group_id'] = $group_id;
231 plugin_hook("task_extra_detail", $hookParams);
235 <?php $pt->showHistory(); ?>
240 <td colspan="3" style="text-align:center">
241 <input type="submit" value="<?php echo _('Submit') ?>" name="submit" />
247 echo $HTML->closeForm();
248 echo html_e('h2', array(), _('Time tracking'));
250 $title_arr = array();
251 $title_arr[]=_('Week');
252 $title_arr[]=_('Day');
253 $title_arr[]=_('Estimated Hours');
254 $title_arr[]=_('Category');
255 $title_arr[]=_('User');
260 $report=new Report();
261 if ($report->isError()) {
262 exit_error($report->getErrorMessage(), 'pm');
264 $report->setStartDate($pt->ProjectGroup->Group->getStartDate());
266 echo $HTML->openForm(array('array' => '/reporting/timeadd.php', 'id' => 'time-tracking', 'method' => 'post'));
267 echo '<input type="hidden" name="project_task_id" value="'.$project_task_id.'" />
268 <input type="hidden" name="submit" value="1" />';
269 echo $HTML->listTableTop ($title_arr);
270 echo '<tr '.$HTML->boxGetAltRowStyle($xi++).'>
271 <td class="align-center">'. report_weeks_box($report, 'week') .'</td>
272 <td class="align-center">'. report_day_adjust_box() .'</td>
273 <td class="align-center"><input id="time-tracking-hours" type="text" required="required" name="hours" value="" size="3" maxlength="3" /></td>
274 <td class="align-center">'.report_time_category_box('time_code',false).'</td>
276 <td class="align-center"><input type="submit" name="add" value="'._('Add').'" /><input type="submit" name="cancel" value="'._('Cancel').'" /></td>
279 //setenv("TZ=" . $user_timezone); //restore the user's timezone
282 // Display Time Recorded for this task
286 $res=db_query_params ('SELECT users.realname, rep_time_tracking.report_date, rep_time_tracking.hours, rep_time_category.category_name
287 FROM users,rep_time_tracking,rep_time_category
289 users.user_id=rep_time_tracking.user_id
290 AND rep_time_tracking.time_code=rep_time_category.time_code
291 AND rep_time_tracking.project_task_id=$1',
292 array($project_task_id));
294 for ($i=0; $i<db_numrows($res); $i++) {
297 <tr '.$HTML->boxGetAltRowStyle($xi++).'>
299 <td>'.date(_('Y-m-d H:i'),db_result($res,$i,'report_date')).'</td>
300 <td>'.db_result($res,$i,'hours').'</td>
301 <td>'.db_result($res,$i,'category_name').'</td>
302 <td>'.db_result($res,$i,'realname').'</td>
304 $total_hours += db_result($res,$i,'hours');
309 <tr '.$HTML->boxGetAltRowStyle($xi++).'>
310 <td><strong>'._('Total')._(': ').'</strong></td>
312 <td>'.$total_hours.'</td>
318 echo $HTML->listTableBottom();
319 echo $HTML->closeForm();
325 // c-file-style: "bsd"