This is an automated email from the git hooks/post-receive script. New commit to branch feature/9094_always_open_demand_in_edition in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 6b1dcefd2a3be79c814353652716e43b1d0a38e9 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 16 11:55:38 2017 +0100 refs #9094 prise en compte de la conf mustTakeToEditDemand dans la partie cliente --- .../ui/swing/actions/ShowDemandeAction.java | 23 ++++++++++++--------- .../actions/OpenGroupedDemandAction.java | 24 +++++++++++++--------- 2 files changed, 27 insertions(+), 20 deletions(-) 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 73820f9..b375c0b 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 @@ -89,16 +89,12 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { FaxToMailUser takenBy = email.getTakenBy(); - // todo KMORIN 201703015 check in the folder conf - if (true) { - takeEmail = false; - JOptionPane.showConfirmDialog(getHandler().getTopestUI(), - t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), - t("faxtomail.alert.alreadyTakenBy.title"), - JOptionPane.DEFAULT_OPTION, - JOptionPane.WARNING_MESSAGE); - - } else { + MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); + while (folderWithMustTakeToEditDemand.getParent() != null + && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { + folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); + } + if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? if (takenBy != null && !currentUser.equals(takenBy)) { String htmlMessage = String.format( @@ -133,6 +129,13 @@ public class ShowDemandeAction extends AbstractMainUIFaxToMailAction { } } } + } else { + takeEmail = false; + JOptionPane.showConfirmDialog(getHandler().getTopestUI(), + t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), + t("faxtomail.alert.alreadyTakenBy.title"), + JOptionPane.DEFAULT_OPTION, + JOptionPane.WARNING_MESSAGE); } } // le mail est locké, soit on rejette, soit on ouvre en lecture seule, en fonction de la conf du dossier diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java index 5dba28f..375b3cb 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/actions/OpenGroupedDemandAction.java @@ -37,6 +37,7 @@ import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUI; import com.franciaflex.faxtomail.ui.swing.content.demande.demandgroup.DemandGroupUI; import com.franciaflex.faxtomail.ui.swing.content.demande.demandgroup.DemandGroupUIHandler; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler; @@ -84,16 +85,12 @@ public class OpenGroupedDemandAction extends AbstractFaxToMailAction<DemandeUIMo FaxToMailUser takenBy = email.getTakenBy(); - // todo KMORIN 201703015 check in the folder conf - if (true) { - takeEmail = false; - JOptionPane.showConfirmDialog(getHandler().getTopestUI(), - t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), - t("faxtomail.alert.alreadyTakenBy.title"), - JOptionPane.DEFAULT_OPTION, - JOptionPane.WARNING_MESSAGE); - - } else { + MailFolder folderWithMustTakeToEditDemand = email.getMailFolder(); + while (folderWithMustTakeToEditDemand.getParent() != null + && folderWithMustTakeToEditDemand.getMustTakeToEditDemand() == null) { + folderWithMustTakeToEditDemand = folderWithMustTakeToEditDemand.getParent(); + } + if (BooleanUtils.isTrue(folderWithMustTakeToEditDemand.getMustTakeToEditDemand())) { // si le mail est pris par quelqu'un d'autre, le prend-on ou pas ? if (takenBy != null && !currentUser.equals(takenBy)) { String htmlMessage = String.format( @@ -127,6 +124,13 @@ public class OpenGroupedDemandAction extends AbstractFaxToMailAction<DemandeUIMo } } } + } else { + takeEmail = false; + JOptionPane.showConfirmDialog(getHandler().getTopestUI(), + t("faxtomail.alert.alreadyTakenBy.message", decorate(takenBy)), + t("faxtomail.alert.alreadyTakenBy.title"), + JOptionPane.DEFAULT_OPTION, + JOptionPane.WARNING_MESSAGE); } } // le mail est locké, on ne fait rien -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.