mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-27 23:20:28 +01:00
159 lines
3.8 KiB
PHP
159 lines
3.8 KiB
PHP
<?php
|
|
include ("_gen/widget.gen.artikelgruppen.php");
|
|
|
|
class WidgetArtikelgruppen extends WidgetGenArtikelgruppen
|
|
{
|
|
private $app;
|
|
function __construct($app,$parsetarget)
|
|
{
|
|
$this->app = $app;
|
|
$this->parsetarget = $parsetarget;
|
|
parent::__construct($app,$parsetarget);
|
|
$this->ExtendsForm();
|
|
}
|
|
|
|
function ExtendsForm()
|
|
{
|
|
//firma
|
|
// $this->app->Secure->POST["firma"]=$this->app->User->GetFirma();
|
|
// $field = new HTMLInput("firma","hidden",$this->app->User->GetFirma());
|
|
// $this->form->NewField($field);
|
|
$this->app->YUI->AutoComplete("shop","shopname");
|
|
$this->form->ReplaceFunction("shop",$this,"ReplaceShopname");
|
|
|
|
|
|
|
|
//$this->app->YUI->AutoComplete(PROJEKTAUTO,"projekt",array('name','abkuerzung'),"abkuerzung");
|
|
//$this->form->ReplaceFunction("projekt",&$this,"ReplaceProjekt");
|
|
|
|
|
|
//$this->app->Tpl->Set(DATUM_BUCHUNG,
|
|
// "<img src=\"./themes/[THEME]/images/kalender.png\" onclick=\"displayCalendar(document.forms[0].datum,'dd.mm.yyyy',this)\">");
|
|
|
|
}
|
|
function ReplaceProjekt($db,$value,$fromform)
|
|
{
|
|
//value muss hier vom format ueberprueft werden
|
|
$dbformat = 0;
|
|
if(!$fromform) {
|
|
$dbformat = 1;
|
|
$id = $value;
|
|
$abkuerzung = $this->app->DB->Select("SELECT abkuerzung FROM projekt WHERE id='$id' LIMIT 1");
|
|
} else {
|
|
$dbformat = 0;
|
|
$abkuerzung = $value;
|
|
$id = $this->app->DB->Select("SELECT id FROM projekt WHERE abkuerzung='$value' LIMIT 1");
|
|
}
|
|
|
|
// wenn ziel datenbank
|
|
if($db)
|
|
{
|
|
return $id;
|
|
}
|
|
// wenn ziel formular
|
|
else
|
|
{
|
|
return $abkuerzung;
|
|
}
|
|
}
|
|
|
|
function ReplaceDecimal($db,$value,$fromform)
|
|
{
|
|
//value muss hier vom format ueberprueft werden
|
|
|
|
return str_replace(",",".",$value);
|
|
}
|
|
|
|
function ReplaceDatum($db,$value,$fromform)
|
|
{
|
|
//value muss hier vom format ueberprueft werden
|
|
$dbformat = 0;
|
|
if(strpos($value,'-') > 0) $dbformat = 1;
|
|
|
|
// wenn ziel datenbank
|
|
if($db)
|
|
{
|
|
if($dbformat) return $value;
|
|
else return $this->app->String->Convert($value,"%1.%2.%3","%3-%2-%1");
|
|
}
|
|
// wenn ziel formular
|
|
else
|
|
{
|
|
if($dbformat) return $this->app->String->Convert($value,"%1-%2-%3","%3.%2.%1");
|
|
else return $value;
|
|
}
|
|
}
|
|
|
|
function ReplaceAdresse($db,$value,$fromform)
|
|
{
|
|
//value muss hier vom format ueberprueft werden
|
|
$dbformat = 0;
|
|
if(!$fromform) {
|
|
$dbformat = 1;
|
|
$id = $value;
|
|
$abkuerzung = $this->app->DB->Select("SELECT name FROM adresse WHERE id='$id' AND geloescht=0 LIMIT 1");
|
|
} else {
|
|
$dbformat = 0;
|
|
$abkuerzung = $value;
|
|
$id = $this->app->DB->Select("SELECT id FROM adresse WHERE name='$value' AND geloescht=0 LIMIT 1");
|
|
}
|
|
|
|
// wenn ziel datenbank
|
|
if($db)
|
|
{
|
|
return $id;
|
|
}
|
|
// wenn ziel formular
|
|
else
|
|
{
|
|
return $abkuerzung;
|
|
}
|
|
}
|
|
|
|
public function Table()
|
|
{
|
|
$this->app->YUI->TableSearch('INHALT',"artikelgruppenlist");
|
|
$this->app->Tpl->Parse($this->parsetarget,"rahmen70.tpl");
|
|
|
|
}
|
|
|
|
function ReplaceShopname($db,$value)
|
|
{
|
|
//value muss hier vom format ueberprueft werden
|
|
$dbformat = 0;
|
|
if(is_numeric($value)) {
|
|
$dbformat = 1;
|
|
$id = $value;
|
|
$abkuerzung = $this->app->DB->Select("SELECT bezeichnung FROM shopexport WHERE id='$id' LIMIT 1");
|
|
} else {
|
|
$dbformat = 0;
|
|
$abkuerzung = $value;
|
|
$id = $this->app->DB->Select("SELECT id FROM shopexport WHERE bezeichnung='$value' LIMIT 1");
|
|
}
|
|
|
|
// wenn ziel datenbank
|
|
if($db)
|
|
{
|
|
return $id;
|
|
}
|
|
// wenn ziel formular
|
|
else
|
|
{
|
|
return $abkuerzung;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function Search()
|
|
{
|
|
//$this->app->Tpl->Set($this->parsetarget,"suchmaske");
|
|
//$this->app->Table(
|
|
//$table = new OrderTable("veranstalter");
|
|
//$table->Heading(array('Name','Homepage','Telefon'));
|
|
}
|
|
|
|
|
|
}
|
|
?>
|