Do požadavku na služební cestu byla přidána chybějící pole,

implementovaná validace formuláře.
Do BaseValidator byly přidány metody na obecnou validaci null/empty.
Do ListViewModel přidány metody pro dotažení lazy loadovaných dat.
closes #108
This commit is contained in:
2014-07-20 21:36:38 +02:00
parent b71f3a9bef
commit f2d9576a3f
10 changed files with 302 additions and 22 deletions
@@ -4,3 +4,8 @@ DataTypeErr=Chybný datový typ...
UserPasswordIsEmpty=Uživatelské heslo musí být zadané...
UserPasswordsAreNotSame=Znovu zadané heslo není stejné...
RequirementCenterIsEmpty=Musíte zadat středisko...
TripDateIsEmpty=Musíte zadat datum cesty...
EndDateIsEmpty=Musíte zadat datum konce cesty...
FromIsEmpty=Musíte zadat místo začátku cesty...
ToIsEmpty=Musíte zadat cíl cesty...
VehicleIsEmpty=Musíte zadat dopravní prostředek...
@@ -11,7 +11,7 @@
src="/img/reqact.png"
zclass="form-caption"
label="${labels.RequirementsFormTitle}" />
<vlayout>
<vlayout form="@id('fx') @load(vm.dataBean) @save(vm.dataBean, before='save') @validator(vm.validator)">
<grid hflex="min">
<columns>
<column
@@ -25,9 +25,8 @@
<cell>
<textbox
id="numser"
constraint="@load(vm.constriant)"
width="200px"
value="@bind(vm.dataBean.numser)"
value="@bind(fx.numser)"
readonly="true" />
</cell>
</row>
@@ -37,7 +36,7 @@
<datebox
id="reqDate"
width="200px"
value="@bind(vm.dataBean.reqDate)"
value="@bind(fx.reqDate)"
format="${labels.DateFormat}" />
</cell>
</row>
@@ -47,7 +46,7 @@
<combobox
model="@load(vm.centres)"
readonly="true"
selectedItem="@bind(vm.dataBean.centre)">
selectedItem="@bind(fx.centre)">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
@@ -60,7 +59,25 @@
<textbox
id="from"
width="300px"
value="@bind(vm.dataBean.from)" />
value="@bind(fx.from)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.RequirementsFormStartDateTime} :</cell>
<cell>
<hbox>
<datebox
id="tripDate"
width="200px"
format="medium"
value="@bind(fx.tripDate)" />
<timebox
id="tripTime"
width="90px"
format="short"
value="@bind(fx.tripDate)" />
</hbox>
</cell>
</row>
<row>
@@ -69,7 +86,7 @@
<textbox
id="to"
width="300px"
value="@bind(vm.dataBean.to)" />
value="@bind(fx.to)" />
</cell>
</row>
<row>
@@ -78,12 +95,72 @@
<textbox
id="description"
width="300px"
value="@bind(vm.dataBean.description)" />
value="@bind(fx.description)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.RequirementsFormEndTravel} :</cell>
<cell>
<textbox
id="end"
width="200px"
value="@bind(fx.end)" />
</cell>
</row>
<row>
<cell sclass="row-title">${labels.RequirementsFormEndDate} :</cell>
<cell>
<datebox
id="endDate"
width="300px"
format="medium"
value="@bind(fx.endDate)" />
</cell>
</row>
</rows>
</grid>
<vbox>
<label value="${labels.RequirementsFormPassengers}"/>
<hbox>
<combobox model="@load(vm.users)"
autocomplete="true"
selectedItem="@bind(vm.selUser)">
<template name="model">
<comboitem label="@load(each)"/>
</template>
</combobox>
<button label="${labels.AddItem}"
onClick="@command('addPassanger')"
sclass="nicebutton"
disabled="@load(vm.selUser eq null)"/>
</hbox>
<grid model="@load(vm.passengers)" width="700px">
<columns>
<column/>
<column/>
</columns>
<rows>
<template name="model">
<row>
<label value="@load(each)"/>
<button label="${labels.RemoveItem}"
onClick="@command('removePassanger', user=each)"
sclass="nicebutton"/>
</row>
</template>
</rows>
</grid>
<hbox>
<label value="${labels.RequirementsFormVehicle}"/>
<combobox model="@load(vm.settings.vehicles)"
selectedItem="@bind(fx.vehicle)"
readonly="true">
<template name="model">
<comboitem label="@load(each)"/>
</template>
</combobox>
</hbox>
</vbox>
<include src="/app/formButtons.zul" />
</vlayout>
</window>