- Moved old libraries to CI

- Bugfixes
This commit is contained in:
paolo
2016-06-10 18:09:54 +02:00
parent d237915e80
commit ffa0bdc947
5 changed files with 18 additions and 7 deletions
@@ -37,7 +37,7 @@ class Ort extends APIv1_Controller
if (isset($ort_kurzbz))
{
$result = $this->OrtModel->load($ort_kurzbz);
$result = $this->OrtModel->load(trim($ort_kurzbz));
$this->response($result, REST_Controller::HTTP_OK);
}
+6 -1
View File
@@ -1,7 +1,12 @@
<?php
trait db_extra
{
protected $db_result=null;
/*
* Moved to private to avoid to violate "Strict standards"
* This property must be used only in the methods of this trait
* and access to it should only be done through the methods of this trait
*/
private $db_result = null;
public function db_query($sql)
{
+2
View File
@@ -23,6 +23,8 @@ require_once(dirname(__FILE__).'/person.class.php');
class benutzer extends person
{
use db_extra; //CI Hack
//Tabellenspalten
public $uid; // varchar(32)
public $bnaktiv=true; // boolean
+2
View File
@@ -25,6 +25,8 @@ require_once(dirname(__FILE__).'/functions.inc.php');
class mitarbeiter extends benutzer
{
use db_extra; //CI Hack
public $new;
public $errormsg;
public $result=array();
+7 -5
View File
@@ -35,6 +35,7 @@ class ort extends Ort_model
public $new; // boolean
public $result = array(); // ort Objekt
public $errormsg; // string
//Tabellenspalten
public $ort_kurzbz; // string
@@ -137,22 +138,23 @@ class ort extends Ort_model
*/
public function load($ort_kurzbz)
{
if($ort_kurzbz == '')
if ($ort_kurzbz == '')
{
$this->errormsg = 'kurzbz darf nicht leer sein';
return false;
}
$qry = "SELECT * FROM public.tbl_ort WHERE trim(ort_kurzbz) = ".$this->db_add_param(trim($ort_kurzbz)).";";
if(!$this->db_query($qry))
$result = parent::load(trim($ort_kurzbz));
if (!is_object($result) || (is_object($result) && $result->error != EXIT_SUCCESS))
{
$this->errormsg = 'Fehler beim Laden des Datensatzes';
return false;
}
if($row = $this->db_fetch_object())
if(is_array($result->retval) && count($result->retval) > 0)
{
$row = $result->retval[0];
$this->ort_kurzbz = $row->ort_kurzbz;
$this->bezeichnung = $row->bezeichnung;
$this->planbezeichnung = $row->planbezeichnung;