branch develop updated (43271c8 -> ad15ae4)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from 43271c8 fixes #9052 Ajouter une ligne "Totaux" dans le tableau des quantités par gamme sur les dossiers new ad15ae4 fixes #9054 Pouvoir consulter en lecture seule un mail bloqué par un autre utilisateur The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit ad15ae4b838fe9f42a11b9c8993ea90d3d660d3b Author: Kevin Morin <morin@codelutin.com> Date: Thu Feb 16 09:31:18 2017 +0100 fixes #9054 Pouvoir consulter en lecture seule un mail bloqué par un autre utilisateur Summary of changes: faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 33469 -> 33550 bytes .../services/service/EmailServiceImpl.java | 5 ++++- .../exceptions/AlreadyLockedMailException.java | 10 ++++++++- ...14__add_colorize_invalid_demands_on_folders.sql | 6 ++++- ...14__add_colorize_invalid_demands_on_folders.sql | 7 +++++- .../ui/swing/actions/ShowDemandeAction.java | 25 +++++++++++++++------ .../util/AbstractFaxToMailDemandListHandler.java | 3 +-- .../WEB-INF/content/admin/configuration-input.jsp | 17 ++++++++++++++ .../src/main/webapp/js/configuration.js | 4 ++++ 9 files changed, 64 insertions(+), 13 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit ad15ae4b838fe9f42a11b9c8993ea90d3d660d3b Author: Kevin Morin <morin@codelutin.com> Date: Thu Feb 16 09:31:18 2017 +0100 fixes #9054 Pouvoir consulter en lecture seule un mail bloqué par un autre utilisateur --- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 33469 -> 33550 bytes .../services/service/EmailServiceImpl.java | 5 ++++- .../exceptions/AlreadyLockedMailException.java | 10 ++++++++- ...14__add_colorize_invalid_demands_on_folders.sql | 6 ++++- ...14__add_colorize_invalid_demands_on_folders.sql | 7 +++++- .../ui/swing/actions/ShowDemandeAction.java | 25 +++++++++++++++------ .../util/AbstractFaxToMailDemandListHandler.java | 3 +-- .../WEB-INF/content/admin/configuration-input.jsp | 17 ++++++++++++++ .../src/main/webapp/js/configuration.js | 4 ++++ 9 files changed, 64 insertions(+), 13 deletions(-) diff --git a/faxtomail-persistence/src/main/xmi/faxtomail.zargo b/faxtomail-persistence/src/main/xmi/faxtomail.zargo index 033fb8c..6eb4a18 100644 Binary files a/faxtomail-persistence/src/main/xmi/faxtomail.zargo and b/faxtomail-persistence/src/main/xmi/faxtomail.zargo differ diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index 1db0638..a31b8ca 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -944,8 +944,11 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe getPersistenceContext().commit(); } else if (!mailLock.getLockBy().equals(currentUser)) { + // throw exception if already locked by another user - throw new AlreadyLockedMailException(String.format("Mail %s already locked by %s", emailId, mailLock.getLockBy().getTopiaId()), mailLock.getLockBy()); + throw new AlreadyLockedMailException(String.format("Mail %s already locked by %s", emailId, mailLock.getLockBy().getTopiaId()), + mailLock.getLockBy(), + mailLock.getLockOn()); } return email; diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/exceptions/AlreadyLockedMailException.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/exceptions/AlreadyLockedMailException.java index db77125..3102fc0 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/exceptions/AlreadyLockedMailException.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/exceptions/AlreadyLockedMailException.java @@ -1,5 +1,6 @@ package com.franciaflex.faxtomail.services.service.exceptions; +import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; /* @@ -38,12 +39,19 @@ public class AlreadyLockedMailException extends Exception { protected FaxToMailUser lockedBy; - public AlreadyLockedMailException(String message, FaxToMailUser lockedBy) { + protected Email email; + + public AlreadyLockedMailException(String message, FaxToMailUser lockedBy, Email email) { super(message); this.lockedBy = lockedBy; + this.email = email; } public FaxToMailUser getLockedBy() { return lockedBy; } + + public Email getEmail() { + return email; + } } diff --git a/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql b/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql index 019223f..fe94f31 100644 --- a/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql +++ b/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql @@ -1,3 +1,7 @@ -- add mail folder COLORIZEINVALIDDEMANDS alter table mailfolder add COLORIZEINVALIDDEMANDS boolean; -update mailfolder set COLORIZEINVALIDDEMANDS = 't' where parent is null; \ No newline at end of file +update mailfolder set COLORIZEINVALIDDEMANDS = 't' where parent is null; + +-- add mail folder lockedDemandsOpenableInReadOnly +alter table mailfolder add lockedDemandsOpenableInReadOnly boolean; +update mailfolder set lockedDemandsOpenableInReadOnly = 'f' where parent is null; \ No newline at end of file diff --git a/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql index f7830a0..ef07110 100644 --- a/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql +++ b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql @@ -1,3 +1,8 @@ -- add mail folder COLORIZEINVALIDDEMANDS alter table mailfolder add COLORIZEINVALIDDEMANDS bit; -update mailfolder set COLORIZEINVALIDDEMANDS = 1 where parent is null; \ No newline at end of file +update mailfolder set COLORIZEINVALIDDEMANDS = 1 where parent is null; + +-- add mail folder lockedDemandsOpenableInReadOnly +alter table mailfolder add lockedDemandsOpenableInReadOnly bit; +update mailfolder set lockedDemandsOpenableInReadOnly = 0 where parent is null; + diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java index ba1abf9..1b1df37 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeAction.java @@ -35,6 +35,7 @@ import com.franciaflex.faxtomail.ui.swing.content.MainUIHandler; import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUI; import jaxx.runtime.swing.JAXXWidgetUtil; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -123,15 +124,25 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { } } } - // le mail est locké, on ne fait rien + // le mail est locké, soit on rejette, soit on ouvre en lecture seule, en fonction de la conf du dossier catch (AlreadyLockedMailException ex) { - result = false; - String htmlMessage = t("faxtomail.alert.alreadyLockedBy.message", decorate(ex.getLockedBy())); - JOptionPane.showMessageDialog(getHandler().getTopestUI(), - htmlMessage, - t("faxtomail.alert.alreadyLockedBy.title"), - JOptionPane.ERROR_MESSAGE); + MailFolder mailFolder = currentEmail.getMailFolder(); + while (mailFolder != null && mailFolder.getLockedDemandsOpenableInReadOnly() == null) { + mailFolder = mailFolder.getParent(); + } + + result = mailFolder != null && BooleanUtils.isTrue(mailFolder.getLockedDemandsOpenableInReadOnly()); + if (result) { + currentEmail.setEditable(false); + + } else { + String htmlMessage = t("faxtomail.alert.alreadyLockedBy.message", decorate(ex.getLockedBy())); + JOptionPane.showMessageDialog(getHandler().getTopestUI(), + htmlMessage, + t("faxtomail.alert.alreadyLockedBy.title"), + JOptionPane.ERROR_MESSAGE); + } } // l'utilisateur n'a pas les droits de lecture sur le dossier diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java index 8ddba10..6e78be6 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java @@ -91,8 +91,7 @@ public abstract class AbstractFaxToMailDemandListHandler<M, UI extends FaxToMail public void updateColorizeInvalidDemands() { MailFolder mailFolder = getContext().getCurrentMailFolder(); - while (mailFolder != null && mailFolder.getParent() != null - && mailFolder.getColorizeInvalidDemands() == null) { + while (mailFolder != null && mailFolder.getColorizeInvalidDemands() == null) { mailFolder = mailFolder.getParent(); } colorizeInvalidDemands = mailFolder != null && BooleanUtils.isNotFalse(mailFolder.getColorizeInvalidDemands()); diff --git a/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp b/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp index 6f3e675..e05a7b5 100644 --- a/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp +++ b/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp @@ -506,6 +506,23 @@ </label> </div> + <div class="form-group"> + <label class="control-label">Permettre l'ouverture en lecture seule des demandes bloquées par un autre utilisateur ?</label><br /> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.lockedDemandsOpenableInReadOnly" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.lockedDemandsOpenableInReadOnly" ng-value="false"> non + </label> + <label class="radio-inline" ng-if="selectedMailFolder.$parent"> + <input type="radio" + ng-model="selectedMailFolder.lockedDemandsOpenableInReadOnly" ng-value="undefined"> hériter du dossier parent + ({{parentScopeValues.lockedDemandsOpenableInReadOnly ? 'Oui' : 'Non'}}) + </label> + </div> + <div class="form-group" ng-if="selectedMailFolder.$parent"> <label><input type="radio" ng-model="selectedMailFolder.useCurrentLevelNbElementToDisplay" ng-value="false" /> Hériter du nombre d'éléments à afficher à l'utilisateur :</label> diff --git a/faxtomail-ui-web/src/main/webapp/js/configuration.js b/faxtomail-ui-web/src/main/webapp/js/configuration.js index 07b4ae0..4c572d0 100644 --- a/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -794,6 +794,7 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo $scope.selectedMailFolder.colorizeInvalidDemands = $scope.selectedMailFolder.colorizeInvalidDemands || false; $scope.selectedMailFolder.openAttachmentReportNoTaken = $scope.selectedMailFolder.openAttachmentReportNoTaken || false; $scope.selectedMailFolder.printActionEqualTakeAction = $scope.selectedMailFolder.printActionEqualTakeAction || false; + $scope.selectedMailFolder.lockedDemandsOpenableInReadOnly = $scope.selectedMailFolder.lockedDemandsOpenableInReadOnly || false; $scope.selectedMailFolder.ediTransfer = $scope.selectedMailFolder.ediTransfer|| false; } @@ -881,6 +882,9 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo if (angular.isUndefined($scope.parentScopeValues.printActionEqualTakeAction)) { $scope.parentScopeValues.printActionEqualTakeAction = folder.printActionEqualTakeAction; } + if (angular.isUndefined($scope.parentScopeValues.lockedDemandsOpenableInReadOnly)) { + $scope.parentScopeValues.lockedDemandsOpenableInReadOnly = folder.lockedDemandsOpenableInReadOnly; + } if (angular.isUndefined($scope.parentScopeValues.ediTransfer)) { $scope.parentScopeValues.ediTransfer = folder.ediTransfer; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm