From 9293a0742ad625f0ba45dd08f5037fcd50c37648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20David?= Date: Tue, 13 Aug 2024 10:31:08 +0200 Subject: [PATCH] #1680 [Control] add: multi control list template --- core/tpl/digiquali_mass_control_list.tpl.php | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 core/tpl/digiquali_mass_control_list.tpl.php diff --git a/core/tpl/digiquali_mass_control_list.tpl.php b/core/tpl/digiquali_mass_control_list.tpl.php new file mode 100644 index 00000000..d42f7ab9 --- /dev/null +++ b/core/tpl/digiquali_mass_control_list.tpl.php @@ -0,0 +1,56 @@ +fetchAll('', '', 0, 0, ['fk_control' => $object->id]); + +// Start the responsive table container +print '
'; + +// Load and print the title for the control list section +print load_fiche_titre($langs->trans('LinkedControlList'), '', ''); + +// Start the table +print '
'; + +// Define table headers with appropriate translations +$tableHeaders = [ + $langs->trans('Nom'), + $langs->trans('Verdict'), + $langs->trans('NoteControl'), + $langs->trans('QRCode'), + $langs->trans('Document'), + $langs->trans('Action'), +]; + +// Create header row using divs +print '
'; +foreach ($tableHeaders as $header) { + print '
' . $header . '
'; +} +print '
'; + +// Check if there are any mass controls and print them +if (is_array($massControlList) && !empty($massControlList)) { + foreach ($massControlList as $massControl) { + print '
'; + print '
' . $massControl->getNomUrl(1) . '
'; + print '
' . $massControl->getVerdict() . '
'; + print '
'; + } +} else { + // If no mass controls are found, display a message + print '
'; + print '
' . $langs->trans('NoMassControlFound') . '
'; + print '
'; +} + +print '
'; // End of table +print '
'; // End of responsive container + +?>