Skip to content

Commit

Permalink
Merge pull request #3898 from Evarisk/develop
Browse files Browse the repository at this point in the history
10.1.0
  • Loading branch information
nicolas-eoxia authored May 17, 2024
2 parents a86bf83 + 77d09bc commit 60fd53f
Show file tree
Hide file tree
Showing 42 changed files with 1,628 additions and 1,629 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 : 23/04/2024
- Dernière mise à jour : 17/05/2024
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 10.0.0
- Version : 10.1.0
- PHP : 7.4.33
- Compatibilité : Dolibarr 16.0.0 - 19.0.1
- Saturne Framework : 1.3.0
- Compatibilité : Dolibarr 16.0.0 - 19.0.2
- Saturne Framework : 1.4.0

## Liens

Expand Down
35 changes: 34 additions & 1 deletion admin/config/digiriskelement.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
// Actions set_mod, update_mask
require_once __DIR__ . '/../../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

if ($action == 'update') {
$digiriskElementDepthGraph = GETPOST('DigiriskElementDepthGraph', 'int');
if ($digiriskElementDepthGraph > -1) {
dolibarr_set_const($db, 'DIGIRISKDOLIBARR_DIGIRISKELEMENT_DEPTH_GRAPH', $digiriskElementDepthGraph, 'integer', 0, '', $conf->entity);
}

setEventMessage($langs->trans('SavedConfig'));
header('Location: ' . $_SERVER['PHP_SELF']);
exit;
}

/*
* View
*/
Expand Down Expand Up @@ -97,9 +108,31 @@
$object = new WorkUnit($db);

print load_fiche_titre($pictos['workunit'] . $langs->trans('WorkUnitManagement'), '', '');
print '<hr>';

require __DIR__ . '/../../../saturne/core/tpl/admin/object/object_numbering_module_view.tpl.php';
print '<hr>';

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

print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans('Name') . '</td>';
print '<td>' . $langs->trans('Description') . '</td>';
print '<td>' . $langs->trans('Value') . '</td>';
print '<td>' . $langs->trans('Action') . '</td>';
print '</tr>';

print '<tr class="oddeven"><td><label for="DigiriskElementDepthGraph">' . $langs->trans("DigiriskElementDepthGraph") . '</label></td>';
print '<td>' . $langs->trans("DigiriskElementDepthGraphDescription") . '</td>';
print '<td><input type="number" name="DigiriskElementDepthGraph" value="' . $conf->global->DIGIRISKDOLIBARR_DIGIRISKELEMENT_DEPTH_GRAPH . '"></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '">';
print '</td></tr>';

print '</table>';
print '</form>';

