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, Branch_5_3 has been updated
via e0594b49a767c500051fff39f43959b0e47732f4 (commit)
via 32e8119ba1c0724af70cb2dc26a73398e8595854 (commit)
from e7d568d1b387245b5b2e3afab19d416708943907 (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 -----------------------------------------------------------------
commit e0594b49a767c500051fff39f43959b0e47732f4
Author: Franck Villaume <[email protected]>
Date: Mon Apr 6 13:46:01 2015 +0200
sync CHANGES
diff --git a/src/CHANGES b/src/CHANGES
index dd71232..88fd3fb 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -9,6 +9,7 @@ Fusionforge-5.3.3:
* Docman: fix move to files to fs script [#763] (TrivialDev)
* FRS: wrong tooltip displayed in admin page [#703] (TrivialDev)
* PM: fix test on success [#762] (TrivialDev)
+* PM: fix allow new tasks without replace older one [#761] patch from Philipp
Keidel (TrivialDev)
* Plugin AuthLDAP: error and warning messages displayed twice [#732]
(TrivialDev)
* Plugin scmhook: fix display when only one SCM plugin enabled [#735]
(TrivialDev)
* Plugin Hudson: fix global status in Hudson Job widget [#740] (TrivialDev)
commit 32e8119ba1c0724af70cb2dc26a73398e8595854
Author: PKeidel <[email protected]>
Date: Mon Mar 23 13:06:50 2015 +0100
Bugfix for Bug [#761]: Choose if csv task import should replace or append
the tasks
Signed-off-by: Franck Villaume <[email protected]>
diff --git a/src/common/pm/import_utils.php b/src/common/pm/import_utils.php
index a65b946..a87af32 100644
--- a/src/common/pm/import_utils.php
+++ b/src/common/pm/import_utils.php
@@ -23,7 +23,7 @@
require_once $gfcommon.'pm/ProjectTaskFactory.class.php';
-function &pm_import_tasks($group_project_id,&$tasks) {
+function &pm_import_tasks($group_project_id,&$tasks,$replace=true) {
$was_error = false;
$pg = projectgroup_get_object($group_project_id);
@@ -303,7 +303,7 @@ function &pm_import_tasks($group_project_id,&$tasks) {
//
// Delete unreferenced tasks
//
- if (!$was_error) {
+ if ($replace && !$was_error) {
$ptf = new ProjectTaskFactory($pg);
$pt_arr=& $ptf->getTasks();
for ($i=0; $i<count($pt_arr); $i++) {
diff --git a/src/www/pm/csv.php b/src/www/pm/csv.php
index 1d182ae..e0d40c6 100644
--- a/src/www/pm/csv.php
+++ b/src/www/pm/csv.php
@@ -86,13 +86,15 @@ $format .= " using '$sep' as separator.";
<h2><?php echo _('Import tasks using a CSV file'); ?></h2>
<form enctype="multipart/form-data" method="post" action="<?php echo
getStringFromServer('PHP_SELF')?>?group_project_id=<?php echo $group_project_id
?>&group_id=<?php echo $group_id ?>&func=postuploadcsv">
<p><?php echo _('Choose a file in the proper .csv format for uploading.');
?></p>
-<input type="file" name="userfile" required="required" />
+<input type="file" name="userfile" required="required" /><br/>
+<label><input type="radio" name="replace" value="1" checked /> <?php echo
_('Replace all tasks by the ones present in the file'); ?></label>
+<label><input type="radio" name="replace" value="0" /> <?php echo _('Add the
ones from the file to the existing ones'); ?></label>
+<br/><br/>
<input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
</form>
<h3><?php echo _('Notes'); ?></h3>
<ul>
-<li><?php echo _('Be careful, when importing a CSV file, all the tasks will be
replaced by the ones present in the file.'); ?></li>
<li><?php echo _('If project_task_id is empty, then a new task will be
created.'); ?></li>
<li><?php echo _('If project_task_id is present, then the corresponding task
will be updated.'); ?></li>
</ul>
diff --git a/src/www/pm/postuploadcsv.php b/src/www/pm/postuploadcsv.php
index 6ba1afd..3c2a0f2 100644
--- a/src/www/pm/postuploadcsv.php
+++ b/src/www/pm/postuploadcsv.php
@@ -107,8 +107,8 @@ if (isset($input_file) && isset($input_file['tmp_name']) &&
'dependenton'=>$dependentOn,
'notes'=>$cols[11]);
}
- $res=&pm_import_tasks($group_project_id, $tasks);
}
+ $res=&pm_import_tasks($group_project_id, $tasks,
getIntFromRequest('replace') == 1);
} else {
$res['errormessage'] = _('Parameter error');
}
-----------------------------------------------------------------------
Summary of changes:
src/CHANGES | 1 +
src/common/pm/import_utils.php | 4 ++--
src/www/pm/csv.php | 6 ++++--
src/www/pm/postuploadcsv.php | 2 +-
4 files changed, 8 insertions(+), 5 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits