Skip to content

Commit

Permalink
Merge pull request #2231 from Evarisk/9.5.0
Browse files Browse the repository at this point in the history
9.5.0
  • Loading branch information
nicolas-eoxia authored Aug 31, 2022
2 parents e19825c + 417ac2b commit a037c1f
Show file tree
Hide file tree
Showing 45 changed files with 8,232 additions and 316 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Informations

Version du module: 9.4.0
Version du module: 9.5.0

Dernière mise à jour: 25/07/2022
Dernière mise à jour: 31/08/2022

Prérequis:
* Dolibarr min version 14.0.0
* Dolibarr min version 15.0.2
* Dolibarr min version 15.0.3

Thème: Eldy Menu

Expand Down
51 changes: 48 additions & 3 deletions admin/config/digiriskdocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

// Libraries
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';

require_once '../../lib/digiriskdolibarr.lib.php';

Expand Down Expand Up @@ -92,6 +93,53 @@
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
}

if ($action == 'setModuleOptions') {
$subdir = GETPOST('path');
$subdir = preg_replace('/DOL_DATA_ROOT\/ecm\/digiriskdolibarr\//', '', $subdir);
$subdir = preg_replace('/\//', '', $subdir);

$ecmdir = $conf->ecm->multidir_output[$conf->entity?:1];
$path = $ecmdir . '/digiriskdolibarr/'. $subdir .'/';

if (!empty($_FILES)) {
if (is_array($_FILES['userfile']['tmp_name'])) {
$userfiles = $_FILES['userfile']['tmp_name'];
} else {
$userfiles = array($_FILES['userfile']['tmp_name']);
}

foreach ($userfiles as $key => $userfile) {
if (empty($_FILES['userfile']['tmp_name'][$key])) {
$error++;
if ($_FILES['userfile']['error'][$key] == 1 || $_FILES['userfile']['error'][$key] == 2) {
setEventMessages($langs->trans('ErrorFileSizeTooLarge'), null, 'errors');
} else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors');
}
}
if (preg_match('/__.*__/', $_FILES['userfile']['name'][$key])) {
$error++;
setEventMessages($langs->trans('ErrorWrongFileName'), null, 'errors');
}
}

if (!$error) {
// Define if we have to generate thumbs or not
if (GETPOST('section_dir', 'alpha')) {
$generatethumbs = 0;
}
$allowoverwrite = (GETPOST('overwritefile', 'int') ? 1 : 0);

if (!empty($upload_dirold) && !empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
$result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object);
} elseif (!empty($path)) {
$result = dol_add_file_process($path, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '' );
}
}
}

}


/*
* View
Expand Down Expand Up @@ -232,9 +280,6 @@
}
}

/*
* Documents models for Listing Risks Action
*/
$trad = "DigiriskTemplateDocument" . $type;
print load_fiche_titre($langs->trans($trad), '', '');

Expand Down
40 changes: 22 additions & 18 deletions admin/config/riskassessmentdocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,18 +282,20 @@

$result = !empty($conf->mc->entities['risk']) ? strpos($conf->mc->entities['risk'], $conf->entity) : 0;

if ($conf->multicompany->enabled && !empty($conf->mc->sharings['risk']) && $result > 0) {
print '<tr class="oddeven"><td>';
print $langs->trans('ShowSharedRisks');
print "</td><td>";
print $langs->trans('ShowSharedRisksDescription');
print '</td>';
print '<tr class="oddeven"><td>';
print $langs->trans('ShowSharedRisks');
print "</td><td>";
print $langs->trans('ShowSharedRisksDescription');
print '</td>';

print '<td class="center">';
print '<td class="center">';
if ($conf->multicompany->enabled && !empty($conf->mc->sharings['risk']) && $result > 0) {
print ajax_constantonoff('DIGIRISKDOLIBARR_SHOW_SHARED_RISKS');
print '</td>';
print '</tr>';
} else {
print $langs->trans('DisabledSharedElement');
}
print '</td>';
print '</tr>';

print '</table>';
print '<hr>';
Expand Down Expand Up @@ -784,18 +786,20 @@

$result = !empty($conf->mc->entities['risksign']) ? strpos($conf->mc->entities['risksign'], $conf->entity) : 0;

if ($conf->multicompany->enabled && !empty($conf->mc->sharings['risksign']) && $result > 0) {
print '<tr class="oddeven"><td>';
print $langs->trans('ShowSharedRiskSigns');
print "</td><td>";
print $langs->trans('ShowSharedRiskSignsDescription');
print '</td>';
print '<tr class="oddeven"><td>';
print $langs->trans('ShowSharedRiskSigns');
print "</td><td>";
print $langs->trans('ShowSharedRiskSignsDescription');
print '</td>';

print '<td class="center">';
print '<td class="center">';
if ($conf->multicompany->enabled && !empty($conf->mc->sharings['risksign']) && $result > 0) {
print ajax_constantonoff('DIGIRISKDOLIBARR_SHOW_SHARED_RISKSIGNS');
print '</td>';
print '</tr>';
} else {
print $langs->trans('DisabledSharedElement');
}
print '</td>';
print '</tr>';
print '</table>';

// Page end
Expand Down
3 changes: 2 additions & 1 deletion admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@

print '<div style="text-indent: 3em"><br>' . '<i class="fas fa-2x fa-calendar-alt" style="padding: 10px"></i> ' . $langs->trans("AgendaModuleRequired") . '<br></div>';
print '<div style="text-indent: 3em"><br>' . '<i class="fas fa-2x fa-tools" style="padding: 10px"></i> ' . $langs->trans("HowToSetupOtherModules") . ' ' . '<a href=' . '"../../../admin/modules.php">' . $langs->trans('ConfigMyModules') . '</a>' . '<br></div>';
print '<div style="text-indent: 3em"><br>' . '<i class="fas fa-2x fa-globe" style="padding: 10px"></i> ' . $langs->trans("AvoidLogoProblems") . ' ' . '<a href="' . $langs->trans('LogoHelpLink') . '">' . $langs->trans('LogoHelpLink') . '</a>' . '<br></div>';
print '<div style="text-indent: 3em"><br>' . '<i class="fas fa-2x fa-file-alt" style="padding: 10px"></i> ' . $langs->trans("AvoidLogoProblems") . ' ' . '<a href="' . $langs->trans('LogoHelpLink') . '">' . $langs->trans('LogoHelpLink') . '</a>' . '<br></div>';
print '<div style="text-indent: 3em"><br>' . '<i class="fab fa-2x fa-css3-alt" style="padding: 10px"></i> ' . $langs->trans("HowToSetupIHM") . ' ' . '<a href=' . '"../../../admin/ihm.php">' . $langs->trans('ConfigIHM') . '</a>' . '<br></div>';
print '<div style="text-indent: 3em"><br>' . '<i class="fas fa-2x fa-globe" style="padding: 10px"></i> ' . $langs->trans("HowToSharedElement") . ' ' . '<a href="' . $langs->trans('HowToSharedElementLink') . '">' . $langs->trans('ConfigSharedElement') . '</a>' . '<br></div>';

print load_fiche_titre($langs->trans("DigiriskData"), '', '');

Expand Down
Loading

0 comments on commit a037c1f

Please sign in to comment.