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 8b0ca30fc5171a5cf5d04216c93783c8967a0dc4 Author: jcouteau <couteau@codelutin.com> Date: Thu May 28 11:24:10 2020 +0200 fixes #10749 : Ajouter un bouton "répondre à tous" --- .../ui/swing/content/demande/DemandeListUI.css | 9 ++ .../ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../ui/swing/content/demande/DemandesUI.css | 7 ++ .../ui/swing/content/demande/DemandesUI.jaxx | 3 + .../swing/content/demande/DemandesUIHandler.java | 13 +-- .../demande/actions/OpenReplyAllFormAction.java | 130 +++++++++++++++++++++ .../actions/SaveAndOpenReplyAllFormAction.java | 92 +++++++++++++++ .../i18n/faxtomail-ui-swing_fr_FR.properties | 3 + 8 files changed, 251 insertions(+), 7 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css index 6cc6db38..0cb62873 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css @@ -109,6 +109,15 @@ _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenReplyFormAction.class }; } +#replyAllMenu { + actionIcon: reply; + text: "faxtomail.demandeList.action.replyAll"; + toolTipText: "faxtomail.demandeList.action.replyAll.tip"; + visible: { model.isReplyActivated() }; + enabled: { model.isReplyEnabled() }; + _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenReplyAllFormAction.class }; +} + #forwardMenu { actionIcon: reply; text: "faxtomail.demandeList.action.forward"; diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx index 235adf4a..8b907a7e 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx @@ -61,6 +61,7 @@ <JMenuItem id='printMenu' onActionPerformed='handler.print()'/> <JMenuItem id='replyMenu'/> + <JMenuItem id='replyAllMenu'/> <JMenuItem id='forwardMenu'/> <JMenuItem id='archiveMenu'/> <JMenuItem id='moveMenu'/> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css index 79b2ef19..ff741f61 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css @@ -69,6 +69,13 @@ enabled: { model.isReplyEnabled() }; } +#replyAllButton { + text: "faxtomail.demande.replyAll.button.label"; + actionIcon: reply; + visible: { model.isReplyActivated() }; + enabled: { model.isReplyEnabled() }; +} + #forwardButton { text: "faxtomail.demande.forward.button.label"; actionIcon: reply; diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.jaxx index 8eb909fa..508981e6 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.jaxx @@ -85,6 +85,9 @@ <cell weightx="1" insets="0"> <JButton id="replyButton" onActionPerformed="handler.reply()"/> </cell> + <cell weightx="1" insets="0"> + <JButton id="replyAllButton" onActionPerformed="handler.replyAll()"/> + </cell> <cell weightx="1" insets="0"> <JButton id="forwardButton" onActionPerformed="handler.forward()"/> </cell> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java index 76f8819c..e4e5090b 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java @@ -29,13 +29,7 @@ import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.MailAction; import com.franciaflex.faxtomail.persistence.entities.MailFolder; import com.franciaflex.faxtomail.services.FaxToMailServiceContext; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.ArchiveAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveAndOpenChooseAttachmentToPrintAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveAndOpenForwardFormAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveAndOpenMailFolderChooserAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveAndOpenReplyFormAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveAndOpenSearchToGroupAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveDemandeAndExitAction; +import com.franciaflex.faxtomail.ui.swing.content.demande.actions.*; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler; import jaxx.runtime.validator.swing.SwingValidator; @@ -376,6 +370,11 @@ public class DemandesUIHandler extends AbstractFaxToMailUIHandler<DemandesUIMode runAction(SaveAndOpenReplyFormAction.class); } + public void replyAll() { + closeButtonPopups(); + runAction(SaveAndOpenReplyAllFormAction.class); + } + public void forward() { closeButtonPopups(); runAction(SaveAndOpenForwardFormAction.class); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyAllFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyAllFormAction.java new file mode 100644 index 00000000..3fa24b94 --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyAllFormAction.java @@ -0,0 +1,130 @@ +package com.franciaflex.faxtomail.ui.swing.content.demande.actions; + +/* + * #%L + * FaxToMail :: UI + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 - 2015 Mac-Groupe, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.franciaflex.faxtomail.persistence.entities.Email; +import com.franciaflex.faxtomail.persistence.entities.MailFolder; +import com.franciaflex.faxtomail.persistence.entities.SigningForDomain; +import com.franciaflex.faxtomail.services.FaxToMailServiceContext; +import com.franciaflex.faxtomail.services.FaxToMailServiceUtils; +import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; +import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel; +import jaxx.runtime.JAXXUtil; +import org.apache.commons.lang3.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import static org.nuiton.i18n.I18n.t; + +/** + * @author Kevin Morin (Code Lutin) + * @since 1.1 + */ +public class OpenReplyAllFormAction extends AbstractFaxToMailAction<DemandeListUIModel, DemandeListUI, DemandeListUIHandler> { + + protected ReplyFormUI frameContent; + protected JFrame frame; + + public OpenReplyAllFormAction(DemandeListUIHandler handler) { + super(handler, false); + } + + @Override + public void doAction() throws Exception { + DemandeUIModel demand = getModel().getSelectedEmails().get(0); + + if (StringUtils.isNotBlank(demand.getTopiaId())) { + try(FaxToMailServiceContext serviceContext = getContext().newServiceContext()) { + Email email = serviceContext.getEmailService().getFullEmailById(demand.getTopiaId(), getContext().getCurrentUser()); + demand.fromEntity(email); + + getContext().setCurrentEmail(demand); + + frameContent = new ReplyFormUI(getUI()); + ReplyFormUIModel model = frameContent.getModel(); + + SigningForDomain signingForDomain = null; + if (!demand.isFax() && demand.getRecipient() != null) { + signingForDomain = serviceContext.getConfigurationService().getSigningForEmailAddress(demand.getRecipient()).orNull(); + } + model.setSigning(signingForDomain); + + model.setForward(false); + model.setOriginalDemand(demand); + + String sender = JAXXUtil.getStringValue(demand.getSender()); + if (demand.isFax()) { + MailFolder selectedFolder = getModel().getSelectedFolder(); + + sender = FaxToMailServiceUtils.addFaxDomainToFaxNumber(sender, selectedFolder); + + String from = FaxToMailServiceUtils.addFaxDomainToFaxNumber(FaxToMailServiceUtils.getFaxFromNumber(selectedFolder), selectedFolder); + model.setFrom(from); + } + model.setTo(sender); + model.setCc(demand.getCcRecipients()); + frameContent.getHandler().addReferences(); + } + } + } + + @Override + public void postSuccessAction() { + super.postSuccessAction(); + frame = getHandler().openModalFrame(frameContent, + t("faxtomail.reply.title", getContext().getCurrentEmail().getTitle()), + new Dimension(800, 600)); + + getContext().addPropertyChangeListener(FaxToMailUIContext.PROPERTY_BUSY, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (!getContext().isBusy()) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + + bringCurrentDemandToFront(); + if (frame != null) { + frame.toFront(); + frame = null; + } + } + }); + getContext().removePropertyChangeListener(FaxToMailUIContext.PROPERTY_BUSY, this); + } + } + }); + } + +} diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyAllFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyAllFormAction.java new file mode 100644 index 00000000..fb0967f8 --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyAllFormAction.java @@ -0,0 +1,92 @@ +package com.franciaflex.faxtomail.ui.swing.content.demande.actions; + +/* + * #%L + * FaxToMail :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2014 Mac-Groupe, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import com.franciaflex.faxtomail.persistence.entities.MailFolder; +import com.franciaflex.faxtomail.persistence.entities.SigningForDomain; +import com.franciaflex.faxtomail.services.FaxToMailServiceContext; +import com.franciaflex.faxtomail.services.FaxToMailServiceUtils; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandesUIHandler; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel; +import jaxx.runtime.JAXXUtil; + +import java.awt.*; + +import static org.nuiton.i18n.I18n.t; + +/** + * @author Kevin Morin (Code Lutin) + */ +public class SaveAndOpenReplyAllFormAction extends SaveAndOpenModalFrameAction<ReplyFormUI> { + + public SaveAndOpenReplyAllFormAction(DemandesUIHandler handler) { + super(handler); + setTakeIfNotTaken(true); + } + + @Override + public String getTitle() { + return t("faxtomail.reply.title", getModel().getTitle()); + } + + @Override + public Dimension getDimension() { + return new Dimension(800, 600); + } + + @Override + public void doAction() throws Exception { + super.doAction(); + + frameContent = new ReplyFormUI(getUI()); + ReplyFormUIModel model = frameContent.getModel(); + DemandeUIModel currentDemand = getModel(); + + SigningForDomain signingForDomain = null; + if (!currentDemand.isFax() && currentDemand.getRecipient() != null) { + try(FaxToMailServiceContext serviceContext = getContext().newServiceContext()) { + signingForDomain = serviceContext.getConfigurationService().getSigningForEmailAddress(currentDemand.getRecipient()).orNull(); + } + } + model.setSigning(signingForDomain); + model.setForward(false); + model.setOriginalDemand(currentDemand); + + String sender = JAXXUtil.getStringValue(currentDemand.getSender()); + if (currentDemand.isFax()) { + MailFolder folder = currentDemand.getMailFolder(); + + sender = FaxToMailServiceUtils.addFaxDomainToFaxNumber(sender, folder); + + String from = FaxToMailServiceUtils.addFaxDomainToFaxNumber(FaxToMailServiceUtils.getFaxFromNumber(folder), folder); + model.setFrom(from); + } + model.setTo(sender); + model.setCc(currentDemand.getCcRecipients()); + frameContent.getHandler().addReferences(); + } +} diff --git a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties index 30e3f209..d63c654a 100644 --- a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties +++ b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties @@ -152,6 +152,7 @@ faxtomail.demande.receptionDate.label=Date de réception faxtomail.demande.recipient.label=Destinataire faxtomail.demande.repliedBy.label=Réponse par faxtomail.demande.reply.button.label=Répondre +faxtomail.demande.replyAll.button.label=Répondre à tous faxtomail.demande.save.button.label=Enregistrer faxtomail.demande.sender.label=Émetteur faxtomail.demande.sender.manualCreation=Création manuelle @@ -174,6 +175,8 @@ faxtomail.demandeList.action.print=Imprimer faxtomail.demandeList.action.print.tip=Imprimer faxtomail.demandeList.action.reply=Répondre faxtomail.demandeList.action.reply.tip=Répondre +faxtomail.demandeList.action.replyAll=Répondre à tous +faxtomail.demandeList.action.replyAll.tip=Répondre à tous faxtomail.demandeList.action.takenBy=Pris par faxtomail.demandeList.action.takenBy.tip=Modifier la personne prenant l'élément faxtomail.demandeList.action.transmit=Déplacer -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.