This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.0 has been updated
       via  55eedf085a105e060f639fd483d638462b32fb5f (commit)
      from  9c84fbb18657f7e882597c3e00d968813f9e62d7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=55eedf085a105e060f639fd483d638462b32fb5f

commit 55eedf085a105e060f639fd483d638462b32fb5f
Author: Franck Villaume <[email protected]>
Date:   Sat Jul 23 12:13:01 2016 +0200

    fix PM Task CSV import [#823]

diff --git a/src/CHANGES b/src/CHANGES
index b2561d5..18e1fe5 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -1,5 +1,8 @@
 FusionForge 6.0.5:
 * Plugin SCM SVN: fix activity when SVN repository is private [#813] 
(TrivialDev)
+* Project Task: fix CSV import [#823] (Peter Katzmann)
+* Project Task: fix CSV import [#823]: add missing translation, add missing 
category in no header import,
+                fix start/end date format description (TrivialDev)
 * Tracker: fix artifact deletion with votes [#819] (TrivialDev)
 
 FusionForge 6.0.4:
diff --git a/src/common/pm/import_utils.php b/src/common/pm/import_utils.php
index a87af32..1bdd004 100644
--- a/src/common/pm/import_utils.php
+++ b/src/common/pm/import_utils.php
@@ -4,6 +4,7 @@
  *
  * Copyright 1999-2000, Tim Perdue/Sourceforge
  * Copyright 2002, Tim Perdue/GForge, LLC
+ * Copyright 2016, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -29,10 +30,10 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
        $pg = projectgroup_get_object($group_project_id);
        if (!$pg || !is_object($pg)) {
                $array['success']=false;
-               $array['errormessage']='Could Not Get ProjectGroup';
+               $array['errormessage']=_('Could Not Get ProjectGroup');
        } elseif ($pg->isError()) {
                $array['success']=false;
-               $array['errormessage']='Could Not Get ProjectGroup: 
'.$pg->getErrorMessage();
+               $array['errormessage']=_('Could Not Get ProjectGroup')._(': 
').$pg->getErrorMessage();
        } else {
                $count=count($tasks);
                //
@@ -68,7 +69,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                //
                if (count($invalid_names)) {
                        $array['success']=false;
-                       $array['errormessage']='Invalid Resource Name:';
+                       $array['errormessage']=_('Invalid Resource 
Name')._(':');
                        foreach ($invalid_names as $i) {
                                $array['errormessage'] .= ' ' . $i;
                        }
@@ -88,18 +89,18 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                //no task_id so it must be new - create it
                                if (!$tasks[$i]['id']) {
                                        if (!$tasks[$i]['notes']) {
-                                               $tasks[$i]['notes']='None 
Provided';
+                                               $tasks[$i]['notes']=_('None 
Provided');
                                        }
                                        //create the task
                                        $pt = new ProjectTask($pg);
                                        if (!$pt || !is_object($pt)) {
                                                $array['success']=false;
                                                $was_error=true;
-                                               $array['errormessage']='Could 
Not Get ProjectTask';
+                                               $array['errormessage']=_('Could 
Not Get ProjectTask');
                                        } elseif ($pt->isError()) {
                                                $array['success']=false;
                                                $was_error=true;
-                                               $array['errormessage']='Could 
Not Get ProjectTask: '.$pt->getErrorMessage();
+                                               $array['errormessage']=_('Could 
Not Get ProjectTask')._(': ').$pt->getErrorMessage();
                                        } else {
                                                //remap priority names=>numbers
                                                
$priority=$tasks[$i]['priority'];
@@ -136,7 +137,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                                                $category_id = 
db_result($res, 0, 'category_id');
                                                                if 
(!$category_id) {
                                                                        
$was_error=true;
-                                                                       
$array['errormessage']='Error No category named : '.$tasks[$i]['category'];
+                                                                       
$array['errormessage']=_('Error No category named')._(': 
').$tasks[$i]['category'];
                                                                        break;
                                                                }
                                                        }
@@ -159,7 +160,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                                        
$tasks[$i]['parent_id'])) {
                                                        $array['success']=false;
                                                        $was_error=true;
-                                                       
$array['errormessage']='Error Creating ProjectTask: '.$pt->getErrorMessage();
+                                                       
$array['errormessage']=_('Error Creating ProjectTask')._(': 
').$pt->getErrorMessage();
                                                        break 1;
 //                                                     continue;
                                                } else {
@@ -179,7 +180,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                        } elseif ($pt->isError()) {
                                                $array['success']=false;
                                                $was_error=true;
-                                               $array['errormessage']='Could 
Not Get ProjectTask: '.$pt->getErrorMessage();
+                                               $array['errormessage']=_('Could 
Not Get ProjectTask')._(': ').$pt->getErrorMessage();
                                        } else {
                                                //remap priority names=>numbers
                                                
$priority=$tasks[$i]['priority'];
@@ -218,7 +219,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                                                $category_id = 
db_result($res, 0, 'category_id');
                                                                if 
(!$category_id) {
                                                                        
$was_error=true;
-                                                                       
$array['errormessage']='Error No category named : '.$tasks[$i]['category'];
+                                                                       
$array['errormessage']=_('Error No category named')._(': 
').$tasks[$i]['category'];
                                                                        break;
                                                                }
                                                        }
@@ -243,7 +244,7 @@ function 
&pm_import_tasks($group_project_id,&$tasks,$replace=true) {
                                                        
$tasks[$i]['parent_id'])) {
                                                        $array['success']=false;
                                                        $was_error=true;
-                                                       
$array['errormessage']='Error Updating ProjectTask: '.$pt->getErrorMessage();
+                                                       
$array['errormessage']=_('Error Updating ProjectTask')._(': 
').$pt->getErrorMessage();
                                                        break 1;
 //                                                     continue;
 
diff --git a/src/www/pm/csv.php b/src/www/pm/csv.php
index 6b8d36e..dd74e9a 100644
--- a/src/www/pm/csv.php
+++ b/src/www/pm/csv.php
@@ -134,11 +134,11 @@ $cells[][] = _('Number of hours required to complete');
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
 $cells[][] = 'start_date';
-$cells[][] = _('The start date in MM-DD-YYYY HH:MM:SS format');
+$cells[][] = _('The start date in YYYY-MM-DD HH:MM:SS format');
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
 $cells[][] = 'end_date';
-$cells[][] = _('The end date in MM-DD-YYYY HH:MM:SS format');
+$cells[][] = _('The end date in YYYY-MM-DD HH:MM:SS format');
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
 $cells[][] = 'percent_complete';
diff --git a/src/www/pm/postuploadcsv.php b/src/www/pm/postuploadcsv.php
index 0cdf95b..4a7adf9 100644
--- a/src/www/pm/postuploadcsv.php
+++ b/src/www/pm/postuploadcsv.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
- * Copyright 2015, Franck Villaume - TrivialDev
+ * Copyright 2015-2016, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -54,7 +54,6 @@ if (isset($input_file) && isset($input_file['tmp_name']) &&
                $uploaded_data_type = $input_file['type'];
        }
 
-
        if ($uploaded_data_type === "text/plain") {
 
                $handle = fopen($input_file['tmp_name'], 'r');
@@ -90,7 +89,7 @@ if (isset($input_file) && isset($input_file['tmp_name']) &&
                        while (($cols = fgetcsv($handle, 4096, $sep)) !== 
false) {
 
                                $resources = array();
-                               for ($i=12;$i<17;$i++) {
+                               for ($i=13;$i<18;$i++) {
                                        if (trim($cols[$i]) != '') {
                                                $resources[] = 
array('user_name'=>$cols[$i]);
                                        }
@@ -98,7 +97,7 @@ if (isset($input_file) && isset($input_file['tmp_name']) &&
 
                                $dependentOn = array();
 
-                               for ($i=17;$i<30;$i=$i+3) {
+                               for ($i=18;$i<31;$i=$i+3) {
                                        if (trim($cols[$i]) != '') {
                                                $dependentOn[] = 
array('task_id'=>$cols[$i], 'msproj_id'=>$cols[$i+1], 'task_name'=>'', 
'link_type'=>$cols[$i+2]);
                                        }
@@ -109,18 +108,19 @@ if (isset($input_file) && isset($input_file['tmp_name']) 
&&
                                                'parent_id'=>$cols[2],
                                                'parent_msproj_id'=>$cols[3],
                                                'name'=>$cols[4],
-                                               'duration'=>$cols[5],
-                                               'work'=>$cols[6],
-                                               'start_date'=>$cols[7],
-                                               'end_date'=>$cols[8],
-                                               'percent_complete'=>$cols[9],
-                                               'priority'=>$cols[10],
+                                               'category'=>$cols[5],
+                                               'duration'=>$cols[6],
+                                               'work'=>$cols[7],
+                                               'start_date'=>$cols[8],
+                                               'end_date'=>$cols[9],
+                                               'percent_complete'=>$cols[10],
+                                               'priority'=>$cols[11],
                                                'resources'=>$resources,
                                                'dependenton'=>$dependentOn,
-                                               'notes'=>$cols[11]);
+                                               'notes'=>$cols[12]);
                        }
-                       $res = &pm_import_tasks($group_project_id, $tasks, 
getIntFromRequest('replace') == 1);
                }
+               $res = &pm_import_tasks($group_project_id, $tasks, 
getIntFromRequest('replace') == 1);
        } else {
                $res['errormessage'] = _('Wrong file type. Only plain CSV file 
supported');
        }

-----------------------------------------------------------------------

Summary of changes:
 src/CHANGES                    |  3 +++
 src/common/pm/import_utils.php | 23 ++++++++++++-----------
 src/www/pm/csv.php             |  4 ++--
 src/www/pm/postuploadcsv.php   | 24 ++++++++++++------------
 4 files changed, 29 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to