/*
 * Copyright (c) 2015 com.haulmont.ts.gui.entities
 */
package com.haulmont.timesheets.gui.extuser;

import com.haulmont.cuba.gui.app.security.user.edit.UserEditor;
import com.haulmont.timesheets.entity.ExtUser;
import com.haulmont.timesheets.global.WorkConfigBean;

import javax.inject.Inject;

/**
 * @author gorelov
 */
public class ExtUserEdit extends UserEditor {

    @Inject
    protected WorkConfigBean workConfigBean;

    @Override
    protected void postInit() {
        ExtUser user = (ExtUser) getItem();
        if (user.getWorkHoursForWeek() == null) {
            user.setWorkHoursForWeek(workConfigBean.getWorkHourForWeek());
        }
    }
}
@@ -161,16 +161,63 @@
 Editor;%0A
+import com.haulmont.cuba.security.entity.User;%0A
 import c
@@ -293,24 +293,28 @@
 .global.Work
+Time
 ConfigBean;%0A
@@ -447,16 +447,20 @@
 ted Work
+Time
 ConfigBe
@@ -462,24 +462,28 @@
 figBean work
+Time
 ConfigBean;%0A
@@ -520,20 +520,65 @@
 oid 
-postInit() %7B
+initNewItem(User item) %7B%0A        super.initNewItem(item);
 %0A   
@@ -611,17 +611,12 @@
 er) 
-getI
+i
 tem
-()
 ;%0A  
@@ -704,16 +704,20 @@
 eek(work
+Time
 ConfigBe

Move user defaults to initNewItem