소스 검색

Fix example of number for holiday

Laurent Destailleur 6 년 전
부모
커밋
773e2da4cc
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      htdocs/admin/holiday.php
  2. 2 0
      htdocs/holiday/class/holiday.class.php

+ 4 - 4
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").': <b>'.$module->getVersion().'</b><br>';
-						$nextval=$module->getNextValue($mysoc,$contract);
+						$nextval=$module->getNextValue($mysoc,$holiday);
                         if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
                             $htmltooltip.=''.$langs->trans("NextValue").': ';
                             if ($nextval) {

+ 2 - 0
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;
 	}
 }