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

#4026 [Mod] add: change labour doctor default name #4039

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
27 changes: 27 additions & 0 deletions core/modules/modDigiriskDolibarr.class.php
evarisk-francois marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -2205,6 +2205,33 @@ public function init($options = '')

dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_THIRDPARTY_UPDATED', 2, 'integer', 0, '', $conf->entity);
}
if (getDolGlobalInt('DIGIRISKDOLIBARR_THIRDPARTY_UPDATED') == 2) {
require_once __DIR__ . '/../../../saturne/class/saturneschedules.class.php';

$labourDoctorID = $resources->fetchDigiriskResource('LabourDoctorSociety');
$societe->fetch($labourDoctorID);
$result = $societe->setValueFrom('nom', $langs->transnoentities('LabourDoctorNameFull') . ' - ' . getDolGlobalString('MAIN_INFO_SOCIETE_NOM'));

if ($result >= 0) {
$schedule = new SaturneSchedules($this->db);
$schedule->element_id = $labourDoctorID;

$schedule->monday = $langs->transnoentities('weekDayDefault');
$schedule->tuesday = $langs->transnoentities('weekDayDefault');
$schedule->wednesday = $langs->transnoentities('weekDayDefault');
$schedule->thursday = $langs->transnoentities('weekDayDefault');
$schedule->friday = $langs->transnoentities('weekDayDefault');
$schedule->saturday = $langs->transnoentities('weekEndDefault');
$schedule->sunday = $langs->transnoentities('weekEndDefault');

$schedule->element_type = 'societe';
$schedule->status = 1;

$schedule->create($user);
}

dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_THIRDPARTY_UPDATED', 3, 'integer', 0, '', $conf->entity);
}

// Create extrafields during init
include_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
4 changes: 3 additions & 1 deletion langs/fr_FR/digiriskdolibarr.lang
evarisk-francois marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -124,7 +124,8 @@ LabourInspectorSociety = Tiers Inspecteur du travail
LabourInspectorAssigned = Inspecteur du travail

SocieteSchedules = Horaires de la société

weekDayDefault = Cf-Site Internet
weekEndDefault = Fermé Fermé

#
# DigriskDocuments - Documents Digirisk
@@ -1494,3 +1495,4 @@ ManuelInputNBEmployeesDescription = Si l'option est activée, vous pouvez sais
ManuelInputNBWorkedHours = Saisir manuellement le nombre d'heures travaillées
ManuelInputNBWorkedHoursDescription = Si l'option est activée, vous pouvez saisir manuellement le nombre d'heures travaillées dans la configuration de la société.<br>Sinon le nombre d'heures travaillées est calculé.<br>Consulter la documentation pour plus d'informations.
HowToConfigureSetupConf = Pour configurer les donnés de la société lié à Digirisk,<br>veuillez vous rendre sur Digirisk - Configuration - Réglages
LabourDoctorNameFull = Association des Médecins