mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 12:37:14 +01:00
73 lines
2.6 KiB
PHP
73 lines
2.6 KiB
PHP
<?php
|
|
include ("_gen/widget.gen.preisanfrage.php");
|
|
|
|
class WidgetPreisanfrage extends WidgetGenpreisanfrage
|
|
{
|
|
private $app;
|
|
function __construct(&$app,$parsetarget)
|
|
{
|
|
$this->app = &$app;
|
|
$this->parsetarget = $parsetarget;
|
|
parent::__construct($app,$parsetarget);
|
|
$this->ExtendsForm();
|
|
}
|
|
|
|
function ExtendsForm()
|
|
{
|
|
$this->app->YUI->AutoComplete("adresse","lieferant",1);
|
|
$this->app->YUI->AutoComplete("projekt","projektname",1);
|
|
|
|
if($this->app->erp->Firmendaten("briefhtml")=="1")
|
|
{
|
|
$this->app->YUI->CkEditor("bodyzusatz","belege");
|
|
$this->app->YUI->CkEditor("freitext","belege");
|
|
$this->app->YUI->CkEditor("internebemerkung","internal");
|
|
}
|
|
|
|
$this->app->YUI->DatePicker("datum");
|
|
$id = $this->app->Secure->GetGET("id");
|
|
$sprachenOptions = $this->app->erp->GetSprachenSelect($id?$this->app->DB->Select("SELECT sprache FROM adresse WHERE id = '$id' LIMIT 1"):null);
|
|
|
|
$field = new HTMLSelect("sprache",0,"sprache",false,false,"1");
|
|
//$field->onchange="onchange_typ(this.form.typ.options[this.form.typ.selectedIndex].value);";
|
|
$field->AddOptionsSimpleArray($sprachenOptions);
|
|
$this->form->NewField($field);
|
|
if($this->app->erp->ModulVorhanden('bundesstaaten'))
|
|
{
|
|
$typOptions = $this->app->erp->GetTypSelect();
|
|
$field = new HTMLSelect("bundesstaat",0,"bundesstaat",false,false,"1");
|
|
$this->form->NewField($field);
|
|
if($id > 0){
|
|
$schreibschutz = $this->app->DB->Select("SELECT schreibschutz FROM preisanfrage WHERE id = '$id' LIMIT 1");
|
|
}else{
|
|
$schreibschutz = 0;
|
|
}
|
|
$this->app->YUI->BundeslaenderSelect('EPROO_SELECT_BUNDESSTAAT', 'land', 'bundesstaat',$this->app->DB->Select("SELECT land FROM preisanfrage WHERE id = '$id' LIMIT 1"),$this->app->DB->Select("SELECT bundesstaat FROM preisanfrage WHERE id = '$id' LIMIT 1"),$schreibschutz?true:false);
|
|
}else{
|
|
$this->app->Tpl->Set('VORBUNDESSTAAT','<!--');
|
|
$this->app->Tpl->Set('NACHBUNDESSTAAT','-->');
|
|
}
|
|
|
|
$this->form->ReplaceFunction("datum",$this,"ReplaceDatum");
|
|
$this->form->ReplaceFunction("projekt",$this,"ReplaceProjekt");
|
|
$this->form->ReplaceFunction("adresse",$this,"ReplaceLieferant");
|
|
}
|
|
|
|
function ReplaceProjekt($db,$value,$fromform)
|
|
{
|
|
return $this->app->erp->ReplaceProjekt($db,$value,$fromform);
|
|
}
|
|
|
|
function ReplaceLieferant($db,$value,$fromform)
|
|
{
|
|
return $this->app->erp->ReplaceLieferantennummer($db,$value,$fromform);
|
|
}
|
|
|
|
function ReplaceDatum($db,$value,$fromform)
|
|
{
|
|
return $this->app->erp->ReplaceDatum($db,$value,$fromform);
|
|
}
|
|
|
|
}
|
|
?>
|