try to fix EleveAction
This commit is contained in:
parent
775b24f184
commit
000d5ce133
2 changed files with 6 additions and 9 deletions
|
@ -8,15 +8,10 @@ class Eleve {
|
||||||
private $data;
|
private $data;
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
public function __construct(EntryManager $entryManager, $data) {
|
public function __construct(EntryManager $entryManager, $yunoshostFormId, $data) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
// echo "<p>".var_dump($data)."</p>";
|
// echo "<p>".var_dump($data)."</p>";
|
||||||
//TODO récupérer le bon numéro de liste
|
$userId = $data['listefiche'.$yunoshostFormId.'Listebf_nom'];
|
||||||
|
|
||||||
if (empty($data['listefiche5Listebf_nom']))
|
|
||||||
$userId = $data['listefichebf_nom'];
|
|
||||||
else
|
|
||||||
$userId = $data['listefiche5Listebf_nom'];
|
|
||||||
|
|
||||||
$this->user = $entryManager->getOne($userId);
|
$this->user = $entryManager->getOne($userId);
|
||||||
// echo "<p>".var_dump($this)."</p>";
|
// echo "<p>".var_dump($this)."</p>";
|
||||||
|
|
|
@ -13,6 +13,7 @@ use YesWiki\Meeo\Eleve\Eleve;
|
||||||
class EleveManager {
|
class EleveManager {
|
||||||
|
|
||||||
private $formId;
|
private $formId;
|
||||||
|
private $yunoshostFormId;
|
||||||
private $entryManager;
|
private $entryManager;
|
||||||
private $listManager;
|
private $listManager;
|
||||||
private $wiki;
|
private $wiki;
|
||||||
|
@ -22,6 +23,7 @@ class EleveManager {
|
||||||
$meeo_config = $params->get('meeo');
|
$meeo_config = $params->get('meeo');
|
||||||
$this->wiki = $wiki;
|
$this->wiki = $wiki;
|
||||||
$this->formId = $meeo_config['elevesFormId'];
|
$this->formId = $meeo_config['elevesFormId'];
|
||||||
|
$this->yunoshostFormId = $meeo_config['yunohostFormId'];
|
||||||
$this->entryManager = $entryManager;
|
$this->entryManager = $entryManager;
|
||||||
$this->listManager = $listManager;
|
$this->listManager = $listManager;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +45,7 @@ class EleveManager {
|
||||||
foreach ($this->entryManager->search(['formsIds' => $this->formId]) as $data)
|
foreach ($this->entryManager->search(['formsIds' => $this->formId]) as $data)
|
||||||
{
|
{
|
||||||
|
|
||||||
$eleve = new Eleve($this->entryManager, $data);
|
$eleve = new Eleve($this->entryManager, $this->yunoshostFormId, $data);
|
||||||
// echo "<p>".var_dump($eleve)."</p>";
|
// echo "<p>".var_dump($eleve)."</p>";
|
||||||
$eleves[] = $eleve;
|
$eleves[] = $eleve;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +53,7 @@ class EleveManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEleve(string $id) {
|
public function getEleve(string $id) {
|
||||||
return new Eleve($this->entryManager, $this->entryManager->getOne($id));
|
return new Eleve($this->entryManager, $this->yunoshostFormId, $this->entryManager->getOne($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentEleve(string $username) {
|
public function getCurrentEleve(string $username) {
|
||||||
|
|
Loading…
Reference in a new issue