diff --git a/core/tpl/registrationcertificatefr_vehicle_history.tpl.php b/core/tpl/registrationcertificatefr_vehicle_history.tpl.php index 6e5df72..acf43fd 100644 --- a/core/tpl/registrationcertificatefr_vehicle_history.tpl.php +++ b/core/tpl/registrationcertificatefr_vehicle_history.tpl.php @@ -30,6 +30,9 @@ * $catLabels (array id => ['label' => string, 'data-html' => string]) * $eventsList (array of ActionComm) * $evtCatById (array evtId => Categorie) + * $alreadyLinkedFactureIds (array of facture ids already linked to an event) + * $alreadyLinkedPropalIds (array of propal ids already linked to an event) + * $alreadyLinkedControlIds (array of control ids already linked to an event) */ require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; @@ -45,6 +48,11 @@ // === Add event form === if (!empty($permissiontoadd)) { + // Exclude elements already linked to an existing event so the same one cannot be assigned twice + $factureFilter = !empty($alreadyLinkedFactureIds) ? ':0:(t.rowid:notin:' . implode(',', $alreadyLinkedFactureIds) . ')' : ''; + $propalFilter = !empty($alreadyLinkedPropalIds) ? ':0:(t.rowid:notin:' . implode(',', $alreadyLinkedPropalIds) . ')' : ''; + $controlFilter = !empty($alreadyLinkedControlIds) ? ':0:(t.rowid:notin:' . implode(',', $alreadyLinkedControlIds) . ')' : ''; + $out .= load_fiche_titre($langs->transnoentities('AddVehicleEvent'), '', 'dolicar_color@dolicar'); $out .= '