Fix bulletin
This commit is contained in:
parent
8fe95ee094
commit
166cbfc20b
4 changed files with 15 additions and 17 deletions
|
@ -31,8 +31,8 @@ class Bulletin {
|
|||
return $this->eleve->getNom();
|
||||
}
|
||||
|
||||
public function getClass() {
|
||||
return $this->eleve->classe;
|
||||
public function getClasse() {
|
||||
return $this->eleve->getClasse();
|
||||
}
|
||||
|
||||
public function getMoyenne() {
|
||||
|
@ -53,10 +53,10 @@ class Bulletin {
|
|||
|
||||
public function isVisible() {
|
||||
foreach ($this->matieres as $matiere) {
|
||||
if ( !$matiere->isVisible() ) {
|
||||
return false;
|
||||
if ( $matiere->isVisible() ) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ class Matiere {
|
|||
|
||||
// echo "<p>".var_dump($entries)."</p>";
|
||||
foreach ($entries as $entry) {
|
||||
if (!empty($entry['bf_note']))
|
||||
$this->notes[] = new Note($entry['bf_intitule'], $entry['bf_note'], $entry['bf_coef']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,18 +42,12 @@ class NoteManager {
|
|||
// echo "<p>".var_dump($currentEleve)."</p>";
|
||||
// if ($currentEleve == null) {
|
||||
$eleves = $eleveManager->getAll();
|
||||
// $eleves = $ $this->entryManager->search(['formsIds' => $meeo_config['elevesFormId']]);
|
||||
// $entries = $this->entryManager->search(['formsIds' => $this->formId]);
|
||||
|
||||
$bulletins = [];
|
||||
foreach ( $eleves as $eleve) {
|
||||
//TODO enlever "Passerelle"
|
||||
$bulletin = new Bulletin($this->wiki, $eleve, "Passerelle");
|
||||
if ($bulletin->isVisible())
|
||||
$bulletins[] = $bulletin;
|
||||
$bulletins[] = new Bulletin($this->wiki, $eleve);
|
||||
}
|
||||
// echo "<p>".var_dump($eleves)."</p>";
|
||||
// echo "<p>".var_dump($entries)."</p>";
|
||||
// echo "<p>".var_dump($bulletins)."</p>";
|
||||
|
||||
return $this->wiki->render('@meeo/edu_notes.twig', [
|
||||
|
@ -78,7 +72,10 @@ class NoteManager {
|
|||
}
|
||||
|
||||
public function createNote($intitule, $eleve, $matiere, $note, $coef) {
|
||||
$note = [
|
||||
if ($note == 0)
|
||||
return;
|
||||
|
||||
$data = [
|
||||
'bf_titre' => "Note : ".$intitule." - ".$eleve." - ".$matiere,
|
||||
'bf_intitule' => $intitule,
|
||||
'listeListeMatierebf_matiere' => $matiere,
|
||||
|
@ -87,12 +84,12 @@ class NoteManager {
|
|||
'bf_coef' => $coef,
|
||||
'antispam' => true
|
||||
];
|
||||
$this->entryManager->create($this->formId, $note);
|
||||
$this->entryManager->create($this->formId, $data);
|
||||
}
|
||||
|
||||
public function getNotes($eleveId, $matiereId) {
|
||||
echo "<p>".$eleveId."</p>";
|
||||
echo "<p>".$matiereId."</p>";
|
||||
// echo "<p>".$eleveId."</p>";
|
||||
// echo "<p>".$matiereId."</p>";
|
||||
$entries = $this->entryManager->search(['formsIds' => $this->formId,
|
||||
'queries' =>[
|
||||
'listefiche'.$this->eleveFormId.'bf_eleve' => \strtolower($eleveId),
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<button id="head_{{ bulletin.getId() }}" class="panel-heading collapsed" data-parent="#accordion_bulletins" data-target="#{{ bulletin.getId() }}" data-toggle="collapse">
|
||||
<h4 class="panel-title">{{ bulletin.getNom() }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-9">{{ bulletin.getClass() }}</div>
|
||||
<div class="col-sm-9">{{ bulletin.getClasse() }}</div>
|
||||
<div class="col-sm-3">Moyenne Générale : {{ bulletin.getMoyenne() }}</div>
|
||||
</div>
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue