Skip to content

Commit

Permalink
Merge pull request #4009 from Evarisk/develop
Browse files Browse the repository at this point in the history
10.2.1
  • Loading branch information
nicolas-eoxia authored Jun 24, 2024
2 parents 8e1ac81 + c44f484 commit 1ad9fdc
Show file tree
Hide file tree
Showing 28 changed files with 109 additions and 95 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 : 31/05/2024
- Dernière mise à jour : 24/06/2024
- Éditeur : [Evarisk](https://evarisk.com)
- Thème : Eldy Menu
- Licence : GPLv3
- Disponible sur : Windows - MacOS - Linux

### Version

- Version : 10.2.0
- Version : 10.2.1
- PHP : 7.4.33
- Compatibilité : Dolibarr 16.0.0 - 19.0.2
- Saturne Framework : 1.4.0 - 1.5.0
- Compatibilité : Dolibarr 16.0.0 - 20.0.0
- Saturne Framework : 1.5.1

## Liens

Expand Down
6 changes: 3 additions & 3 deletions class/accident.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Accident extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string String with name of icon for digiriskelement. Must be the part after the 'object_' into object_digiriskelement.png
Expand Down Expand Up @@ -1032,7 +1032,7 @@ class AccidentMetaData extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string String with name of icon for digiriskelement. Must be the part after the 'object_' into object_digiriskelement.png
Expand Down Expand Up @@ -1198,7 +1198,7 @@ class AccidentLesion extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 0;
public $isextrafieldmanaged = 0;

/**
* @var string String with name of icon for digiriskelement. Must be the part after the 'object_' into object_digiriskelement.png
Expand Down
2 changes: 1 addition & 1 deletion class/accidentinvestigation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AccidentInvestigation extends SaturneObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
public int $isextrafieldmanaged = 0;
public $isextrafieldmanaged = 0;

/**
* @var string String with name of icon for digiriskelement. Must be the part after the 'object_' into object_digiriskelement.png
Expand Down
110 changes: 50 additions & 60 deletions class/actions_digiriskdolibarr.class.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ public function RiskAssessmentDocumentFillJSON()
$user->fetch($recipientId);

$json['RiskAssessmentDocument']['destinataireDUER'] .= dol_strtoupper($user->lastname) . ' ' . ucfirst($user->firstname) . chr(0x0A);
$json['RiskAssessmentDocument']['telephone'] .= $user->office_phone . chr(0x0A);
$json['RiskAssessmentDocument']['portable'] .= $user->user_mobile . chr(0x0A);
$json['RiskAssessmentDocument']['telephone'] .= (dol_strlen($user->office_phone) > 0 ? $user->office_phone : '-') . chr(0x0A);
$json['RiskAssessmentDocument']['portable'] .= (dol_strlen($user->user_mobile) > 0 ? $user->user_mobile : '-') . chr(0x0A);
}
}

Expand Down
2 changes: 1 addition & 1 deletion class/digiriskelement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DigiriskElement extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

public const STATUS_DELETED = -1;
public const STATUS_DRAFT = 0;
Expand Down
2 changes: 1 addition & 1 deletion class/digiriskresources.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DigiriskResources extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string String with name of icon for digiriskresources. Must be the part after the 'object_' into object_digiriskresources.png
Expand Down
2 changes: 1 addition & 1 deletion class/digiriskstandard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DigiriskStandard extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string String with name of icon for digiriskstandard. Must be the part after the 'object_' into object_digiriskstandard.png
Expand Down
2 changes: 1 addition & 1 deletion class/evaluator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Evaluator extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string Name of icon for evaluator. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'evaluator@digiriskdolibarr' if picto is file 'img/object_evaluator.png'.
Expand Down
2 changes: 1 addition & 1 deletion class/firepermit.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class FirePermit extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string Name of icon for firepermit. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'firepermit@digiriskdolibarr' if picto is file 'img/object_firepermit.png'.
Expand Down
2 changes: 1 addition & 1 deletion class/preventionplan.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PreventionPlan extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;
/**
* @var string String with name of icon for digiriskelement. Must be the part after the 'object_' into object_digiriskelement.png
*/
Expand Down
2 changes: 1 addition & 1 deletion class/riskanalysis/risk.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Risk extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

public const STATUS_DELETED = -1;
public const STATUS_DRAFT = 0;
Expand Down
2 changes: 1 addition & 1 deletion class/riskanalysis/riskassessment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RiskAssessment extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string Name of icon for riskassessment. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'riskassessment@digiriskdolibarr' if picto is file 'img/object_riskassessment.png'
Expand Down
2 changes: 1 addition & 1 deletion class/riskanalysis/risksign.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RiskSign extends SaturneObject
/**
* @var int Does object support extrafields ? 0 = No, 1 = Yes.
*/
public int $isextrafieldmanaged = 1;
public $isextrafieldmanaged = 1;

/**
* @var string String with name of icon for risksign. Must be the part after the 'object_' into object_risksign.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
$riskSign = new RiskSign($this->db);
$evaluator = new Evaluator($this->db);
$accident = new Accident($this->db);
$userTmp = new User($this->db);

$arraySoc = $this->get_substitutionarray_mysoc($mysoc, $outputLangs);
$tmpArray['mycompany_photo_fullsize'] = $arraySoc['mycompany_logo'];
Expand All @@ -119,7 +120,7 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
complete_substitutions_array($tmpArray, $outputLangs, $objectDocument);
$objectDocument->element = $previousObjectDocumentElement;

if (!empty($moreParam['dateStart']) && $moreParam['dateEnd']) {
if (!empty($moreParam['dateStart']) && !empty($moreParam['dateEnd'])) {
$startDate = dol_print_date($moreParam['dateStart'], 'dayrfc');
$endDate = dol_print_date($moreParam['dateEnd'], 'dayrfc');
$filter = " AND (t.date_creation BETWEEN '$startDate' AND '$endDate' OR t.tms BETWEEN '$startDate' AND '$endDate')";
Expand All @@ -133,6 +134,21 @@ public function write_file(SaturneDocuments $objectDocument, Translate $outputLa
$moreParam['specificFilter'] = $specificFilter;
}

if (is_array($moreParam['recipient']) && !empty($moreParam['recipient'])) {
$userRecipient = $moreParam['recipient'];

$tmpArray['destinataireDUER'] = '';
$tmpArray['telephone'] = '';
$tmpArray['portable'] = '';
foreach ($userRecipient as $recipientId) {
$userTmp->fetch($recipientId);

$tmpArray['destinataireDUER'] .= dol_strtoupper($userTmp->lastname) . ' ' . ucfirst($userTmp->firstname) . chr(0x0A);
$tmpArray['telephone'] .= (dol_strlen($userTmp->office_phone) > 0 ? $userTmp->office_phone : '-') . chr(0x0A);
$tmpArray['portable'] .= (dol_strlen($userTmp->user_mobile) > 0 ? $userTmp->user_mobile : '-') . chr(0x0A);
}
}

$groupments = [];
$workUnits = [];
$digiriskElements = $digiriskElement->getActiveDigiriskElements(0, $moreParam);
Expand Down
4 changes: 2 additions & 2 deletions core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function __construct($db)
$this->descriptionlong = "Digirisk";
$this->editor_name = 'Evarisk';
$this->editor_url = 'https://evarisk.com';
$this->version = '10.2.0';
$this->version = '10.2.1';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
$this->picto = 'digiriskdolibarr_color@digiriskdolibarr';

Expand Down Expand Up @@ -416,7 +416,7 @@ public function __construct($db)
'projecttaskcard',
'projecttaskscard',
'tasklist',
'publicnewticketcard',
'publicticket',
'ticketlist',
'thirdpartyticket',
'projectticket',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct($db)
$this->name = preg_replace('/^Interface/i', '', get_class($this));
$this->family = "demo";
$this->description = "Digiriskdolibarr triggers.";
$this->version = '10.2.0';
$this->version = '10.2.1';
$this->picto = 'digiriskdolibarr@digiriskdolibarr';
}

Expand Down
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,7 @@ QRCodeGenerated = QRCode généré
FkTicket = Ticket lié
PublicTicket = Interface publique des tickets
TicketPublicInterfaceForbidden = Accès interdit à l'interface publique des tickets
WHSRegister = Registre SST

# Stats - Statistiques
TicketStatistics = Statistiques des tickets
Expand Down
2 changes: 1 addition & 1 deletion lib/digiriskdolibarr.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function digiriskdolibarr_admin_prepare_head(): array
$h++;

$head[$h][0] = dol_buildpath('/digiriskdolibarr/admin/ticket/ticket.php', 1);
$head[$h][1] = $conf->browser->layout != 'phone' ? '<i class="fa fa-ticket-alt pictofixedwidth"></i>' . $langs->trans('Tickets') : '<i class="fas fa-ticket-alt"></i>';
$head[$h][1] = $conf->browser->layout != 'phone' ? '<i class="fa fa-ticket-alt pictofixedwidth"></i>' . $langs->trans('WHSRegister') : '<i class="fas fa-ticket-alt"></i>';
$head[$h][2] = 'ticket';
$h++;

Expand Down
2 changes: 1 addition & 1 deletion public/ticket/create_ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('publicnewticketcard', 'globalcard'));
$hookmanager->initHooks(['publicticket', 'saturnepublicinterface']);

$object = new Ticket($db);
$formfile = new FormFile($db);
Expand Down
4 changes: 2 additions & 2 deletions view/accident/accident_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1061,12 +1061,12 @@
<span class="add-medias" <?php echo ($object->status <= Accident::STATUS_DRAFT) ? '' : 'style="display:none"' ?>>
<input hidden multiple class="fast-upload" id="fast-upload-photo-default" type="file" name="userfile[]" capture="environment" accept="image/*">
<label for="fast-upload-photo-default">
<div class="wpeo-button button-square-50">
<div title="<?php echo $langs->trans('AddPhotoFromComputer') ?>" class="wpeo-button button-square-50">
<i class="fas fa-camera"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</label>
<input type="hidden" class="favorite-photo" id="photo" name="photo" value="<?php echo $object->photo ?>"/>
<div class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?> 'open-media-gallery add-media modal-open" value="0">
<div title="<?php echo $langs->trans('AddPhotoFromMediaGallery') ?>" class="wpeo-button <?php echo ($onPhone ? 'button-square-40' : 'button-square-50'); ?> 'open-media-gallery add-media modal-open" value="0">
<input type="hidden" class="modal-options" data-modal-to-open="media_gallery" data-from-id="<?php echo $object->id?>" data-from-type="accident" data-from-subtype="photo" data-from-subdir="photos"/>
<i class="fas fa-folder-open"></i><i class="fas fa-plus-circle button-add"></i>
</div>
Expand Down
4 changes: 2 additions & 2 deletions view/accidentinvestigation/accidentinvestigation_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,12 @@
<span class="add-medias" <?php echo ($object->status < AccidentInvestigation::STATUS_VALIDATED && empty($object->causality_tree)) ? '' : 'style="display:none"' ?>>
<input hidden multiple class="fast-upload" id="fast-upload-photo-default" type="file" name="userfile[]" capture="environment" accept="image/*">
<label for="fast-upload-photo-default">
<div class="wpeo-button button-square-50">
<div title="<?php echo $langs->trans('AddPhotoFromComputer') ?>" class="wpeo-button button-square-50">
<i class="fas fa-camera"></i><i class="fas fa-plus-circle button-add"></i>
</div>
</label>
<input type="hidden" class="favorite-photo" id="photo" name="photo" value="<?php echo $object->causality_tree ?>"/>
<div class="wpeo-button button-square-50 open-media-gallery add-media modal-open" value="0">
<div title="<?php echo $langs->trans('AddPhotoFromMediaGallery') ?>" class="wpeo-button button-square-50 open-media-gallery add-media modal-open" value="0">
<input type="hidden" class="modal-options" data-modal-to-open="media_gallery" data-from-id="<?php echo $object->id?>" data-from-type="accidentinvestigation" data-from-subtype="causality_tree" data-from-subdir="causality_tree"/>
<i class="fas fa-folder-open"></i><i class="fas fa-plus-circle button-add"></i>
</div>
Expand Down
4 changes: 2 additions & 2 deletions view/digiriskelement/digiriskelement_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@
print '<span class="add-medias" '. (($object->status != $object::STATUS_LOCKED) ? "" : "style='display:none'") . '>';
print '<input hidden multiple class="fast-upload" id="fast-upload-photo-default" type="file" name="userfile[]" capture="environment" accept="image/*">';
print '<label for="fast-upload-photo-default">';
print '<div class="wpeo-button button-square-50">';
print '<div title="'. $langs->trans('AddPhotoFromComputer') .'" class="wpeo-button button-square-50">';
print '<i class="fas fa-camera"></i><i class="fas fa-plus-circle button-add"></i>';
print '</div>';
print '</label>';
print '&nbsp';
print '<input type="hidden" class="favorite-photo" id="photo" name="photo" value="<?php echo $object->photo ?>"/>';
print '<div class="wpeo-button button-square-50 open-media-gallery add-media modal-open" value="0">';
print '<div title="'. $langs->trans('AddPhotoFromMediaGallery') .'" class="wpeo-button button-square-50 open-media-gallery add-media modal-open" value="0">';
print '<input type="hidden" class="modal-options" data-modal-to-open="media_gallery" data-from-id="'. $object->id .'" data-from-type="'. $object->element_type .'" data-from-subtype="photo" data-from-subdir="" data-photo-class="digirisk-element-photo-'. $object->id .'"/>';
print '<i class="fas fa-folder-open"></i><i class="fas fa-plus-circle button-add"></i>';
print '</div>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
if (GETPOST('daterange')) {
$moreParams['dateStart'] = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'));
$moreParams['dateEnd'] = dol_mktime(0, 0, 0, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'));
$moreParams['recipient'] = GETPOST('recipient');
}
}

Expand Down Expand Up @@ -136,6 +137,12 @@
print $langs->trans('UseDateRange');
print '<input type="checkbox" id="daterange" name="daterange" checked>';
print '</td></tr>';

// Destinataire
$userRecipient = json_decode(getDolGlobalString('DIGIRISKDOLIBARR_RISKASSESSMENTDOCUMENT_RECIPIENT'));
print '<tr class="oddeven"><td>' . $langs->trans('Recipient') . '</td>';
print '<td>' . $form->select_dolusers($userRecipient, 'recipient', 0, null, 0, '', '', 0, 0, 0, '', 0, '', 'minwidth400', 0, 0, true);
print '</td></tr>';
print '</table>';

$objRef = dol_sanitizeFileName($object->ref);
Expand Down
6 changes: 3 additions & 3 deletions view/firepermit/firepermit_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@
// setPendingSignature confirmation
if (($action == 'setPendingSignature' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|| ( ! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { // Always output when not jmobile nor js
$formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateFirePermit'), $langs->trans('ConfirmValidateFirePermit', $object->ref), 'confirm_setPendingSignature', '', 'yes', 'actionButtonPendingSignature', 350, 600);
$formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateObject', $langs->transnoentities('The' . ucfirst($object->element))), $langs->trans('ConfirmValidateFirePermit', $object->ref), 'confirm_setPendingSignature', '', 'yes', 'actionButtonPendingSignature', 350, 600);
}

// setInProgress confirmation
Expand Down Expand Up @@ -1169,7 +1169,7 @@

print '<tr class="liste_titre">';
print '<td><span>' . $langs->trans('Ref.') . '</span></td>';
print '<td>' . $langs->trans('Location') . '</td>';
print '<td>' . $langs->trans('GP/UT') . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('ActionsDescription'), $langs->trans("ActionsDescriptionTooltip")) . '</td>';
print '<td class="center">' . $form->textwithpicto($langs->trans('INRSRisk'), $langs->trans('INRSRiskTooltip')) . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('PreventionMethod'), $langs->trans('PreventionMethodTooltip')) . '</td>';
Expand Down Expand Up @@ -1269,7 +1269,7 @@

print '<tr class="liste_titre">';
print '<td><span>' . $langs->trans('Ref.') . '</span></td>';
print '<td>' . $langs->trans('Location') . '</td>';
print '<td>' . $langs->trans('GP/UT') . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('ActionsDescription'), $langs->trans("ActionsDescriptionTooltip")) . '</td>';
print '<td class="center">' . $form->textwithpicto($langs->trans('INRSRisk'), $langs->trans('INRSRiskTooltip')) . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('UsedEquipment'), $langs->trans('UsedMaterialTooltip')) . '</td>';
Expand Down
2 changes: 1 addition & 1 deletion view/preventionplan/preventionplan_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@

print '<tr class="liste_titre">';
print '<td><span>' . $langs->trans('Ref.') . '</span></td>';
print '<td>' . $langs->trans('Location') . '</td>';
print '<td>' . $langs->trans('GP/UT') . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('ActionsDescription'), $langs->trans("ActionsDescriptionTooltip")) . '</td>';
print '<td class="center">' . $form->textwithpicto($langs->trans('INRSRisk'), $langs->trans('INRSRiskTooltip')) . '</td>';
print '<td>' . $form->textwithpicto($langs->trans('PreventionMethod'), $langs->trans('PreventionMethodTooltip')) . '</td>';
Expand Down

0 comments on commit 1ad9fdc

Please sign in to comment.