18 package org.turro.erp.humanres.logic;
20 import java.util.Date;
21 import org.turro.auth.Authentication;
22 import org.turro.command.Command;
23 import org.turro.command.Context;
24 import org.turro.elephant.context.Application;
25 import org.turro.elephant.log.LogType;
26 import org.turro.elephant.util.ZkossUtils;
27 import org.turro.erp.aptitude.AptitudeDegreeCombobox;
28 import org.turro.erp.entity.AptitudeDegree;
29 import org.turro.erp.entity.HumanResource;
30 import org.turro.erp.entity.OwnedAptitude;
31 import org.turro.jpa.Dao;
32 import org.turro.jpa.entity.EntityCollectionUtil;
33 import org.turro.zkoss.dialog.InputDialog;
34 import org.turro.zkoss.dialog.InputField;
35 import org.turro.zkoss.input.DateboxShort;
36 import org.turro.zul.frame.Framework;
37 import org.zkoss.zk.ui.HtmlBasedComponent;
49 public void delete(
final boolean close) {
52 ZkossUtils.confirmDeletion(
null,
new Command() {
54 public Object execute(Context context) {
66 if(
entity.getId() == 0)
return false;
87 new InputField(
"lFrom", null, null, 0) {
89 protected HtmlBasedComponent createEditor() {
90 return new DateboxShort(new Date());
95 protected HtmlBasedComponent createEditor() {
101 protected HtmlBasedComponent createEditor() {
108 public Object execute(Context context) {
110 if(fields.length > 0) {
111 Date from =
null, to =
null;
115 if(
"lAptitude".
equals(f.getLabel())) {
117 }
else if(
"lFrom".
equals(f.getLabel())) {
118 from = (Date) f.getValue();
119 }
else if(
"lTo".
equals(f.getLabel())) {
120 to = (Date) f.getValue();
124 OwnedAptitude oo =
new OwnedAptitude();
125 oo.setAptitudeDegree(o);
126 oo.setInitialDate(from);
128 oo.setDefaultDegree(
false);
129 oo.setHumanResource(
entity);
130 entity.getOwnedAptitudes().add(oo);
139 if(aptitude !=
null) {
140 EntityCollectionUtil.remove(entity.getOwnedAptitudes(), aptitude);
static String getString(String key)
void logEntity(LogType logType, String path, String action, String data)
void delete(final boolean close)
void deleteAptitude(OwnedAptitude aptitude)
HumanResourceWrapper(HumanResource entity)
boolean equals(Object obj)
static Framework getCurrent()