umstellung auf shared codeigniter und postgres php8.2
This commit is contained in:
@@ -11,7 +11,7 @@ class mAccounts extends Model {
|
||||
protected $returnType = 'object';
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $allowedFields = ['parent_id','type','bookable','description','LKZ'];
|
||||
protected $allowedFields = ['parent_id','type','bookable','description','lkz'];
|
||||
|
||||
protected $useTimestamps = false;
|
||||
private $mAccountList = array();
|
||||
@@ -65,12 +65,12 @@ class mAccounts extends Model {
|
||||
* liefert DropDown Liste mit gegeben Suchparametern
|
||||
* @param string Kontotyp "InOut,In,Out,Acc"
|
||||
* @param bool ob bookable gesetzt sein muss
|
||||
* @return bool ob LKZ Flag gesetzt sein darf
|
||||
* @return bool ob lkz Flag gesetzt sein darf
|
||||
*/
|
||||
public function getDropDownList($type, $bookable = true, $lkz = false )
|
||||
{
|
||||
if ($bookable == true)
|
||||
$this->where('bookable',1);
|
||||
$this->where('bookable',true);
|
||||
if ($lkz == false) $this->where('lkz',NULL);
|
||||
if ( $type == 'InOut' ) $this->where('type !=','account');
|
||||
elseif ( $type == 'Acc' ) $this->where('type','account');
|
||||
@@ -99,11 +99,11 @@ class mAccounts extends Model {
|
||||
* parent für Vorselektion, subs für Untereinträge
|
||||
* @param string Kontotyp "InOut,In,Out,Acc"
|
||||
* @param bool ob bookable gesetzt sein muss
|
||||
* @return bool ob LKZ Flag gesetzt sein darf
|
||||
* @return bool ob lkz Flag gesetzt sein darf
|
||||
*/
|
||||
public function getDropDownLists($type, $bookable = true, $lkz = false )
|
||||
{
|
||||
if ($bookable == true) $this->where('bookable',1);
|
||||
if ($bookable == true) $this->where('bookable',true);
|
||||
if ($lkz == false) $this->where('lkz',null);
|
||||
if ( $type == 'InOut' ) $this->where('type !=','account');
|
||||
elseif ( $type == 'Acc' ) $this->where('type','account');
|
||||
@@ -119,7 +119,7 @@ class mAccounts extends Model {
|
||||
$id = $element->parent_id;
|
||||
while ( $id > 0 )
|
||||
{
|
||||
if ($this->mAccountList[$id]->LKZ == 1) continue 2;
|
||||
if ($this->mAccountList[$id]->lkz == 1) continue 2;
|
||||
if ($this->mAccountList[$id]->parent_id == 0){
|
||||
if (!array_key_exists($id, $parent))
|
||||
$parent[$id] = (object)['id' => $id,'description' => $this->mAccountList[$id]->description ];
|
||||
@@ -134,7 +134,7 @@ class mAccounts extends Model {
|
||||
$subs = array();
|
||||
$subs[0] = $this->createDropDownList(array());
|
||||
foreach ( $listen as $key => $element ){
|
||||
$subs[$key] = $this->createDropDownList($element,$this->mAccountList[$key]->bookable, $key);
|
||||
$subs[$key] = $this->createDropDownList($element,($this->mAccountList[$key]->bookable=="t"), $key);
|
||||
}
|
||||
return array('parent'=> $this->createDropDownList($parent),'subs'=>(object)$subs);
|
||||
}
|
||||
@@ -188,9 +188,9 @@ class mAccounts extends Model {
|
||||
public function saveAccount($data){
|
||||
$this->set('parent_id',$data['parent']);
|
||||
$this->set('type', $data['type']);
|
||||
$this->set('bookable', array_key_exists('bookable', $data) ? 1 : 0);
|
||||
$this->set('bookable', array_key_exists('bookable', $data) ? true : false);
|
||||
$this->set('description', $data['description']);
|
||||
$this->set('LKZ', (array_key_exists('lkz', $data) ? 1 : null));
|
||||
$this->set('lkz', (array_key_exists('lkz', $data) ? 1 : null));
|
||||
if ($data['id'] == 0)
|
||||
$this->insert();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user