[Fusionforge-commits] r14556 - in trunk/src: common/tracker common/tracker/actions common/tracker/include common/tracker/views db plugins/oslc/include/oslc-zend/application/controllers www/reporting www/search www/search/include/engines www/tracker www/tracker/admin www/tracker/include www/tracker/reporting

Alain Peyrat aljeux at fusionforge.org
Thu Oct 6 22:42:21 CEST 2011


Author: aljeux
Date: 2011-10-06 22:42:21 +0200 (Thu, 06 Oct 2011)
New Revision: 14556

Added:
   trunk/src/common/tracker/actions/
   trunk/src/common/tracker/actions/add.php
   trunk/src/common/tracker/actions/admin-ind.php
   trunk/src/common/tracker/actions/admin-tracker.php
   trunk/src/common/tracker/actions/admin-updates.php
   trunk/src/common/tracker/actions/browse.php
   trunk/src/common/tracker/actions/deleteartifact.php
   trunk/src/common/tracker/actions/detail.php
   trunk/src/common/tracker/actions/ind.php
   trunk/src/common/tracker/actions/mod-limited.php
   trunk/src/common/tracker/actions/mod.php
   trunk/src/common/tracker/actions/query.php
   trunk/src/common/tracker/actions/taskmgr.php
   trunk/src/common/tracker/actions/tracker.php
   trunk/src/common/tracker/include/
   trunk/src/common/tracker/include/ArtifactFileHtml.class.php
   trunk/src/common/tracker/include/ArtifactHtml.class.php
   trunk/src/common/tracker/include/ArtifactTypeFactoryHtml.class.php
   trunk/src/common/tracker/include/ArtifactTypeHtml.class.php
   trunk/src/common/tracker/include/build_submission_form.php
   trunk/src/common/tracker/views/
   trunk/src/common/tracker/views/form-addcanned.php
   trunk/src/common/tracker/views/form-addextrafield.php
   trunk/src/common/tracker/views/form-addextrafieldoption.php
   trunk/src/common/tracker/views/form-clonetracker.php
   trunk/src/common/tracker/views/form-customizelist.php
   trunk/src/common/tracker/views/form-deleteextrafield.php
   trunk/src/common/tracker/views/form-deleteextrafieldelement.php
   trunk/src/common/tracker/views/form-deletetracker.php
   trunk/src/common/tracker/views/form-extrafieldcopy.php
   trunk/src/common/tracker/views/form-updatecanned.php
   trunk/src/common/tracker/views/form-updateextrafield.php
   trunk/src/common/tracker/views/form-updateextrafieldelement.php
   trunk/src/common/tracker/views/form-updatetracker.php
   trunk/src/common/tracker/views/form-uploadtemplate.php
   trunk/src/common/tracker/views/form-workflow.php
   trunk/src/common/tracker/views/form-workflow_roles.php
Removed:
   trunk/src/www/tracker/add.php
   trunk/src/www/tracker/admin/form-addcanned.php
   trunk/src/www/tracker/admin/form-addextrafield.php
   trunk/src/www/tracker/admin/form-addextrafieldoption.php
   trunk/src/www/tracker/admin/form-clonetracker.php
   trunk/src/www/tracker/admin/form-customizelist.php
   trunk/src/www/tracker/admin/form-deleteextrafield.php
   trunk/src/www/tracker/admin/form-deleteextrafieldelement.php
   trunk/src/www/tracker/admin/form-deletetracker.php
   trunk/src/www/tracker/admin/form-extrafieldcopy.php
   trunk/src/www/tracker/admin/form-updatecanned.php
   trunk/src/www/tracker/admin/form-updateextrafield.php
   trunk/src/www/tracker/admin/form-updateextrafieldelement.php
   trunk/src/www/tracker/admin/form-updatetracker.php
   trunk/src/www/tracker/admin/form-uploadtemplate.php
   trunk/src/www/tracker/admin/form-workflow.php
   trunk/src/www/tracker/admin/form-workflow_roles.php
   trunk/src/www/tracker/admin/ind.php
   trunk/src/www/tracker/admin/tracker.php
   trunk/src/www/tracker/admin/updates.php
   trunk/src/www/tracker/browse.php
   trunk/src/www/tracker/build_submission_form.php
   trunk/src/www/tracker/deleteartifact.php
   trunk/src/www/tracker/detail.php
   trunk/src/www/tracker/include/ArtifactFileHtml.class.php
   trunk/src/www/tracker/include/ArtifactHtml.class.php
   trunk/src/www/tracker/include/ArtifactTypeFactoryHtml.class.php
   trunk/src/www/tracker/include/ArtifactTypeHtml.class.php
   trunk/src/www/tracker/ind.php
   trunk/src/www/tracker/mod-limited.php
   trunk/src/www/tracker/mod.php
   trunk/src/www/tracker/query.php
   trunk/src/www/tracker/taskmgr.php
   trunk/src/www/tracker/tracker.php
Modified:
   trunk/src/db/20090507-install_workflow.php
   trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
   trunk/src/www/reporting/trackerpie_graph.php
   trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php
   trunk/src/www/search/index.php
   trunk/src/www/tracker/admin/index.php
   trunk/src/www/tracker/index.php
   trunk/src/www/tracker/reporting/index.php
   trunk/src/www/tracker/reporting/trackerpie_graph.php
Log:
Move internal trackers files in common

Copied: trunk/src/common/tracker/actions/add.php (from rev 14555, trunk/src/www/tracker/add.php)
===================================================================
--- trunk/src/common/tracker/actions/add.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/add.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Generic Tracker facility
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems; 2005 GForge, LLC
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+$ath->header(array ('title'=>_('Submit New')));
+
+require_once $gfcommon.'tracker/include/build_submission_form.php';
+artifact_submission_form($ath, $group);
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/admin-ind.php (from rev 14555, trunk/src/www/tracker/admin/ind.php)
===================================================================
--- trunk/src/common/tracker/actions/admin-ind.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/admin-ind.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,178 @@
+<?php
+/**
+ * FusionForge Tracker Listing
+ *
+ * Copyright 2000, Quentin Cregan/Sourceforge
+ * Copyright 2002-2003, Tim Perdue/GForge, LLC
+ * Copyright 2010, FusionForge Team
+ * Copyright 2011, Franck Villaume - Capgemini
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+if (getStringFromRequest('post_changes')) {
+	$name = getStringFromRequest('name');
+	$description = getStringFromRequest('description');
+	$is_public = getStringFromRequest('is_public');
+	$allow_anon = getStringFromRequest('allow_anon');
+	$email_all = getStringFromRequest('email_all');
+	$email_address = getStringFromRequest('email_address');
+	$due_period = getStringFromRequest('due_period');
+	$use_resolution = getStringFromRequest('use_resolution');
+	$submit_instructions = getStringFromRequest('submit_instructions');
+	$browse_instructions = getStringFromRequest('browse_instructions');
+
+	if (!forge_check_perm ('tracker_admin', $group->getID())) {
+		exit_permission_denied('','tracker');
+	}
+
+	if (getStringFromRequest('add_at')) {
+		$res=new ArtifactTypeHtml($group);
+		if (!$res->create($name,$description,$is_public,$allow_anon,$email_all,$email_address,
+			$due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
+			exit_error($res->getErrorMessage(),'tracker');
+		} else {
+			$feedback .= _('Tracker created successfully');
+			$feedback .= '<br/>';
+			$feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
+		}
+		$group->normalizeAllRoles () ;
+	}
+}
+
+
+//
+//	Display existing artifact types
+//
+$atf = new ArtifactTypeFactory($group);
+if (!$atf || !is_object($atf) || $atf->isError()) {
+	exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
+}
+
+// Only keep the Artifacts where the user has admin rights.
+$arr = $atf->getArtifactTypes();
+$i=0;
+for ($j = 0; $j < count($arr); $j++) {
+	if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
+		$at_arr[$i++] =& $arr[$j];
+	}
+}
+// If no more tracker now,
+if ($i==0 && $j>0) {
+	exit_permission_denied('','tracker');
+}
+
+//required params for site_project_header();
+$params['group']=$group_id;
+$params['toptab']='tracker';
+if(isset($page_title)){
+	$params['title'] = $page_title;
+} else {
+	$params['title'] = '';
+}
+
+site_project_header($params);
+echo $HTML->subMenu(
+	array(
+		_('Report'),
+		_('Admin')
+	),
+	array(
+		'/tracker/reporting/?group_id='.$group_id,
+		'/tracker/admin/?group_id='.$group_id
+	),
+	array(
+		array('title' => _('Various graph about statistics'), 'class' => 'tabtitle-nw'),
+		array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle')
+	)
+);
+
+if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
+	echo '<div class="warning">'._('No trackers found').'</div>';
+} else {
+
+	echo '
+	<p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
+
+	/*
+		Put the result set (list of forums for this group) into a column with folders
+	*/
+	$tablearr=array(_('Tracker'),_('Description'));
+	echo $HTML->listTableTop($tablearr);
+
+	for ($j = 0; $j < count($at_arr); $j++) {
+		echo '
+		<tr '. $HTML->boxGetAltRowStyle($j) . '>
+			<td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
+				html_image("ic/tracker20w.png","20","20") . '  '.
+				$at_arr[$j]->getName() .'</a>
+			</td>
+			<td>'.$at_arr[$j]->getDescription() .'
+			</td>
+		</tr>';
+	}
+		echo $HTML->listTableBottom();
+	}
+
+	//
+	//	Set up blank ArtifactType
+	//
+
+	if (forge_check_perm ('tracker_admin', $group->getID())) {
+	?><?php echo _('<h3>Create a new tracker</h3><p>You can use this system to track virtually any kind of data, with each tracker having separate user, group, category, and permission lists. You can also easily move items between trackers when needed.</p><p>Trackers are referred to as "Artifact Types" and individual pieces of data are "Artifacts". "Bugs" might be an Artifact Type, whiles a bug report would be an Artifact. You can create as many Artifact Types as you want, but remember you need to set up categories, groups, and permission for each type, which can get time-consuming.</p>') ?>
+	<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
+	<input type="hidden" name="add_at" value="y" />
+	<p>
+	<?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
+	<input type="text" name="name" value="" /></p>
+	<p>
+	<strong><?php echo _('Description') ?>:</strong><br />
+	<input type="text" name="description" value="" size="50" /></p>
+	<p>
+	<input type="checkbox" name="is_public" value="1" /> <strong><?php echo _('Publicly Available') ?></strong><br />
+	<input type="checkbox" name="allow_anon" value="1" /> <strong><?php echo _('Allow non-logged-in postings') ?></strong></p>
+	<p>
+	<strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
+	<input type="text" name="email_address" value="" /></p>
+	<p>
+	<input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong><br /></p>
+	<p>
+	<strong><?php echo _('Days till considered overdue') ?>:</strong><br />
+	<input type="text" name="due_period" value="30" /></p>
+	<p>
+	<strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
+	<input type="text" name="status_timeout" value="14" /></p>
+	<p>
+	<strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
+	<textarea name="submit_instructions" rows="10" cols="55"></textarea></p>
+	<p>
+	<strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
+	<textarea name="browse_instructions" rows="10" cols="55"></textarea></p>
+	<p>
+	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+	</form>
+	<?php
+	}
+
+site_project_footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/admin-tracker.php (from rev 14555, trunk/src/www/tracker/admin/tracker.php)
===================================================================
--- trunk/src/common/tracker/actions/admin-tracker.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/admin-tracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Tracker Links
+ *
+ * Copyright 2010, FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+//
+//  SHOW LINKS TO FUNCTIONS
+//
+
+$ath->header(array ('title'=>_('Administration').': '.$ath->getName()));
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id,
+			     '<strong>'._('New Tracker').'</strong>').'<br />' ;
+echo _('Create a new tracker.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&update_type=1',
+			     '<strong>'._('Update Settings').'</strong>').'<br />' ;
+echo _('Set up preferences like expiration times, email addresses.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&add_extrafield=1',
+			     '<strong>'._('Manage Custom Fields').'</strong>').'<br />' ;
+echo _('Add new boxes like Phases, Quality Metrics, Components, etc.  Once added they can be used with other selection boxes (for example, Categories or Groups) to describe and browse bugs or other artifact types.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&workflow=1',
+			     '<strong>'._('Manage Workflow').'</strong>').'<br />' ;
+echo _('Edit tracker workflow.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&customize_list=1',
+			     '<strong>'._('Customize List').'</strong>').'<br />' ;
+echo _('Customize display for the tracker.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&add_canned=1',
+			     '<strong>'._('Add/Update Canned Responses').'</strong>').'<br />' ;
+echo _('Create/change generic response messages for the tracker.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&clone_tracker=1',
+			     '<strong>'._('Clone Tracker').'</strong>').'<br />' ;
+echo _('Create a new tracker as a copy of this one.') ;
+echo '</p>';
+
+echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&delete=1',
+			     '<strong>'._('Delete').'</strong>').'<br />' ;
+echo _('Permanently delete this tracker.') ;
+echo '</p>';
+
+$ath->footer(array());
+
+?>

Copied: trunk/src/common/tracker/actions/admin-updates.php (from rev 14555, trunk/src/www/tracker/admin/updates.php)
===================================================================
--- trunk/src/common/tracker/actions/admin-updates.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/admin-updates.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,487 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * Copyright 2010 (c) Franck Villaume - Capgemini
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+		//
+		//	Create an extra field
+		//
+		if (getStringFromRequest('add_extrafield')) {
+			$name = getStringFromRequest('name');
+			$field_type = getStringFromRequest('field_type');
+			$attribute1 = getStringFromRequest('attribute1');
+			$attribute2 = getStringFromRequest('attribute2');
+			$is_required = getStringFromRequest('is_required');
+			$alias = getStringFromRequest('alias');
+
+			$ab = new ArtifactExtraField($ath);
+
+			if (!$ab || !is_object($ab)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+//			} elseif ($ab->isError())
+//				$error_msg .= $ab->getErrorMessage();
+			} else {
+				if (!$ab->create($name,$field_type,$attribute1,$attribute2,$is_required,$alias)) {
+					$error_msg .= _('Error inserting a custom field').': '.$ab->getErrorMessage();
+					$ab->clearError();
+				} else {
+					$feedback .= _('Extra field inserted');
+				}
+			}
+		//
+		//	Delete an extra field and its contents
+		//
+		} elseif (getStringFromRequest('deleteextrafield')) {
+			$id = getStringFromRequest('id');
+			$ab = new ArtifactExtraField($ath,$id);
+
+			if (!$ab || !is_object($ab)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ab->isError()) {
+				$error_msg .= $ab->getErrorMessage();
+			} else {
+				$sure = getStringFromRequest('sure');
+				$really_sure = getStringFromRequest('really_sure');
+				if (!$ab->delete($sure,$really_sure)) {
+					$error_msg .= $ab->getErrorMessage();
+				} else {
+					$browse_list = $ath->getBrowseList();
+					$arr = explode(',', $browse_list);
+					$idx = array_search($id, $arr);
+					if($idx !== False) {
+						array_splice($arr, $idx, 1);
+					}
+					$ath->setBrowseList(join(',', $arr));
+					$feedback .= _('Custom Field Deleted');
+					$deleteextrafield=false;
+					session_redirect('/tracker/admin/?group_id='.$group_id.'&atid='.$atid.'&add_extrafield=1&feedback='.urlencode($feedback));
+				}
+			}
+
+		//
+		//	Add an element to an extra field
+		//
+		} elseif (getStringFromRequest('add_opt')) {
+			$boxid = getStringFromRequest('boxid');
+			$ab = new ArtifactExtraField($ath,$boxid);
+			if (!$ab || !is_object($ab)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ab->isError()) {
+				$error_msg .= $ab->getErrorMessage();
+			} else {
+				$ao = new ArtifactExtraFieldElement($ab);
+				if (!$ao || !is_object($ao)) {
+					$error_msg .= 'Unable to create ArtifactExtraFieldElement Object';
+//				} elseif ($ao->isError())
+//					$error_msg .= $ao->getErrorMessage();
+				} else {
+					$name = getStringFromRequest('name');
+					$status_id = getIntFromRequest('status_id');
+					if (!$ao->create($name,$status_id)) {
+						$error_msg .= _('Error inserting an element').': '.$ao->getErrorMessage();
+						$ao->clearError();
+					} else {
+						$feedback .= _('Element inserted');
+					}
+				}
+			}
+
+		//
+		//	Add a canned response
+		//
+		} elseif (getStringFromRequest('add_canned')) {
+			$title = getStringFromRequest('title');
+			$body = getStringFromRequest('body');
+
+			$acr = new ArtifactCanned($ath);
+			if (!$acr || !is_object($acr)) {
+				$error_msg .= _('Unable to create ArtifactCanned Object');
+//			} elseif ($acr->isError()) {
+//				$error_msg .= $acr->getErrorMessage();
+			} else {
+				if (!$acr->create($title,$body)) {
+					$error_msg .= _('Error inserting').' : '.$acr->getErrorMessage();
+					$acr->clearError();
+				} else {
+					$feedback .= _('Canned Response Inserted');
+				}
+			}
+
+		//
+		//	Update a canned response
+		//
+		} elseif (getStringFromRequest('update_canned')) {
+			$id = getStringFromRequest('id');
+			$title = getStringFromRequest('title');
+			$body = getStringFromRequest('body');
+
+			$acr = new ArtifactCanned($ath,$id);
+			if (!$acr || !is_object($acr)) {
+				$error_msg .= _('Unable to create ArtifactCanned Object');
+			} elseif ($acr->isError()) {
+				$error_msg .= $acr->getErrorMessage();
+			} else {
+				if (!$acr->update($title,$body)) {
+					$error_msg .= _('Error updating').' : '.$acr->getErrorMessage();
+					$acr->clearError();
+				} else {
+					$feedback .= _('Canned Response Updated');
+					$next = 'add_canned';
+				}
+			}
+
+		//
+		//	Copy Categories
+		//
+		} elseif (getStringFromRequest('copy_opt')) {
+			$copyid = getStringFromRequest('copyid');
+			$selectid = getStringFromRequest('selectid');
+
+			$copy_rows=count($copyid);
+			if ($copy_rows > 0) {
+				//
+				// create an object for each selected type
+				//
+				$result = db_query_params ('SELECT * FROM artifact_extra_field_list
+					WHERE extra_field_id=$1',
+			array($selectid));
+				$typeid = db_result($result,0,'group_artifact_id');
+				$dest_tracker =& artifactType_get_object($typeid);
+				if (!$dest_tracker || !is_object($dest_tracker)) {
+					exit_error(_('ArtifactType could not be created'),'tracker');
+				} elseif ($dest_tracker->isError()) {
+					exit_error($dest_tracker->getErrorMessage(),'tracker');
+				}
+				//
+				//  Copy elements into a field (box) for each tracker selected
+				//
+				$feedback .= _('Copy into Tracker: ');
+				$feedback .= $dest_tracker->getName();
+				$aef =new ArtifactExtraField($dest_tracker,$selectid);
+				if (!$aef || !is_object($aef)) {
+					$error_msg .= _('Unable to create ArtifactExtraField Object');
+				} elseif ($aef->isError()) {
+					$error_msg .= $aefe->getErrorMessage();
+				} else {
+					$feedback .= ', Box: ';
+					$feedback .= $aef->getName();
+					$feedback .= '<br />';
+
+					for ($k=0; $k < $copy_rows; $k++) {
+					$aefe = new ArtifactExtraFieldElement($aef);
+						if (!$aefe || !is_object($aefe)) {
+							$error_msg .= 'Unable to create ArtifactExtraFieldElement Object';
+						} elseif ($aefe->isError()) {
+							$error_msg .= $aefe->getErrorMessage();
+						} else {
+							$name=$ath->getElementName($copyid[$k]);
+							$status=$ath->getElementStatusID($copyid[$k]);
+							if (!$aefe->create($name,$status)) {
+								$error_msg .= _('Error inserting an element').': '.$aefe->getErrorMessage();
+								$aefe->clearError();
+							} else {
+								$feedback .= '- Copied choice:'. $name;
+							}
+						}
+					}
+				}
+			}
+			$feedback .= '<br />';
+
+		//
+		//	Update an extra field
+		//
+		} elseif (getStringFromRequest('update_box')) {
+			$id = getStringFromRequest('id');
+			$name = getStringFromRequest('name');
+			$attribute1 = getStringFromRequest('attribute1');
+			$attribute2 = getStringFromRequest('attribute2');
+			$is_required = getStringFromRequest('is_required');
+			$alias = getStringFromRequest('alias');
+
+			$ac = new ArtifactExtraField($ath,$id);
+			if (!$ac || !is_object($ac)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ac->isError()) {
+				$error_msg .= $ac->getErrorMessage();
+			} else {
+				if (!$ac->update($name,$attribute1,$attribute2,$is_required,$alias)) {
+					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
+					$ac->clearError();
+				} else {
+					$feedback .= _('Custom Field updated');
+					$next = 'add_extrafield';
+				}
+			}
+
+		//
+		//	Update an Element
+		//
+		} elseif (getStringFromRequest('update_opt')) {
+			$id = getStringFromRequest('id');
+			$name = getStringFromRequest('name');
+			$boxid = getStringFromRequest('boxid');
+
+			$ac = new ArtifactExtraField($ath,$boxid);
+			if (!$ac || !is_object($ac)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ac->isError()) {
+				$error_msg .= $ac->getErrorMessage();
+			} else {
+				$ao = new ArtifactExtraFieldElement($ac,$id);
+				if (!$ao || !is_object($ao)) {
+					$error_msg .= _('Unable to create ArtifactExtraFieldElement Object');
+				} elseif ($ao->isError()) {
+					$error_msg .= $ao->getErrorMessage();
+				} else {
+					$name = getStringFromRequest('name');
+					$status_id = getIntFromRequest('status_id');
+					if (!$ao->update($name,$status_id)) {
+						$error_msg .= _('Error updating a custom field').' : '.$ao->getErrorMessage();
+						$ao->clearError();
+					} else {
+						$feedback .= _('Element updated');
+						$next = 'add_extrafield';
+					}
+				}
+			}
+
+		//
+		//	Clone a tracker's elements to this tracker
+		//
+		} elseif (getStringFromRequest('clone_tracker')) {
+			$clone_id = getIntFromRequest('clone_id');
+
+			if (!$clone_id) {
+				exit_missing_param('',array(_('Clone ID')),'tracker');
+			}
+			if (!$ath->cloneFieldsFrom($clone_id)) {
+				exit_error(_('Error cloning fields: ').$ath->getErrorMessage(),'tracker');
+			} else {
+				$feedback .= _('Successfully Cloned Tracker Fields ');
+				$next = '*main*';
+			}
+
+		//
+		//	Update a tracker
+		//
+		} elseif (getStringFromRequest('update_type')) {
+			$name = getStringFromRequest('name');
+			$description = getStringFromRequest('description');
+			$email_all = getStringFromRequest('email_all');
+			$email_address = getStringFromRequest('email_address');
+			$due_period = getStringFromRequest('due_period');
+			$status_timeout = getStringFromRequest('status_timeout');
+			$use_resolution = getStringFromRequest('use_resolution');
+			$submit_instructions = getStringFromRequest('submit_instructions');
+			$browse_instructions = getStringFromRequest('browse_instructions');
+
+			if (!$ath->update($name,$description,$email_all,$email_address,
+				$due_period,$status_timeout,$use_resolution,$submit_instructions,$browse_instructions)) {
+				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
+				$ath->clearError();
+			} else {
+				$feedback .= _('Tracker Updated');
+			}
+
+		//
+		//	Update the browse list of a tracker
+		//
+		} elseif (getStringFromRequest('customize_list')) {
+			$browse_fields = getArrayFromRequest('browse_fields');
+			foreach ($browse_fields as $name => $pos) {
+				if ($pos)
+					$list_fields[$pos][] = $name;
+			}
+			ksort($list_fields);
+			$browse_fields = array();
+			foreach ($list_fields as $pos => $list_name) {
+				sort($list_name);
+				foreach ($list_name as $name)
+					$browse_fields[] = $name;
+			}
+			$browse_fields = join(',', $browse_fields);
+			if (!$ath->setBrowseList($browse_fields)) {
+				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
+				$ath->clearError();
+			} else {
+				$feedback .= _('Tracker Updated');
+			}
+
+		//
+		//	Delete a tracker
+		//
+		} elseif (getStringFromRequest('delete')) {
+			$sure = getStringFromRequest('sure');
+			$really_sure = getStringFromRequest('really_sure');
+
+			if (!$ath->delete($sure,$really_sure)) {
+				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
+			} else {
+				session_redirect('/tracker/admin/?group_id='.$group_id.'&tracker_deleted=1');
+			}
+
+		//
+		//	Upload template
+		//
+		} elseif (getStringFromRequest('uploadtemplate')) {
+
+			$input_file = getUploadedFile('input_file');
+			$size = $input_file['size'];
+			if ($size != 0 ) {
+				if (!util_check_fileupload($input_file['tmp_name'])) {
+					echo ('Invalid filename :'.$input_file['tmp_name']);
+					exit;
+				}
+				$input_data = addslashes(fread(fopen($input_file['tmp_name'], 'r'), $size));
+
+				db_query_params ('UPDATE artifact_group_list SET custom_renderer=$1 WHERE group_artifact_id=$2',
+					 	array ($input_data,
+						$ath->getID()));
+				echo db_error();
+				$feedback .= _('Renderer Uploaded');
+			} else {
+				$error_msg .= _('Renderer File empty');
+			}
+		//
+		//	Up or down elements
+		//
+		} elseif (getStringFromRequest('updownorder_opt')) {
+			$boxid = getStringFromRequest('boxid');
+			$id = getIntFromRequest('id');
+			$new_pos = getStringFromRequest('new_pos');
+			$ac = new ArtifactExtraField($ath,$boxid);
+			if (!$ac || !is_object($ac)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ac->isError()) {
+				$error_msg .= $ac->getErrorMessage();
+			} else {
+				if (!$ac->reorderValues($id, $new_pos)) {
+					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
+					$ac->clearError();
+				} else {
+					$feedback .= _('Tracker Updated');
+				}
+			}
+
+		//
+		//  Change order of elements
+		//
+		} elseif (getStringFromRequest('post_changes_order')) {
+			$boxid = getStringFromRequest('boxid');
+			$order = getArrayFromRequest('order');
+			$ac = new ArtifactExtraField($ath,$boxid);
+			if (!$ac || !is_object($ac)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ac->isError()) {
+				$error_msg .= $ac->getErrorMessage();
+			} else {
+				$updated_flag = 0;
+				foreach ($order as $id => $new_pos) {
+					if ($new_pos == '') continue;
+					if (!$ac->reorderValues($id, $new_pos)) {
+						$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
+						$ac->clearError();
+						continue;
+					}
+					else {
+						$updated_flag = 1;
+					}
+				}
+				if ($updated_flag)
+					$feedback .= _('Tracker Updated');
+			}
+		} elseif (getStringFromRequest('post_changes_alphaorder')) {
+			$boxid = getStringFromRequest('boxid');
+			$ac = new ArtifactExtraField($ath,$boxid);
+			if (!$ac || !is_object($ac)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ac->isError()) {
+				$error_msg .= $ac->getErrorMessage();
+			} else {
+				if (!$ac->alphaorderValues($id)) {
+					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
+					$ac->clearError();
+				} else {
+					$feedback .= _('Tracker Updated');
+				}
+			}
+		//
+		// Configure workflow
+		//
+		} elseif (getStringFromRequest('workflow')) {
+			require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
+			$field_id = getIntFromRequest('field_id');
+			$wk = getArrayFromRequest('wk');
+    		$atw = new ArtifactWorkflow($ath, $field_id);
+
+    		if (!isset($wk[100])) {
+    			$error_msg .= _('ERROR: Initial values not saved, no initial state given.').'<br />';
+    		} else {
+	    		// Save values for the submit form (from=100).
+	    		$atw->saveNextNodes('100', array_keys($wk[100]));
+    			$feedback .= _('Initial values saved.').'<br />';
+    		}
+
+	    	$elearray = $ath->getExtraFieldElements($field_id);
+			foreach ($elearray as $e) {
+				$from = $e['element_id'];
+				$next = isset($wk[$from]) ? array_keys($wk[$from]) : array();
+				$atw->saveNextNodes($from, array_keys($wk[$from]));
+	 		}
+			$feedback .= _('Workflow saved');
+		} elseif (getStringFromRequest('workflow_roles')) {
+			require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
+			$field_id = getIntFromRequest('field_id');
+			$from = getIntFromRequest('from');
+			$next = getIntFromRequest('next');
+			$role = array_keys(getArrayFromRequest('role'));
+			$atw = new ArtifactWorkflow($ath, $field_id);
+    		$atw->saveAllowedRoles($from, $next, $role);
+			$feedback .= _('Workflow saved');
+		} elseif (getStringFromRequest('delete_opt')) {
+			$sure = getStringFromRequest('sure');
+			$really_sure = getStringFromRequest('really_sure');
+
+			$id = getStringFromRequest('id');
+			$boxid = getStringFromRequest('boxid');
+			$ab = new ArtifactExtraField($ath,$boxid);
+			if (!$ab || !is_object($ab)) {
+				$error_msg .= _('Unable to create ArtifactExtraField Object');
+			} elseif ($ab->isError()) {
+				$error_msg .= $ab->getErrorMessage();
+			} else {
+				$ao = new ArtifactExtraFieldElement($ab,$id);
+				if (!$ao || !is_object($ao)) {
+					$error_msg .= _('Unable to create ArtifactExtraFieldElement Object');
+				} else {
+					if (!$sure || !$really_sure || !$ao->delete()) {
+						$error_msg .= _('Error deleting an element').': '.$ao->getErrorMessage();
+						$ao->clearError();
+					} else {
+						$feedback .= _('Element deleted');
+						$next = 'add_extrafield';
+					}
+				}
+			}
+		}
+		?>

Copied: trunk/src/common/tracker/actions/browse.php (from rev 14555, trunk/src/www/tracker/browse.php)
===================================================================
--- trunk/src/common/tracker/actions/browse.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/browse.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,748 @@
+<?php
+/**
+ * FusionForge Tracker
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 Roland Mas
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactFactory.class.php';
+require_once $gfcommon.'tracker/ArtifactQuery.class.php';
+//
+//  make sure this person has permission to view artifacts
+//
+session_require_perm ('tracker', $ath->getID(), 'read') ;
+
+$query_id = getIntFromRequest('query_id');
+$start = getIntFromRequest('start');
+$paging = 0;
+
+//
+//	The browse page can be powered by a pre-saved query
+//	or by select boxes chosen by the user
+//
+//	If there is a $query_id coming from the request OR the pref
+//	was already saved, use the artifact factory that way.
+//
+//	If the query_id = -1, unset the pref and use regular browse boxes
+//
+if (session_loggedin()) {
+	$u =& session_get_user();
+	if (getStringFromRequest('setpaging')) {
+		/* store paging preferences */
+		$paging = getIntFromRequest('nres');
+		if (!$paging) {
+			$paging = 25;
+		}
+		$u->setPreference("paging", $paging);
+	}
+
+	if($query_id) {
+		if ($query_id == '-1') {
+			$u->setPreference('art_query'.$ath->getID(),'');
+		} else {
+			$aq = new ArtifactQuery($ath,$query_id);
+			if (!$aq || !is_object($aq)) {
+				exit_error($aq->getErrorMessage(),'tracker');
+			}
+			$aq->makeDefault();
+		}
+	} else {
+		$query_id=$u->getPreference('art_query'.$ath->getID(),'');
+	}
+} elseif ($query_id) {
+	// If user is not logged, then use a cookie to store the current query.
+	if (isset($_COOKIE["GFTrackerQuery"])) {
+		$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
+	} else {
+		$gf_tracker = array();
+	}
+	$gf_tracker[$ath->getID()] = $query_id;
+	// Send the query_id as a cookie to save it.
+	setcookie("GFTrackerQuery", serialize($gf_tracker));
+	$_COOKIE["GFTrackerQuery"] = serialize($gf_tracker);
+} elseif (isset($_COOKIE["GFTrackerQuery"])) {
+	$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
+	$query_id = (int)$gf_tracker[$ath->getID()];
+}
+
+$af = new ArtifactFactory($ath);
+
+if (!$af || !is_object($af)) {
+	exit_error(_('Could Not Get Factory'),'tracker');
+} elseif ($af->isError()) {
+	exit_error($af->getErrorMessage(),'tracker');
+}
+
+if (!isset($_sort_col)) {
+	/* default sort order: highest priority first */
+	$_sort_col = 'priority';
+	$_sort_ord = 'DESC';
+}
+$offset = getStringFromRequest('offset');
+$_sort_col = getStringFromRequest('_sort_col',$_sort_col);
+$_sort_ord = getStringFromRequest('_sort_ord',$_sort_ord);
+$max_rows = getIntFromRequest('max_rows', 25);
+$set = getStringFromRequest('set');
+$_assigned_to = getIntFromRequest('_assigned_to');
+$_status = getIntFromRequest('_status');
+$_extra_fields = array() ;
+$aux_extra_fields = array() ;
+
+if ($set == 'custom') {
+	/* may be past in next/prev url */
+	$i = $ath->getCustomStatusField();
+	$tmp_extra_fields = getArrayFromRequest('extra_fields');
+	if (isset($tmp_extra_fields[$i])) {
+		$_extra_fields[$i] = $tmp_extra_fields[$i];
+	}
+}
+
+if (is_array($_extra_fields)){
+	$keys=array_keys($_extra_fields);
+	foreach ($keys as $key) {
+		if ($_extra_fields[$key] != 'Array') {
+			$aux_extra_fields[$key] = $_extra_fields[$key];
+		}
+	}
+} else {
+	if (isset($_extra_fields)){
+		$aux_extra_fields = $_extra_fields;
+	} else {
+		$aux_extra_fields = '';
+	}
+}
+
+$af->setup($offset,$_sort_col,$_sort_ord,$paging,$set,$_assigned_to,$_status,$aux_extra_fields);
+//
+//	These vals are sanitized and/or retrieved from ArtifactFactory stored settings
+//
+$_sort_col=$af->order_col;
+$_sort_ord=$af->sort;
+$_status=$af->status;
+$_assigned_to=$af->assigned_to;
+$_extra_fields=$af->extra_fields;
+
+$art_arr = $af->getArtifacts();
+
+if (!$art_arr && $af->isError()) {
+	exit_error($af->getErrorMessage(),'tracker');
+}
+
+//build page title to make bookmarking easier
+//if a user was selected, add the user_name to the title
+//same for status
+use_javascript('/tabber/tabber.js');
+
+$ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
+
+/**
+ *
+ *	Build the powerful browsing options pop-up boxes
+ *
+ */
+
+//
+//	creating a custom technician box which includes "any" and "unassigned"
+//
+$engine = RBACEngine::getInstance () ;
+$techs = $engine->getUsersByAllowedAction ('tracker', $ath->getID(), 'tech') ;
+
+$tech_id_arr = array () ;
+$tech_name_arr = array () ;
+
+foreach ($techs as $tech) {
+	$tech_id_arr[] = $tech->getID() ;
+	$tech_name_arr[] = $tech->getRealName() ;
+}
+$tech_id_arr[]='0';  //this will be the 'any' row
+$tech_name_arr[]=_('Any');
+
+if (is_array($_assigned_to)) {
+	$_assigned_to='';
+}
+$tech_box=html_build_select_box_from_arrays ($tech_id_arr,$tech_name_arr,'_assigned_to',$_assigned_to,true,_('Unassigned'));
+
+
+//
+//	custom order by arrays to build a pop-up box
+//
+$order_name_arr=array();
+$order_name_arr[]=_('ID');
+$order_name_arr[]=_('Priority');
+$order_name_arr[]=_('Summary');
+$order_name_arr[]=_('Open Date');
+$order_name_arr[]=_('Last Modified Date');
+$order_name_arr[]=_('Close Date');
+$order_name_arr[]=_('Submitter');
+$order_name_arr[]=_('Assignee');
+
+
+$order_arr=array();
+$order_arr[]='artifact_id';
+$order_arr[]='priority';
+$order_arr[]='summary';
+$order_arr[]='open_date';
+$order_arr[]='last_modified_date';
+$order_arr[]='close_date';
+$order_arr[]='submitted_by';
+$order_arr[]='assigned_to';
+
+//
+//	custom sort arrays to build pop-up box
+//
+$sort_name_arr=array();
+$sort_name_arr[]=_('Ascending');
+$sort_name_arr[]=_('Descending');
+
+$sort_arr=array();
+$sort_arr[]='ASC';
+$sort_arr[]='DESC';
+
+//
+//	custom changed arrays to build pop-up box
+//
+$changed_name_arr=array();
+$changed_name_arr[]=_('Any changes');
+$changed_name_arr[]=_('Last 24H');
+$changed_name_arr[]=_('Last 7days');
+$changed_name_arr[]=_('Last 2weeks');
+$changed_name_arr[]=_('Last 1month');
+
+$changed_arr=array();
+$changed_arr[]= 0x7fffffff;	 // Any
+$changed_arr[]= 3600 * 24;	 // 24 hour
+$changed_arr[]= 3600 * 24 * 7; // 1 week
+$changed_arr[]= 3600 * 24 * 14;// 2 week
+$changed_arr[]= 3600 * 24 * 30;// 1 month
+
+if ($art_arr && ($art_cnt = count($art_arr)) > 0) {
+	$focus = getIntFromRequest('focus');
+} else {
+	$art_cnt = 0;
+	$start = 0;
+	$focus = 0;
+}
+$paging = 0;
+if (session_loggedin()) {
+	/* logged in users get configurable paging */
+	$paging = $u->getPreference("paging");
+	echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'&start='.
+		$start.'" method="post">'."\n";
+}
+if (!$paging) {
+	$paging = 25;
+}
+if ($art_cnt) {
+	if ($focus) {
+		for ($i = 0; $i < $art_cnt; ++$i)
+			if ($art_arr[$i]->getID() == $focus) {
+				$start = $i;
+				break;
+			}
+	}
+	$max = ($art_cnt > ($start + $paging)) ? ($start + $paging) : $art_cnt;
+} else {
+	$max = 0;
+}
+
+printf('<p>' . _('Displaying results %1$d‒%2$d out of %3$d total.'),
+       $start + 1, $max, $art_cnt);
+if (session_loggedin()) {
+	printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
+	       'type="submit" name="setpaging" value="%1$s" />' .
+	       "\n</p>\n</form>\n", _('Change'),
+	       html_build_select_box_from_array(array(
+							'10', '25', '50', '100', '1000'), 'nres', $paging, 1));
+} else {
+	echo "</p>\n";
+}
+
+/**
+ *
+ *	Show the free-form text submitted by the project admin
+ */
+echo $ath->renderBrowseInstructions();
+
+//
+//	statuses can be custom in GForge 4.5+
+//
+if ($ath->usesCustomStatuses()) {
+	$aux_extra_fields = array();
+	if (is_array($_extra_fields)){
+		$keys=array_keys($_extra_fields);
+		foreach ($keys as $key) {
+			if (!is_array($_extra_fields[$key])) {
+				$aux_extra_fields[$key] = $_extra_fields[$key];
+			}
+		}
+	} else {
+		$aux_extra_fields = $_extra_fields;
+	}
+	$status_box=$ath->renderSelect ($ath->getCustomStatusField(),$aux_extra_fields[$ath->getCustomStatusField()],false,'',true,_('Any'));
+} else {
+	if (is_array($_status)) {
+		$_status='';
+	}
+	$status_box = $ath->statusBox('_status',$_status,true,_('Any'));
+}
+
+// start of RDFa
+$proj_name = $group->getUnixName();
+$proj_url = util_make_url_g($group->getUnixName(),$group_id);
+// the tracker's URIs are constructed in order to support addition of an OSLC-CM REST server
+// inside /tracker/cm/. There each tracker has a URL in the form .../project/PROJ_NAME/atid/ATID
+$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $proj_name .'/atid/'. $ath->getID());
+print '<div about="'. $tracker_stdzd_uri
+	.'" typeof="sioc:Container">'."\n";
+print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource="" />'."\n";
+print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" />'."\n";
+print "</div>\n"; // end of about
+
+echo '
+<div id="tabber" class="tabber">
+	<div class="tabbertab" title="'._('Advanced queries').'">';
+
+if (session_loggedin()) {
+	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
+	FROM artifact_query
+	WHERE group_artifact_id=$1 AND (user_id=$2 OR query_type>0)
+	ORDER BY type ASC, query_name ASC',
+				array ($ath->getID(),
+				       user_getid()));
+} else {
+	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
+	FROM artifact_query
+	WHERE group_artifact_id=$1 AND query_type>0
+	ORDER BY type ASC, query_name ASC',
+				array ($ath->getID()));
+}
+
+
+if (db_numrows($res)>0) {
+	echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="get">';
+	echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
+	echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
+	echo '<input type="hidden" name="power_query" value="1" />';
+	echo '	<table width="100%" cellspacing="0">
+	<tr>
+	<td>
+	';
+	$optgroup['key'] = 'type';
+	$optgroup['values'][0] = 'Private queries';
+	$optgroup['values'][1] = 'Project queries';
+	echo '<span style="font-size:smaller">';
+	echo '<select name="query_id">';
+	echo '<option value="100">Select One</option>';
+	$current = '';
+	$selected = $af->getDefaultQuery();
+	while ($row = db_fetch_array($res)) {
+		if ($current != $row['type']) {
+			if ($current !== '')
+				echo '</optgroup>';
+			$label = $row['type'] ? 'Project' : 'Private';
+			echo '<optgroup label="'.$label.'">';
+			$current = $row['type'];
+		}
+		echo '<option value="'.$row['artifact_query_id'].'"';
+		if ($row['artifact_query_id'] == $selected)
+			echo ' selected="selected"';
+		echo '>'. $row['query_name'] .'</option>'."\n";
+	}
+	if ($current !== '')
+		echo '</optgroup>';
+	echo '</select>';
+	echo '</span>
+	<input type="submit" name="run" value="'._('Power Query').'" />
+	  <a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'.
+	_('Build Query').'</a>
+	</td></tr></table>
+	</form>';
+} else {
+	echo '<strong>
+	<a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'._('Build Query').'</a></strong>';
+}
+echo '
+	</div>
+	<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
+	<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
+	<input type="hidden" name="query_id" value="-1" />
+	<input type="hidden" name="set" value="custom" />
+	<table width="100%" cellspacing="0">
+	<tr>
+	<td>
+	'._('Assignee').': '. $tech_box .'
+	</td>
+	<td align="center">
+	'._('State').': '. $status_box .'
+	</td>
+	<td align="right">';
+
+// Compute the list of fields which can be sorted.
+$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
+				    ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
+				    ARTIFACT_EXTRAFIELDTYPE_INTEGER,
+				    ARTIFACT_EXTRAFIELDTYPE_SELECT,
+				    ARTIFACT_EXTRAFIELDTYPE_RADIO,
+				    ARTIFACT_EXTRAFIELDTYPE_STATUS));
+$keys=array_keys($efarr);
+for ($k=0; $k<count($keys); $k++) {
+	$i=$keys[$k];
+	$order_name_arr[] = $efarr[$i]['field_name'];
+	$order_arr[] = $efarr[$i]['extra_field_id'];
+}
+
+echo _('Order by').
+	html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .
+	html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .
+	'<input type="submit" name="submit" value="'._('Quick Browse').'" />';
+
+echo '
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>';
+if ($af->query_type == 'default') {
+	echo '<div class="tabbertab tabbertabdefault" title="'._('Default').'">';
+	echo '<strong>'._('Viewing only opened records by default, use \'Advanced queries\' or \'Simple Filtering and Sorting\' to change.').'</strong>';
+	echo '</div>';
+}
+echo '
+</div>';
+
+$art_cnt = count($art_arr);
+if ($art_arr && $art_cnt > 0) {
+
+	if ($query_id) {
+		$aq = new ArtifactQuery($ath,$query_id);
+		$has_bargraph = (in_array('bargraph', $aq->getQueryOptions()));
+	} else {
+		$has_bargraph = false;
+	}
+
+	if ($has_bargraph) {
+		// Display the roadmap block based on the values of the Status field.
+		$colors = array('#a71d16', '#ffa0a0', '#f5f5b5', '#bae0ba', '#16a716');
+		$count = array();
+		$percent = array();
+		foreach($art_arr as $art) {
+			if ($ath->usesCustomStatuses()) {
+				$custom_id = $ath->getCustomStatusField();
+				$extra_data = $art->getExtraFieldDataText();
+				@$count[ $extra_data[$custom_id]['value'] ]++;
+			} else {
+				@$count[ $art->getStatusName()]++;
+			}
+		}
+		foreach($count as $n => $c) {
+			$percent[$n] = round(100*$c/$art_cnt);
+		}
+		if ($ath->getCustomStatusField()) {
+			$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
+			$keys=array_keys($efarr);
+			$field_id = $keys[0];
+			$custom_states = $ath->getExtraFieldElements($field_id);
+			$states = array();
+			if (is_array($custom_states)) {
+				foreach($custom_states as $state) {
+					$states[] = $state['element_name'];
+				}
+			}
+		} else {
+			$colors = array('#ffa0a0', '#bae0ba');
+			$res = $ath->getStatuses();
+			while ($row = db_fetch_array($res)) {
+				$states[] = $row['status_name'];
+			}
+		}
+
+		$i=0;
+		$graph = '';
+		$legend = '';
+		if (is_array($states)) {
+			foreach($states as $name) {
+				if ($count[$name]) {
+					$graph  .= '<td style="background: '.$colors[$i].'; width: '.$percent[$name].'%;"> </td>';
+					$legend .= '<td style="white-space: nowrap; width: '.$percent[$name].'%;">'."<i>$name: $count[$name] ($percent[$name]%)</i></td>";
+				}
+				$i++;
+			}
+		}
+
+		if ($graph) {
+		?>
+		<table class="progress">
+      	<tbody>
+      		<tr><?php echo $graph; ?></tr>
+      	</tbody>
+      	</table>
+      	<table class="progress_legend">
+      		<tr><?php echo $legend ?></tr>
+      	</table>
+	<?php
+		}
+	}
+
+	if ($set=='custom') {
+		$set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_sort_col='.$_sort_col.'&_sort_ord='.$_sort_ord;
+		if (array_key_exists($ath->getCustomStatusField(),$_extra_fields)) {
+			$set .= '&extra_fields['.$ath->getCustomStatusField().']='.$_extra_fields[$ath->getCustomStatusField()];
+		}
+	}
+
+
+	$IS_ADMIN = forge_check_perm ('tracker', $ath->getID(), 'manager') ;
+
+	if ($IS_ADMIN) {
+		echo '
+		<form name="artifactList" action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
+		<input type="hidden" name="form_key" value="'.form_generate_key().'" />
+		<input type="hidden" name="func" value="massupdate" />';
+	}
+
+	$browse_fields = explode(',', "id,".$ath->getBrowseList());
+	$title_arr=array();
+	foreach ($browse_fields as $f) {
+		$title=$f;
+		if (intval($f) > 0) {
+			$title = $ath->getExtraFieldName($f);
+		} else {
+			if ($f == 'id')
+				$title=_('ID');
+			if ($f == 'summary')
+				$title=_('Summary');
+			if ($f == 'details')
+				$title=_('Description');
+			if ($f == 'open_date')
+				$title=_('Open Date');
+			if ($f == 'close_date')
+				$title=_('Close Date');
+			if ($f == 'status_id')
+				$title=_('State');
+			if ($f == 'priority')
+				$title=_('Priority');
+			if ($f == 'assigned_to')
+				$title=_('Assigned to');
+			if ($f == 'submitted_by')
+				$title=_('Submitted by');
+			if ($f == 'related_tasks')
+				$title=_('Related tasks');
+			if ($f == 'last_modified_date')
+				$title=_('Last Modified Date');
+		}
+		$title_arr[] = $title;
+	}
+
+	if ($start < $max) {
+		echo $GLOBALS['HTML']->listTableTop ($title_arr);
+	}
+
+	$then=(time()-$ath->getDuePeriod());
+
+	for ($i=$start; $i<$max; $i++) {
+ 		$extra_data = $art_arr[$i]->getExtraFieldDataText();
+		echo '
+		<tr '. $HTML->boxGetAltRowStyle($i) . '>';
+ 		foreach ($browse_fields as $f) {
+			if ($f == 'id') {
+				echo '<td style="white-space: nowrap;">'.
+				($IS_ADMIN?'<input type="checkbox" name="artifact_id_list[]" value="'.
+				$art_arr[$i]->getID() .'" /> ':'').
+				'<a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
+				$art_arr[$i]->getID() .
+				'&group_id='. $group_id .'&atid='.
+				$ath->getID().'">'.$art_arr[$i]->getID() .
+				'</a></td>';
+			} else if ($f == 'summary') {
+		 		echo '<td><a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
+				$art_arr[$i]->getID() .
+				'&group_id='. $group_id .'&atid='.
+				$ath->getID().'">'.
+				$art_arr[$i]->getSummary().
+				'</a></td>';
+			} else if ($f == 'open_date') {
+				echo '<td>'. (($set != 'closed' && $art_arr[$i]->getOpenDate() < $then)?'* ':'  ') .
+				date(_('Y-m-d H:i'),$art_arr[$i]->getOpenDate()) .'</td>';
+			} else if ($f == 'status_id') {
+				echo '<td>'. $art_arr[$i]->getStatusName() .'</td>';
+			} else if ($f == 'priority') {
+				echo '<td class="priority'.$art_arr[$i]->getPriority()  .'">'. $art_arr[$i]->getPriority() .'</td>';
+			} else if ($f == 'assigned_to') {
+				echo '<td>'. $art_arr[$i]->getAssignedRealName() .'</td>';
+			} else if ($f == 'submitted_by') {
+				echo '<td>'. $art_arr[$i]->getSubmittedRealName() .'</td>';
+			} else if ($f == 'close_date') {
+				echo '<td>'. ($art_arr[$i]->getCloseDate() ?
+				date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :'  ') .'</td>';
+			} else if ($f == 'details') {
+				echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
+			} else if ($f == 'related_tasks') {
+				echo '<td>';
+				$tasks_res = $art_arr[$i]->getRelatedTasks();
+				$s ='';
+				while ($rest = db_fetch_array($tasks_res)) {
+					$link = '/pm/task.php?func=detailtask&project_task_id='.$rest['project_task_id'].
+						'&group_id='.$group_id.'&group_project_id='.$rest['group_project_id'];
+					$title = '[T'.$rest['project_task_id'].']';
+					if ($rest['status_id'] == 2) {
+						$title = '<strike>'.$title.'</strike>';
+					}
+					print $s.'<a href="'.$link.'" title="'.util_html_secure($rest['summary']).'">'.$title.'</a>';
+					$s = ' ';
+				}
+				echo '</td>';
+			} else if ($f == 'last_modified_date') {
+				echo '<td>'. ($art_arr[$i]->getLastModifiedDate() ?
+				date(_('Y-m-d H:i'),$art_arr[$i]->getLastModifiedDate()) :'  ') .'</td>';
+			} else if (intval($f) > 0) {
+				// Now display extra-fields (fields are numbers).
+				$value = $extra_data[$f]['value'];
+				if ($extra_data[$f]['type'] == 9) {
+					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
+				} else if ($extra_data[$f]['type'] == 7) {
+					if ($art_arr[$i]->getStatusID() == 2) {
+						$value = '<strike>'.$value.'</strike>';
+					}
+
+				}
+				echo '<td>' . $value .'</td>';
+			} else {
+				// Display ? for unknown values.
+				echo '<td>?</td>';
+			}
+ 		}
+		echo '</tr>';
+	}
+
+	if ($start < $max) {
+		echo $GLOBALS['HTML']->listTableBottom();
+	}
+	$pages = $art_cnt / $paging;
+	$currentpage = intval($start / $paging);
+
+	if ($pages >= 1) {
+		$skipped_pages=false;
+		for ($j=0; $j<$pages; $j++) {
+			if ($pages > 20) {
+				if ((($j > 4) && ($j < ($currentpage-5))) || (($j > ($currentpage+5)) && ($j < ($pages-5)))) {
+					if (!$skipped_pages) {
+						$skipped_pages=true;
+						echo ".... ";
+					}
+					continue;
+				} else {
+					$skipped_pages=false;
+				}
+			}
+			if ($j * $paging == $start) {
+				echo '<strong>'.($j+1).'</strong>  ';
+			} else {
+				echo '<a href="'.getStringFromServer('PHP_SELF')."?func=browse&group_id=".$group_id.'&atid='.$ath->getID().'&set='. $set.'&start='.($j*$paging).'"><strong>'.($j+1).'</strong></a>  ';
+			}
+		}
+	}
+
+	/*
+		Mass Update Code
+	*/
+	if ($IS_ADMIN) {
+		echo '<script language="JavaScript" type="text/javascript">/* <![CDATA[ */
+	function checkAll(val) {
+		al=document.artifactList;
+		len = al.elements.length;
+		var i=0;
+		for( i=0 ; i<len ; i++) {
+			if (al.elements[i].name==\'artifact_id_list[]\') {
+				al.elements[i].checked=val;
+			}
+		}
+	}
+	/* ]]> */</script>
+
+			<table width="100%" border="0" id="admin_mass_update">
+			<tr><td colspan="2">
+
+<a href="javascript:checkAll(1)">'._('Check  all').'</a>
+-
+  <a href="javascript:checkAll(0)">'._('Clear  all').'</a>
+
+<div class="important">'._('<strong>Admin:</strong> If you wish to apply changes to all items selected above, use these controls to change their properties and click once on "Mass Update".').'</div>
+			</td></tr>';
+
+		//
+		//	build custom fields
+		//
+	$ef = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELD_FILTER_INT));
+	$keys=array_keys($ef);
+
+	$sel=array();
+	for ($i=0; $i<count($keys); $i++) {
+		if (($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {
+			$sel[$keys[$i]]=array('100');
+		} else {
+			$sel[$keys[$i]]='100';
+		}
+	}
+	$ath->renderExtraFields($sel,true,_('No Change'),false,'',array(ARTIFACT_EXTRAFIELD_FILTER_INT),true);
+		echo   '<tr>
+			<td><strong>'._('Priority').':</strong><br />';
+		echo build_priority_select_box ('priority', '100', true);
+		echo '</td><td>';
+
+		echo '</td>
+			</tr>
+
+			<tr>
+			<td><strong>'._('Assigned to').':</strong><br />'.
+				$ath->technicianBox ('assigned_to','100.1',true,_('Nobody'),'100.1',_('No Change')) .'</td>
+			<td>';
+		if (!$ath->usesCustomStatuses()) {
+		echo '<strong>'._('State').':</strong>
+				<br />'. $ath->statusBox ('status_id','xzxz',true,_('No Change'));
+		}
+		echo '</td>
+			</tr>
+
+			<tr><td colspan="2"><strong>'._('Canned Response').':</strong><br />'.
+				$ath->cannedResponseBox ('canned_response') .'</td></tr>
+
+			<tr><td colspan="3" align="center"><input type="submit" name="submit" value="'._('Mass update').'" /></td></tr>
+			</table>
+		</form>';
+	}
+
+	printf(_('* Denotes requests > %1$s Days Old'), ($ath->getDuePeriod()/86400));
+
+	if (in_array('priority', $browse_fields)) {
+		show_priority_colors_key();
+	}
+} else {
+	echo '<p class="warning_msg">'._('No items found').'</p>';
+	echo db_error();
+}
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/deleteartifact.php (from rev 14555, trunk/src/www/tracker/deleteartifact.php)
===================================================================
--- trunk/src/common/tracker/actions/deleteartifact.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/deleteartifact.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,55 @@
+<?php
+/**
+ * FusionForge Project Management Facility
+ *
+ * Copyright 2002 GForge, LLC
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org/
+ *
+ */
+
+$ath->header(array ('title'=>_('Delete artifact').': [#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+
+// $atid, $aid and $group_id are set in tracker.php
+
+?>
+
+<table>
+<tr>
+<td>
+<fieldset>
+<legend><?php echo _('Confirm Deletion'); ?></legend>
+<form action="<?php echo getStringFromServer('PHP_SELF')."?aid=$aid&group_id=$group_id"; ?>" method="post">
+<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+<input type="hidden" name="func" value="postdeleteartifact" />
+<input type="hidden" name="atid" value="<?php echo $atid; ?>" />
+
+<table border="0" align="center">
+
+	<tr>
+		<td class="veryimportant"><?php echo _('Are you sure you want to delete this artifact?'); ?></td>
+	</tr>
+	<tr align="center">
+		<td align="center"><input type="checkbox" value="1" name="confirm_delete" /> <?php echo _('Yes, I want to delete this artifact'); ?></td>
+	</tr>
+	<tr>
+		<td style="text-align:center"><input type="submit" value="<?php echo _('Delete'); ?>" name="submit" /></td>
+	</tr>
+
+</table>
+</form>
+</fieldset>
+</td>
+</tr>
+</table>
+
+<?php
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/detail.php (from rev 14555, trunk/src/www/tracker/detail.php)
===================================================================
--- trunk/src/common/tracker/actions/detail.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/detail.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Tracker Detail
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+use_javascript('/tabber/tabber.js');
+
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
+$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+
+echo notepad_func();
+
+?>
+	<form id="trackerdetailform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" method="post" enctype="multipart/form-data">
+
+<?php if (session_loggedin()) { ?>
+	<table cellpadding="0" width="100%">
+		<tr>
+			<td>
+				<?php
+					if ($ah->isMonitoring()) {
+						$img="xmail16w.png";
+						$key="monitorstop";
+						$text=_('Stop monitor');
+					} else {
+						$img="mail16w.png";
+						$key="monitor";
+						$text=_('Monitor');
+					}
+					echo '
+					<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
+						html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
+					?>
+			</td>
+			<td>
+				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
+			</td>
+		</tr>
+	</table>
+<?php } ?>
+	<table border="0" width="80%">
+		<tr>
+			<td><strong><?php echo _('Date') ?>:</strong><br /><?php echo date( _('Y-m-d H:i'), $ah->getOpenDate() ); ?></td>
+			<td><strong><?php echo _('Priority') ?>:</strong><br /><?php echo $ah->getPriority(); ?></td>
+		</tr>
+
+		<tr>
+			<td><strong><?php echo _('State') ?>:</strong><br /><?php echo $ah->getStatusName(); ?></td>
+			<td></td>
+		</tr>
+		<tr>
+	        <td>
+			<strong><?php echo _('Submitted by') ?>:</strong><br />
+			<?php echo $ah->getSubmittedRealName();
+			if($ah->getSubmittedBy() != 100) {
+				$submittedUnixName = $ah->getSubmittedUnixName();
+				$submittedBy = $ah->getSubmittedBy();
+				?>
+				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
+			<?php } ?>
+			</td>
+			<td><strong><?php echo _('Assigned to') ?>:</strong><br />
+			<?php echo $ah->getAssignedRealName(); ?> (<?php echo $ah->getAssignedUnixName(); ?>)</td>
+		</tr>
+
+		<?php
+			$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'DISPLAY');
+			$ath->renderRelatedTasks($group, $ah);
+		?>
+
+		<tr><td colspan="2"><strong><?php echo _('Summary') ?>:</strong><br /><?php echo $ah->getSummary(); ?></td></tr>
+
+		<tr><td colspan="2">
+			<br />
+			<?php echo $ah->showDetails(); ?>
+		</td></tr>
+</table>
+<div id="tabber" class="tabber">
+<div class="tabbertab" title="<?php echo _('Followups'); ?>">
+	<table border="0" width="80%">
+		<tr><td colspan="2">
+			<?php if ($ath->allowsAnon() || session_loggedin()) { ?>
+			<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+			<input type="hidden" name="func" value="postmod" />
+			<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+			<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
+			<p>
+			<strong><?php echo _('Add A Comment') ?>:</strong>
+			<?php echo notepad_button('document.forms.trackerdetailform.details') ?><br />
+			<textarea name="details" rows="10" cols="60"></textarea>
+			</p>
+			<?php } ?>
+		</td></tr>
+		<tr><td colspan="2">
+		<h2><?php echo _('Followups: ') ;
+		if ($sort_comments_chronologically) {
+			echo '<a href="' .
+			util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+			'">' . _('Sort comments antichronologically') . '</a>';
+		} else {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+				'">' . _('Sort comments chronologically') . '</a>';
+		}
+		echo '</h2>';
+
+		echo $ah->showMessages($sort_comments_chronologically);
+		?>
+		</td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
+<table border="0" width="80%">
+	<tr><td colspan="2">
+	<?php if (session_loggedin() && ($ah->getSubmittedBy() == user_getid())) { ?>
+		<strong><?php echo _('Attach Files'); ?></strong><br />
+		<input type="file" name="input_file0" size="30" /><br />
+		<input type="file" name="input_file1" size="30" /><br />
+		<input type="file" name="input_file2" size="30" /><br />
+		<input type="file" name="input_file3" size="30" /><br />
+		<input type="file" name="input_file4" size="30" /><br />
+		<p />
+	<?php } ?>
+	<h2><?php echo _('Attached Files') ?>:</h2>
+	<?php
+	//
+	//  print a list of files attached to this Artifact
+	//
+		$ath->renderFiles($group_id, $ah);
+	?>
+	</td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Commits'); ?>" >
+<table border="0" width="80%">
+<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+	<?php
+		$hookParams['artifact_id'] = $aid;
+		$hookParams['group_id'] = $group_id;
+		plugin_hook("artifact_extra_detail",$hookParams);
+	?>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+<table border="0" width="80%">
+	<tr>
+	<td colspan="2">
+	<h2><?php echo _('Changes') ?>:</h2>
+	<?php
+	echo $ah->showHistory();
+	?>
+	</td>
+	</tr>
+</table>
+</div>
+<?php $ah->showRelations(); ?>
+</div>
+</form>
+<?php
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/ind.php (from rev 14555, trunk/src/www/tracker/ind.php)
===================================================================
--- trunk/src/common/tracker/actions/ind.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/ind.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Tracker Front Page
+ *
+ * Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+$atf = new ArtifactTypeFactory($group);
+if (!$group || !is_object($group) || $group->isError()) {
+	exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
+}
+
+$at_arr = $atf->getArtifactTypes();
+if ($at_arr === false) {
+	exit_permission_denied('tracker');
+}
+
+use_javascript('/js/sortable.js');
+
+//required params for site_project_header();
+$params['group']=$group_id;
+$params['title']=sprintf(_('Trackers for %1$s'), $group->getPublicName());
+$params['toptab']='tracker';
+
+site_project_header($params);
+
+if (forge_check_perm('tracker_admin', $group_id)) {
+	$menu_text = array();
+	$menu_links = array();
+	$menu_text[] = _('Administration');
+	$menu_links[] = '/tracker/admin/?group_id='.$group_id;
+	$menu_attr[] = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle-nw');
+	echo $HTML->subMenu($menu_text, $menu_links, $menu_attr);
+}
+
+
+if (!$at_arr || count($at_arr) < 1) {
+	echo '<div class="warning">'._('No Accessible Trackers Found').'</div>';
+	printf(_('<p><strong>No trackers have been set up, or you cannot view them.</strong></p><p><span class="important">The Admin for this project will have to set up data types using the %1$s admin page %2$s</span></p>'), '<a href="'.util_make_url ('/tracker/admin/?group_id='.$group_id).'">', '</a>');
+} else {
+
+	plugin_hook ("blocks", "tracker index");
+
+	echo '<p>'._('Choose a tracker and you can browse/edit/add items to it.').'</p>';
+
+	/*
+		Put the result set (list of trackers for this group) into a column with folders
+	*/
+	$tablearr = array(_('Tracker'),_('Description'),_('Open'),_('Total'));
+
+	echo $HTML->listTableTop($tablearr, false, 'sortable_table_tracker', 'sortable_table_tracker');
+
+	for ($j = 0; $j < count($at_arr); $j++) {
+		if (!is_object($at_arr[$j])) {
+			//just skip it
+		} elseif ($at_arr[$j]->isError()) {
+			echo $at_arr[$j]->getErrorMessage();
+		} else {
+			echo '
+		<tr>
+			<td><a href="'.util_make_url ('/tracker/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id.'&func=browse').'">'.
+ 				html_image("ic/tracker20w.png","20","20").'  '.
+				$at_arr[$j]->getName() .'</a>
+			</td>
+			<td>' .  $at_arr[$j]->getDescription() .'
+			</td>
+			<td style="text-align:center">'. (int) $at_arr[$j]->getOpenCount() . '
+			</td>
+			<td style="text-align:center">'. (int) $at_arr[$j]->getTotalCount() .'
+			</td>
+		</tr>';
+		}
+	}
+	echo $HTML->listTableBottom();
+}
+
+site_project_footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/mod-limited.php (from rev 14555, trunk/src/www/tracker/mod-limited.php)
===================================================================
--- trunk/src/common/tracker/actions/mod-limited.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/mod-limited.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,226 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+use_javascript('/tabber/tabber.js');
+
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
+$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+
+echo notepad_func();
+
+?>
+	<h1>[#<?php echo $ah->getID(); ?>] <?php echo $ah->getSummary(); ?></h1>
+
+	<form id="trackermodlimitedform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" enctype="multipart/form-data" method="post">
+	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+	<input type="hidden" name="func" value="postmod" />
+	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
+
+	<table width="80%">
+<?php
+if (session_loggedin()) {
+?>
+		<tr>
+			<td><?php
+				if ($ah->isMonitoring()) {
+					$img="xmail16w.png";
+					$key="monitorstop";
+					$text=_('Stop monitor');
+				} else {
+					$img="mail16w.png";
+					$key="monitor";
+					$text=_('Monitor');
+				}
+				echo '
+				<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
+					html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
+				?>
+			</td>
+			<td><?php
+				if ($group->usesPM()) {
+					echo '
+				<a href="'.getStringFromServer('PHP_SELF').'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'">'.
+					html_image('ic/taskman20w.png','20','20').'<strong>'._('Build Task Relation').'</strong></a>';
+				}
+				?>
+			</td>
+			<td>
+				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
+			</td>
+		</tr>
+</table>
+<p/>
+<?php } ?>
+<table border="0" width="80%">
+	<tr>
+		<td><strong><?php echo _('Submitted by') ?>:</strong><br />
+			<?php
+			echo $ah->getSubmittedRealName();
+			if($ah->getSubmittedBy() != 100) {
+				$submittedUnixName = $ah->getSubmittedUnixName();
+				$submittedBy = $ah->getSubmittedBy();
+				?>
+				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
+			<?php } ?>
+		</td>
+		<td><strong><?php echo _('Date Submitted') ?>:</strong><br />
+		<?php
+		echo date(_('Y-m-d H:i'), $ah->getOpenDate() );
+
+		$close_date = $ah->getCloseDate();
+		if ($ah->getStatusID()==2 && $close_date > 1) {
+			echo '<br /><strong>'._('Date Closed').':</strong><br />'
+				 .date(_('Y-m-d H:i'), $close_date);
+		}
+		?>
+		</td>
+	</tr>
+
+    <?php
+		$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'UPDATE');
+		?>
+
+	<tr>
+		<td><strong><?php echo _('Assigned to')?>:</strong><br />
+		<span id="tracker-assigned_to" title="<?php echo util_html_secure(html_get_tooltip_description('assigned_to')) ?>">
+		<?php echo $ah->getAssignedRealName(); ?> (<?php echo $ah->getAssignedUnixName(); ?>)
+		</span></td>
+		<td>
+		<strong><?php echo _('Priority') ?>:</strong><br />
+		<span id="tracker-priority" title="<?php echo util_html_secure(html_get_tooltip_description('priority')) ?>">
+		<?php echo $ah->getPriority(); ?>
+		</span></td>
+	</tr>
+
+	<tr>
+		<td>
+		<?php if (!$ath->usesCustomStatuses()) { ?>
+			<strong><?php echo _('State') ?>:</strong><br />
+			<span id="tracker-status_id" title="<?php echo util_html_secure(html_get_tooltip_description('status_id')) ?>">
+			<?php echo $ath->statusBox ('status_id', $ah->getStatusID() ); ?>
+			<span>
+		<?php } ?>
+		</td>
+		<td>
+		</td>
+	</tr>
+	<?php
+		$ath->renderRelatedTasks($group, $ah);
+		$ath->renderFiles($group_id, $ah);
+	?>
+	<tr>
+		<td colspan="2"><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
+			<span id="tracker-summary" title="<?php echo util_html_secure(html_get_tooltip_description('summary')) ?>">
+			<?php echo $ah->getSummary(); ?>
+			<span>
+		</td>
+	</tr>
+
+	<tr><td colspan="2">
+		<br />
+		<?php echo $ah->showDetails(); ?>
+	</td></tr>
+</table>
+<div id="tabber" class="tabber">
+<div class="tabbertab" title="<?php echo _('Followups');?>">
+<table border="0" width="80%">
+	<tr><td colspan="2">
+		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.forms.trackermodlimitedform.details') ?></strong><br />
+		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea>
+		<p>
+		<h2><?php echo _('Followups: ') ;
+		if ($sort_comments_chronologically) {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+				'">' . _('Sort comments antichronologically') . '</a>';
+		} else {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+				'">' . _('Sort comments chronologically') . '</a>';
+		}
+echo '</h2>';
+echo $ah->showMessages($sort_comments_chronologically);
+		?>
+	</td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
+<table border="0" width="80%">
+	<tr><td colspan="2">
+		<?php echo _('Attach Files') ?><br />
+		<input type="file" name="input_file0" size="30" /><br />
+		<input type="file" name="input_file1" size="30" /><br />
+		<input type="file" name="input_file2" size="30" /><br />
+		<input type="file" name="input_file3" size="30" /><br />
+		<input type="file" name="input_file4" size="30" /><br />
+		<p>
+		<h2><?php echo _('Attached Files') ?>:</h2>
+		<?php
+		//
+		//  print a list of files attached to this Artifact
+		//
+			$ath->renderFiles($group_id, $ah);
+		?>
+	</td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Commits'); ?>">
+<table border="0" width="80%">
+<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+	<?php
+		$hookParams['artifact_id'] = $aid;
+		$hookParams['group_id'] = $group_id;
+		plugin_hook("artifact_extra_detail",$hookParams);
+	?>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+<table border="0" width="80%">
+	<tr><td colspan="2">
+		<h2><?php echo _('Change Log') ?>:</h2>
+		<?php
+			echo $ah->showHistory();
+		?>
+	</td></tr>
+</table>
+</div>
+<?php $ah->showRelations(); ?>
+</div>
+		</form>
+<?php
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/mod.php (from rev 14555, trunk/src/www/tracker/mod.php)
===================================================================
--- trunk/src/common/tracker/actions/mod.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/mod.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,281 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2010 (c) Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+use_javascript('/tabber/tabber.js');
+
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
+$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
+
+echo notepad_func();
+
+?>
+	<form id="trackermodform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>"  enctype="multipart/form-data" method="post">
+	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>"/>
+	<input type="hidden" name="func" value="postmod"/>
+	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>"/>
+
+	<table width="80%">
+<?php
+if (session_loggedin()) {
+?>
+		<tr>
+			<td><?php
+				if ($ah->isMonitoring()) {
+					$img="xmail16w.png";
+					$key="monitorstop";
+					$text=_('Stop monitor');
+				} else {
+					$img="mail16w.png";
+					$key="monitor";
+					$text=_('Monitor');
+				}
+				echo '
+				<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
+					html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
+				?>
+			</td>
+			<td><?php
+				if ($group->usesPM()) {
+					echo '
+				<a href="'.getStringFromServer('PHP_SELF').'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'">'.
+					html_image('ic/taskman20w.png','20','20').'<strong>'._('Build Task Relation').'</strong></a>';
+				}
+				?>
+			</td>
+			<td>
+				<a href="<?php echo getStringFromServer('PHP_SELF')."?func=deleteartifact&aid=$aid&group_id=$group_id&atid=$atid"; ?>"><strong><?php echo html_image('ic/trash.png','16','16') . _('Delete'); ?></strong></a>
+			</td>
+			<td>
+				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
+			</td>
+		</tr>
+</table>
+<p/>
+<?php } ?>
+<table border="0" width="80%">
+	<tr>
+		<td>
+			<strong><?php echo _('Submitted by') ?>:</strong><br />
+			<?php echo $ah->getSubmittedRealName();
+			if($ah->getSubmittedBy() != 100) {
+				$submittedUnixName = $ah->getSubmittedUnixName();
+				$submittedBy = $ah->getSubmittedBy();
+				?>
+				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
+			<?php } ?>
+		</td>
+		<td><strong><?php echo _('Date Submitted') ?>:</strong><br />
+		<?php
+		echo date(_('Y-m-d H:i'), $ah->getOpenDate() );
+
+		$close_date = $ah->getCloseDate();
+		if ($ah->getStatusID()==2 && $close_date > 1) {
+			echo '<br /><strong>'._('Date Closed').':</strong><br />'
+				.date(_('Y-m-d H:i'), $close_date);
+		}
+		?>
+		</td>
+	</tr>
+
+	<tr>
+		<td><strong><?php echo _('Data Type') ?>:</strong><br />
+		<?php
+
+$atf = new ArtifactTypeFactory ($group) ;
+$tids = array () ;
+foreach ($atf->getArtifactTypes() as $at) {
+	if (forge_check_perm ('tracker', $at->getID(), 'manager')) {
+		$tids[] = $at->getID() ;
+	}
+}
+
+$res = db_query_params ('SELECT group_artifact_id, name
+			FROM artifact_group_list
+			WHERE group_artifact_id = ANY ($1)',
+			array (db_int_array_to_any_clause ($tids))) ;
+
+echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
+
+		?>
+		</td>
+		<td>
+		</td>
+	</tr>
+
+	<?php
+		$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'UPDATE');
+	?>
+
+	<tr>
+		<td><strong><?php echo _('Assigned to')?>:</strong><br />
+		<?php
+		echo $ath->technicianBox('assigned_to', $ah->getAssignedTo() );
+		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&update_users=1','('._('Admin').')');
+		?>
+		</td><td>
+		<strong><?php echo _('Priority') ?>:</strong><br />
+		<?php
+		/*
+			Priority of this request
+		*/
+		build_priority_select_box('priority',$ah->getPriority());
+		?>
+		</td>
+	</tr>
+
+	<tr>
+		<td>
+		<?php if (!$ath->usesCustomStatuses()) { ?>
+		<strong><?php echo _('State') ?>:</strong><br />
+		<?php
+
+		echo $ath->statusBox ('status_id', $ah->getStatusID() );
+		}
+		?>
+		</td>
+		<td>
+		</td>
+	</tr>
+	<?php
+		$ath->renderRelatedTasks($group, $ah);
+		$ath->renderFiles($group_id, $ah);
+	?>
+	<tr>
+		<td><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
+		<input id="tracker-summary" title="<?php echo util_html_secure(_('The summary text-box represents a short tracker item summary. Useful when browsing through several tracker items.')) ?>" type="text" name="summary" size="70" value="<?php
+			echo $ah->getSummary();
+			?>" maxlength="255" />
+		</td>
+		<td>
+		</td>
+	</tr>
+	<tr><td colspan="2">
+		<div id="edit" style="display:none;">
+		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>: <?php echo notepad_button('document.forms.trackermodform.description') ?></strong>
+		<br />
+		<textarea id="tracker-description" name="description" rows="30" cols="79" title="<?php echo util_html_secure(html_get_tooltip_description('description')) ?>"><?php echo $ah->getDetails(); ?></textarea>
+		</div>
+		<div id="show" style="display:block;">
+		<?php echo $ah->showDetails(true); ?>
+		</div>
+	</td></tr>
+</table>
+<div id="tabber" class="tabber">
+<div class="tabbertab" title="<?php echo _('Followups'); ?>">
+<table border="0" width="80%">
+	<tr><td colspan="2">
+		<br /><strong><?php echo _('Use Canned Response') ?>:</strong><br />
+		<?php
+		echo $ath->cannedResponseBox('canned_response');
+		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&add_canned=1','('._('Admin').')');
+		?>
+		<p>
+		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.forms.trackermodform.details') ?></strong><br />
+		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea></p>
+		<h2><?php echo _('Followups: ') ;
+		if ($sort_comments_chronologically) {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+				'">' . _('Sort comments antichronologically') . '</a>';
+		} else {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+				'">' . _('Sort comments chronologically') . '</a>';
+		}
+echo '</h2>';
+echo $ah->showMessages($sort_comments_chronologically);
+		?>
+	</td></tr>
+</table>
+</div>
+<?php
+if ($group->usesPM()) {
+?>
+<div class="tabbertab" title="<?php echo _('Related Tasks'); ?>">
+	<?php
+		$ath->renderRelatedTasks($group, $ah);
+	?>
+</div>
+<?php } ?>
+<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
+		<h2><?php echo _('Existing Files') ?>:</h2>
+<table border="0" width="80%">
+	<tr><td colspan="2">
+        <strong><?php echo _('Attach Files') ?>:</strong><br />
+        <input type="file" name="input_file0" size="30" /><br />
+        <input type="file" name="input_file1" size="30" /><br />
+        <input type="file" name="input_file2" size="30" /><br />
+        <input type="file" name="input_file3" size="30" /><br />
+        <input type="file" name="input_file4" size="30" /><br />
+		<?php
+		//
+		//	print a list of files attached to this Artifact
+		//
+		$ath->renderFiles($group_id, $ah);
+		?>
+	</td></tr>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Commits'); ?>">
+<table border="0" width="80%">
+<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
+	<?php
+		$hookParams['artifact_id'] = $aid;
+		$hookParams['group_id'] = $group_id;
+		plugin_hook("artifact_extra_detail",$hookParams);
+	?>
+</table>
+</div>
+<div class="tabbertab" title="<?php echo _('Changes'); ?>">
+<table border="0" width="80%">
+	<tr>
+	<td colspan="2">
+		<h2><?php echo _('Changes') ?>:</h2>
+		<?php
+			echo $ah->showHistory();
+		?>
+	</td>
+	</tr>
+</table>
+</div>
+<?php $ah->showRelations(); ?>
+</div>
+		</form>
+<?php
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/query.php (from rev 14555, trunk/src/www/tracker/query.php)
===================================================================
--- trunk/src/common/tracker/actions/query.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/query.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,403 @@
+<?php
+/**
+ * Copyright 2005 (c) GForge Group, LLC; Anthony J. Pugliese,
+ * Copyright 2010 (c) Fusionforge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactQuery.class.php';
+
+if (!session_loggedin()) {
+	exit_not_logged_in();
+}
+
+$query_id = getIntFromRequest('query_id');
+$query_action = getIntFromRequest('query_action');
+if (getStringFromRequest('submit')) {
+	//
+	//  Create a Saved Query
+	//
+
+	if ($query_action == 1) {
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+
+		$aq = new ArtifactQuery($ath);
+		if (!$aq || !is_object($aq)) {
+			exit_error($aq->getErrorMessage(),'tracker');
+		}
+		$query_name = trim(getStringFromRequest('query_name'));
+		$query_type = getStringFromRequest('query_type',0);
+		$_status = getStringFromRequest('_status');
+		$_assigned_to = getStringFromRequest('_assigned_to');
+		$_sort_col = getStringFromRequest('_sort_col');
+		$_sort_ord = getStringFromRequest('_sort_ord');
+		$extra_fields = getStringFromRequest('extra_fields');
+		$_moddaterange = getStringFromRequest('_moddaterange');
+		$_opendaterange = getStringFromRequest('_opendaterange');
+		$_closedaterange = getStringFromRequest('_closedaterange');
+		$_summary = getStringFromRequest('_summary');
+		$_description = getStringFromRequest('_description');
+		$_followups = getStringFromRequest('_followups');
+		$query_options = array_keys(getArrayFromRequest('query_options'));
+		if (!$aq->create($query_name,$_status,$_assigned_to,$_moddaterange,$_sort_col,$_sort_ord,$extra_fields,$_opendaterange,$_closedaterange,
+			$_summary,$_description,$_followups,$query_type, $query_options)) {
+			form_release_key(getStringFromRequest('form_key'));
+			exit_error($aq->getErrorMessage(),'tracker');
+		} else {
+			$feedback .= _('Query Successfully Created');
+		}
+		$aq->makeDefault();
+		$query_id=$aq->getID();
+		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse&feedback='.urlencode($feedback));
+	//
+/*
+	// Make the displayed query the default
+	//
+	} elseif ($query_action == 2) {
+		$aq = new ArtifactQuery($ath,$query_id);
+		if (!$aq || !is_object($aq)) {
+			exit_error('Error',$aq->getErrorMessage());
+		}
+		if (!$aq->makeDefault()) {
+			$feedback .= $aq->getErrorMessage();
+		} else {
+			$feedback .= 'Query Made Default';
+		}
+*/	//
+	// Update the name and or fields of the displayed saved query
+	//
+	} elseif ($query_action == 3) {
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+		$aq = new ArtifactQuery($ath,$query_id);
+		if (!$aq || !is_object($aq)) {
+			exit_error($aq->getErrorMessage(),'tracker');
+		}
+		$query_name = getStringFromRequest('query_name');
+		$query_type = getStringFromRequest('query_type',0);
+		$_status = getStringFromRequest('_status');
+		$_assigned_to = getStringFromRequest('_assigned_to');
+		$_sort_col = getStringFromRequest('_sort_col');
+		$_sort_ord = getStringFromRequest('_sort_ord');
+		$_moddaterange = getStringFromRequest('_moddaterange');
+		$_opendaterange = getStringFromRequest('_opendaterange');
+		$_closedaterange = getStringFromRequest('_closedaterange');
+		$_summary = getStringFromRequest('_summary');
+		$_description = getStringFromRequest('_description');
+		$_followups = getStringFromRequest('_followups');
+		$extra_fields = getStringFromRequest('extra_fields');
+		$query_options = array_keys(getArrayFromRequest('query_options'));
+		if (!$aq->update($query_name,$_status,$_assigned_to,$_moddaterange,$_sort_col,$_sort_ord,$extra_fields,$_opendaterange,$_closedaterange,
+			$_summary,$_description,$_followups,$query_type, $query_options)) {
+			exit_error($aq->getErrorMessage(),'tracker');
+		} else {
+			$feedback .= _('Query Updated');
+		}
+		$aq->makeDefault();
+		$query_id=$aq->getID();
+		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse&feedback='.urlencode($feedback));
+	//
+	//	Just load the query
+	//
+	} elseif ($query_action == 4) {
+		$aq = new ArtifactQuery($ath,$query_id);
+		if (!$aq || !is_object($aq)) {
+			exit_error($aq->getErrorMessage(),'tracker');
+		}
+		$aq->makeDefault();
+	//
+	//	Delete the query
+	//
+	} elseif ($query_action == 5) {
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+		$aq = new ArtifactQuery($ath,$query_id);
+		if (!$aq || !is_object($aq)) {
+			exit_error($aq->getErrorMessage(),'tracker');
+		}
+		if (!$aq->delete()) {
+			$error_msg .= $aq->getErrorMessage();
+            $ret_msg = '&error_msg='.urlencode($error_msg);
+		} else {
+			$feedback .= _('Query Deleted');;
+            $ret_msg = '&feedback='.urlencode($feedback);
+		}
+		$query_id=0;
+		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse'.$ret_msg);
+		exit;
+	} else {
+		exit_error(_('Missing Build Query Action'),'tracker');
+	}
+} else {
+	$user=session_get_user();
+	$query_id=$user->getPreference('art_query'.$ath->getID());
+	$aq = new ArtifactQuery($ath,$query_id);
+	if (!$aq || !is_object($aq)) {
+		exit_error($aq->getErrorMessage(),'tracker');
+	}
+	$aq->makeDefault();
+}
+
+//
+//  setup the query
+//
+$_assigned_to=$aq->getAssignee();
+$_status=$aq->getStatus();
+$extra_fields=$aq->getExtraFields();
+$_sort_col=$aq->getSortCol();
+$_sort_ord=$aq->getSortOrd();
+$_moddaterange=$aq->getModDateRange();
+$_opendaterange=$aq->getOpenDateRange();
+$_closedaterange=$aq->getCloseDateRange();
+$_summary=$aq->getSummary();
+$_description=$aq->getDescription();
+$_followups=$aq->getFollowups();
+$query_type=$aq->getQueryType();
+//
+//	creating a custom technician box which includes "any" and "unassigned"
+$tech_box=$ath->technicianBox ('_assigned_to[]',$_assigned_to,true,'none','-1',false,true);
+
+
+//
+//	custom order by arrays to build a pop-up box
+//
+$order_name_arr=array();
+$order_name_arr[]=_('ID');
+$order_name_arr[]=_('Priority');
+$order_name_arr[]=_('Summary');
+$order_name_arr[]=_('Open Date');
+$order_name_arr[]=_('Last Modified Date');
+$order_name_arr[]=_('Close Date');
+$order_name_arr[]=_('Submitter');
+$order_name_arr[]=_('Assignee');
+
+
+$order_arr=array();
+$order_arr[]='artifact_id';
+$order_arr[]='priority';
+$order_arr[]='summary';
+$order_arr[]='open_date';
+$order_arr[]='last_modified_date';
+$order_arr[]='close_date';
+$order_arr[]='submitted_by';
+$order_arr[]='assigned_to';
+
+//
+//	custom sort arrays to build pop-up box
+//
+$sort_name_arr=array();
+$sort_name_arr[]=_('Ascending');
+$sort_name_arr[]=_('Descending');
+
+
+$sort_arr=array();
+$sort_arr[]='ASC';
+$sort_arr[]='DESC';
+
+//
+//	custom changed arrays to build pop-up box
+//
+$changed_name_arr=array();
+$changed_name_arr[]=_('Any changes');
+$changed_name_arr[]=_('Last 24H');
+$changed_name_arr[]=_('Last 7days');
+$changed_name_arr[]=_('Last 2weeks');
+$changed_name_arr[]=_('Last 1month');
+
+$changed_arr=array();
+$changed_arr[]= 0;
+$changed_arr[]= 3600 * 24;	 // 24 hour
+$changed_arr[]= 3600 * 24 * 7; // 1 week
+$changed_arr[]= 3600 * 24 * 14;// 2 week
+$changed_arr[]= 3600 * 24 * 30;// 1 month
+
+//
+//	get queries for this user
+//
+$res = db_query_params ('SELECT artifact_query_id,query_name FROM artifact_query WHERE user_id=$1 AND group_artifact_id=$2',
+			array(user_getid(),
+			      $ath->getID()));
+
+
+//	Show the new pop-up boxes to select assigned to, status, etc
+//
+$ath->header(array('atid'=>$ath->getID(), 'title' =>_('Build Query')));
+
+echo '<table align="center"><tr><td>' .
+		'<fieldset><legend>'.
+		_('Build Query').
+		'</legend>';
+
+echo '
+<form action="'.getStringFromServer('PHP_SELF').'?func=query&group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
+<input type="hidden" name="form_key" value="'.form_generate_key().'" />
+<table align="center" border="3" cellpadding="4" rules="groups" frame="box" width="100%" class="tablecontent">
+	<tr>
+		<td>
+			<input type="submit" name="submit" value="'._('Save Changes').'" />
+		</td>
+		<td>';
+	if(db_numrows($res)>0) {
+		echo html_build_select_box($res,'query_id',$query_id,false).'';
+	}
+
+	echo '
+		</td>
+	</tr>
+	<tr class="tablecontent">
+		<td>';
+	if(db_numrows($res)>0) {
+		if ($query_type == 0 || ($query_type>0 && forge_check_perm ('tracker', $ath->getID(), 'manager'))) {
+			$allow_update = true;
+			$checked[1] = '';
+			$checked[3] = ' checked="checked"';
+		} else {
+			$allow_update = false;
+			$checked[1] = ' checked="checked"';
+			$checked[3] = '';
+		}
+		echo '
+		<input type="radio" name="query_action" value="1"'.$checked[1].' />'._('Name and Save Query').'<br />
+		<input type="radio" name="query_action" value="4" />'._('Load Query').'<br />';
+		if ($allow_update) {
+			echo '
+		<input type="radio" name="query_action" value="3"'.$checked[3].' />'._('Update Query').'<br />
+		<input type="radio" name="query_action" value="5" />'._('Delete Query');
+		}
+	} else {
+		echo '
+		<input type="hidden" name="query_action" value="1" />'._('Name and Save Query').'<br />';
+	}
+	echo '
+		</td>
+		<td valign="top">
+		<input type="text" name="query_name" value="'.$aq->getName().'" size="20" maxlength="30" /></td>
+	</tr>
+</table>';
+
+echo'
+<table width="100%" class="tablecontent">';
+if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
+	$default_query = db_result(db_query_params('SELECT query_name FROM artifact_query WHERE query_type=2 AND group_artifact_id=$1',
+						   array ($ath->getID())),
+				   0,
+				   'query_name');
+	if ($default_query) {
+		if ($default_query == $aq->getName()) {
+			$note = '';
+		} else {
+			$note= '<br/><i>'.sprintf(_('Note: The default project query is currently \'%1$s\'.'), $default_query).'</i>';
+		}
+	} else {
+		$note= '<br/><i>'._('Note: There is no default project query defined.').'</i>';
+	}
+	echo '
+	<tr>
+		<td colspan="2">
+			<strong>'._('Type of query').':</strong><br />
+			<input name="query_type" value="0" type="radio"'.(($query_type==0) ? ' checked="checked"' : '' ).' />'.
+			_('Private query').'<br />
+			<input name="query_type" value="1" type="radio"'.(($query_type==1) ? ' checked="checked"' : '' ).' />'.
+			_('Project level query (query is public)').'<br />
+			<input name="query_type" value="2" type="radio"'.(($query_type==2) ? ' checked="checked"' : '' ).' />'.
+			_('Default project query (for project level query only)').'<br />
+			'.$note.'
+			<hr/>
+		</td>
+	</tr>';
+}
+	echo '<tr>
+		<td><strong>'._('Assignee').':</strong><br />'. $tech_box .'</td>
+		<td valign="top">';
+		if (!$ath->usesCustomStatuses()) {
+			echo '<strong>'._('State').':</strong><br />'. $ath->statusBox('_status',$_status,true,_('Any'));
+		}
+		echo '</td>
+	</tr>';
+	$ath->renderExtraFields($extra_fields,true,'None',true,'Any',array(),false,'QUERY');
+
+	// Compute the list of fields which can be sorted.
+	// Currently, only scalar artifacts are taken.
+	$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
+					    ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
+					    ARTIFACT_EXTRAFIELDTYPE_INTEGER,
+					    ARTIFACT_EXTRAFIELDTYPE_SELECT,
+					    ARTIFACT_EXTRAFIELDTYPE_RADIO,
+					    ARTIFACT_EXTRAFIELDTYPE_STATUS));
+	$keys=array_keys($efarr);
+	for ($k=0; $k<count($keys); $k++) {
+		$i=$keys[$k];
+		$order_name_arr[] = $efarr[$i]['field_name'];
+		$order_arr[] = $efarr[$i]['extra_field_id'];
+	}
+	array_multisort($order_name_arr, $order_arr);
+
+	$tips = '<i>'._('(%% for wildcards)').'</i>   ';
+
+echo '
+	<tr>
+		<td colspan="2" nowrap="nowrap">'.
+		'<strong>'._('Last Modified Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
+		<input type="text" name="_moddaterange" size="21" maxlength="21" value="'. htmlspecialchars($_moddaterange) .'" /><p/>
+		<strong>'._('Open Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
+		<input type="text" name="_opendaterange" size="21" maxlength="21" value="'. htmlspecialchars($_opendaterange) .'" /><p/>
+		<strong>'._('Close Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
+		<input type="text" name="_closedaterange" size="21" maxlength="21" value="'. htmlspecialchars($_closedaterange) .'" />
+		</td>
+	</tr>
+	<tr>
+		<td colspan="2">'.
+		'<strong>'._('Summary').':</strong> '.$tips.'<br />
+		<input type="text" name="_summary" size="40" value="'. htmlspecialchars($_summary) .'" /><p/>
+		<strong>'._('Detailed description').':</strong> '.$tips.'<br />
+		<input type="text" name="_description" size="40" value="'. htmlspecialchars($_description) .'" /><p/>
+		<strong>'._('Followups').':</strong> '.$tips.'<br />
+		<input type="text" name="_followups" size="40" value="'. htmlspecialchars($_followups) .'" />
+		</td>
+	</tr>
+	<tr>
+		<td><strong>'._('Order by').':</strong><br />
+		'.
+		html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .'</td>
+		<td> <br />
+		'.html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .'</td>
+	</tr>';
+echo '<tr>
+		<td colspan="2">'.
+		'<p/><strong>Options:</strong><br />
+		<input type="checkbox" name="query_options[bargraph]" '.
+	((in_array('bargraph', $aq->getQueryOptions())) ? 'checked="checked"' : '')
+.'/> Display a short summary box on top of the list (roadmap status).<p/>
+		</td>
+	</tr>';
+echo '
+	</table></form>';
+echo '</fieldset></td></tr></table>';
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/actions/taskmgr.php (from rev 14555, trunk/src/www/tracker/taskmgr.php)
===================================================================
--- trunk/src/common/tracker/actions/taskmgr.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/taskmgr.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,172 @@
+<?php
+/**
+ * Task Mgr And Tracker Integration
+ *
+ * Copyright 2003 GForge, LLC
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'pm/ProjectGroupFactory.class.php';
+require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
+
+$group_project_id = getIntFromRequest('group_project_id');
+$project_task_id = getIntFromRequest('project_task_id');
+$aid = getIntFromRequest('aid');
+
+$a=new Artifact($ath,$aid);
+if (!$a || !is_object($a)) {
+	exit_error(_('Artifact Could Not Be Created'),'tracker');
+}
+
+//
+//	Add a relationship from this artifact to an existing task
+//
+if (getStringFromRequest('add_to_task')) {
+	$offset = getStringFromRequest('offset');
+	$_order = getStringFromRequest('_order');
+	$max_rows = getIntFromRequest('max_rows');
+	$set = getStringFromRequest('set');
+	$_assigned_to = getStringFromRequest('_assigned_to');
+	$_status = getStringFromRequest('_status');
+	$_category_id = getIntFromRequest('_category_id');
+
+	// $group object is created in tracker.php
+
+	$pg=new ProjectGroup($group,$group_project_id);
+	if (!$pg || !is_object($pg)) {
+		exit_error(_('Could Not Get ProjectGroup'),'tracker');
+	} elseif ($pg->isError()) {
+		exit_error($pg->getErrorMessage(),'tracker');
+	}
+
+	$ptf = new ProjectTaskFactory($pg);
+	if (!$ptf || !is_object($ptf)) {
+		exit_error(_('Could Not Get ProjectTaskFactory'),'tracker');
+	} elseif ($ptf->isError()) {
+		exit_error($ptf->getErrorMessage(),'tracker');
+	}
+
+	$ptf->setup($offset,$_order,$max_rows,$set,$_assigned_to,$_status,$_category_id);
+	if ($ptf->isError()) {
+		exit_error($ptf->getErrorMessage(),'tracker');
+	}
+
+	$pt_arr =& $ptf->getTasks();
+	if (!$pt_arr) {
+		if ($ptf->isError()) {
+			exit_error($ptf->getErrorMessage(),'tracker');
+		} else {
+			exit_error(_('No Available Tasks Found'),'tracker');
+		}
+	}
+
+	$related_tasks = $a->getRelatedTasks();
+	$skip = array();
+	while ($row = db_fetch_array($related_tasks)) {
+		$skip[$row['project_task_id']] = true;
+	}
+	$tasks = array();
+	foreach($pt_arr as $p) {
+		$id = $p->getID();
+		if (!isset($skip[$id])) {
+			$tasks[] = $p;
+		}
+	}
+	if (empty($tasks)) {
+		exit_error(_('No Available Tasks Found'));
+	}
+
+	$ath->header(array('titlevals'=>array($ath->getName()),
+		'atid'=>$ath->getID(),
+		'title'=>_('Build Relationship Between Tracker Items and Tasks')));
+
+	echo '
+		<form name="foo" action="'. getStringFromServer('PHP_SELF') .'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'" method="post">
+		<p><strong>'._('Tracker Item').':</strong> [#'.$a->getID().'] '.$a->getSummary().'</p>
+		<p><strong>'._('Tasks Project').':</strong><br />';
+	echo $pg->getName().'
+		<input type="hidden" name="group_project_id" value="'.$pg->getID().'" /></p>
+		<p>
+		<strong>'._('Task').':</strong></p>
+		<select name="project_task_id">';
+	foreach($tasks as $task) {
+		echo '<option value="'.$task->getID().'">'.$task->getSummary().'</option>';
+	}
+	echo '</select><br />
+		<input type="submit" name="done_adding" value="'._('Add Relationship to Selected Task') . '" />
+		</form>';
+
+//
+//	Add the relationship and display finished message
+//
+} elseif (getStringFromRequest('done_adding')) {
+
+	session_redirect('/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&project_task_id='.$project_task_id.'&func=addartifact&add_artifact_id='. $a->getID());
+
+//
+//	Create a new task and relate it to this artifact
+//
+} elseif (getStringFromRequest('new_task')) {
+
+	session_redirect ('/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=addtask&related_artifact_summary='. urlencode($a->getSummary()) .'&related_artifact_id='. $a->getID());
+
+//
+//	Show the list of ProjectGroups available
+//
+} else {
+
+	$pgf=new ProjectGroupFactory($group);
+	if (!$pgf || !is_object($pgf)) {
+		exit_error(_('Could Not Get Factory'),'tracker');
+	} elseif ($pgf->isError()) {
+		exit_error($pgf->getErrorMessage(),'tracker');
+	}
+
+	$pg_arr = $pgf->getProjectGroups();
+	if (!$pg_arr) {
+		if ($pgf->isError()) {
+			exit_error($pgf->getErrorMessage(),'tracker');
+		} else {
+			exit_error(_('No Existing Project Groups Found'),'tracker');
+		}
+	}
+
+	$ath->header(array('titlevals'=>array($ath->getName()),
+		'atid'=>$ath->getID(),
+		'title'=>_('Build Relationship Between Tracker Items and Tasks')));
+
+	echo '<form name="foo" action="'. getStringFromServer('PHP_SELF') .'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'" method="post">
+		<p><strong>'._('Tracker Item').':</strong> [#'.$a->getID().'] '.$a->getSummary().'</p>
+		<p><strong>'._('Tasks Project').':</strong></p>
+		<select name="group_project_id">';
+	for ($i=0; $i<count($pg_arr); $i++) {
+		echo '<option value="'.$pg_arr[$i]->getID().'">'.$pg_arr[$i]->getName().'</option>';
+	}
+	echo '</select>
+		<p>
+		<input type="submit" name="add_to_task" value="'._('Add Relation to Existing Task').'" />
+		<input type="submit" name="new_task" value="'._('Create New Task').'" />
+		</p>
+		</form>';
+
+}
+
+$ath->footer(array());
+
+?>

Copied: trunk/src/common/tracker/actions/tracker.php (from rev 14555, trunk/src/www/tracker/tracker.php)
===================================================================
--- trunk/src/common/tracker/actions/tracker.php	                        (rev 0)
+++ trunk/src/common/tracker/actions/tracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,594 @@
+<?php
+/**
+ * Tracker Front Page
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2002-2004 (c) GForge Team
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+html_use_tooltips();
+
+//
+//	get the Group object
+//
+$group =& group_get_object($group_id);
+if (!$group || !is_object($group)) {
+	exit_no_group();
+}
+if ($group->isError()) {
+	if($group->isPermissionDeniedError()) {
+		exit_permission_denied($group->getErrorMessage(),'tracker');
+	} else {
+		exit_error($group->getErrorMessage(),'tracker');
+	}
+}
+
+//
+//	Create the ArtifactType object
+//
+$ath = new ArtifactTypeHtml($group,$atid);
+
+if (!$ath || !is_object($ath)) {
+	exit_error(_('ArtifactType could not be created'),'tracker');
+}
+if ($ath->isError()) {
+	if($ath->isPermissionDeniedError()) {
+		exit_permission_denied($ath->getErrorMessage(),'tracker');
+	} else {
+		exit_error($ath->getErrorMessage(),'tracker');
+	}
+}
+switch (getStringFromRequest('func')) {
+
+	case 'add' : {
+		if (!$ath->allowsAnon() && !session_loggedin()) {
+			exit_permission_denied('tracker');
+		}
+		include $gfcommon.'tracker/actions/add.php';
+		break;
+	}
+	case 'postadd' : {
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+
+		$user_email = getStringFromRequest('user_email');
+		$category_id = getIntFromRequest('category_id');
+		$artifact_group_id = getIntFromRequest('artifact_group_id');
+		$summary = getStringFromRequest('summary');
+		$details = getStringFromRequest('details');
+		$assigned_to = getStringFromRequest('assigned_to');
+		$priority = getStringFromRequest('priority');
+		$extra_fields = getStringFromRequest('extra_fields');
+
+		/*
+			Create a new Artifact
+
+		*/
+		$ah=new ArtifactHtml($ath);
+		$feedback = '';
+		if (!$ah || !is_object($ah)) {
+			form_release_key(getStringFromRequest('form_key'));
+			exit_error(_('Artifact Could Not Be Created'),'tracker');
+		} else if (!$ath->allowsAnon() && !session_loggedin()) {
+			exit_error(_('Artifact: This ArtifactType Does Not Allow Anonymous Submissions. Please Login.'),'tracker');
+		} else {
+			if (empty($user_email)) {
+				$user_email=false;
+			} else {
+				if (!validate_email($user_email)) {
+					form_release_key(getStringFromRequest('form_key'));
+					exit_error(_('Invalid Email Address') . htmlspecialchars($user_email),'tracker');
+				}
+			}
+			if ($user_email) {
+				$details = "Anonymous message posted by $user_email\n\n".
+				$details;
+			}
+			if (!$ah->create($summary,$details,$assigned_to,$priority,$extra_fields)) {
+				form_release_key(getStringFromRequest('form_key'));
+				exit_error($ah->getErrorMessage(),'tracker');
+			} else {
+				//
+				//	  Attach files to this Artifact.
+				//
+				$ext_feedback = '';
+				for ($i=0; $i<5; $i++) {
+					$f = getUploadedFile("input_file$i");
+					$error = $f['error'];
+					if (isset($error) && $error > 0) {
+						$n = $i+1;
+						if ($error === 1 || $error === 2) {
+							// UPLOAD_ERR_INI_SIZE or UPLOAD_ERR_FORM_SIZE
+							$ext_feedback .= "<br />ERROR: Skipping attachement $n: file is too large.";
+						} elseif ($error === 3) {
+							// UPLOAD_ERR_PARTIAL
+							$ext_feedback .= "<br />ERROR: Skipping attachement $n: transfert interrupted.";
+						}
+						continue;
+					}
+					$file_name = $f['name'];
+					$tmp_name = $f['tmp_name'];
+					$size = $f['size'];
+					$type = $f['type'];
+					if (!is_uploaded_file($tmp_name)) {
+						continue;
+					}
+
+					$afh=new ArtifactFileHtml($ah);
+					if (!$afh || !is_object($afh)) {
+						$error_msg .= _('Could Not Create File Object');
+					} elseif ($afh->isError()) {
+						$error_msg .= $afh->getErrorMessage();
+					} else {
+						if (!util_check_fileupload($tmp_name)) {
+							form_release_key(getStringFromRequest('form_key'));
+							//delete the artifact
+							$ah->delete(true);
+							exit_error(_('Invalid filename'),'tracker');
+						}
+						if (!$afh->upload($tmp_name,$file_name,$type,' ')) {
+							form_release_key(getStringFromRequest('form_key'));
+							//delete the artifact
+							$ah->delete(true);
+							exit_error(_('Could Not Attach File to Item: '.$afh->getErrorMessage()),'tracker');
+						}
+					}
+				}
+				$feedback .= sprintf(_('Item %s successfully created'),'[#'.$ah->getID().']');
+				$feedback .= $ext_feedback;
+				include $gfcommon.'tracker/actions/browse.php';
+			}
+		}
+		break;
+	}
+	case 'massupdate' : {
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+
+		$artifact_id_list = getArrayFromRequest('artifact_id_list');
+		$priority = getStringFromRequest('priority');
+		$status_id = getIntFromRequest('status_id');
+		$category_id = getIntFromRequest('category_id');
+		$artifact_group_id = getIntFromRequest('artifact_group_id');
+		$resolution_id = getIntFromRequest('resolution_id');
+		$assigned_to = getStringFromRequest('assigned_to');
+		$canned_response = getIntFromRequest("canned_response");
+		$extra_fields = getArrayFromRequest('extra_fields');
+		$was_error=false;
+
+		$count=count($artifact_id_list);
+
+		session_require_perm ('tracker', $ath->getID(), 'manager') ;
+
+		$artifact_type_id=$ath->getID();
+
+		for ($i=0; $i < $count; $i++) {
+			$ah=new Artifact($ath,$artifact_id_list[$i]);
+			if (!$ah || !is_object($ah)) {
+				$feedback .= ' ID: '.$artifact_id_list[$i].'::Artifact Could Not Be Created';
+			} else if ($ah->isError()) {
+				$feedback .= ' ID: '.$artifact_id_list[$i].'::'.$ah->getErrorMessage();
+			} else {
+				$_summary = '';
+				$_priority=(($priority != 100) ? $priority : $ah->getPriority());
+				$_status_id=(($status_id != 100) ? $status_id : $ah->getStatusID());
+				//yikes, we want the ability to mass-update to "un-assigned", which is the ID=100, which
+				//conflicts with the "no change" ID! Sorry for messy use of 100.1
+				$_assigned_to=(($assigned_to != '100.1') ? $assigned_to : $ah->getAssignedTo());
+
+				//
+				//	get existing extra field data
+				//	we will then override individual elements if needed
+				//
+				$ef = $ah->getExtraFieldData();
+				$keys = array_keys($ef);
+				foreach ($keys as $efid) {
+					if (is_array($ef[$efid])) {
+						$f = $extra_fields[$efid];
+						// in this case, if $extra_fields is not setted, it
+						// means no option was selected, so we have to delete
+						// the original values
+						if (!is_array($f) || count($f) == 0) {
+							$ef[$efid] = array();
+						} else if (in_array('100', $extra_fields[$efid])) {	// "No change" option selected?
+							// no change
+						} else {
+							$ef[$efid] = $f;		// replace old values with new values
+						}
+					} else {
+						// in some cases (ie: textfields) the value is not passed, but
+						// this doesn't mean we must delete the existing value
+						if (array_key_exists($efid, $extra_fields)) {
+							$f = $extra_fields[$efid];
+							if ($f == '100') {
+								// no change
+							} else {
+								$ef[$efid] = $f;
+							}
+						} else {
+							$ef[$efid] = addslashes($ef[$efid]);
+						}
+					}
+				}
+
+				if (!$ah->update($_priority,$_status_id,$_assigned_to,$_summary,$canned_response,'',$artifact_type_id,$ef)) {
+					$was_error=true;
+				}
+
+				if ($was_error) {
+					$error_msg .= ' ID: '.$artifact_id_list[$i].'::'.$ah->getErrorMessage();
+				}else {
+					$was_error=false;
+				}
+			}
+			unset($ah);
+
+		if (!$was_error) {
+			$feedback = _('Updated Successfully');			}
+		}
+		unset ($extra_fields_choice);
+		include $gfcommon.'tracker/actions/browse.php';
+		break;
+	}
+	case 'postmod' : {
+		$artifact_id = getIntFromRequest('artifact_id');
+		$priority = getIntFromRequest('priority');
+		$status_id = getIntFromRequest('status_id');
+		$category_id = getIntFromRequest('category_id');
+		$artifact_group_id = getIntFromRequest('artifact_group_id');
+		$resolution_id = getIntFromRequest('resolution_id');
+		$assigned_to = getStringFromRequest('assigned_to');
+		$summary = getStringFromRequest('summary');
+		$canned_response = getStringFromRequest('canned_response');
+		$details = getStringFromRequest('details');
+		$description = getStringFromRequest('description');
+		$new_artifact_type_id = getIntFromRequest('new_artifact_type_id');
+		$extra_fields = getStringFromRequest('extra_fields');
+		$user_email = getStringFromRequest('user_email', false);
+		$was_error = false;
+
+		/*
+			Technicians can modify limited fields - to be certain
+			no one is hacking around, we override any fields they don't have
+			permission to change.
+		*/
+		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+			exit_form_double_submit('tracker');
+		}
+
+		$ah=new ArtifactHtml($ath,$artifact_id);
+		if (!$ah || !is_object($ah)) {
+			exit_error(_('Artifact Could Not Be Created'),'tracker');
+		} else if ($ah->isError()) {
+			exit_error($ah->getErrorMessage(),'tracker');
+		} else if (!$ath->allowsAnon() && !session_loggedin()) {
+			exit_error(_('Artifact: This ArtifactType Does Not Allow Anonymous Submissions. Please Login.'),'tracker');
+		} else {
+
+			$remlink = getArrayFromRequest('remlink');
+			if (count($remlink) > 0 && forge_check_perm ('tracker_admin', $ah->ArtifactType->Group->getID())) {
+				require_once $gfcommon.'pm/ProjectTask.class.php';
+				foreach ($remlink as $tid) {
+					$pt = &projecttask_get_object($tid);
+					if (!$pt || $pt->isError())
+						exit_error(_('Error'), sprintf(_('Could not get Project Task for %d'), $tid));
+					if (!$pt->removeRelatedArtifacts(array($artifact_id)))
+						exit_error($tid."->removeRelatedArtifacts(".$artifact_id.")", $pt->getErrorMessage());
+				}
+			}
+			/*
+
+				The following logic causes fields to be overridden
+				in the event that someone tampered with the HTML form
+
+			*/
+			if (forge_check_perm ('tracker', $ath->getID(), 'tech')
+					|| forge_check_perm ('tracker', $ath->getID(), 'manager')) {
+				//admin and techs can do everything
+				//techs will have certain fields overridden inside the update() function call
+				if (!$ah->update($priority,$status_id,
+					$assigned_to,$summary,$canned_response,$details,$new_artifact_type_id,$extra_fields, $description)) {
+					form_release_key(getStringFromRequest('form_key'));
+					$error_msg .= _('Tracker Item'). ': '.$ah->getErrorMessage();
+					$ah->clearError();
+					$was_error=true;
+				}
+
+			} else {
+
+				// Everyone else can add comments
+				if ($details) {
+					if ($ah->addMessage($details,$user_email,true)) {
+						$feedback=_('Comment added');
+					} else {
+						if ( (strlen($details)>0) ) { //if there was no message, then it's not an error but addMessage returns false and sets missing params error
+							//some kind of error in creation
+							exit_error($ah->getErrorMessage(),'tracker');
+						} else {
+							// we have to unset the error if the user added a file ( add a file and no comment)
+							if ( (getStringFromRequest('add_file')) ) {
+								$ah->clearError();
+							}
+						}
+					}
+
+				} else {
+
+					//everyone else can only add comments
+					$delete_file=false;
+					$add_file=false;
+					if ($ah->addMessage($details,$user_email,true)) {
+						$feedback=_('Comment added');
+					} else {
+						//some kind of error in creation
+						exit_error($ah->getErrorMessage(),'tracker');
+					}
+				}
+			}
+
+			// Admin, Techs and Submitter can add files.
+			if (forge_check_perm ('tracker', $ath->getID(), 'tech')
+					|| forge_check_perm ('tracker', $ath->getID(), 'manager')
+					|| (session_loggedin() && ($ah->getSubmittedBy() == user_getid()))) {
+				//
+				//	  Attach files to this Artifact.
+				//
+				$ext_feedback = '';
+				for ($i=0; $i<5; $i++) {
+					$f = getUploadedFile("input_file$i");
+					$error = $f['error'];
+					if (isset($error) && $error > 0) {
+						$n = $i+1;
+						if ($error === 1 || $error === 2) {
+							// UPLOAD_ERR_INI_SIZE or UPLOAD_ERR_FORM_SIZE
+							$ext_feedback .= "<br />" .
+								sprintf(_("ERROR: Skipping attachment %d: file is too large."), $n);
+						} elseif ($error === 3) {
+							// UPLOAD_ERR_PARTIAL
+							$ext_feedback .= "<br />" .
+								sprintf(_("ERROR: Skipping attachment %d: transfer interrupted."), $n);
+						}
+						continue;
+					}
+					$file_name = $f['name'];
+					$tmp_name = $f['tmp_name'];
+					$size = $f['size'];
+					$type = $f['type'];
+
+					if (!is_uploaded_file($tmp_name)) {
+						continue;
+					}
+
+					$afh=new ArtifactFileHtml($ah);
+					if (!$afh || !is_object($afh)) {
+						$error_msg .= _('Could Not Create File Object');
+					} elseif ($afh->isError()) {
+						$error_msg .= $afh->getErrorMessage();
+					} else {
+						if (!util_check_fileupload($tmp_name)) {
+							form_release_key(getStringFromRequest('form_key'));
+							exit_error(_('Invalid filename'),'tracker');
+						}
+						if (!$afh->upload($tmp_name,$file_name,$type,' ')) {
+							$error_msg .= ' <br />'._('File Upload: Error').':'.$afh->getErrorMessage();
+							$was_error=true;
+						} else {
+							$feedback .= ' <br />'._('File Upload: Successful');
+						}
+					}
+				}
+
+				// Admin and Techs can delete files.
+				if (forge_check_perm ('tracker', $ath->getID(), 'tech')
+						|| forge_check_perm ('tracker', $ath->getID(), 'manager')) {
+					//
+					//	Delete list of files from this artifact
+					//
+					$delete_file = getStringFromRequest('delete_file');
+					if ($delete_file) {
+						$count=count($delete_file);
+						for ($i=0; $i<$count; $i++) {
+							$afh=new ArtifactFileHtml($ah,$delete_file[$i]);
+							if (!$afh || !is_object($afh)) {
+								$error_msg .= _('Could Not Create File Object::').$delete_file[$i];
+							} elseif ($afh->isError()) {
+								$error_msg .= $afh->getErrorMessage().'::'.$delete_file[$i];
+							} else {
+								if (!$afh->delete()) {
+									$error_msg .= ' <br />'._('File Delete:').': '.$afh->getErrorMessage();
+									$was_error=true;
+								} else {
+									$feedback .= ' <br />'._('File Delete: Successful');
+								}
+							}
+						}
+					}
+				}
+
+				//
+				//	Show just one feedback entry if no errors
+				//
+				if (!$was_error) {
+					$feedback = sprintf(_('Item %s successfully updated'),'[#'.$ah->getID().']');
+				}
+				$feedback .= $ext_feedback;
+				include $gfcommon.'tracker/actions/browse.php';
+				break;
+			}
+		}
+	}
+		case 'monitor' : {
+			if (!session_loggedin()) {
+				exit_permission_denied();
+			}
+			$start = getIntFromRequest('start');
+			$stop = getIntFromRequest('stop');
+			$artifact_id = getIntFromRequest('artifact_id');
+
+			// Fix to prevent collision with the start variable used in browse.
+			$_GET['start'] = 0;
+
+			if ($artifact_id) {
+				$ah=new ArtifactHtml($ath,$artifact_id);
+				if (!$ah || !is_object($ah)) {
+					exit_error(_('Artifact Could Not Be Created'),'tracker');
+				} else if ($ah->isError()) {
+					exit_error($ah->getErrorMessage(),'tracker');
+				} else {
+					if ($start && $ah->isMonitoring())
+						$feedback = _('Monitoring Started');
+					elseif ($stop && !$ah->isMonitoring())
+						$feedback = _('Monitoring Deactivated');
+					else {
+						$ah->setMonitor();
+						$error_msg = $ah->getErrorMessage();
+					}
+					include $gfcommon.'tracker/actions/browse.php';
+				}
+			} else {
+				$at=new ArtifactType($group,$atid);
+				if (!$at || !is_object($at)) {
+					exit_error(_('Artifact Could Not Be Created'),'tracker');
+				} else if ($at->isError()) {
+					exit_error($at->getErrorMessage(),'tracker');
+				} else {
+					if ($start && $at->isMonitoring())
+						$feedback = _('Monitoring Started');
+					elseif ($stop && !$at->isMonitoring())
+						$feedback = _('Monitoring Deactivated');
+					else {
+						$at->setMonitor();
+						$feedback=$at->getErrorMessage();
+						$at->clearError();
+					}
+					include $gfcommon.'tracker/actions/browse.php';
+				}
+			}
+			break;
+		}
+
+
+		//
+		//	Show delete form
+		//
+		case 'deleteartifact' : {
+			session_require_perm ('tracker', $ath->getID(), 'manager') ;
+
+			$aid = getIntFromRequest('aid');
+			$ah= new ArtifactHtml($ath,$aid);
+			if (!$ah || !is_object($ah)) {
+				exit_error(_('Artifact Could Not Be Created'),'tracker');
+			} elseif ($ah->isError()) {
+				exit_error($ah->getErrorMessage(),'tracker');
+			}
+			include $gfcommon.'tracker/actions/deleteartifact.php';
+			break;
+		}
+
+		//
+		//	Handle the actual delete
+		//
+
+		case 'postdeleteartifact' : {
+			if (!form_key_is_valid(getStringFromRequest('form_key'))) {
+				exit_form_double_submit('tracker');
+			}
+			session_require_perm ('tracker', $ath->getID(), 'manager') ;
+
+			$aid = getStringFromRequest('aid');
+			$ah= new ArtifactHtml($ath,$aid);
+			if (!$ah || !is_object($ah)) {
+				exit_error(_('Artifact Could Not Be Created'),'tracker');
+			} elseif ($ah->isError()) {
+				exit_error($ah->getErrorMessage(),'tracker');
+			}
+			if (!getStringFromRequest('confirm_delete')) {
+				$warning_msg .= _('Confirmation failed. Artifact not deleted');
+			}
+			else {
+				if (!$ah->delete(true)) {
+					$error_msg .= _('Artifact Delete Failed') . ': '.$ah->getErrorMessage();
+				} else {
+					$feedback .= _('Artifact Deleted Successfully');
+				}
+			}
+			include $gfcommon.'tracker/actions/browse.php';
+			break;
+		}
+
+
+		case 'taskmgr' : {
+			include $gfcommon.'tracker/actions/taskmgr.php';
+			break;
+		}
+		case 'browse' : {
+			include $gfcommon.'tracker/actions/browse.php';
+			break;
+		}
+		case 'query' : {
+			include $gfcommon.'tracker/actions/query.php';
+			break;
+		}
+		case 'downloadcsv' : {
+			include $gfcommon.'tracker/actions/downloadcsv.php';
+			break;
+		}
+		case 'download' : {
+			$aid = getIntFromRequest('aid');
+			session_redirect('/tracker/download.php?group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'&file_id='.$file_id);
+			break;
+		}
+		case 'detail' : {
+			$aid = getIntFromRequest('aid');
+
+			//
+			//	users can modify their own tickets in a limited way if they submitted them
+			//	even if they are not artifact admins
+			//
+			$ah=new ArtifactHtml($ath,$aid);
+			if (!$ah || !is_object($ah)) {
+				exit_error(_('Artifact Could Not Be Created'),'tracker');
+			} else if ($ah->isError()) {
+				exit_error($ah->getErrorMessage(),'tracker');
+			} else {
+				if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
+					include $gfcommon.'tracker/actions/mod.php';
+				} elseif (forge_check_perm ('tracker', $ath->getID(), 'tech')) {
+					include $gfcommon.'tracker/actions/mod-limited.php';
+				} else {
+					include $gfcommon.'tracker/actions/detail.php';
+				}
+			}
+			break;
+		}
+		default : {
+			include $gfcommon.'tracker/actions/browse.php';
+			break;
+		}
+	}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/include/ArtifactFileHtml.class.php (from rev 14555, trunk/src/www/tracker/include/ArtifactFileHtml.class.php)
===================================================================
--- trunk/src/common/tracker/include/ArtifactFileHtml.class.php	                        (rev 0)
+++ trunk/src/common/tracker/include/ArtifactFileHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,56 @@
+<?php
+/**
+ *
+ * SourceForge Generic Tracker facility
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright 2011, Franck Villaume - Capgemini
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactFile.class.php';
+
+class ArtifactFileHtml extends ArtifactFile {
+
+	/**
+	 *  ArtifactFileHtml() - constructor
+	 *
+	 *  Use this constructor if you are modifying an existing artifact
+	 *
+	 *	@param $Artifact object
+	 *  @param $data associative array (all fields from artifact_file_user_vw) OR id from database
+	 *  @return true/false
+	 */
+	function ArtifactFileHtml(&$Artifact, $data=false) {
+		return $this->ArtifactFile($Artifact,$data);
+	}
+
+	function upload($input_file,$input_file_name,$input_file_type,$description) {
+		if (!util_check_fileupload($input_file)) {
+			$this->setError('ArtifactFile: Invalid filename');
+			return false;
+		}
+		$size = @filesize($input_file);
+		$input_data = fread(fopen($input_file, 'r'), $size);
+		return $this->create($input_file_name,$input_file_type,$size,$input_data,$description);
+	}
+
+}
+
+?>

Copied: trunk/src/common/tracker/include/ArtifactHtml.class.php (from rev 14555, trunk/src/www/tracker/include/ArtifactHtml.class.php)
===================================================================
--- trunk/src/common/tracker/include/ArtifactHtml.class.php	                        (rev 0)
+++ trunk/src/common/tracker/include/ArtifactHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,224 @@
+<?php
+/**
+ *
+ * SourceForge Generic Tracker facility
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2011, Franck Villaume - Capgemini
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/Artifact.class.php';
+require_once $gfcommon.'include/utils_crossref.php';
+
+class ArtifactHtml extends Artifact {
+
+	/**
+	 *  ArtifactHtml() - constructor
+	 *
+	 *  Use this constructor if you are modifying an existing artifact
+	 *
+	 *  @param $ArtifactType object
+	 *  @param $artifact_id integer (primary key from database)
+	 *  @return true/false
+	 */
+	function ArtifactHtml(&$ArtifactType,$artifact_id=false) {
+		return $this->Artifact($ArtifactType,$artifact_id);
+	}
+
+	/**
+	 * show details preformatted (like followups)
+	 */
+	function showDetails($editable = false) {
+		$result = $this->getDetails();
+		$result = util_gen_cross_ref($result, $this->ArtifactType->Group->getID());
+		//$result = util_line_wrap( $result, 120,"\n");
+		$result = preg_replace('/\r|\n/', '<br />', $result);
+
+		$title_arr = array();
+		if ($editable === true) {
+			$title_arr[] = '<div style="width:100%;">' .
+				'<div style="float:left">' . _('Detailed description') . '</div>' .
+				'<div style="float:right">' . html_image('ic/forum_edit.gif','37','15',array('title'=>"Click to edit", 'alt'=>"Click to edit", 'onclick'=>"switch2edit(this, 'show', 'edit')")) . '</div>' .
+				'</div>';
+		}
+		else {
+			$title_arr[] = _('Detailed description');
+		}
+		echo $GLOBALS['HTML']->listTableTop ($title_arr);
+
+		echo '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle(0) .'><td>'. $result. '</td></tr>';
+
+		echo $GLOBALS['HTML']->listTableBottom();
+	}
+
+
+	function showMessages($asc=true) {
+		$result= $this->getMessages($asc);
+		$rows=db_numrows($result);
+
+		if ($rows > 0) {
+			$title_arr=array();
+			$title_arr[]=_('Message');
+
+			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+
+			for ($i=0; $i < $rows; $i++) {
+				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>';
+
+				$params = array('user_id' => db_result($result,$i,'user_id'), 'size' => 's');
+				plugin_hook("user_logo", $params);
+
+				echo _('Date').': '.
+					date(_('Y-m-d H:i'),db_result($result, $i, 'adddate')) .'<br />'.
+					_('Sender').': ';
+				if(db_result($result,$i,'user_id') == 100) {
+					echo db_result($result,$i,'realname');
+				} else {
+					echo util_make_link_u (db_result($result,$i,'user_name'),db_result($result,$i,'user_id'),db_result($result,$i,'realname'));
+				}
+
+				$text = db_result($result, $i, 'body');
+				$text = util_gen_cross_ref($text, $this->ArtifactType->Group->getID());
+				//$text = util_line_wrap( $text, 120,"\n");
+				$text = preg_replace('/\r?\n/', '<br />', $text);
+				echo "<br /><br />".$text.'</td></tr>';
+			}
+
+			echo $GLOBALS['HTML']->listTableBottom();
+
+		} else {
+			echo '
+				<p>'._('No Followups Have Been Posted').'</p>';
+		}
+	}
+
+	function showHistory() {
+		global $artifact_cat_arr,$artifact_grp_arr,$artifact_res_arr;
+		$result=$this->getHistory();
+		$rows= db_numrows($result);
+
+		if ($rows > 0) {
+
+			$title_arr=array();
+			$title_arr[]=_('Field');
+			$title_arr[]=_('Old Value');
+			$title_arr[]=_('Date');
+			$title_arr[]=_('By');
+
+			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+
+			$artifactType =& $this->getArtifactType();
+
+			for ($i=0; $i < $rows; $i++) {
+				$field=db_result($result, $i, 'field_name');
+				echo '
+				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'.$field.'</td><td>';
+
+				if ($field == 'status_id') {
+
+					echo $artifactType->getStatusName(db_result($result, $i, 'old_value'));
+
+				} else if ($field == 'assigned_to') {
+
+					echo user_getname(db_result($result, $i, 'old_value'));
+
+				} else if ($field == 'close_date') {
+					if (db_result($result, $i, 'old_value'))
+						echo date(_('Y-m-d H:i'),db_result($result, $i, 'old_value'));
+					else
+						echo '<i>None</i>';
+				} else {
+
+					echo db_result($result, $i, 'old_value');
+
+				}
+				echo '</td>'.
+					'<td>'. date(_('Y-m-d H:i'),db_result($result, $i, 'entrydate')) .'</td>'.
+					'<td>'. db_result($result, $i, 'user_name'). '</td></tr>';
+			}
+
+			echo $GLOBALS['HTML']->listTableBottom();
+
+		} else {
+			echo '
+			<p>'._('No Changes Have Been Made to This Item').'</p>';
+		}
+
+	}
+
+	function showRelations() {
+		$aid = $this->getID();
+
+		// Search for all relations pointing to this record.
+
+		$res = db_query_params ('SELECT *
+		FROM artifact_extra_field_list, artifact_extra_field_data, artifact_group_list, artifact, groups
+		WHERE field_type=9
+		AND artifact_extra_field_list.extra_field_id=artifact_extra_field_data.extra_field_id
+		AND artifact_group_list.group_artifact_id = artifact_extra_field_list.group_artifact_id
+		AND artifact.artifact_id = artifact_extra_field_data.artifact_id
+		AND groups.group_id = artifact_group_list.group_id
+		AND (field_data = $1 OR field_data LIKE $2 OR field_data LIKE $3 OR field_data LIKE $4)
+		ORDER BY artifact_group_list.group_id ASC, name ASC, artifact.artifact_id ASC',
+					array($aid,
+					      "$aid %",
+					      "% $aid %",
+					      "% $aid"));
+		if (db_numrows($res)>0) {
+			?>
+<div class="tabbertab" title="<?php echo _('Backward Relations'); ?>">
+<table border="0" width="80%">
+	<tr>
+		<td colspan="2">
+		<h2><?php echo _('Changes') ?>:</h2>
+		<?php
+		$current = '';
+		$end = '';
+		while ($arr = db_fetch_array($res)) {
+			$title = $arr['group_name'].': '.$arr['name'];
+			if ($title != $current) {
+				echo $end.'<strong>'.$title.'</strong>';
+				$current = $title;
+				$end = '<br /><br />';
+			}
+			$text = '[#'.$arr['artifact_id'].']';
+			$url = '/tracker/?func=detail&aid='.$arr['artifact_id'].'&group_id='.$arr['group_id'].'&atid='.$arr['group_artifact_id'];
+			$arg = 'title="'.util_html_secure($arr['summary']).'"' ;
+			if ($arr['status_id'] == 2) {
+				$arg .= 'class="artifact_closed"';
+			}
+			print '<br/>   <a href="'.$url.'" '.$arg.'>'.$text.'</a>'.' <a href="'.$url.'">'.$arr['summary'].'</a> <i>(Relation: '.$arr['field_name'].')</i>';
+		}
+		?></td>
+	</tr>
+</table>
+</div>
+<?php
+		}
+	}
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/include/ArtifactTypeFactoryHtml.class.php (from rev 14555, trunk/src/www/tracker/include/ArtifactTypeFactoryHtml.class.php)
===================================================================
--- trunk/src/common/tracker/include/ArtifactTypeFactoryHtml.class.php	                        (rev 0)
+++ trunk/src/common/tracker/include/ArtifactTypeFactoryHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,85 @@
+<?php
+/**
+ * FusionForge Generic Tracker facility
+ *
+ * Copyright 2011 (C) Alain Peyrat, Alcatel-Lucent
+ * Copyright 2011, Franck Villaume - Capgemini
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactType.class.php';
+require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
+require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
+require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
+require_once $gfcommon.'include/utils_crossref.php';
+
+class ArtifactTypeFactoryHtml extends ArtifactTypeFactory {
+	function header($params=array()) {
+		global $HTML;
+
+		if (!forge_get_config('use_tracker')) {
+			exit_disabled();
+		}
+
+		$group_id= $this->Group->getID();
+
+		$params['group']=$group_id;
+		if (!isset($params['title'])) {
+			$params['title']=sprintf(_('Trackers for %1$s'), $this->Group->getPublicName());
+		}
+		$params['toptab']='tracker';
+
+		$labels = array(_('View Trackers'));
+		$links  = array('/tracker/?group_id='.$group_id);
+		$attr   = array(array('title' => _('Get the list of available trackers'), 'class' => 'tabtitle-nw'));
+		if (session_loggedin()) {
+			$labels[] = _('Reporting');
+			$links[]  = '/tracker/reporting/?group_id='.$group_id;
+			$attr[]   = array('title' => _('Various graph of statistics.'), 'class' => 'tabtitle');
+			$perm = $this->Group->getPermission(session_get_user());
+			if ($perm && is_object($perm) && !$perm->isError() && $perm->isPMAdmin()) {
+				$labels[] = _('Administration');
+				$links[]  = '/tracker/admin/?group_id='.$group_id;
+				$attr[]   = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle');
+			}
+		}
+
+		$params['submenu'] = $HTML->subMenu($labels, $links, $attr);
+
+		site_project_header($params);
+	}
+
+	function footer($params=array()) {
+		site_project_footer($params);
+	}
+
+//     function adminHeader($params=array()) {
+//             return $this->header($params);
+//     }
+//
+//     function adminFooter($params=array()) {
+//             return $this->footer($params);
+//     }
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/include/ArtifactTypeHtml.class.php (from rev 14555, trunk/src/www/tracker/include/ArtifactTypeHtml.class.php)
===================================================================
--- trunk/src/common/tracker/include/ArtifactTypeHtml.class.php	                        (rev 0)
+++ trunk/src/common/tracker/include/ArtifactTypeHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,725 @@
+<?php
+/**
+ * FusionForge Generic Tracker facility
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems - Sourceforge
+ * Copyright 2010 (c) Fusionforge Team
+ * Copyright 2011, Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once $gfcommon.'tracker/ArtifactType.class.php';
+require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
+require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
+require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
+require_once $gfcommon.'include/utils_crossref.php';
+
+class ArtifactTypeHtml extends ArtifactType {
+
+	/**
+	 *  ArtifactType() - constructor
+	 *
+	 *  @param $group object
+	 *  @param $artifact_type_id - the id # assigned to this artifact type in the db
+	 */
+	function ArtifactTypeHtml(&$group,$artifact_type_id=false, $arr=false) {
+		return $this->ArtifactType($group,$artifact_type_id,$arr);
+	}
+
+	function header($params) {
+		global $HTML;
+		if (!forge_get_config('use_tracker')) {
+			exit_disabled();
+		}
+		$group_id= $this->Group->getID();
+
+		//required by new site_project_header
+		$params['group']=$group_id;
+		$params['toptab']='tracker';
+		$params['tabtext']=$this->getName();
+
+		$labels = array();
+		$links  = array();
+		$attr   = array();
+
+		$labels[] = _("View Trackers");
+		$links[]  = '/tracker/?group_id='.$group_id;
+		$attr[]   = array('title' => _('Get the list of available trackers'), 'class' => 'tabtitle-nw');
+		$labels[] = $this->getName();
+		$links[]  = '/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
+		$attr[]   = array('title' => _('Browse this tracker.'), 'class' => 'tabtitle');
+		$labels[] = _('Download .csv');
+		$links[]  = '/tracker/?func=downloadcsv&group_id='.$group_id.'&atid='. $this->getID();
+		$attr[]   = array('title' => _('Download data from this tracker as csv file.'), 'class' => 'tabtitle');
+		if ($this->allowsAnon() || session_loggedin()) {
+			$labels[] = _('Submit New');
+			$links[]  = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
+			$attr[]   = array('title' => _('Add a new issue.'), 'class' => 'tabtitle');
+		}
+
+		if (session_loggedin()) {
+			$labels[] = _('Reporting');
+			$links[]  = '/tracker/reporting/?group_id='.$group_id.'&atid='. $this->getID();
+			$attr[]   = array('title' => _('Various graph about statistics.'), 'class' => 'tabtitle');
+			if ($this->isMonitoring()) {
+				$labels[] = _('Stop Monitor');
+				$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&stop=1';
+				$attr[]   = array('title' => _('Remove this tracker from your monitoring.'), 'class' => 'tabtitle');
+			} else {
+				$labels[] = _('Monitor');
+				$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
+				$attr[]   = array('title' => _('Add this tracker from your monitoring.'), 'class' => 'tabtitle');
+			}
+
+			if (forge_check_perm ('tracker', $this->getID(), 'manager')) {
+				$labels[] = _('Administration');
+				$links[]  = '/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID();
+				$attr[]   = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle');
+			}
+		} else {
+			$labels[] = _('Monitor');
+			$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
+			$attr[]   = array('title' => _('Add this tracker from your monitoring.'), 'class' => 'tabtitle');
+		}
+
+		$params['submenu'] = $HTML->subMenu($labels, $links, $attr);
+		site_project_header($params);
+
+		if ($this)
+			plugin_hook("blocks", "tracker_".$this->getName());
+
+	}
+
+	function footer($params) {
+		site_project_footer($params);
+	}
+
+	function adminHeader($params) {
+		global $HTML;
+		$this->header($params);
+		$group_id= $this->Group->getID();
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id;
+		$title_arr[]=_('New Tracker');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&update_type=1';
+		$title_arr[]=_('Update Settings');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_extrafield=1';
+		$title_arr[]=_('Manage Custom Fields');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&workflow=1';
+		$title_arr[]=_('Manage Workflow');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&customize_list=1';
+		$title_arr[]=_('Customize List');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_canned=1';
+		$title_arr[]=_('Add/Update Canned Responses');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&clone_tracker=1';
+		$title_arr[]=_('Clone Tracker');
+
+		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&delete=1';
+		$title_arr[]=_('Delete');
+
+		echo $HTML->printSubMenu($title_arr, $links_arr, false);
+	}
+
+	function adminFooter($params) {
+		echo $this->footer($params);
+	}
+
+	function renderSubmitInstructions() {
+		$msg = $this->getSubmitInstructions();
+		return str_replace("\n","<br />", $msg);
+	}
+
+	function renderBrowseInstructions() {
+		$msg = $this->getBrowseInstructions();
+		return str_replace("\n","<br />", $msg);
+	}
+
+	function renderExtraFields($selected=array(),$show_100=false,$text_100='none',$show_any=false,$text_any='Any',$types=array(),$status_show_100=false,$mode='') {
+		$efarr = $this->getExtraFields($types);
+		//each two columns, we'll reset this and start a new row
+
+		$template = $this->getRenderHTML($types, $mode);
+
+		if ($mode=='QUERY') {
+			$keys=array_keys($efarr);
+			for ($k=0; $k<count($keys); $k++) {
+				$i=$keys[$k];
+				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
+					$efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_MULTISELECT;
+				} else {
+					$efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_TEXT;
+				}
+			}
+		}
+
+		// 'DISPLAY' mode is for renderding in 'read-only' mode (for detail view).
+		if ($mode === 'DISPLAY') {
+			$keys=array_keys($efarr);
+			for ($k=0; $k<count($keys); $k++) {
+				$i=$keys[$k];
+
+				if (!isset($selected[$efarr[$i]['extra_field_id']]))
+					$selected[$efarr[$i]['extra_field_id']] = '';
+
+				$value = @$selected[$efarr[$i]['extra_field_id']];
+
+				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
+					if ($value == 100) {
+						$value = 'None';
+					} else {
+						$arr = $this->getExtraFieldElements($efarr[$i]['extra_field_id']);
+
+						// Convert the values (ids) to names in the ids order.
+						$new = array();
+						for ($j=0; $j<count($arr); $j++) {
+							if (is_array($value)) {
+								if (in_array($arr[$j]['element_id'],$value))
+									$new[]= $arr[$j]['element_name'];
+							} elseif ($arr[$j]['element_id'] === $value) {
+									$new[] = $arr[$j]['element_name'];
+							}
+						}
+						$value = join('<br />', $new);
+					}
+				} else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
+					$value = preg_replace('/((http|https|ftp):\/\/\S+)/',
+								"<a href=\"\\1\" target=\"_blank\">\\1</a>", $value);
+				} else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
+					// Convert artifact id to links.
+					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
+				}
+				$template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
+				$template = str_replace('{$'.$efarr[$i]['field_name'].'}',$value,$template);
+			}
+			echo $template;
+			return ;
+		}
+
+		$keys=array_keys($efarr);
+		for ($k=0; $k<count($keys); $k++) {
+			$i=$keys[$k];
+			$post_name = '';
+
+			if (!isset($selected[$efarr[$i]['extra_field_id']]))
+				$selected[$efarr[$i]['extra_field_id']] = '';
+
+			if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
+				$str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
+
+				$str = $this->renderCheckbox($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
+
+				$str = $this->renderRadio($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
+
+				$str = $this->renderTextField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
+				if ($mode == 'QUERY') {
+					$post_name =  ' <i>'._('(%% for wildcards)').'</i>   ';
+				}
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
+
+				$str = $this->renderTextArea($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
+				if ($mode == 'QUERY') {
+					$post_name =  ' <i>'._('(%% for wildcards)').'</i>   ';
+				}
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
+
+				$str = $this->renderMultiSelectBox ($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
+
+				// Get the allowed values from the workflow.
+				$atw = new ArtifactWorkflow($this, $efarr[$i]['extra_field_id']);
+
+				// Special treatement for the initial step (Submit).
+				// In this case, the initial value is the first value.
+				if ($selected === true) {
+					$selected_node = 100;
+				} elseif (isset($selected[$efarr[$i]['extra_field_id']]) && $selected[$efarr[$i]['extra_field_id']]) {
+					$selected_node = $selected[$efarr[$i]['extra_field_id']];
+				} else {
+					$selected_node = 100;
+				}
+
+				$allowed = $atw->getNextNodes($selected_node);
+				$allowed[] = $selected_node;
+				$str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected_node,$status_show_100,$text_100,$show_any,$text_any, $allowed);
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
+
+				$str = $this->renderRelationField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
+				if ($mode == 'UPDATE') {
+					$post_name = html_image('ic/forum_edit.gif','37','15',array('title'=>"Click to edit", 'alt'=>"Click to edit", 'onclick'=>"switch2edit(this, 'show$i', 'edit$i')"));
+				}
+			}
+			$template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
+			$template = str_replace('{$'.$efarr[$i]['field_name'].'}',$str,$template);
+		}
+		if($template != NULL){
+			echo $template;
+		}
+	}
+
+	function renderRelatedTasks($group, $ah) {
+
+		if (!$group->usesPM()) {
+			return '';
+		}
+
+		$taskcount = db_numrows($ah->getRelatedTasks());
+
+		if (forge_check_perm ('tracker_admin', $ah->ArtifactType->Group->getID())) {
+			$is_admin=false;
+		} else {
+			$is_admin=true;
+		}
+
+		$totalPercentage = 0;
+
+		if ($taskcount > 0) {
+			echo '<tr><td colspan="2">';
+			echo '<b>'._("Related Tasks").':</b>'.'<br/>';
+			$title_arr = array();
+			$title_arr[] = _('Task Id');
+			$title_arr[] = _('Task Summary');
+			$title_arr[] = _('Start Date');
+			$title_arr[] = _('End Date');
+			$title_arr[] = _('Status');
+			(($is_admin) ? $title_arr[]=_('Remove Relation') : '');
+			echo $GLOBALS['HTML']->listTableTop($title_arr);
+
+			echo '<table cellspacing="0">';
+			for ($i = 0; $i < $taskcount; $i++) {
+				$taskinfo  = db_fetch_array($ah->relatedtasks, $i);
+				$totalPercentage += $taskinfo['percent_complete'];
+				$taskid    = $taskinfo['project_task_id'];
+				$projectid = $taskinfo['group_project_id'];
+				$groupid   = $taskinfo['group_id'];
+				$summary   = util_unconvert_htmlspecialchars($taskinfo['summary']);
+				$startdate = date(_('Y-m-d H:i'), $taskinfo['start_date']);
+				$enddate   = date(_('Y-m-d H:i'), $taskinfo['end_date']);
+				$status   = $taskinfo['status_name'];
+				echo '<tr>
+						<td><a href="/pm/task.php?func=detailtask&project_task_id='.$taskid.
+						'&group_id='.$groupid.'&group_project_id='.$projectid.'">[T'.$taskid.'] '.$summary.'</a></td>
+						<td>'.$startdate.'</td>
+						<td>'.$enddate.'</td>
+						<td>'.$status.' ('.$taskinfo['percent_complete'].'%)</td>'.
+					(($is_admin) ? '<td><input type="checkbox" name="remlink[]" value="'.$taskid.'" /></td>' : '').
+					'</tr>';
+			}
+			echo $GLOBALS['HTML']->listTableBottom();
+
+			echo "\n<hr /><p style=\"text-align:right;\">";
+			printf(_('Average completion rate: %d%%'), (int)($totalPercentage/$taskcount));
+			echo "</p>\n";			echo '</td></tr>';
+		}
+	}
+
+	function renderFiles($group_id, $ah) {
+
+		$file_list =& $ah->getFiles();
+		$count=count($file_list);
+
+		if ($count > 0) {
+			echo '<tr><td colspan="2">';
+			echo '<b>'._("Attachments").':</b>'.'<br/>';
+			$title_arr=array();
+			$title_arr[] = _('Size');
+			$title_arr[] = _('Name');
+			$title_arr[] = _('Date');
+			$title_arr[] = _('By');
+			$title_arr[] = _('Download');
+			echo $GLOBALS['HTML']->listTableTop($title_arr);
+
+			foreach ($file_list as $file) {
+				echo '<tr>';
+				echo '<td>'.human_readable_bytes($file->getSize()).'</td>';
+				echo '<td>'.htmlspecialchars($file->getName()).'</td>';
+				echo '<td>'.date(_('Y-m-d H:i'), $file->getDate()).'</td>';
+				echo '<td>'.$file->getSubmittedUnixName().'</td>';
+				echo '<td><a href="/tracker/download.php/'.$group_id.'/'. $this->getID().'/'. $ah->getID() .'/'.$file->getID().'/'.$file->getName() .'">'. htmlspecialchars($file->getName()) .'</a></td>';
+//				<td><input type="checkbox" name="delete_file[]" value="'. $file->getID() .'">'._("Delete").' </td>
+				echo '</tr>';
+			}
+
+			echo $GLOBALS['HTML']->listTableBottom();
+			echo '</td></tr>';
+		}
+	}
+
+	/**
+	 *	getRenderHTML
+	 *
+	 *	@return	string	HTML template.
+	 */
+	function getRenderHTML($types=array(), $mode='') {
+		// Use template only for the browse (not for query or mass update)
+		if (($mode === 'DISPLAY' || $mode === 'DETAIL' || $mode === 'UPDATE')
+			&& $this->data_array['custom_renderer']) {
+			return preg_replace('/<!--(\S+.*?)-->/','{$\\1}',$this->data_array['custom_renderer']);
+		} else {
+			return $this->generateRenderHTML($types, $mode);
+		}
+	}
+
+	/**
+	 *	generateRenderHTML
+	 *
+	 *	@return	string	HTML template.
+	 */
+	function generateRenderHTML($types=array(), $mode) {
+		$efarr = $this->getExtraFields($types);
+		//each two columns, we'll reset this and start a new row
+
+		$return = '
+			<!-- Start Extra Fields Rendering -->
+			<tr>';
+		$col_count=0;
+
+		$keys=array_keys($efarr);
+		$count=count($keys);
+		if ($count == 0) return '';
+
+		for ($k=0; $k<$count; $k++) {
+			$i=$keys[$k];
+
+			// Do not show the required star in query mode (creating/updating a query).
+			$is_required = ($mode == 'QUERY' || $mode == 'DISPLAY') ?	0 : $efarr[$i]['is_required'];
+			$name = $efarr[$i]['field_name'].($is_required ? utils_requiredField() : '').': ';
+			$name = '<strong>'.$name.'</strong>';
+
+			if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
+
+				$return .= '
+					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
+
+				$return .= '
+					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
+
+				$return .= '
+					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+				$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
+
+				//text fields might be really wide, so need a row to themselves.
+				if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
+					$colspan=2;
+					$return .= '
+					<td> </td>
+			</tr>
+			<tr>';
+				} else {
+					$colspan=1;
+				}
+				$return .= '
+					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
+
+				//text areas might be really wide, so need a row to themselves.
+				if (($col_count == 1) && ($efarr[$i]['attribute2'] > 30)) {
+					$colspan=2;
+					$return .= '
+					<td> </td>
+			</tr>
+			<tr>';
+				} else {
+					$colspan=1;
+				}
+				$return .= '
+					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
+
+				$return .= '
+					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
+
+				$return .= '
+					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
+
+				//text fields might be really wide, so need a row to themselves.
+				if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
+					$colspan=2;
+					$return .= '
+					<td> </td>
+			</tr>
+			<tr>';
+				} else {
+					$colspan=1;
+				}
+				$return .= '
+					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
+
+			}
+			$col_count++;
+			//we've done two columns - if there are more to do, start a new row
+			if (($col_count == 2) && ($k != $count-1)) {
+				$col_count = 0;
+				$return .= '
+			</tr>
+			<tr>';
+			}
+		}
+		if ($col_count == 1) {
+			$return .= '
+					<td> </td>';
+		}
+		$return .= '
+			</tr>
+			<!-- End Extra Fields Rendering -->';
+		return $return;
+	}
+
+	/**
+	 *	renderSelect - this function builds pop up
+	 *	box with choices.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		string	The item that should be checked
+	 *	@param		string	Whether to show the '100 row'
+	 *	@param		string	What to call the '100 row'
+	 *	@return		box and choices
+	 */
+	function renderSelect ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any', $allowed=false) {
+		if ($text_100 == 'none'){
+			$text_100=_('None');
+		}
+		$arr = $this->getExtraFieldElements($extra_field_id);
+		$keys = array();
+		$vals = array();
+		for ($i=0; $i<count($arr); $i++) {
+			$keys[$i]=$arr[$i]['element_id'];
+			$vals[$i]=$arr[$i]['element_name'];
+		}
+		return html_build_select_box_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any, $allowed);
+	}
+
+	/**
+	 *	renderRadio - this function builds radio buttons.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		string	The item that should be checked
+	 *	@param		string	Whether to show the '100 row'
+	 *	@param		string	What to call the '100 row'
+	 *	@return		radio buttons
+	 */
+	function renderRadio ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any') {
+		$arr = $this->getExtraFieldElements($extra_field_id);
+		$keys = array();
+		$vals = array();
+		for ($i=0; $i<count($arr); $i++) {
+			$keys[$i]=$arr[$i]['element_id'];
+			$vals[$i]=$arr[$i]['element_name'];
+		}
+		return html_build_radio_buttons_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any);
+	}
+
+	/**
+	 *	renderCheckbox - this function builds checkboxes.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		array	The items that should be checked
+	 *	@param		string	Whether to show the '100 row'
+	 *	@param		string	What to call the '100 row'
+	 *	@return		radio buttons
+	 */
+	function renderCheckbox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
+		if ($text_100 == 'none'){
+			$text_100=_('None');
+		}
+		if (!$checked || !is_array($checked)) {
+			$checked=array();
+		}
+		$arr = $this->getExtraFieldElements($extra_field_id);
+		$return = '';
+		if ($show_100) {
+			$return .= '
+				<input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="100" '.
+			((in_array(100,$checked)) ? 'checked="checked"' : '').'/> '.$text_100.'<br />';
+		}
+		for ($i=0; $i<count($arr); $i++) {
+			$return .= '
+				<input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="'.$arr[$i]['element_id'].'" '.
+			((in_array($arr[$i]['element_id'],$checked)) ? 'checked="checked"' : '').'/> '.$arr[$i]['element_name'].'<br />';
+		}
+		return $return;
+	}
+
+	/**
+	 *	renderMultiSelectBox - this function builds checkboxes.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		array	The items that should be checked
+	 *	@param		string	Whether to show the '100 row'
+	 *	@param		string	What to call the '100 row'
+	 *	@return		radio multiselectbox
+	 */
+	function renderMultiSelectBox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
+		$arr =$this->getExtraFieldElements($extra_field_id);
+		if (!$checked) {
+			$checked=array();
+		}
+		if (!is_array($checked)) {
+			$checked = explode(',',$checked);
+		}
+		$keys=array();
+		$vals=array();
+		$arr = $this->getExtraFieldElements($extra_field_id);
+		for ($i=0; $i<count($arr); $i++) {
+			$keys[]=$arr[$i]['element_id'];
+			$vals[]=$arr[$i]['element_name'];
+		}
+		$size = min( count($arr)+1, 15);
+			return html_build_multiple_select_box_from_arrays($keys,$vals,"extra_fields[$extra_field_id][]",$checked,$size,$show_100,$text_100);
+	}
+
+	/**
+	 *	renderTextField - this function builds a text field.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		string	The data for this field.
+	 *	@return		text area and data.
+	 */
+	function renderTextField ($extra_field_id,$contents,$size,$maxlength) {
+		return '
+			<input type="text" name="extra_fields['.$extra_field_id.']" value="'.$contents.'" size="'.$size.'" maxlength="'.$maxlength.'"/>';
+	}
+
+	/**
+	 *	renderRelationField - this function builds a relation field.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		string	The data for this field.
+	 *	@return		text area and data.
+	 */
+	function renderRelationField ($extra_field_id,$contents,$size,$maxlength) {
+		$arr = $this->getExtraFieldElements($extra_field_id);
+		for ($i=0; $i<count($arr); $i++) {
+			$keys[$i]=$arr[$i]['element_id'];
+			$vals[$i]=$arr[$i]['element_name'];
+		}
+		// Convert artifact id to links.
+		$html_contents = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1','title')", $contents);
+		$edit_contents = $this->renderTextField ($extra_field_id,$contents,$size,$maxlength);
+		$edit_tips = '<br/><span class="tips">'._('Tip: Enter a space-separated list of artifact ids ([#NNN] also accepted)').'</span>';
+		return '
+			<div id="edit'.$extra_field_id.'" style="display: none;">'.$edit_contents.$edit_tips.'</div>
+			<div id="show'.$extra_field_id.'" style="display: block;">'.$html_contents.'</div>';
+	}
+
+	/**
+	 *	renderTextArea - this function builds a text area.
+	 *
+	 *	@param		int 	The ID of this field.
+	 *	@param 		string	The data for this field.
+	 *	@return		text area and data.
+	 */
+	function renderTextArea ($extra_field_id,$contents,$rows,$cols) {
+		return '
+			<textarea name="extra_fields['.$extra_field_id.']" rows="'.$rows.'" cols="'.$cols.'">'.$contents.'</textarea>';
+	}
+
+	function technicianBox ($name='assigned_to[]',$checked='xzxz',$show_100=true,$text_100='none',$extra_id='-1',$extra_name='',$multiple=false) {
+		if ($text_100=='none'){
+			$text_100=_('Nobody');
+		}
+
+		$engine = RBACEngine::getInstance () ;
+		$techs = $engine->getUsersByAllowedAction ('tracker', $this->getID(), 'tech') ;
+
+		$ids = array () ;
+		$names = array () ;
+
+		foreach ($techs as $tech) {
+			$ids[] = $tech->getID() ;
+			$names[] = $tech->getRealName() ;
+		}
+
+		if ($extra_id != '-1') {
+			$ids[]=$extra_id;
+			$names[]=$extra_name;
+		}
+
+		if ($multiple) {
+			if (!is_array($checked)) {
+				$checked = explode(',',$checked);
+			}
+			$size = min( count($ids)+1, 15);
+			return html_build_multiple_select_box_from_arrays ($ids,$names,$name,$checked,$size,$show_100,$text_100);
+		} else {
+			return html_build_select_box_from_arrays ($ids,$names,$name,$checked,$show_100,$text_100);
+		}
+	}
+
+	function cannedResponseBox ($name='canned_response',$checked='xzxz') {
+		return html_build_select_box ($this->getCannedResponses(),$name,$checked);
+	}
+
+	/**
+	 *	statusBox - show the statuses - automatically shows the "custom statuses" if they exist
+	 *
+	 *
+	 */
+	function statusBox ($name='status_id',$checked='xzxz',$show_100=false,$text_100='none') {
+		if ($text_100=='none'){
+			$text_100=_('None');
+		}
+		return html_build_select_box($this->getStatuses(),$name,$checked,$show_100,$text_100);
+	}
+
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/include/build_submission_form.php (from rev 14555, trunk/src/www/tracker/build_submission_form.php)
===================================================================
--- trunk/src/common/tracker/include/build_submission_form.php	                        (rev 0)
+++ trunk/src/common/tracker/include/build_submission_form.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Generic Tracker facility
+ *
+ * Copyright 1999-2001 (c) VA Linux Systems; 2005 GForge, LLC
+ * http://fusionforge.org/
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+require_once 'note.php';
+function artifact_submission_form($ath, $group) {
+	/*
+		Show the free-form text submitted by the project admin
+	*/
+	echo notepad_func();
+	echo $ath->renderSubmitInstructions();
+?>
+
+	<form id="trackeraddform" action="<?php echo getStringFromServer('PHP_SELF') . '?group_id='.$group->getID().'&atid='.$ath->getID(); ?>" method="post" enctype="multipart/form-data">
+	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+	<table>
+
+	<tr>
+		<td valign="top">
+	            <input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
+	            <input type="hidden" name="func" value="postadd" />
+	            <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
+<?php
+	if (!session_loggedin()) {
+		echo '<div class="login_warning_msg">
+		<span class="warning_msg">'.sprintf(_('Please %1$s login %2$s'), '<a href="'.util_make_url ('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))).'">', '</a>').'</span><br /><br />
+		'._('If you <strong>cannot</strong> login, then enter your email address here').':<p>
+		<input type="text" name="user_email" size="50" maxlength="255" /></p>
+		</div>';
+	}
+?>
+		</td>
+	</tr>
+	<tr>
+		<td valign="top"><strong><?php echo _('For project'); ?></strong><br /><?php echo $group->getPublicName(); ?></td>
+		<td valign="top"><input type="submit" name="submit" value="<?php echo _('Submit'); ?>" /></td>
+	</tr>
+
+<?php
+	$ath->renderExtraFields(array(),true,'none',false,'Any',array(),false,'UPDATE');
+
+	if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
+		echo '<tr>
+		<td><strong>'._('Assigned to').':</strong><br />';
+		echo $ath->technicianBox('assigned_to');
+		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group->getID().'&atid='.$ath->getID().'&update_users=1', '('._('Admin').')' );
+
+		echo '</td><td><strong>'._('Priority').':</strong><br />';
+		build_priority_select_box('priority');
+		echo '</td></tr>';
+	}
+?>
+	<tr>
+		<td colspan="2"><strong><?php echo _('Summary'); echo utils_requiredField(); ?> :</strong><br />
+			<input id="tracker-summary" type="text" name="summary" size="80" maxlength="255" title="<?php echo util_html_secure(html_get_tooltip_description('summary')); ?>" />
+		</td>
+	</tr>
+
+	<tr>
+		<td colspan="2">
+			<strong> <?php echo _('Detailed description'); echo utils_requiredField(); ?> :</strong><?php notepad_button('document.forms.trackeraddform.details'); ?><br />
+			<textarea id="tracker-description" name="details" rows="20" cols="79" title="<?php echo util_html_secure(html_get_tooltip_description('description')); ?> "></textarea>
+		</td>
+	</tr>
+
+	<tr>
+		<td colspan="2">
+<?php
+	if (!session_loggedin()) {
+		echo '<div class="login_warning_msg">
+		<div class="error">'.sprintf(_('Please %1$s login %2$s'), '<a href="'.util_make_url ('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))).'">', '</a>').'</div><br />
+		'._('If you <strong>cannot</strong> login, then enter your email address here').':<p>
+		<input type="text" name="user_email" size="30" maxlength="255" /></p>
+		</div>';
+	}
+?>
+
+		<p> </p>
+		<span class="veryimportant"><?php echo _('DO NOT enter passwords or confidential information in your message!'); ?></span>
+		</td>
+	</tr>
+
+	<tr>
+		<td colspan="2">
+		<div class="file_attachments">
+		<a href="javascript:help_window(\''. util_make_url ('/help/tracker.php?helpname=attach_file') .'\')"><strong>(?)</strong></a><br />
+		<p>
+		<strong><?php echo _('Attach Files'); ?> :</strong><br />
+		<input type="file" name="input_file0" size="30" /><br />
+		<input type="file" name="input_file1" size="30" /><br />
+		<input type="file" name="input_file2" size="30" /><br />
+		<input type="file" name="input_file3" size="30" /><br />
+		<input type="file" name="input_file4" size="30" /><br />
+		</p>
+		</div>
+		</td>
+	</tr>
+
+	<tr><td colspan="2">
+		<input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
+		</td>
+	</tr>
+
+	<tr><td colspan="2"><br/><?php  echo utils_requiredField(); echo _('Indicates required fields.'); ?></td></tr>
+	</table></form>
+<?php
+}
+?>

Copied: trunk/src/common/tracker/views/form-addcanned.php (from rev 14555, trunk/src/www/tracker/admin/form-addcanned.php)
===================================================================
--- trunk/src/common/tracker/views/form-addcanned.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-addcanned.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+//
+//  FORM TO ADD CANNED RESPONSES
+//
+$title = sprintf(_('Add/Update Canned Responses to %s'), $ath->getName()) ;
+$ath->adminHeader(array ('title'=>$title));
+
+		/*
+			List of existing canned responses
+		*/
+		$result=$ath->getCannedResponses();
+		$rows=db_numrows($result);
+		echo "<p> </p>";
+
+		if ($result && $rows > 0) {
+			//code to show existing responses and link to update page
+			echo '<h2>'._('Existing Responses').'</h2>';
+			$title_arr=array();
+			$title_arr[]=_('ID');
+			$title_arr[]=_('Title');
+
+			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+
+			for ($i=0; $i < $rows; $i++) {
+				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
+					'<td>'.db_result($result, $i, 'id').'</td>'.
+					'<td><a href="'.getStringFromServer('PHP_SELF').'?update_canned=1&id='.
+						db_result($result, $i, 'id').'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
+						db_result($result, $i, 'title').'</a></td></tr>';
+			}
+
+			echo $GLOBALS['HTML']->listTableBottom();
+
+		} else {
+			echo '<p class="warning_msg">'._('No responses set up in this group').'</p>';
+		}
+		?>
+		<p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<input type="hidden" name="add_canned" value="y" />
+		<strong><?php echo _('Title') ?>:</strong><br />
+		<input type="text" name="title" value="" size="50" maxlength="50" />
+		<p>
+		<strong><?php echo _('Message Body') ?>:</strong><br />
+		<textarea name="body" rows="30" cols="65"></textarea></p>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+		</form>
+		<?php
+
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-addextrafield.php (from rev 14555, trunk/src/www/tracker/admin/form-addextrafield.php)
===================================================================
--- trunk/src/common/tracker/views/form-addextrafield.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-addextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,167 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+//
+//  FORM TO BUILD SELECTION BOXES
+//
+
+$title = sprintf(_('Manage Custom Fields for %s'), $ath->getName());
+$ath->adminHeader(array ('title'=>$title));
+
+		/*
+			List of possible user built Selection Boxes for an ArtifactType
+		*/
+		$efarr = $ath->getExtraFields();
+		$eftypes=ArtifactExtraField::getAvailableTypes();
+		$keys=array_keys($efarr);
+		echo "<br />";
+		$rows=count($keys);
+		if ($rows > 0) {
+
+			$title_arr=array();
+			$title_arr[]=_('Custom Fields Defined');
+			$title_arr[]=_('Type');
+			$title_arr[]=_('Elements Defined');
+			$title_arr[]=_('Add Options');
+			echo $GLOBALS['HTML']->listTableTop ($title_arr);
+
+			for ($k=0; $k < $rows; $k++) {
+				$i=$keys[$k];
+				echo '<tr id="field-'.$efarr[$i]['alias'].'" '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
+					'<td>'.$efarr[$i]['field_name'].(($efarr[$i]['is_required']) ? utils_requiredField() : '').'<a href="'.getStringFromServer('PHP_SELF').'?update_box=1&id='.
+						$efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
+						' ['._('Edit').']</a>'.
+					'<a href="'.getStringFromServer('PHP_SELF').'?deleteextrafield=1&id='.
+                        $efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
+                        ' ['._('Delete').']</a>'.
+					'<a href="'.getStringFromServer('PHP_SELF').'?copy_opt=1&id='.
+                        $efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
+                        ' ['._('Copy').']</a>'.
+					'</td>';
+				echo '<td>'.$eftypes[$efarr[$i]['field_type']].'</td>';
+				/*
+		  			List of possible options for a user built Selection Box
+		  		*/
+				$elearray = $ath->getExtraFieldElements($efarr[$i]['extra_field_id']);
+
+				if (!empty($elearray)) {
+					$optrows=count($elearray);
+
+					echo '<td>';
+					for ($j=0; $j <$optrows; $j++)
+					{
+						echo $elearray[$j]['element_name'];
+						echo ' <a href="'.getStringFromServer('PHP_SELF').'?update_opt=1&id='.
+						$elearray[$j]['element_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'&boxid='.
+						$efarr[$i]['extra_field_id'].'">'.
+						'['._('Edit').']</a>';
+						echo ' <a href="'.getStringFromServer('PHP_SELF').'?delete_opt=1&id='.
+						$elearray[$j]['element_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'&boxid='.
+						$efarr[$i]['extra_field_id'].'">'.
+						'['._('Delete').']</a>';
+						echo '<br />';
+					}
+				} else {
+					echo '<td>';
+				}
+
+				echo '</td>';
+				echo '<td>';
+				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT
+					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO
+					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX
+					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT
+					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
+					echo '<a href="'.getStringFromServer('PHP_SELF').'?add_opt=1&boxid='.
+						$efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">['.
+						_('add choices').']</a>';
+				}
+				echo '</td>';
+			        echo   '</tr>'."\n";
+			}
+			echo $GLOBALS['HTML']->listTableBottom();
+
+			echo utils_requiredField().' '._('Indicates required fields.');
+		} else {
+			echo "\n<strong>"._('You have not defined any custom fields')."</strong>";
+		}
+
+		echo "<h2>"._('Add New Custom Field')."</h2>";
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<p>
+		<input type="hidden" name="add_extrafield" value="y" />
+		<strong><?php echo _('Custom Field Name') ?>:</strong><br />
+		<input type="text" name="name" value="" size="15" maxlength="30" />
+		</p>
+		<p>
+		<strong><?php echo _('Field alias') ?>:</strong><br />
+		<input type="text" name="alias" value="" size="15" maxlength="30" />
+		</p>
+
+		<p>
+		<strong><?php  echo _('Type of custom field') ?>:</strong><br />
+		<input type="radio" name="field_type" value="1" /> <?php echo _('Select Box'); ?><br />
+		<input type="radio" name="field_type" value="2" /> <?php echo _('Check Box'); ?><br />
+		<input type="radio" name="field_type" value="3" /> <?php echo _('Radio Buttons'); ?><br />
+		<input type="radio" name="field_type" value="4" /> <?php echo _('Text Field'); ?><br />
+		<input type="radio" name="field_type" value="5" /> <?php echo _('Multi-Select Box'); ?><br />
+		<input type="radio" name="field_type" value="6" /> <?php echo _('Text Area'); ?><br />
+		<?php if (!$ath->usesCustomStatuses()) { ?>
+		<input type="radio" name="field_type" value="7" /> <?php echo _('Status'); ?><br />
+		<?php } ?>
+		<!--<input type="radio" name="field_type" value="8" /> <?php echo _('Box type technician'); ?><br />-->
+		<input type="radio" name="field_type" value="9" /> <?php echo _('Relation between artifacts'); ?><br />
+		<p>
+		<?php echo _('Text Fields and Text Areas need to have Size/Maxlength and Rows/Cols defined, respectively.'); ?><br />
+		<?php echo _('Text Field Size/Text Area Rows'); ?>
+			<input type="text" name="attribute1" value="20" size="2" maxlength="2" /><br />
+		<?php echo _('Text Field Maxlength/Text Area Columns'); ?>
+			<input type="text" name="attribute2" value="80" size="2" maxlength="2" />
+		</p>
+		<p>
+		<div class="warning"><?php echo _('Warning: this add new custom field') ?></div>
+		</p>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+		</p>
+		</form>
+		<?php
+
+		echo "<h2>"._('Custom Field Rendering Template')."</h2><p>";
+
+		echo "<p>";
+		echo '<a href="'.getStringFromServer('PHP_SELF').'?downloadtemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Download default template').'</a><br />';
+		echo '<a href="'.getStringFromServer('PHP_SELF').'?uploadtemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Add/Update template').'</a><br />';
+		echo '<a href="'.getStringFromServer('PHP_SELF').'?deletetemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Delete template').'</a><br />';
+		echo "</p>";
+
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-addextrafieldoption.php (from rev 14555, trunk/src/www/tracker/admin/form-addextrafieldoption.php)
===================================================================
--- trunk/src/common/tracker/views/form-addextrafieldoption.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-addextrafieldoption.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+//
+//  FORM TO ADD ELEMENTS TO EXTRA FIELD
+//
+	$boxid = getIntFromRequest('boxid');
+	$ac = new ArtifactExtraField($ath,$boxid);
+	if (!$ac || !is_object($ac)) {
+		exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
+	} elseif ($ac->isError()) {
+		exit_error($ac->getErrorMessage(),'tracker');
+	} else {
+	  	$efearr=$ath->getExtraFieldElements($boxid);
+		$title = sprintf(_('Add/Update Custom Field Elements in %s'), $ath->getName());
+		$ath->adminHeader(array ('title'=>$title));
+
+		$rows=count($efearr);
+		if ($rows > 0) {
+
+			?>
+			<form action="<?php echo 'index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid; ?>" method="post">
+			<?php
+			$title_arr=array();
+			$title_arr[]=_('Current / New positions');
+			$title_arr[]=_('Up/Down positions');
+			$title_arr[]=_('Elements Defined');
+			$title_arr[]='';
+
+			echo $GLOBALS['HTML']->listTableTop ($title_arr,false, ' ');
+
+			for ($i=0; $i < $rows; $i++) {
+				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
+					'<td align="right">'.
+					($i + 1).' --> <input type="text" name="order['. $efearr[$i]['element_id'] .']" value="" size="3" maxlength="3" />'.
+					'</td>'."\n".'<td align="center">'.'   '.
+					'<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
+					'&updownorder_opt=1&new_pos='.(($i == 0)? $i + 1 : $i).'">'.html_image('ic/btn_up.png','19','18',array('alt'=>"Up")).'</a>'.
+					'  '.
+					'<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
+					'&updownorder_opt=1&new_pos='.(($i == $rows - 1)? $i + 1 : $i + 2).'">'.html_image('ic/btn_down.png','19','18',array('alt'=>"Down")).'</a>'.
+					'</td>'."\n".'<td>'.'   '.$efearr[$i]['element_name'].
+					'</td>'."\n".'<td align="center">'.
+					'<a href="'.getStringFromServer('PHP_SELF').'?update_opt=1&id='.
+					$efearr[$i]['element_id'].'&boxid='.
+					$boxid.'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
+					html_image('ic/forum_edit.gif','37','15',array('alt'=>"Edit")).'</a>'.
+					'</td></tr>'."\n";
+			}
+//			echo $GLOBALS['HTML']->listTableBottom();
+			?>
+			<tr class="noborder">
+			<td align="right">
+			<input type="submit" name="post_changes_order" value="<?php echo _('Reorder') ?>" />
+			</td>
+			<td>
+			</td>
+			<td align="left">
+			<input type="submit" name="post_changes_alphaorder" value="<?php echo _('Alphabetical order') ?>" />
+			<br /> 
+			</td>
+			</tr>
+			<?php echo $GLOBALS['HTML']->listTableBottom(); ?>
+			</form>
+			<?php
+
+		} else {
+			echo "\n<strong>"._('You have not defined any elements')."</strong>";
+		}
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&boxid='.$boxid.'&atid='.$ath->getID(); ?>" method="post">
+		<input type="hidden" name="add_opt" value="y" />
+		<br /><br />
+		<strong><?php echo _('Add New Element') ?>:</strong>
+		<input type="text" name="name" value="" size="15" maxlength="30" />
+		<!--
+		Show a pop-up box to choose the possible statuses that this element will map to
+		-->
+		<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) { ?>
+		<strong>  <?php echo _('Status'); ?></strong>
+		<?php echo $ath->statusBox('status_id',1,false,false); ?>
+		<?php } ?>
+		  <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+		</form>
+		<?php
+		$ath->footer(array());
+	}
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-clonetracker.php (from rev 14555, trunk/src/www/tracker/admin/form-clonetracker.php)
===================================================================
--- trunk/src/common/tracker/views/form-clonetracker.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-clonetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,66 @@
+<?php
+/**
+ * FusionForge Tracker Cloning Form
+ *
+ * Copyright 2010, FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+$g = group_get_object(forge_get_config('template_group'));
+if (!$g || !is_object($g)) {
+	exit_no_group();
+} elseif ($g->isError()) {
+	exit_error($g->getErrorMessage(),'tracker');
+} else {
+	$atf = new ArtifactTypeFactory($g);
+	if (!$atf || !is_object($atf)) {
+		exit_error(_('Unable to Create Template Group Object'),'tracker');
+	} elseif ($atf->isError()) {
+		exit_error($atf->getErrorMessage(),'tracker');
+	} else {
+		$ata = $atf->getArtifactTypes();
+		$ids = array();
+		$titles = array();
+		for ($i=0; $i<count($ata); $i++) {
+			if (!$ata[$i] || $ata[$i]->isError()) {
+//skip it
+			} else {
+				$ids[]=$ata[$i]->getID();
+				$titles[]=$g->getPublicName().'::'.$ata[$i]->getName();
+			}
+		}
+
+		$ath->adminHeader(array ('title'=>_('Clone Tracker')));
+
+		if (empty($ata)) {
+			echo '<div class="warning_msg">'._('The site administrator must first set up template trackers in the template projet with default values and set permissions propertly so you can access them.').'</div>';
+		} else {
+		?>
+		<p><?php echo _('Choose the template tracker to clone.') ?></p>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<input type="hidden" name="clone_tracker" value="y" />
+		<div class="warning" ><?php echo _('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. You have been warned!') ?></div>
+		<p><?php echo html_build_select_box_from_arrays($ids,$titles,'clone_id','',false); ?></p>
+		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+		</form>
+<?php
+		}
+		$ath->footer(array());
+	}
+}
+?>

Copied: trunk/src/common/tracker/views/form-customizelist.php (from rev 14555, trunk/src/www/tracker/admin/form-customizelist.php)
===================================================================
--- trunk/src/common/tracker/views/form-customizelist.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-customizelist.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,98 @@
+<?php
+/**
+ * FusionForge Artifact update Form
+ *
+ * Copyright 2010, FusionForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+$ath->adminHeader(array ('title'=>_('Customize Browse List'),'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
+
+/*
+	List of possible user built Selection Boxes for an ArtifactType
+*/
+$efarr = $ath->getExtraFields();
+
+$browse_fields = explode(',',$ath->getBrowseList());
+?>
+
+<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+<input type="hidden" name="customize_list" value="y" />
+<p>
+<?php echo _('Set order of the fields that will be displayed on the browse view of your tracker:') ?>
+</p>
+
+<?php
+// Display regular fields.
+$fields = array (
+		'summary' => _('Summary'),
+		'open_date' => _('Open Date'),
+		'status_id' => _('State'),
+		'priority'  => _('Priority'),
+		'assigned_to' => _('Assigned To'),
+		'submitted_by' => _('Submitted By'),
+		'close_date' => _('Close Date'),
+		'details' => _('Detailed description'),
+	'related_tasks' => _('Related tasks'),
+	'last_modified_date' => _('Last Modified Date')
+	);
+
+if(count($ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS))) > 0) {
+	unset($fields['status_id']);
+}
+
+// Extra fields
+foreach ($efarr as $f) {
+	$fields[$f[0]] = $f['field_name'];
+}
+
+asort($fields);
+
+// Display fields
+foreach ($fields as $f => $name) {
+	$pos = array_search($f, $browse_fields);
+	echo "<input type=\"text\" name=\"browse_fields[$f]\" value=\"" .
+		 (($pos !== false) ? $pos + 1 : '') .
+		 "\" size=\"3\" maxlength=\"3\" /> " .
+		 $name .
+		 "<br />\n";
+}
+
+$keys=array_keys($efarr);
+$rows=count($keys);
+if ($rows > 0) {
+	for ($k=0; $k < $rows; $k++) {
+		$i=$keys[$k];
+		$pos = array_search($i, $browse_fields);
+		echo "<input type=\"text\" name=\"browse_fields[$i]\" value=\"" .
+		 	 (($pos !== false) ? $pos + 1 : '') .
+		 	 "\" size=\"3\" maxlength=\"3\" /> " .
+			 $efarr[$i]['field_name'] .
+			 "<br />\n";
+	}
+}
+?>
+
+<p>
+<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+</form>
+<?php
+
+$ath->footer(array());
+
+?>

Copied: trunk/src/common/tracker/views/form-deleteextrafield.php (from rev 14555, trunk/src/www/tracker/admin/form-deleteextrafield.php)
===================================================================
--- trunk/src/common/tracker/views/form-deleteextrafield.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-deleteextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+$ath->adminHeader(array ('title'=>sprintf(_('Delete a custom field for %s'),$ath->getName())));
+
+		$id = getStringFromRequest('id');
+
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<p>
+		<input type="hidden" name="deleteextrafield" value="y" />
+		<input type="hidden" name="id" value="<?php echo $id; ?>" />
+		<?php echo _('You are about to permanently and irretrievably delete this custom field and all its contents!'); ?>
+		</p>
+		<p>
+		<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
+		<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?>
+		</p>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Delete') ?>" /></p>
+		</form>
+		<?php
+
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-deleteextrafieldelement.php (from rev 14555, trunk/src/www/tracker/admin/form-deleteextrafieldelement.php)
===================================================================
--- trunk/src/common/tracker/views/form-deleteextrafieldelement.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-deleteextrafieldelement.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+//
+//  FORM TO DELETE POP-UP CHOICES FOR A BOX
+//
+	/*
+		Allow deletion of a Choice for a Pop-up Box
+	*/
+	$boxid = getIntFromRequest('boxid');
+	$ac = new ArtifactExtraField($ath,$boxid);
+	if (!$ac || !is_object($ac)) {
+		exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
+	} elseif ($ac->isError()) {
+		exit_error($ac->getErrorMessage(),'tracker');
+	} else {
+		$id = getStringFromRequest('id');
+		$ao = new ArtifactExtraFieldElement($ac,$id);
+		if (!$ao || !is_object($ao)) {
+			exit_error(_('Unable to create ArtifactExtraFieldElement Object'),'tracker');
+		} elseif ($ao->isError()) {
+			exit_error($ao->getErrorMessage(),'tracker');
+		} else {
+
+			$ath->adminHeader(array('title'=>sprintf(_("Delete a custom field element in: %s"), $ath->getName())));
+
+			?>
+			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+			<input type="hidden" name="delete_opt" value="y" />
+			<input type="hidden" name="id" value="<?php echo $ao->getID(); ?>" />
+			<input type="hidden" name="boxid" value="<?php echo $boxid; ?>" />
+
+			<p>
+			<strong><?php echo _('Element') ?>:</strong> 
+			<?php echo $ao->getName(); ?></p>
+			<p>
+			<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
+			<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?>
+			</p>
+			<p>
+			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+			</form>
+			<?php
+			$ath->footer(array());
+		}
+	}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-deletetracker.php (from rev 14555, trunk/src/www/tracker/admin/form-deletetracker.php)
===================================================================
--- trunk/src/common/tracker/views/form-deletetracker.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-deletetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,45 @@
+<?php
+/*
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+$ath->adminHeader(array ('title'=>sprintf(_('Permanently Delete Tracker %s'), $ath->getName())));
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<input type="hidden" name="delete" value="y" /><br />
+		<?php echo _('You are about to permanently and irretrievably delete this tracker and all its contents!'); ?>
+		<p>
+		<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
+		<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?></p>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Delete') ?>" /></p>
+		</form>
+		<?php
+
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-extrafieldcopy.php (from rev 14555, trunk/src/www/tracker/admin/form-extrafieldcopy.php)
===================================================================
--- trunk/src/common/tracker/views/form-extrafieldcopy.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-extrafieldcopy.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,108 @@
+<?php
+/*
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+//
+//  FORM TO COPY Choices configured by admin for extra_field BOXES
+//
+$id = getIntFromRequest('id');
+$fb= new ArtifactExtraField($ath,$id);
+
+// Get a list of all extra fields in trackers and groups that you have perms to admin
+
+$project_ids = array () ;
+foreach (session_get_user()->getGroups() as $p) {
+	if (forge_check_perm ('tracker_admin', $p->getID())) {
+		$project_ids[] = $p->getID() ;
+	}
+}
+
+$res = db_query_params ('SELECT g.unix_group_name, agl.name AS tracker_name, aefl.field_name, aefl.extra_field_id
+			FROM groups g,
+			artifact_group_list agl,
+			artifact_extra_field_list aefl
+			WHERE g.group_id=ANY($1)
+			AND g.group_id=agl.group_id
+			AND agl.group_artifact_id=ap.group_artifact_id
+			AND aefl.group_artifact_id=agl.group_artifact_id
+			AND aefl.extra_field_id != $2
+			AND aefl.field_type IN (1,2,3,5,7)',
+			array (db_int_array_to_any_clause ($project_ids),
+			       $id));
+		if (db_numrows($res) < 1) {
+			exit_error(_('Cannot find a destination tracker where you have administration rights.'),'tracker');
+		}
+
+		$title = sprintf(_('Copy choices from custom field %1$s'), $fb->getName());
+		$ath->adminHeader(array ('title'=>$title));
+
+		$efearr = $ath->getExtraFieldElements($id);
+		for ($i=0; $i<count($efearr); $i++) {
+			$field_id_arr[] = $efearr[$i]['element_id'];
+			$field_arr[] = $efearr[$i]['element_name'];
+		}
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post" >
+		<table>
+		<tr>
+		<td></td><td><center><strong>
+		<?php echo _('Copy From') ?>
+		<br />
+		<?php echo $fb->getName() ?>
+		</strong></center></td>
+		<td></td>
+		<td><center><strong>
+		<?php echo _('Into trackers and custom fields') ?>
+		</strong></center></td></tr>
+		<tr><td></td>
+		<td valign="top">
+		<input type="hidden" name="copy_opt" value="copy" />
+		<input type="hidden" name="id" value="<?php echo $id; ?>" />
+		<?php
+		echo html_build_multiple_select_box_from_arrays($field_id_arr,$field_arr,'copyid[]',array(),10,false);
+		echo '</td><td><center><strong>';
+
+		while($arr =db_fetch_array($res)) {
+				$name_arr[]=$arr['unix_group_name']. '::'. $arr['tracker_name'] . '::'. $arr['field_name'];
+				$id_arr[]=$arr['extra_field_id'];
+		}
+		echo '</strong></center></td>';
+		echo '<td valign="top">';
+
+		echo html_build_select_box_from_arrays($id_arr,$name_arr,'selectid',$selectid,false);
+		echo '</td></tr>';
+		echo '<tr><td>';
+		?>
+		<br />
+	 	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+		</td></tr></table></form>
+
+		<?php
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-updatecanned.php (from rev 14555, trunk/src/www/tracker/admin/form-updatecanned.php)
===================================================================
--- trunk/src/common/tracker/views/form-updatecanned.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-updatecanned.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,60 @@
+<?php
+/*
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+//
+//	FORM TO UPDATE CANNED MESSAGES
+//
+$title = sprintf(_('Modify Canned Responses In %s'),$ath->getName());
+$ath->adminHeader(array ('title'=>$title));
+
+		$id = getStringFromRequest('id');
+		$acr = new ArtifactCanned($ath,$id);
+		if (!$acr || !is_object($acr)) {
+			$feedback .= 'Unable to create ArtifactCanned Object';
+		} elseif ($acr->isError()) {
+			$feedback .= $acr->getErrorMessage();
+		} else {
+			?>
+			<p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
+			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+			<input type="hidden" name="update_canned" value="y" />
+			<input type="hidden" name="id" value="<?php echo $acr->getID(); ?>" />
+			<strong><?php echo _('Title') ?>:</strong><br />
+			<input type="text" name="title" value="<?php echo $acr->getTitle(); ?>" size="50" maxlength="50" />
+			<p>
+			<strong><?php echo _('Message Body') ?>:</strong><br />
+			<textarea name="body" rows="30" cols="65"><?php echo $acr->getBody(); ?></textarea></p>
+			<p>
+			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+			</form>
+			<?php
+		}
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-updateextrafield.php (from rev 14555, trunk/src/www/tracker/admin/form-updateextrafield.php)
===================================================================
--- trunk/src/common/tracker/views/form-updateextrafield.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-updateextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+//
+//  FORM TO UPDATE POP-UP BOXES
+//
+/*
+	Allow modification of a artifact Selection Box
+*/
+$title = sprintf(_('Modify a custom field in %s'),$ath->getName());
+$ath->adminHeader(array('title'=>$title));
+
+$id = getStringFromRequest('id');
+$ac = new ArtifactExtraField($ath,$id);
+if (!$ac || !is_object($ac)) {
+	$error_msg .= _('Unable to create ArtifactExtraField Object');
+} elseif ($ac->isError()) {
+	$error_msg .= $ac->getErrorMessage();
+} else {
+?>
+<p>
+<strong><?php echo _('Type of custom field').': '.$ac->getTypeName(); ?></strong></p>
+
+<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&id='.$id.'&atid='.$ath->getID(); ?>" method="post">
+	<input type="hidden" name="update_box" value="y" />
+	<input type="hidden" name="id" value="<?php echo $ac->getID(); ?>" />
+	<p>
+		<strong><?php echo _('Custom Field Name') ?>:</strong><br />
+		<input type="text" name="name" value="<?php echo $ac->getName(); ?>" />
+	</p>
+	<p>
+		<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) { ?>
+		<b><?php echo _('Text Area Rows'); ?></b><br />
+		<input type="text" name="attribute1" value="<?php echo $ac->getAttribute1(); ?>" size="2" maxlength="2" />
+	</p>
+	<p>
+		<b><?php echo _('Text Area Columns'); ?></b><br />
+		<input type="text" name="attribute2" value="<?php echo $ac->getAttribute2(); ?>" size="2" maxlength="2" />
+		<?php } elseif ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_TEXT || $ac->getType() == ARTIFACT_EXTRAFIELDTYPE_RELATION) {?>
+		<b><?php echo _('Text Field Size'); ?></b><br />
+		<input type="text" name="attribute1" value="<?php echo $ac->getAttribute1(); ?>" size="2" maxlength="2" />
+		</p>
+		<p>
+		<b><?php echo _('Text Field Maxlength'); ?></b><br />
+		<input type="text" name="attribute2" value="<?php echo $ac->getAttribute2(); ?>" size="2" maxlength="2" />
+		<?php } else { ?>
+		<input type="hidden" name="attribute1" value="0" />
+		<input type="hidden" name="attribute2" value="0" />
+		<?php } ?>
+	</p>
+	<p>
+		<strong><?php echo _('Field alias') ?>:</strong><br />
+		<input type="text" name="alias" value="<?php echo $ac->getAlias(); ?>" />
+	</p>
+	<p><input type="checkbox" name="is_required" <?php if ($ac->isRequired()) echo "checked=\"checked\""; ?> /><?php echo _('Field is mandatory')?></p>
+	<div class="warning"><?php echo _('It is not recommended that you change the custom field name because other things are dependent upon it. When you change the custom field name, all related items will be changed to the new name') ?>
+	</div>
+	<p>
+	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+    </p>
+</form>
+<?php
+}
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-updateextrafieldelement.php (from rev 14555, trunk/src/www/tracker/admin/form-updateextrafieldelement.php)
===================================================================
--- trunk/src/common/tracker/views/form-updateextrafieldelement.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-updateextrafieldelement.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+//
+//  FORM TO UPDATE POP-UP CHOICES FOR A BOX
+//
+/*
+	Allow modification of a Choice for a Pop-up Box
+*/
+$boxid = getIntFromRequest('boxid');
+$ac = new ArtifactExtraField($ath,$boxid);
+if (!$ac || !is_object($ac)) {
+	exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
+} elseif ($ac->isError()) {
+	exit_error($ac->getErrorMessage(),'tracker');
+} else {
+	$id = getStringFromRequest('id');
+	$ao = new ArtifactExtraFieldElement($ac,$id);
+	if (!$ao || !is_object($ao)) {
+		exit_error(_('Unable to create ArtifactExtraFieldElement Object'),'tracker');
+	} elseif ($ao->isError()) {
+		exit_error($ao->getErrorMessage(),'tracker');
+	} else {
+		$title = sprintf(_('Modify a custom field element in %s'), $ath->getName()) ;
+		$ath->adminHeader(array('title'=>$title));
+
+?>
+			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+			<input type="hidden" name="update_opt" value="y" />
+			<input type="hidden" name="id" value="<?php echo $ao->getID(); ?>" />
+			<input type="hidden" name="boxid" value="<?php echo $boxid; ?>" />
+
+			<p>
+			<strong><?php echo _('Element') ?>:</strong><br />
+			<input type="text" name="name" value="<?php echo $ao->getName(); ?>" /></p>
+			<!--
+			Show a pop-up box to choose the possible statuses that this element will map to
+			-->
+			<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) { ?>
+			<strong><?php echo _('Status'); ?></strong><br />
+			<?php echo $ath->statusBox('status_id',$ao->getStatusID(),false,false); ?>
+			<?php } ?>
+
+			<div class="warning"><?php echo _('It is not recommended that you change the custom field name because other things are dependent upon it. When you change the custom field name, all related items will be changed to the new name') ?>
+			</div>
+			<p>
+			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+			</form>
+			<?php
+			$ath->footer(array());
+	}
+}
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-updatetracker.php (from rev 14555, trunk/src/www/tracker/admin/form-updatetracker.php)
===================================================================
--- trunk/src/common/tracker/views/form-updatetracker.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-updatetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,91 @@
+<?php
+/*
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+$name = getStringFromRequest('name', $ath->getName());
+$description = getStringFromRequest('description', $ath->getDescription());
+$email_address = getStringFromRequest('email_address', $ath->getEmailAddress());
+$email_all = getStringFromRequest('email_all', $ath->emailAll());
+$due_period = getStringFromRequest('due_period', $ath->getDuePeriod() / 86400);
+$status_timeout = getStringFromRequest('status_timeout', $ath->getStatusTimeout() / 86400);
+$submit_instructions = getStringFromRequest('submit_instructions', $ath->getSubmitInstructions());
+$browse_instructions = getStringFromRequest('browse_instructions', $ath->getBrowseInstructions());
+
+//
+//	FORM TO UPDATE ARTIFACT TYPES
+//
+$ath->adminHeader(array ('title'=>sprintf(_('Update settings for %s'),$ath->getName())));
+		?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<p>
+		<input type="hidden" name="update_type" value="y" />
+		<?php echo _('<strong>Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
+		<?php if ($ath->getDataType()) {
+			echo $ath->getName();
+		} else {
+			?>
+			<input type="text" name="name" value="<?php echo $ath->getName(); ?>" />
+			<?php
+		}
+		?>
+		</p>
+		<p>
+		<strong><?php echo _('Description') ?>:</strong><br />
+		<?php if ($ath->getDataType()) {
+			echo $ath->getDescription();
+		} else {
+			?>
+			<input type="text" name="description" value="<?php echo $ath->getDescription(); ?>" size="50" />
+			<?php
+		}
+		?>
+		</p>
+		<p>
+		<strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
+		<input type="text" name="email_address" value="<?php echo $email_address; ?>" /></p>
+		<p>
+		<input type="checkbox" name="email_all" value="1" <?php echo (($email_all)?'checked="checked"':''); ?> /> <strong><?php echo _('Send email on all changes') ?></strong><br /></p>
+		<p>
+		<strong><?php echo _('Days till considered overdue') ?>:</strong><br />
+		<input type="text" name="due_period" value="<?php echo $due_period; ?>" /></p>
+		<p>
+		<strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
+		<input type="text" name="status_timeout"  value="<?php echo $status_timeout; ?>" /></p>
+		<p>
+		<strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
+		<textarea name="submit_instructions" rows="10" cols="55"><?php echo $submit_instructions; ?></textarea></p>
+		<p>
+		<strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
+		<textarea name="browse_instructions" rows="10" cols="55"><?php echo $browse_instructions; ?></textarea></p>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+		</form>
+		<?php
+
+		$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-uploadtemplate.php (from rev 14555, trunk/src/www/tracker/admin/form-uploadtemplate.php)
===================================================================
--- trunk/src/common/tracker/views/form-uploadtemplate.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-uploadtemplate.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,55 @@
+<?php
+/*
+ * Tracker Facility
+ *
+ * Copyright 2010 (c) FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+$title = sprintf(_('Add/Update template for %s'), $ath->getName()) ;
+
+$ath->adminHeader(array('title'=>$title));
+
+?>
+<table>
+<tr>
+<td>
+<fieldset>
+<legend><?php echo _('Select Template'); ?></legend>
+<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post" enctype="multipart/form-data">
+<p>
+    <input type="hidden" name="uploadtemplate" value="1" />
+    <input type="file" name="input_file" size="30" />
+    <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
+</p>
+</form>
+</fieldset>
+</td>
+</tr>
+</table>
+<?php
+
+$ath->footer(array());
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
+?>

Copied: trunk/src/common/tracker/views/form-workflow.php (from rev 14555, trunk/src/www/tracker/admin/form-workflow.php)
===================================================================
--- trunk/src/common/tracker/views/form-workflow.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-workflow.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Update Artifact Type Form
+ *
+ * Copyright 2010, FusionForge Team
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once('common/tracker/ArtifactWorkflow.class.php');
+
+$has_error = false;
+$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
+if (count($efarr) === 0) {
+	$has_error = true;
+   	$error_msg .= _('To create a workflow, you need first to create a custom field of type \'Status\'.');
+} elseif (count($efarr) !== 1) {
+	// Internal error.
+	$has_error = true;
+	$error_msg .= _('Internal error: Illegal number of status fields (WKFL01).');
+}
+
+$ath->adminHeader(array ('title'=> _('Configure workflow'),'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
+
+/*
+	List of possible user built Selection Boxes for an ArtifactType
+*/
+if (!$has_error) {
+
+  	$keys=array_keys($efarr);
+   	$field_id = $keys[0];
+   	$field_name = $efarr[$field_id]['field_name'];
+
+   	$atw = new ArtifactWorkflow($ath, $field_id);
+
+	$elearray = $ath->getExtraFieldElements($field_id);
+	$states = $elearray;
+
+?>
+
+   	<h2><?php printf(_('Allowed initial values for the %1$s field'), $field_name) ?></h2>
+	<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+	<input type="hidden" name="field_id" value="<?php echo $field_id ?>" />
+	<input type="hidden" name="workflow" value="1" />
+
+<?php
+	$from = _('From').' ';
+	$to = _('To').' ';
+	$init = _('Initial values').' ';
+
+	$title_arr=array();
+	$title_arr[]=_('From Value');
+	foreach ($elearray as $status) {
+		$title_arr[]=$status['element_name'];
+	}
+	echo $GLOBALS['HTML']->listTableTop($title_arr, false, ' ');
+	echo "\n";
+
+	// Special treatement for the initial value (in the Submit form).
+	echo '<tr id="initval"><th style="text-align:left">'.$init.'</th>'."\n";
+	$next = $atw->getNextNodes('100');
+	foreach ($states as $s) {
+		$name = 'wk[100]['. $s['element_id'].']';
+		$value = in_array($s['element_id'], $next)? ' checked="checked"' : '';
+		$str = '<input type="checkbox" name="'.$name.'"'.$value.' />';
+				$str .= ' '.html_image('spacer.gif', 20, 20);
+		echo '<td align="center">'.$str.'</td>'."\n";
+	}
+	echo '</tr>'."\n";
+	echo $GLOBALS['HTML']->listTableBottom();
+
+	$count=count($title_arr);
+	$totitle_arr = array();
+	for ($i=0; $i<$count; $i++) {
+		$totitle_arr[] = $title_arr[$i]? $to.$title_arr[$i] : '';
+	}
+	echo $GLOBALS['HTML']->listTableTop($totitle_arr, false, ' ');
+
+	$i=1;
+	foreach ($elearray as $status) {
+		echo '<tr id="configuring-'.$i++.'"><th style="text-align:left">'.$from.$status['element_name'].'</th>'."\n";
+		$next = $atw->getNextNodes($status['element_id']);
+		foreach ($states as $s) {
+			if ($status['element_id'] !== $s['element_id']) {
+				$name = 'wk['.$status['element_id'].']['. $s['element_id'].']';
+				$value = in_array($s['element_id'], $next)? ' checked="checked"' : '';
+				$str = '<input type="checkbox" name="'.$name.'"'.$value.' />';
+				if ($value) {
+					$url = getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID().'&workflow_roles=1&from='.$status['element_id'].'&next='.$s['element_id'];
+					$str .= ' <a href="'.$url.'" title="Edit roles">'.html_image('ic/acl_roles20.png', 20, 20, array('alt'=>'Edit Roles')).'</a>';
+				} else {
+							$str .= ' '.html_image('spacer.gif', 20, 20);
+				}
+			} else {
+				$str = '<input type="checkbox" checked="checked" disabled="disabled" />';
+						$str .= ' '.html_image('spacer.gif', 20, 20);
+			}
+			echo '<td align="center">'.$str.'</td>'."\n";
+		}
+		echo '</tr>'."\n";
+	}
+	echo $GLOBALS['HTML']->listTableBottom();
+
+?>
+<div class="tips">Tip: Click on <?php echo html_image('ic/acl_roles20.png', 20, 20, array('alt'=> _('Edit Roles'))) ?> to configure allowed roles for a transition (all by default).</div>
+<p>
+<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+</form>
+<?php
+}
+
+$ath->footer(array());
+
+?>

Copied: trunk/src/common/tracker/views/form-workflow_roles.php (from rev 14555, trunk/src/www/tracker/admin/form-workflow_roles.php)
===================================================================
--- trunk/src/common/tracker/views/form-workflow_roles.php	                        (rev 0)
+++ trunk/src/common/tracker/views/form-workflow_roles.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Workflow Form
+ *
+ * Copyright 2010, FusionForge Team
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+
+require_once('common/tracker/ArtifactWorkflow.class.php');
+
+		$from = getIntFromRequest('from');
+		$next = getIntFromRequest('next');
+
+//	FORM TO UPDATE ARTIFACT TYPES
+
+		/*
+			List of possible user built Selection Boxes for an ArtifactType
+		*/
+	$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
+    	if (count($efarr) === 0) {
+    		// TODO: Normal status is not implemented right now.
+      		return false;
+    	} elseif (count($efarr) !== 1) {
+			// Internal error.
+			return false;
+    	}
+
+    	$keys=array_keys($efarr);
+    	$field_id = $keys[0];
+
+    	$atw = new ArtifactWorkflow($ath, $field_id);
+		$roles = $atw->getAllowedRoles($from, $next);
+
+		$elearray = $ath->getExtraFieldElements($field_id);
+		foreach ($elearray as $e) {
+			$name[ $e['element_id'] ] = $e['element_name'];
+		}
+
+		$title = sprintf(_('Configuring allowed roles for the transitions from %1$s to %2$s'), $name[$from], $name[$next]);
+		$ath->adminHeader(array ('title'=>$title,'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
+?>
+		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
+		<input type="hidden" name="field_id" value="<?php echo $field_id ?>" />
+		<input type="hidden" name="workflow_roles" value="1" />
+		<input type="hidden" name="from" value="<?php echo $from ?>" />
+		<input type="hidden" name="next" value="<?php echo $next ?>" />
+
+<?php
+		$group_roles = $group->getRoles() ;
+		sortRoleList ($group_roles) ;
+		foreach ($group_roles as $role) {
+			$value = in_array($role->getID(), $roles)? ' checked="checked"' : '';
+			$str = '<input type="checkbox" name="role['.$role->getID().']"'.$value.' />';
+			$str .= ' '.$role->getDisplayableName($group);
+			echo $str."<br />\n";
+		}
+?>
+		<p>
+		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
+		</form>
+		<?php
+
+		$ath->footer(array());
+
+?>

Modified: trunk/src/db/20090507-install_workflow.php
===================================================================
--- trunk/src/db/20090507-install_workflow.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/db/20090507-install_workflow.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -4,11 +4,11 @@
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'tracker/Artifact.class.php';
 require_once $gfcommon.'tracker/ArtifactFile.class.php';
-require_once $gfwww.'tracker/include/ArtifactFileHtml.class.php';
-require_once $gfcommon.'common/tracker/ArtifactType.class.php';
+require_once $gfcommon.'tracker/include/ArtifactFileHtml.class.php';
+require_once $gfcommon.'tracker/ArtifactType.class.php';
 require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
 require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
-require_once $gfwww.'tracker/include/ArtifactHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactCanned.class.php';
 require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
 require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -39,7 +39,7 @@
 require(APPLICATION_PATH.'/../../../../../common/include/env.inc.php');
 require_once $gfwww.'include/pre.php';
 
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
 require_once $gfcommon.'tracker/ArtifactType.class.php';
 require_once $gfcommon.'tracker/ArtifactFactory.class.php';

Modified: trunk/src/www/reporting/trackerpie_graph.php
===================================================================
--- trunk/src/www/reporting/trackerpie_graph.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/reporting/trackerpie_graph.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -28,7 +28,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_pie3d.php');
 require_once $gfcommon.'reporting/Report.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
 
 session_require_global_perm ('forge_stats', 'read') ;
 

Modified: trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php
===================================================================
--- trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/search/include/engines/ArtifactSearchEngine.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -22,7 +22,7 @@
  */
 
 require_once $gfwww.'search/include/engines/GroupSearchEngine.class.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
 
 class ArtifactSearchEngine extends GroupSearchEngine {
 	var $ath;

Modified: trunk/src/www/search/index.php
===================================================================
--- trunk/src/www/search/index.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/search/index.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -26,7 +26,7 @@
 
 require_once('../env.inc.php');
 require_once $gfcommon.'include/pre.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
 require_once $gfwww.'search/include/SearchManager.class.php';
 
 $group_id = getIntFromRequest('group_id');

Deleted: trunk/src/www/tracker/add.php
===================================================================
--- trunk/src/www/tracker/add.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/add.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,36 +0,0 @@
-<?php
-/**
- * Generic Tracker facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems; 2005 GForge, LLC
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-$ath->header(array ('title'=>_('Submit New')));
-
-require_once $gfwww.'tracker/build_submission_form.php';
-artifact_submission_form($ath, $group);
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-addcanned.php
===================================================================
--- trunk/src/www/tracker/admin/form-addcanned.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-addcanned.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,80 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-//
-//  FORM TO ADD CANNED RESPONSES
-//
-$title = sprintf(_('Add/Update Canned Responses to %s'), $ath->getName()) ;
-$ath->adminHeader(array ('title'=>$title));
-
-		/*
-			List of existing canned responses
-		*/
-		$result=$ath->getCannedResponses();
-		$rows=db_numrows($result);
-		echo "<p> </p>";
-
-		if ($result && $rows > 0) {
-			//code to show existing responses and link to update page
-			echo '<h2>'._('Existing Responses').'</h2>';
-			$title_arr=array();
-			$title_arr[]=_('ID');
-			$title_arr[]=_('Title');
-
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			for ($i=0; $i < $rows; $i++) {
-				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
-					'<td>'.db_result($result, $i, 'id').'</td>'.
-					'<td><a href="'.getStringFromServer('PHP_SELF').'?update_canned=1&id='.
-						db_result($result, $i, 'id').'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
-						db_result($result, $i, 'title').'</a></td></tr>';
-			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
-		} else {
-			echo '<p class="warning_msg">'._('No responses set up in this group').'</p>';
-		}
-		?>
-		<p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<input type="hidden" name="add_canned" value="y" />
-		<strong><?php echo _('Title') ?>:</strong><br />
-		<input type="text" name="title" value="" size="50" maxlength="50" />
-		<p>
-		<strong><?php echo _('Message Body') ?>:</strong><br />
-		<textarea name="body" rows="30" cols="65"></textarea></p>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-		</form>
-		<?php
-
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-addextrafield.php
===================================================================
--- trunk/src/www/tracker/admin/form-addextrafield.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-addextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,167 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-//
-//  FORM TO BUILD SELECTION BOXES
-//
-
-$title = sprintf(_('Manage Custom Fields for %s'), $ath->getName());
-$ath->adminHeader(array ('title'=>$title));
-
-		/*
-			List of possible user built Selection Boxes for an ArtifactType
-		*/
-		$efarr = $ath->getExtraFields();
-		$eftypes=ArtifactExtraField::getAvailableTypes();
-		$keys=array_keys($efarr);
-		echo "<br />";
-		$rows=count($keys);
-		if ($rows > 0) {
-
-			$title_arr=array();
-			$title_arr[]=_('Custom Fields Defined');
-			$title_arr[]=_('Type');
-			$title_arr[]=_('Elements Defined');
-			$title_arr[]=_('Add Options');
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			for ($k=0; $k < $rows; $k++) {
-				$i=$keys[$k];
-				echo '<tr id="field-'.$efarr[$i]['alias'].'" '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
-					'<td>'.$efarr[$i]['field_name'].(($efarr[$i]['is_required']) ? utils_requiredField() : '').'<a href="'.getStringFromServer('PHP_SELF').'?update_box=1&id='.
-						$efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
-						' ['._('Edit').']</a>'.
-					'<a href="'.getStringFromServer('PHP_SELF').'?deleteextrafield=1&id='.
-                        $efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
-                        ' ['._('Delete').']</a>'.
-					'<a href="'.getStringFromServer('PHP_SELF').'?copy_opt=1&id='.
-                        $efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
-                        ' ['._('Copy').']</a>'.
-					'</td>';
-				echo '<td>'.$eftypes[$efarr[$i]['field_type']].'</td>';
-				/*
-		  			List of possible options for a user built Selection Box
-		  		*/
-				$elearray = $ath->getExtraFieldElements($efarr[$i]['extra_field_id']);
-
-				if (!empty($elearray)) {
-					$optrows=count($elearray);
-
-					echo '<td>';
-					for ($j=0; $j <$optrows; $j++)
-					{
-						echo $elearray[$j]['element_name'];
-						echo ' <a href="'.getStringFromServer('PHP_SELF').'?update_opt=1&id='.
-						$elearray[$j]['element_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'&boxid='.
-						$efarr[$i]['extra_field_id'].'">'.
-						'['._('Edit').']</a>';
-						echo ' <a href="'.getStringFromServer('PHP_SELF').'?delete_opt=1&id='.
-						$elearray[$j]['element_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'&boxid='.
-						$efarr[$i]['extra_field_id'].'">'.
-						'['._('Delete').']</a>';
-						echo '<br />';
-					}
-				} else {
-					echo '<td>';
-				}
-
-				echo '</td>';
-				echo '<td>';
-				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT
-					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO
-					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX
-					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT
-					|| $efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
-					echo '<a href="'.getStringFromServer('PHP_SELF').'?add_opt=1&boxid='.
-						$efarr[$i]['extra_field_id'].'&group_id='.$group_id.'&atid='. $ath->getID() .'">['.
-						_('add choices').']</a>';
-				}
-				echo '</td>';
-			        echo   '</tr>'."\n";
-			}
-			echo $GLOBALS['HTML']->listTableBottom();
-
-			echo utils_requiredField().' '._('Indicates required fields.');
-		} else {
-			echo "\n<strong>"._('You have not defined any custom fields')."</strong>";
-		}
-
-		echo "<h2>"._('Add New Custom Field')."</h2>";
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<p>
-		<input type="hidden" name="add_extrafield" value="y" />
-		<strong><?php echo _('Custom Field Name') ?>:</strong><br />
-		<input type="text" name="name" value="" size="15" maxlength="30" />
-		</p>
-		<p>
-		<strong><?php echo _('Field alias') ?>:</strong><br />
-		<input type="text" name="alias" value="" size="15" maxlength="30" />
-		</p>
-
-		<p>
-		<strong><?php  echo _('Type of custom field') ?>:</strong><br />
-		<input type="radio" name="field_type" value="1" /> <?php echo _('Select Box'); ?><br />
-		<input type="radio" name="field_type" value="2" /> <?php echo _('Check Box'); ?><br />
-		<input type="radio" name="field_type" value="3" /> <?php echo _('Radio Buttons'); ?><br />
-		<input type="radio" name="field_type" value="4" /> <?php echo _('Text Field'); ?><br />
-		<input type="radio" name="field_type" value="5" /> <?php echo _('Multi-Select Box'); ?><br />
-		<input type="radio" name="field_type" value="6" /> <?php echo _('Text Area'); ?><br />
-		<?php if (!$ath->usesCustomStatuses()) { ?>
-		<input type="radio" name="field_type" value="7" /> <?php echo _('Status'); ?><br />
-		<?php } ?>
-		<!--<input type="radio" name="field_type" value="8" /> <?php echo _('Box type technician'); ?><br />-->
-		<input type="radio" name="field_type" value="9" /> <?php echo _('Relation between artifacts'); ?><br />
-		<p>
-		<?php echo _('Text Fields and Text Areas need to have Size/Maxlength and Rows/Cols defined, respectively.'); ?><br />
-		<?php echo _('Text Field Size/Text Area Rows'); ?>
-			<input type="text" name="attribute1" value="20" size="2" maxlength="2" /><br />
-		<?php echo _('Text Field Maxlength/Text Area Columns'); ?>
-			<input type="text" name="attribute2" value="80" size="2" maxlength="2" />
-		</p>
-		<p>
-		<div class="warning"><?php echo _('Warning: this add new custom field') ?></div>
-		</p>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-		</p>
-		</form>
-		<?php
-
-		echo "<h2>"._('Custom Field Rendering Template')."</h2><p>";
-
-		echo "<p>";
-		echo '<a href="'.getStringFromServer('PHP_SELF').'?downloadtemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Download default template').'</a><br />';
-		echo '<a href="'.getStringFromServer('PHP_SELF').'?uploadtemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Add/Update template').'</a><br />';
-		echo '<a href="'.getStringFromServer('PHP_SELF').'?deletetemplate=1&group_id='.$group_id.'&atid='. $ath->getID() .'">'._('Delete template').'</a><br />';
-		echo "</p>";
-
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-addextrafieldoption.php
===================================================================
--- trunk/src/www/tracker/admin/form-addextrafieldoption.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-addextrafieldoption.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,114 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-//
-//  FORM TO ADD ELEMENTS TO EXTRA FIELD
-//
-	$boxid = getIntFromRequest('boxid');
-	$ac = new ArtifactExtraField($ath,$boxid);
-	if (!$ac || !is_object($ac)) {
-		exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
-	} elseif ($ac->isError()) {
-		exit_error($ac->getErrorMessage(),'tracker');
-	} else {
-	  	$efearr=$ath->getExtraFieldElements($boxid);
-		$title = sprintf(_('Add/Update Custom Field Elements in %s'), $ath->getName());
-		$ath->adminHeader(array ('title'=>$title));
-
-		$rows=count($efearr);
-		if ($rows > 0) {
-
-			?>
-			<form action="<?php echo 'index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid; ?>" method="post">
-			<?php
-			$title_arr=array();
-			$title_arr[]=_('Current / New positions');
-			$title_arr[]=_('Up/Down positions');
-			$title_arr[]=_('Elements Defined');
-			$title_arr[]='';
-
-			echo $GLOBALS['HTML']->listTableTop ($title_arr,false, ' ');
-
-			for ($i=0; $i < $rows; $i++) {
-				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>'.
-					'<td align="right">'.
-					($i + 1).' --> <input type="text" name="order['. $efearr[$i]['element_id'] .']" value="" size="3" maxlength="3" />'.
-					'</td>'."\n".'<td align="center">'.'   '.
-					'<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
-					'&updownorder_opt=1&new_pos='.(($i == 0)? $i + 1 : $i).'">'.html_image('ic/btn_up.png','19','18',array('alt'=>"Up")).'</a>'.
-					'  '.
-					'<a href="index.php?group_id='.$group_id.'&atid='.$ath->getID().'&boxid='.$boxid.'&id='.$efearr[$i]['element_id'].
-					'&updownorder_opt=1&new_pos='.(($i == $rows - 1)? $i + 1 : $i + 2).'">'.html_image('ic/btn_down.png','19','18',array('alt'=>"Down")).'</a>'.
-					'</td>'."\n".'<td>'.'   '.$efearr[$i]['element_name'].
-					'</td>'."\n".'<td align="center">'.
-					'<a href="'.getStringFromServer('PHP_SELF').'?update_opt=1&id='.
-					$efearr[$i]['element_id'].'&boxid='.
-					$boxid.'&group_id='.$group_id.'&atid='. $ath->getID() .'">'.
-					html_image('ic/forum_edit.gif','37','15',array('alt'=>"Edit")).'</a>'.
-					'</td></tr>'."\n";
-			}
-//			echo $GLOBALS['HTML']->listTableBottom();
-			?>
-			<tr class="noborder">
-			<td align="right">
-			<input type="submit" name="post_changes_order" value="<?php echo _('Reorder') ?>" />
-			</td>
-			<td>
-			</td>
-			<td align="left">
-			<input type="submit" name="post_changes_alphaorder" value="<?php echo _('Alphabetical order') ?>" />
-			<br /> 
-			</td>
-			</tr>
-			<?php echo $GLOBALS['HTML']->listTableBottom(); ?>
-			</form>
-			<?php
-
-		} else {
-			echo "\n<strong>"._('You have not defined any elements')."</strong>";
-		}
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&boxid='.$boxid.'&atid='.$ath->getID(); ?>" method="post">
-		<input type="hidden" name="add_opt" value="y" />
-		<br /><br />
-		<strong><?php echo _('Add New Element') ?>:</strong>
-		<input type="text" name="name" value="" size="15" maxlength="30" />
-		<!--
-		Show a pop-up box to choose the possible statuses that this element will map to
-		-->
-		<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) { ?>
-		<strong>  <?php echo _('Status'); ?></strong>
-		<?php echo $ath->statusBox('status_id',1,false,false); ?>
-		<?php } ?>
-		  <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-		</form>
-		<?php
-		$ath->footer(array());
-	}
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-clonetracker.php
===================================================================
--- trunk/src/www/tracker/admin/form-clonetracker.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-clonetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,66 +0,0 @@
-<?php
-/**
- * FusionForge Tracker Cloning Form
- *
- * Copyright 2010, FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-$g = group_get_object(forge_get_config('template_group'));
-if (!$g || !is_object($g)) {
-	exit_no_group();
-} elseif ($g->isError()) {
-	exit_error($g->getErrorMessage(),'tracker');
-} else {
-	$atf = new ArtifactTypeFactory($g);
-	if (!$atf || !is_object($atf)) {
-		exit_error(_('Unable to Create Template Group Object'),'tracker');
-	} elseif ($atf->isError()) {
-		exit_error($atf->getErrorMessage(),'tracker');
-	} else {
-		$ata = $atf->getArtifactTypes();
-		$ids = array();
-		$titles = array();
-		for ($i=0; $i<count($ata); $i++) {
-			if (!$ata[$i] || $ata[$i]->isError()) {
-//skip it
-			} else {
-				$ids[]=$ata[$i]->getID();
-				$titles[]=$g->getPublicName().'::'.$ata[$i]->getName();
-			}
-		}
-
-		$ath->adminHeader(array ('title'=>_('Clone Tracker')));
-
-		if (empty($ata)) {
-			echo '<div class="warning_msg">'._('The site administrator must first set up template trackers in the template projet with default values and set permissions propertly so you can access them.').'</div>';
-		} else {
-		?>
-		<p><?php echo _('Choose the template tracker to clone.') ?></p>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<input type="hidden" name="clone_tracker" value="y" />
-		<div class="warning" ><?php echo _('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. You have been warned!') ?></div>
-		<p><?php echo html_build_select_box_from_arrays($ids,$titles,'clone_id','',false); ?></p>
-		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-		</form>
-<?php
-		}
-		$ath->footer(array());
-	}
-}
-?>

Deleted: trunk/src/www/tracker/admin/form-customizelist.php
===================================================================
--- trunk/src/www/tracker/admin/form-customizelist.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-customizelist.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,98 +0,0 @@
-<?php
-/**
- * FusionForge Artifact update Form
- *
- * Copyright 2010, FusionForge Team
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-$ath->adminHeader(array ('title'=>_('Customize Browse List'),'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
-
-/*
-	List of possible user built Selection Boxes for an ArtifactType
-*/
-$efarr = $ath->getExtraFields();
-
-$browse_fields = explode(',',$ath->getBrowseList());
-?>
-
-<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-<input type="hidden" name="customize_list" value="y" />
-<p>
-<?php echo _('Set order of the fields that will be displayed on the browse view of your tracker:') ?>
-</p>
-
-<?php
-// Display regular fields.
-$fields = array (
-		'summary' => _('Summary'),
-		'open_date' => _('Open Date'),
-		'status_id' => _('State'),
-		'priority'  => _('Priority'),
-		'assigned_to' => _('Assigned To'),
-		'submitted_by' => _('Submitted By'),
-		'close_date' => _('Close Date'),
-		'details' => _('Detailed description'),
-	'related_tasks' => _('Related tasks'),
-	'last_modified_date' => _('Last Modified Date')
-	);
-
-if(count($ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS))) > 0) {
-	unset($fields['status_id']);
-}
-
-// Extra fields
-foreach ($efarr as $f) {
-	$fields[$f[0]] = $f['field_name'];
-}
-
-asort($fields);
-
-// Display fields
-foreach ($fields as $f => $name) {
-	$pos = array_search($f, $browse_fields);
-	echo "<input type=\"text\" name=\"browse_fields[$f]\" value=\"" .
-		 (($pos !== false) ? $pos + 1 : '') .
-		 "\" size=\"3\" maxlength=\"3\" /> " .
-		 $name .
-		 "<br />\n";
-}
-
-$keys=array_keys($efarr);
-$rows=count($keys);
-if ($rows > 0) {
-	for ($k=0; $k < $rows; $k++) {
-		$i=$keys[$k];
-		$pos = array_search($i, $browse_fields);
-		echo "<input type=\"text\" name=\"browse_fields[$i]\" value=\"" .
-		 	 (($pos !== false) ? $pos + 1 : '') .
-		 	 "\" size=\"3\" maxlength=\"3\" /> " .
-			 $efarr[$i]['field_name'] .
-			 "<br />\n";
-	}
-}
-?>
-
-<p>
-<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-</form>
-<?php
-
-$ath->footer(array());
-
-?>

Deleted: trunk/src/www/tracker/admin/form-deleteextrafield.php
===================================================================
--- trunk/src/www/tracker/admin/form-deleteextrafield.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-deleteextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,52 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-$ath->adminHeader(array ('title'=>sprintf(_('Delete a custom field for %s'),$ath->getName())));
-
-		$id = getStringFromRequest('id');
-
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<p>
-		<input type="hidden" name="deleteextrafield" value="y" />
-		<input type="hidden" name="id" value="<?php echo $id; ?>" />
-		<?php echo _('You are about to permanently and irretrievably delete this custom field and all its contents!'); ?>
-		</p>
-		<p>
-		<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
-		<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?>
-		</p>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Delete') ?>" /></p>
-		</form>
-		<?php
-
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-deleteextrafieldelement.php
===================================================================
--- trunk/src/www/tracker/admin/form-deleteextrafieldelement.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-deleteextrafieldelement.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,75 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-//
-//  FORM TO DELETE POP-UP CHOICES FOR A BOX
-//
-	/*
-		Allow deletion of a Choice for a Pop-up Box
-	*/
-	$boxid = getIntFromRequest('boxid');
-	$ac = new ArtifactExtraField($ath,$boxid);
-	if (!$ac || !is_object($ac)) {
-		exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
-	} elseif ($ac->isError()) {
-		exit_error($ac->getErrorMessage(),'tracker');
-	} else {
-		$id = getStringFromRequest('id');
-		$ao = new ArtifactExtraFieldElement($ac,$id);
-		if (!$ao || !is_object($ao)) {
-			exit_error(_('Unable to create ArtifactExtraFieldElement Object'),'tracker');
-		} elseif ($ao->isError()) {
-			exit_error($ao->getErrorMessage(),'tracker');
-		} else {
-
-			$ath->adminHeader(array('title'=>sprintf(_("Delete a custom field element in: %s"), $ath->getName())));
-
-			?>
-			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-			<input type="hidden" name="delete_opt" value="y" />
-			<input type="hidden" name="id" value="<?php echo $ao->getID(); ?>" />
-			<input type="hidden" name="boxid" value="<?php echo $boxid; ?>" />
-
-			<p>
-			<strong><?php echo _('Element') ?>:</strong> 
-			<?php echo $ao->getName(); ?></p>
-			<p>
-			<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
-			<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?>
-			</p>
-			<p>
-			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-			</form>
-			<?php
-			$ath->footer(array());
-		}
-	}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-deletetracker.php
===================================================================
--- trunk/src/www/tracker/admin/form-deletetracker.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-deletetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,45 +0,0 @@
-<?php
-/*
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-$ath->adminHeader(array ('title'=>sprintf(_('Permanently Delete Tracker %s'), $ath->getName())));
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<input type="hidden" name="delete" value="y" /><br />
-		<?php echo _('You are about to permanently and irretrievably delete this tracker and all its contents!'); ?>
-		<p>
-		<input type="checkbox" name="sure" value="1" /><?php echo _("I'm Sure.") ?><br />
-		<input type="checkbox" name="really_sure" value="1" /><?php echo _("I'm Really Sure.") ?></p>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Delete') ?>" /></p>
-		</form>
-		<?php
-
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-extrafieldcopy.php
===================================================================
--- trunk/src/www/tracker/admin/form-extrafieldcopy.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-extrafieldcopy.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,108 +0,0 @@
-<?php
-/*
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-//
-//  FORM TO COPY Choices configured by admin for extra_field BOXES
-//
-$id = getIntFromRequest('id');
-$fb= new ArtifactExtraField($ath,$id);
-
-// Get a list of all extra fields in trackers and groups that you have perms to admin
-
-$project_ids = array () ;
-foreach (session_get_user()->getGroups() as $p) {
-	if (forge_check_perm ('tracker_admin', $p->getID())) {
-		$project_ids[] = $p->getID() ;
-	}
-}
-
-$res = db_query_params ('SELECT g.unix_group_name, agl.name AS tracker_name, aefl.field_name, aefl.extra_field_id
-			FROM groups g,
-			artifact_group_list agl,
-			artifact_extra_field_list aefl
-			WHERE g.group_id=ANY($1)
-			AND g.group_id=agl.group_id
-			AND agl.group_artifact_id=ap.group_artifact_id
-			AND aefl.group_artifact_id=agl.group_artifact_id
-			AND aefl.extra_field_id != $2
-			AND aefl.field_type IN (1,2,3,5,7)',
-			array (db_int_array_to_any_clause ($project_ids),
-			       $id));
-		if (db_numrows($res) < 1) {
-			exit_error(_('Cannot find a destination tracker where you have administration rights.'),'tracker');
-		}
-
-		$title = sprintf(_('Copy choices from custom field %1$s'), $fb->getName());
-		$ath->adminHeader(array ('title'=>$title));
-
-		$efearr = $ath->getExtraFieldElements($id);
-		for ($i=0; $i<count($efearr); $i++) {
-			$field_id_arr[] = $efearr[$i]['element_id'];
-			$field_arr[] = $efearr[$i]['element_name'];
-		}
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post" >
-		<table>
-		<tr>
-		<td></td><td><center><strong>
-		<?php echo _('Copy From') ?>
-		<br />
-		<?php echo $fb->getName() ?>
-		</strong></center></td>
-		<td></td>
-		<td><center><strong>
-		<?php echo _('Into trackers and custom fields') ?>
-		</strong></center></td></tr>
-		<tr><td></td>
-		<td valign="top">
-		<input type="hidden" name="copy_opt" value="copy" />
-		<input type="hidden" name="id" value="<?php echo $id; ?>" />
-		<?php
-		echo html_build_multiple_select_box_from_arrays($field_id_arr,$field_arr,'copyid[]',array(),10,false);
-		echo '</td><td><center><strong>';
-
-		while($arr =db_fetch_array($res)) {
-				$name_arr[]=$arr['unix_group_name']. '::'. $arr['tracker_name'] . '::'. $arr['field_name'];
-				$id_arr[]=$arr['extra_field_id'];
-		}
-		echo '</strong></center></td>';
-		echo '<td valign="top">';
-
-		echo html_build_select_box_from_arrays($id_arr,$name_arr,'selectid',$selectid,false);
-		echo '</td></tr>';
-		echo '<tr><td>';
-		?>
-		<br />
-	 	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-		</td></tr></table></form>
-
-		<?php
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-updatecanned.php
===================================================================
--- trunk/src/www/tracker/admin/form-updatecanned.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-updatecanned.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,60 +0,0 @@
-<?php
-/*
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-//
-//	FORM TO UPDATE CANNED MESSAGES
-//
-$title = sprintf(_('Modify Canned Responses In %s'),$ath->getName());
-$ath->adminHeader(array ('title'=>$title));
-
-		$id = getStringFromRequest('id');
-		$acr = new ArtifactCanned($ath,$id);
-		if (!$acr || !is_object($acr)) {
-			$feedback .= 'Unable to create ArtifactCanned Object';
-		} elseif ($acr->isError()) {
-			$feedback .= $acr->getErrorMessage();
-		} else {
-			?>
-			<p><?php echo _('Creating useful generic messages can save you a lot of time when handling common artifact requests.') ?></p>
-			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-			<input type="hidden" name="update_canned" value="y" />
-			<input type="hidden" name="id" value="<?php echo $acr->getID(); ?>" />
-			<strong><?php echo _('Title') ?>:</strong><br />
-			<input type="text" name="title" value="<?php echo $acr->getTitle(); ?>" size="50" maxlength="50" />
-			<p>
-			<strong><?php echo _('Message Body') ?>:</strong><br />
-			<textarea name="body" rows="30" cols="65"><?php echo $acr->getBody(); ?></textarea></p>
-			<p>
-			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-			</form>
-			<?php
-		}
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-updateextrafield.php
===================================================================
--- trunk/src/www/tracker/admin/form-updateextrafield.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-updateextrafield.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,92 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-//
-//  FORM TO UPDATE POP-UP BOXES
-//
-/*
-	Allow modification of a artifact Selection Box
-*/
-$title = sprintf(_('Modify a custom field in %s'),$ath->getName());
-$ath->adminHeader(array('title'=>$title));
-
-$id = getStringFromRequest('id');
-$ac = new ArtifactExtraField($ath,$id);
-if (!$ac || !is_object($ac)) {
-	$error_msg .= _('Unable to create ArtifactExtraField Object');
-} elseif ($ac->isError()) {
-	$error_msg .= $ac->getErrorMessage();
-} else {
-?>
-<p>
-<strong><?php echo _('Type of custom field').': '.$ac->getTypeName(); ?></strong></p>
-
-<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&id='.$id.'&atid='.$ath->getID(); ?>" method="post">
-	<input type="hidden" name="update_box" value="y" />
-	<input type="hidden" name="id" value="<?php echo $ac->getID(); ?>" />
-	<p>
-		<strong><?php echo _('Custom Field Name') ?>:</strong><br />
-		<input type="text" name="name" value="<?php echo $ac->getName(); ?>" />
-	</p>
-	<p>
-		<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) { ?>
-		<b><?php echo _('Text Area Rows'); ?></b><br />
-		<input type="text" name="attribute1" value="<?php echo $ac->getAttribute1(); ?>" size="2" maxlength="2" />
-	</p>
-	<p>
-		<b><?php echo _('Text Area Columns'); ?></b><br />
-		<input type="text" name="attribute2" value="<?php echo $ac->getAttribute2(); ?>" size="2" maxlength="2" />
-		<?php } elseif ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_TEXT || $ac->getType() == ARTIFACT_EXTRAFIELDTYPE_RELATION) {?>
-		<b><?php echo _('Text Field Size'); ?></b><br />
-		<input type="text" name="attribute1" value="<?php echo $ac->getAttribute1(); ?>" size="2" maxlength="2" />
-		</p>
-		<p>
-		<b><?php echo _('Text Field Maxlength'); ?></b><br />
-		<input type="text" name="attribute2" value="<?php echo $ac->getAttribute2(); ?>" size="2" maxlength="2" />
-		<?php } else { ?>
-		<input type="hidden" name="attribute1" value="0" />
-		<input type="hidden" name="attribute2" value="0" />
-		<?php } ?>
-	</p>
-	<p>
-		<strong><?php echo _('Field alias') ?>:</strong><br />
-		<input type="text" name="alias" value="<?php echo $ac->getAlias(); ?>" />
-	</p>
-	<p><input type="checkbox" name="is_required" <?php if ($ac->isRequired()) echo "checked=\"checked\""; ?> /><?php echo _('Field is mandatory')?></p>
-	<div class="warning"><?php echo _('It is not recommended that you change the custom field name because other things are dependent upon it. When you change the custom field name, all related items will be changed to the new name') ?>
-	</div>
-	<p>
-	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-    </p>
-</form>
-<?php
-}
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-updateextrafieldelement.php
===================================================================
--- trunk/src/www/tracker/admin/form-updateextrafieldelement.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-updateextrafieldelement.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,79 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-//
-//  FORM TO UPDATE POP-UP CHOICES FOR A BOX
-//
-/*
-	Allow modification of a Choice for a Pop-up Box
-*/
-$boxid = getIntFromRequest('boxid');
-$ac = new ArtifactExtraField($ath,$boxid);
-if (!$ac || !is_object($ac)) {
-	exit_error(_('Unable to create ArtifactExtraField Object'),'tracker');
-} elseif ($ac->isError()) {
-	exit_error($ac->getErrorMessage(),'tracker');
-} else {
-	$id = getStringFromRequest('id');
-	$ao = new ArtifactExtraFieldElement($ac,$id);
-	if (!$ao || !is_object($ao)) {
-		exit_error(_('Unable to create ArtifactExtraFieldElement Object'),'tracker');
-	} elseif ($ao->isError()) {
-		exit_error($ao->getErrorMessage(),'tracker');
-	} else {
-		$title = sprintf(_('Modify a custom field element in %s'), $ath->getName()) ;
-		$ath->adminHeader(array('title'=>$title));
-
-?>
-			<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-			<input type="hidden" name="update_opt" value="y" />
-			<input type="hidden" name="id" value="<?php echo $ao->getID(); ?>" />
-			<input type="hidden" name="boxid" value="<?php echo $boxid; ?>" />
-
-			<p>
-			<strong><?php echo _('Element') ?>:</strong><br />
-			<input type="text" name="name" value="<?php echo $ao->getName(); ?>" /></p>
-			<!--
-			Show a pop-up box to choose the possible statuses that this element will map to
-			-->
-			<?php if ($ac->getType() == ARTIFACT_EXTRAFIELDTYPE_STATUS) { ?>
-			<strong><?php echo _('Status'); ?></strong><br />
-			<?php echo $ath->statusBox('status_id',$ao->getStatusID(),false,false); ?>
-			<?php } ?>
-
-			<div class="warning"><?php echo _('It is not recommended that you change the custom field name because other things are dependent upon it. When you change the custom field name, all related items will be changed to the new name') ?>
-			</div>
-			<p>
-			<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-			</form>
-			<?php
-			$ath->footer(array());
-	}
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-updatetracker.php
===================================================================
--- trunk/src/www/tracker/admin/form-updatetracker.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-updatetracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,91 +0,0 @@
-<?php
-/*
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-$name = getStringFromRequest('name', $ath->getName());
-$description = getStringFromRequest('description', $ath->getDescription());
-$email_address = getStringFromRequest('email_address', $ath->getEmailAddress());
-$email_all = getStringFromRequest('email_all', $ath->emailAll());
-$due_period = getStringFromRequest('due_period', $ath->getDuePeriod() / 86400);
-$status_timeout = getStringFromRequest('status_timeout', $ath->getStatusTimeout() / 86400);
-$submit_instructions = getStringFromRequest('submit_instructions', $ath->getSubmitInstructions());
-$browse_instructions = getStringFromRequest('browse_instructions', $ath->getBrowseInstructions());
-
-//
-//	FORM TO UPDATE ARTIFACT TYPES
-//
-$ath->adminHeader(array ('title'=>sprintf(_('Update settings for %s'),$ath->getName())));
-		?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<p>
-		<input type="hidden" name="update_type" value="y" />
-		<?php echo _('<strong>Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
-		<?php if ($ath->getDataType()) {
-			echo $ath->getName();
-		} else {
-			?>
-			<input type="text" name="name" value="<?php echo $ath->getName(); ?>" />
-			<?php
-		}
-		?>
-		</p>
-		<p>
-		<strong><?php echo _('Description') ?>:</strong><br />
-		<?php if ($ath->getDataType()) {
-			echo $ath->getDescription();
-		} else {
-			?>
-			<input type="text" name="description" value="<?php echo $ath->getDescription(); ?>" size="50" />
-			<?php
-		}
-		?>
-		</p>
-		<p>
-		<strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
-		<input type="text" name="email_address" value="<?php echo $email_address; ?>" /></p>
-		<p>
-		<input type="checkbox" name="email_all" value="1" <?php echo (($email_all)?'checked="checked"':''); ?> /> <strong><?php echo _('Send email on all changes') ?></strong><br /></p>
-		<p>
-		<strong><?php echo _('Days till considered overdue') ?>:</strong><br />
-		<input type="text" name="due_period" value="<?php echo $due_period; ?>" /></p>
-		<p>
-		<strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
-		<input type="text" name="status_timeout"  value="<?php echo $status_timeout; ?>" /></p>
-		<p>
-		<strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
-		<textarea name="submit_instructions" rows="10" cols="55"><?php echo $submit_instructions; ?></textarea></p>
-		<p>
-		<strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
-		<textarea name="browse_instructions" rows="10" cols="55"><?php echo $browse_instructions; ?></textarea></p>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-		</form>
-		<?php
-
-		$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-uploadtemplate.php
===================================================================
--- trunk/src/www/tracker/admin/form-uploadtemplate.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-uploadtemplate.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,55 +0,0 @@
-<?php
-/*
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-$title = sprintf(_('Add/Update template for %s'), $ath->getName()) ;
-
-$ath->adminHeader(array('title'=>$title));
-
-?>
-<table>
-<tr>
-<td>
-<fieldset>
-<legend><?php echo _('Select Template'); ?></legend>
-<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post" enctype="multipart/form-data">
-<p>
-    <input type="hidden" name="uploadtemplate" value="1" />
-    <input type="file" name="input_file" size="30" />
-    <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
-</p>
-</form>
-</fieldset>
-</td>
-</tr>
-</table>
-<?php
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/admin/form-workflow.php
===================================================================
--- trunk/src/www/tracker/admin/form-workflow.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-workflow.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,128 +0,0 @@
-<?php
-/**
- * Update Artifact Type Form
- *
- * Copyright 2010, FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once('common/tracker/ArtifactWorkflow.class.php');
-
-$has_error = false;
-$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
-if (count($efarr) === 0) {
-	$has_error = true;
-   	$error_msg .= _('To create a workflow, you need first to create a custom field of type \'Status\'.');
-} elseif (count($efarr) !== 1) {
-	// Internal error.
-	$has_error = true;
-	$error_msg .= _('Internal error: Illegal number of status fields (WKFL01).');
-}
-
-$ath->adminHeader(array ('title'=> _('Configure workflow'),'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
-
-/*
-	List of possible user built Selection Boxes for an ArtifactType
-*/
-if (!$has_error) {
-
-  	$keys=array_keys($efarr);
-   	$field_id = $keys[0];
-   	$field_name = $efarr[$field_id]['field_name'];
-
-   	$atw = new ArtifactWorkflow($ath, $field_id);
-
-	$elearray = $ath->getExtraFieldElements($field_id);
-	$states = $elearray;
-
-?>
-
-   	<h2><?php printf(_('Allowed initial values for the %1$s field'), $field_name) ?></h2>
-	<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-	<input type="hidden" name="field_id" value="<?php echo $field_id ?>" />
-	<input type="hidden" name="workflow" value="1" />
-
-<?php
-	$from = _('From').' ';
-	$to = _('To').' ';
-	$init = _('Initial values').' ';
-
-	$title_arr=array();
-	$title_arr[]=_('From Value');
-	foreach ($elearray as $status) {
-		$title_arr[]=$status['element_name'];
-	}
-	echo $GLOBALS['HTML']->listTableTop($title_arr, false, ' ');
-	echo "\n";
-
-	// Special treatement for the initial value (in the Submit form).
-	echo '<tr id="initval"><th style="text-align:left">'.$init.'</th>'."\n";
-	$next = $atw->getNextNodes('100');
-	foreach ($states as $s) {
-		$name = 'wk[100]['. $s['element_id'].']';
-		$value = in_array($s['element_id'], $next)? ' checked="checked"' : '';
-		$str = '<input type="checkbox" name="'.$name.'"'.$value.' />';
-				$str .= ' '.html_image('spacer.gif', 20, 20);
-		echo '<td align="center">'.$str.'</td>'."\n";
-	}
-	echo '</tr>'."\n";
-	echo $GLOBALS['HTML']->listTableBottom();
-
-	$count=count($title_arr);
-	$totitle_arr = array();
-	for ($i=0; $i<$count; $i++) {
-		$totitle_arr[] = $title_arr[$i]? $to.$title_arr[$i] : '';
-	}
-	echo $GLOBALS['HTML']->listTableTop($totitle_arr, false, ' ');
-
-	$i=1;
-	foreach ($elearray as $status) {
-		echo '<tr id="configuring-'.$i++.'"><th style="text-align:left">'.$from.$status['element_name'].'</th>'."\n";
-		$next = $atw->getNextNodes($status['element_id']);
-		foreach ($states as $s) {
-			if ($status['element_id'] !== $s['element_id']) {
-				$name = 'wk['.$status['element_id'].']['. $s['element_id'].']';
-				$value = in_array($s['element_id'], $next)? ' checked="checked"' : '';
-				$str = '<input type="checkbox" name="'.$name.'"'.$value.' />';
-				if ($value) {
-					$url = getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID().'&workflow_roles=1&from='.$status['element_id'].'&next='.$s['element_id'];
-					$str .= ' <a href="'.$url.'" title="Edit roles">'.html_image('ic/acl_roles20.png', 20, 20, array('alt'=>'Edit Roles')).'</a>';
-				} else {
-							$str .= ' '.html_image('spacer.gif', 20, 20);
-				}
-			} else {
-				$str = '<input type="checkbox" checked="checked" disabled="disabled" />';
-						$str .= ' '.html_image('spacer.gif', 20, 20);
-			}
-			echo '<td align="center">'.$str.'</td>'."\n";
-		}
-		echo '</tr>'."\n";
-	}
-	echo $GLOBALS['HTML']->listTableBottom();
-
-?>
-<div class="tips">Tip: Click on <?php echo html_image('ic/acl_roles20.png', 20, 20, array('alt'=> _('Edit Roles'))) ?> to configure allowed roles for a transition (all by default).</div>
-<p>
-<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-</form>
-<?php
-}
-
-$ath->footer(array());
-
-?>

Deleted: trunk/src/www/tracker/admin/form-workflow_roles.php
===================================================================
--- trunk/src/www/tracker/admin/form-workflow_roles.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/form-workflow_roles.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,82 +0,0 @@
-<?php
-/**
- * Workflow Form
- *
- * Copyright 2010, FusionForge Team
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-require_once('common/tracker/ArtifactWorkflow.class.php');
-
-		$from = getIntFromRequest('from');
-		$next = getIntFromRequest('next');
-
-//	FORM TO UPDATE ARTIFACT TYPES
-
-		/*
-			List of possible user built Selection Boxes for an ArtifactType
-		*/
-	$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
-    	if (count($efarr) === 0) {
-    		// TODO: Normal status is not implemented right now.
-      		return false;
-    	} elseif (count($efarr) !== 1) {
-			// Internal error.
-			return false;
-    	}
-
-    	$keys=array_keys($efarr);
-    	$field_id = $keys[0];
-
-    	$atw = new ArtifactWorkflow($ath, $field_id);
-		$roles = $atw->getAllowedRoles($from, $next);
-
-		$elearray = $ath->getExtraFieldElements($field_id);
-		foreach ($elearray as $e) {
-			$name[ $e['element_id'] ] = $e['element_name'];
-		}
-
-		$title = sprintf(_('Configuring allowed roles for the transitions from %1$s to %2$s'), $name[$from], $name[$next]);
-		$ath->adminHeader(array ('title'=>$title,'pagename'=>'tracker_admin_customize_liste','titlevals'=>array($ath->getName())));
-?>
-		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
-		<input type="hidden" name="field_id" value="<?php echo $field_id ?>" />
-		<input type="hidden" name="workflow_roles" value="1" />
-		<input type="hidden" name="from" value="<?php echo $from ?>" />
-		<input type="hidden" name="next" value="<?php echo $next ?>" />
-
-<?php
-		$group_roles = $group->getRoles() ;
-		sortRoleList ($group_roles) ;
-		foreach ($group_roles as $role) {
-			$value = in_array($role->getID(), $roles)? ' checked="checked"' : '';
-			$str = '<input type="checkbox" name="role['.$role->getID().']"'.$value.' />';
-			$str .= ' '.$role->getDisplayableName($group);
-			echo $str."<br />\n";
-		}
-?>
-		<p>
-		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-		</form>
-		<?php
-
-		$ath->footer(array());
-
-?>

Deleted: trunk/src/www/tracker/admin/ind.php
===================================================================
--- trunk/src/www/tracker/admin/ind.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/ind.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,178 +0,0 @@
-<?php
-/**
- * FusionForge Tracker Listing
- *
- * Copyright 2000, Quentin Cregan/Sourceforge
- * Copyright 2002-2003, Tim Perdue/GForge, LLC
- * Copyright 2010, FusionForge Team
- * Copyright 2011, Franck Villaume - Capgemini
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-if (getStringFromRequest('post_changes')) {
-	$name = getStringFromRequest('name');
-	$description = getStringFromRequest('description');
-	$is_public = getStringFromRequest('is_public');
-	$allow_anon = getStringFromRequest('allow_anon');
-	$email_all = getStringFromRequest('email_all');
-	$email_address = getStringFromRequest('email_address');
-	$due_period = getStringFromRequest('due_period');
-	$use_resolution = getStringFromRequest('use_resolution');
-	$submit_instructions = getStringFromRequest('submit_instructions');
-	$browse_instructions = getStringFromRequest('browse_instructions');
-
-	if (!forge_check_perm ('tracker_admin', $group->getID())) {
-		exit_permission_denied('','tracker');
-	}
-
-	if (getStringFromRequest('add_at')) {
-		$res=new ArtifactTypeHtml($group);
-		if (!$res->create($name,$description,$is_public,$allow_anon,$email_all,$email_address,
-			$due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
-			exit_error($res->getErrorMessage(),'tracker');
-		} else {
-			$feedback .= _('Tracker created successfully');
-			$feedback .= '<br/>';
-			$feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
-		}
-		$group->normalizeAllRoles () ;
-	}
-}
-
-
-//
-//	Display existing artifact types
-//
-$atf = new ArtifactTypeFactory($group);
-if (!$atf || !is_object($atf) || $atf->isError()) {
-	exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
-}
-
-// Only keep the Artifacts where the user has admin rights.
-$arr = $atf->getArtifactTypes();
-$i=0;
-for ($j = 0; $j < count($arr); $j++) {
-	if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
-		$at_arr[$i++] =& $arr[$j];
-	}
-}
-// If no more tracker now,
-if ($i==0 && $j>0) {
-	exit_permission_denied('','tracker');
-}
-
-//required params for site_project_header();
-$params['group']=$group_id;
-$params['toptab']='tracker';
-if(isset($page_title)){
-	$params['title'] = $page_title;
-} else {
-	$params['title'] = '';
-}
-
-site_project_header($params);
-echo $HTML->subMenu(
-	array(
-		_('Report'),
-		_('Admin')
-	),
-	array(
-		'/tracker/reporting/?group_id='.$group_id,
-		'/tracker/admin/?group_id='.$group_id
-	),
-	array(
-		array('title' => _('Various graph about statistics'), 'class' => 'tabtitle-nw'),
-		array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle')
-	)
-);
-
-if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
-	echo '<div class="warning">'._('No trackers found').'</div>';
-} else {
-
-	echo '
-	<p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
-
-	/*
-		Put the result set (list of forums for this group) into a column with folders
-	*/
-	$tablearr=array(_('Tracker'),_('Description'));
-	echo $HTML->listTableTop($tablearr);
-
-	for ($j = 0; $j < count($at_arr); $j++) {
-		echo '
-		<tr '. $HTML->boxGetAltRowStyle($j) . '>
-			<td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
-				html_image("ic/tracker20w.png","20","20") . '  '.
-				$at_arr[$j]->getName() .'</a>
-			</td>
-			<td>'.$at_arr[$j]->getDescription() .'
-			</td>
-		</tr>';
-	}
-		echo $HTML->listTableBottom();
-	}
-
-	//
-	//	Set up blank ArtifactType
-	//
-
-	if (forge_check_perm ('tracker_admin', $group->getID())) {
-	?><?php echo _('<h3>Create a new tracker</h3><p>You can use this system to track virtually any kind of data, with each tracker having separate user, group, category, and permission lists. You can also easily move items between trackers when needed.</p><p>Trackers are referred to as "Artifact Types" and individual pieces of data are "Artifacts". "Bugs" might be an Artifact Type, whiles a bug report would be an Artifact. You can create as many Artifact Types as you want, but remember you need to set up categories, groups, and permission for each type, which can get time-consuming.</p>') ?>
-	<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
-	<input type="hidden" name="add_at" value="y" />
-	<p>
-	<?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
-	<input type="text" name="name" value="" /></p>
-	<p>
-	<strong><?php echo _('Description') ?>:</strong><br />
-	<input type="text" name="description" value="" size="50" /></p>
-	<p>
-	<input type="checkbox" name="is_public" value="1" /> <strong><?php echo _('Publicly Available') ?></strong><br />
-	<input type="checkbox" name="allow_anon" value="1" /> <strong><?php echo _('Allow non-logged-in postings') ?></strong></p>
-	<p>
-	<strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
-	<input type="text" name="email_address" value="" /></p>
-	<p>
-	<input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong><br /></p>
-	<p>
-	<strong><?php echo _('Days till considered overdue') ?>:</strong><br />
-	<input type="text" name="due_period" value="30" /></p>
-	<p>
-	<strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
-	<input type="text" name="status_timeout" value="14" /></p>
-	<p>
-	<strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
-	<textarea name="submit_instructions" rows="10" cols="55"></textarea></p>
-	<p>
-	<strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
-	<textarea name="browse_instructions" rows="10" cols="55"></textarea></p>
-	<p>
-	<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
-	</form>
-	<?php
-	}
-
-site_project_footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Modified: trunk/src/www/tracker/admin/index.php
===================================================================
--- trunk/src/www/tracker/admin/index.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/index.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -26,11 +26,11 @@
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'tracker/Artifact.class.php';
 require_once $gfcommon.'tracker/ArtifactFile.class.php';
-require_once $gfwww.'tracker/include/ArtifactFileHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactFileHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactType.class.php';
 require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
-require_once $gfwww.'tracker/include/ArtifactHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactCanned.class.php';
 require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
 require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
@@ -75,7 +75,7 @@
 		getStringFromRequest('updownorder_opt') ||
 		getStringFromRequest('post_changes_order') ||
 		getStringFromRequest('post_changes_alphaorder')) {
-		include $gfwww.'tracker/admin/updates.php';
+		include $gfcommon.'tracker/actions/admin-updates.php';
 
 	} elseif (getStringFromRequest('deletetemplate')) {
 		db_query_params ('UPDATE artifact_group_list SET custom_renderer=$1 WHERE group_artifact_id=$2',
@@ -107,42 +107,42 @@
 
 	if ($action == 'add_extrafield') {
 
-		include $gfwww.'tracker/admin/form-addextrafield.php';
+		include $gfcommon.'tracker/views/form-addextrafield.php';
 
 	} elseif ($action == 'customize_list') {
 
-		include $gfwww.'tracker/admin/form-customizelist.php';
+		include $gfcommon.'tracker/views/form-customizelist.php';
 
 	} elseif ($action == 'workflow') {
 
-		include $gfwww.'tracker/admin/form-workflow.php';
+		include $gfcommon.'tracker/views/form-workflow.php';
 
 	} elseif ($action == 'workflow_roles') {
 
-		include $gfwww.'tracker/admin/form-workflow_roles.php';
+		include $gfcommon.'tracker/views/form-workflow_roles.php';
 
 	} elseif ($action == 'add_opt' ||
 			  $action == 'updownorder_opt' ||
 			  $action == 'post_changes_order' ||
 			  $action == 'post_changes_alphaorder') {
 
-		include $gfwww.'tracker/admin/form-addextrafieldoption.php';
+		include $gfcommon.'tracker/views/form-addextrafieldoption.php';
 
 	} elseif ($action == 'copy_opt') {
 
-		include $gfwww.'tracker/admin/form-extrafieldcopy.php';
+		include $gfcommon.'tracker/views/form-extrafieldcopy.php';
 
 	} elseif ($action == 'add_canned') {
 
-		include $gfwww.'tracker/admin/form-addcanned.php';
+		include $gfcommon.'tracker/views/form-addcanned.php';
 
 	} elseif ($action == 'clone_tracker') {
 
-		include $gfwww.'tracker/admin/form-clonetracker.php';
+		include $gfcommon.'tracker/views/form-clonetracker.php';
 
 	} elseif ($action == 'uploadtemplate') {
 
-		include $gfwww.'tracker/admin/form-uploadtemplate.php';
+		include $gfcommon.'tracker/views/form-uploadtemplate.php';
 
 	} elseif ($action == 'downloadtemplate') {
 
@@ -154,35 +154,35 @@
 
 	} elseif ($action == 'update_canned') {
 
-		include $gfwww.'tracker/admin/form-updatecanned.php';
+		include $gfcommon.'tracker/views/form-updatecanned.php';
 
 	} elseif ($action == 'update_box') {
 
-		include $gfwww.'tracker/admin/form-updateextrafield.php';
+		include $gfcommon.'tracker/views/form-updateextrafield.php';
 
 	} elseif ($action == 'update_opt') {
 
-		include $gfwww.'tracker/admin/form-updateextrafieldelement.php';
+		include $gfcommon.'tracker/views/form-updateextrafieldelement.php';
 
 	} elseif ($action == 'delete_opt') {
 
-		include $gfwww.'tracker/admin/form-deleteextrafieldelement.php';
+		include $gfcommon.'tracker/views/form-deleteextrafieldelement.php';
 
 	} elseif ($action == 'delete') {
 
-		include $gfwww.'tracker/admin/form-deletetracker.php';
+		include $gfcommon.'tracker/views/form-deletetracker.php';
 
 	} elseif ($action == 'deleteextrafield') {
 
-		include $gfwww.'tracker/admin/form-deleteextrafield.php';
+		include $gfcommon.'tracker/views/form-deleteextrafield.php';
 
 	} elseif ($action == 'update_type') {
 
-		include $gfwww.'tracker/admin/form-updatetracker.php';
+		include $gfcommon.'tracker/views/form-updatetracker.php';
 
 	} else {
 
-		include $gfwww.'tracker/admin/tracker.php';
+		include $gfcommon.'tracker/actions/admin-tracker.php';
 
 	}
 
@@ -191,8 +191,7 @@
 		$feedback .= _('Successfully Deleted.');
 	}
 
-	include $gfwww.'tracker/admin/ind.php';
-
+	include $gfcommon.'tracker/actions/admin-ind.php';
 }
 
 // Local Variables:

Deleted: trunk/src/www/tracker/admin/tracker.php
===================================================================
--- trunk/src/www/tracker/admin/tracker.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/tracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,72 +0,0 @@
-<?php
-/**
- * Tracker Links
- *
- * Copyright 2010, FusionForge Team
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-//
-//  SHOW LINKS TO FUNCTIONS
-//
-
-$ath->header(array ('title'=>_('Administration').': '.$ath->getName()));
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id,
-			     '<strong>'._('New Tracker').'</strong>').'<br />' ;
-echo _('Create a new tracker.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&update_type=1',
-			     '<strong>'._('Update Settings').'</strong>').'<br />' ;
-echo _('Set up preferences like expiration times, email addresses.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&add_extrafield=1',
-			     '<strong>'._('Manage Custom Fields').'</strong>').'<br />' ;
-echo _('Add new boxes like Phases, Quality Metrics, Components, etc.  Once added they can be used with other selection boxes (for example, Categories or Groups) to describe and browse bugs or other artifact types.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&workflow=1',
-			     '<strong>'._('Manage Workflow').'</strong>').'<br />' ;
-echo _('Edit tracker workflow.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&customize_list=1',
-			     '<strong>'._('Customize List').'</strong>').'<br />' ;
-echo _('Customize display for the tracker.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&add_canned=1',
-			     '<strong>'._('Add/Update Canned Responses').'</strong>').'<br />' ;
-echo _('Create/change generic response messages for the tracker.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&clone_tracker=1',
-			     '<strong>'._('Clone Tracker').'</strong>').'<br />' ;
-echo _('Create a new tracker as a copy of this one.') ;
-echo '</p>';
-
-echo '<p>' . util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID().'&delete=1',
-			     '<strong>'._('Delete').'</strong>').'<br />' ;
-echo _('Permanently delete this tracker.') ;
-echo '</p>';
-
-$ath->footer(array());
-
-?>

Deleted: trunk/src/www/tracker/admin/updates.php
===================================================================
--- trunk/src/www/tracker/admin/updates.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/admin/updates.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,487 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 2010 (c) FusionForge Team
- * Copyright 2010 (c) Franck Villaume - Capgemini
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-		//
-		//	Create an extra field
-		//
-		if (getStringFromRequest('add_extrafield')) {
-			$name = getStringFromRequest('name');
-			$field_type = getStringFromRequest('field_type');
-			$attribute1 = getStringFromRequest('attribute1');
-			$attribute2 = getStringFromRequest('attribute2');
-			$is_required = getStringFromRequest('is_required');
-			$alias = getStringFromRequest('alias');
-
-			$ab = new ArtifactExtraField($ath);
-
-			if (!$ab || !is_object($ab)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-//			} elseif ($ab->isError())
-//				$error_msg .= $ab->getErrorMessage();
-			} else {
-				if (!$ab->create($name,$field_type,$attribute1,$attribute2,$is_required,$alias)) {
-					$error_msg .= _('Error inserting a custom field').': '.$ab->getErrorMessage();
-					$ab->clearError();
-				} else {
-					$feedback .= _('Extra field inserted');
-				}
-			}
-		//
-		//	Delete an extra field and its contents
-		//
-		} elseif (getStringFromRequest('deleteextrafield')) {
-			$id = getStringFromRequest('id');
-			$ab = new ArtifactExtraField($ath,$id);
-
-			if (!$ab || !is_object($ab)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ab->isError()) {
-				$error_msg .= $ab->getErrorMessage();
-			} else {
-				$sure = getStringFromRequest('sure');
-				$really_sure = getStringFromRequest('really_sure');
-				if (!$ab->delete($sure,$really_sure)) {
-					$error_msg .= $ab->getErrorMessage();
-				} else {
-					$browse_list = $ath->getBrowseList();
-					$arr = explode(',', $browse_list);
-					$idx = array_search($id, $arr);
-					if($idx !== False) {
-						array_splice($arr, $idx, 1);
-					}
-					$ath->setBrowseList(join(',', $arr));
-					$feedback .= _('Custom Field Deleted');
-					$deleteextrafield=false;
-					session_redirect('/tracker/admin/?group_id='.$group_id.'&atid='.$atid.'&add_extrafield=1&feedback='.urlencode($feedback));
-				}
-			}
-
-		//
-		//	Add an element to an extra field
-		//
-		} elseif (getStringFromRequest('add_opt')) {
-			$boxid = getStringFromRequest('boxid');
-			$ab = new ArtifactExtraField($ath,$boxid);
-			if (!$ab || !is_object($ab)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ab->isError()) {
-				$error_msg .= $ab->getErrorMessage();
-			} else {
-				$ao = new ArtifactExtraFieldElement($ab);
-				if (!$ao || !is_object($ao)) {
-					$error_msg .= 'Unable to create ArtifactExtraFieldElement Object';
-//				} elseif ($ao->isError())
-//					$error_msg .= $ao->getErrorMessage();
-				} else {
-					$name = getStringFromRequest('name');
-					$status_id = getIntFromRequest('status_id');
-					if (!$ao->create($name,$status_id)) {
-						$error_msg .= _('Error inserting an element').': '.$ao->getErrorMessage();
-						$ao->clearError();
-					} else {
-						$feedback .= _('Element inserted');
-					}
-				}
-			}
-
-		//
-		//	Add a canned response
-		//
-		} elseif (getStringFromRequest('add_canned')) {
-			$title = getStringFromRequest('title');
-			$body = getStringFromRequest('body');
-
-			$acr = new ArtifactCanned($ath);
-			if (!$acr || !is_object($acr)) {
-				$error_msg .= _('Unable to create ArtifactCanned Object');
-//			} elseif ($acr->isError()) {
-//				$error_msg .= $acr->getErrorMessage();
-			} else {
-				if (!$acr->create($title,$body)) {
-					$error_msg .= _('Error inserting').' : '.$acr->getErrorMessage();
-					$acr->clearError();
-				} else {
-					$feedback .= _('Canned Response Inserted');
-				}
-			}
-
-		//
-		//	Update a canned response
-		//
-		} elseif (getStringFromRequest('update_canned')) {
-			$id = getStringFromRequest('id');
-			$title = getStringFromRequest('title');
-			$body = getStringFromRequest('body');
-
-			$acr = new ArtifactCanned($ath,$id);
-			if (!$acr || !is_object($acr)) {
-				$error_msg .= _('Unable to create ArtifactCanned Object');
-			} elseif ($acr->isError()) {
-				$error_msg .= $acr->getErrorMessage();
-			} else {
-				if (!$acr->update($title,$body)) {
-					$error_msg .= _('Error updating').' : '.$acr->getErrorMessage();
-					$acr->clearError();
-				} else {
-					$feedback .= _('Canned Response Updated');
-					$next = 'add_canned';
-				}
-			}
-
-		//
-		//	Copy Categories
-		//
-		} elseif (getStringFromRequest('copy_opt')) {
-			$copyid = getStringFromRequest('copyid');
-			$selectid = getStringFromRequest('selectid');
-
-			$copy_rows=count($copyid);
-			if ($copy_rows > 0) {
-				//
-				// create an object for each selected type
-				//
-				$result = db_query_params ('SELECT * FROM artifact_extra_field_list
-					WHERE extra_field_id=$1',
-			array($selectid));
-				$typeid = db_result($result,0,'group_artifact_id');
-				$dest_tracker =& artifactType_get_object($typeid);
-				if (!$dest_tracker || !is_object($dest_tracker)) {
-					exit_error(_('ArtifactType could not be created'),'tracker');
-				} elseif ($dest_tracker->isError()) {
-					exit_error($dest_tracker->getErrorMessage(),'tracker');
-				}
-				//
-				//  Copy elements into a field (box) for each tracker selected
-				//
-				$feedback .= _('Copy into Tracker: ');
-				$feedback .= $dest_tracker->getName();
-				$aef =new ArtifactExtraField($dest_tracker,$selectid);
-				if (!$aef || !is_object($aef)) {
-					$error_msg .= _('Unable to create ArtifactExtraField Object');
-				} elseif ($aef->isError()) {
-					$error_msg .= $aefe->getErrorMessage();
-				} else {
-					$feedback .= ', Box: ';
-					$feedback .= $aef->getName();
-					$feedback .= '<br />';
-
-					for ($k=0; $k < $copy_rows; $k++) {
-					$aefe = new ArtifactExtraFieldElement($aef);
-						if (!$aefe || !is_object($aefe)) {
-							$error_msg .= 'Unable to create ArtifactExtraFieldElement Object';
-						} elseif ($aefe->isError()) {
-							$error_msg .= $aefe->getErrorMessage();
-						} else {
-							$name=$ath->getElementName($copyid[$k]);
-							$status=$ath->getElementStatusID($copyid[$k]);
-							if (!$aefe->create($name,$status)) {
-								$error_msg .= _('Error inserting an element').': '.$aefe->getErrorMessage();
-								$aefe->clearError();
-							} else {
-								$feedback .= '- Copied choice:'. $name;
-							}
-						}
-					}
-				}
-			}
-			$feedback .= '<br />';
-
-		//
-		//	Update an extra field
-		//
-		} elseif (getStringFromRequest('update_box')) {
-			$id = getStringFromRequest('id');
-			$name = getStringFromRequest('name');
-			$attribute1 = getStringFromRequest('attribute1');
-			$attribute2 = getStringFromRequest('attribute2');
-			$is_required = getStringFromRequest('is_required');
-			$alias = getStringFromRequest('alias');
-
-			$ac = new ArtifactExtraField($ath,$id);
-			if (!$ac || !is_object($ac)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ac->isError()) {
-				$error_msg .= $ac->getErrorMessage();
-			} else {
-				if (!$ac->update($name,$attribute1,$attribute2,$is_required,$alias)) {
-					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
-					$ac->clearError();
-				} else {
-					$feedback .= _('Custom Field updated');
-					$next = 'add_extrafield';
-				}
-			}
-
-		//
-		//	Update an Element
-		//
-		} elseif (getStringFromRequest('update_opt')) {
-			$id = getStringFromRequest('id');
-			$name = getStringFromRequest('name');
-			$boxid = getStringFromRequest('boxid');
-
-			$ac = new ArtifactExtraField($ath,$boxid);
-			if (!$ac || !is_object($ac)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ac->isError()) {
-				$error_msg .= $ac->getErrorMessage();
-			} else {
-				$ao = new ArtifactExtraFieldElement($ac,$id);
-				if (!$ao || !is_object($ao)) {
-					$error_msg .= _('Unable to create ArtifactExtraFieldElement Object');
-				} elseif ($ao->isError()) {
-					$error_msg .= $ao->getErrorMessage();
-				} else {
-					$name = getStringFromRequest('name');
-					$status_id = getIntFromRequest('status_id');
-					if (!$ao->update($name,$status_id)) {
-						$error_msg .= _('Error updating a custom field').' : '.$ao->getErrorMessage();
-						$ao->clearError();
-					} else {
-						$feedback .= _('Element updated');
-						$next = 'add_extrafield';
-					}
-				}
-			}
-
-		//
-		//	Clone a tracker's elements to this tracker
-		//
-		} elseif (getStringFromRequest('clone_tracker')) {
-			$clone_id = getIntFromRequest('clone_id');
-
-			if (!$clone_id) {
-				exit_missing_param('',array(_('Clone ID')),'tracker');
-			}
-			if (!$ath->cloneFieldsFrom($clone_id)) {
-				exit_error(_('Error cloning fields: ').$ath->getErrorMessage(),'tracker');
-			} else {
-				$feedback .= _('Successfully Cloned Tracker Fields ');
-				$next = '*main*';
-			}
-
-		//
-		//	Update a tracker
-		//
-		} elseif (getStringFromRequest('update_type')) {
-			$name = getStringFromRequest('name');
-			$description = getStringFromRequest('description');
-			$email_all = getStringFromRequest('email_all');
-			$email_address = getStringFromRequest('email_address');
-			$due_period = getStringFromRequest('due_period');
-			$status_timeout = getStringFromRequest('status_timeout');
-			$use_resolution = getStringFromRequest('use_resolution');
-			$submit_instructions = getStringFromRequest('submit_instructions');
-			$browse_instructions = getStringFromRequest('browse_instructions');
-
-			if (!$ath->update($name,$description,$email_all,$email_address,
-				$due_period,$status_timeout,$use_resolution,$submit_instructions,$browse_instructions)) {
-				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
-				$ath->clearError();
-			} else {
-				$feedback .= _('Tracker Updated');
-			}
-
-		//
-		//	Update the browse list of a tracker
-		//
-		} elseif (getStringFromRequest('customize_list')) {
-			$browse_fields = getArrayFromRequest('browse_fields');
-			foreach ($browse_fields as $name => $pos) {
-				if ($pos)
-					$list_fields[$pos][] = $name;
-			}
-			ksort($list_fields);
-			$browse_fields = array();
-			foreach ($list_fields as $pos => $list_name) {
-				sort($list_name);
-				foreach ($list_name as $name)
-					$browse_fields[] = $name;
-			}
-			$browse_fields = join(',', $browse_fields);
-			if (!$ath->setBrowseList($browse_fields)) {
-				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
-				$ath->clearError();
-			} else {
-				$feedback .= _('Tracker Updated');
-			}
-
-		//
-		//	Delete a tracker
-		//
-		} elseif (getStringFromRequest('delete')) {
-			$sure = getStringFromRequest('sure');
-			$really_sure = getStringFromRequest('really_sure');
-
-			if (!$ath->delete($sure,$really_sure)) {
-				$error_msg .= _('Error updating').' : '.$ath->getErrorMessage();
-			} else {
-				session_redirect('/tracker/admin/?group_id='.$group_id.'&tracker_deleted=1');
-			}
-
-		//
-		//	Upload template
-		//
-		} elseif (getStringFromRequest('uploadtemplate')) {
-
-			$input_file = getUploadedFile('input_file');
-			$size = $input_file['size'];
-			if ($size != 0 ) {
-				if (!util_check_fileupload($input_file['tmp_name'])) {
-					echo ('Invalid filename :'.$input_file['tmp_name']);
-					exit;
-				}
-				$input_data = addslashes(fread(fopen($input_file['tmp_name'], 'r'), $size));
-
-				db_query_params ('UPDATE artifact_group_list SET custom_renderer=$1 WHERE group_artifact_id=$2',
-					 	array ($input_data,
-						$ath->getID()));
-				echo db_error();
-				$feedback .= _('Renderer Uploaded');
-			} else {
-				$error_msg .= _('Renderer File empty');
-			}
-		//
-		//	Up or down elements
-		//
-		} elseif (getStringFromRequest('updownorder_opt')) {
-			$boxid = getStringFromRequest('boxid');
-			$id = getIntFromRequest('id');
-			$new_pos = getStringFromRequest('new_pos');
-			$ac = new ArtifactExtraField($ath,$boxid);
-			if (!$ac || !is_object($ac)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ac->isError()) {
-				$error_msg .= $ac->getErrorMessage();
-			} else {
-				if (!$ac->reorderValues($id, $new_pos)) {
-					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
-					$ac->clearError();
-				} else {
-					$feedback .= _('Tracker Updated');
-				}
-			}
-
-		//
-		//  Change order of elements
-		//
-		} elseif (getStringFromRequest('post_changes_order')) {
-			$boxid = getStringFromRequest('boxid');
-			$order = getArrayFromRequest('order');
-			$ac = new ArtifactExtraField($ath,$boxid);
-			if (!$ac || !is_object($ac)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ac->isError()) {
-				$error_msg .= $ac->getErrorMessage();
-			} else {
-				$updated_flag = 0;
-				foreach ($order as $id => $new_pos) {
-					if ($new_pos == '') continue;
-					if (!$ac->reorderValues($id, $new_pos)) {
-						$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
-						$ac->clearError();
-						continue;
-					}
-					else {
-						$updated_flag = 1;
-					}
-				}
-				if ($updated_flag)
-					$feedback .= _('Tracker Updated');
-			}
-		} elseif (getStringFromRequest('post_changes_alphaorder')) {
-			$boxid = getStringFromRequest('boxid');
-			$ac = new ArtifactExtraField($ath,$boxid);
-			if (!$ac || !is_object($ac)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ac->isError()) {
-				$error_msg .= $ac->getErrorMessage();
-			} else {
-				if (!$ac->alphaorderValues($id)) {
-					$error_msg .= _('Error updating a custom field').' : '.$ac->getErrorMessage();
-					$ac->clearError();
-				} else {
-					$feedback .= _('Tracker Updated');
-				}
-			}
-		//
-		// Configure workflow
-		//
-		} elseif (getStringFromRequest('workflow')) {
-			require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
-			$field_id = getIntFromRequest('field_id');
-			$wk = getArrayFromRequest('wk');
-    		$atw = new ArtifactWorkflow($ath, $field_id);
-
-    		if (!isset($wk[100])) {
-    			$error_msg .= _('ERROR: Initial values not saved, no initial state given.').'<br />';
-    		} else {
-	    		// Save values for the submit form (from=100).
-	    		$atw->saveNextNodes('100', array_keys($wk[100]));
-    			$feedback .= _('Initial values saved.').'<br />';
-    		}
-
-	    	$elearray = $ath->getExtraFieldElements($field_id);
-			foreach ($elearray as $e) {
-				$from = $e['element_id'];
-				$next = isset($wk[$from]) ? array_keys($wk[$from]) : array();
-				$atw->saveNextNodes($from, array_keys($wk[$from]));
-	 		}
-			$feedback .= _('Workflow saved');
-		} elseif (getStringFromRequest('workflow_roles')) {
-			require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
-			$field_id = getIntFromRequest('field_id');
-			$from = getIntFromRequest('from');
-			$next = getIntFromRequest('next');
-			$role = array_keys(getArrayFromRequest('role'));
-			$atw = new ArtifactWorkflow($ath, $field_id);
-    		$atw->saveAllowedRoles($from, $next, $role);
-			$feedback .= _('Workflow saved');
-		} elseif (getStringFromRequest('delete_opt')) {
-			$sure = getStringFromRequest('sure');
-			$really_sure = getStringFromRequest('really_sure');
-
-			$id = getStringFromRequest('id');
-			$boxid = getStringFromRequest('boxid');
-			$ab = new ArtifactExtraField($ath,$boxid);
-			if (!$ab || !is_object($ab)) {
-				$error_msg .= _('Unable to create ArtifactExtraField Object');
-			} elseif ($ab->isError()) {
-				$error_msg .= $ab->getErrorMessage();
-			} else {
-				$ao = new ArtifactExtraFieldElement($ab,$id);
-				if (!$ao || !is_object($ao)) {
-					$error_msg .= _('Unable to create ArtifactExtraFieldElement Object');
-				} else {
-					if (!$sure || !$really_sure || !$ao->delete()) {
-						$error_msg .= _('Error deleting an element').': '.$ao->getErrorMessage();
-						$ao->clearError();
-					} else {
-						$feedback .= _('Element deleted');
-						$next = 'add_extrafield';
-					}
-				}
-			}
-		}
-		?>

Deleted: trunk/src/www/tracker/browse.php
===================================================================
--- trunk/src/www/tracker/browse.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/browse.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,748 +0,0 @@
-<?php
-/**
- * FusionForge Tracker
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2010 Roland Mas
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/ArtifactFactory.class.php';
-require_once $gfcommon.'tracker/ArtifactQuery.class.php';
-//
-//  make sure this person has permission to view artifacts
-//
-session_require_perm ('tracker', $ath->getID(), 'read') ;
-
-$query_id = getIntFromRequest('query_id');
-$start = getIntFromRequest('start');
-$paging = 0;
-
-//
-//	The browse page can be powered by a pre-saved query
-//	or by select boxes chosen by the user
-//
-//	If there is a $query_id coming from the request OR the pref
-//	was already saved, use the artifact factory that way.
-//
-//	If the query_id = -1, unset the pref and use regular browse boxes
-//
-if (session_loggedin()) {
-	$u =& session_get_user();
-	if (getStringFromRequest('setpaging')) {
-		/* store paging preferences */
-		$paging = getIntFromRequest('nres');
-		if (!$paging) {
-			$paging = 25;
-		}
-		$u->setPreference("paging", $paging);
-	}
-
-	if($query_id) {
-		if ($query_id == '-1') {
-			$u->setPreference('art_query'.$ath->getID(),'');
-		} else {
-			$aq = new ArtifactQuery($ath,$query_id);
-			if (!$aq || !is_object($aq)) {
-				exit_error($aq->getErrorMessage(),'tracker');
-			}
-			$aq->makeDefault();
-		}
-	} else {
-		$query_id=$u->getPreference('art_query'.$ath->getID(),'');
-	}
-} elseif ($query_id) {
-	// If user is not logged, then use a cookie to store the current query.
-	if (isset($_COOKIE["GFTrackerQuery"])) {
-		$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
-	} else {
-		$gf_tracker = array();
-	}
-	$gf_tracker[$ath->getID()] = $query_id;
-	// Send the query_id as a cookie to save it.
-	setcookie("GFTrackerQuery", serialize($gf_tracker));
-	$_COOKIE["GFTrackerQuery"] = serialize($gf_tracker);
-} elseif (isset($_COOKIE["GFTrackerQuery"])) {
-	$gf_tracker = unserialize($_COOKIE["GFTrackerQuery"]);
-	$query_id = (int)$gf_tracker[$ath->getID()];
-}
-
-$af = new ArtifactFactory($ath);
-
-if (!$af || !is_object($af)) {
-	exit_error(_('Could Not Get Factory'),'tracker');
-} elseif ($af->isError()) {
-	exit_error($af->getErrorMessage(),'tracker');
-}
-
-if (!isset($_sort_col)) {
-	/* default sort order: highest priority first */
-	$_sort_col = 'priority';
-	$_sort_ord = 'DESC';
-}
-$offset = getStringFromRequest('offset');
-$_sort_col = getStringFromRequest('_sort_col',$_sort_col);
-$_sort_ord = getStringFromRequest('_sort_ord',$_sort_ord);
-$max_rows = getIntFromRequest('max_rows', 25);
-$set = getStringFromRequest('set');
-$_assigned_to = getIntFromRequest('_assigned_to');
-$_status = getIntFromRequest('_status');
-$_extra_fields = array() ;
-$aux_extra_fields = array() ;
-
-if ($set == 'custom') {
-	/* may be past in next/prev url */
-	$i = $ath->getCustomStatusField();
-	$tmp_extra_fields = getArrayFromRequest('extra_fields');
-	if (isset($tmp_extra_fields[$i])) {
-		$_extra_fields[$i] = $tmp_extra_fields[$i];
-	}
-}
-
-if (is_array($_extra_fields)){
-	$keys=array_keys($_extra_fields);
-	foreach ($keys as $key) {
-		if ($_extra_fields[$key] != 'Array') {
-			$aux_extra_fields[$key] = $_extra_fields[$key];
-		}
-	}
-} else {
-	if (isset($_extra_fields)){
-		$aux_extra_fields = $_extra_fields;
-	} else {
-		$aux_extra_fields = '';
-	}
-}
-
-$af->setup($offset,$_sort_col,$_sort_ord,$paging,$set,$_assigned_to,$_status,$aux_extra_fields);
-//
-//	These vals are sanitized and/or retrieved from ArtifactFactory stored settings
-//
-$_sort_col=$af->order_col;
-$_sort_ord=$af->sort;
-$_status=$af->status;
-$_assigned_to=$af->assigned_to;
-$_extra_fields=$af->extra_fields;
-
-$art_arr = $af->getArtifacts();
-
-if (!$art_arr && $af->isError()) {
-	exit_error($af->getErrorMessage(),'tracker');
-}
-
-//build page title to make bookmarking easier
-//if a user was selected, add the user_name to the title
-//same for status
-use_javascript('/tabber/tabber.js');
-
-$ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
-
-/**
- *
- *	Build the powerful browsing options pop-up boxes
- *
- */
-
-//
-//	creating a custom technician box which includes "any" and "unassigned"
-//
-$engine = RBACEngine::getInstance () ;
-$techs = $engine->getUsersByAllowedAction ('tracker', $ath->getID(), 'tech') ;
-
-$tech_id_arr = array () ;
-$tech_name_arr = array () ;
-
-foreach ($techs as $tech) {
-	$tech_id_arr[] = $tech->getID() ;
-	$tech_name_arr[] = $tech->getRealName() ;
-}
-$tech_id_arr[]='0';  //this will be the 'any' row
-$tech_name_arr[]=_('Any');
-
-if (is_array($_assigned_to)) {
-	$_assigned_to='';
-}
-$tech_box=html_build_select_box_from_arrays ($tech_id_arr,$tech_name_arr,'_assigned_to',$_assigned_to,true,_('Unassigned'));
-
-
-//
-//	custom order by arrays to build a pop-up box
-//
-$order_name_arr=array();
-$order_name_arr[]=_('ID');
-$order_name_arr[]=_('Priority');
-$order_name_arr[]=_('Summary');
-$order_name_arr[]=_('Open Date');
-$order_name_arr[]=_('Last Modified Date');
-$order_name_arr[]=_('Close Date');
-$order_name_arr[]=_('Submitter');
-$order_name_arr[]=_('Assignee');
-
-
-$order_arr=array();
-$order_arr[]='artifact_id';
-$order_arr[]='priority';
-$order_arr[]='summary';
-$order_arr[]='open_date';
-$order_arr[]='last_modified_date';
-$order_arr[]='close_date';
-$order_arr[]='submitted_by';
-$order_arr[]='assigned_to';
-
-//
-//	custom sort arrays to build pop-up box
-//
-$sort_name_arr=array();
-$sort_name_arr[]=_('Ascending');
-$sort_name_arr[]=_('Descending');
-
-$sort_arr=array();
-$sort_arr[]='ASC';
-$sort_arr[]='DESC';
-
-//
-//	custom changed arrays to build pop-up box
-//
-$changed_name_arr=array();
-$changed_name_arr[]=_('Any changes');
-$changed_name_arr[]=_('Last 24H');
-$changed_name_arr[]=_('Last 7days');
-$changed_name_arr[]=_('Last 2weeks');
-$changed_name_arr[]=_('Last 1month');
-
-$changed_arr=array();
-$changed_arr[]= 0x7fffffff;	 // Any
-$changed_arr[]= 3600 * 24;	 // 24 hour
-$changed_arr[]= 3600 * 24 * 7; // 1 week
-$changed_arr[]= 3600 * 24 * 14;// 2 week
-$changed_arr[]= 3600 * 24 * 30;// 1 month
-
-if ($art_arr && ($art_cnt = count($art_arr)) > 0) {
-	$focus = getIntFromRequest('focus');
-} else {
-	$art_cnt = 0;
-	$start = 0;
-	$focus = 0;
-}
-$paging = 0;
-if (session_loggedin()) {
-	/* logged in users get configurable paging */
-	$paging = $u->getPreference("paging");
-	echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'&start='.
-		$start.'" method="post">'."\n";
-}
-if (!$paging) {
-	$paging = 25;
-}
-if ($art_cnt) {
-	if ($focus) {
-		for ($i = 0; $i < $art_cnt; ++$i)
-			if ($art_arr[$i]->getID() == $focus) {
-				$start = $i;
-				break;
-			}
-	}
-	$max = ($art_cnt > ($start + $paging)) ? ($start + $paging) : $art_cnt;
-} else {
-	$max = 0;
-}
-
-printf('<p>' . _('Displaying results %1$d‒%2$d out of %3$d total.'),
-       $start + 1, $max, $art_cnt);
-if (session_loggedin()) {
-	printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
-	       'type="submit" name="setpaging" value="%1$s" />' .
-	       "\n</p>\n</form>\n", _('Change'),
-	       html_build_select_box_from_array(array(
-							'10', '25', '50', '100', '1000'), 'nres', $paging, 1));
-} else {
-	echo "</p>\n";
-}
-
-/**
- *
- *	Show the free-form text submitted by the project admin
- */
-echo $ath->renderBrowseInstructions();
-
-//
-//	statuses can be custom in GForge 4.5+
-//
-if ($ath->usesCustomStatuses()) {
-	$aux_extra_fields = array();
-	if (is_array($_extra_fields)){
-		$keys=array_keys($_extra_fields);
-		foreach ($keys as $key) {
-			if (!is_array($_extra_fields[$key])) {
-				$aux_extra_fields[$key] = $_extra_fields[$key];
-			}
-		}
-	} else {
-		$aux_extra_fields = $_extra_fields;
-	}
-	$status_box=$ath->renderSelect ($ath->getCustomStatusField(),$aux_extra_fields[$ath->getCustomStatusField()],false,'',true,_('Any'));
-} else {
-	if (is_array($_status)) {
-		$_status='';
-	}
-	$status_box = $ath->statusBox('_status',$_status,true,_('Any'));
-}
-
-// start of RDFa
-$proj_name = $group->getUnixName();
-$proj_url = util_make_url_g($group->getUnixName(),$group_id);
-// the tracker's URIs are constructed in order to support addition of an OSLC-CM REST server
-// inside /tracker/cm/. There each tracker has a URL in the form .../project/PROJ_NAME/atid/ATID
-$tracker_stdzd_uri = util_make_url('/tracker/cm/project/'. $proj_name .'/atid/'. $ath->getID());
-print '<div about="'. $tracker_stdzd_uri
-	.'" typeof="sioc:Container">'."\n";
-print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource="" />'."\n";
-print '<span rev="doap:bug-database sioc:space_of" resource="'. $proj_url .'" />'."\n";
-print "</div>\n"; // end of about
-
-echo '
-<div id="tabber" class="tabber">
-	<div class="tabbertab" title="'._('Advanced queries').'">';
-
-if (session_loggedin()) {
-	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
-	FROM artifact_query
-	WHERE group_artifact_id=$1 AND (user_id=$2 OR query_type>0)
-	ORDER BY type ASC, query_name ASC',
-				array ($ath->getID(),
-				       user_getid()));
-} else {
-	$res = db_query_params ('SELECT artifact_query_id,query_name, CASE WHEN query_type>0 THEN 1 ELSE 0 END as type
-	FROM artifact_query
-	WHERE group_artifact_id=$1 AND query_type>0
-	ORDER BY type ASC, query_name ASC',
-				array ($ath->getID()));
-}
-
-
-if (db_numrows($res)>0) {
-	echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="get">';
-	echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
-	echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
-	echo '<input type="hidden" name="power_query" value="1" />';
-	echo '	<table width="100%" cellspacing="0">
-	<tr>
-	<td>
-	';
-	$optgroup['key'] = 'type';
-	$optgroup['values'][0] = 'Private queries';
-	$optgroup['values'][1] = 'Project queries';
-	echo '<span style="font-size:smaller">';
-	echo '<select name="query_id">';
-	echo '<option value="100">Select One</option>';
-	$current = '';
-	$selected = $af->getDefaultQuery();
-	while ($row = db_fetch_array($res)) {
-		if ($current != $row['type']) {
-			if ($current !== '')
-				echo '</optgroup>';
-			$label = $row['type'] ? 'Project' : 'Private';
-			echo '<optgroup label="'.$label.'">';
-			$current = $row['type'];
-		}
-		echo '<option value="'.$row['artifact_query_id'].'"';
-		if ($row['artifact_query_id'] == $selected)
-			echo ' selected="selected"';
-		echo '>'. $row['query_name'] .'</option>'."\n";
-	}
-	if ($current !== '')
-		echo '</optgroup>';
-	echo '</select>';
-	echo '</span>
-	<input type="submit" name="run" value="'._('Power Query').'" />
-	  <a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'.
-	_('Build Query').'</a>
-	</td></tr></table>
-	</form>';
-} else {
-	echo '<strong>
-	<a href="/tracker/?atid='. $ath->getID().'&group_id='.$group_id.'&func=query">'._('Build Query').'</a></strong>';
-}
-echo '
-	</div>
-	<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
-	<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
-	<input type="hidden" name="query_id" value="-1" />
-	<input type="hidden" name="set" value="custom" />
-	<table width="100%" cellspacing="0">
-	<tr>
-	<td>
-	'._('Assignee').': '. $tech_box .'
-	</td>
-	<td align="center">
-	'._('State').': '. $status_box .'
-	</td>
-	<td align="right">';
-
-// Compute the list of fields which can be sorted.
-$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
-				    ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
-				    ARTIFACT_EXTRAFIELDTYPE_INTEGER,
-				    ARTIFACT_EXTRAFIELDTYPE_SELECT,
-				    ARTIFACT_EXTRAFIELDTYPE_RADIO,
-				    ARTIFACT_EXTRAFIELDTYPE_STATUS));
-$keys=array_keys($efarr);
-for ($k=0; $k<count($keys); $k++) {
-	$i=$keys[$k];
-	$order_name_arr[] = $efarr[$i]['field_name'];
-	$order_arr[] = $efarr[$i]['extra_field_id'];
-}
-
-echo _('Order by').
-	html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .
-	html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .
-	'<input type="submit" name="submit" value="'._('Quick Browse').'" />';
-
-echo '
-	</td>
-	</tr>
-	</table>
-	</form>
-	</div>';
-if ($af->query_type == 'default') {
-	echo '<div class="tabbertab tabbertabdefault" title="'._('Default').'">';
-	echo '<strong>'._('Viewing only opened records by default, use \'Advanced queries\' or \'Simple Filtering and Sorting\' to change.').'</strong>';
-	echo '</div>';
-}
-echo '
-</div>';
-
-$art_cnt = count($art_arr);
-if ($art_arr && $art_cnt > 0) {
-
-	if ($query_id) {
-		$aq = new ArtifactQuery($ath,$query_id);
-		$has_bargraph = (in_array('bargraph', $aq->getQueryOptions()));
-	} else {
-		$has_bargraph = false;
-	}
-
-	if ($has_bargraph) {
-		// Display the roadmap block based on the values of the Status field.
-		$colors = array('#a71d16', '#ffa0a0', '#f5f5b5', '#bae0ba', '#16a716');
-		$count = array();
-		$percent = array();
-		foreach($art_arr as $art) {
-			if ($ath->usesCustomStatuses()) {
-				$custom_id = $ath->getCustomStatusField();
-				$extra_data = $art->getExtraFieldDataText();
-				@$count[ $extra_data[$custom_id]['value'] ]++;
-			} else {
-				@$count[ $art->getStatusName()]++;
-			}
-		}
-		foreach($count as $n => $c) {
-			$percent[$n] = round(100*$c/$art_cnt);
-		}
-		if ($ath->getCustomStatusField()) {
-			$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
-			$keys=array_keys($efarr);
-			$field_id = $keys[0];
-			$custom_states = $ath->getExtraFieldElements($field_id);
-			$states = array();
-			if (is_array($custom_states)) {
-				foreach($custom_states as $state) {
-					$states[] = $state['element_name'];
-				}
-			}
-		} else {
-			$colors = array('#ffa0a0', '#bae0ba');
-			$res = $ath->getStatuses();
-			while ($row = db_fetch_array($res)) {
-				$states[] = $row['status_name'];
-			}
-		}
-
-		$i=0;
-		$graph = '';
-		$legend = '';
-		if (is_array($states)) {
-			foreach($states as $name) {
-				if ($count[$name]) {
-					$graph  .= '<td style="background: '.$colors[$i].'; width: '.$percent[$name].'%;"> </td>';
-					$legend .= '<td style="white-space: nowrap; width: '.$percent[$name].'%;">'."<i>$name: $count[$name] ($percent[$name]%)</i></td>";
-				}
-				$i++;
-			}
-		}
-
-		if ($graph) {
-		?>
-		<table class="progress">
-      	<tbody>
-      		<tr><?php echo $graph; ?></tr>
-      	</tbody>
-      	</table>
-      	<table class="progress_legend">
-      		<tr><?php echo $legend ?></tr>
-      	</table>
-	<?php
-		}
-	}
-
-	if ($set=='custom') {
-		$set .= '&_assigned_to='.$_assigned_to.'&_status='.$_status.'&_sort_col='.$_sort_col.'&_sort_ord='.$_sort_ord;
-		if (array_key_exists($ath->getCustomStatusField(),$_extra_fields)) {
-			$set .= '&extra_fields['.$ath->getCustomStatusField().']='.$_extra_fields[$ath->getCustomStatusField()];
-		}
-	}
-
-
-	$IS_ADMIN = forge_check_perm ('tracker', $ath->getID(), 'manager') ;
-
-	if ($IS_ADMIN) {
-		echo '
-		<form name="artifactList" action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
-		<input type="hidden" name="form_key" value="'.form_generate_key().'" />
-		<input type="hidden" name="func" value="massupdate" />';
-	}
-
-	$browse_fields = explode(',', "id,".$ath->getBrowseList());
-	$title_arr=array();
-	foreach ($browse_fields as $f) {
-		$title=$f;
-		if (intval($f) > 0) {
-			$title = $ath->getExtraFieldName($f);
-		} else {
-			if ($f == 'id')
-				$title=_('ID');
-			if ($f == 'summary')
-				$title=_('Summary');
-			if ($f == 'details')
-				$title=_('Description');
-			if ($f == 'open_date')
-				$title=_('Open Date');
-			if ($f == 'close_date')
-				$title=_('Close Date');
-			if ($f == 'status_id')
-				$title=_('State');
-			if ($f == 'priority')
-				$title=_('Priority');
-			if ($f == 'assigned_to')
-				$title=_('Assigned to');
-			if ($f == 'submitted_by')
-				$title=_('Submitted by');
-			if ($f == 'related_tasks')
-				$title=_('Related tasks');
-			if ($f == 'last_modified_date')
-				$title=_('Last Modified Date');
-		}
-		$title_arr[] = $title;
-	}
-
-	if ($start < $max) {
-		echo $GLOBALS['HTML']->listTableTop ($title_arr);
-	}
-
-	$then=(time()-$ath->getDuePeriod());
-
-	for ($i=$start; $i<$max; $i++) {
- 		$extra_data = $art_arr[$i]->getExtraFieldDataText();
-		echo '
-		<tr '. $HTML->boxGetAltRowStyle($i) . '>';
- 		foreach ($browse_fields as $f) {
-			if ($f == 'id') {
-				echo '<td style="white-space: nowrap;">'.
-				($IS_ADMIN?'<input type="checkbox" name="artifact_id_list[]" value="'.
-				$art_arr[$i]->getID() .'" /> ':'').
-				'<a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
-				$art_arr[$i]->getID() .
-				'&group_id='. $group_id .'&atid='.
-				$ath->getID().'">'.$art_arr[$i]->getID() .
-				'</a></td>';
-			} else if ($f == 'summary') {
-		 		echo '<td><a href="'.getStringFromServer('PHP_SELF').'?func=detail&aid='.
-				$art_arr[$i]->getID() .
-				'&group_id='. $group_id .'&atid='.
-				$ath->getID().'">'.
-				$art_arr[$i]->getSummary().
-				'</a></td>';
-			} else if ($f == 'open_date') {
-				echo '<td>'. (($set != 'closed' && $art_arr[$i]->getOpenDate() < $then)?'* ':'  ') .
-				date(_('Y-m-d H:i'),$art_arr[$i]->getOpenDate()) .'</td>';
-			} else if ($f == 'status_id') {
-				echo '<td>'. $art_arr[$i]->getStatusName() .'</td>';
-			} else if ($f == 'priority') {
-				echo '<td class="priority'.$art_arr[$i]->getPriority()  .'">'. $art_arr[$i]->getPriority() .'</td>';
-			} else if ($f == 'assigned_to') {
-				echo '<td>'. $art_arr[$i]->getAssignedRealName() .'</td>';
-			} else if ($f == 'submitted_by') {
-				echo '<td>'. $art_arr[$i]->getSubmittedRealName() .'</td>';
-			} else if ($f == 'close_date') {
-				echo '<td>'. ($art_arr[$i]->getCloseDate() ?
-				date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :'  ') .'</td>';
-			} else if ($f == 'details') {
-				echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
-			} else if ($f == 'related_tasks') {
-				echo '<td>';
-				$tasks_res = $art_arr[$i]->getRelatedTasks();
-				$s ='';
-				while ($rest = db_fetch_array($tasks_res)) {
-					$link = '/pm/task.php?func=detailtask&project_task_id='.$rest['project_task_id'].
-						'&group_id='.$group_id.'&group_project_id='.$rest['group_project_id'];
-					$title = '[T'.$rest['project_task_id'].']';
-					if ($rest['status_id'] == 2) {
-						$title = '<strike>'.$title.'</strike>';
-					}
-					print $s.'<a href="'.$link.'" title="'.util_html_secure($rest['summary']).'">'.$title.'</a>';
-					$s = ' ';
-				}
-				echo '</td>';
-			} else if ($f == 'last_modified_date') {
-				echo '<td>'. ($art_arr[$i]->getLastModifiedDate() ?
-				date(_('Y-m-d H:i'),$art_arr[$i]->getLastModifiedDate()) :'  ') .'</td>';
-			} else if (intval($f) > 0) {
-				// Now display extra-fields (fields are numbers).
-				$value = $extra_data[$f]['value'];
-				if ($extra_data[$f]['type'] == 9) {
-					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
-				} else if ($extra_data[$f]['type'] == 7) {
-					if ($art_arr[$i]->getStatusID() == 2) {
-						$value = '<strike>'.$value.'</strike>';
-					}
-
-				}
-				echo '<td>' . $value .'</td>';
-			} else {
-				// Display ? for unknown values.
-				echo '<td>?</td>';
-			}
- 		}
-		echo '</tr>';
-	}
-
-	if ($start < $max) {
-		echo $GLOBALS['HTML']->listTableBottom();
-	}
-	$pages = $art_cnt / $paging;
-	$currentpage = intval($start / $paging);
-
-	if ($pages >= 1) {
-		$skipped_pages=false;
-		for ($j=0; $j<$pages; $j++) {
-			if ($pages > 20) {
-				if ((($j > 4) && ($j < ($currentpage-5))) || (($j > ($currentpage+5)) && ($j < ($pages-5)))) {
-					if (!$skipped_pages) {
-						$skipped_pages=true;
-						echo ".... ";
-					}
-					continue;
-				} else {
-					$skipped_pages=false;
-				}
-			}
-			if ($j * $paging == $start) {
-				echo '<strong>'.($j+1).'</strong>  ';
-			} else {
-				echo '<a href="'.getStringFromServer('PHP_SELF')."?func=browse&group_id=".$group_id.'&atid='.$ath->getID().'&set='. $set.'&start='.($j*$paging).'"><strong>'.($j+1).'</strong></a>  ';
-			}
-		}
-	}
-
-	/*
-		Mass Update Code
-	*/
-	if ($IS_ADMIN) {
-		echo '<script language="JavaScript" type="text/javascript">/* <![CDATA[ */
-	function checkAll(val) {
-		al=document.artifactList;
-		len = al.elements.length;
-		var i=0;
-		for( i=0 ; i<len ; i++) {
-			if (al.elements[i].name==\'artifact_id_list[]\') {
-				al.elements[i].checked=val;
-			}
-		}
-	}
-	/* ]]> */</script>
-
-			<table width="100%" border="0" id="admin_mass_update">
-			<tr><td colspan="2">
-
-<a href="javascript:checkAll(1)">'._('Check  all').'</a>
--
-  <a href="javascript:checkAll(0)">'._('Clear  all').'</a>
-
-<div class="important">'._('<strong>Admin:</strong> If you wish to apply changes to all items selected above, use these controls to change their properties and click once on "Mass Update".').'</div>
-			</td></tr>';
-
-		//
-		//	build custom fields
-		//
-	$ef = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELD_FILTER_INT));
-	$keys=array_keys($ef);
-
-	$sel=array();
-	for ($i=0; $i<count($keys); $i++) {
-		if (($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($ef[$keys[$i]]['field_type']==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {
-			$sel[$keys[$i]]=array('100');
-		} else {
-			$sel[$keys[$i]]='100';
-		}
-	}
-	$ath->renderExtraFields($sel,true,_('No Change'),false,'',array(ARTIFACT_EXTRAFIELD_FILTER_INT),true);
-		echo   '<tr>
-			<td><strong>'._('Priority').':</strong><br />';
-		echo build_priority_select_box ('priority', '100', true);
-		echo '</td><td>';
-
-		echo '</td>
-			</tr>
-
-			<tr>
-			<td><strong>'._('Assigned to').':</strong><br />'.
-				$ath->technicianBox ('assigned_to','100.1',true,_('Nobody'),'100.1',_('No Change')) .'</td>
-			<td>';
-		if (!$ath->usesCustomStatuses()) {
-		echo '<strong>'._('State').':</strong>
-				<br />'. $ath->statusBox ('status_id','xzxz',true,_('No Change'));
-		}
-		echo '</td>
-			</tr>
-
-			<tr><td colspan="2"><strong>'._('Canned Response').':</strong><br />'.
-				$ath->cannedResponseBox ('canned_response') .'</td></tr>
-
-			<tr><td colspan="3" align="center"><input type="submit" name="submit" value="'._('Mass update').'" /></td></tr>
-			</table>
-		</form>';
-	}
-
-	printf(_('* Denotes requests > %1$s Days Old'), ($ath->getDuePeriod()/86400));
-
-	if (in_array('priority', $browse_fields)) {
-		show_priority_colors_key();
-	}
-} else {
-	echo '<p class="warning_msg">'._('No items found').'</p>';
-	echo db_error();
-}
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/build_submission_form.php
===================================================================
--- trunk/src/www/tracker/build_submission_form.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/build_submission_form.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,126 +0,0 @@
-<?php
-/**
- * Generic Tracker facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems; 2005 GForge, LLC
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-require_once 'note.php';
-function artifact_submission_form($ath, $group) {
-	/*
-		Show the free-form text submitted by the project admin
-	*/
-	echo notepad_func();
-	echo $ath->renderSubmitInstructions();
-?>
-
-	<form id="trackeraddform" action="<?php echo getStringFromServer('PHP_SELF') . '?group_id='.$group->getID().'&atid='.$ath->getID(); ?>" method="post" enctype="multipart/form-data">
-	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-	<table>
-
-	<tr>
-		<td valign="top">
-	            <input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
-	            <input type="hidden" name="func" value="postadd" />
-	            <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-<?php
-	if (!session_loggedin()) {
-		echo '<div class="login_warning_msg">
-		<span class="warning_msg">'.sprintf(_('Please %1$s login %2$s'), '<a href="'.util_make_url ('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))).'">', '</a>').'</span><br /><br />
-		'._('If you <strong>cannot</strong> login, then enter your email address here').':<p>
-		<input type="text" name="user_email" size="50" maxlength="255" /></p>
-		</div>';
-	}
-?>
-		</td>
-	</tr>
-	<tr>
-		<td valign="top"><strong><?php echo _('For project'); ?></strong><br /><?php echo $group->getPublicName(); ?></td>
-		<td valign="top"><input type="submit" name="submit" value="<?php echo _('Submit'); ?>" /></td>
-	</tr>
-
-<?php
-	$ath->renderExtraFields(array(),true,'none',false,'Any',array(),false,'UPDATE');
-
-	if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
-		echo '<tr>
-		<td><strong>'._('Assigned to').':</strong><br />';
-		echo $ath->technicianBox('assigned_to');
-		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group->getID().'&atid='.$ath->getID().'&update_users=1', '('._('Admin').')' );
-
-		echo '</td><td><strong>'._('Priority').':</strong><br />';
-		build_priority_select_box('priority');
-		echo '</td></tr>';
-	}
-?>
-	<tr>
-		<td colspan="2"><strong><?php echo _('Summary'); echo utils_requiredField(); ?> :</strong><br />
-			<input id="tracker-summary" type="text" name="summary" size="80" maxlength="255" title="<?php echo util_html_secure(html_get_tooltip_description('summary')); ?>" />
-		</td>
-	</tr>
-
-	<tr>
-		<td colspan="2">
-			<strong> <?php echo _('Detailed description'); echo utils_requiredField(); ?> :</strong><?php notepad_button('document.forms.trackeraddform.details'); ?><br />
-			<textarea id="tracker-description" name="details" rows="20" cols="79" title="<?php echo util_html_secure(html_get_tooltip_description('description')); ?> "></textarea>
-		</td>
-	</tr>
-
-	<tr>
-		<td colspan="2">
-<?php
-	if (!session_loggedin()) {
-		echo '<div class="login_warning_msg">
-		<div class="error">'.sprintf(_('Please %1$s login %2$s'), '<a href="'.util_make_url ('/account/login.php?return_to='.urlencode(getStringFromServer('REQUEST_URI'))).'">', '</a>').'</div><br />
-		'._('If you <strong>cannot</strong> login, then enter your email address here').':<p>
-		<input type="text" name="user_email" size="30" maxlength="255" /></p>
-		</div>';
-	}
-?>
-
-		<p> </p>
-		<span class="veryimportant"><?php echo _('DO NOT enter passwords or confidential information in your message!'); ?></span>
-		</td>
-	</tr>
-
-	<tr>
-		<td colspan="2">
-		<div class="file_attachments">
-		<a href="javascript:help_window(\''. util_make_url ('/help/tracker.php?helpname=attach_file') .'\')"><strong>(?)</strong></a><br />
-		<p>
-		<strong><?php echo _('Attach Files'); ?> :</strong><br />
-		<input type="file" name="input_file0" size="30" /><br />
-		<input type="file" name="input_file1" size="30" /><br />
-		<input type="file" name="input_file2" size="30" /><br />
-		<input type="file" name="input_file3" size="30" /><br />
-		<input type="file" name="input_file4" size="30" /><br />
-		</p>
-		</div>
-		</td>
-	</tr>
-
-	<tr><td colspan="2">
-		<input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
-		</td>
-	</tr>
-
-	<tr><td colspan="2"><br/><?php  echo utils_requiredField(); echo _('Indicates required fields.'); ?></td></tr>
-	</table></form>
-<?php
-}
-?>

Deleted: trunk/src/www/tracker/deleteartifact.php
===================================================================
--- trunk/src/www/tracker/deleteartifact.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/deleteartifact.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,55 +0,0 @@
-<?php
-/**
- * FusionForge Project Management Facility
- *
- * Copyright 2002 GForge, LLC
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org/
- *
- */
-
-$ath->header(array ('title'=>_('Delete artifact').': [#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
-
-// $atid, $aid and $group_id are set in tracker.php
-
-?>
-
-<table>
-<tr>
-<td>
-<fieldset>
-<legend><?php echo _('Confirm Deletion'); ?></legend>
-<form action="<?php echo getStringFromServer('PHP_SELF')."?aid=$aid&group_id=$group_id"; ?>" method="post">
-<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
-<input type="hidden" name="func" value="postdeleteartifact" />
-<input type="hidden" name="atid" value="<?php echo $atid; ?>" />
-
-<table border="0" align="center">
-
-	<tr>
-		<td class="veryimportant"><?php echo _('Are you sure you want to delete this artifact?'); ?></td>
-	</tr>
-	<tr align="center">
-		<td align="center"><input type="checkbox" value="1" name="confirm_delete" /> <?php echo _('Yes, I want to delete this artifact'); ?></td>
-	</tr>
-	<tr>
-		<td style="text-align:center"><input type="submit" value="<?php echo _('Delete'); ?>" name="submit" /></td>
-	</tr>
-
-</table>
-</form>
-</fieldset>
-</td>
-</tr>
-</table>
-
-<?php
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/detail.php
===================================================================
--- trunk/src/www/tracker/detail.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/detail.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,192 +0,0 @@
-<?php
-/**
- * Tracker Detail
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-use_javascript('/tabber/tabber.js');
-
-if (getStringFromRequest('commentsort') == 'anti') {
-       $sort_comments_chronologically = false;
-} else {
-       $sort_comments_chronologically = true;
-}
-
-$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
-
-echo notepad_func();
-
-?>
-	<form id="trackerdetailform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" method="post" enctype="multipart/form-data">
-
-<?php if (session_loggedin()) { ?>
-	<table cellpadding="0" width="100%">
-		<tr>
-			<td>
-				<?php
-					if ($ah->isMonitoring()) {
-						$img="xmail16w.png";
-						$key="monitorstop";
-						$text=_('Stop monitor');
-					} else {
-						$img="mail16w.png";
-						$key="monitor";
-						$text=_('Monitor');
-					}
-					echo '
-					<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
-						html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
-					?>
-			</td>
-			<td>
-				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
-			</td>
-		</tr>
-	</table>
-<?php } ?>
-	<table border="0" width="80%">
-		<tr>
-			<td><strong><?php echo _('Date') ?>:</strong><br /><?php echo date( _('Y-m-d H:i'), $ah->getOpenDate() ); ?></td>
-			<td><strong><?php echo _('Priority') ?>:</strong><br /><?php echo $ah->getPriority(); ?></td>
-		</tr>
-
-		<tr>
-			<td><strong><?php echo _('State') ?>:</strong><br /><?php echo $ah->getStatusName(); ?></td>
-			<td></td>
-		</tr>
-		<tr>
-	        <td>
-			<strong><?php echo _('Submitted by') ?>:</strong><br />
-			<?php echo $ah->getSubmittedRealName();
-			if($ah->getSubmittedBy() != 100) {
-				$submittedUnixName = $ah->getSubmittedUnixName();
-				$submittedBy = $ah->getSubmittedBy();
-				?>
-				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
-			<?php } ?>
-			</td>
-			<td><strong><?php echo _('Assigned to') ?>:</strong><br />
-			<?php echo $ah->getAssignedRealName(); ?> (<?php echo $ah->getAssignedUnixName(); ?>)</td>
-		</tr>
-
-		<?php
-			$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'DISPLAY');
-			$ath->renderRelatedTasks($group, $ah);
-		?>
-
-		<tr><td colspan="2"><strong><?php echo _('Summary') ?>:</strong><br /><?php echo $ah->getSummary(); ?></td></tr>
-
-		<tr><td colspan="2">
-			<br />
-			<?php echo $ah->showDetails(); ?>
-		</td></tr>
-</table>
-<div id="tabber" class="tabber">
-<div class="tabbertab" title="<?php echo _('Followups'); ?>">
-	<table border="0" width="80%">
-		<tr><td colspan="2">
-			<?php if ($ath->allowsAnon() || session_loggedin()) { ?>
-			<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
-			<input type="hidden" name="func" value="postmod" />
-			<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-			<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
-			<p>
-			<strong><?php echo _('Add A Comment') ?>:</strong>
-			<?php echo notepad_button('document.forms.trackerdetailform.details') ?><br />
-			<textarea name="details" rows="10" cols="60"></textarea>
-			</p>
-			<?php } ?>
-		</td></tr>
-		<tr><td colspan="2">
-		<h2><?php echo _('Followups: ') ;
-		if ($sort_comments_chronologically) {
-			echo '<a href="' .
-			util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
-			'">' . _('Sort comments antichronologically') . '</a>';
-		} else {
-			echo '<a href="' .
-				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
-				'">' . _('Sort comments chronologically') . '</a>';
-		}
-		echo '</h2>';
-
-		echo $ah->showMessages($sort_comments_chronologically);
-		?>
-		</td></tr>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-	<?php if (session_loggedin() && ($ah->getSubmittedBy() == user_getid())) { ?>
-		<strong><?php echo _('Attach Files'); ?></strong><br />
-		<input type="file" name="input_file0" size="30" /><br />
-		<input type="file" name="input_file1" size="30" /><br />
-		<input type="file" name="input_file2" size="30" /><br />
-		<input type="file" name="input_file3" size="30" /><br />
-		<input type="file" name="input_file4" size="30" /><br />
-		<p />
-	<?php } ?>
-	<h2><?php echo _('Attached Files') ?>:</h2>
-	<?php
-	//
-	//  print a list of files attached to this Artifact
-	//
-		$ath->renderFiles($group_id, $ah);
-	?>
-	</td></tr>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>" >
-<table border="0" width="80%">
-<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
-	<?php
-		$hookParams['artifact_id'] = $aid;
-		$hookParams['group_id'] = $group_id;
-		plugin_hook("artifact_extra_detail",$hookParams);
-	?>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table border="0" width="80%">
-	<tr>
-	<td colspan="2">
-	<h2><?php echo _('Changes') ?>:</h2>
-	<?php
-	echo $ah->showHistory();
-	?>
-	</td>
-	</tr>
-</table>
-</div>
-<?php $ah->showRelations(); ?>
-</div>
-</form>
-<?php
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/include/ArtifactFileHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactFileHtml.class.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/include/ArtifactFileHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,56 +0,0 @@
-<?php
-/**
- *
- * SourceForge Generic Tracker facility
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2011, Franck Villaume - Capgemini
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/ArtifactFile.class.php';
-
-class ArtifactFileHtml extends ArtifactFile {
-
-	/**
-	 *  ArtifactFileHtml() - constructor
-	 *
-	 *  Use this constructor if you are modifying an existing artifact
-	 *
-	 *	@param $Artifact object
-	 *  @param $data associative array (all fields from artifact_file_user_vw) OR id from database
-	 *  @return true/false
-	 */
-	function ArtifactFileHtml(&$Artifact, $data=false) {
-		return $this->ArtifactFile($Artifact,$data);
-	}
-
-	function upload($input_file,$input_file_name,$input_file_type,$description) {
-		if (!util_check_fileupload($input_file)) {
-			$this->setError('ArtifactFile: Invalid filename');
-			return false;
-		}
-		$size = @filesize($input_file);
-		$input_data = fread(fopen($input_file, 'r'), $size);
-		return $this->create($input_file_name,$input_file_type,$size,$input_data,$description);
-	}
-
-}
-
-?>

Deleted: trunk/src/www/tracker/include/ArtifactHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactHtml.class.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/include/ArtifactHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,224 +0,0 @@
-<?php
-/**
- *
- * SourceForge Generic Tracker facility
- *
- * SourceForge: Breaking Down the Barriers to Open Source Development
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2011, Franck Villaume - Capgemini
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/Artifact.class.php';
-require_once $gfcommon.'include/utils_crossref.php';
-
-class ArtifactHtml extends Artifact {
-
-	/**
-	 *  ArtifactHtml() - constructor
-	 *
-	 *  Use this constructor if you are modifying an existing artifact
-	 *
-	 *  @param $ArtifactType object
-	 *  @param $artifact_id integer (primary key from database)
-	 *  @return true/false
-	 */
-	function ArtifactHtml(&$ArtifactType,$artifact_id=false) {
-		return $this->Artifact($ArtifactType,$artifact_id);
-	}
-
-	/**
-	 * show details preformatted (like followups)
-	 */
-	function showDetails($editable = false) {
-		$result = $this->getDetails();
-		$result = util_gen_cross_ref($result, $this->ArtifactType->Group->getID());
-		//$result = util_line_wrap( $result, 120,"\n");
-		$result = preg_replace('/\r|\n/', '<br />', $result);
-
-		$title_arr = array();
-		if ($editable === true) {
-			$title_arr[] = '<div style="width:100%;">' .
-				'<div style="float:left">' . _('Detailed description') . '</div>' .
-				'<div style="float:right">' . html_image('ic/forum_edit.gif','37','15',array('title'=>"Click to edit", 'alt'=>"Click to edit", 'onclick'=>"switch2edit(this, 'show', 'edit')")) . '</div>' .
-				'</div>';
-		}
-		else {
-			$title_arr[] = _('Detailed description');
-		}
-		echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-		echo '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle(0) .'><td>'. $result. '</td></tr>';
-
-		echo $GLOBALS['HTML']->listTableBottom();
-	}
-
-
-	function showMessages($asc=true) {
-		$result= $this->getMessages($asc);
-		$rows=db_numrows($result);
-
-		if ($rows > 0) {
-			$title_arr=array();
-			$title_arr[]=_('Message');
-
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			for ($i=0; $i < $rows; $i++) {
-				echo '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>';
-
-				$params = array('user_id' => db_result($result,$i,'user_id'), 'size' => 's');
-				plugin_hook("user_logo", $params);
-
-				echo _('Date').': '.
-					date(_('Y-m-d H:i'),db_result($result, $i, 'adddate')) .'<br />'.
-					_('Sender').': ';
-				if(db_result($result,$i,'user_id') == 100) {
-					echo db_result($result,$i,'realname');
-				} else {
-					echo util_make_link_u (db_result($result,$i,'user_name'),db_result($result,$i,'user_id'),db_result($result,$i,'realname'));
-				}
-
-				$text = db_result($result, $i, 'body');
-				$text = util_gen_cross_ref($text, $this->ArtifactType->Group->getID());
-				//$text = util_line_wrap( $text, 120,"\n");
-				$text = preg_replace('/\r?\n/', '<br />', $text);
-				echo "<br /><br />".$text.'</td></tr>';
-			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
-		} else {
-			echo '
-				<p>'._('No Followups Have Been Posted').'</p>';
-		}
-	}
-
-	function showHistory() {
-		global $artifact_cat_arr,$artifact_grp_arr,$artifact_res_arr;
-		$result=$this->getHistory();
-		$rows= db_numrows($result);
-
-		if ($rows > 0) {
-
-			$title_arr=array();
-			$title_arr[]=_('Field');
-			$title_arr[]=_('Old Value');
-			$title_arr[]=_('Date');
-			$title_arr[]=_('By');
-
-			echo $GLOBALS['HTML']->listTableTop ($title_arr);
-
-			$artifactType =& $this->getArtifactType();
-
-			for ($i=0; $i < $rows; $i++) {
-				$field=db_result($result, $i, 'field_name');
-				echo '
-				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'.$field.'</td><td>';
-
-				if ($field == 'status_id') {
-
-					echo $artifactType->getStatusName(db_result($result, $i, 'old_value'));
-
-				} else if ($field == 'assigned_to') {
-
-					echo user_getname(db_result($result, $i, 'old_value'));
-
-				} else if ($field == 'close_date') {
-					if (db_result($result, $i, 'old_value'))
-						echo date(_('Y-m-d H:i'),db_result($result, $i, 'old_value'));
-					else
-						echo '<i>None</i>';
-				} else {
-
-					echo db_result($result, $i, 'old_value');
-
-				}
-				echo '</td>'.
-					'<td>'. date(_('Y-m-d H:i'),db_result($result, $i, 'entrydate')) .'</td>'.
-					'<td>'. db_result($result, $i, 'user_name'). '</td></tr>';
-			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-
-		} else {
-			echo '
-			<p>'._('No Changes Have Been Made to This Item').'</p>';
-		}
-
-	}
-
-	function showRelations() {
-		$aid = $this->getID();
-
-		// Search for all relations pointing to this record.
-
-		$res = db_query_params ('SELECT *
-		FROM artifact_extra_field_list, artifact_extra_field_data, artifact_group_list, artifact, groups
-		WHERE field_type=9
-		AND artifact_extra_field_list.extra_field_id=artifact_extra_field_data.extra_field_id
-		AND artifact_group_list.group_artifact_id = artifact_extra_field_list.group_artifact_id
-		AND artifact.artifact_id = artifact_extra_field_data.artifact_id
-		AND groups.group_id = artifact_group_list.group_id
-		AND (field_data = $1 OR field_data LIKE $2 OR field_data LIKE $3 OR field_data LIKE $4)
-		ORDER BY artifact_group_list.group_id ASC, name ASC, artifact.artifact_id ASC',
-					array($aid,
-					      "$aid %",
-					      "% $aid %",
-					      "% $aid"));
-		if (db_numrows($res)>0) {
-			?>
-<div class="tabbertab" title="<?php echo _('Backward Relations'); ?>">
-<table border="0" width="80%">
-	<tr>
-		<td colspan="2">
-		<h2><?php echo _('Changes') ?>:</h2>
-		<?php
-		$current = '';
-		$end = '';
-		while ($arr = db_fetch_array($res)) {
-			$title = $arr['group_name'].': '.$arr['name'];
-			if ($title != $current) {
-				echo $end.'<strong>'.$title.'</strong>';
-				$current = $title;
-				$end = '<br /><br />';
-			}
-			$text = '[#'.$arr['artifact_id'].']';
-			$url = '/tracker/?func=detail&aid='.$arr['artifact_id'].'&group_id='.$arr['group_id'].'&atid='.$arr['group_artifact_id'];
-			$arg = 'title="'.util_html_secure($arr['summary']).'"' ;
-			if ($arr['status_id'] == 2) {
-				$arg .= 'class="artifact_closed"';
-			}
-			print '<br/>   <a href="'.$url.'" '.$arg.'>'.$text.'</a>'.' <a href="'.$url.'">'.$arr['summary'].'</a> <i>(Relation: '.$arr['field_name'].')</i>';
-		}
-		?></td>
-	</tr>
-</table>
-</div>
-<?php
-		}
-	}
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/include/ArtifactTypeFactoryHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactTypeFactoryHtml.class.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/include/ArtifactTypeFactoryHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,85 +0,0 @@
-<?php
-/**
- * FusionForge Generic Tracker facility
- *
- * Copyright 2011 (C) Alain Peyrat, Alcatel-Lucent
- * Copyright 2011, Franck Villaume - Capgemini
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/ArtifactType.class.php';
-require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
-require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
-require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
-require_once $gfcommon.'include/utils_crossref.php';
-
-class ArtifactTypeFactoryHtml extends ArtifactTypeFactory {
-	function header($params=array()) {
-		global $HTML;
-
-		if (!forge_get_config('use_tracker')) {
-			exit_disabled();
-		}
-
-		$group_id= $this->Group->getID();
-
-		$params['group']=$group_id;
-		if (!isset($params['title'])) {
-			$params['title']=sprintf(_('Trackers for %1$s'), $this->Group->getPublicName());
-		}
-		$params['toptab']='tracker';
-
-		$labels = array(_('View Trackers'));
-		$links  = array('/tracker/?group_id='.$group_id);
-		$attr   = array(array('title' => _('Get the list of available trackers'), 'class' => 'tabtitle-nw'));
-		if (session_loggedin()) {
-			$labels[] = _('Reporting');
-			$links[]  = '/tracker/reporting/?group_id='.$group_id;
-			$attr[]   = array('title' => _('Various graph of statistics.'), 'class' => 'tabtitle');
-			$perm = $this->Group->getPermission(session_get_user());
-			if ($perm && is_object($perm) && !$perm->isError() && $perm->isPMAdmin()) {
-				$labels[] = _('Administration');
-				$links[]  = '/tracker/admin/?group_id='.$group_id;
-				$attr[]   = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle');
-			}
-		}
-
-		$params['submenu'] = $HTML->subMenu($labels, $links, $attr);
-
-		site_project_header($params);
-	}
-
-	function footer($params=array()) {
-		site_project_footer($params);
-	}
-
-//     function adminHeader($params=array()) {
-//             return $this->header($params);
-//     }
-//
-//     function adminFooter($params=array()) {
-//             return $this->footer($params);
-//     }
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/include/ArtifactTypeHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactTypeHtml.class.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/include/ArtifactTypeHtml.class.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,725 +0,0 @@
-<?php
-/**
- * FusionForge Generic Tracker facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems - Sourceforge
- * Copyright 2010 (c) Fusionforge Team
- * Copyright 2011, Franck Villaume - Capgemini
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/ArtifactType.class.php';
-require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
-require_once $gfcommon.'tracker/ArtifactExtraFieldElement.class.php';
-require_once $gfcommon.'tracker/ArtifactWorkflow.class.php';
-require_once $gfcommon.'include/utils_crossref.php';
-
-class ArtifactTypeHtml extends ArtifactType {
-
-	/**
-	 *  ArtifactType() - constructor
-	 *
-	 *  @param $group object
-	 *  @param $artifact_type_id - the id # assigned to this artifact type in the db
-	 */
-	function ArtifactTypeHtml(&$group,$artifact_type_id=false, $arr=false) {
-		return $this->ArtifactType($group,$artifact_type_id,$arr);
-	}
-
-	function header($params) {
-		global $HTML;
-		if (!forge_get_config('use_tracker')) {
-			exit_disabled();
-		}
-		$group_id= $this->Group->getID();
-
-		//required by new site_project_header
-		$params['group']=$group_id;
-		$params['toptab']='tracker';
-		$params['tabtext']=$this->getName();
-
-		$labels = array();
-		$links  = array();
-		$attr   = array();
-
-		$labels[] = _("View Trackers");
-		$links[]  = '/tracker/?group_id='.$group_id;
-		$attr[]   = array('title' => _('Get the list of available trackers'), 'class' => 'tabtitle-nw');
-		$labels[] = $this->getName();
-		$links[]  = '/tracker/?func=browse&group_id='.$group_id.'&atid='. $this->getID();
-		$attr[]   = array('title' => _('Browse this tracker.'), 'class' => 'tabtitle');
-		$labels[] = _('Download .csv');
-		$links[]  = '/tracker/?func=downloadcsv&group_id='.$group_id.'&atid='. $this->getID();
-		$attr[]   = array('title' => _('Download data from this tracker as csv file.'), 'class' => 'tabtitle');
-		if ($this->allowsAnon() || session_loggedin()) {
-			$labels[] = _('Submit New');
-			$links[]  = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
-			$attr[]   = array('title' => _('Add a new issue.'), 'class' => 'tabtitle');
-		}
-
-		if (session_loggedin()) {
-			$labels[] = _('Reporting');
-			$links[]  = '/tracker/reporting/?group_id='.$group_id.'&atid='. $this->getID();
-			$attr[]   = array('title' => _('Various graph about statistics.'), 'class' => 'tabtitle');
-			if ($this->isMonitoring()) {
-				$labels[] = _('Stop Monitor');
-				$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&stop=1';
-				$attr[]   = array('title' => _('Remove this tracker from your monitoring.'), 'class' => 'tabtitle');
-			} else {
-				$labels[] = _('Monitor');
-				$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
-				$attr[]   = array('title' => _('Add this tracker from your monitoring.'), 'class' => 'tabtitle');
-			}
-
-			if (forge_check_perm ('tracker', $this->getID(), 'manager')) {
-				$labels[] = _('Administration');
-				$links[]  = '/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID();
-				$attr[]   = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle');
-			}
-		} else {
-			$labels[] = _('Monitor');
-			$links[]  = '/tracker/?group_id='.$group_id.'&atid='. $this->getID().'&func=monitor&start=1';
-			$attr[]   = array('title' => _('Add this tracker from your monitoring.'), 'class' => 'tabtitle');
-		}
-
-		$params['submenu'] = $HTML->subMenu($labels, $links, $attr);
-		site_project_header($params);
-
-		if ($this)
-			plugin_hook("blocks", "tracker_".$this->getName());
-
-	}
-
-	function footer($params) {
-		site_project_footer($params);
-	}
-
-	function adminHeader($params) {
-		global $HTML;
-		$this->header($params);
-		$group_id= $this->Group->getID();
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id;
-		$title_arr[]=_('New Tracker');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&update_type=1';
-		$title_arr[]=_('Update Settings');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_extrafield=1';
-		$title_arr[]=_('Manage Custom Fields');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&workflow=1';
-		$title_arr[]=_('Manage Workflow');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&customize_list=1';
-		$title_arr[]=_('Customize List');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&add_canned=1';
-		$title_arr[]=_('Add/Update Canned Responses');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&clone_tracker=1';
-		$title_arr[]=_('Clone Tracker');
-
-		$links_arr[]='/tracker/admin/?group_id='.$group_id.'&atid='.$this->getID().'&delete=1';
-		$title_arr[]=_('Delete');
-
-		echo $HTML->printSubMenu($title_arr, $links_arr, false);
-	}
-
-	function adminFooter($params) {
-		echo $this->footer($params);
-	}
-
-	function renderSubmitInstructions() {
-		$msg = $this->getSubmitInstructions();
-		return str_replace("\n","<br />", $msg);
-	}
-
-	function renderBrowseInstructions() {
-		$msg = $this->getBrowseInstructions();
-		return str_replace("\n","<br />", $msg);
-	}
-
-	function renderExtraFields($selected=array(),$show_100=false,$text_100='none',$show_any=false,$text_any='Any',$types=array(),$status_show_100=false,$mode='') {
-		$efarr = $this->getExtraFields($types);
-		//each two columns, we'll reset this and start a new row
-
-		$template = $this->getRenderHTML($types, $mode);
-
-		if ($mode=='QUERY') {
-			$keys=array_keys($efarr);
-			for ($k=0; $k<count($keys); $k++) {
-				$i=$keys[$k];
-				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
-					$efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_MULTISELECT;
-				} else {
-					$efarr[$i]['field_type'] = ARTIFACT_EXTRAFIELDTYPE_TEXT;
-				}
-			}
-		}
-
-		// 'DISPLAY' mode is for renderding in 'read-only' mode (for detail view).
-		if ($mode === 'DISPLAY') {
-			$keys=array_keys($efarr);
-			for ($k=0; $k<count($keys); $k++) {
-				$i=$keys[$k];
-
-				if (!isset($selected[$efarr[$i]['extra_field_id']]))
-					$selected[$efarr[$i]['extra_field_id']] = '';
-
-				$value = @$selected[$efarr[$i]['extra_field_id']];
-
-				if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
-					if ($value == 100) {
-						$value = 'None';
-					} else {
-						$arr = $this->getExtraFieldElements($efarr[$i]['extra_field_id']);
-
-						// Convert the values (ids) to names in the ids order.
-						$new = array();
-						for ($j=0; $j<count($arr); $j++) {
-							if (is_array($value)) {
-								if (in_array($arr[$j]['element_id'],$value))
-									$new[]= $arr[$j]['element_name'];
-							} elseif ($arr[$j]['element_id'] === $value) {
-									$new[] = $arr[$j]['element_name'];
-							}
-						}
-						$value = join('<br />', $new);
-					}
-				} else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
-					$value = preg_replace('/((http|https|ftp):\/\/\S+)/',
-								"<a href=\"\\1\" target=\"_blank\">\\1</a>", $value);
-				} else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
-					// Convert artifact id to links.
-					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
-				}
-				$template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
-				$template = str_replace('{$'.$efarr[$i]['field_name'].'}',$value,$template);
-			}
-			echo $template;
-			return ;
-		}
-
-		$keys=array_keys($efarr);
-		for ($k=0; $k<count($keys); $k++) {
-			$i=$keys[$k];
-			$post_name = '';
-
-			if (!isset($selected[$efarr[$i]['extra_field_id']]))
-				$selected[$efarr[$i]['extra_field_id']] = '';
-
-			if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
-				$str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
-
-				$str = $this->renderCheckbox($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
-
-				$str = $this->renderRadio($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
-					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
-
-				$str = $this->renderTextField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
-				if ($mode == 'QUERY') {
-					$post_name =  ' <i>'._('(%% for wildcards)').'</i>   ';
-				}
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
-
-				$str = $this->renderTextArea($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
-				if ($mode == 'QUERY') {
-					$post_name =  ' <i>'._('(%% for wildcards)').'</i>   ';
-				}
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
-
-				$str = $this->renderMultiSelectBox ($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100);
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
-
-				// Get the allowed values from the workflow.
-				$atw = new ArtifactWorkflow($this, $efarr[$i]['extra_field_id']);
-
-				// Special treatement for the initial step (Submit).
-				// In this case, the initial value is the first value.
-				if ($selected === true) {
-					$selected_node = 100;
-				} elseif (isset($selected[$efarr[$i]['extra_field_id']]) && $selected[$efarr[$i]['extra_field_id']]) {
-					$selected_node = $selected[$efarr[$i]['extra_field_id']];
-				} else {
-					$selected_node = 100;
-				}
-
-				$allowed = $atw->getNextNodes($selected_node);
-				$allowed[] = $selected_node;
-				$str = $this->renderSelect($efarr[$i]['extra_field_id'],$selected_node,$status_show_100,$text_100,$show_any,$text_any, $allowed);
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
-
-				$str = $this->renderRelationField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
-				if ($mode == 'UPDATE') {
-					$post_name = html_image('ic/forum_edit.gif','37','15',array('title'=>"Click to edit", 'alt'=>"Click to edit", 'onclick'=>"switch2edit(this, 'show$i', 'edit$i')"));
-				}
-			}
-			$template = str_replace('{$PostName:'.$efarr[$i]['field_name'].'}',$post_name,$template);
-			$template = str_replace('{$'.$efarr[$i]['field_name'].'}',$str,$template);
-		}
-		if($template != NULL){
-			echo $template;
-		}
-	}
-
-	function renderRelatedTasks($group, $ah) {
-
-		if (!$group->usesPM()) {
-			return '';
-		}
-
-		$taskcount = db_numrows($ah->getRelatedTasks());
-
-		if (forge_check_perm ('tracker_admin', $ah->ArtifactType->Group->getID())) {
-			$is_admin=false;
-		} else {
-			$is_admin=true;
-		}
-
-		$totalPercentage = 0;
-
-		if ($taskcount > 0) {
-			echo '<tr><td colspan="2">';
-			echo '<b>'._("Related Tasks").':</b>'.'<br/>';
-			$title_arr = array();
-			$title_arr[] = _('Task Id');
-			$title_arr[] = _('Task Summary');
-			$title_arr[] = _('Start Date');
-			$title_arr[] = _('End Date');
-			$title_arr[] = _('Status');
-			(($is_admin) ? $title_arr[]=_('Remove Relation') : '');
-			echo $GLOBALS['HTML']->listTableTop($title_arr);
-
-			echo '<table cellspacing="0">';
-			for ($i = 0; $i < $taskcount; $i++) {
-				$taskinfo  = db_fetch_array($ah->relatedtasks, $i);
-				$totalPercentage += $taskinfo['percent_complete'];
-				$taskid    = $taskinfo['project_task_id'];
-				$projectid = $taskinfo['group_project_id'];
-				$groupid   = $taskinfo['group_id'];
-				$summary   = util_unconvert_htmlspecialchars($taskinfo['summary']);
-				$startdate = date(_('Y-m-d H:i'), $taskinfo['start_date']);
-				$enddate   = date(_('Y-m-d H:i'), $taskinfo['end_date']);
-				$status   = $taskinfo['status_name'];
-				echo '<tr>
-						<td><a href="/pm/task.php?func=detailtask&project_task_id='.$taskid.
-						'&group_id='.$groupid.'&group_project_id='.$projectid.'">[T'.$taskid.'] '.$summary.'</a></td>
-						<td>'.$startdate.'</td>
-						<td>'.$enddate.'</td>
-						<td>'.$status.' ('.$taskinfo['percent_complete'].'%)</td>'.
-					(($is_admin) ? '<td><input type="checkbox" name="remlink[]" value="'.$taskid.'" /></td>' : '').
-					'</tr>';
-			}
-			echo $GLOBALS['HTML']->listTableBottom();
-
-			echo "\n<hr /><p style=\"text-align:right;\">";
-			printf(_('Average completion rate: %d%%'), (int)($totalPercentage/$taskcount));
-			echo "</p>\n";			echo '</td></tr>';
-		}
-	}
-
-	function renderFiles($group_id, $ah) {
-
-		$file_list =& $ah->getFiles();
-		$count=count($file_list);
-
-		if ($count > 0) {
-			echo '<tr><td colspan="2">';
-			echo '<b>'._("Attachments").':</b>'.'<br/>';
-			$title_arr=array();
-			$title_arr[] = _('Size');
-			$title_arr[] = _('Name');
-			$title_arr[] = _('Date');
-			$title_arr[] = _('By');
-			$title_arr[] = _('Download');
-			echo $GLOBALS['HTML']->listTableTop($title_arr);
-
-			foreach ($file_list as $file) {
-				echo '<tr>';
-				echo '<td>'.human_readable_bytes($file->getSize()).'</td>';
-				echo '<td>'.htmlspecialchars($file->getName()).'</td>';
-				echo '<td>'.date(_('Y-m-d H:i'), $file->getDate()).'</td>';
-				echo '<td>'.$file->getSubmittedUnixName().'</td>';
-				echo '<td><a href="/tracker/download.php/'.$group_id.'/'. $this->getID().'/'. $ah->getID() .'/'.$file->getID().'/'.$file->getName() .'">'. htmlspecialchars($file->getName()) .'</a></td>';
-//				<td><input type="checkbox" name="delete_file[]" value="'. $file->getID() .'">'._("Delete").' </td>
-				echo '</tr>';
-			}
-
-			echo $GLOBALS['HTML']->listTableBottom();
-			echo '</td></tr>';
-		}
-	}
-
-	/**
-	 *	getRenderHTML
-	 *
-	 *	@return	string	HTML template.
-	 */
-	function getRenderHTML($types=array(), $mode='') {
-		// Use template only for the browse (not for query or mass update)
-		if (($mode === 'DISPLAY' || $mode === 'DETAIL' || $mode === 'UPDATE')
-			&& $this->data_array['custom_renderer']) {
-			return preg_replace('/<!--(\S+.*?)-->/','{$\\1}',$this->data_array['custom_renderer']);
-		} else {
-			return $this->generateRenderHTML($types, $mode);
-		}
-	}
-
-	/**
-	 *	generateRenderHTML
-	 *
-	 *	@return	string	HTML template.
-	 */
-	function generateRenderHTML($types=array(), $mode) {
-		$efarr = $this->getExtraFields($types);
-		//each two columns, we'll reset this and start a new row
-
-		$return = '
-			<!-- Start Extra Fields Rendering -->
-			<tr>';
-		$col_count=0;
-
-		$keys=array_keys($efarr);
-		$count=count($keys);
-		if ($count == 0) return '';
-
-		for ($k=0; $k<$count; $k++) {
-			$i=$keys[$k];
-
-			// Do not show the required star in query mode (creating/updating a query).
-			$is_required = ($mode == 'QUERY' || $mode == 'DISPLAY') ?	0 : $efarr[$i]['is_required'];
-			$name = $efarr[$i]['field_name'].($is_required ? utils_requiredField() : '').': ';
-			$name = '<strong>'.$name.'</strong>';
-
-			if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_SELECT) {
-
-				$return .= '
-					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) {
-
-				$return .= '
-					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RADIO) {
-
-				$return .= '
-					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
-				$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
-
-				//text fields might be really wide, so need a row to themselves.
-				if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
-					$colspan=2;
-					$return .= '
-					<td> </td>
-			</tr>
-			<tr>';
-				} else {
-					$colspan=1;
-				}
-				$return .= '
-					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
-
-				//text areas might be really wide, so need a row to themselves.
-				if (($col_count == 1) && ($efarr[$i]['attribute2'] > 30)) {
-					$colspan=2;
-					$return .= '
-					<td> </td>
-			</tr>
-			<tr>';
-				} else {
-					$colspan=1;
-				}
-				$return .= '
-					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
-
-				$return .= '
-					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_STATUS) {
-
-				$return .= '
-					<td width="50%" valign="top">'.$name.'<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
-
-				//text fields might be really wide, so need a row to themselves.
-				if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
-					$colspan=2;
-					$return .= '
-					<td> </td>
-			</tr>
-			<tr>';
-				} else {
-					$colspan=1;
-				}
-				$return .= '
-					<td width="'.(50*$colspan).'%" colspan="'.$colspan.'" valign="top">'.$name.'{$PostName:'.$efarr[$i]['field_name'].'}<br />{$'.$efarr[$i]['field_name'].'}</td>';
-
-			}
-			$col_count++;
-			//we've done two columns - if there are more to do, start a new row
-			if (($col_count == 2) && ($k != $count-1)) {
-				$col_count = 0;
-				$return .= '
-			</tr>
-			<tr>';
-			}
-		}
-		if ($col_count == 1) {
-			$return .= '
-					<td> </td>';
-		}
-		$return .= '
-			</tr>
-			<!-- End Extra Fields Rendering -->';
-		return $return;
-	}
-
-	/**
-	 *	renderSelect - this function builds pop up
-	 *	box with choices.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		string	The item that should be checked
-	 *	@param		string	Whether to show the '100 row'
-	 *	@param		string	What to call the '100 row'
-	 *	@return		box and choices
-	 */
-	function renderSelect ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any', $allowed=false) {
-		if ($text_100 == 'none'){
-			$text_100=_('None');
-		}
-		$arr = $this->getExtraFieldElements($extra_field_id);
-		$keys = array();
-		$vals = array();
-		for ($i=0; $i<count($arr); $i++) {
-			$keys[$i]=$arr[$i]['element_id'];
-			$vals[$i]=$arr[$i]['element_name'];
-		}
-		return html_build_select_box_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any, $allowed);
-	}
-
-	/**
-	 *	renderRadio - this function builds radio buttons.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		string	The item that should be checked
-	 *	@param		string	Whether to show the '100 row'
-	 *	@param		string	What to call the '100 row'
-	 *	@return		radio buttons
-	 */
-	function renderRadio ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any') {
-		$arr = $this->getExtraFieldElements($extra_field_id);
-		$keys = array();
-		$vals = array();
-		for ($i=0; $i<count($arr); $i++) {
-			$keys[$i]=$arr[$i]['element_id'];
-			$vals[$i]=$arr[$i]['element_name'];
-		}
-		return html_build_radio_buttons_from_arrays ($keys,$vals,'extra_fields['.$extra_field_id.']',$checked,$show_100,$text_100,$show_any,$text_any);
-	}
-
-	/**
-	 *	renderCheckbox - this function builds checkboxes.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		array	The items that should be checked
-	 *	@param		string	Whether to show the '100 row'
-	 *	@param		string	What to call the '100 row'
-	 *	@return		radio buttons
-	 */
-	function renderCheckbox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
-		if ($text_100 == 'none'){
-			$text_100=_('None');
-		}
-		if (!$checked || !is_array($checked)) {
-			$checked=array();
-		}
-		$arr = $this->getExtraFieldElements($extra_field_id);
-		$return = '';
-		if ($show_100) {
-			$return .= '
-				<input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="100" '.
-			((in_array(100,$checked)) ? 'checked="checked"' : '').'/> '.$text_100.'<br />';
-		}
-		for ($i=0; $i<count($arr); $i++) {
-			$return .= '
-				<input type="checkbox" name="extra_fields['.$extra_field_id.'][]" value="'.$arr[$i]['element_id'].'" '.
-			((in_array($arr[$i]['element_id'],$checked)) ? 'checked="checked"' : '').'/> '.$arr[$i]['element_name'].'<br />';
-		}
-		return $return;
-	}
-
-	/**
-	 *	renderMultiSelectBox - this function builds checkboxes.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		array	The items that should be checked
-	 *	@param		string	Whether to show the '100 row'
-	 *	@param		string	What to call the '100 row'
-	 *	@return		radio multiselectbox
-	 */
-	function renderMultiSelectBox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
-		$arr =$this->getExtraFieldElements($extra_field_id);
-		if (!$checked) {
-			$checked=array();
-		}
-		if (!is_array($checked)) {
-			$checked = explode(',',$checked);
-		}
-		$keys=array();
-		$vals=array();
-		$arr = $this->getExtraFieldElements($extra_field_id);
-		for ($i=0; $i<count($arr); $i++) {
-			$keys[]=$arr[$i]['element_id'];
-			$vals[]=$arr[$i]['element_name'];
-		}
-		$size = min( count($arr)+1, 15);
-			return html_build_multiple_select_box_from_arrays($keys,$vals,"extra_fields[$extra_field_id][]",$checked,$size,$show_100,$text_100);
-	}
-
-	/**
-	 *	renderTextField - this function builds a text field.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		string	The data for this field.
-	 *	@return		text area and data.
-	 */
-	function renderTextField ($extra_field_id,$contents,$size,$maxlength) {
-		return '
-			<input type="text" name="extra_fields['.$extra_field_id.']" value="'.$contents.'" size="'.$size.'" maxlength="'.$maxlength.'"/>';
-	}
-
-	/**
-	 *	renderRelationField - this function builds a relation field.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		string	The data for this field.
-	 *	@return		text area and data.
-	 */
-	function renderRelationField ($extra_field_id,$contents,$size,$maxlength) {
-		$arr = $this->getExtraFieldElements($extra_field_id);
-		for ($i=0; $i<count($arr); $i++) {
-			$keys[$i]=$arr[$i]['element_id'];
-			$vals[$i]=$arr[$i]['element_name'];
-		}
-		// Convert artifact id to links.
-		$html_contents = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1','title')", $contents);
-		$edit_contents = $this->renderTextField ($extra_field_id,$contents,$size,$maxlength);
-		$edit_tips = '<br/><span class="tips">'._('Tip: Enter a space-separated list of artifact ids ([#NNN] also accepted)').'</span>';
-		return '
-			<div id="edit'.$extra_field_id.'" style="display: none;">'.$edit_contents.$edit_tips.'</div>
-			<div id="show'.$extra_field_id.'" style="display: block;">'.$html_contents.'</div>';
-	}
-
-	/**
-	 *	renderTextArea - this function builds a text area.
-	 *
-	 *	@param		int 	The ID of this field.
-	 *	@param 		string	The data for this field.
-	 *	@return		text area and data.
-	 */
-	function renderTextArea ($extra_field_id,$contents,$rows,$cols) {
-		return '
-			<textarea name="extra_fields['.$extra_field_id.']" rows="'.$rows.'" cols="'.$cols.'">'.$contents.'</textarea>';
-	}
-
-	function technicianBox ($name='assigned_to[]',$checked='xzxz',$show_100=true,$text_100='none',$extra_id='-1',$extra_name='',$multiple=false) {
-		if ($text_100=='none'){
-			$text_100=_('Nobody');
-		}
-
-		$engine = RBACEngine::getInstance () ;
-		$techs = $engine->getUsersByAllowedAction ('tracker', $this->getID(), 'tech') ;
-
-		$ids = array () ;
-		$names = array () ;
-
-		foreach ($techs as $tech) {
-			$ids[] = $tech->getID() ;
-			$names[] = $tech->getRealName() ;
-		}
-
-		if ($extra_id != '-1') {
-			$ids[]=$extra_id;
-			$names[]=$extra_name;
-		}
-
-		if ($multiple) {
-			if (!is_array($checked)) {
-				$checked = explode(',',$checked);
-			}
-			$size = min( count($ids)+1, 15);
-			return html_build_multiple_select_box_from_arrays ($ids,$names,$name,$checked,$size,$show_100,$text_100);
-		} else {
-			return html_build_select_box_from_arrays ($ids,$names,$name,$checked,$show_100,$text_100);
-		}
-	}
-
-	function cannedResponseBox ($name='canned_response',$checked='xzxz') {
-		return html_build_select_box ($this->getCannedResponses(),$name,$checked);
-	}
-
-	/**
-	 *	statusBox - show the statuses - automatically shows the "custom statuses" if they exist
-	 *
-	 *
-	 */
-	function statusBox ($name='status_id',$checked='xzxz',$show_100=false,$text_100='none') {
-		if ($text_100=='none'){
-			$text_100=_('None');
-		}
-		return html_build_select_box($this->getStatuses(),$name,$checked,$show_100,$text_100);
-	}
-
-}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/ind.php
===================================================================
--- trunk/src/www/tracker/ind.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/ind.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,101 +0,0 @@
-<?php
-/**
- * Tracker Front Page
- *
- * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-$atf = new ArtifactTypeFactory($group);
-if (!$group || !is_object($group) || $group->isError()) {
-	exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
-}
-
-$at_arr = $atf->getArtifactTypes();
-if ($at_arr === false) {
-	exit_permission_denied('tracker');
-}
-
-use_javascript('/js/sortable.js');
-
-//required params for site_project_header();
-$params['group']=$group_id;
-$params['title']=sprintf(_('Trackers for %1$s'), $group->getPublicName());
-$params['toptab']='tracker';
-
-site_project_header($params);
-
-if (forge_check_perm('tracker_admin', $group_id)) {
-	$menu_text = array();
-	$menu_links = array();
-	$menu_text[] = _('Administration');
-	$menu_links[] = '/tracker/admin/?group_id='.$group_id;
-	$menu_attr[] = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle-nw');
-	echo $HTML->subMenu($menu_text, $menu_links, $menu_attr);
-}
-
-
-if (!$at_arr || count($at_arr) < 1) {
-	echo '<div class="warning">'._('No Accessible Trackers Found').'</div>';
-	printf(_('<p><strong>No trackers have been set up, or you cannot view them.</strong></p><p><span class="important">The Admin for this project will have to set up data types using the %1$s admin page %2$s</span></p>'), '<a href="'.util_make_url ('/tracker/admin/?group_id='.$group_id).'">', '</a>');
-} else {
-
-	plugin_hook ("blocks", "tracker index");
-
-	echo '<p>'._('Choose a tracker and you can browse/edit/add items to it.').'</p>';
-
-	/*
-		Put the result set (list of trackers for this group) into a column with folders
-	*/
-	$tablearr = array(_('Tracker'),_('Description'),_('Open'),_('Total'));
-
-	echo $HTML->listTableTop($tablearr, false, 'sortable_table_tracker', 'sortable_table_tracker');
-
-	for ($j = 0; $j < count($at_arr); $j++) {
-		if (!is_object($at_arr[$j])) {
-			//just skip it
-		} elseif ($at_arr[$j]->isError()) {
-			echo $at_arr[$j]->getErrorMessage();
-		} else {
-			echo '
-		<tr>
-			<td><a href="'.util_make_url ('/tracker/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id.'&func=browse').'">'.
- 				html_image("ic/tracker20w.png","20","20").'  '.
-				$at_arr[$j]->getName() .'</a>
-			</td>
-			<td>' .  $at_arr[$j]->getDescription() .'
-			</td>
-			<td style="text-align:center">'. (int) $at_arr[$j]->getOpenCount() . '
-			</td>
-			<td style="text-align:center">'. (int) $at_arr[$j]->getTotalCount() .'
-			</td>
-		</tr>';
-		}
-	}
-	echo $HTML->listTableBottom();
-}
-
-site_project_footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Modified: trunk/src/www/tracker/index.php
===================================================================
--- trunk/src/www/tracker/index.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/index.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -28,10 +28,10 @@
 require_once $gfwww.'include/note.php';
 require_once $gfcommon.'tracker/Artifact.class.php';
 require_once $gfcommon.'tracker/ArtifactFile.class.php';
-require_once $gfwww.'tracker/include/ArtifactFileHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactFileHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactType.class.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
-require_once $gfwww.'tracker/include/ArtifactHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactHtml.class.php';
 require_once $gfcommon.'tracker/ArtifactCanned.class.php';
 require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
 
@@ -69,10 +69,10 @@
 }
 
 if ($group_id && $atid) {
-	include $gfwww.'tracker/tracker.php';
+	include $gfcommon.'tracker/actions/tracker.php';
 
 } elseif ($group_id) {
-	include $gfwww.'tracker/ind.php';
+	include $gfcommon.'tracker/actions/ind.php';
 
 }
 

Deleted: trunk/src/www/tracker/mod-limited.php
===================================================================
--- trunk/src/www/tracker/mod-limited.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/mod-limited.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,226 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-use_javascript('/tabber/tabber.js');
-
-if (getStringFromRequest('commentsort') == 'anti') {
-       $sort_comments_chronologically = false;
-} else {
-       $sort_comments_chronologically = true;
-}
-
-$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
-
-echo notepad_func();
-
-?>
-	<h1>[#<?php echo $ah->getID(); ?>] <?php echo $ah->getSummary(); ?></h1>
-
-	<form id="trackermodlimitedform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>" enctype="multipart/form-data" method="post">
-	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
-	<input type="hidden" name="func" value="postmod" />
-	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
-
-	<table width="80%">
-<?php
-if (session_loggedin()) {
-?>
-		<tr>
-			<td><?php
-				if ($ah->isMonitoring()) {
-					$img="xmail16w.png";
-					$key="monitorstop";
-					$text=_('Stop monitor');
-				} else {
-					$img="mail16w.png";
-					$key="monitor";
-					$text=_('Monitor');
-				}
-				echo '
-				<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
-					html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
-				?>
-			</td>
-			<td><?php
-				if ($group->usesPM()) {
-					echo '
-				<a href="'.getStringFromServer('PHP_SELF').'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'">'.
-					html_image('ic/taskman20w.png','20','20').'<strong>'._('Build Task Relation').'</strong></a>';
-				}
-				?>
-			</td>
-			<td>
-				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
-			</td>
-		</tr>
-</table>
-<p/>
-<?php } ?>
-<table border="0" width="80%">
-	<tr>
-		<td><strong><?php echo _('Submitted by') ?>:</strong><br />
-			<?php
-			echo $ah->getSubmittedRealName();
-			if($ah->getSubmittedBy() != 100) {
-				$submittedUnixName = $ah->getSubmittedUnixName();
-				$submittedBy = $ah->getSubmittedBy();
-				?>
-				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
-			<?php } ?>
-		</td>
-		<td><strong><?php echo _('Date Submitted') ?>:</strong><br />
-		<?php
-		echo date(_('Y-m-d H:i'), $ah->getOpenDate() );
-
-		$close_date = $ah->getCloseDate();
-		if ($ah->getStatusID()==2 && $close_date > 1) {
-			echo '<br /><strong>'._('Date Closed').':</strong><br />'
-				 .date(_('Y-m-d H:i'), $close_date);
-		}
-		?>
-		</td>
-	</tr>
-
-    <?php
-		$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'UPDATE');
-		?>
-
-	<tr>
-		<td><strong><?php echo _('Assigned to')?>:</strong><br />
-		<span id="tracker-assigned_to" title="<?php echo util_html_secure(html_get_tooltip_description('assigned_to')) ?>">
-		<?php echo $ah->getAssignedRealName(); ?> (<?php echo $ah->getAssignedUnixName(); ?>)
-		</span></td>
-		<td>
-		<strong><?php echo _('Priority') ?>:</strong><br />
-		<span id="tracker-priority" title="<?php echo util_html_secure(html_get_tooltip_description('priority')) ?>">
-		<?php echo $ah->getPriority(); ?>
-		</span></td>
-	</tr>
-
-	<tr>
-		<td>
-		<?php if (!$ath->usesCustomStatuses()) { ?>
-			<strong><?php echo _('State') ?>:</strong><br />
-			<span id="tracker-status_id" title="<?php echo util_html_secure(html_get_tooltip_description('status_id')) ?>">
-			<?php echo $ath->statusBox ('status_id', $ah->getStatusID() ); ?>
-			<span>
-		<?php } ?>
-		</td>
-		<td>
-		</td>
-	</tr>
-	<?php
-		$ath->renderRelatedTasks($group, $ah);
-		$ath->renderFiles($group_id, $ah);
-	?>
-	<tr>
-		<td colspan="2"><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
-			<span id="tracker-summary" title="<?php echo util_html_secure(html_get_tooltip_description('summary')) ?>">
-			<?php echo $ah->getSummary(); ?>
-			<span>
-		</td>
-	</tr>
-
-	<tr><td colspan="2">
-		<br />
-		<?php echo $ah->showDetails(); ?>
-	</td></tr>
-</table>
-<div id="tabber" class="tabber">
-<div class="tabbertab" title="<?php echo _('Followups');?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.forms.trackermodlimitedform.details') ?></strong><br />
-		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea>
-		<p>
-		<h2><?php echo _('Followups: ') ;
-		if ($sort_comments_chronologically) {
-			echo '<a href="' .
-				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
-				'">' . _('Sort comments antichronologically') . '</a>';
-		} else {
-			echo '<a href="' .
-				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
-				'">' . _('Sort comments chronologically') . '</a>';
-		}
-echo '</h2>';
-echo $ah->showMessages($sort_comments_chronologically);
-		?>
-	</td></tr>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-		<?php echo _('Attach Files') ?><br />
-		<input type="file" name="input_file0" size="30" /><br />
-		<input type="file" name="input_file1" size="30" /><br />
-		<input type="file" name="input_file2" size="30" /><br />
-		<input type="file" name="input_file3" size="30" /><br />
-		<input type="file" name="input_file4" size="30" /><br />
-		<p>
-		<h2><?php echo _('Attached Files') ?>:</h2>
-		<?php
-		//
-		//  print a list of files attached to this Artifact
-		//
-			$ath->renderFiles($group_id, $ah);
-		?>
-	</td></tr>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>">
-<table border="0" width="80%">
-<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
-	<?php
-		$hookParams['artifact_id'] = $aid;
-		$hookParams['group_id'] = $group_id;
-		plugin_hook("artifact_extra_detail",$hookParams);
-	?>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-		<h2><?php echo _('Change Log') ?>:</h2>
-		<?php
-			echo $ah->showHistory();
-		?>
-	</td></tr>
-</table>
-</div>
-<?php $ah->showRelations(); ?>
-</div>
-		</form>
-<?php
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/mod.php
===================================================================
--- trunk/src/www/tracker/mod.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/mod.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,281 +0,0 @@
-<?php
-/**
- * Tracker Facility
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2010 (c) Franck Villaume - Capgemini
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-use_javascript('/tabber/tabber.js');
-
-if (getStringFromRequest('commentsort') == 'anti') {
-       $sort_comments_chronologically = false;
-} else {
-       $sort_comments_chronologically = true;
-}
-
-$ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
-
-echo notepad_func();
-
-?>
-	<form id="trackermodform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>"  enctype="multipart/form-data" method="post">
-	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>"/>
-	<input type="hidden" name="func" value="postmod"/>
-	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
-	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>"/>
-
-	<table width="80%">
-<?php
-if (session_loggedin()) {
-?>
-		<tr>
-			<td><?php
-				if ($ah->isMonitoring()) {
-					$img="xmail16w.png";
-					$key="monitorstop";
-					$text=_('Stop monitor');
-				} else {
-					$img="mail16w.png";
-					$key="monitor";
-					$text=_('Monitor');
-				}
-				echo '
-				<a id="tracker-monitor" href="index.php?group_id='.$group_id.'&artifact_id='.$ah->getID().'&atid='.$ath->getID().'&func=monitor" title="'.util_html_secure(html_get_tooltip_description('monitor')).'"><strong>'.
-					html_image('ic/'.$img.'','20','20').' '.$text.'</strong></a>';
-				?>
-			</td>
-			<td><?php
-				if ($group->usesPM()) {
-					echo '
-				<a href="'.getStringFromServer('PHP_SELF').'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'">'.
-					html_image('ic/taskman20w.png','20','20').'<strong>'._('Build Task Relation').'</strong></a>';
-				}
-				?>
-			</td>
-			<td>
-				<a href="<?php echo getStringFromServer('PHP_SELF')."?func=deleteartifact&aid=$aid&group_id=$group_id&atid=$atid"; ?>"><strong><?php echo html_image('ic/trash.png','16','16') . _('Delete'); ?></strong></a>
-			</td>
-			<td>
-				<input type="submit" name="submit" value="<?php echo _('Save Changes') ?>" />
-			</td>
-		</tr>
-</table>
-<p/>
-<?php } ?>
-<table border="0" width="80%">
-	<tr>
-		<td>
-			<strong><?php echo _('Submitted by') ?>:</strong><br />
-			<?php echo $ah->getSubmittedRealName();
-			if($ah->getSubmittedBy() != 100) {
-				$submittedUnixName = $ah->getSubmittedUnixName();
-				$submittedBy = $ah->getSubmittedBy();
-				?>
-				(<tt><?php echo util_make_link_u ($submittedUnixName,$submittedBy,$submittedUnixName); ?></tt>)
-			<?php } ?>
-		</td>
-		<td><strong><?php echo _('Date Submitted') ?>:</strong><br />
-		<?php
-		echo date(_('Y-m-d H:i'), $ah->getOpenDate() );
-
-		$close_date = $ah->getCloseDate();
-		if ($ah->getStatusID()==2 && $close_date > 1) {
-			echo '<br /><strong>'._('Date Closed').':</strong><br />'
-				.date(_('Y-m-d H:i'), $close_date);
-		}
-		?>
-		</td>
-	</tr>
-
-	<tr>
-		<td><strong><?php echo _('Data Type') ?>:</strong><br />
-		<?php
-
-$atf = new ArtifactTypeFactory ($group) ;
-$tids = array () ;
-foreach ($atf->getArtifactTypes() as $at) {
-	if (forge_check_perm ('tracker', $at->getID(), 'manager')) {
-		$tids[] = $at->getID() ;
-	}
-}
-
-$res = db_query_params ('SELECT group_artifact_id, name
-			FROM artifact_group_list
-			WHERE group_artifact_id = ANY ($1)',
-			array (db_int_array_to_any_clause ($tids))) ;
-
-echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
-
-		?>
-		</td>
-		<td>
-		</td>
-	</tr>
-
-	<?php
-		$ath->renderExtraFields($ah->getExtraFieldData(),true,'none',false,'Any',array(),false,'UPDATE');
-	?>
-
-	<tr>
-		<td><strong><?php echo _('Assigned to')?>:</strong><br />
-		<?php
-		echo $ath->technicianBox('assigned_to', $ah->getAssignedTo() );
-		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&update_users=1','('._('Admin').')');
-		?>
-		</td><td>
-		<strong><?php echo _('Priority') ?>:</strong><br />
-		<?php
-		/*
-			Priority of this request
-		*/
-		build_priority_select_box('priority',$ah->getPriority());
-		?>
-		</td>
-	</tr>
-
-	<tr>
-		<td>
-		<?php if (!$ath->usesCustomStatuses()) { ?>
-		<strong><?php echo _('State') ?>:</strong><br />
-		<?php
-
-		echo $ath->statusBox ('status_id', $ah->getStatusID() );
-		}
-		?>
-		</td>
-		<td>
-		</td>
-	</tr>
-	<?php
-		$ath->renderRelatedTasks($group, $ah);
-		$ath->renderFiles($group_id, $ah);
-	?>
-	<tr>
-		<td><strong><?php echo _('Summary')?><?php echo utils_requiredField(); ?>:</strong><br />
-		<input id="tracker-summary" title="<?php echo util_html_secure(_('The summary text-box represents a short tracker item summary. Useful when browsing through several tracker items.')) ?>" type="text" name="summary" size="70" value="<?php
-			echo $ah->getSummary();
-			?>" maxlength="255" />
-		</td>
-		<td>
-		</td>
-	</tr>
-	<tr><td colspan="2">
-		<div id="edit" style="display:none;">
-		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>: <?php echo notepad_button('document.forms.trackermodform.description') ?></strong>
-		<br />
-		<textarea id="tracker-description" name="description" rows="30" cols="79" title="<?php echo util_html_secure(html_get_tooltip_description('description')) ?>"><?php echo $ah->getDetails(); ?></textarea>
-		</div>
-		<div id="show" style="display:block;">
-		<?php echo $ah->showDetails(true); ?>
-		</div>
-	</td></tr>
-</table>
-<div id="tabber" class="tabber">
-<div class="tabbertab" title="<?php echo _('Followups'); ?>">
-<table border="0" width="80%">
-	<tr><td colspan="2">
-		<br /><strong><?php echo _('Use Canned Response') ?>:</strong><br />
-		<?php
-		echo $ath->cannedResponseBox('canned_response');
-		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&add_canned=1','('._('Admin').')');
-		?>
-		<p>
-		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.forms.trackermodform.details') ?></strong><br />
-		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo util_html_secure(html_get_tooltip_description('comment')) ?>"></textarea></p>
-		<h2><?php echo _('Followups: ') ;
-		if ($sort_comments_chronologically) {
-			echo '<a href="' .
-				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
-				'">' . _('Sort comments antichronologically') . '</a>';
-		} else {
-			echo '<a href="' .
-				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
-				'">' . _('Sort comments chronologically') . '</a>';
-		}
-echo '</h2>';
-echo $ah->showMessages($sort_comments_chronologically);
-		?>
-	</td></tr>
-</table>
-</div>
-<?php
-if ($group->usesPM()) {
-?>
-<div class="tabbertab" title="<?php echo _('Related Tasks'); ?>">
-	<?php
-		$ath->renderRelatedTasks($group, $ah);
-	?>
-</div>
-<?php } ?>
-<div class="tabbertab" title="<?php echo _('Attachments'); ?>">
-		<h2><?php echo _('Existing Files') ?>:</h2>
-<table border="0" width="80%">
-	<tr><td colspan="2">
-        <strong><?php echo _('Attach Files') ?>:</strong><br />
-        <input type="file" name="input_file0" size="30" /><br />
-        <input type="file" name="input_file1" size="30" /><br />
-        <input type="file" name="input_file2" size="30" /><br />
-        <input type="file" name="input_file3" size="30" /><br />
-        <input type="file" name="input_file4" size="30" /><br />
-		<?php
-		//
-		//	print a list of files attached to this Artifact
-		//
-		$ath->renderFiles($group_id, $ah);
-		?>
-	</td></tr>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Commits'); ?>">
-<table border="0" width="80%">
-<tr><td colspan="2"><!-- dummy in case the hook is empty --></td></tr>
-	<?php
-		$hookParams['artifact_id'] = $aid;
-		$hookParams['group_id'] = $group_id;
-		plugin_hook("artifact_extra_detail",$hookParams);
-	?>
-</table>
-</div>
-<div class="tabbertab" title="<?php echo _('Changes'); ?>">
-<table border="0" width="80%">
-	<tr>
-	<td colspan="2">
-		<h2><?php echo _('Changes') ?>:</h2>
-		<?php
-			echo $ah->showHistory();
-		?>
-	</td>
-	</tr>
-</table>
-</div>
-<?php $ah->showRelations(); ?>
-</div>
-		</form>
-<?php
-
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Deleted: trunk/src/www/tracker/query.php
===================================================================
--- trunk/src/www/tracker/query.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/query.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,403 +0,0 @@
-<?php
-/**
- * Copyright 2005 (c) GForge Group, LLC; Anthony J. Pugliese,
- * Copyright 2010 (c) Fusionforge Team
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'tracker/ArtifactQuery.class.php';
-
-if (!session_loggedin()) {
-	exit_not_logged_in();
-}
-
-$query_id = getIntFromRequest('query_id');
-$query_action = getIntFromRequest('query_action');
-if (getStringFromRequest('submit')) {
-	//
-	//  Create a Saved Query
-	//
-
-	if ($query_action == 1) {
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-
-		$aq = new ArtifactQuery($ath);
-		if (!$aq || !is_object($aq)) {
-			exit_error($aq->getErrorMessage(),'tracker');
-		}
-		$query_name = trim(getStringFromRequest('query_name'));
-		$query_type = getStringFromRequest('query_type',0);
-		$_status = getStringFromRequest('_status');
-		$_assigned_to = getStringFromRequest('_assigned_to');
-		$_sort_col = getStringFromRequest('_sort_col');
-		$_sort_ord = getStringFromRequest('_sort_ord');
-		$extra_fields = getStringFromRequest('extra_fields');
-		$_moddaterange = getStringFromRequest('_moddaterange');
-		$_opendaterange = getStringFromRequest('_opendaterange');
-		$_closedaterange = getStringFromRequest('_closedaterange');
-		$_summary = getStringFromRequest('_summary');
-		$_description = getStringFromRequest('_description');
-		$_followups = getStringFromRequest('_followups');
-		$query_options = array_keys(getArrayFromRequest('query_options'));
-		if (!$aq->create($query_name,$_status,$_assigned_to,$_moddaterange,$_sort_col,$_sort_ord,$extra_fields,$_opendaterange,$_closedaterange,
-			$_summary,$_description,$_followups,$query_type, $query_options)) {
-			form_release_key(getStringFromRequest('form_key'));
-			exit_error($aq->getErrorMessage(),'tracker');
-		} else {
-			$feedback .= _('Query Successfully Created');
-		}
-		$aq->makeDefault();
-		$query_id=$aq->getID();
-		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse&feedback='.urlencode($feedback));
-	//
-/*
-	// Make the displayed query the default
-	//
-	} elseif ($query_action == 2) {
-		$aq = new ArtifactQuery($ath,$query_id);
-		if (!$aq || !is_object($aq)) {
-			exit_error('Error',$aq->getErrorMessage());
-		}
-		if (!$aq->makeDefault()) {
-			$feedback .= $aq->getErrorMessage();
-		} else {
-			$feedback .= 'Query Made Default';
-		}
-*/	//
-	// Update the name and or fields of the displayed saved query
-	//
-	} elseif ($query_action == 3) {
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-		$aq = new ArtifactQuery($ath,$query_id);
-		if (!$aq || !is_object($aq)) {
-			exit_error($aq->getErrorMessage(),'tracker');
-		}
-		$query_name = getStringFromRequest('query_name');
-		$query_type = getStringFromRequest('query_type',0);
-		$_status = getStringFromRequest('_status');
-		$_assigned_to = getStringFromRequest('_assigned_to');
-		$_sort_col = getStringFromRequest('_sort_col');
-		$_sort_ord = getStringFromRequest('_sort_ord');
-		$_moddaterange = getStringFromRequest('_moddaterange');
-		$_opendaterange = getStringFromRequest('_opendaterange');
-		$_closedaterange = getStringFromRequest('_closedaterange');
-		$_summary = getStringFromRequest('_summary');
-		$_description = getStringFromRequest('_description');
-		$_followups = getStringFromRequest('_followups');
-		$extra_fields = getStringFromRequest('extra_fields');
-		$query_options = array_keys(getArrayFromRequest('query_options'));
-		if (!$aq->update($query_name,$_status,$_assigned_to,$_moddaterange,$_sort_col,$_sort_ord,$extra_fields,$_opendaterange,$_closedaterange,
-			$_summary,$_description,$_followups,$query_type, $query_options)) {
-			exit_error($aq->getErrorMessage(),'tracker');
-		} else {
-			$feedback .= _('Query Updated');
-		}
-		$aq->makeDefault();
-		$query_id=$aq->getID();
-		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse&feedback='.urlencode($feedback));
-	//
-	//	Just load the query
-	//
-	} elseif ($query_action == 4) {
-		$aq = new ArtifactQuery($ath,$query_id);
-		if (!$aq || !is_object($aq)) {
-			exit_error($aq->getErrorMessage(),'tracker');
-		}
-		$aq->makeDefault();
-	//
-	//	Delete the query
-	//
-	} elseif ($query_action == 5) {
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-		$aq = new ArtifactQuery($ath,$query_id);
-		if (!$aq || !is_object($aq)) {
-			exit_error($aq->getErrorMessage(),'tracker');
-		}
-		if (!$aq->delete()) {
-			$error_msg .= $aq->getErrorMessage();
-            $ret_msg = '&error_msg='.urlencode($error_msg);
-		} else {
-			$feedback .= _('Query Deleted');;
-            $ret_msg = '&feedback='.urlencode($feedback);
-		}
-		$query_id=0;
-		session_redirect('/tracker/?atid='.$atid.'&group_id='.$group_id.'&func=browse'.$ret_msg);
-		exit;
-	} else {
-		exit_error(_('Missing Build Query Action'),'tracker');
-	}
-} else {
-	$user=session_get_user();
-	$query_id=$user->getPreference('art_query'.$ath->getID());
-	$aq = new ArtifactQuery($ath,$query_id);
-	if (!$aq || !is_object($aq)) {
-		exit_error($aq->getErrorMessage(),'tracker');
-	}
-	$aq->makeDefault();
-}
-
-//
-//  setup the query
-//
-$_assigned_to=$aq->getAssignee();
-$_status=$aq->getStatus();
-$extra_fields=$aq->getExtraFields();
-$_sort_col=$aq->getSortCol();
-$_sort_ord=$aq->getSortOrd();
-$_moddaterange=$aq->getModDateRange();
-$_opendaterange=$aq->getOpenDateRange();
-$_closedaterange=$aq->getCloseDateRange();
-$_summary=$aq->getSummary();
-$_description=$aq->getDescription();
-$_followups=$aq->getFollowups();
-$query_type=$aq->getQueryType();
-//
-//	creating a custom technician box which includes "any" and "unassigned"
-$tech_box=$ath->technicianBox ('_assigned_to[]',$_assigned_to,true,'none','-1',false,true);
-
-
-//
-//	custom order by arrays to build a pop-up box
-//
-$order_name_arr=array();
-$order_name_arr[]=_('ID');
-$order_name_arr[]=_('Priority');
-$order_name_arr[]=_('Summary');
-$order_name_arr[]=_('Open Date');
-$order_name_arr[]=_('Last Modified Date');
-$order_name_arr[]=_('Close Date');
-$order_name_arr[]=_('Submitter');
-$order_name_arr[]=_('Assignee');
-
-
-$order_arr=array();
-$order_arr[]='artifact_id';
-$order_arr[]='priority';
-$order_arr[]='summary';
-$order_arr[]='open_date';
-$order_arr[]='last_modified_date';
-$order_arr[]='close_date';
-$order_arr[]='submitted_by';
-$order_arr[]='assigned_to';
-
-//
-//	custom sort arrays to build pop-up box
-//
-$sort_name_arr=array();
-$sort_name_arr[]=_('Ascending');
-$sort_name_arr[]=_('Descending');
-
-
-$sort_arr=array();
-$sort_arr[]='ASC';
-$sort_arr[]='DESC';
-
-//
-//	custom changed arrays to build pop-up box
-//
-$changed_name_arr=array();
-$changed_name_arr[]=_('Any changes');
-$changed_name_arr[]=_('Last 24H');
-$changed_name_arr[]=_('Last 7days');
-$changed_name_arr[]=_('Last 2weeks');
-$changed_name_arr[]=_('Last 1month');
-
-$changed_arr=array();
-$changed_arr[]= 0;
-$changed_arr[]= 3600 * 24;	 // 24 hour
-$changed_arr[]= 3600 * 24 * 7; // 1 week
-$changed_arr[]= 3600 * 24 * 14;// 2 week
-$changed_arr[]= 3600 * 24 * 30;// 1 month
-
-//
-//	get queries for this user
-//
-$res = db_query_params ('SELECT artifact_query_id,query_name FROM artifact_query WHERE user_id=$1 AND group_artifact_id=$2',
-			array(user_getid(),
-			      $ath->getID()));
-
-
-//	Show the new pop-up boxes to select assigned to, status, etc
-//
-$ath->header(array('atid'=>$ath->getID(), 'title' =>_('Build Query')));
-
-echo '<table align="center"><tr><td>' .
-		'<fieldset><legend>'.
-		_('Build Query').
-		'</legend>';
-
-echo '
-<form action="'.getStringFromServer('PHP_SELF').'?func=query&group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
-<input type="hidden" name="form_key" value="'.form_generate_key().'" />
-<table align="center" border="3" cellpadding="4" rules="groups" frame="box" width="100%" class="tablecontent">
-	<tr>
-		<td>
-			<input type="submit" name="submit" value="'._('Save Changes').'" />
-		</td>
-		<td>';
-	if(db_numrows($res)>0) {
-		echo html_build_select_box($res,'query_id',$query_id,false).'';
-	}
-
-	echo '
-		</td>
-	</tr>
-	<tr class="tablecontent">
-		<td>';
-	if(db_numrows($res)>0) {
-		if ($query_type == 0 || ($query_type>0 && forge_check_perm ('tracker', $ath->getID(), 'manager'))) {
-			$allow_update = true;
-			$checked[1] = '';
-			$checked[3] = ' checked="checked"';
-		} else {
-			$allow_update = false;
-			$checked[1] = ' checked="checked"';
-			$checked[3] = '';
-		}
-		echo '
-		<input type="radio" name="query_action" value="1"'.$checked[1].' />'._('Name and Save Query').'<br />
-		<input type="radio" name="query_action" value="4" />'._('Load Query').'<br />';
-		if ($allow_update) {
-			echo '
-		<input type="radio" name="query_action" value="3"'.$checked[3].' />'._('Update Query').'<br />
-		<input type="radio" name="query_action" value="5" />'._('Delete Query');
-		}
-	} else {
-		echo '
-		<input type="hidden" name="query_action" value="1" />'._('Name and Save Query').'<br />';
-	}
-	echo '
-		</td>
-		<td valign="top">
-		<input type="text" name="query_name" value="'.$aq->getName().'" size="20" maxlength="30" /></td>
-	</tr>
-</table>';
-
-echo'
-<table width="100%" class="tablecontent">';
-if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
-	$default_query = db_result(db_query_params('SELECT query_name FROM artifact_query WHERE query_type=2 AND group_artifact_id=$1',
-						   array ($ath->getID())),
-				   0,
-				   'query_name');
-	if ($default_query) {
-		if ($default_query == $aq->getName()) {
-			$note = '';
-		} else {
-			$note= '<br/><i>'.sprintf(_('Note: The default project query is currently \'%1$s\'.'), $default_query).'</i>';
-		}
-	} else {
-		$note= '<br/><i>'._('Note: There is no default project query defined.').'</i>';
-	}
-	echo '
-	<tr>
-		<td colspan="2">
-			<strong>'._('Type of query').':</strong><br />
-			<input name="query_type" value="0" type="radio"'.(($query_type==0) ? ' checked="checked"' : '' ).' />'.
-			_('Private query').'<br />
-			<input name="query_type" value="1" type="radio"'.(($query_type==1) ? ' checked="checked"' : '' ).' />'.
-			_('Project level query (query is public)').'<br />
-			<input name="query_type" value="2" type="radio"'.(($query_type==2) ? ' checked="checked"' : '' ).' />'.
-			_('Default project query (for project level query only)').'<br />
-			'.$note.'
-			<hr/>
-		</td>
-	</tr>';
-}
-	echo '<tr>
-		<td><strong>'._('Assignee').':</strong><br />'. $tech_box .'</td>
-		<td valign="top">';
-		if (!$ath->usesCustomStatuses()) {
-			echo '<strong>'._('State').':</strong><br />'. $ath->statusBox('_status',$_status,true,_('Any'));
-		}
-		echo '</td>
-	</tr>';
-	$ath->renderExtraFields($extra_fields,true,'None',true,'Any',array(),false,'QUERY');
-
-	// Compute the list of fields which can be sorted.
-	// Currently, only scalar artifacts are taken.
-	$efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_TEXT,
-					    ARTIFACT_EXTRAFIELDTYPE_TEXTAREA,
-					    ARTIFACT_EXTRAFIELDTYPE_INTEGER,
-					    ARTIFACT_EXTRAFIELDTYPE_SELECT,
-					    ARTIFACT_EXTRAFIELDTYPE_RADIO,
-					    ARTIFACT_EXTRAFIELDTYPE_STATUS));
-	$keys=array_keys($efarr);
-	for ($k=0; $k<count($keys); $k++) {
-		$i=$keys[$k];
-		$order_name_arr[] = $efarr[$i]['field_name'];
-		$order_arr[] = $efarr[$i]['extra_field_id'];
-	}
-	array_multisort($order_name_arr, $order_arr);
-
-	$tips = '<i>'._('(%% for wildcards)').'</i>   ';
-
-echo '
-	<tr>
-		<td colspan="2" nowrap="nowrap">'.
-		'<strong>'._('Last Modified Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
-		<input type="text" name="_moddaterange" size="21" maxlength="21" value="'. htmlspecialchars($_moddaterange) .'" /><p/>
-		<strong>'._('Open Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
-		<input type="text" name="_opendaterange" size="21" maxlength="21" value="'. htmlspecialchars($_opendaterange) .'" /><p/>
-		<strong>'._('Close Date range').':</strong> <i>(YYYY-MM-DD YYYY-MM-DD Format)</i><br />
-		<input type="text" name="_closedaterange" size="21" maxlength="21" value="'. htmlspecialchars($_closedaterange) .'" />
-		</td>
-	</tr>
-	<tr>
-		<td colspan="2">'.
-		'<strong>'._('Summary').':</strong> '.$tips.'<br />
-		<input type="text" name="_summary" size="40" value="'. htmlspecialchars($_summary) .'" /><p/>
-		<strong>'._('Detailed description').':</strong> '.$tips.'<br />
-		<input type="text" name="_description" size="40" value="'. htmlspecialchars($_description) .'" /><p/>
-		<strong>'._('Followups').':</strong> '.$tips.'<br />
-		<input type="text" name="_followups" size="40" value="'. htmlspecialchars($_followups) .'" />
-		</td>
-	</tr>
-	<tr>
-		<td><strong>'._('Order by').':</strong><br />
-		'.
-		html_build_select_box_from_arrays($order_arr,$order_name_arr,'_sort_col',$_sort_col,false) .'</td>
-		<td> <br />
-		'.html_build_select_box_from_arrays($sort_arr,$sort_name_arr,'_sort_ord',$_sort_ord,false) .'</td>
-	</tr>';
-echo '<tr>
-		<td colspan="2">'.
-		'<p/><strong>Options:</strong><br />
-		<input type="checkbox" name="query_options[bargraph]" '.
-	((in_array('bargraph', $aq->getQueryOptions())) ? 'checked="checked"' : '')
-.'/> Display a short summary box on top of the list (roadmap status).<p/>
-		</td>
-	</tr>';
-echo '
-	</table></form>';
-echo '</fieldset></td></tr></table>';
-$ath->footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>

Modified: trunk/src/www/tracker/reporting/index.php
===================================================================
--- trunk/src/www/tracker/reporting/index.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/reporting/index.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -27,8 +27,8 @@
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
-require_once $gfwww.'tracker/include/ArtifactTypeFactoryHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeFactoryHtml.class.php';
 
 if (!session_loggedin()) {
 	exit_not_logged_in();

Modified: trunk/src/www/tracker/reporting/trackerpie_graph.php
===================================================================
--- trunk/src/www/tracker/reporting/trackerpie_graph.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/reporting/trackerpie_graph.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -30,7 +30,7 @@
 require_once(forge_get_config('jpgraph_path').'/jpgraph_pie3d.php');
 require_once $gfcommon.'reporting/Report.class.php';
 require_once $gfcommon.'reporting/report_utils.php';
-require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
+require_once $gfcommon.'tracker/include/ArtifactTypeHtml.class.php';
 
 
 $group_id = getIntFromRequest('group_id');

Deleted: trunk/src/www/tracker/taskmgr.php
===================================================================
--- trunk/src/www/tracker/taskmgr.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/taskmgr.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,172 +0,0 @@
-<?php
-/**
- * Task Mgr And Tracker Integration
- *
- * Copyright 2003 GForge, LLC
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * http://fusionforge.org
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-require_once $gfcommon.'pm/ProjectGroupFactory.class.php';
-require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
-
-$group_project_id = getIntFromRequest('group_project_id');
-$project_task_id = getIntFromRequest('project_task_id');
-$aid = getIntFromRequest('aid');
-
-$a=new Artifact($ath,$aid);
-if (!$a || !is_object($a)) {
-	exit_error(_('Artifact Could Not Be Created'),'tracker');
-}
-
-//
-//	Add a relationship from this artifact to an existing task
-//
-if (getStringFromRequest('add_to_task')) {
-	$offset = getStringFromRequest('offset');
-	$_order = getStringFromRequest('_order');
-	$max_rows = getIntFromRequest('max_rows');
-	$set = getStringFromRequest('set');
-	$_assigned_to = getStringFromRequest('_assigned_to');
-	$_status = getStringFromRequest('_status');
-	$_category_id = getIntFromRequest('_category_id');
-
-	// $group object is created in tracker.php
-
-	$pg=new ProjectGroup($group,$group_project_id);
-	if (!$pg || !is_object($pg)) {
-		exit_error(_('Could Not Get ProjectGroup'),'tracker');
-	} elseif ($pg->isError()) {
-		exit_error($pg->getErrorMessage(),'tracker');
-	}
-
-	$ptf = new ProjectTaskFactory($pg);
-	if (!$ptf || !is_object($ptf)) {
-		exit_error(_('Could Not Get ProjectTaskFactory'),'tracker');
-	} elseif ($ptf->isError()) {
-		exit_error($ptf->getErrorMessage(),'tracker');
-	}
-
-	$ptf->setup($offset,$_order,$max_rows,$set,$_assigned_to,$_status,$_category_id);
-	if ($ptf->isError()) {
-		exit_error($ptf->getErrorMessage(),'tracker');
-	}
-
-	$pt_arr =& $ptf->getTasks();
-	if (!$pt_arr) {
-		if ($ptf->isError()) {
-			exit_error($ptf->getErrorMessage(),'tracker');
-		} else {
-			exit_error(_('No Available Tasks Found'),'tracker');
-		}
-	}
-
-	$related_tasks = $a->getRelatedTasks();
-	$skip = array();
-	while ($row = db_fetch_array($related_tasks)) {
-		$skip[$row['project_task_id']] = true;
-	}
-	$tasks = array();
-	foreach($pt_arr as $p) {
-		$id = $p->getID();
-		if (!isset($skip[$id])) {
-			$tasks[] = $p;
-		}
-	}
-	if (empty($tasks)) {
-		exit_error(_('No Available Tasks Found'));
-	}
-
-	$ath->header(array('titlevals'=>array($ath->getName()),
-		'atid'=>$ath->getID(),
-		'title'=>_('Build Relationship Between Tracker Items and Tasks')));
-
-	echo '
-		<form name="foo" action="'. getStringFromServer('PHP_SELF') .'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'" method="post">
-		<p><strong>'._('Tracker Item').':</strong> [#'.$a->getID().'] '.$a->getSummary().'</p>
-		<p><strong>'._('Tasks Project').':</strong><br />';
-	echo $pg->getName().'
-		<input type="hidden" name="group_project_id" value="'.$pg->getID().'" /></p>
-		<p>
-		<strong>'._('Task').':</strong></p>
-		<select name="project_task_id">';
-	foreach($tasks as $task) {
-		echo '<option value="'.$task->getID().'">'.$task->getSummary().'</option>';
-	}
-	echo '</select><br />
-		<input type="submit" name="done_adding" value="'._('Add Relationship to Selected Task') . '" />
-		</form>';
-
-//
-//	Add the relationship and display finished message
-//
-} elseif (getStringFromRequest('done_adding')) {
-
-	session_redirect('/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&project_task_id='.$project_task_id.'&func=addartifact&add_artifact_id='. $a->getID());
-
-//
-//	Create a new task and relate it to this artifact
-//
-} elseif (getStringFromRequest('new_task')) {
-
-	session_redirect ('/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=addtask&related_artifact_summary='. urlencode($a->getSummary()) .'&related_artifact_id='. $a->getID());
-
-//
-//	Show the list of ProjectGroups available
-//
-} else {
-
-	$pgf=new ProjectGroupFactory($group);
-	if (!$pgf || !is_object($pgf)) {
-		exit_error(_('Could Not Get Factory'),'tracker');
-	} elseif ($pgf->isError()) {
-		exit_error($pgf->getErrorMessage(),'tracker');
-	}
-
-	$pg_arr = $pgf->getProjectGroups();
-	if (!$pg_arr) {
-		if ($pgf->isError()) {
-			exit_error($pgf->getErrorMessage(),'tracker');
-		} else {
-			exit_error(_('No Existing Project Groups Found'),'tracker');
-		}
-	}
-
-	$ath->header(array('titlevals'=>array($ath->getName()),
-		'atid'=>$ath->getID(),
-		'title'=>_('Build Relationship Between Tracker Items and Tasks')));
-
-	echo '<form name="foo" action="'. getStringFromServer('PHP_SELF') .'?func=taskmgr&group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'" method="post">
-		<p><strong>'._('Tracker Item').':</strong> [#'.$a->getID().'] '.$a->getSummary().'</p>
-		<p><strong>'._('Tasks Project').':</strong></p>
-		<select name="group_project_id">';
-	for ($i=0; $i<count($pg_arr); $i++) {
-		echo '<option value="'.$pg_arr[$i]->getID().'">'.$pg_arr[$i]->getName().'</option>';
-	}
-	echo '</select>
-		<p>
-		<input type="submit" name="add_to_task" value="'._('Add Relation to Existing Task').'" />
-		<input type="submit" name="new_task" value="'._('Create New Task').'" />
-		</p>
-		</form>';
-
-}
-
-$ath->footer(array());
-
-?>

Deleted: trunk/src/www/tracker/tracker.php
===================================================================
--- trunk/src/www/tracker/tracker.php	2011-10-06 14:49:34 UTC (rev 14555)
+++ trunk/src/www/tracker/tracker.php	2011-10-06 20:42:21 UTC (rev 14556)
@@ -1,594 +0,0 @@
-<?php
-/**
- * Tracker Front Page
- *
- * Copyright 1999-2001 (c) VA Linux Systems
- * Copyright 2002-2004 (c) GForge Team
- * http://fusionforge.org/
- *
- * This file is part of FusionForge. FusionForge is free software;
- * you can redistribute it and/or modify it under the terms of the
- * GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the Licence, or (at your option)
- * any later version.
- *
- * FusionForge is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-
-html_use_tooltips();
-
-//
-//	get the Group object
-//
-$group =& group_get_object($group_id);
-if (!$group || !is_object($group)) {
-	exit_no_group();
-}
-if ($group->isError()) {
-	if($group->isPermissionDeniedError()) {
-		exit_permission_denied($group->getErrorMessage(),'tracker');
-	} else {
-		exit_error($group->getErrorMessage(),'tracker');
-	}
-}
-
-//
-//	Create the ArtifactType object
-//
-$ath = new ArtifactTypeHtml($group,$atid);
-
-if (!$ath || !is_object($ath)) {
-	exit_error(_('ArtifactType could not be created'),'tracker');
-}
-if ($ath->isError()) {
-	if($ath->isPermissionDeniedError()) {
-		exit_permission_denied($ath->getErrorMessage(),'tracker');
-	} else {
-		exit_error($ath->getErrorMessage(),'tracker');
-	}
-}
-switch (getStringFromRequest('func')) {
-
-	case 'add' : {
-		if (!$ath->allowsAnon() && !session_loggedin()) {
-			exit_permission_denied('tracker');
-		}
-		include $gfwww.'tracker/add.php';
-		break;
-	}
-	case 'postadd' : {
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-
-		$user_email = getStringFromRequest('user_email');
-		$category_id = getIntFromRequest('category_id');
-		$artifact_group_id = getIntFromRequest('artifact_group_id');
-		$summary = getStringFromRequest('summary');
-		$details = getStringFromRequest('details');
-		$assigned_to = getStringFromRequest('assigned_to');
-		$priority = getStringFromRequest('priority');
-		$extra_fields = getStringFromRequest('extra_fields');
-
-		/*
-			Create a new Artifact
-
-		*/
-		$ah=new ArtifactHtml($ath);
-		$feedback = '';
-		if (!$ah || !is_object($ah)) {
-			form_release_key(getStringFromRequest('form_key'));
-			exit_error(_('Artifact Could Not Be Created'),'tracker');
-		} else if (!$ath->allowsAnon() && !session_loggedin()) {
-			exit_error(_('Artifact: This ArtifactType Does Not Allow Anonymous Submissions. Please Login.'),'tracker');
-		} else {
-			if (empty($user_email)) {
-				$user_email=false;
-			} else {
-				if (!validate_email($user_email)) {
-					form_release_key(getStringFromRequest('form_key'));
-					exit_error(_('Invalid Email Address') . htmlspecialchars($user_email),'tracker');
-				}
-			}
-			if ($user_email) {
-				$details = "Anonymous message posted by $user_email\n\n".
-				$details;
-			}
-			if (!$ah->create($summary,$details,$assigned_to,$priority,$extra_fields)) {
-				form_release_key(getStringFromRequest('form_key'));
-				exit_error($ah->getErrorMessage(),'tracker');
-			} else {
-				//
-				//	  Attach files to this Artifact.
-				//
-				$ext_feedback = '';
-				for ($i=0; $i<5; $i++) {
-					$f = getUploadedFile("input_file$i");
-					$error = $f['error'];
-					if (isset($error) && $error > 0) {
-						$n = $i+1;
-						if ($error === 1 || $error === 2) {
-							// UPLOAD_ERR_INI_SIZE or UPLOAD_ERR_FORM_SIZE
-							$ext_feedback .= "<br />ERROR: Skipping attachement $n: file is too large.";
-						} elseif ($error === 3) {
-							// UPLOAD_ERR_PARTIAL
-							$ext_feedback .= "<br />ERROR: Skipping attachement $n: transfert interrupted.";
-						}
-						continue;
-					}
-					$file_name = $f['name'];
-					$tmp_name = $f['tmp_name'];
-					$size = $f['size'];
-					$type = $f['type'];
-					if (!is_uploaded_file($tmp_name)) {
-						continue;
-					}
-
-					$afh=new ArtifactFileHtml($ah);
-					if (!$afh || !is_object($afh)) {
-						$error_msg .= _('Could Not Create File Object');
-					} elseif ($afh->isError()) {
-						$error_msg .= $afh->getErrorMessage();
-					} else {
-						if (!util_check_fileupload($tmp_name)) {
-							form_release_key(getStringFromRequest('form_key'));
-							//delete the artifact
-							$ah->delete(true);
-							exit_error(_('Invalid filename'),'tracker');
-						}
-						if (!$afh->upload($tmp_name,$file_name,$type,' ')) {
-							form_release_key(getStringFromRequest('form_key'));
-							//delete the artifact
-							$ah->delete(true);
-							exit_error(_('Could Not Attach File to Item: '.$afh->getErrorMessage()),'tracker');
-						}
-					}
-				}
-				$feedback .= sprintf(_('Item %s successfully created'),'[#'.$ah->getID().']');
-				$feedback .= $ext_feedback;
-				include $gfwww.'tracker/browse.php';
-			}
-		}
-		break;
-	}
-	case 'massupdate' : {
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-
-		$artifact_id_list = getArrayFromRequest('artifact_id_list');
-		$priority = getStringFromRequest('priority');
-		$status_id = getIntFromRequest('status_id');
-		$category_id = getIntFromRequest('category_id');
-		$artifact_group_id = getIntFromRequest('artifact_group_id');
-		$resolution_id = getIntFromRequest('resolution_id');
-		$assigned_to = getStringFromRequest('assigned_to');
-		$canned_response = getIntFromRequest("canned_response");
-		$extra_fields = getArrayFromRequest('extra_fields');
-		$was_error=false;
-
-		$count=count($artifact_id_list);
-
-		session_require_perm ('tracker', $ath->getID(), 'manager') ;
-
-		$artifact_type_id=$ath->getID();
-
-		for ($i=0; $i < $count; $i++) {
-			$ah=new Artifact($ath,$artifact_id_list[$i]);
-			if (!$ah || !is_object($ah)) {
-				$feedback .= ' ID: '.$artifact_id_list[$i].'::Artifact Could Not Be Created';
-			} else if ($ah->isError()) {
-				$feedback .= ' ID: '.$artifact_id_list[$i].'::'.$ah->getErrorMessage();
-			} else {
-				$_summary = '';
-				$_priority=(($priority != 100) ? $priority : $ah->getPriority());
-				$_status_id=(($status_id != 100) ? $status_id : $ah->getStatusID());
-				//yikes, we want the ability to mass-update to "un-assigned", which is the ID=100, which
-				//conflicts with the "no change" ID! Sorry for messy use of 100.1
-				$_assigned_to=(($assigned_to != '100.1') ? $assigned_to : $ah->getAssignedTo());
-
-				//
-				//	get existing extra field data
-				//	we will then override individual elements if needed
-				//
-				$ef = $ah->getExtraFieldData();
-				$keys = array_keys($ef);
-				foreach ($keys as $efid) {
-					if (is_array($ef[$efid])) {
-						$f = $extra_fields[$efid];
-						// in this case, if $extra_fields is not setted, it
-						// means no option was selected, so we have to delete
-						// the original values
-						if (!is_array($f) || count($f) == 0) {
-							$ef[$efid] = array();
-						} else if (in_array('100', $extra_fields[$efid])) {	// "No change" option selected?
-							// no change
-						} else {
-							$ef[$efid] = $f;		// replace old values with new values
-						}
-					} else {
-						// in some cases (ie: textfields) the value is not passed, but
-						// this doesn't mean we must delete the existing value
-						if (array_key_exists($efid, $extra_fields)) {
-							$f = $extra_fields[$efid];
-							if ($f == '100') {
-								// no change
-							} else {
-								$ef[$efid] = $f;
-							}
-						} else {
-							$ef[$efid] = addslashes($ef[$efid]);
-						}
-					}
-				}
-
-				if (!$ah->update($_priority,$_status_id,$_assigned_to,$_summary,$canned_response,'',$artifact_type_id,$ef)) {
-					$was_error=true;
-				}
-
-				if ($was_error) {
-					$error_msg .= ' ID: '.$artifact_id_list[$i].'::'.$ah->getErrorMessage();
-				}else {
-					$was_error=false;
-				}
-			}
-			unset($ah);
-
-		if (!$was_error) {
-			$feedback = _('Updated Successfully');			}
-		}
-		unset ($extra_fields_choice);
-		include $gfwww.'tracker/browse.php';
-		break;
-	}
-	case 'postmod' : {
-		$artifact_id = getIntFromRequest('artifact_id');
-		$priority = getIntFromRequest('priority');
-		$status_id = getIntFromRequest('status_id');
-		$category_id = getIntFromRequest('category_id');
-		$artifact_group_id = getIntFromRequest('artifact_group_id');
-		$resolution_id = getIntFromRequest('resolution_id');
-		$assigned_to = getStringFromRequest('assigned_to');
-		$summary = getStringFromRequest('summary');
-		$canned_response = getStringFromRequest('canned_response');
-		$details = getStringFromRequest('details');
-		$description = getStringFromRequest('description');
-		$new_artifact_type_id = getIntFromRequest('new_artifact_type_id');
-		$extra_fields = getStringFromRequest('extra_fields');
-		$user_email = getStringFromRequest('user_email', false);
-		$was_error = false;
-
-		/*
-			Technicians can modify limited fields - to be certain
-			no one is hacking around, we override any fields they don't have
-			permission to change.
-		*/
-		if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-			exit_form_double_submit('tracker');
-		}
-
-		$ah=new ArtifactHtml($ath,$artifact_id);
-		if (!$ah || !is_object($ah)) {
-			exit_error(_('Artifact Could Not Be Created'),'tracker');
-		} else if ($ah->isError()) {
-			exit_error($ah->getErrorMessage(),'tracker');
-		} else if (!$ath->allowsAnon() && !session_loggedin()) {
-			exit_error(_('Artifact: This ArtifactType Does Not Allow Anonymous Submissions. Please Login.'),'tracker');
-		} else {
-
-			$remlink = getArrayFromRequest('remlink');
-			if (count($remlink) > 0 && forge_check_perm ('tracker_admin', $ah->ArtifactType->Group->getID())) {
-				require_once $gfcommon.'pm/ProjectTask.class.php';
-				foreach ($remlink as $tid) {
-					$pt = &projecttask_get_object($tid);
-					if (!$pt || $pt->isError())
-						exit_error(_('Error'), sprintf(_('Could not get Project Task for %d'), $tid));
-					if (!$pt->removeRelatedArtifacts(array($artifact_id)))
-						exit_error($tid."->removeRelatedArtifacts(".$artifact_id.")", $pt->getErrorMessage());
-				}
-			}
-			/*
-
-				The following logic causes fields to be overridden
-				in the event that someone tampered with the HTML form
-
-			*/
-			if (forge_check_perm ('tracker', $ath->getID(), 'tech')
-					|| forge_check_perm ('tracker', $ath->getID(), 'manager')) {
-				//admin and techs can do everything
-				//techs will have certain fields overridden inside the update() function call
-				if (!$ah->update($priority,$status_id,
-					$assigned_to,$summary,$canned_response,$details,$new_artifact_type_id,$extra_fields, $description)) {
-					form_release_key(getStringFromRequest('form_key'));
-					$error_msg .= _('Tracker Item'). ': '.$ah->getErrorMessage();
-					$ah->clearError();
-					$was_error=true;
-				}
-
-			} else {
-
-				// Everyone else can add comments
-				if ($details) {
-					if ($ah->addMessage($details,$user_email,true)) {
-						$feedback=_('Comment added');
-					} else {
-						if ( (strlen($details)>0) ) { //if there was no message, then it's not an error but addMessage returns false and sets missing params error
-							//some kind of error in creation
-							exit_error($ah->getErrorMessage(),'tracker');
-						} else {
-							// we have to unset the error if the user added a file ( add a file and no comment)
-							if ( (getStringFromRequest('add_file')) ) {
-								$ah->clearError();
-							}
-						}
-					}
-
-				} else {
-
-					//everyone else can only add comments
-					$delete_file=false;
-					$add_file=false;
-					if ($ah->addMessage($details,$user_email,true)) {
-						$feedback=_('Comment added');
-					} else {
-						//some kind of error in creation
-						exit_error($ah->getErrorMessage(),'tracker');
-					}
-				}
-			}
-
-			// Admin, Techs and Submitter can add files.
-			if (forge_check_perm ('tracker', $ath->getID(), 'tech')
-					|| forge_check_perm ('tracker', $ath->getID(), 'manager')
-					|| (session_loggedin() && ($ah->getSubmittedBy() == user_getid()))) {
-				//
-				//	  Attach files to this Artifact.
-				//
-				$ext_feedback = '';
-				for ($i=0; $i<5; $i++) {
-					$f = getUploadedFile("input_file$i");
-					$error = $f['error'];
-					if (isset($error) && $error > 0) {
-						$n = $i+1;
-						if ($error === 1 || $error === 2) {
-							// UPLOAD_ERR_INI_SIZE or UPLOAD_ERR_FORM_SIZE
-							$ext_feedback .= "<br />" .
-								sprintf(_("ERROR: Skipping attachment %d: file is too large."), $n);
-						} elseif ($error === 3) {
-							// UPLOAD_ERR_PARTIAL
-							$ext_feedback .= "<br />" .
-								sprintf(_("ERROR: Skipping attachment %d: transfer interrupted."), $n);
-						}
-						continue;
-					}
-					$file_name = $f['name'];
-					$tmp_name = $f['tmp_name'];
-					$size = $f['size'];
-					$type = $f['type'];
-
-					if (!is_uploaded_file($tmp_name)) {
-						continue;
-					}
-
-					$afh=new ArtifactFileHtml($ah);
-					if (!$afh || !is_object($afh)) {
-						$error_msg .= _('Could Not Create File Object');
-					} elseif ($afh->isError()) {
-						$error_msg .= $afh->getErrorMessage();
-					} else {
-						if (!util_check_fileupload($tmp_name)) {
-							form_release_key(getStringFromRequest('form_key'));
-							exit_error(_('Invalid filename'),'tracker');
-						}
-						if (!$afh->upload($tmp_name,$file_name,$type,' ')) {
-							$error_msg .= ' <br />'._('File Upload: Error').':'.$afh->getErrorMessage();
-							$was_error=true;
-						} else {
-							$feedback .= ' <br />'._('File Upload: Successful');
-						}
-					}
-				}
-
-				// Admin and Techs can delete files.
-				if (forge_check_perm ('tracker', $ath->getID(), 'tech')
-						|| forge_check_perm ('tracker', $ath->getID(), 'manager')) {
-					//
-					//	Delete list of files from this artifact
-					//
-					$delete_file = getStringFromRequest('delete_file');
-					if ($delete_file) {
-						$count=count($delete_file);
-						for ($i=0; $i<$count; $i++) {
-							$afh=new ArtifactFileHtml($ah,$delete_file[$i]);
-							if (!$afh || !is_object($afh)) {
-								$error_msg .= _('Could Not Create File Object::').$delete_file[$i];
-							} elseif ($afh->isError()) {
-								$error_msg .= $afh->getErrorMessage().'::'.$delete_file[$i];
-							} else {
-								if (!$afh->delete()) {
-									$error_msg .= ' <br />'._('File Delete:').': '.$afh->getErrorMessage();
-									$was_error=true;
-								} else {
-									$feedback .= ' <br />'._('File Delete: Successful');
-								}
-							}
-						}
-					}
-				}
-
-				//
-				//	Show just one feedback entry if no errors
-				//
-				if (!$was_error) {
-					$feedback = sprintf(_('Item %s successfully updated'),'[#'.$ah->getID().']');
-				}
-				$feedback .= $ext_feedback;
-				include $gfwww.'tracker/browse.php';
-				break;
-			}
-		}
-	}
-		case 'monitor' : {
-			if (!session_loggedin()) {
-				exit_permission_denied();
-			}
-			$start = getIntFromRequest('start');
-			$stop = getIntFromRequest('stop');
-			$artifact_id = getIntFromRequest('artifact_id');
-
-			// Fix to prevent collision with the start variable used in browse.
-			$_GET['start'] = 0;
-
-			if ($artifact_id) {
-				$ah=new ArtifactHtml($ath,$artifact_id);
-				if (!$ah || !is_object($ah)) {
-					exit_error(_('Artifact Could Not Be Created'),'tracker');
-				} else if ($ah->isError()) {
-					exit_error($ah->getErrorMessage(),'tracker');
-				} else {
-					if ($start && $ah->isMonitoring())
-						$feedback = _('Monitoring Started');
-					elseif ($stop && !$ah->isMonitoring())
-						$feedback = _('Monitoring Deactivated');
-					else {
-						$ah->setMonitor();
-						$error_msg = $ah->getErrorMessage();
-					}
-					include $gfwww.'tracker/browse.php';
-				}
-			} else {
-				$at=new ArtifactType($group,$atid);
-				if (!$at || !is_object($at)) {
-					exit_error(_('Artifact Could Not Be Created'),'tracker');
-				} else if ($at->isError()) {
-					exit_error($at->getErrorMessage(),'tracker');
-				} else {
-					if ($start && $at->isMonitoring())
-						$feedback = _('Monitoring Started');
-					elseif ($stop && !$at->isMonitoring())
-						$feedback = _('Monitoring Deactivated');
-					else {
-						$at->setMonitor();
-						$feedback=$at->getErrorMessage();
-						$at->clearError();
-					}
-					include $gfwww.'tracker/browse.php';
-				}
-			}
-			break;
-		}
-
-
-		//
-		//	Show delete form
-		//
-		case 'deleteartifact' : {
-			session_require_perm ('tracker', $ath->getID(), 'manager') ;
-
-			$aid = getIntFromRequest('aid');
-			$ah= new ArtifactHtml($ath,$aid);
-			if (!$ah || !is_object($ah)) {
-				exit_error(_('Artifact Could Not Be Created'),'tracker');
-			} elseif ($ah->isError()) {
-				exit_error($ah->getErrorMessage(),'tracker');
-			}
-			include $gfwww.'tracker/deleteartifact.php';
-			break;
-		}
-
-		//
-		//	Handle the actual delete
-		//
-
-		case 'postdeleteartifact' : {
-			if (!form_key_is_valid(getStringFromRequest('form_key'))) {
-				exit_form_double_submit('tracker');
-			}
-			session_require_perm ('tracker', $ath->getID(), 'manager') ;
-
-			$aid = getStringFromRequest('aid');
-			$ah= new ArtifactHtml($ath,$aid);
-			if (!$ah || !is_object($ah)) {
-				exit_error(_('Artifact Could Not Be Created'),'tracker');
-			} elseif ($ah->isError()) {
-				exit_error($ah->getErrorMessage(),'tracker');
-			}
-			if (!getStringFromRequest('confirm_delete')) {
-				$warning_msg .= _('Confirmation failed. Artifact not deleted');
-			}
-			else {
-				if (!$ah->delete(true)) {
-					$error_msg .= _('Artifact Delete Failed') . ': '.$ah->getErrorMessage();
-				} else {
-					$feedback .= _('Artifact Deleted Successfully');
-				}
-			}
-			include $gfwww.'tracker/browse.php';
-			break;
-		}
-
-
-		case 'taskmgr' : {
-			include $gfwww.'tracker/taskmgr.php';
-			break;
-		}
-		case 'browse' : {
-			include $gfwww.'tracker/browse.php';
-			break;
-		}
-		case 'query' : {
-			include $gfwww.'tracker/query.php';
-			break;
-		}
-		case 'downloadcsv' : {
-			include $gfwww.'tracker/downloadcsv.php';
-			break;
-		}
-		case 'download' : {
-			$aid = getIntFromRequest('aid');
-			session_redirect('/tracker/download.php?group_id='.$group_id.'&atid='.$atid.'&aid='.$aid.'&file_id='.$file_id);
-			break;
-		}
-		case 'detail' : {
-			$aid = getIntFromRequest('aid');
-
-			//
-			//	users can modify their own tickets in a limited way if they submitted them
-			//	even if they are not artifact admins
-			//
-			$ah=new ArtifactHtml($ath,$aid);
-			if (!$ah || !is_object($ah)) {
-				exit_error(_('Artifact Could Not Be Created'),'tracker');
-			} else if ($ah->isError()) {
-				exit_error($ah->getErrorMessage(),'tracker');
-			} else {
-				if (forge_check_perm ('tracker', $ath->getID(), 'manager')) {
-					include $gfwww.'tracker/mod.php';
-				} elseif (forge_check_perm ('tracker', $ath->getID(), 'tech')) {
-					include $gfwww.'tracker/mod-limited.php';
-				} else {
-					include $gfwww.'tracker/detail.php';
-				}
-			}
-			break;
-		}
-		default : {
-			include $gfwww.'tracker/browse.php';
-			break;
-		}
-	}
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>




More information about the Fusionforge-commits mailing list