ItEr39S12RFSoporteRecursosVirtuais: Virtual worker groups management
This commit is contained in:
parent
7f01b564cf
commit
56d85592fc
16 changed files with 336 additions and 88 deletions
|
|
@ -39,6 +39,10 @@ public interface IResourceDAO extends IGenericDAO<Resource, Long> {
|
|||
|
||||
public List<Worker> getWorkers();
|
||||
|
||||
public List<Worker> getRealWorkers();
|
||||
|
||||
public List<Worker> getVirtualWorkers();
|
||||
|
||||
/**
|
||||
* Returns all {@link Resource} which satisfy a set of {@link Criterion}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ package org.navalplanner.business.resources.daos;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -54,6 +55,30 @@ public class ResourceDAO extends GenericDAOHibernate<Resource, Long> implements
|
|||
return list(Worker.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Worker> getVirtualWorkers() {
|
||||
List<Worker> list = getWorkers();
|
||||
for (Iterator<Worker> iterator = list.iterator(); iterator.hasNext();) {
|
||||
Worker worker = iterator.next();
|
||||
if (worker.isReal()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Worker> getRealWorkers() {
|
||||
List<Worker> list = getWorkers();
|
||||
for (Iterator<Worker> iterator = list.iterator(); iterator.hasNext();) {
|
||||
Worker worker = iterator.next();
|
||||
if (worker.isVirtual()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Resource> findAllSatisfyingCriterions(
|
||||
Collection<? extends Criterion> criterions) {
|
||||
|
|
|
|||
|
|
@ -784,4 +784,8 @@ public abstract class Resource extends BaseEntity{
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isVirtual() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This file is part of ###PROJECT_NAME###
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.navalplanner.business.resources.entities;
|
||||
|
||||
|
||||
/**
|
||||
* This class models a VirtualWorker.
|
||||
*
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
public class VirtualWorker extends Worker {
|
||||
|
||||
public static VirtualWorker create() {
|
||||
VirtualWorker virtualWorker = new VirtualWorker();
|
||||
virtualWorker.setNewObject(true);
|
||||
virtualWorker.setNif("[Virtual]");
|
||||
return virtualWorker;
|
||||
}
|
||||
|
||||
private String observations;
|
||||
|
||||
/**
|
||||
* Constructor for hibernate. Do not use!
|
||||
*/
|
||||
public VirtualWorker() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(){
|
||||
return getFirstName()+" "+getSurname();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return getFirstName() + " " + getSurname();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVirtual() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getObservations() {
|
||||
return observations;
|
||||
}
|
||||
|
||||
public void setObservations(String observations) {
|
||||
this.observations = observations;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -103,4 +103,12 @@ public class Worker extends Resource {
|
|||
this.nif = nif;
|
||||
}
|
||||
|
||||
public boolean isVirtual() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isReal() {
|
||||
return !isVirtual();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@
|
|||
<property name="firstName"/>
|
||||
<property name="surname"/>
|
||||
<property name="nif"/>
|
||||
|
||||
<joined-subclass name="org.navalplanner.business.resources.entities.VirtualWorker">
|
||||
<key column="VIRTUALWORKER_ID"/>
|
||||
<property name="observations"/>
|
||||
</joined-subclass>
|
||||
|
||||
</joined-subclass>
|
||||
|
||||
<joined-subclass name="org.navalplanner.business.resources.entities.Machine">
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
|
|||
|
||||
public void initializeMenu() {
|
||||
topItem(_("Scheduling"), "/planner/index.zul", "01-introducion.html",
|
||||
subItem(
|
||||
subItem(
|
||||
_("Company view"), "/planner/index.zul;company_scheduling",
|
||||
"01-introducion.html"), subItem(
|
||||
_("General resource allocation"),
|
||||
|
|
@ -208,7 +208,10 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
|
|||
_("Workers List"), "/resources/worker/worker.zul",
|
||||
"05-recursos.html#xesti-n-de-traballadores"), subItem(
|
||||
_("Machines List"), "/resources/machine/machines.zul",
|
||||
"05-recursos.html#xesti-n-de-m-quinas"));
|
||||
"05-recursos.html#xesti-n-de-m-quinas"), subItem(
|
||||
_("Virtual worker groups"),
|
||||
"/resources/worker/virtualWorkers.zul",
|
||||
"05-recursos.html#xesti-n-de-traballadores"));
|
||||
|
||||
topItem(_("Work reports"), "/workreports/workReportTypes.zul", "",
|
||||
subItem(_("Work report types"),
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ public interface IWorkerCRUDControllerEntryPoints {
|
|||
@EntryPoint("edit")
|
||||
public abstract void goToEditForm(Worker worker);
|
||||
|
||||
@EntryPoint("workRelationships")
|
||||
public abstract void goToWorkRelationshipsForm(Worker worker);
|
||||
|
||||
@EntryPoint("create")
|
||||
public abstract void goToCreateForm();
|
||||
|
||||
|
|
|
|||
|
|
@ -84,10 +84,16 @@ public interface IWorkerModel {
|
|||
|
||||
List<Worker> getWorkers();
|
||||
|
||||
List<Worker> getRealWorkers();
|
||||
|
||||
List<Worker> getVirtualWorkers();
|
||||
|
||||
Worker getWorker();
|
||||
|
||||
void prepareForCreate();
|
||||
|
||||
void prepareForCreate(boolean virtual);
|
||||
|
||||
void prepareEditFor(Worker worker);
|
||||
|
||||
IMultipleCriterionActiveAssigner getLocalizationsAssigner();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||
import org.navalplanner.business.calendars.entities.ResourceCalendar;
|
||||
import org.navalplanner.business.common.exceptions.ValidationException;
|
||||
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
|
||||
import org.navalplanner.business.resources.entities.VirtualWorker;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.web.calendars.BaseCalendarEditionController;
|
||||
import org.navalplanner.web.calendars.IBaseCalendarModel;
|
||||
|
|
@ -54,6 +54,7 @@ import org.zkoss.zul.api.Window;
|
|||
/**
|
||||
* Controller for {@link Worker} resource <br />
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
public class WorkerCRUDController extends GenericForwardComposer implements
|
||||
IWorkerCRUDControllerEntryPoints {
|
||||
|
|
@ -62,12 +63,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
|
||||
private Window editWindow;
|
||||
|
||||
private Window workRelationshipsWindow;
|
||||
|
||||
private Window addWorkRelationshipWindow;
|
||||
|
||||
private Window editWorkRelationshipWindow;
|
||||
|
||||
private IWorkerModel workerModel;
|
||||
|
||||
private IURLHandlerRegistry URLHandlerRegistry;
|
||||
|
|
@ -80,14 +75,10 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
|
||||
private CriterionsController criterionsController;
|
||||
|
||||
private WorkRelationshipsController addWorkRelationship;
|
||||
|
||||
private LocalizationsController localizationsForEditionController;
|
||||
|
||||
private LocalizationsController localizationsForCreationController;
|
||||
|
||||
private WorkRelationshipsController editWorkRelationship;
|
||||
|
||||
private ResourcesCostCategoryAssignmentController resourcesCostCategoryAssignmentController;
|
||||
|
||||
private IWorkerCRUDControllerEntryPoints workerCRUD;
|
||||
|
|
@ -105,18 +96,13 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
public WorkerCRUDController() {
|
||||
}
|
||||
|
||||
public WorkerCRUDController( Window listWindow,
|
||||
Window editWindow, Window workRelationshipsWindow,
|
||||
Window addWorkRelationshipWindow,
|
||||
Window editWorkRelationshipWindow, Window editCalendarWindow,
|
||||
public WorkerCRUDController(Window listWindow, Window editWindow,
|
||||
Window editCalendarWindow,
|
||||
IWorkerModel workerModel,
|
||||
IMessagesForUser messages,
|
||||
IWorkerCRUDControllerEntryPoints workerCRUD) {
|
||||
this.listWindow = listWindow;
|
||||
this.editWindow = editWindow;
|
||||
this.workRelationshipsWindow = workRelationshipsWindow;
|
||||
this.addWorkRelationshipWindow = addWorkRelationshipWindow;
|
||||
this.editWorkRelationshipWindow = editWorkRelationshipWindow;
|
||||
this.workerModel = workerModel;
|
||||
this.messages = messages;
|
||||
this.workerCRUD = workerCRUD;
|
||||
|
|
@ -131,6 +117,14 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
return workerModel.getWorkers();
|
||||
}
|
||||
|
||||
public List<Worker> getRealWorkers() {
|
||||
return workerModel.getRealWorkers();
|
||||
}
|
||||
|
||||
public List<Worker> getVirtualWorkers() {
|
||||
return workerModel.getVirtualWorkers();
|
||||
}
|
||||
|
||||
public LocalizationsController getLocalizations() {
|
||||
if (workerModel.isCreating()) {
|
||||
return localizationsForCreationController;
|
||||
|
|
@ -186,7 +180,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
}
|
||||
|
||||
public void goToList() {
|
||||
getBookmarker().goToList();
|
||||
getVisibility().showOnly(listWindow);
|
||||
}
|
||||
|
||||
|
|
@ -201,9 +194,22 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
editWindow.setTitle(_("Edit Worker"));
|
||||
getVisibility().showOnly(editWindow);
|
||||
Util.reloadBindings(editWindow);
|
||||
|
||||
}
|
||||
|
||||
public void goToEditVirtualWorkerForm(Worker worker) {
|
||||
workerModel.prepareEditFor(worker);
|
||||
resourcesCostCategoryAssignmentController.setResource(workerModel
|
||||
.getWorker());
|
||||
if (isCalendarNotNull()) {
|
||||
editCalendar();
|
||||
}
|
||||
editAsignedCriterions();
|
||||
editWindow.setTitle(_("Edit virtual worker groups"));
|
||||
getVisibility().showOnly(editWindow);
|
||||
Util.reloadBindings(editWindow);
|
||||
}
|
||||
|
||||
|
||||
public void goToEditForm() {
|
||||
if (isCalendarNotNull()) {
|
||||
editCalendar();
|
||||
|
|
@ -213,21 +219,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
Util.reloadBindings(editWindow);
|
||||
}
|
||||
|
||||
public void goToWorkRelationshipsForm(Worker worker) {
|
||||
getVisibility().showOnly(workRelationshipsWindow);
|
||||
Util.reloadBindings(workRelationshipsWindow);
|
||||
}
|
||||
|
||||
public void goToWorkRelationshipsForm() {
|
||||
getVisibility().showOnly(workRelationshipsWindow);
|
||||
Util.reloadBindings(workRelationshipsWindow);
|
||||
}
|
||||
|
||||
public void goToAddWorkRelationshipForm() {
|
||||
this.addWorkRelationship.prepareForCreate();
|
||||
getVisibility().showOnly(addWorkRelationshipWindow);
|
||||
}
|
||||
|
||||
public void goToCreateForm() {
|
||||
getBookmarker().goToCreateForm();
|
||||
workerModel.prepareForCreate();
|
||||
|
|
@ -238,11 +229,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
Util.reloadBindings(editWindow);
|
||||
}
|
||||
|
||||
public void goToEditWorkRelationshipForm(CriterionSatisfaction satisfaction) {
|
||||
this.editWorkRelationship.prepareForEdit(satisfaction);
|
||||
getVisibility().showOnly(editWorkRelationshipWindow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
|
@ -258,14 +244,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
throw new RuntimeException(_("MessagesContainer is needed"));
|
||||
}
|
||||
messages = new MessagesForUser(messagesContainer);
|
||||
this.addWorkRelationship = new WorkRelationshipsController(
|
||||
this.workerModel, this, messages);
|
||||
setupWorkRelationshipController(this.addWorkRelationship,
|
||||
this.addWorkRelationshipWindow);
|
||||
setupWorkRelationshipController(
|
||||
this.editWorkRelationship = new WorkRelationshipsController(
|
||||
this.workerModel, this, messages),
|
||||
editWorkRelationshipWindow);
|
||||
setupResourcesCostCategoryAssignmentController(comp);
|
||||
|
||||
final URLHandler<IWorkerCRUDControllerEntryPoints> handler = URLHandlerRegistry
|
||||
|
|
@ -310,14 +288,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
return baseCalendarEditionController;
|
||||
}
|
||||
|
||||
private void setupWorkRelationshipController(
|
||||
WorkRelationshipsController workRelationshipController,
|
||||
Window workRelationshipWindow) throws Exception {
|
||||
workRelationshipController.doAfterCompose(workRelationshipWindow);
|
||||
workRelationshipWindow.setVariable("workRelationship",
|
||||
workRelationshipController, true);
|
||||
}
|
||||
|
||||
private LocalizationsController createLocalizationsController(
|
||||
Component comp, String localizationsContainerName) throws Exception {
|
||||
LocalizationsController localizationsController = new LocalizationsController(
|
||||
|
|
@ -330,17 +300,11 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
|
||||
private OnlyOneVisible getVisibility() {
|
||||
if (visibility == null) {
|
||||
visibility = new OnlyOneVisible(listWindow, editWindow,
|
||||
workRelationshipsWindow,addWorkRelationshipWindow,
|
||||
editWorkRelationshipWindow);
|
||||
visibility = new OnlyOneVisible(listWindow, editWindow);
|
||||
}
|
||||
return visibility;
|
||||
}
|
||||
|
||||
public GenericForwardComposer getWorkRelationship() {
|
||||
return this.addWorkRelationship;
|
||||
}
|
||||
|
||||
private IWorkerCRUDControllerEntryPoints getBookmarker() {
|
||||
return workerCRUD;
|
||||
}
|
||||
|
|
@ -467,7 +431,53 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
BaseCalendar defaultCalendar = workerModel.getDefaultCalendar();
|
||||
return defaultCalendar.getId().equals(calendar.getId());
|
||||
}
|
||||
}
|
||||
|
||||
public void goToCreateVirtualWorkerForm() {
|
||||
workerModel.prepareForCreate(true);
|
||||
createAsignedCriterions();
|
||||
resourcesCostCategoryAssignmentController.setResource(workerModel
|
||||
.getWorker());
|
||||
editWindow.setTitle(_("Create virtual resource"));
|
||||
getVisibility().showOnly(editWindow);
|
||||
Util.reloadBindings(editWindow);
|
||||
}
|
||||
|
||||
public boolean isVirtualWorker() {
|
||||
boolean isVirtual = false;
|
||||
if (this.workerModel != null) {
|
||||
if (this.workerModel.getWorker() != null ) {
|
||||
isVirtual = this.workerModel.getWorker().isVirtual();
|
||||
}
|
||||
}
|
||||
return isVirtual;
|
||||
}
|
||||
|
||||
public boolean isRealWorker() {
|
||||
return !isVirtualWorker();
|
||||
}
|
||||
|
||||
public String getVirtualWorkerObservations() {
|
||||
if (isVirtualWorker()) {
|
||||
return ((VirtualWorker) this.workerModel.getWorker())
|
||||
.getObservations();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public void setVirtualWorkerObservations(String observations) {
|
||||
if (isVirtualWorker()) {
|
||||
((VirtualWorker) this.workerModel.getWorker())
|
||||
.setObservations(observations);
|
||||
}
|
||||
}
|
||||
|
||||
public String getVirtualWorkerCapacity() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public void setVirtualWorkerCapacity(String capacity) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ import org.navalplanner.business.resources.entities.ICriterionType;
|
|||
import org.navalplanner.business.resources.entities.Interval;
|
||||
import org.navalplanner.business.resources.entities.PredefinedCriterionTypes;
|
||||
import org.navalplanner.business.resources.entities.Resource;
|
||||
import org.navalplanner.business.resources.entities.VirtualWorker;
|
||||
import org.navalplanner.business.resources.entities.Worker;
|
||||
import org.navalplanner.web.calendars.IBaseCalendarModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -125,6 +126,18 @@ public class WorkerModel implements IWorkerModel {
|
|||
return resourceDAO.getWorkers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<Worker> getRealWorkers() {
|
||||
return resourceDAO.getRealWorkers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<Worker> getVirtualWorkers() {
|
||||
return resourceDAO.getVirtualWorkers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Worker getWorker() {
|
||||
return worker;
|
||||
|
|
@ -133,12 +146,25 @@ public class WorkerModel implements IWorkerModel {
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void prepareForCreate() {
|
||||
worker = Worker.create();
|
||||
prepareForCreate(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void prepareForCreate(boolean virtual) {
|
||||
|
||||
if (virtual) {
|
||||
worker = VirtualWorker.create();
|
||||
worker.setFirstName("Virtual");
|
||||
} else {
|
||||
worker = Worker.create();
|
||||
}
|
||||
localizationsAssigner = new MultipleCriterionActiveAssigner(
|
||||
criterionDAO, worker,
|
||||
PredefinedCriterionTypes.LOCATION_GROUP);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void prepareEditFor(Worker worker) {
|
||||
|
|
|
|||
|
|
@ -41,20 +41,33 @@
|
|||
<column />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<row visible="@{controller.isRealWorker}">
|
||||
<label value="${i18n:_('First name')}" />
|
||||
<textbox
|
||||
value="@{controller.worker.firstName}" constraint="no empty" width="500px"/>
|
||||
</row>
|
||||
<row>
|
||||
<row visible="@{controller.isVirtualWorker}">
|
||||
<label value="${i18n:_('Group name')}" />
|
||||
<textbox
|
||||
value="@{controller.worker.firstName}" constraint="no empty" width="500px"/>
|
||||
</row>
|
||||
<row visible="@{controller.isRealWorker}">
|
||||
<label value="${i18n:_('Last name')}" />
|
||||
<textbox
|
||||
value="@{controller.worker.surname}" constraint="no empty" width="500px"/>
|
||||
</row>
|
||||
<row>
|
||||
<row visible="@{controller.isRealWorker}">
|
||||
<label value="${i18n:_('NIF')}" />
|
||||
<textbox value="@{controller.worker.nif}" constraint="no empty"/>
|
||||
</row>
|
||||
<row visible="@{controller.isVirtualWorker}">
|
||||
<label value="${i18n:_('Capacity')}" />
|
||||
<textbox value="@{controller.virtualWorkerCapacity}" width="500px" />
|
||||
</row>
|
||||
<row visible="@{controller.isVirtualWorker}">
|
||||
<label value="${i18n:_('Observations')}" />
|
||||
<textbox value="@{controller.virtualWorkerObservations}" width="500px" multiline="true" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</tabpanel>
|
||||
|
|
@ -62,12 +75,9 @@
|
|||
<criterions />
|
||||
</tabpanel>
|
||||
<tabpanel visible="false">
|
||||
<localizations />
|
||||
</tabpanel>
|
||||
<tabpanel visible="false">
|
||||
<workRelationships top_id="workRelationshipsWindow"
|
||||
title="${i18n:_('Work relationships')}" save_button_label="${i18n:_('Save')}"
|
||||
cancel_button_label="${i18n:_('Cancel')}" />
|
||||
<localizations />
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<resourceCalendar />
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
-->
|
||||
|
||||
<window id="${arg.top_id}" title="${i18n:_('Workers list')}">
|
||||
<newdatasortablegrid id="listing" model="@{controller.workers}" mold="paging"
|
||||
<newdatasortablegrid id="listing" model="@{controller.realWorkers}" mold="paging"
|
||||
pageSize="10" fixedLayout="true">
|
||||
<columns>
|
||||
<newdatasortablecolumn label="${i18n:_('First name')}" sort="auto(firstName)"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
<!--
|
||||
This file is part of ###PROJECT_NAME###
|
||||
|
||||
Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
Desenvolvemento Tecnolóxico de Galicia
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<window id="${arg.top_id}" title="${i18n:_('Virtual workers list')}">
|
||||
<newdatasortablegrid id="listing" model="@{controller.virtualWorkers}" mold="paging"
|
||||
pageSize="10" fixedLayout="true">
|
||||
<columns>
|
||||
<newdatasortablecolumn label="${i18n:_('Name')}" sort="auto(name)"/>
|
||||
<newdatasortablecolumn label="${i18n:_('Capacity')}" sort="auto(capacity)" />
|
||||
<newdatasortablecolumn label="${i18n:_('Observations')}" sort="auto(observations)" />
|
||||
<newdatasortablecolumn label="${i18n:_('Operations')}" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row self="@{each='virtualWorker'}" value="@{virtualWorker}" onDoubleClick="controller.goToEditVirtualWorkerForm(self.value);">
|
||||
<label value="@{virtualWorker.firstName}" />
|
||||
<label value="@virtualWorker.capacity" />
|
||||
<label value="@{virtualWorker.observations}" maxlength="20"/>
|
||||
<hbox>
|
||||
<button sclass="icono" image="/common/img/ico_editar1.png"
|
||||
hoverImage="/common/img/ico_editar.png"
|
||||
tooltiptext="${i18n:_('Edit')}"
|
||||
onClick="controller.goToEditVirtualWorkerForm(self.getParent().getParent().value);">
|
||||
</button>
|
||||
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</newdatasortablegrid>
|
||||
<button id="show_create_form" onClick="controller.goToCreateVirtualWorkerForm();"
|
||||
label="${i18n:_('Create Virtual Worker')}" sclass="create-button global-action">
|
||||
</button>
|
||||
</window>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!--
|
||||
This file is part of ###PROJECT_NAME###
|
||||
|
||||
Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
Desenvolvemento Tecnolóxico de Galicia
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<?page title="${i18n:_('Virtual resources')}"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
|
||||
<?page id="Create"?>
|
||||
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
|
||||
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_v01.css"?>
|
||||
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_zk.css"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?component name="list" inline="true" macroURI="_listVirtualWorkers.zul"?>
|
||||
<?component name="edition" inline="true" macroURI="_edition.zul"?>
|
||||
<zk>
|
||||
<window self="@{define(content)}"
|
||||
apply="org.navalplanner.web.resources.worker.WorkerCRUDController">
|
||||
<vbox id="messagesContainer">
|
||||
</vbox>
|
||||
|
||||
<list top_id="listWindow" />
|
||||
|
||||
<edition top_id="editWindow" title="${i18n:_('Edit virtual resource')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}" />
|
||||
|
||||
</window>
|
||||
</zk>
|
||||
|
|
@ -27,8 +27,6 @@
|
|||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?component name="list" inline="true" macroURI="_list.zul"?>
|
||||
<?component name="edition" inline="true" macroURI="_edition.zul"?>
|
||||
<?component name="workRelationships" inline="true" macroURI="_workRelationships.zul"?>
|
||||
<?component name="editWorkRelationship" inline="true" macroURI="_editWorkRelationship.zul"?>
|
||||
<zk>
|
||||
<window self="@{define(content)}"
|
||||
apply="org.navalplanner.web.resources.worker.WorkerCRUDController"
|
||||
|
|
@ -41,14 +39,5 @@
|
|||
<edition top_id="editWindow" title="${i18n:_('Edit worker')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}" />
|
||||
|
||||
<workRelationships top_id="workRelationshipsWindow" title="${i18n:_('Work relationships')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}" />
|
||||
<editWorkRelationship top_id="editWorkRelationshipWindow" title="${i18n:_('Edit work relationship')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}"
|
||||
add_button_label="${i18n:_('Edit')}"/>
|
||||
<editWorkRelationship top_id="addWorkRelationshipWindow" title="${i18n:_('Add work relationship')}"
|
||||
save_button_label="${i18n:_('Save')}" cancel_button_label="${i18n:_('Cancel')}"
|
||||
add_button_label="${i18n:_('Add')}"/>
|
||||
|
||||
</window>
|
||||
</zk>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue