';
}
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 9a1819fc46c..dad46c96989 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -100,7 +100,7 @@ class Task extends CommonObject
// Clean parameters
$this->label = trim($this->label);
$this->description = trim($this->description);
-
+
// Check parameters
// Put here code to add control on parameters values
@@ -128,7 +128,7 @@ class Task extends CommonObject
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
$sql.= ", ".($this->planned_workload!=''?$this->planned_workload:0);
- $sql.= ", ".($this->progress!=''?$this->progress:0);
+ $sql.= ", ".(($this->progress!='' && $this->progress >= 0)?$this->progress:'null');
$sql.= ")";
$this->db->begin();
@@ -300,7 +300,7 @@ class Task extends CommonObject
$sql.= " planned_workload=".((isset($this->planned_workload) && $this->planned_workload != '')?$this->planned_workload:"null").",";
$sql.= " dateo=".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null').",";
$sql.= " datee=".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null').",";
- $sql.= " progress=".$this->progress.",";
+ $sql.= " progress=".(($this->progress!='' && $this->progress >= 0)?$this->progress:'null').",";
$sql.= " rang=".((!empty($this->rang))?$this->rang:"0");
$sql.= " WHERE rowid=".$this->id;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 35a7812d4fa..06bd2c9c730 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -391,14 +391,14 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print $form->select_date(($date_end?$date_end:-1),'datee',1,1,0,'',1,1,1);
print '';
- // planned workload
+ // Planned workload
print ''.$langs->trans("PlannedWorkload").' ';
print $form->select_duration('planned_workload', $planned_workload?$planned_workload : $object->planned_workload,0,'text');
print ' ';
// Progress
print ''.$langs->trans("ProgressDeclared").' ';
- print $formother->select_percent($progress,'progress');
+ print $formother->select_percent($progress,'progress',0,5,0,100,1);
print ' ';
// Description
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index f0a55517881..603a69a07b0 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -391,12 +391,12 @@ if ($id > 0 || ! empty($ref))
// Planned workload
print ''.$langs->trans("PlannedWorkload").' ';
- print $form->select_duration('planned_workload',$object->planned_workload,0,'text');
+ print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
print ' ';
// Progress declared
- print ''.$langs->trans("ProgressDeclared").' ';
- print $formother->select_percent($object->progress,'progress');
+ print ' '.$langs->trans("ProgressDeclared").' ';
+ print $formother->select_percent($object->progress,'progress',0,5,0,100,1);
print ' ';
// Description