* fix generating Intervention from Task Time * remove comment * fix CI * FIX CI
This commit is contained in:
parent
c724800a05
commit
d359a4d7a5
2 changed files with 15 additions and 2 deletions
|
|
@ -1469,7 +1469,7 @@ class Fichinter extends CommonObject
|
|||
|
||||
if ($result >= 0) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
return $line->id;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ if ($action == 'confirm_generateinter') {
|
|||
$arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration;
|
||||
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
|
||||
$arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note;
|
||||
$arrayoftasks[$object->timespent_id]['date'] = date('Y-m-d H:i:s', $object->timespent_datehour);
|
||||
$arrayoftasks[$object->timespent_id]['date'] = $object->timespent_datehour;
|
||||
}
|
||||
|
||||
foreach ($arrayoftasks as $timespent_id => $value) {
|
||||
|
|
@ -857,6 +857,19 @@ if ($action == 'confirm_generateinter') {
|
|||
|
||||
// Add lines
|
||||
$lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), (int) $value['date'], $value['timespent']);
|
||||
|
||||
if ($lineid > 0) {
|
||||
// Link timespent to intervention
|
||||
$timespent = new TimeSpent($db);
|
||||
$timespent->fetch($timespent_id);
|
||||
$timespent->intervention_id = $tmpinter->id;
|
||||
$timespent->intervention_line_id = $lineid;
|
||||
$result = $timespent->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($timespent->error, $timespent->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue