Add limits for workers and machines (Mapping, Entity, DAO, Model, DB).

Refactoring.
Add method for create button of Workers/Machines to check if users not violating with limits.
Add i18n.
This commit is contained in:
Vova Perebykivskiy 2015-12-18 11:05:59 +02:00 committed by Dgray16
parent f48f2ead71
commit afeea6823b
20 changed files with 157 additions and 19 deletions

View file

@ -17,4 +17,5 @@ public interface ILimitsDAO extends IGenericDAO<Limits, Long> {
Limits getUsersType(); Limits getUsersType();
Limits getWorkersType(); Limits getWorkersType();
Limits getMachinesType();
} }

View file

@ -37,4 +37,12 @@ public class LimitsDAO extends GenericDAOHibernate<Limits, Long> implements ILim
return null; return null;
} }
@Override
public Limits getMachinesType() {
List<Limits> list = list(Limits.class);
for (Limits item : list)
if (item.getType().equals("machines")) return item;
return null;
}
} }

View file

@ -33,6 +33,7 @@ import org.libreplan.business.resources.entities.Machine;
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* @author Javier Moran Rua <jmoran@igalia.com> * @author Javier Moran Rua <jmoran@igalia.com>
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public interface IMachineDAO extends IIntegrationEntityDAO<Machine> { public interface IMachineDAO extends IIntegrationEntityDAO<Machine> {
@ -82,4 +83,9 @@ public interface IMachineDAO extends IIntegrationEntityDAO<Machine> {
* code as the one passed as parameter * code as the one passed as parameter
*/ */
boolean existsMachineWithCodeInAnotherTransaction(String code); boolean existsMachineWithCodeInAnotherTransaction(String code);
/**
* Return a number of rows in database table
*/
Number getRowCount();
} }

View file

@ -36,7 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Manuel Rego Casasnovas <mrego@igalia.com> * @author Manuel Rego Casasnovas <mrego@igalia.com>
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* * @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public interface IWorkerDAO extends IIntegrationEntityDAO<Worker> { public interface IWorkerDAO extends IIntegrationEntityDAO<Worker> {
@ -127,4 +127,6 @@ public interface IWorkerDAO extends IIntegrationEntityDAO<Worker> {
* Return the list of {@link Worker Workers} bound to any {@link User}. * Return the list of {@link Worker Workers} bound to any {@link User}.
*/ */
List<Worker> getBound(); List<Worker> getBound();
Number getRowCount();
} }

View file

@ -23,6 +23,7 @@ package org.libreplan.business.resources.daos;
import java.util.List; import java.util.List;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Restrictions;
import org.libreplan.business.common.daos.IntegrationEntityDAO; import org.libreplan.business.common.daos.IntegrationEntityDAO;
import org.libreplan.business.common.exceptions.InstanceNotFoundException; import org.libreplan.business.common.exceptions.InstanceNotFoundException;
@ -40,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* @author Javier Moran Rua <jmoran@igalia.com> * @author Javier Moran Rua <jmoran@igalia.com>
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
@Repository @Repository
@Scope(BeanDefinition.SCOPE_SINGLETON) @Scope(BeanDefinition.SCOPE_SINGLETON)
@ -82,6 +84,11 @@ public class MachineDAO extends IntegrationEntityDAO<Machine>
} }
} }
@Override
public Number getRowCount() {
return (Number) getSession().createCriteria(Machine.class).setProjection(Projections.rowCount()).uniqueResult();
}
@Override @Override
@Transactional(readOnly= true, propagation = Propagation.REQUIRES_NEW) @Transactional(readOnly= true, propagation = Propagation.REQUIRES_NEW)
public Machine findUniqueByCodeInAnotherTransaction(String code) public Machine findUniqueByCodeInAnotherTransaction(String code)

View file

@ -26,6 +26,7 @@ import java.util.List;
import org.hibernate.Criteria; import org.hibernate.Criteria;
import org.hibernate.Query; import org.hibernate.Query;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Restrictions;
import org.libreplan.business.common.daos.IntegrationEntityDAO; import org.libreplan.business.common.daos.IntegrationEntityDAO;
import org.libreplan.business.common.exceptions.InstanceNotFoundException; import org.libreplan.business.common.exceptions.InstanceNotFoundException;
@ -43,7 +44,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Manuel Rego Casasnovas <mrego@igalia.com> * @author Manuel Rego Casasnovas <mrego@igalia.com>
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* * @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
@Repository @Repository
@Scope(BeanDefinition.SCOPE_SINGLETON) @Scope(BeanDefinition.SCOPE_SINGLETON)
@ -199,4 +200,9 @@ public class WorkerDAO extends IntegrationEntityDAO<Worker>
return criteria.list(); return criteria.list();
} }
@Override
public Number getRowCount() {
return (Number) getSession().createCriteria(Worker.class).setProjection(Projections.rowCount()).uniqueResult();
}
} }

