Skip to content

Commit

Permalink
Merge pull request #3789 from Evarisk/develop
Browse files Browse the repository at this point in the history
9.15.0
  • Loading branch information
nicolas-eoxia authored Apr 8, 2024
2 parents a780251 + a45fe24 commit 39e7c4a
Show file tree
Hide file tree
Showing 108 changed files with 2,356 additions and 2,254 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
## Informations

- Numéro du module : 436302
- Dernière mise à jour : 19/01/2024
- Dernière mise à jour : 08/04/2024
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 9.14.1
- Version : 9.15.0
- PHP : 7.4.33
- Compatibilité : Dolibarr 16.0.0 - 18.0.4
- Saturne Framework : 1.2.1
- Compatibilité : Dolibarr 16.0.0 - 19.0.1
- Saturne Framework : 1.3.0

## Liens

Expand Down
47 changes: 3 additions & 44 deletions admin/config/accident.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');

// Initialize technical objects
$usertmp = new User($db);
$accident = new Accident($db);
$workstop = new AccidentWorkStop($db);
$lesion = new AccidentLesion($db);

// Security check - Protection if external user
$permissiontoread = $user->rights->digiriskdolibarr->adminpage->read;
Expand All @@ -76,40 +69,8 @@
}
}

if ($action == 'updateMask') {
$accidentMaskConst = GETPOST('maskconstaccident', 'alpha');
$accidentMask = GETPOST('maskaccident', 'alpha');

if ($accidentMaskConst) {
$res = dolibarr_set_const($db, $accidentMaskConst, $accidentMask, 'chaine', 0, '', $conf->entity);
}

if (!$res > 0) {
$error++;
}

if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null);
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

if ($action == 'setmod') {
if (preg_match('_accidentinvestigation_', $value)) {
$constforval = 'DIGIRISKDOLIBARR_ACCIDENTINVESTIGATION_ADDON';
} else if (preg_match('_accidentworkstop_', $value)) {
$constforval = 'DIGIRISKDOLIBARR_ACCIDENTWORKSTOP_ADDON';
} else if (preg_match('_accidentlesion_', $value)) {
$constforval = 'DIGIRISKDOLIBARR_ACCIDENTLESION_ADDON';
} else if (preg_match('_accident_', $value)) {
$constforval = 'DIGIRISKDOLIBARR_ACCIDENT_ADDON';
} else {
$constforval = '';
}

dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
}
// Actions set_mod, update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
Expand Down Expand Up @@ -164,8 +125,6 @@

$object = new AccidentLesion($db);

$objectModSubdir = 'digiriskelement';

require __DIR__ . '/../../../saturne/core/tpl/admin/object/object_numbering_module_view.tpl.php';

print load_fiche_titre('<i class="fas fa-user-injured"></i> ' . $langs->trans("AccidentInvestigationManagement"), '', '');
Expand Down Expand Up @@ -194,7 +153,7 @@

$langs->load("projects");
print '<tr class="oddeven"><td><label for="ACCProject">' . $langs->trans("ACCProject") . '</label></td><td>';
$formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_ACCIDENT_PROJECT, 'ACCProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
$formproject->select_projects(-1, $conf->global->DIGIRISKDOLIBARR_ACCIDENT_PROJECT, 'ACCProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';
Expand Down
14 changes: 3 additions & 11 deletions admin/config/digiriskelement.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
$digiriskelement = new DigiriskElement($db);

// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');

// Security check - Protection if external user
Expand All @@ -57,17 +58,8 @@
* Actions
*/

if (GETPOST('action') == 'setmod') {
$value = GETPOST('value');
$valueArray = explode('_', $value);
$objectType = $valueArray[1];

dolibarr_set_const($db, 'DIGIRISKDOLIBARR_'. strtoupper($objectType) .'_ADDON', $value, 'chaine', 0, '', $conf->entity);
}

if (GETPOST('action') == 'updateMask') {
dolibarr_set_const($db, GETPOST('mask'), GETPOST('addon_value'), 'chaine', 0, '', $conf->entity);
}
// Actions set_mod, update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
Expand Down
31 changes: 3 additions & 28 deletions admin/config/firepermit.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');

$type = 'firepermit';
$error = 0;

// Initialize technical objects
Expand Down Expand Up @@ -80,30 +78,8 @@
}
}

