[Fusionforge-commits] r7420 - trunk/gforge/contrib

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 15 11:02:58 CEST 2009


Author: lolando
Date: 2009-04-15 11:02:58 +0200 (Wed, 15 Apr 2009)
New Revision: 7420

Modified:
   trunk/gforge/contrib/migrate-from-gfas.pl
Log:
Migrate cost estimation and completeness for tasks

Modified: trunk/gforge/contrib/migrate-from-gfas.pl
===================================================================
--- trunk/gforge/contrib/migrate-from-gfas.pl	2009-04-15 09:02:50 UTC (rev 7419)
+++ trunk/gforge/contrib/migrate-from-gfas.pl	2009-04-15 09:02:58 UTC (rev 7420)
@@ -657,7 +657,31 @@
 	$dbhFF->rollback ;
 	die "Rolling back" ;
 } ;
+
+$sthAS = $dbhAS->prepare ("select tefd.field_data, ti.tracker_item_id from tracker_extra_field_data tefd, tracker_extra_field tef, tracker_item ti, tracker t where tefd.tracker_item_id = ti.tracker_item_id and ti.tracker_id = t.tracker_id and t.datatype = 2 and tefd.tracker_extra_field_id = tef.tracker_extra_field_id and field_name = 'Estimated Effort (Hours)'") ;
+$sthFF = $dbhFF->prepare ("update project_task set hours=? where project_task_id=?") ;
+$sthAS->execute ;
+while (@arrayAS = $sthAS->fetchrow_array) {
+    my $hours = $arrayAS[0] ;
+    my $ptid = $arrayAS[1] ;
+    next unless $hours =~ /^[0-9]+$/ ;
+    $sthFF->execute ($hours, $ptid) ;
+}
+$sthAS->finish ;
+$sthFF->finish ;
 		      
+$sthAS = $dbhAS->prepare ("select tefd.field_data, ti.tracker_item_id from tracker_extra_field_data tefd, tracker_extra_field tef, tracker_item ti, tracker t where tefd.tracker_item_id = ti.tracker_item_id and ti.tracker_id = t.tracker_id and t.datatype = 2 and tefd.tracker_extra_field_id = tef.tracker_extra_field_id and field_name = 'Percent Complete (0-100)'") ;
+$sthFF = $dbhFF->prepare ("update project_task set percent_complete=? where project_task_id=?") ;
+$sthAS->execute ;
+while (@arrayAS = $sthAS->fetchrow_array) {
+    my $percent = $arrayAS[0] ;
+    my $ptid = $arrayAS[1] ;
+    next unless $percent =~ /^[0-9]+$/ ;
+    $sthFF->execute ($percent, $ptid) ;
+}
+$sthAS->finish ;
+$sthFF->finish ;
+		      
 $map = {
     'tia.tracker_item_id' => 'project_task_id',
     'tia.assignee' => 'assigned_to_id',




More information about the Fusionforge-commits mailing list