|
21 | 21 | // Define table headers with appropriate translations
|
22 | 22 | $tableHeaders = [
|
23 | 23 | $langs->trans('Nom'),
|
| 24 | + $langs->trans('ControlledObject'), |
24 | 25 | $langs->trans('Verdict'),
|
25 | 26 | $langs->trans('NoteControl'),
|
26 | 27 | $langs->trans('Answers'),
|
|
31 | 32 |
|
32 | 33 | // Create header row using divs
|
33 | 34 | print '<div class="table-row header-row">';
|
| 35 | +$i = 0; |
34 | 36 | foreach ($tableHeaders as $header) {
|
35 |
| - print '<div class="table-cell header-cell center">' . $header . '</div>'; |
| 37 | + print '<div class="table-cell header-cell '. ($i >= 2 ? 'center' : '').'">' . $header . '</div>'; |
| 38 | + $i++; |
36 | 39 | }
|
37 | 40 | print '</div>';
|
38 | 41 |
|
|
43 | 46 | $object = $massControl;
|
44 | 47 | $massControl->fetch_optionals();
|
45 | 48 | $massControl->fetchLines();
|
46 |
| - // Fetch the public note if it exists |
| 49 | + $massControl->fetchObjectLinked('', '', $massControl->id, 'digiquali_control', 'OR', 1, 'sourcetype', 0); |
| 50 | + //get object controlled |
| 51 | + $linkableElements = get_sheet_linkable_objects(); |
47 | 52 |
|
48 | 53 | print '<div class="table-row sub-control-'. $massControl->id .'">';
|
49 |
| - print '<div class="table-cell center">' . $massControl->getNomUrl(1) . '</div>'; |
| 54 | + print '<div class="table-cell">' . $massControl->getNomUrl(1) . '</div>'; |
| 55 | + print '<div class="table-cell">'; |
| 56 | + foreach ($linkableElements as $linkableElementType => $linkableElement) { |
| 57 | + if ($linkableElement['conf'] > 0 && (!empty($object->linkedObjectsIds[$linkableElement['link_name']]))) { |
| 58 | + $className = $linkableElement['className']; |
| 59 | + $linkedObject = new $className($db); |
| 60 | + foreach($object->linkedObjectsIds[$linkableElement['link_name']] as $linkedObjectId) { |
| 61 | + $linkedObject->fetch($linkedObjectId); |
| 62 | + |
| 63 | + |
| 64 | + print $linkedObject->getNomUrl(1); |
| 65 | + |
| 66 | + if ($linkedObject->array_options['options_qc_frequency'] > 0) { |
| 67 | + print ' '; |
| 68 | + print '<strong>'; |
| 69 | + print $langs->transnoentities('QcFrequency') . ' : ' . $linkedObject->array_options['options_qc_frequency']; |
| 70 | + print '</strong>'; |
| 71 | + } |
| 72 | + |
| 73 | + print '<br/>'; |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | + print '</div>'; |
50 | 78 |
|
51 | 79 | // Verdict section with interactive OK/KO buttons
|
52 | 80 | print '<div class="table-cell center">';
|
|
0 commit comments