mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
- Moved old libraries to CI
- Bugfixes
This commit is contained in:
@@ -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
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user