app = $app;
if ($intern)
return;
$this->app->ActionHandlerInit($this);
$this->app->ActionHandler("list", "waehrung_umrechnung_list");
$this->app->ActionHandler("create", "waehrung_umrechnung_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "waehrung_umrechnung_edit");
$this->app->ActionHandler("delete", "waehrung_umrechnung_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 "waehrung_umrechnung_list":
$allowed['waehrung_umrechnung_list'] = array('list');
$heading = array('','','Währung von', 'Währung nach', 'Kurs', 'Gültig bis', 'Geändert am', 'Bearbeiter', 'Kommentar', '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('id','id','w.waehrung_von', 'w.waehrung_nach', 'w.kurs', 'w.gueltig_bis', 'w.zeitstempel', 'w.bearbeiter', 'w.kommentar');
$searchsql = array('w.waehrung_von', 'w.waehrung_nach', 'w.kurs', 'w.gueltig_bis', 'w.zeitstempel', 'w.bearbeiter', 'w.kommentar');
$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 w.id, $dropnbox, w.waehrung_von, w.waehrung_nach, w.kurs, w.gueltig_bis, w.zeitstempel, w.bearbeiter, w.kommentar, w.id FROM waehrung_umrechnung w"." 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->SetInput($input);
$this->app->YUI->DatePicker("gueltig_bis");
$this->app->Tpl->Set('GUELTIG_BIS',$this->app->erp->ReplaceDatum(false,$result[0]['gueltig_bis'],true));
$this->app->Tpl->Set('WAEHRUNG_VON',$this->app->erp->getSelectAsso($this->app->erp->GetWaehrung(), $result[0]['waehrung_von']));
$this->app->Tpl->Set('WAEHRUNG_NACH',$this->app->erp->getSelectAsso($this->app->erp->GetWaehrung(), $result[0]['waehrung_nach']));
$this->app->Tpl->Parse('PAGE', "waehrungumrechnung_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['waehrung_von'] = $this->app->Secure->GetPOST('waehrung_von');
$input['waehrung_nach'] = $this->app->Secure->GetPOST('waehrung_nach');
$input['kurs'] = $this->app->Secure->GetPOST('kurs');
$input['gueltig_bis'] = $this->app->Secure->GetPOST('gueltig_bis');
$input['zeitstempel'] = $this->app->Secure->GetPOST('zeitstempel');
$input['bearbeiter'] = $this->app->Secure->GetPOST('bearbeiter');
$input['kommentar'] = $this->app->Secure->GetPOST('kommentar');
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('WAEHRUNG_VON', $input['waehrung_von']);
$this->app->Tpl->Set('WAEHRUNG_NACH', $input['waehrung_nach']);
$this->app->Tpl->Set('KURS', $input['kurs']);
$this->app->Tpl->Set('GUELTIG_BIS', $input['gueltig_bis']);
$this->app->Tpl->Set('ZEITSTEMPEL', $input['zeitstempel']);
$this->app->Tpl->Set('BEARBEITER', $input['bearbeiter']);
$this->app->Tpl->Set('KOMMENTAR', $input['kommentar']);
}
}