Skip to content

Commit

Permalink
terminata richiesta di iscrizione ad un corso
Browse files Browse the repository at this point in the history
  • Loading branch information
drinky78 committed Nov 8, 2015
1 parent b31368f commit 372ef48
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
8 changes: 0 additions & 8 deletions core/class/GiornataCorso.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ public function corso() {
return Corso::id($this->corso);
}

/**
* Ritorna il Corso collegato alla lezione
* @return CorsoBase
*/
public function docente() {
return Volontario::id($this->docente);
}

/**
* Ritorna l'elenco di assenze registrate per una data Lezione
* @return array(AssenzaLezione)
Expand Down
1 change: 0 additions & 1 deletion inc/formazione.corsi.crea.ok.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
$l->data = $c->inizio;
$l->luogo = $c->luogo;
$l->note = $c->descrizione;
$l->docente = 0;
}

$c->assegnaProgressivo();
Expand Down
11 changes: 7 additions & 4 deletions inc/formazione.corsi.lezioni.aggiungi.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@
$l->data = $data->getTimestamp();
$l->luogo = normalizzaNome($_POST['luogo']);
$l->note = addslashes($_POST['note']);
$l->docente = intval($_POST['docenti'][0]);

$docente = Volontario::id(intval($_POST['docenti'][0]));
$part = new PartecipazioneCorso();
$part->aggiungi(Corso::id($id), $docente, CORSO_RUOLO_DOCENTE);
// $l->docente = intval($_POST['docenti'][0]);

foreach ($_POST['docenti'] as $docente) {
$docenteId = Volontario::id(intval($docente));
$part = new PartecipazioneCorso();
$part->aggiungi(Corso::id($id), $docenteId, CORSO_RUOLO_DOCENTE);
}

$db->commit();
} catch(Exception $e) {
Expand Down

0 comments on commit 372ef48

Please sign in to comment.