View file

@ -45,6 +45,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Jacobo Aragunde Perez <jaragunde@igalia.com> * @author Jacobo Aragunde Perez <jaragunde@igalia.com>
* @author Manuel Rego Casasnovas <rego@igalia.com> * @author Manuel Rego Casasnovas <rego@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
@Repository @Repository
public class UserDAO extends GenericDAOHibernate<User, Long> public class UserDAO extends GenericDAOHibernate<User, Long>

View file

@ -16,4 +16,5 @@ public interface ILimitsModel {
Limits getUsersType(); Limits getUsersType();
Limits getWorkersType(); Limits getWorkersType();
Limits getMachinesType();
} }

View file

@ -42,4 +42,10 @@ public class LimitsModel implements ILimitsModel {
public Limits getWorkersType() { public Limits getWorkersType() {
return limitsDAO.getWorkersType(); return limitsDAO.getWorkersType();
} }
@Override
@Transactional(readOnly = true)
public Limits getMachinesType() {
return limitsDAO.getMachinesType();
}
} }

View file

@ -34,7 +34,7 @@ import org.libreplan.business.resources.entities.Worker;
import org.libreplan.web.common.IIntegrationEntityModel; import org.libreplan.web.common.IIntegrationEntityModel;
import org.libreplan.web.resources.search.ResourcePredicate; import org.libreplan.web.resources.search.ResourcePredicate;
/* /**
* This interface contains the operations to create/edit a machine. * This interface contains the operations to create/edit a machine.
* *
* Conversation state: the Machine instance and associated entities. * Conversation state: the Machine instance and associated entities.
@ -63,6 +63,7 @@ import org.libreplan.web.resources.search.ResourcePredicate;
* *
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* @author Javier Moran Rua <jmoran@igalia.com> * @author Javier Moran Rua <jmoran@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public interface IMachineModel extends IIntegrationEntityModel { public interface IMachineModel extends IIntegrationEntityModel {
// Initial conversational steps // Initial conversational steps
@ -108,4 +109,6 @@ public interface IMachineModel extends IIntegrationEntityModel {
void removeCalendar(); void removeCalendar();
Number getRowCount();
} }

View file

@ -31,15 +31,13 @@ import java.util.Set;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.libreplan.business.calendars.entities.BaseCalendar; import org.libreplan.business.calendars.entities.BaseCalendar;
import org.libreplan.business.calendars.entities.ResourceCalendar; import org.libreplan.business.calendars.entities.ResourceCalendar;
import org.libreplan.business.common.entities.Limits;
import org.libreplan.business.common.exceptions.InstanceNotFoundException; import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException; import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.resources.entities.Machine; import org.libreplan.business.resources.entities.Machine;
import org.libreplan.web.calendars.BaseCalendarEditionController; import org.libreplan.web.calendars.BaseCalendarEditionController;
import org.libreplan.web.calendars.IBaseCalendarModel; import org.libreplan.web.calendars.IBaseCalendarModel;
import org.libreplan.web.common.BaseCRUDController; import org.libreplan.web.common.*;
import org.libreplan.web.common.ConstraintChecker;
import org.libreplan.web.common.Level;
import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxMultipleSearch; import org.libreplan.web.common.components.bandboxsearch.BandboxMultipleSearch;
import org.libreplan.web.common.components.finders.FilterPair; import org.libreplan.web.common.components.finders.FilterPair;
import org.libreplan.web.costcategories.ResourcesCostCategoryAssignmentController; import org.libreplan.web.costcategories.ResourcesCostCategoryAssignmentController;
@ -47,6 +45,7 @@ import org.libreplan.web.resources.search.ResourcePredicate;
import org.libreplan.web.resources.worker.CriterionsController; import org.libreplan.web.resources.worker.CriterionsController;
import org.libreplan.web.resources.worker.CriterionsMachineController; import org.libreplan.web.resources.worker.CriterionsMachineController;
import org.libreplan.web.resources.worker.WorkerCRUDController.LimitingResourceEnum; import org.libreplan.web.resources.worker.WorkerCRUDController.LimitingResourceEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.CheckEvent; import org.zkoss.zk.ui.event.CheckEvent;
@ -75,9 +74,14 @@ import org.zkoss.zul.api.Window;
* Controller for {@link Machine} resource <br /> * Controller for {@link Machine} resource <br />
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com> * @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public class MachineCRUDController extends BaseCRUDController<Machine> { public class MachineCRUDController extends BaseCRUDController<Machine> {
@Autowired
private ILimitsModel limitsModel;
@Autowired
private IMachineModel machineModel; private IMachineModel machineModel;
private Component configurationUnits; private Component configurationUnits;
@ -611,4 +615,24 @@ public class MachineCRUDController extends BaseCRUDController<Machine> {
return machineModel.getMachine(); return machineModel.getMachine();
} }
public boolean isCreateButtonDisabled(){
Limits machinesTypeLimit = limitsModel.getMachinesType();
Long machinesCount = (Long) machineModel.getRowCount();
if ( machinesTypeLimit != null )
if ( machinesCount >= machinesTypeLimit.getValue() )
return true;
return false;
}
public String getShowCreateFormLabel(){
Limits machinesTypeLimit = limitsModel.getMachinesType();
Long machinesCount = (Long) machineModel.getRowCount();
if ( machinesTypeLimit != null )
if ( machinesCount >= machinesTypeLimit.getValue() )
return _("Machines limit reached");
return _("Create");
}
} }

View file

@ -70,6 +70,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* @author Diego Pino Garcia <dpino@igalia.com> * @author Diego Pino Garcia <dpino@igalia.com>
* @author Javier Moran Rua <jmoran@igalia.com> * @author Javier Moran Rua <jmoran@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
@Service @Service
@Scope(BeanDefinition.SCOPE_PROTOTYPE) @Scope(BeanDefinition.SCOPE_PROTOTYPE)
@ -403,4 +404,11 @@ public class MachineModel extends IntegrationEntityModel implements
machine.setCalendar(null); machine.setCalendar(null);
} }
@Override
@Transactional(readOnly = true)
public Number getRowCount() {
return machineDAO.getRowCount();
}
} }

View file

@ -74,6 +74,7 @@ import org.libreplan.web.resources.search.ResourcePredicate;
* @author Óscar González Fernández <ogonzalez@igalia.com> * @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Manuel Rego Casasnovas <rego@igalia.com> * @author Manuel Rego Casasnovas <rego@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public interface IWorkerModel extends IIntegrationEntityModel { public interface IWorkerModel extends IIntegrationEntityModel {
@ -147,4 +148,6 @@ public interface IWorkerModel extends IIntegrationEntityModel {
User getBoundUserFromDB(Worker worker); User getBoundUserFromDB(Worker worker);
Number getRowCount();
} }

View file

@ -35,6 +35,7 @@ import org.apache.commons.lang.StringUtils;
import org.joda.time.LocalDate; import org.joda.time.LocalDate;
import org.libreplan.business.calendars.entities.BaseCalendar; import org.libreplan.business.calendars.entities.BaseCalendar;
import org.libreplan.business.calendars.entities.ResourceCalendar; import org.libreplan.business.calendars.entities.ResourceCalendar;
import org.libreplan.business.common.entities.Limits;
import org.libreplan.business.common.exceptions.InstanceNotFoundException; import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.common.exceptions.ValidationException; import org.libreplan.business.common.exceptions.ValidationException;
import org.libreplan.business.resources.entities.ResourceType; import org.libreplan.business.resources.entities.ResourceType;
@ -44,13 +45,8 @@ import org.libreplan.business.users.entities.User;
import org.libreplan.business.users.entities.UserRole; import org.libreplan.business.users.entities.UserRole;
import org.libreplan.web.calendars.BaseCalendarEditionController; import org.libreplan.web.calendars.BaseCalendarEditionController;
import org.libreplan.web.calendars.IBaseCalendarModel; import org.libreplan.web.calendars.IBaseCalendarModel;
import org.libreplan.web.common.*;
import org.libreplan.web.common.BaseCRUDController.CRUDControllerState; import org.libreplan.web.common.BaseCRUDController.CRUDControllerState;
import org.libreplan.web.common.ConstraintChecker;
import org.libreplan.web.common.IMessagesForUser;
import org.libreplan.web.common.Level;
import org.libreplan.web.common.MessagesForUser;
import org.libreplan.web.common.OnlyOneVisible;
import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxMultipleSearch; import org.libreplan.web.common.components.bandboxsearch.BandboxMultipleSearch;
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch; import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
import org.libreplan.web.common.components.finders.FilterPair; import org.libreplan.web.common.components.finders.FilterPair;
@ -98,6 +94,7 @@ import org.zkoss.zul.api.Window;
* @author Óscar González Fernández <ogonzalez@igalia.com> * @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com> * @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
* @author Manuel Rego Casasnovas <rego@igalia.com> * @author Manuel Rego Casasnovas <rego@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
public class WorkerCRUDController extends GenericForwardComposer implements public class WorkerCRUDController extends GenericForwardComposer implements
IWorkerCRUDControllerEntryPoints { IWorkerCRUDControllerEntryPoints {
@ -105,6 +102,12 @@ public class WorkerCRUDController extends GenericForwardComposer implements
@Autowired @Autowired
private IDBPasswordEncoderService dbPasswordEncoderService; private IDBPasswordEncoderService dbPasswordEncoderService;
@Autowired
private ILimitsModel limitsModel;
@Autowired
private IWorkerModel workerModel;
@Resource @Resource
private IUserCRUDController userCRUD; private IUserCRUDController userCRUD;
@ -112,8 +115,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
private Window editWindow; private Window editWindow;
private IWorkerModel workerModel;
private IURLHandlerRegistry URLHandlerRegistry; private IURLHandlerRegistry URLHandlerRegistry;
private OnlyOneVisible visibility; private OnlyOneVisible visibility;
@ -1159,4 +1160,24 @@ public class WorkerCRUDController extends GenericForwardComposer implements
return ""; return "";
} }
public boolean isCreateButtonDisabled(){
Limits workersTypeLimit = limitsModel.getWorkersType();
Long workersCount = (Long) workerModel.getRowCount();
if ( workersTypeLimit != null )
if ( workersCount >= workersTypeLimit.getValue() )
return true;
return false;
}
public String getShowCreateFormLabel(){
Limits workersTypeLimit = limitsModel.getWorkersType();
Long workersCount = (Long) workerModel.getRowCount();
if ( workersTypeLimit != null )
if ( workersCount >= workersTypeLimit.getValue() )
return _("Workers limit reached");
return _("Create");
}
} }

View file

@ -49,6 +49,8 @@ import org.libreplan.business.planner.daos.IDayAssignmentDAO;
import org.libreplan.business.planner.daos.IResourceAllocationDAO; import org.libreplan.business.planner.daos.IResourceAllocationDAO;
import org.libreplan.business.resources.daos.ICriterionDAO; import org.libreplan.business.resources.daos.ICriterionDAO;
import org.libreplan.business.resources.daos.IResourceDAO; import org.libreplan.business.resources.daos.IResourceDAO;
import org.libreplan.business.resources.daos.IWorkerDAO;
import org.libreplan.business.resources.daos.WorkerDAO;
import org.libreplan.business.resources.entities.Criterion; import org.libreplan.business.resources.entities.Criterion;
import org.libreplan.business.resources.entities.CriterionSatisfaction; import org.libreplan.business.resources.entities.CriterionSatisfaction;
import org.libreplan.business.resources.entities.CriterionWithItsType; import org.libreplan.business.resources.entities.CriterionWithItsType;
@ -81,6 +83,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Fernando Bellas Permuy <fbellas@udc.es> * @author Fernando Bellas Permuy <fbellas@udc.es>
* @author Diego Pino García <dpino@igalia.com> * @author Diego Pino García <dpino@igalia.com>
* @author Manuel Rego Casasnovas <rego@igalia.com> * @author Manuel Rego Casasnovas <rego@igalia.com>
* @author Vova Perebykivskiy <vova@libreplan-enterprise.com>
*/ */
@Service @Service
@Scope(BeanDefinition.SCOPE_PROTOTYPE) @Scope(BeanDefinition.SCOPE_PROTOTYPE)
@ -96,6 +99,9 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
@Autowired @Autowired
private IBaseCalendarDAO baseCalendarDAO; private IBaseCalendarDAO baseCalendarDAO;
@Autowired
private IWorkerDAO workerDAO;
private final ICriterionType<?>[] laboralRelatedTypes = { private final ICriterionType<?>[] laboralRelatedTypes = {
PredefinedCriterionTypes.LOCATION, PredefinedCriterionTypes.LOCATION,
PredefinedCriterionTypes.CATEGORY, PredefinedCriterionTypes.SKILL }; PredefinedCriterionTypes.CATEGORY, PredefinedCriterionTypes.SKILL };
@ -697,4 +703,10 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
return null; return null;
} }
@Override
@Transactional(readOnly = true)
public Number getRowCount() {
return workerDAO.getRowCount();
}
} }

