diff --git a/NEWS.rst b/NEWS.rst
index f25e21154..33764cf2a 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1712,7 +1712,7 @@ Changes
* Use disabled textbox for capacity row in monthly timesheets
* Set a pink background for days with zero capacity in the monthly timesheet
* Fix align issues due to colspan in the first column of capacity and total rows
-* Add capcity row to monthly timesheets
+* Add capacity row to monthly timesheets
* Add total row to monthly timesheets
* Remove commented line
* Add button to hide/show extra filtering options
diff --git a/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java b/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java
index a2160b248..6d706ce0b 100644
--- a/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java
+++ b/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java
@@ -30,7 +30,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- * It contains the current version of project and implements of singleton pattern.
+ * It contains the current version of project and implements of singleton pattern.
+ *
* It also has a cached value with information about last project version published.
* It checks the last version against a URL.
*
@@ -42,15 +43,16 @@ public class VersionInformation {
private static final Log LOG = LogFactory.getLog(VersionInformation.class);
/**
- * URL with a text file only with last number version of LibrePlan
+ * URL with a text file only with last number version of LibrePlan.
*/
private static final String LIBREPLAN_VERSION_URL = "http://libreplan.org/VERSION";
/**
- * Delay to wait till we check the URL again
+ * Delay to wait till we check the URL again.
+ * 1 Day.
*/
- private static final long DELAY_TO_CHECK_URL = 24 * 60 * 60 * 1000L; // 1 day
+ private static final long DELAY_TO_CHECK_URL = 24 * 60 * 60 * 1000L;
private static final VersionInformation singleton = new VersionInformation();
@@ -69,14 +71,15 @@ public class VersionInformation {
URL url = getURL();
String lastVersion = (new BufferedReader(new InputStreamReader(url.openStream()))).readLine();
if (projectVersion != null && lastVersion != null) {
- newVersionCached = !projectVersion.equals(lastVersion);
+ Integer currentVersion = Integer.parseInt(projectVersion.replace(".", ""));
+ Integer versionFromURL = Integer.parseInt(lastVersion.replace(".", ""));
+ newVersionCached = versionFromURL > currentVersion;
}
} catch (MalformedURLException e) {
LOG.warn("Problems generating URL to check LibrePlan version. MalformedURLException: " + e.getMessage());
} catch (IOException e) {
- LOG.info(
- "Could not check LibrePlan version information from " +
- LIBREPLAN_VERSION_URL + ". IOException: " + e.getMessage());
+ LOG.info("Could not check LibrePlan version information from " +
+ LIBREPLAN_VERSION_URL + ". IOException: " + e.getMessage());
}
}
diff --git a/libreplan-webapp/src/main/java/org/libreplan/importers/notifications/EmailConnectionValidator.java b/libreplan-webapp/src/main/java/org/libreplan/importers/notifications/EmailConnectionValidator.java
index 70f7fd0aa..6b4486bf9 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/importers/notifications/EmailConnectionValidator.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/importers/notifications/EmailConnectionValidator.java
@@ -20,7 +20,6 @@
package org.libreplan.importers.notifications;
import org.libreplan.business.common.daos.IConnectorDAO;
-import org.libreplan.business.common.entities.Connector;
import org.libreplan.business.common.entities.ConnectorProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -94,26 +93,30 @@ public class EmailConnectionValidator {
Transport transport = null;
try {
- if ( protocol.equals("SMTP") ) {
+ if ( "SMTP".equals(protocol) ) {
properties.setProperty("mail.smtp.port", port);
properties.setProperty("mail.smtp.host", host);
properties.setProperty("mail.smtp.connectiontimeout", Integer.toString(3000));
Session session = Session.getInstance(properties, null);
transport = session.getTransport("smtp");
- if ( "".equals(usrnme) && "".equals(psswrd) )
+ if ( "".equals(usrnme) && "".equals(psswrd) ) {
transport.connect();
+ }
- } else if ( protocol.equals("STARTTLS") ) {
+
+ } else if ( "STARTTLS".equals(protocol) ) {
properties.setProperty("mail.smtps.port", port);
properties.setProperty("mail.smtps.host", host);
- properties.setProperty("mail.smtp.connectiontimeout", Integer.toString(3000));
+ properties.setProperty("mail.smtps.connectiontimeout", Integer.toString(3000));
Session session = Session.getInstance(properties, null);
transport = session.getTransport("smtps");
- if ( !"".equals(usrnme) && psswrd != null )
+ if ( !"".equals(usrnme) && psswrd != null ) {
transport.connect(host, usrnme, psswrd);
+ }
+
}
if ( transport != null && transport.isConnected() )
return true;
@@ -128,19 +131,20 @@ public class EmailConnectionValidator {
}
public List getEmailConnectorProperties() {
- Connector connector = connectorDAO.findUniqueByName("E-mail");
-
- return connector.getProperties();
+ return connectorDAO.findUniqueByName("E-mail").getProperties();
}
public boolean isConnectionActivated() {
List emailConnectorProperties = getEmailConnectorProperties();
for (ConnectorProperty item : emailConnectorProperties) {
- if ( item.getKey().equals("Activated") )
- if ( item.getValue().equals("Y") )
+ if ( "Activated".equals(item.getKey()) ) {
+ if ( "Y".equals(item.getValue()) ) {
return true;
- else break;
+ } else {
+ break;
+ }
+ }
}
return false;
}
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java
index 3b5b1bcf9..22d7c2d04 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/ConfigurationController.java
@@ -487,6 +487,7 @@ public class ConfigurationController extends GenericForwardComposer {
if ("SMTP".equals(protocolsCombobox.getSelectedItem().getLabel())) {
props.setProperty("mail.smtp.port", port);
props.setProperty("mail.smtp.host", host);
+ props.setProperty("mail.smtp.connectiontimeout", Integer.toString(3000));
Session session = Session.getInstance(props, null);
transport = session.getTransport("smtp");
@@ -497,6 +498,7 @@ public class ConfigurationController extends GenericForwardComposer {
else if (STARTTLS_PROTOCOL.equals(protocolsCombobox.getSelectedItem().getLabel())) {
props.setProperty("mail.smtps.port", port);
props.setProperty("mail.smtps.host", host);
+ props.setProperty("mail.smtps.connectiontimeout", Integer.toString(3000));
Session session = Session.getInstance(props, null);
transport = session.getTransport("smtps");
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/GatheredUsageStats.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/GatheredUsageStats.java
index 275ae1ea4..d77910f37 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/common/GatheredUsageStats.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/GatheredUsageStats.java
@@ -121,16 +121,38 @@ public class GatheredUsageStats {
private String oldestDate;
public GatheredUsageStats() {
- this.userDAO = (IUserDAO) SpringUtil.getBean("userDAO");
- this.orderModel = (IOrderModel) SpringUtil.getBean("orderModel");
- this.workReportModel = (IWorkReportModel) SpringUtil.getBean("workReportModel");
- this.workerModel = (IWorkerModel) SpringUtil.getBean("workerModel");
- this.machineModel = (IMachineModel) SpringUtil.getBean("machineModel");
- this.expenseSheetModel = (IExpenseSheetModel) SpringUtil.getBean("expenseSheetModel");
- this.materialsModel = (IMaterialsModel) SpringUtil.getBean("materialsModel");
+ if ( this.userDAO == null ) {
+ this.userDAO = (IUserDAO) SpringUtil.getBean("userDAO");
+ }
- this.assignedTaskQualityFormsToOrderElementModel = (IAssignedTaskQualityFormsToOrderElementModel)
- SpringUtil.getBean("assignedTaskQualityFormsToOrderElementModel");
+ if ( this.orderModel == null ) {
+ this.orderModel = (IOrderModel) SpringUtil.getBean("orderModel");
+ }
+
+ if ( this.workReportModel == null ) {
+ this.workReportModel = (IWorkReportModel) SpringUtil.getBean("workReportModel");
+ }
+
+ if ( this.workerModel == null ) {
+ this.workerModel = (IWorkerModel) SpringUtil.getBean("workerModel");
+ }
+
+ if ( this.machineModel == null ) {
+ this.machineModel = (IMachineModel) SpringUtil.getBean("machineModel");
+ }
+
+ if ( this.expenseSheetModel == null ) {
+ this.expenseSheetModel = (IExpenseSheetModel) SpringUtil.getBean("expenseSheetModel");
+ }
+
+ if ( this.materialsModel == null ) {
+ this.materialsModel = (IMaterialsModel) SpringUtil.getBean("materialsModel");
+ }
+
+ if ( this.assignedTaskQualityFormsToOrderElementModel == null ) {
+ this.assignedTaskQualityFormsToOrderElementModel = (IAssignedTaskQualityFormsToOrderElementModel)
+ SpringUtil.getBean("assignedTaskQualityFormsToOrderElementModel");
+ }
initialize();
}
@@ -160,7 +182,8 @@ public class GatheredUsageStats {
sb.append(Integer.toString((anEncoded & 0xff) + 0x100, 16).substring(1));
}
- } catch (NoSuchAlgorithmException | UnsupportedEncodingException ignored) {}
+ } catch (NoSuchAlgorithmException | UnsupportedEncodingException ignored) {
+ }
return sb.toString();
}
@@ -229,7 +252,6 @@ public class GatheredUsageStats {
connection.getInputStream();
} catch (IOException ignored) {
-
} finally {
if ( connection != null ) {
connection.disconnect();
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateController.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateController.java
index 07c1c67af..dbb92a641 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateController.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/TemplateController.java
@@ -91,11 +91,7 @@ public class TemplateController extends GenericForwardComposer {
}
public List getScenarios() {
- if ( templateModel == null ) {
- return Collections.emptyList();
- }
-
- return templateModel.getScenarios();
+ return templateModel == null ? Collections.emptyList() : templateModel.getScenarios();
}
public String getCompanyLogoURL() {
@@ -183,7 +179,6 @@ public class TemplateController extends GenericForwardComposer {
return asDisplayProperty(templateModel.hasChangedDefaultPassword(mandatoryUser));
}
-
private String asDisplayProperty(boolean passwordChanged) {
return passwordChanged ? "none" : "inline";
}
@@ -229,13 +224,9 @@ public class TemplateController extends GenericForwardComposer {
}
public boolean isNewVersionAvailable() {
- if ( templateModel.isCheckNewVersionEnabled() ) {
-
- if ( VersionInformation.isNewVersionAvailable() ){
- lastVersionNumber = VersionInformation.getLastVersion();
-
- return true;
- }
+ if ( templateModel.isCheckNewVersionEnabled() && VersionInformation.isNewVersionAvailable() ) {
+ lastVersionNumber = VersionInformation.getLastVersion();
+ return true;
}
return false;
@@ -243,14 +234,15 @@ public class TemplateController extends GenericForwardComposer {
public String getUsername() {
CustomUser user = SecurityUtils.getLoggedUser();
-
return (user == null) ? "" : user.getUsername();
}
- public String getVersionMessage(){
- return _("A new version ") +
- lastVersionNumber +
- _(" of LibrePlan is available. Please check next link for more information:");
+ /**
+ * Should be public!
+ * Used in template.zul
+ */
+ public String getVersionMessage() {
+ return _("A new version ") + lastVersionNumber + _(" of LibrePlan is available. Please check next link for more information:");
}
}
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/planner/consolidations/AdvanceConsolidationModel.java b/libreplan-webapp/src/main/java/org/libreplan/web/planner/consolidations/AdvanceConsolidationModel.java
index d18df3e8c..fe31525f4 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/planner/consolidations/AdvanceConsolidationModel.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/planner/consolidations/AdvanceConsolidationModel.java
@@ -424,10 +424,10 @@ public class AdvanceConsolidationModel implements IAdvanceConsolidationModel {
}
} else {
- SortedSet consolcalculatedConsolidatedValuestedValues =
+ SortedSet calculatedConsolidatedValuestedValues =
((CalculatedConsolidation) consolidation).getCalculatedConsolidatedValues();
- for (CalculatedConsolidatedValue consolidatedValue : consolcalculatedConsolidatedValuestedValues) {
+ for (CalculatedConsolidatedValue consolidatedValue : calculatedConsolidatedValuestedValues) {
consolidationDTOs.add(new AdvanceConsolidationDTO(null, consolidatedValue));
}
}
@@ -469,7 +469,7 @@ public class AdvanceConsolidationModel implements IAdvanceConsolidationModel {
@Override
public boolean isVisibleMessages() {
- return getAdvances().size() == 0 || isSubcontracted() || !hasResourceAllocation();
+ return getAdvances().isEmpty() || isSubcontracted() || !hasResourceAllocation();
}
private boolean advanceIsCalculated(){
@@ -477,7 +477,7 @@ public class AdvanceConsolidationModel implements IAdvanceConsolidationModel {
}
public String infoMessages() {
- return getAdvances().size() > 0
+ return !getAdvances().isEmpty()
? _("Progress cannot be consolidated.")
: _("There is not any assigned progress to current task");
}
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/security/SecurityUtils.java b/libreplan-webapp/src/main/java/org/libreplan/web/security/SecurityUtils.java
index 15f9fee74..96faf7521 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/security/SecurityUtils.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/security/SecurityUtils.java
@@ -55,7 +55,6 @@ public final class SecurityUtils {
public static boolean isGatheredStatsAlreadySent = false;
private SecurityUtils() {
-
}
public static boolean isUserInRole(UserRole role) {
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java
index 5cca300a7..2d4b080bd 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/ProfileCRUDController.java
@@ -45,7 +45,7 @@ import java.util.List;
import static org.libreplan.web.I18nHelper._;
/**
- * Controller for CRUD actions over a {@link Profile}
+ * Controller for CRUD actions over a {@link Profile}.
*
* @author Jacobo Aragunde Perez
* @author Diego Pino GarcĂa
@@ -57,8 +57,10 @@ public class ProfileCRUDController extends BaseCRUDController {
private Combobox userRolesCombo;
- public ProfileCRUDController(){
- profileModel = (IProfileModel) SpringUtil.getBean("profileModel");
+ public ProfileCRUDController() {
+ if ( profileModel == null ) {
+ profileModel = (IProfileModel) SpringUtil.getBean("profileModel");
+ }
}
@Override
@@ -70,6 +72,7 @@ public class ProfileCRUDController extends BaseCRUDController {
/**
* Appends the existing UserRoles to the Combobox passed.
+ *
* @param combo
*/
private void appendAllUserRolesExceptRoleBoundUser(Combobox combo) {
@@ -82,7 +85,7 @@ public class ProfileCRUDController extends BaseCRUDController {
}
}
- protected void save() throws ValidationException{
+ protected void save() throws ValidationException {
profileModel.confirmSave();
}
@@ -96,8 +99,8 @@ public class ProfileCRUDController extends BaseCRUDController {
public void addSelectedRole() {
Comboitem comboItem = userRolesCombo.getSelectedItem();
- if(comboItem != null) {
- addRole((UserRole)comboItem.getValue());
+ if (comboItem != null) {
+ addRole(comboItem.getValue());
}
}
@@ -145,8 +148,7 @@ public class ProfileCRUDController extends BaseCRUDController {
profileModel.checkHasUsers(profile);
return false;
} catch (ValidationException e) {
- showCannotDeleteProfileDialog(e.getInvalidValue().getMessage()
- );
+ showCannotDeleteProfileDialog(e.getInvalidValue().getMessage());
}
return true;
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java
index 270dac3c3..7cb41cd52 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java
@@ -85,12 +85,9 @@ public class UserCRUDController extends BaseCRUDController implements IUse
private Combobox profilesCombo;
- private Button showCreateForm;
-
private IURLHandlerRegistry URLHandlerRegistry;
public UserCRUDController() {
-
}
private RowRenderer usersRenderer = (row, data, i) -> {
@@ -103,8 +100,8 @@ public class UserCRUDController extends BaseCRUDController implements IUse
Util.appendLabel(row, _(user.getUserType().toString()));
Util.appendLabel(row, user.isBound() ? user.getWorker().getShortDescription() : "");
- Button[] buttons = Util.appendOperationsAndOnClickEvent(row,
- event -> goToEditForm(user), event -> confirmDelete(user));
+ Button[] buttons =
+ Util.appendOperationsAndOnClickEvent(row, event -> goToEditForm(user), event -> confirmDelete(user));
// Disable remove button for default admin as it's mandatory
if ( isDefaultAdmin(user) ) {
@@ -122,7 +119,10 @@ public class UserCRUDController extends BaseCRUDController implements IUse
passwordBox = (Textbox) editWindow.getFellowIfAny("password");
passwordConfirmationBox = (Textbox) editWindow.getFellowIfAny("passwordConfirmation");
profilesCombo = (Combobox) editWindow.getFellowIfAny("profilesCombo");
+
userRolesCombo = (Combobox) editWindow.getFellowIfAny("userRolesCombo");
+ userRolesCombo.setWidth("320px");
+
appendAllUserRolesExceptRoleBoundUser(userRolesCombo);
appendAllProfiles(profilesCombo);
boundResourceGroupbox = (Groupbox) editWindow.getFellowIfAny("boundResourceGroupbox");
@@ -132,14 +132,26 @@ public class UserCRUDController extends BaseCRUDController implements IUse
}
private void injectsObjects() {
- userModel = (IUserModel) SpringUtil.getBean("userModel");
- limitsModel = (ILimitsModel) SpringUtil.getBean("limitsModel");
- workerCRUD = (IWorkerCRUDControllerEntryPoints) SpringUtil.getBean("workerCRUD");
- URLHandlerRegistry = (IURLHandlerRegistry) SpringUtil.getBean("URLHandlerRegistry");
+ if ( userModel == null ) {
+ userModel = (IUserModel) SpringUtil.getBean("userModel");
+ }
+
+ if ( limitsModel == null ) {
+ limitsModel = (ILimitsModel) SpringUtil.getBean("limitsModel");
+ }
+
+ if ( workerCRUD == null ) {
+ workerCRUD = (IWorkerCRUDControllerEntryPoints) SpringUtil.getBean("workerCRUD");
+ }
+
+ if ( URLHandlerRegistry == null ) {
+ URLHandlerRegistry = (IURLHandlerRegistry) SpringUtil.getBean("URLHandlerRegistry");
+ }
}
/**
* Appends the existing UserRoles to the Combobox passed.
+ *
* @param combo
*/
private void appendAllUserRolesExceptRoleBoundUser(Combobox combo) {
@@ -188,7 +200,7 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public void addSelectedRole() {
Comboitem comboItem = userRolesCombo.getSelectedItem();
- if(comboItem != null) {
+ if (comboItem != null) {
addRole(comboItem.getValue());
}
}
@@ -210,7 +222,7 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public void addSelectedProfile() {
Comboitem comboItem = profilesCombo.getSelectedItem();
- if(comboItem != null) {
+ if (comboItem != null) {
addProfile(comboItem.getValue());
}
}
@@ -226,22 +238,21 @@ public class UserCRUDController extends BaseCRUDController implements IUse
}
/**
- * Tells the XXXModel to set the password attribute of the inner
- * {@ link User} object.
+ * Tells the XXXModel to set the password attribute of the inner {@link User} object.
*
* @param password String with the unencrypted password.
*/
public void setPassword(String password) {
userModel.setPassword(password);
- //update the constraint on the confirmation password box
- ((Textbox)editWindow.getFellowIfAny("passwordConfirmation")).clearErrorMessage(true);
+ // Update the constraint on the confirmation password box
+ ((Textbox) editWindow.getFellowIfAny("passwordConfirmation")).clearErrorMessage(true);
}
public Constraint validatePasswordConfirmation() {
return (comp, value) -> {
- ((Textbox)comp).setRawValue(value);
+ ((Textbox) comp).setRawValue(value);
- if(!value.equals(passwordBox.getValue())) {
+ if (!value.equals(passwordBox.getValue())) {
throw new WrongValueException(comp, _("passwords don't match"));
}
};
@@ -260,25 +271,29 @@ public class UserCRUDController extends BaseCRUDController implements IUse
@Override
protected void initCreate() {
userModel.initCreate();
- //password is compulsory when creating
+
+ // Password is compulsory when creating
passwordBox.setConstraint("no empty:" + _("Password cannot be empty"));
- //clean the password boxes, they are not cleared automatically
- //because they are not directly associated to an attribute
+
+ // Clean the password boxes, they are not cleared automatically because they are not directly associated to an attribute
passwordBox.setRawValue("");
passwordConfirmationBox.setRawValue("");
+
prepareAuthenticationTypesCombo();
}
@Override
protected void initEdit(User user) {
userModel.initEdit(user);
- //password is not compulsory when editing, so we remove
- //the constraint
+
+ // Password is not compulsory when editing, so we remove the constraint
passwordBox.setConstraint((Constraint)null);
- //cleans the box and forces the check of the new Constraint (null)
+
+ // Cleans the box and forces the check of the new Constraint (null)
passwordBox.setValue("");
passwordConfirmationBox.setValue("");
- //setup authentication type combo box
+
+ // Setup authentication type combo box
prepareAuthenticationTypesCombo();
}
@@ -305,12 +320,11 @@ public class UserCRUDController extends BaseCRUDController implements IUse
@Override
protected boolean beforeDeleting(User user) {
Worker worker = user.getWorker();
+
return worker == null ||
Messagebox.show(_("User is bound to resource \"{0}\" and it will be unbound. " +
- "Do you want to continue with user removal?",
- worker.getShortDescription()),
- _("Confirm remove user"),
- Messagebox.YES | Messagebox.NO, Messagebox.QUESTION) == Messagebox.YES;
+ "Do you want to continue with user removal?", worker.getShortDescription()),
+ _("Confirm remove user"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION) == Messagebox.YES;
}
@Override
@@ -320,16 +334,15 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public boolean isLdapUser() {
User user = userModel.getUser();
-
return user != null && !user.isLibrePlanUser();
}
public boolean isLdapUserLdapConfiguration() {
- return (isLdapUser() && userModel.isLDAPBeingUsed());
+ return isLdapUser() && userModel.isLDAPBeingUsed();
}
public boolean getLdapUserRolesLdapConfiguration() {
- return (isLdapUser() && userModel.isLDAPRolesBeingUsed());
+ return isLdapUser() && userModel.isLDAPRolesBeingUsed();
}
public RowRenderer getRolesRenderer() {
@@ -339,6 +352,7 @@ public class UserCRUDController extends BaseCRUDController implements IUse
row.appendChild(new Label(_(role.getDisplayName())));
Button removeButton = Util.createRemoveButton(event -> removeRole(role));
+
removeButton.setDisabled(areRolesAndProfilesDisabled() ||
role.equals(UserRole.ROLE_BOUND_USER) || isUserDefaultAdmin());
@@ -352,25 +366,16 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public String hasBoundResource() {
User user = getUser();
- if (user != null && user.isBound()) {
- return _("Yes");
- }
-
- return _("No");
+ return user != null && user.isBound() ? _("Yes") : _("No");
}
public String getBoundResource() {
User user = getUser();
- if (user != null && user.isBound()) {
- return user.getWorker().getShortDescription();
- }
-
- return "";
+ return user != null && user.isBound() ? user.getWorker().getShortDescription() : "";
}
public boolean isBound() {
User user = getUser();
-
return user != null && user.isBound();
}
@@ -383,10 +388,8 @@ public class UserCRUDController extends BaseCRUDController implements IUse
}
private int showConfirmWorkerEditionDialog() {
- return Messagebox
- .show(_("Unsaved changes will be lost. Would you like to continue?"),
- _("Confirm edit worker"), Messagebox.OK
- | Messagebox.CANCEL, Messagebox.QUESTION);
+ return Messagebox.show(_("Unsaved changes will be lost. Would you like to continue?"),
+ _("Confirm edit worker"), Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION);
}
public void unboundResource() {
@@ -399,11 +402,7 @@ public class UserCRUDController extends BaseCRUDController implements IUse
}
public String getWorkerEditionButtonTooltip() {
- if (isNoRoleWorkers()) {
- return _("You do not have permissions to go to edit worker window");
- }
-
- return "";
+ return isNoRoleWorkers() ? _("You do not have permissions to go to edit worker window") : "";
}
private boolean isDefaultAdmin(final User user) {
@@ -412,7 +411,6 @@ public class UserCRUDController extends BaseCRUDController implements IUse
private boolean isUserDefaultAdmin() {
User user = userModel.getUser();
-
return user != null && isDefaultAdmin(user);
}
@@ -426,18 +424,12 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public UserAuthenticationType getAuthenticationType() {
User user = getUser();
- if (user != null) {
- return user.getUserType();
- }
-
- return null;
+ return user != null ? user.getUserType() : null;
}
public void setAuthenticationType(Comboitem item) {
if (item == null) {
- throw new WrongValueException(
- editWindow.getFellowIfAny("authenticationTypeCombo"),
- _("cannot be empty"));
+ throw new WrongValueException(editWindow.getFellowIfAny("authenticationTypeCombo"), _("cannot be empty"));
}
UserAuthenticationType authenticationType = item.getValue();
@@ -451,7 +443,6 @@ public class UserCRUDController extends BaseCRUDController implements IUse
public boolean isCreateButtonDisabled() {
Limits usersTypeLimit = limitsModel.getUsersType();
Integer usersCount = userModel.getRowCount().intValue();
-
return usersTypeLimit != null && usersCount >= usersTypeLimit.getValue();
}
@@ -464,9 +455,8 @@ public class UserCRUDController extends BaseCRUDController implements IUse
Integer usersCount = userModel.getRowCount().intValue();
int usersLeft = usersTypeLimit.getValue() - usersCount;
- if ( usersCount >= usersTypeLimit.getValue() )
- return _("User limit reached");
-
- return _("Create") + " ( " + usersLeft + " " + _("left") + " )";
+ return usersCount >= usersTypeLimit.getValue()
+ ? _("User limit reached")
+ : _("Create") + " ( " + usersLeft + " " + _("left") + " )";
}
}
diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/PersonalTimesheetController.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/PersonalTimesheetController.java
index bb34eeb2d..682e593d6 100644
--- a/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/PersonalTimesheetController.java
+++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/dashboard/PersonalTimesheetController.java
@@ -251,7 +251,10 @@ public class PersonalTimesheetController extends GenericForwardComposer implemen
private void openPersonalTimesheetPopup(Textbox textbox, OrderElement orderElement, LocalDate textboxDate) {
Textbox toFocus = setupPersonalTimesheetPopup(textbox, orderElement, textboxDate);
+
personalTimesheetPopup.open(textbox, "after_start");
+ ((Column) personalTimesheetPopup.getChildren().get(0).getChildren().get(0).getChildren().get(0)).setWidth("60px");
+
toFocus.setFocus(true);
}
@@ -419,16 +422,16 @@ public class PersonalTimesheetController extends GenericForwardComposer implemen
private void renderCapacityRow(Row row) {
appendLabelSpaningTwoColumns(row, _("Capacity"));
- appendCapcityForDaysAndTotal(row);
+ appendCapacityForDaysAndTotal(row);
}
- private void appendCapcityForDaysAndTotal(Row row) {
+ private void appendCapacityForDaysAndTotal(Row row) {
EffortDuration totalCapacity = EffortDuration.zero();
for (LocalDate day = first; day.compareTo(last) <= 0; day = day.plusDays(1)) {
EffortDuration capacity = personalTimesheetModel.getResourceCapacity(day);
- Cell cell = getCenteredCell(getDisabledTextbox(getCapcityColumnTextboxId(day), capacity));
+ Cell cell = getCenteredCell(getDisabledTextbox(getCapacityColumnTextboxId(day), capacity));
if ( personalTimesheetModel.getResourceCapacity(day).isZero() ) {
setBackgroundNonCapacityCell(cell);
@@ -471,7 +474,7 @@ public class PersonalTimesheetController extends GenericForwardComposer implemen
private void updateExtraRow(LocalDate date) {
EffortDuration total = getEffortDuration(getTotalColumnTextboxId(date));
- EffortDuration capacity = getEffortDuration(getCapcityColumnTextboxId(date));
+ EffortDuration capacity = getEffortDuration(getCapacityColumnTextboxId(date));
EffortDuration extra = EffortDuration.zero();
if ( total.compareTo(capacity) > 0 ) {
@@ -837,7 +840,7 @@ public class PersonalTimesheetController extends GenericForwardComposer implemen
return "textbox-other-capacity";
}
- private static String getCapcityColumnTextboxId(LocalDate date) {
+ private static String getCapacityColumnTextboxId(LocalDate date) {
return "textbox-capacity-column-" + date;
}
diff --git a/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml b/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml
index 4ed7abab0..b43dc8104 100644
--- a/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml
+++ b/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml
@@ -17,6 +17,8 @@
+
+
diff --git a/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css b/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css
index 25f16ad9f..35f6acd9b 100644
--- a/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css
+++ b/libreplan-webapp/src/main/webapp/common/css/libreplan_zk.css
@@ -1094,11 +1094,11 @@ span.z-dottree-line {
background-position: 18px 10px;
}
-.label-highlight:hover{
+.label-highlight:hover {
background-color: #aacbff;
}
-.global-dashboard-grid{
+.global-dashboard-grid {
margin-top: 5px;
}
diff --git a/libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul b/libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul
index 04b578b77..c01de7c00 100644
--- a/libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul
+++ b/libreplan-webapp/src/main/webapp/dashboard/_pipeline.zul
@@ -1,4 +1,5 @@
+
diff --git a/libreplan-webapp/src/main/webapp/profiles/_editProfile.zul b/libreplan-webapp/src/main/webapp/profiles/_editProfile.zul
index c9b31b9c8..58861e982 100644
--- a/libreplan-webapp/src/main/webapp/profiles/_editProfile.zul
+++ b/libreplan-webapp/src/main/webapp/profiles/_editProfile.zul
@@ -51,9 +51,8 @@
-
-
+
+
@@ -68,13 +67,10 @@
+ label="${i18n:_('Save')}" sclass="save-button global-action" />
+ label="${i18n:_('Save & Continue')}" sclass="saveandcontinue-button global-action" />
+ label="${i18n:_('Cancel')}" sclass="cancel-button global-action" />
diff --git a/libreplan-webapp/src/main/webapp/users/_editUser.zul b/libreplan-webapp/src/main/webapp/users/_editUser.zul
index 8db5c3e66..ba6713788 100644
--- a/libreplan-webapp/src/main/webapp/users/_editUser.zul
+++ b/libreplan-webapp/src/main/webapp/users/_editUser.zul
@@ -166,7 +166,7 @@
visible="@{controller.areRolesAndProfilesDisabled}" />
-
+