diff --git a/class/actions_digiriskdolibarr.class.php b/class/actions_digiriskdolibarr.class.php index 2861266b8..80b569b02 100644 --- a/class/actions_digiriskdolibarr.class.php +++ b/class/actions_digiriskdolibarr.class.php @@ -1126,4 +1126,60 @@ public function addMoreActionsButtons($parameters, &$object, &$action) } } + + /** + * Overloading the showLinkedObjectBlock function : replacing the parent's function with the one below + * + * @param array $parameters Hook metadata (context, etc...) + * @param object $object The object to process + * @return int 0 < on error, 0 on success, 1 to replace standard code + * @throws Exception + */ + public function showLinkedObjectBlock($parameters, &$object) { + global $conf, $langs; + + if (strpos($parameters['context'], 'preventionplancard') !== false) { + $firePermits = saturne_fetch_all_object_type('FirePermit', '', '', 0, 0, ['customsql' => 'fk_preventionplan = ' . $object->id]); + $morehtmlright = $parameters['morehtmlright']; + + print load_fiche_titre($langs->trans('RelatedFirePermit'), $morehtmlright, '', 0, 0, 'showlinkedobjectblock'); + + print '
' . $langs->trans("Type") . ' | '; + print '' . $langs->trans("Ref") . ' | '; + print '' . $langs->trans("Label") . ' | '; + print '' . $langs->trans("DateStart") . ' | '; + print '' . $langs->trans("DateEnd") . ' | '; + print '' . $langs->trans("Status") . ' | '; + print '|
' . $langs->trans("None") . ' |