View file

@ -64,6 +64,8 @@ import org.zkoss.zul.RowRenderer;
import org.zkoss.zul.Textbox; import org.zkoss.zul.Textbox;
import org.zkoss.zul.api.Groupbox; import org.zkoss.zul.api.Groupbox;
import static org.libreplan.web.I18nHelper._;
/** /**
* Controller for CRUD actions over a {@link User} * Controller for CRUD actions over a {@link User}
* *
@ -97,6 +99,8 @@ public class UserCRUDController extends BaseCRUDController<User> implements
private Combobox profilesCombo; private Combobox profilesCombo;
private Button showCreateForm;
private IURLHandlerRegistry URLHandlerRegistry; private IURLHandlerRegistry URLHandlerRegistry;
private RowRenderer usersRenderer = new RowRenderer() { private RowRenderer usersRenderer = new RowRenderer() {
@ -503,7 +507,18 @@ public class UserCRUDController extends BaseCRUDController<User> implements
Limits usersTypeLimit = limitsModel.getUsersType(); Limits usersTypeLimit = limitsModel.getUsersType();
Long usersCount = (Long) userModel.getRowCount(); Long usersCount = (Long) userModel.getRowCount();
if (usersTypeLimit != null) if (usersTypeLimit != null)
if ( usersCount >= usersTypeLimit.getValue() ) return true; if ( usersCount >= usersTypeLimit.getValue() )
return true;
return false; return false;
} }
public String getShowCreateFormLabel(){
Limits usersTypeLimit = limitsModel.getUsersType();
Long usersCount = (Long) userModel.getRowCount();
if (usersTypeLimit != null)
if ( usersCount >= usersTypeLimit.getValue() )
return _("User limit reached");
return _("Create");
}
} }

View file

@ -9287,3 +9287,15 @@ msgstr ""
#: libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul:2 #: libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul:2
msgid "Show archived column data" msgid "Show archived column data"
msgstr "" msgstr ""
#: libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java:520
msgid "User limit reached"
msgstr ""
#: libreplan-webapp/src/main/java/org/libreplan/web/resources/worker/UserCRUDController.java:1178
msgid "Workers limit reached"
msgstr ""
#: libreplan-webapp/src/main/java/org/libreplan/web/resources/machine/MachineCRUDController.java:631
msgid "Machines limit reached"
msgstr ""

View file

@ -40,6 +40,7 @@
</columns> </columns>
</newdatasortablegrid> </newdatasortablegrid>
<button id="show_create_form" onClick="controller.goToCreateForm();" <button id="show_create_form" onClick="controller.goToCreateForm();"
label="${i18n:_('Create')}" sclass="create-button global-action"> label="@{controller.getShowCreateFormLabel}" sclass="create-button global-action"
disabled="@{controller.isCreateButtonDisabled}">
</button> </button>
</window> </window>

View file

@ -42,6 +42,7 @@
</newdatasortablegrid> </newdatasortablegrid>
<button id="show_create_form" onClick="controller.goToCreateForm();" <button id="show_create_form" onClick="controller.goToCreateForm();"
label="${i18n:_('Create')}" sclass="create-button global-action"> label="@{controller.getShowCreateFormLabel}" sclass="create-button global-action"
disabled="@{controller.isCreateButtonDisabled}">
</button> </button>
</window> </window>

View file

@ -35,7 +35,7 @@
</columns> </columns>
</newdatasortablegrid> </newdatasortablegrid>
<button id="show_create_form" onClick="controller.goToCreateForm();" <button id="show_create_form" onClick="controller.goToCreateForm();"
label="${i18n:_('Create')}" sclass="create-button global-action" label="@{controller.getShowCreateFormLabel}" sclass="create-button global-action"
disabled="@{controller.isCreateButtonDisabled}"> disabled="@{controller.isCreateButtonDisabled}">
</button> </button>
</window> </window>