app = $app;
if ($intern)
return;
$this->app->ActionHandlerInit($this);
$this->app->ActionHandler("list", "konten_list");
$this->app->ActionHandler("create", "konten_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "konten_edit");
$this->app->ActionHandler("delete", "konten_delete");
$this->app->DefaultActionHandler("list");
$this->app->ActionHandlerListen($app);
}
public function Install() {
/* Fill out manually later */
}
static function TableSearch(&$app, $name, $erlaubtevars) {
switch ($name) {
case "konten_list":
$allowed['konten_list'] = array('list');
$heading = array('','','Bezeichnung', 'Kurzbezeichnung', 'Typ', 'Projekt', 'Aktiv','Menü');
$width = array('1%','1%','10%'); // Fill out manually later
// columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8);
$findcols = array('k.id','k.id','k.bezeichnung', 'k.kurzbezeichnung', 'k.type', 'p.abkuerzung', ' k.aktiv','k.id');
$searchsql = array('k.bezeichnung', 'k.kurzbezeichnung', 'k.datevkonto', 'k.blz', 'k.konto', 'k.swift', 'k.iban', 'k.inhaber', 'k.firma','p.abkuerzung');
$defaultorder = 1;
$defaultorderdesc = 0;
$dropnbox = "'
' AS `open`, CONCAT('') AS `auswahl`";
$menu = "
| " . " |
' AS `open`, CONCAT('') AS `auswahl`";
$result = $this->app->DB->SelectArr("SELECT SQL_CALC_FOUND_ROWS k.id, $dropnbox, k.bezeichnung, k.kurzbezeichnung, k.type, k.erstezeile, k.datevkonto, k.blz, k.konto, k.swift, k.iban, k.lastschrift, k.hbci, k.hbcikennung, k.inhaber, k.aktiv, k.keineemail, k.firma, k.schreibbar, k.importletztenzeilenignorieren, k.liveimport, k.liveimport_passwort, k.liveimport_online, k.importtrennzeichen, k.codierung, k.importerstezeilenummer, k.importdatenmaskierung, k.importnullbytes, k.glaeubiger, k.geloescht, k.projekt, k.saldo_summieren, k.saldo_betrag, k.saldo_datum, k.importfelddatum, k.importfelddatumformat, k.importfelddatumformatausgabe, k.importfeldbetrag, k.importfeldbetragformat, k.importfeldbuchungstext, k.importfeldbuchungstextformat, k.importfeldwaehrung, k.importfeldwaehrungformat, k.importfeldhabensollkennung, k.importfeldkennunghaben, k.importfeldkennungsoll, k.importextrahabensoll, k.importfeldhaben, k.importfeldsoll, k.cronjobaktiv, k.cronjobverbuchen, k.last_import, k.importperiode_in_hours, k.id FROM konten k"." WHERE id=$id");
foreach ($result[0] as $key => $value) {
$this->app->Tpl->Set(strtoupper($key), $value);
}
/*
* Add displayed items later
*
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
$this->app->Tpl->Add('EMAIL', $email);
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
*/
$this->app->YUI->AutoComplete('projekt','projektname',1);
$this->app->Tpl->Set('PROJEKT',$this->app->erp->ReplaceProjekt(false,$result[0]['projekt'],false));
$this->app->Tpl->Set('AKTIV',$result[0]['aktiv']==1?'checked':'');
$this->app->Tpl->Set('KEINEEMAIL',$result[0]['keineemail']==1?'checked':'');
$this->app->Tpl->Set('SCHREIBBAR',$result[0]['schreibbar']==1?'checked':'');
$this->app->Tpl->Set('LASTSCHRIFT',$result[0]['lastschrift']==1?'checked':'');
$this->app->Tpl->Set('SALDO_SUMMIEREN',$result[0]['saldo_summieren']==1?'checked':'');
$this->app->Tpl->Parse('PAGE', "konten_edit.tpl");
}
/**
* Get all paramters from html form and save into $input
*/
public function GetInput(): array {
$input = array();
//$input['EMAIL'] = $this->app->Secure->GetPOST('email');
$input['bezeichnung'] = $this->app->Secure->GetPOST('bezeichnung');
$input['kurzbezeichnung'] = $this->app->Secure->GetPOST('kurzbezeichnung');
$input['type'] = $this->app->Secure->GetPOST('type');
$input['erstezeile'] = $this->app->Secure->GetPOST('erstezeile');
$input['datevkonto'] = $this->app->Secure->GetPOST('datevkonto');
$input['blz'] = $this->app->Secure->GetPOST('blz');
$input['konto'] = $this->app->Secure->GetPOST('konto');
$input['swift'] = $this->app->Secure->GetPOST('swift');
$input['iban'] = $this->app->Secure->GetPOST('iban');
$input['lastschrift'] = $this->app->Secure->GetPOST('lastschrift');
$input['hbci'] = $this->app->Secure->GetPOST('hbci');
$input['hbcikennung'] = $this->app->Secure->GetPOST('hbcikennung');
$input['inhaber'] = $this->app->Secure->GetPOST('inhaber');
$input['aktiv'] = $this->app->Secure->GetPOST('aktiv');
$input['keineemail'] = $this->app->Secure->GetPOST('keineemail');
$input['firma'] = $this->app->Secure->GetPOST('firma');
$input['schreibbar'] = $this->app->Secure->GetPOST('schreibbar');
$input['importletztenzeilenignorieren'] = $this->app->Secure->GetPOST('importletztenzeilenignorieren');
$input['liveimport'] = $this->app->Secure->GetPOST('liveimport');
$input['liveimport_passwort'] = $this->app->Secure->GetPOST('liveimport_passwort');
$input['liveimport_online'] = $this->app->Secure->GetPOST('liveimport_online');
$input['importtrennzeichen'] = $this->app->Secure->GetPOST('importtrennzeichen');
$input['codierung'] = $this->app->Secure->GetPOST('codierung');
$input['importerstezeilenummer'] = $this->app->Secure->GetPOST('importerstezeilenummer');
$input['importdatenmaskierung'] = $this->app->Secure->GetPOST('importdatenmaskierung');
$input['importnullbytes'] = $this->app->Secure->GetPOST('importnullbytes');
$input['glaeubiger'] = $this->app->Secure->GetPOST('glaeubiger');
$input['geloescht'] = $this->app->Secure->GetPOST('geloescht');
$input['projekt'] = $this->app->Secure->GetPOST('projekt');
$input['saldo_summieren'] = $this->app->Secure->GetPOST('saldo_summieren');
$input['saldo_betrag'] = $this->app->Secure->GetPOST('saldo_betrag');
$input['saldo_datum'] = $this->app->Secure->GetPOST('saldo_datum');
$input['importfelddatum'] = $this->app->Secure->GetPOST('importfelddatum');
$input['importfelddatumformat'] = $this->app->Secure->GetPOST('importfelddatumformat');
$input['importfelddatumformatausgabe'] = $this->app->Secure->GetPOST('importfelddatumformatausgabe');
$input['importfeldbetrag'] = $this->app->Secure->GetPOST('importfeldbetrag');
$input['importfeldbetragformat'] = $this->app->Secure->GetPOST('importfeldbetragformat');
$input['importfeldbuchungstext'] = $this->app->Secure->GetPOST('importfeldbuchungstext');
$input['importfeldbuchungstextformat'] = $this->app->Secure->GetPOST('importfeldbuchungstextformat');
$input['importfeldwaehrung'] = $this->app->Secure->GetPOST('importfeldwaehrung');
$input['importfeldwaehrungformat'] = $this->app->Secure->GetPOST('importfeldwaehrungformat');
$input['importfeldhabensollkennung'] = $this->app->Secure->GetPOST('importfeldhabensollkennung');
$input['importfeldkennunghaben'] = $this->app->Secure->GetPOST('importfeldkennunghaben');
$input['importfeldkennungsoll'] = $this->app->Secure->GetPOST('importfeldkennungsoll');
$input['importextrahabensoll'] = $this->app->Secure->GetPOST('importextrahabensoll');
$input['importfeldhaben'] = $this->app->Secure->GetPOST('importfeldhaben');
$input['importfeldsoll'] = $this->app->Secure->GetPOST('importfeldsoll');
$input['cronjobaktiv'] = $this->app->Secure->GetPOST('cronjobaktiv');
$input['cronjobverbuchen'] = $this->app->Secure->GetPOST('cronjobverbuchen');
$input['last_import'] = $this->app->Secure->GetPOST('last_import');
$input['importperiode_in_hours'] = $this->app->Secure->GetPOST('importperiode_in_hours');
return $input;
}
/*
* Set all fields in the page corresponding to $input
*/
function SetInput($input) {
// $this->app->Tpl->Set('EMAIL', $input['email']);
$this->app->Tpl->Set('BEZEICHNUNG', $input['bezeichnung']);
$this->app->Tpl->Set('KURZBEZEICHNUNG', $input['kurzbezeichnung']);
$this->app->Tpl->Set('TYPE', $input['type']);
$this->app->Tpl->Set('ERSTEZEILE', $input['erstezeile']);
$this->app->Tpl->Set('DATEVKONTO', $input['datevkonto']);
$this->app->Tpl->Set('BLZ', $input['blz']);
$this->app->Tpl->Set('KONTO', $input['konto']);
$this->app->Tpl->Set('SWIFT', $input['swift']);
$this->app->Tpl->Set('IBAN', $input['iban']);
$this->app->Tpl->Set('LASTSCHRIFT', $input['lastschrift']);
$this->app->Tpl->Set('HBCI', $input['hbci']);
$this->app->Tpl->Set('HBCIKENNUNG', $input['hbcikennung']);
$this->app->Tpl->Set('INHABER', $input['inhaber']);
$this->app->Tpl->Set('AKTIV', $input['aktiv']);
$this->app->Tpl->Set('KEINEEMAIL', $input['keineemail']);
$this->app->Tpl->Set('FIRMA', $input['firma']);
$this->app->Tpl->Set('SCHREIBBAR', $input['schreibbar']);
$this->app->Tpl->Set('IMPORTLETZTENZEILENIGNORIEREN', $input['importletztenzeilenignorieren']);
$this->app->Tpl->Set('LIVEIMPORT', $input['liveimport']);
$this->app->Tpl->Set('LIVEIMPORT_PASSWORT', $input['liveimport_passwort']);
$this->app->Tpl->Set('LIVEIMPORT_ONLINE', $input['liveimport_online']);
$this->app->Tpl->Set('IMPORTTRENNZEICHEN', $input['importtrennzeichen']);
$this->app->Tpl->Set('CODIERUNG', $input['codierung']);
$this->app->Tpl->Set('IMPORTERSTEZEILENUMMER', $input['importerstezeilenummer']);
$this->app->Tpl->Set('IMPORTDATENMASKIERUNG', $input['importdatenmaskierung']);
$this->app->Tpl->Set('IMPORTNULLBYTES', $input['importnullbytes']);
$this->app->Tpl->Set('GLAEUBIGER', $input['glaeubiger']);
$this->app->Tpl->Set('GELOESCHT', $input['geloescht']);
$this->app->Tpl->Set('PROJEKT', $input['projekt']);
$this->app->Tpl->Set('SALDO_SUMMIEREN', $input['saldo_summieren']);
$this->app->Tpl->Set('SALDO_BETRAG', $input['saldo_betrag']);
$this->app->Tpl->Set('SALDO_DATUM', $input['saldo_datum']);
$this->app->Tpl->Set('IMPORTFELDDATUM', $input['importfelddatum']);
$this->app->Tpl->Set('IMPORTFELDDATUMFORMAT', $input['importfelddatumformat']);
$this->app->Tpl->Set('IMPORTFELDDATUMFORMATAUSGABE', $input['importfelddatumformatausgabe']);
$this->app->Tpl->Set('IMPORTFELDBETRAG', $input['importfeldbetrag']);
$this->app->Tpl->Set('IMPORTFELDBETRAGFORMAT', $input['importfeldbetragformat']);
$this->app->Tpl->Set('IMPORTFELDBUCHUNGSTEXT', $input['importfeldbuchungstext']);
$this->app->Tpl->Set('IMPORTFELDBUCHUNGSTEXTFORMAT', $input['importfeldbuchungstextformat']);
$this->app->Tpl->Set('IMPORTFELDWAEHRUNG', $input['importfeldwaehrung']);
$this->app->Tpl->Set('IMPORTFELDWAEHRUNGFORMAT', $input['importfeldwaehrungformat']);
$this->app->Tpl->Set('IMPORTFELDHABENSOLLKENNUNG', $input['importfeldhabensollkennung']);
$this->app->Tpl->Set('IMPORTFELDKENNUNGHABEN', $input['importfeldkennunghaben']);
$this->app->Tpl->Set('IMPORTFELDKENNUNGSOLL', $input['importfeldkennungsoll']);
$this->app->Tpl->Set('IMPORTEXTRAHABENSOLL', $input['importextrahabensoll']);
$this->app->Tpl->Set('IMPORTFELDHABEN', $input['importfeldhaben']);
$this->app->Tpl->Set('IMPORTFELDSOLL', $input['importfeldsoll']);
$this->app->Tpl->Set('CRONJOBAKTIV', $input['cronjobaktiv']);
$this->app->Tpl->Set('CRONJOBVERBUCHEN', $input['cronjobverbuchen']);
$this->app->Tpl->Set('LAST_IMPORT', $input['last_import']);
$this->app->Tpl->Set('IMPORTPERIODE_IN_HOURS', $input['importperiode_in_hours']);
}
}