Do globálního nastavení byly přidány dopravní prostředky.

refs #101
multitenant
Josef Rokos 10 years ago
parent 3c42c1be35
commit b71f3a9bef

@ -16,6 +16,7 @@ public class SettingsData {
private String bankName; private String bankName;
private String accountNumber; private String accountNumber;
private String bankCode; private String bankCode;
private List<Vehicle> vehicles;
public SettingsData() { public SettingsData() {
newReqTemplate = new MailMessage(); newReqTemplate = new MailMessage();
@ -23,6 +24,7 @@ public class SettingsData {
confReqTemplate = new MailMessage(); confReqTemplate = new MailMessage();
mainAddress = new Address(); mainAddress = new Address();
shippingAddrs = new ArrayList<Address>(); shippingAddrs = new ArrayList<Address>();
vehicles = new ArrayList<Vehicle>();
} }
public boolean isEnableRequirements() { public boolean isEnableRequirements() {
@ -97,4 +99,12 @@ public class SettingsData {
this.bankCode = bankCode; this.bankCode = bankCode;
} }
public List<Vehicle> getVehicles() {
return vehicles;
}
public void setVehicles(List<Vehicle> vehicles) {
this.vehicles = vehicles;
}
} }

@ -0,0 +1,67 @@
package info.bukova.isspst.data;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class Vehicle {
@Column(name = "VEHICLE_CODE")
private String code;
@Column(name = "VEHICLE_DESCRIPTION")
private String description;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((code == null) ? 0 : code.hashCode());
result = prime * result
+ ((description == null) ? 0 : description.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Vehicle other = (Vehicle) obj;
if (code == null) {
if (other.code != null)
return false;
} else if (!code.equals(other.code))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
return true;
}
@Override
public String toString() {
return code + (description != null ? " - " + description : "");
}
}

@ -12,6 +12,7 @@ import org.zkoss.zul.Window;
import info.bukova.isspst.data.Address; import info.bukova.isspst.data.Address;
import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.SettingsData; import info.bukova.isspst.data.SettingsData;
import info.bukova.isspst.data.Vehicle;
import info.bukova.isspst.mail.MailMessage; import info.bukova.isspst.mail.MailMessage;
import info.bukova.isspst.services.settings.GlobalSettingsService; import info.bukova.isspst.services.settings.GlobalSettingsService;
import info.bukova.isspst.sort.ReflectionTools; import info.bukova.isspst.sort.ReflectionTools;
@ -71,6 +72,18 @@ public class GlobalSettingsVM {
settings.getShippingAddrs().remove(addr); settings.getShippingAddrs().remove(addr);
} }
@Command
@NotifyChange("settings")
public void addVehicle() {
settings.getVehicles().add(new Vehicle());
}
@Command
@NotifyChange("settings")
public void removeVehicle(@BindingParam("vehicle") Vehicle vehicle) {
settings.getVehicles().remove(vehicle);
}
public Address getSelAddress() { public Address getSelAddress() {
return selAddress; return selAddress;
} }

@ -12,6 +12,11 @@ RequirementsFormDeliveryDate=Datum dodání
RequirementsFormFrom=Z RequirementsFormFrom=Z
RequirementsFormTo=Do RequirementsFormTo=Do
RequirementsFormPurpose=Účel cesty RequirementsFormPurpose=Účel cesty
RequirementsFormStartDateTime=Datum a čas odjezdu
RequirementsFormEndTravel=Konec cesty
RequirementsFormEndDate=Datum příjezdu
RequirementsFormPassengers=Spolucestující:
RequirementsFormVehicle=Dopravní prostředek:
RequirementsGridNumberSerie=Číslo RequirementsGridNumberSerie=Číslo
RequirementsGridReqDate=Datum požadavku RequirementsGridReqDate=Datum požadavku
RequirementsGridCenter=Středisko RequirementsGridCenter=Středisko
@ -150,6 +155,8 @@ BankInfo=Banka
BankName=Název BankName=Název
BankCode=Kód banky BankCode=Kód banky
AccountNumber=Číslo účtu AccountNumber=Číslo účtu
TravelOrders=Cestovní příkazy
GlobalSettingsVehicles=Dopravní prostředky
CentresForRequirements=Střediska, pro která lze vkládat požadavky CentresForRequirements=Střediska, pro která lze vkládat požadavky
WorkgroupMembership=Členství v komisích WorkgroupMembership=Členství v komisích

@ -0,0 +1,23 @@
<?page title="travel orders" contentType="text/html;charset=UTF-8"?>
<zk>
<vbox>
<label value="Dopravní prostředky:"/>
<button label="${labels.AddItem}" onClick="@command('addVehicle')"/>
<grid model="@load(vm.settings.vehicles)">
<columns>
<column label="${labels.code}"/>
<column label="${labels.name}"/>
<column/>
</columns>
<rows>
<template name="model">
<row>
<textbox inplace="true" value="@bind(each.code)"/>
<textbox inplace="true" value="@bind(each.description)"/>
<button label="${labels.RemoveItem}" onClick="@command('removeVehicle', vehicle=each)"/>
</row>
</template>
</rows>
</grid>
</vbox>
</zk>

@ -6,11 +6,12 @@ binder="@init(queueName='email')">
<caption src="/img/settings.png" zclass="form-caption" label="${labels.GlobalSettings}" /> <caption src="/img/settings.png" zclass="form-caption" label="${labels.GlobalSettings}" />
<tabbox orient="vertical" height="500px"> <tabbox orient="vertical" height="500px">
<tabs width="100px"> <tabs width="140px">
<tab label="${labels.Requirements}"/> <tab label="${labels.Requirements}"/>
<tab label="${labels.EMails}"/> <tab label="${labels.EMails}"/>
<tab label="${labels.ContactInfo }"/> <tab label="${labels.ContactInfo }"/>
<tab label="${labels.BankInfo}"/> <tab label="${labels.BankInfo}"/>
<tab label="${labels.TravelOrders}"/>
</tabs> </tabs>
<tabpanels> <tabpanels>
<tabpanel> <tabpanel>
@ -27,6 +28,9 @@ binder="@init(queueName='email')">
<tabpanel> <tabpanel>
<include src="/settings/global/bank.zul"/> <include src="/settings/global/bank.zul"/>
</tabpanel> </tabpanel>
<tabpanel>
<include src="/settings/global/travelOrders.zul"/>
</tabpanel>
</tabpanels> </tabpanels>
</tabbox> </tabbox>

Loading…
Cancel
Save