Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty media library #2759

Merged
merged 2 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions class/digiriskdocuments.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,17 @@ public function fillRiskData($odfHandler, $object, $outputlangs, $tmparray, $fil
if ($conf->global->DIGIRISKDOLIBARR_WORKUNITDOCUMENT_SHOW_TASK_DONE > 0) {
(($related_task->ref) ? $tmparray['actionPreventionCompleted'] .= $langs->trans('Ref') . ' : ' . $related_task->ref . "\n" : '');
(($responsible) ? $tmparray['actionPreventionCompleted'] .= $langs->trans('Responsible') . ' : ' . $responsible . "\n" : '');
$tmparray['actionPreventionCompleted'] .= $langs->trans('DateStart') . ' : ' . dol_print_date((($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_START_DATE && (!empty($related_task->date_start))) ? $related_task->date_start : $related_task->date_c), 'dayreduceformat') . ' - ' . $langs->trans('Deadline') . ' : ' . (($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_END_DATE && (!empty($related_task->date_end))) ? ' - ' . dol_print_date($related_task->date_end, 'dayreduceformat') : $langs->trans('NoData')) . "\n";
$tmparray['actionPreventionCompleted'] .= $langs->trans('DateStart') . ' : ';
if ($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_START_DATE && !empty($related_task->date_start)) {
$tmparray['actionPreventionCompleted'] .= dol_print_date(($related_task->date_start), 'dayreduceformat');
} else {
$tmparray['actionPreventionCompleted'] .= dol_print_date(($related_task->date_c), 'dayreduceformat');
}
if ($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_END_DATE && !empty($related_task->date_end)) {
$tmparray['actionPreventionCompleted'] .= "\n" . $langs->trans('Deadline') . ' : ' . dol_print_date($related_task->date_end, 'dayreduceformat') . "\n";
} else {
$tmparray['actionPreventionCompleted'] .= ' - ' . $langs->trans('Deadline') . ' : ' . $langs->trans('NoData') . "\n";
}
if (strcmp($related_task->budget_amount, '')) {
$tmparray['actionPreventionCompleted'] .= $langs->trans('Budget') . ' : ' . price($related_task->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . "\n";
}
Expand All @@ -531,7 +541,17 @@ public function fillRiskData($odfHandler, $object, $outputlangs, $tmparray, $fil
} else {
(($related_task->ref) ? $tmparray['actionPreventionUncompleted'] .= $langs->trans('Ref') . ' : ' . $related_task->ref . "\n" : '');
(($responsible) ? $tmparray['actionPreventionUncompleted'] .= $langs->trans('Responsible') . ' : ' . $responsible . "\n" : '');
$tmparray['actionPreventionUncompleted'] .= $langs->trans('DateStart') . ' : ' . dol_print_date((($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_START_DATE && (!empty($related_task->date_start))) ? $related_task->date_start : $related_task->date_c), 'dayreduceformat') . ' - ' . $langs->trans('Deadline') . ' : ' . (($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_END_DATE && (!empty($related_task->date_end))) ? ' - ' . dol_print_date($related_task->date_end, 'dayreduceformat') : $langs->trans('NoData')) . "\n";
$tmparray['actionPreventionUncompleted'] .= $langs->trans('DateStart') . ' : ';
if ($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_START_DATE && !empty($related_task->date_start)) {
$tmparray['actionPreventionUncompleted'] .= dol_print_date(($related_task->date_start), 'dayreduceformat');
} else {
$tmparray['actionPreventionUncompleted'] .= dol_print_date(($related_task->date_c), 'dayreduceformat');
}
if ($conf->global->DIGIRISKDOLIBARR_SHOW_TASK_END_DATE && !empty($related_task->date_end)) {
$tmparray['actionPreventionUncompleted'] .= "\n" . $langs->trans('Deadline') . ' : ' . dol_print_date($related_task->date_end, 'dayreduceformat') . "\n";
} else {
$tmparray['actionPreventionUncompleted'] .= ' - ' . $langs->trans('Deadline') . ' : ' . $langs->trans('NoData') . "\n";
}
if (strcmp($related_task->budget_amount, '')) {
$tmparray['actionPreventionUncompleted'] .= $langs->trans('Budget') . ' : ' . price($related_task->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . ' - ';
}
Expand Down
5 changes: 5 additions & 0 deletions core/tpl/medias/digiriskdolibarr_medias_gallery_modal.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@
</div>
</div>
<div class="ecm-photo-list-content">
<?php
// Display media library is empty if no media uploaded
if (!is_array($_FILES['userfile']['tmp_name'])) {
print($langs->trans("EmptyMediaLibrary"));
} ?>
<div class="wpeo-gridlayout grid-4 grid-gap-3 grid-margin-2 ecm-photo-list ecm-photo-list">
<?php
$relativepath = 'digiriskdolibarr/medias/thumbs';
Expand Down
1 change: 1 addition & 0 deletions langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ MediaMaxWidthLargeDescription = Largeur du média (dimension large) avec pour ra
MediaMaxHeightLarge = Hauteur du média large
MediaMaxHeightLargeDescription = Hauteur du média (dimension large) avec pour ratio 16:9
ErrorFileSizeTooLarge = Le fichier est trop volumineux
EmptyMediaLibrary = La bibliothèque de média est vide


#
Expand Down