diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 529449d86d4..5c4b74a04e6 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -185,8 +185,8 @@ if ($action == 'add') { if ($newfichinterid > 0) { // Now we add line of details - foreach ($object->lines as $ficheinterligne) { - $newinter->addline($user, $newfichinterid, $ficheinterligne->desc, '', $ficheinterligne->duree, ''); + foreach ($object->lines as $line) { + $newinter->addline($user, $newfichinterid, $line->desc, '', $line->duree, ''); } // on update le nombre d'inter crée à partir du modèle diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 36e54f2effe..6943b5335f7 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1648,8 +1648,7 @@ elseif ($id > 0 || ! empty($ref)) // create intervention model if ($conf->global->MAIN_FEATURES_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print '
'; - // This feature is not yet implemented - print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; + print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; print '
'; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 3f5c407e68e..4fabf64be49 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -193,7 +193,7 @@ class FichinterRec extends Fichinter //var_dump($fichintsrc->lines[$i]); $result_insert = $this->addline( $fichintsrc->lines[$i]->desc, - $fichintsrc->lines[$i]->duree, + $fichintsrc->lines[$i]->duration, $fichintsrc->lines[$i]->datei, $fichintsrc->lines[$i]->rang, $fichintsrc->lines[$i]->subprice, @@ -352,6 +352,7 @@ class FichinterRec extends Fichinter $line->fk_product_type = $objp->fk_product_type; // Type of product $line->qty = $objp->qty; $line->duree = $objp->duree; + $line->duration = $objp->duree; $line->datei = $objp->date; $line->subprice = $objp->subprice; $line->tva_tx = $objp->tva_tx; @@ -500,7 +501,7 @@ class FichinterRec extends Fichinter $sql.= ", label"; $sql.= ", description"; $sql.= ", date"; - //$sql.= ", duree"; + $sql.= ", duree"; //$sql.= ", price"; //$sql.= ", qty"; //$sql.= ", tva_tx"; @@ -520,7 +521,7 @@ class FichinterRec extends Fichinter $sql.= ", ".(! empty($label)?"'".$this->db->escape($label)."'":"null"); $sql.= ", ".(! empty($desc)?"'".$this->db->escape($desc)."'":"null"); $sql.= ", ".(! empty($datei)?"'".$this->db->idate($datei)."'":"null"); - //$sql.= ", ".$duration; + $sql.= ", ".$duration; //$sql.= ", ".price2num($pu_ht); //$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null")); //$sql.= ", ".price2num($txtva);