OpenXE/www/widgets/widget.anfrage_position.php

74 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2021-05-21 08:49:41 +02:00
<?php
include ("_gen/widget.gen.anfrage_position.php");
class WidgetAnfrage_position extends WidgetGenAnfrage_position
{
private $app;
function __construct($app,$parsetarget)
{
$this->app = $app;
$this->parsetarget = $parsetarget;
parent::__construct($app,$parsetarget);
$this->ExtendsForm();
}
function ExtendsForm()
{
$this->app->YUI->AutoComplete("einheit","artikeleinheit");
//$this->app->YUI->AutoComplete(AUTO,"artikel",array('nummer','name_de','warengruppe'),"nummer");
$this->app->YUI->DatePicker("lieferdatum");
if($this->app->erp->Firmendaten("briefhtml")=="1")
{
$this->app->YUI->CkEditor("beschreibung","belege");
$this->app->YUI->CkEditor("bemerkung","basic");
}
$this->form->ReplaceFunction("lieferdatum",$this,"ReplaceDatum");
}
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;
}
}
public function Table()
{
$table = new EasyTable($this->app);
$table->Query("SELECT anfrage, id FROM lieferschein_position");
$table->Display($this->parsetarget);
}
public function Search()
{
$this->app->Tpl->Set($this->parsetarget,"suchmaske");
//$this->app->Table(
//$table = new OrderTable("veranstalter");
//$table->Heading(array('Name','Homepage','Telefon'));
}
}
?>