diff --git a/class/actions_digiquali.class.php b/class/actions_digiquali.class.php index b9778f97..4f442eb0 100644 --- a/class/actions_digiquali.class.php +++ b/class/actions_digiquali.class.php @@ -377,7 +377,7 @@ public function printMainArea(array $parameters): int global $conf, $mysoc; // Do something only for the current context. - if (in_array($parameters['currentcontext'], ['publiccontrol', 'publicsurvey'])) { + if (in_array($parameters['currentcontext'], ['publiccontrol', 'publicsurvey', 'publiccontrolhistory'])) { if (!empty($conf->global->SATURNE_SHOW_COMPANY_LOGO)) { // Define logo and logoSmall. $logoSmall = $mysoc->logo_small; diff --git a/core/tpl/digiquali_control_list.tpl.php b/core/tpl/digiquali_control_list.tpl.php index a9a6a7cc..5f39392b 100644 --- a/core/tpl/digiquali_control_list.tpl.php +++ b/core/tpl/digiquali_control_list.tpl.php @@ -325,7 +325,7 @@ $disableSortField = dol_strlen($fromtype) > 0 ? preg_match('/'. $invertedElementElementFields[$fromtype] .'/',$key) : 0; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? 'maxwidthsearch' : $val['css']) : $val['csslist']); - if ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; + if (in_array($key, ['days_remaining_before_next_control', 'status', 'verdict'])) $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; elseif (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') $cssforfield .= ($cssforfield ? ' ' : '').'right'; @@ -377,7 +377,7 @@ { $cssforfield = (empty($val['css']) ? '' : $val['css']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'center'; - elseif ($key == 'status') $cssforfield .= ($cssforfield ? ' ' : '').'center'; + elseif (in_array($key, ['days_remaining_before_next_control', 'status', 'verdict'])) $cssforfield .= ($cssforfield ? ' ' : '').'center'; if (in_array($val['type'], array('timestamp'))) $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; elseif ($key == 'ref') $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; @@ -397,17 +397,15 @@ print $sheet->getNomUrl(1); } elseif ($key == 'verdict') { - print dol_strlen($object->$key) > 0 ? $object->fields[$key]['arrayofkeyval'][$object->$key] : "N/A"; + $verdictColor = $object->$key == 1 ? 'green' : ($object->$key == 2 ? 'red' : 'grey'); + print dol_strlen($object->$key) > 0 ? '
' : "N/A"; } elseif ($key == 'days_remaining_before_next_control') { if (dol_strlen($object->next_control_date) > 0) { $nextControl = floor(($object->next_control_date - dol_now('tzuser'))/(3600 * 24)); - } else { - $nextControl = 0; + $nextControlColor = $nextControl < 0 ? 'red' : ($nextControl <= 30 ? 'orange' : ($nextControl <= 60 ? 'yellow' : 'green')); + print ' '; } - $nextControlColor = $nextControl < 0 ? 'red' : ($nextControl <= 30 ? 'orange' : ($nextControl <= 60 ? 'yellow' : 'green')); - - print ' '; } elseif (in_array($key, $revertedElementFields)) { $linkedElement = $linkNameElementCorrespondance[$elementElementFields[$key]]; diff --git a/core/tpl/digiquali_public_control.tpl.php b/core/tpl/digiquali_public_control.tpl.php index 53c9205e..6fbac90f 100644 --- a/core/tpl/digiquali_public_control.tpl.php +++ b/core/tpl/digiquali_public_control.tpl.php @@ -1,6 +1,6 @@
+ ' . $langs->trans('VerdictObject'); ?>
+ array_options['options_qc_frequency'] > 0 && getDolGlobalInt('SHOW_QC_FREQUENCY_PUBLIC_INTERFACE')) {
+ print ' ' . $langs->transnoentities('QcFrequency') . ' : ' . $linkedObject->array_options['options_qc_frequency']; + } ?> + |
+
+ status == $object::STATUS_DRAFT) {
+ $verdictObjectColor = 'primary';
+ $pictoObjectColor = 'hourglass-start';
+ } elseif ($object->status == $object::STATUS_VALIDATED) {
+ $verdictObjectColor = 'primary';
+ $pictoObjectColor = 'hourglass-half';
+ } elseif (!empty($object->next_control_date) && $object->next_control_date - dol_now() < 0) {
+ $verdictObjectColor = 'red';
+ $pictoObjectColor = 'exclamation';
+ } elseif ($object->verdict > 1) {
+ $verdictObjectColor = 'red';
+ $pictoObjectColor = 'exclamation';
+ } else {
+ $verdictObjectColor = 'green';
+ $pictoObjectColor = 'check';
+ }
+ print ' '; ?> + |
+ getNomUrl(1, 'nolink', 1) . ' '; + print ' ' . $langs->trans('Verdict') . ' '; + print ' ' . saturne_show_medias_linked('digiquali', $conf->digiquali->multidir_output[$conf->entity] . '/control/' . $object->ref . '/qrcode/', 'small', 1, 0, 0, 0, 70, 70, 0, 0, 1, 'control/'. $object->ref . '/qrcode/', $object, '', 0, 0) . ' '; ?>
+ |
+
+ verdict == 1 ? 'green' : ($object->verdict == 2 ? 'red' : 'grey');
+ if ($object->status < $object::STATUS_LOCKED) {
+ print $object->getLibStatut(5);
print ' '; - echo dol_print_date($object->control_date, 'day'); ?> - - - next_control_date)) : ?> -
-
-
-
-
+ print ' ' . $langs->trans('NonFinalVerdict');
+ } else {
+ print ' ';
+ }
+ if (!empty($object->next_control_date)) {
+ print '
- picto, 'class="pictofixedwidth"') . $langs->trans('NextControl') . '
- '; - echo img_picto('', 'calendar', 'class="pictofixedwidth"') . $langs->trans('NextControlDate'); ?> -
- next_control_date - dol_now()) > 0) ? 'badge-status4' : 'badge-status8') . '">' . floor(($object->next_control_date - dol_now())/(3600 * 24)) . ' ' . $langs->trans('Days') . ' '; - echo dol_print_date($object->next_control_date, 'day'); ?> - ' . $langs->trans('NextControl') . ' ';
+ print ' ';
+ } ?>
+ '; + $nextControl = floor(($object->next_control_date - dol_now())/(3600 * 24)); + $nextControlColor = $nextControl < 0 ? 'red' : ($nextControl <= 30 ? 'orange' : ($nextControl <= 60 ? 'yellow' : 'green')); + print dol_print_date($object->next_control_date, 'day') . ' ' . $langs->trans('Remain') . ' '; + print ' |