Skip to content

Commit

Permalink
Renomeia Aluno::Trancadas para Aluno::Trancados
Browse files Browse the repository at this point in the history
  • Loading branch information
guaycuru committed May 18, 2017
1 parent d88d0b8 commit bc02a8c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ajax/horario.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
</tr>
<tr>
<td colspan="2" style="padding: 10px 5px;"><strong>Desist&ecirc;ncias (<?=$Aluno->Creditos_Trancados($Periodo_Selecionado->getPeriodo(), $nivel); ?>):</strong></td>
<td colspan="5" style="padding: 10px 5px;"><?=$Aluno->getTrancadas($Periodo_Selecionado->getPeriodo(), $nivel, true); ?></td>
<td colspan="5" style="padding: 10px 5px;"><?=$Aluno->getTrancados($Periodo_Selecionado->getPeriodo(), $nivel, true); ?></td>
</tr>
<tr>
<td colspan="7" align="center" style="padding: 10px;"><a href="#" onclick="window.open('<?= CONFIG_URL; ?>imprimir-horario/?ra=<?= $Aluno->getRA(true); ?>&p=<?= $Periodo_Selecionado->getID(true); ?>&n=<?= $nivel; ?>', '_blank', 'width=700, height=550, scrollbars=yes'); return false;">Visualizar Para Impress&atilde;o</a></td>
Expand Down
28 changes: 14 additions & 14 deletions classes/GDE/Aluno.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ class Aluno extends Base {
* @var ArrayCollection|Oferecimento[]
*
* @ORM\ManyToMany(targetEntity="Oferecimento")
* @ORM\JoinTable(name="gde_r_alunos_trancadas",
* @ORM\JoinTable(name="gde_r_alunos_trancados",
* joinColumns={@ORM\JoinColumn(name="ra", referencedColumnName="ra")},
* inverseJoinColumns={@ORM\JoinColumn(name="id_oferecimento", referencedColumnName="id_oferecimento")}
* )
*/
protected $trancadas;
protected $trancados;

/**
* @var Curso
Expand Down Expand Up @@ -460,7 +460,7 @@ public function getOferecimentos($periodo = null, $niveis = array(), $formatado
}

/**
* getTrancadas
* getTrancados
*
* Retorna a lista de Oferecimentos trancados deste Aluno, opcionalmente filtrada por $periodo ou $niveis
*
Expand All @@ -469,19 +469,19 @@ public function getOferecimentos($periodo = null, $niveis = array(), $formatado
* @param bool $formatado
* @return ArrayCollection|Oferecimento[]|string
*/
public function getTrancadas($periodo = null, $niveis = array(), $formatado = false) {
public function getTrancados($periodo = null, $niveis = array(), $formatado = false) {
if($niveis == self::NIVEL_GRAD)
$niveis = array_keys(self::$_niveis_grad);
elseif(is_array($niveis) === false)
$niveis = array($niveis);

if(($periodo == null) && (count($niveis) == 0))
$Trancadas = parent::getTrancadas();
$Trancados = parent::getTrancados();
else {
$qb = self::_EM()->createQueryBuilder()
->select('o')
->from('GDE\\Oferecimento', 'o')
->join('o.alunos_trancadas', 'a')
->join('o.alunos_trancados', 'a')
->where('a.ra = :ra')
->setParameter('ra', $this->getRA(false));
if($periodo != null) {
Expand All @@ -494,16 +494,16 @@ public function getTrancadas($periodo = null, $niveis = array(), $formatado = fa
->andWhere('d.nivel IN (:niveis)')
->setParameter('niveis', $niveis);
}
$Trancadas = $qb->getQuery()->getResult();
$Trancados = $qb->getQuery()->getResult();
}

if($formatado === false)
return $Trancadas;
return $Trancados;
else {
$lista = array();
foreach($Trancadas as $Trancada)
$lista[] = "<a href=\"".CONFIG_URL."oferecimento/".$Trancada->getID()."/\" title=\"".$Trancada->getDisciplina(true)->getNome(true)."\">".
$Trancada->getSigla(true).$Trancada->getTurma(true)."</a> (".$Trancada->getDisciplina()->getCreditos(true).")";
foreach($Trancados as $Trancado)
$lista[] = "<a href=\"".CONFIG_URL."oferecimento/".$Trancado->getID()."/\" title=\"".$Trancado->getDisciplina(true)->getNome(true)."\">".
$Trancado->getSigla(true).$Trancado->getTurma(true)."</a> (".$Trancado->getDisciplina()->getCreditos(true).")";
return (count($lista) > 0) ? implode(", ", $lista) : '-';
}
}
Expand Down Expand Up @@ -570,7 +570,7 @@ public function Creditos_Atuais($periodo = null, $niveis = array()) {
*/
public function Creditos_Trancados($periodo = null, $niveis = array()) {
$creditos = 0;
foreach($this->getTrancadas($periodo, $niveis) as $Oferecimento)
foreach($this->getTrancados($periodo, $niveis) as $Oferecimento)
$creditos += $Oferecimento->getDisciplina()->getCreditos();
return $creditos;
}
Expand Down Expand Up @@ -606,7 +606,7 @@ public function Cursou(Disciplina $Disciplina) {
*/
public function Trancou(Disciplina $Disciplina) {
$dql = 'SELECT COUNT(O.id_oferecimento) FROM GDE\\Aluno AS A '.
'INNER JOIN A.trancadas AS O '.
'INNER JOIN A.trancados AS O '.
'INNER JOIN O.disciplina AS D '.
'WHERE A.ra = ?1 AND D.sigla = ?2';

Expand Down Expand Up @@ -657,7 +657,7 @@ public function Cursou_Com(Professor $Professor, Disciplina $Disciplina = null)
*/
public function Trancou_Com(Professor $Professor, Disciplina $Disciplina = null) {
$dql = 'SELECT COUNT(O.id_oferecimento) FROM GDE\\Aluno AS A '.
'INNER JOIN A.trancadas AS O ';
'INNER JOIN A.trancados AS O ';
if($Disciplina !== null)
$dql .= 'INNER JOIN O.disciplina AS D ';
$dql .= 'WHERE A.ra = ?1 AND O.professor = ?2';
Expand Down
2 changes: 1 addition & 1 deletion classes/GDE/Disciplina.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function getEquivalentes($formatado = false) {
*/
public function Desistencias() {
$dql = 'SELECT COUNT(A.ra) FROM GDE\\Aluno AS A '.
'INNER JOIN A.trancadas AS O '.
'INNER JOIN A.trancados AS O '.
'INNER JOIN O.disciplina AS D '.
'WHERE D.sigla = ?1';

Expand Down
6 changes: 3 additions & 3 deletions classes/GDE/Oferecimento.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Oferecimento extends Base {
/**
* @var Aluno
*
* @ORM\ManyToMany(targetEntity="Aluno", mappedBy="trancadas")
* @ORM\ManyToMany(targetEntity="Aluno", mappedBy="trancados")
*/
protected $alunos_trancadas;
protected $alunos_trancados;

/**
* @var Dimensao
Expand Down Expand Up @@ -425,7 +425,7 @@ public function Matriculados() {
* @return integer
*/
public function Desistencias() {
return $this->getAlunos_Trancadas()->count();
return $this->getAlunos_Trancados()->count();
}

/**
Expand Down

0 comments on commit bc02a8c

Please sign in to comment.