/*
* Deleted elements
Expand Down
16 changes: 8 additions & 8 deletions class/accidentinvestigation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,14 @@ public function getTriggerDescription(SaturneObject $object): string
}

$ret = parent::getTriggerDescription($object);
$ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '</br>';
$ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '</br>': '');
$ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '</br>' : '');
$ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '</br>' : '');
$ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '</br>' : '');
$ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '</br>' : '');
$ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '</br>' : '');
$ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '</br>' : '');
$ret .= $langs->transnoentities('Accident') . ' : ' . $accident->ref . ' - ' . $accident->label . '<br>';
$ret .= ($object->fk_task > 0 ? $langs->transnoentities('Task') . ' : ' . $task->ref . ' - ' . $task->label . '<br>': '');
$ret .= (dol_strlen($object->seniority_in_position) > 0 ? $langs->transnoentities('SeniorityInPosition') . ' : ' . $object->seniority_in_position . '<br>' : '');
$ret .= (dol_strlen($object->victim_skills) > 0 ? $langs->transnoentities('VictimSkills') . ' : ' . $object->victim_skills . '<br>' : '');
$ret .= (dol_strlen($object->collective_equipment) > 0 ? $langs->transnoentities('CollectiveEquipment') . ' : ' . $object->collective_equipment . '<br>' : '');
$ret .= (dol_strlen($object->individual_equipment) > 0 ? $langs->transnoentities('IndividualEquipment') . ' : ' . $object->individual_equipment . '<br>' : '');
$ret .= (dol_strlen($object->circumstances) > 0 ? $langs->transnoentities('Circumstances') . ' : ' . $object->circumstances . '<br>' : '');
$ret .= (dol_strlen($object->causality_tree) > 0 ? $langs->transnoentities('CausalityTree') . ' : ' . $object->causality_tree . '<br>' : '');

return $ret;
}
Expand Down
32 changes: 31 additions & 1 deletion class/actions_digiriskdolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function printCommonFooter($parameters)
$linkedAccidentList = '';
if (is_array($linkedAccidents) && !empty($linkedAccidents)) {
foreach ($linkedAccidents as $linkedAccident) {
$linkedAccidentList .= $linkedAccident->getNomUrl(1) . '</br>';
$linkedAccidentList .= $linkedAccident->getNomUrl(1) . '<br>';
}
}

Expand Down Expand Up @@ -1098,6 +1098,36 @@ public function saturneBannerTabCustomSubdir(array $parameters, object $object):
return 0; // or return 1 to replace standard code.
}

/**
* Overloading the extendSheetLinkableObjectsList function : replacing the parent's function with the one below
*
* @param array $linkableObjectTypes Array of linkable objects
* @return int 0 < on error, 0 on success, 1 to replace standard code
*/
public function extendSheetLinkableObjectsList(array $linkableObjectTypes): int
{
require_once __DIR__ . '/firepermit.class.php';
require_once __DIR__ . '/../lib/digiriskdolibarr_firepermit.lib.php';

$linkableObjectTypes['digiriskdolibarr_firepermit'] = [
'langs' => 'Firepermit',
'langfile' => 'digiriskdolibarr@digiriskdolibarr',
'picto' => 'fontawesome_fa-fire-alt_fas_#d35968',
'className' => 'FirePermit',
'name_field' => 'ref',
'post_name' => 'fk_firepermit',
'link_name' => 'digiriskdolibarr_firepermit',
'tab_type' => 'firepermit',
'hook_name_list' => 'firepermitlist',
'hook_name_card' => 'firepermitcard',
'create_url' => 'custom/digiriskdolibarr/view/firepermit/firepermit_card.php?action=create',
'class_path' => 'custom/digiriskdolibarr/class/firepermit.class.php'
];
$this->results = $linkableObjectTypes;

return 1;
}

/**
* Add new actions buttons on CommonObject
*
Expand Down
21 changes: 10 additions & 11 deletions class/digiriskdocuments.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2021-2023 EVARISK <[email protected]>
/* Copyright (C) 2021-2024 EVARISK <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -32,12 +32,12 @@
class DigiriskDocuments extends SaturneDocuments
{
/**
* @var string Module name.
* @var string Module name
*/
public $module = 'digiriskdolibarr';

/**
* @var string Name of table without prefix where object is stored. This is also the key used for extrafields management.
* @var string Name of table without prefix where object is stored. This is also the key used for extrafields management
*/
public $table_element = 'saturne_object_documents';

Expand Down Expand Up @@ -165,16 +165,15 @@ public function fillRiskData(Odf $odfHandler, $object, Translate $outputLangs, $
{
global $action, $conf, $hookmanager, $langs;

$usertmp = new User($this->db);
$project = new Project($this->db);
$DUProject = new Project($this->db);
$risk = new Risk($this->db);
$usertmp = new User($this->db);
$project = new Project($this->db);
$DUProject = new Project($this->db);
$risk = new Risk($this->db);
$digiriskelementobject = new DigiriskElement($this->db);

$DUProject->fetch($conf->global->DIGIRISKDOLIBARR_DU_PROJECT);

$activeDigiriskElements = $digiriskelementobject->getActiveDigiriskElements($allEntities ? 1 : 0);
$tasksSortedByRisk = $risk->getTasksWithFkRisk();
$tasksSortedByRisk = $risk->getTasksWithFkRisk();

for ($i = 4; $i >= 1; $i--) {
$foundTagForLines = 1;
Expand Down Expand Up @@ -462,8 +461,8 @@ public function getTriggerDescription(SaturneObject $object): string

$ret = parent::getTriggerDescription($object);

$ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '</br>';
$ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '</br>';
$ret .= $langs->transnoentities('ElementType') . ' : ' . $object->parent_type . '<br>';
$ret .= $langs->transnoentities('ParentElement') . ' : ' . $parentElement->ref . ' ' . $parentElement->label . '<br>';
$ret .= $langs->transnoentities('LastMainDoc') . ' : ' . $object->last_main_doc . '<br>';

return $ret;
Expand Down
Loading

0 comments on commit 60fd53f

Please sign in to comment.