Compare commits

..

2 commits

Author SHA1 Message Date
mckmonster
ea96d02bcf Prepare absence API 2024-07-28 11:14:51 +02:00
mckmonster
58ba487565 Fix information in datetime 2024-07-28 11:08:54 +02:00
2 changed files with 17 additions and 5 deletions

View file

@ -35,7 +35,7 @@ class ApiController extends YesWikiController
$eleveController->del($clef_action[0]); $eleveController->del($clef_action[0]);
} }
} }
// return ApiResponse($data); // return new ApiResponse($data);
return $this->wiki->redirect('?Eleves', 200); return $this->wiki->redirect('?Eleves', 200);
} }
@ -56,7 +56,19 @@ class ApiController extends YesWikiController
$controle = new Controle($parameters['intitule'], $parameters['matiere'], $parameters['coef'], $eleves); $controle = new Controle($parameters['intitule'], $parameters['matiere'], $parameters['coef'], $eleves);
$controle->createNotes($noteManager); $controle->createNotes($noteManager);
// return ApiResponse($controle); // return new ApiResponse($controle);
return $this->wiki->redirect('?Bulletin', 200); return $this->wiki->redirect('?Bulletin', 200);
} }
/**
* @Route("/api/meeo/absence",methods={"POST"},options={"acl":{"public"}})
*/
public function absence(Request $request) {
// $noteManager = $this->getService(NoteManager::class);
$content = $request->getContent();
parse_str($content, $parameters);
return new ApiResponse($parameters);
// return $this->wiki->redirect('?Bulletin', 200);
}
} }

View file

@ -1,4 +1,4 @@
<form class="form-horizontal" action="" method="post"> <form class="form-horizontal" action="?api/meeo/absence" method="post">
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="eleve">Eleve:</label> <label class="control-label col-sm-2" for="eleve">Eleve:</label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -12,13 +12,13 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="date_debut_absence">Debut:</label> <label class="control-label col-sm-2" for="date_debut_absence">Debut:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" type="datetime-local" id="date_debut_absence" name"date_debut_absence" required/> <input class="form-control" type="datetime-local" id="date_debut_absence" name="date_debut_absence" required/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="date_fin_absence">Fin:</label> <label class="control-label col-sm-2" for="date_fin_absence">Fin:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input class="form-control" type="datetime-local" id="date_fin_absence" name"date_fin_absence"/> <input class="form-control" type="datetime-local" id="date_fin_absence" name="date_fin_absence"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">