diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c1c5fe58b45..82037fa85d1 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -75,8 +75,8 @@ else if ($action == 'specimen') // For contract { $modele= GETPOST('module','alpha'); - $contract = new Contrat($db); - $contract->initAsSpecimen(); + $holiday = new Holiday($db); + $holiday->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; @@ -98,7 +98,7 @@ else if ($action == 'specimen') // For contract $module = new $classname($db); - if ($module->write_file($contract,$langs) > 0) + if ($module->write_file($holiday,$langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); return; @@ -271,7 +271,7 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$contract); + $nextval=$module->getNextValue($mysoc,$holiday); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 6dd49b52a93..9c87f7d32fd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2171,8 +2171,10 @@ class Holiday extends CommonObject $this->description='SPECIMEN description'; $this->date_debut=dol_now(); $this->date_fin=dol_now()+(24*3600); + $this->date_valid=dol_now(); $this->fk_validator=1; $this->halfday=0; $this->fk_type=1; + $this->statut=Holiday::STATUS_VALIDATED; } }