- Cleaned the controllers by moving the database related code and more complex logic

in the models or libraries
- DmsLib bug fix
- Person_model bug fix
This commit is contained in:
bison
2016-08-31 14:15:39 +02:00
parent 0c912c0122
commit 939ca288fc
10 changed files with 194 additions and 163 deletions
@@ -12,7 +12,7 @@
*/
// ------------------------------------------------------------------------
if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!defined("BASEPATH")) exit("No direct script access allowed");
class Ort extends APIv1_Controller
{
@@ -23,9 +23,7 @@ class Ort extends APIv1_Controller
{
parent::__construct();
// Load model OrtModel
$this->load->model('ressource/ort_model', 'OrtModel');
$this->load->model("ressource/ort_model", "OrtModel");
}
/**
@@ -33,7 +31,7 @@ class Ort extends APIv1_Controller
*/
public function getOrt()
{
$ort_kurzbz = $this->get('ort_kurzbz');
$ort_kurzbz = $this->get("ort_kurzbz");
if (isset($ort_kurzbz))
{
@@ -52,17 +50,11 @@ class Ort extends APIv1_Controller
*/
public function getAll()
{
$raumtyp_kurzbz = $this->get('raumtyp_kurzbz');
$raumtyp_kurzbz = $this->get("raumtyp_kurzbz");
$this->OrtModel->addOrder('ort_kurzbz');
if (!is_null($raumtyp_kurzbz) && $raumtyp_kurzbz != '')
if (!is_null($raumtyp_kurzbz) && $raumtyp_kurzbz != "")
{
$result = $this->OrtModel->addJoin('public.tbl_ortraumtyp', 'ort_kurzbz');
if ($result->error == EXIT_SUCCESS)
{
$result = $this->OrtModel->loadWhere(array('raumtyp_kurzbz' => $raumtyp_kurzbz));
}
$result = $this->OrtModel->getAll($raumtyp_kurzbz);
}
else
{
@@ -79,9 +71,9 @@ class Ort extends APIv1_Controller
{
if ($this->_validate($this->post()))
{
if (isset($this->post()['ort_kurzbz']))
if (isset($this->post()["ort_kurzbz"]))
{
$result = $this->OrtModel->update($this->post()['ort_kurzbz'], $this->post());
$result = $this->OrtModel->update($this->post()["ort_kurzbz"], $this->post());
}
else
{