- Moved class APIv1_Controller from FHC_Controller.php to APIv1_Controller.php

- Moved class DB_Model from FHC_Model.php to DB_Model.php
- load method of class person (person.class.php) now is calling getPerson
  method of the class Person_model
- getAllForBewerbung method of class studiengang (studiengang.class.php) now is calling getAllForBewerbung
  method of the class Studiengang_model
- getStudienplaene method of class studienplan (studienplan.class.php) now is calling getStudienplaene
  method of the class Studienplan_model
This commit is contained in:
paolo
2016-04-25 18:25:03 +02:00
parent a3a9c42e99
commit 4cc83999ed
10 changed files with 177 additions and 174 deletions
+8 -6
View File
@@ -90,17 +90,19 @@ class person extends Person_model
public function load($personId)
{
//person_id auf gueltigkeit pruefen
if (is_numeric($personId) && $personId != '')
if(is_numeric($personId) && $personId != '')
{
$qry = str_replace('?', $this->db_add_param($personId, FHC_INTEGER), $this->_loadQuery);
if (!$this->db_query($qry))
$result = $this->getPerson($personId);
if(!is_object($result))
{
$this->errormsg = "Fehler beim Lesen der Personendaten\n";
return false;
return FALSE;
}
if ($row = $this->db_fetch_object())
$row = $result->row();
if(isset($row))
{
$this->person_id = $row->person_id;
$this->sprache = $row->sprache;
+10 -9
View File
@@ -26,9 +26,9 @@ require_once(dirname(__FILE__).'/datum.class.php');
// CI
require_once(dirname(__FILE__).'/../ci_hack.php');
require_once(dirname(__FILE__).'/../application/models/studies/Course_model.php');
require_once(dirname(__FILE__).'/../application/models/lehre/Studiengang_model.php');
class studiengang extends Course_model
class studiengang extends Studiengang_model
{
use db_extra; //CI Hack
@@ -247,18 +247,19 @@ class studiengang extends Course_model
*/
public function getAllForBewerbung()
{
if(!$result = $this->db_query($this->_allForBewerbungQuery))
error_log("getAllForBewerbung called!!!");
$result = parent::getAllForBewerbung();
if(!is_object($result))
{
$this->errormsg = 'Datensatz konnte nicht geladen werden';
return false;
return FALSE;
}
while($row = $this->db_fetch_object($result))
{
$this->result[] = $row;
}
$this->result = $result->result();
return true;
return TRUE;
}
/**
+27 -24
View File
@@ -28,9 +28,9 @@ require_once(dirname(__FILE__).'/datum.class.php');
// CI
require_once(dirname(__FILE__).'/../ci_hack.php');
require_once(dirname(__FILE__).'/../application/models/studies/Plan_model.php');
require_once(dirname(__FILE__).'/../application/models/lehre/Studienplan_model.php');
class studienplan extends Plan_model
class studienplan extends Studienplan_model
{
use db_extra; //CI Hack
@@ -729,33 +729,36 @@ class studienplan extends Plan_model
*/
function getStudienplaene($studiengang_kz)
{
$qry = str_replace('?', $this->db_add_param($studiengang_kz, FHC_INTEGER), $this->_studienplaeneQuery);
if($result = $this->db_query($qry))
error_log("getStudienplaene called!!!");
$result = parent::getStudienplaene($studiengang_kz);
if(is_object($result))
{
while($row = $this->db_fetch_object($result))
foreach($result->result() as $row)
{
$obj = new studienplan();
$obj = new studienplan();
$obj->studienplan_id = $row->studienplan_id;
$obj->studienordnung_id = $row->studienordnung_id;
$obj->orgform_kurzbz = $row->orgform_kurzbz;
$obj->version = $row->version;
$obj->bezeichnung = $row->bezeichnung;
$obj->regelstudiendauer = $row->regelstudiendauer;
$obj->sprache = $row->sprache;
$obj->aktiv = $this->db_parse_bool($row->aktiv);
$obj->semesterwochen = $row->semesterwochen;
$obj->testtool_sprachwahl = $this->db_parse_bool($row->testtool_sprachwahl);
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->new=false;
$obj->studienplan_id = $row->studienplan_id;
$obj->studienordnung_id = $row->studienordnung_id;
$obj->orgform_kurzbz = $row->orgform_kurzbz;
$obj->version = $row->version;
$obj->bezeichnung = $row->bezeichnung;
$obj->regelstudiendauer = $row->regelstudiendauer;
$obj->sprache = $row->sprache;
$obj->aktiv = $this->db_parse_bool($row->aktiv);
$obj->semesterwochen = $row->semesterwochen;
$obj->testtool_sprachwahl = $this->db_parse_bool($row->testtool_sprachwahl);
$obj->updateamum = $row->updateamum;
$obj->updatevon = $row->updatevon;
$obj->insertamum = $row->insertamum;
$obj->insertvon = $row->insertvon;
$obj->new = FALSE;
$this->result[] = $obj;
$this->result[] = $obj;
}
return true;
return TRUE;
}
}