if ($action == 'updateMask') {
$firePermitMaskConst = GETPOST('maskconstfirepermit', 'alpha');
$firePermitMask = GETPOST('maskfirepermit', 'alpha');

if ($firePermitMaskConst) $res = dolibarr_set_const($db, $firePermitMaskConst, $firePermitMask, 'chaine', 0, '', $conf->entity);

if ( ! $res > 0) $error++;

if ( ! $error) {
setEventMessages($langs->trans("SetupSaved"), null);
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

if ($action == 'setmod') {
$constforval = 'DIGIRISKDOLIBARR_' . strtoupper($type) . "_ADDON";
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
}

if ($action == 'setmodFirePermitDet') {
$constforval = 'DIGIRISKDOLIBARR_' . strtoupper('firepermitdet') . "_ADDON";
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
}
// Actions set_mod, update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

if ($action == 'setMaitreOeuvre') {
$masterWorkerId = GETPOST('maitre_oeuvre');
Expand Down Expand Up @@ -151,7 +127,7 @@

$langs->load("projects");
print '<tr class="oddeven"><td><label for="FPRProject">' . $langs->trans("FPRProject") . '</label></td><td>';
$formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_FIREPERMIT_PROJECT, 'FPRProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
$formproject->select_projects(-1, $conf->global->DIGIRISKDOLIBARR_FIREPERMIT_PROJECT, 'FPRProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';
Expand All @@ -168,7 +144,6 @@

require __DIR__ . '/../../../saturne/core/tpl/admin/object/object_numbering_module_view.tpl.php';


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

print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '" name="fire_permit_data">';
Expand Down
30 changes: 3 additions & 27 deletions admin/config/preventionplan.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
// Parameters
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');

$type = 'preventionplan';
$error = 0;

// Initialize technical objects
Expand Down Expand Up @@ -81,30 +79,8 @@
}
}

if ($action == 'updateMask') {
$preventionPlanMaskConst = GETPOST('maskconstpreventionplan', 'alpha');
$preventionPlanMask = GETPOST('maskpreventionplan', 'alpha');

if ($preventionPlanMaskConst) $res = dolibarr_set_const($db, $preventionPlanMaskConst, $preventionPlanMask, 'chaine', 0, '', $conf->entity);

if ( ! $res > 0) $error++;

if ( ! $error) {
setEventMessages($langs->trans("SetupSaved"), null);
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

if ($action == 'setmod') {
$constForVal = 'DIGIRISKDOLIBARR_' . strtoupper($type) . "_ADDON";
dolibarr_set_const($db, $constForVal, $value, 'chaine', 0, '', $conf->entity);
}

if ($action == 'setmodPreventionPlanDet') {
$constForVal = 'DIGIRISKDOLIBARR_' . strtoupper('preventionplandet') . "_ADDON";
dolibarr_set_const($db, $constForVal, $value, 'chaine', 0, '', $conf->entity);
}
// Actions set_mod, update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

if ($action == 'setMaitreOeuvre') {
$masterWorkerId = GETPOST('maitre_oeuvre');
Expand Down Expand Up @@ -152,7 +128,7 @@

$langs->load("projects");
print '<tr class="oddeven"><td><label for="PPRProject">' . $langs->trans("PPRProject") . '</label></td><td>';
$formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_PREVENTIONPLAN_PROJECT, 'PPRProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
$formproject->select_projects(-1, $conf->global->DIGIRISKDOLIBARR_PREVENTIONPLAN_PROJECT, 'PPRProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';
Expand Down
57 changes: 43 additions & 14 deletions admin/config/riskassessmentdocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@
* Actions
*/

if (GETPOST('action') == 'updateMask') {
dolibarr_set_const($db, GETPOST('mask'), GETPOST('addon_value'), 'chaine', 0, '', $conf->entity);
}
// Actions update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

if (GETPOST('action') == 'setmod') {
$value = GETPOST('value');
Expand Down Expand Up @@ -190,6 +189,11 @@
'description' => 'ShowRiskOriginDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_RISK_ORIGIN',
],
'RiskListParentView' => [
'name' => 'RiskListParentView',
'description' => 'RiskListParentViewDescription',
'code' => 'DIGIRISKDOLIBARR_RISK_LIST_PARENT_VIEW',
],
'ShowInheritedRisksInDocuments' => [
'name' => 'ShowInheritedRisksInDocuments',
'description' => 'ShowInheritedRisksInDocumentsDescription',
Expand Down Expand Up @@ -230,16 +234,21 @@
'description' => 'MultipleRiskAssessmentMethodDescription',
'code' => 'DIGIRISKDOLIBARR_MULTIPLE_RISKASSESSMENT_METHOD',
],
'ShowRiskAssessmentDate' => [
'name' => 'ShowRiskAssessmentDate',
'description' => 'ShowRiskAssessmentDateDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_RISKASSESSMENT_DATE',
],
'ShowAllRiskAssessments' => [
'name' => 'ShowAllRiskAssessments',
'description' => 'ShowAllRiskAssessmentsDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_ALL_RISKASSESSMENTS',
],
'ShowAllRiskAssessments' => [
'name' => 'ShowAllRiskAssessments',
'description' => 'ShowAllRiskAssessmentsDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_ALL_RISKASSESSMENTS',
],
'ShowRiskAssessmentDate' => [
'name' => 'ShowRiskAssessmentDate',
'description' => 'ShowRiskAssessmentDateDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_RISKASSESSMENT_DATE',
],
'RiskAssessmentHideDateInDocument' => [
'name' => 'RiskAssessmentHideDateInDocument',
'description' => 'RiskAssessmentHideDateInDocumentDescription',
'code' => 'DIGIRISKDOLIBARR_RISKASSESSMENT_HIDE_DATE_IN_DOCUMENT',
]
];

require __DIR__ . '/../../../saturne/core/tpl/admin/object/object_const_view.tpl.php';
Expand All @@ -264,7 +273,7 @@

$langs->load("projects");
print '<tr class="oddeven"><td><label for="DUProject">' . $langs->trans("DUProject") . '</label></td><td>';
$formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_DU_PROJECT, 'DUProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
$formproject->select_projects(-1, $conf->global->DIGIRISKDOLIBARR_DU_PROJECT, 'DUProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';
Expand Down Expand Up @@ -314,6 +323,26 @@
'description' => 'ShowAllTasksDescription',
'code' => 'DIGIRISKDOLIBARR_SHOW_ALL_TASKS',
],
'TaskHideRefInDocument' => [
'name' => 'TaskHideRefInDocument',
'description' => 'TaskHideRefInDocumentDescription',
'code' => 'DIGIRISKDOLIBARR_TASK_HIDE_REF_IN_DOCUMENT',
],
'TaskHideResponsibleInDocument' => [
'name' => 'TaskHideResponsibleInDocument',
'description' => 'TaskHideResponsibleInDocumentDescription',
'code' => 'DIGIRISKDOLIBARR_TASK_HIDE_RESPONSIBLE_IN_DOCUMENT',
],
'TaskHideDateInDocument' => [
'name' => 'TaskHideDateInDocument',
'description' => 'TaskHideDateInDocumentDescription',
'code' => 'DIGIRISKDOLIBARR_TASK_HIDE_DATE_IN_DOCUMENT',
],
'TaskHideBudgetInDocument' => [
'name' => 'TaskHideBudgetInDocument',
'description' => 'TaskHideBudgetInDocumentDescription',
'code' => 'DIGIRISKDOLIBARR_TASK_HIDE_BUDGET_IN_DOCUMENT',
]
];

require __DIR__ . '/../../../saturne/core/tpl/admin/object/object_const_view.tpl.php';
Expand Down
4 changes: 2 additions & 2 deletions admin/ticket/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@

print dol_get_fiche_head($head, 'ticket', $title, -1, "digiriskdolibarr_color@digiriskdolibarr");

print load_fiche_titre('<i class="fa fa-ticket"></i> ' . $langs->transnoentities("TicketManagement"), '', '');
print load_fiche_titre('<i class="fa fa-ticket-alt"></i> ' . $langs->transnoentities("TicketManagement"), '', '');
print '<hr>';
print load_fiche_titre($langs->transnoentities("PublicInterface"), '', '');

Expand Down Expand Up @@ -628,7 +628,7 @@

$langs->load("projects");
print '<tr class="oddeven"><td><label for="TSProject">' . $langs->transnoentities("TSProject") . '</label></td><td>';
$numprojet = $formproject->select_projects(0, $conf->global->DIGIRISKDOLIBARR_TICKET_PROJECT, 'TSProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
$numprojet = $formproject->select_projects(-1, $conf->global->DIGIRISKDOLIBARR_TICKET_PROJECT, 'TSProject', 0, 0, 0, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->transnoentities("AddProject") . '"></span></a>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->transnoentities("Save") . '">';
print '</td></tr>';
Expand Down
Loading

0 comments on commit 39e7c4a

Please sign in to comment.