try a fix to get parents link
This commit is contained in:
parent
7927889bab
commit
5fde53b4c5
3 changed files with 16 additions and 7 deletions
|
@ -4,6 +4,7 @@ parameters:
|
||||||
absencesFormId: 8
|
absencesFormId: 8
|
||||||
notesFormId: 9
|
notesFormId: 9
|
||||||
yunohostFormId: 6
|
yunohostFormId: 6
|
||||||
|
parentsFormId: 10
|
||||||
groupeEE: 'equipeeducative'
|
groupeEE: 'equipeeducative'
|
||||||
redirect:
|
redirect:
|
||||||
eleveUpdate: '?Eleves'
|
eleveUpdate: '?Eleves'
|
||||||
|
|
|
@ -12,14 +12,21 @@ class Eleve {
|
||||||
private $user;
|
private $user;
|
||||||
private $parents;
|
private $parents;
|
||||||
|
|
||||||
public function __construct(EntryManager $entryManager, $yunoshostFormId, $data) {
|
public function __construct(EntryManager $entryManager, $meeo_config, $data) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
// echo "<p>".var_dump($data)."</p>";
|
// echo "<p>".var_dump($data)."</p>";
|
||||||
|
$yunoshostFormId = $meeo_config['yunohostFormId'];
|
||||||
|
$parentsFormId = $meeo_config['parentsFormId'];
|
||||||
|
$elevesFormId = $meeo_config['elevesFormId'];
|
||||||
|
// echo "<p>Config : ".var_dump($meeo_config)."</p>";
|
||||||
$userId = $data['listefiche'.$yunoshostFormId.'bf_nom'];
|
$userId = $data['listefiche'.$yunoshostFormId.'bf_nom'];
|
||||||
$this->user = $entryManager->getOne($userId);
|
$this->user = $entryManager->getOne($userId);
|
||||||
// echo "<p>".var_dump($userId)."</p>";
|
// echo "<p>".var_dump($userId)."</p>";
|
||||||
$this->parents = [];
|
$this->parents = [];
|
||||||
foreach ($entryManager->search(['formsIds' => 10, 'queries' => ['listefiche7bf_eleve' => $userId]]) as $parent) {
|
$parents = $entryManager->search(['formsIds' => $parentsFormId, 'queries' => ['listefiche'.$elevesFormId.'bf_eleve' => $userId.'2']]);
|
||||||
|
// $parents = $entryManager->search(['formsIds' => $parentsFormId]);
|
||||||
|
// echo "<p>Parents : ".var_dump($parents)."</p>";
|
||||||
|
foreach ( $parents as $parent) {
|
||||||
array_push($this->parents, new ParentEleve($entryManager, $yunoshostFormId, $parent));
|
array_push($this->parents, new ParentEleve($entryManager, $yunoshostFormId, $parent));
|
||||||
}
|
}
|
||||||
// echo "<p>".var_dump($this)."</p>";
|
// echo "<p>".var_dump($this)."</p>";
|
||||||
|
|
|
@ -17,13 +17,14 @@ class EleveManager {
|
||||||
private $entryManager;
|
private $entryManager;
|
||||||
private $listManager;
|
private $listManager;
|
||||||
private $wiki;
|
private $wiki;
|
||||||
|
private $meeo_config;
|
||||||
|
|
||||||
public function __construct( Wiki $wiki, ParameterBagInterface $params, EntryManager $entryManager, ListManager $listManager)
|
public function __construct( Wiki $wiki, ParameterBagInterface $params, EntryManager $entryManager, ListManager $listManager)
|
||||||
{
|
{
|
||||||
$meeo_config = $params->get('meeo');
|
$this->meeo_config = $params->get('meeo');
|
||||||
$this->wiki = $wiki;
|
$this->wiki = $wiki;
|
||||||
$this->formId = $meeo_config['elevesFormId'];
|
$this->formId = $this->meeo_config['elevesFormId'];
|
||||||
$this->yunoshostFormId = $meeo_config['yunohostFormId'];
|
$this->yunoshostFormId = $this->meeo_config['yunohostFormId'];
|
||||||
$this->entryManager = $entryManager;
|
$this->entryManager = $entryManager;
|
||||||
$this->listManager = $listManager;
|
$this->listManager = $listManager;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +45,7 @@ class EleveManager {
|
||||||
$eleves = [];
|
$eleves = [];
|
||||||
foreach ($this->entryManager->search(['formsIds' => $this->formId]) as $data)
|
foreach ($this->entryManager->search(['formsIds' => $this->formId]) as $data)
|
||||||
{
|
{
|
||||||
$eleve = new Eleve($this->entryManager, $this->yunoshostFormId, $data);
|
$eleve = new Eleve($this->entryManager, $this->meeo_config, $data);
|
||||||
// echo "<p>".var_dump($eleve)."</p>";
|
// echo "<p>".var_dump($eleve)."</p>";
|
||||||
$eleves[] = $eleve;
|
$eleves[] = $eleve;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +53,7 @@ class EleveManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEleve(string $id) {
|
public function getEleve(string $id) {
|
||||||
return new Eleve($this->entryManager, $this->yunoshostFormId, $this->entryManager->getOne($id));
|
return new Eleve($this->entryManager, $this->meeo_config, $this->entryManager->getOne($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentEleve(string $username) {
|
public function getCurrentEleve(string $username) {
|
||||||
|
|
Loading…
Reference in a new issue