Skip to content

Commit

Permalink
Evarisk#4026 [Mod] add: create schedule + add trans
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-francois committed Jul 18, 2024
1 parent 0ee06f1 commit 00eb6b5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
23 changes: 22 additions & 1 deletion core/modules/modDigiriskDolibarr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2206,10 +2206,31 @@ public function init($options = '')
dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_THIRDPARTY_UPDATED', 2, 'integer', 0, '', $conf->entity);
}
if ( $conf->global->DIGIRISKDOLIBARR_THIRDPARTY_UPDATED == 2 ) {
require_once __DIR__ . '/../../../saturne/class/saturneschedules.class.php';

$labourDoctorID = $resources->fetchDigiriskResource('LabourDoctorSociety');
$societe->fetch($labourDoctorID);
$societe->name = $langs->trans('LabourDoctorNameFull') . ' - ' . $conf->global->MAIN_INFO_SOCIETE_NOM;
$societe->update(0, $user);
$result = $societe->update(0, $user);

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

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

$schedule->element_type = 'societe';
$schedule->tms = dol_now('tzuser');
$schedule->status = 1;

$schedule->create($user);
}

dolibarr_set_const($this->db, 'DIGIRISKDOLIBARR_THIRDPARTY_SET', 3, 'integer', 0, '', $conf->entity);
}
Expand Down
10 changes: 9 additions & 1 deletion langs/fr_FR/digiriskdolibarr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1494,4 +1494,12 @@ 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
LabourDoctorNameFull = Association des Médecins

#
# Schedules - horaires
#

# Data - Donnée
weekDayDefault = Cf-Site Internet
weekEndDefault = Fermé Fermé

0 comments on commit 00eb6b5

Please sign in to comment.