branch develop updated (0703d50 -> bd0dddd)
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 0703d50 fixes #9098 Colonne "Pris par" : n'afficher que le tryptique (gain de place) new 6ea48a1 refs #9103 ajout de la conf pour afficher ou non les boutons repondre et transférer dans les dossiers new 27d6a5a refs #9103 gestion de la conf de répondre et transférer dans la partie admin new 39ab5e9 refs #9103 prise en compte de la conf des fonctions répondre et transférer dans la partie cliente new bd0dddd fixes #9103 Ajouter une fonction transférer, pour transférer une demande avec toutes les pièces jointes qui ne sont pas dans "Divers" The 4 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 bd0dddd7babaa1c5e34e815cf7ca8696da88ed56 Merge: 0703d50 39ab5e9 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:09:45 2017 +0200 fixes #9103 Ajouter une fonction transférer, pour transférer une demande avec toutes les pièces jointes qui ne sont pas dans "Divers" commit 39ab5e9dcfc3a010664281bc73c21764e5df44e8 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:09:18 2017 +0200 refs #9103 prise en compte de la conf des fonctions répondre et transférer dans la partie cliente commit 27d6a5aaa1d782b41b2f6742ebcf359bc87553ef Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:08:19 2017 +0200 refs #9103 gestion de la conf de répondre et transférer dans la partie admin commit 6ea48a1b20339edc842a1d6a036f72cc5e9492b1 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:07:22 2017 +0200 refs #9103 ajout de la conf pour afficher ou non les boutons repondre et transférer dans les dossiers Summary of changes: .../faxtomail/persistence/entities/MailAction.java | 1 + faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 35759 -> 35847 bytes .../h2/V2_4_170328_2__add_show_actions_config.sql | 5 ++ .../V2_4_170328_2__add_show_actions_config.sql | 7 +++ .../ui/swing/content/demande/DemandeListUI.css | 10 ++++ .../ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../content/demande/DemandeListUIHandler.java | 24 +++++++-- .../swing/content/demande/DemandeListUIModel.java | 39 ++++++++++++++ .../ui/swing/content/demande/DemandesUI.css | 8 +++ .../ui/swing/content/demande/DemandesUI.jaxx | 38 +++++++++---- .../swing/content/demande/DemandesUIHandler.java | 30 ++++++++++- .../ui/swing/content/demande/DemandesUIModel.java | 36 +++++++++++++ ...yFormAction.java => OpenForwardFormAction.java} | 17 ++---- .../demande/actions/OpenReplyFormAction.java | 1 + ...tion.java => SaveAndOpenForwardFormAction.java} | 17 ++---- .../actions/SaveAndOpenReplyFormAction.java | 2 +- .../demande/replies/DemandRepliesUIHandler.java | 1 + .../demande/replies/actions/OpenReplyAction.java | 5 +- .../ui/swing/content/reply/ReplyFormUI.css | 10 ++-- .../ui/swing/content/reply/ReplyFormUI.jaxx | 33 ++++++------ .../ui/swing/content/reply/ReplyFormUIHandler.java | 59 ++++++++++++++++----- .../ui/swing/content/reply/ReplyFormUIModel.java | 12 +++++ .../ui/swing/util/AbstractFaxToMailUIHandler.java | 5 +- .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 ++ .../i18n/faxtomail-ui-web_fr_FR.properties | 1 + .../WEB-INF/content/admin/configuration-input.jsp | 39 +++++++++++++- .../src/main/webapp/js/configuration.js | 8 +++ 27 files changed, 326 insertions(+), 87 deletions(-) create mode 100644 faxtomail-service/src/main/resources/db/migration/h2/V2_4_170328_2__add_show_actions_config.sql create mode 100644 faxtomail-service/src/main/resources/db/migration/sqlserver/V2_4_170328_2__add_show_actions_config.sql copy faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/{OpenReplyFormAction.java => OpenForwardFormAction.java} (83%) copy faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/{SaveAndOpenReplyFormAction.java => SaveAndOpenForwardFormAction.java} (77%) -- 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 6ea48a1b20339edc842a1d6a036f72cc5e9492b1 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:07:22 2017 +0200 refs #9103 ajout de la conf pour afficher ou non les boutons repondre et transférer dans les dossiers --- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 35759 -> 35847 bytes .../h2/V2_4_170328_2__add_show_actions_config.sql | 5 +++++ .../V2_4_170328_2__add_show_actions_config.sql | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/faxtomail-persistence/src/main/xmi/faxtomail.zargo b/faxtomail-persistence/src/main/xmi/faxtomail.zargo index 07e6ab9..bfdfe59 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/resources/db/migration/h2/V2_4_170328_2__add_show_actions_config.sql b/faxtomail-service/src/main/resources/db/migration/h2/V2_4_170328_2__add_show_actions_config.sql new file mode 100644 index 0000000..171aa36 --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/h2/V2_4_170328_2__add_show_actions_config.sql @@ -0,0 +1,5 @@ +-- add showReplyAction and showForwardAction + +alter table mailfolder add showReplyAction boolean; +alter table mailfolder add showForwardAction boolean; +update mailfolder set showReplyAction = 't', showForwardAction = 'f' where parent is null; \ No newline at end of file diff --git a/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_4_170328_2__add_show_actions_config.sql b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_4_170328_2__add_show_actions_config.sql new file mode 100644 index 0000000..72e64f5 --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_4_170328_2__add_show_actions_config.sql @@ -0,0 +1,7 @@ +-- add showReplyAction and showForwardAction + +alter table mailfolder add showReplyAction bit; +alter table mailfolder add showForwardAction bit; +GO +update mailfolder set showReplyAction = 1, showForwardAction = 0 where parent is null; +GO \ No newline at end of file -- 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 27d6a5aaa1d782b41b2f6742ebcf359bc87553ef Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:08:19 2017 +0200 refs #9103 gestion de la conf de répondre et transférer dans la partie admin --- .../faxtomail/persistence/entities/MailAction.java | 1 + .../i18n/faxtomail-ui-web_fr_FR.properties | 1 + .../WEB-INF/content/admin/configuration-input.jsp | 39 +++++++++++++++++++++- .../src/main/webapp/js/configuration.js | 8 +++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java index cb68e59..a6bfc54 100644 --- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java +++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java @@ -33,5 +33,6 @@ public enum MailAction { PRINT, ARCHIVE, REPLY, + FORWARD, GROUP } diff --git a/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties b/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties index 8c4b9d5..a603050 100644 --- a/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties +++ b/faxtomail-ui-web/src/main/resources/i18n/faxtomail-ui-web_fr_FR.properties @@ -1,6 +1,7 @@ com.franciaflex.faxtomail.persistence.entities.FolderAction.COMPUTE_RANGE=Calculer les quantités par gamme com.franciaflex.faxtomail.persistence.entities.FolderAction.NEW_DEMANDE=Créer une nouvelle demande com.franciaflex.faxtomail.persistence.entities.MailAction.ARCHIVE=Archiver +com.franciaflex.faxtomail.persistence.entities.MailAction.FORWARD=Transférer com.franciaflex.faxtomail.persistence.entities.MailAction.GROUP=Grouper com.franciaflex.faxtomail.persistence.entities.MailAction.PRINT=Imprimer com.franciaflex.faxtomail.persistence.entities.MailAction.REPLY=Repondre 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 bb07e73..e25d755 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 @@ -584,7 +584,7 @@ </div> <div class="form-group"> - <label class="control-label">Afficher les les sous-totaux par état dans la fenêtre de calcul des quantités par gamme ?</label><br /> + <label class="control-label">Afficher les sous-totaux par état dans la fenêtre de calcul des quantités par gamme ?</label><br /> <label class="radio-inline"> <input type="radio" ng-model="selectedMailFolder.computeQuantitiesSubtotalsByState" ng-value="true"> oui @@ -600,6 +600,43 @@ </label> </div> + <hr /> + + <div class="form-group"> + <label class="control-label">Activer la fonction "Répondre" sur les éléments ?</label><br /> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.showReplyAction" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.showReplyAction" ng-value="false"> non + </label> + <label class="radio-inline" ng-if="selectedMailFolder.$parent"> + <input type="radio" + ng-model="selectedMailFolder.showReplyAction" ng-value="undefined"> hériter du dossier parent + ({{parentScopeValues.showReplyAction ? 'Oui' : 'Non'}}) + </label> + </div> + <div class="form-group"> + <label class="control-label">Afficher la fonction "Transférer" sur les éléments ?</label><br /> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.showForwardAction" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.showForwardAction" ng-value="false"> non + </label> + <label class="radio-inline" ng-if="selectedMailFolder.$parent"> + <input type="radio" + ng-model="selectedMailFolder.showForwardAction" ng-value="undefined"> hériter du dossier parent + ({{parentScopeValues.showForwardAction ? 'Oui' : 'Non'}}) + </label> + </div> + + <hr /> + <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 c9b9309..4d894e5 100644 --- a/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -785,6 +785,8 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo $scope.selectedMailFolder.mustTakeToEditDemand = $scope.selectedMailFolder.mustTakeToEditDemand || false; $scope.selectedMailFolder.displayHelpOnMessages = $scope.selectedMailFolder.displayHelpOnMessages || false; $scope.selectedMailFolder.computeQuantitiesSubtotalsByState = $scope.selectedMailFolder.computeQuantitiesSubtotalsByState || false; + $scope.selectedMailFolder.showReplyAction = $scope.selectedMailFolder.showReplyAction || false; + $scope.selectedMailFolder.showForwardAction = $scope.selectedMailFolder.showForwardAction || false; $scope.selectedMailFolder.ediTransfer = $scope.selectedMailFolder.ediTransfer || false; $scope.selectedMailFolder.displayOnlyUserTrigraphInTables = $scope.selectedMailFolder.displayOnlyUserTrigraphInTables || false; } @@ -891,6 +893,12 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo if (angular.isUndefined($scope.parentScopeValues.computeQuantitiesSubtotalsByState)) { $scope.parentScopeValues.computeQuantitiesSubtotalsByState = folder.computeQuantitiesSubtotalsByState; } + if (angular.isUndefined($scope.parentScopeValues.showReplyAction)) { + $scope.parentScopeValues.showReplyAction = folder.showReplyAction; + } + if (angular.isUndefined($scope.parentScopeValues.showForwardAction)) { + $scope.parentScopeValues.showForwardAction = folder.showForwardAction; + } 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>.
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 39ab5e9dcfc3a010664281bc73c21764e5df44e8 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:09:18 2017 +0200 refs #9103 prise en compte de la conf des fonctions répondre et transférer dans la partie cliente --- .../ui/swing/content/demande/DemandeListUI.css | 10 ++++ .../ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../content/demande/DemandeListUIHandler.java | 24 +++++++-- .../swing/content/demande/DemandeListUIModel.java | 39 ++++++++++++++ .../ui/swing/content/demande/DemandesUI.css | 8 +++ .../ui/swing/content/demande/DemandesUI.jaxx | 38 ++++++++++---- .../swing/content/demande/DemandesUIHandler.java | 30 ++++++++++- .../ui/swing/content/demande/DemandesUIModel.java | 36 +++++++++++++ ...yFormAction.java => OpenForwardFormAction.java} | 17 ++----- .../demande/actions/OpenReplyFormAction.java | 1 + ...tion.java => SaveAndOpenForwardFormAction.java} | 17 ++----- .../actions/SaveAndOpenReplyFormAction.java | 2 +- .../demande/replies/DemandRepliesUIHandler.java | 1 + .../demande/replies/actions/OpenReplyAction.java | 5 +- .../ui/swing/content/reply/ReplyFormUI.css | 10 ++-- .../ui/swing/content/reply/ReplyFormUI.jaxx | 33 ++++++------ .../ui/swing/content/reply/ReplyFormUIHandler.java | 59 +++++++++++++++++----- .../ui/swing/content/reply/ReplyFormUIModel.java | 12 +++++ .../ui/swing/util/AbstractFaxToMailUIHandler.java | 5 +- .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 ++ 20 files changed, 266 insertions(+), 86 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 d32c873..12cb824 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 @@ -104,10 +104,20 @@ actionIcon: reply; text: "faxtomail.demandeList.action.reply"; toolTipText: "faxtomail.demandeList.action.reply.tip"; + visible: { model.isReplyActivated() }; enabled: { model.isReplyEnabled() }; _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenReplyFormAction.class }; } +#forwardMenu { + actionIcon: reply; + text: "faxtomail.demandeList.action.forward"; + toolTipText: "faxtomail.demandeList.action.forward.tip"; + visible: { model.isForwardActivated() }; + enabled: { model.isForwardEnabled() }; + _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenForwardFormAction.class }; +} + #archiveMenu { actionIcon: archive; text: "faxtomail.demandeList.action.archive"; 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 de31984..b289a82 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='forwardMenu'/> <JMenuItem id='archiveMenu'/> <JMenuItem id='moveMenu'/> </JPopupMenu> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java index ce69130..6c29f64 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java @@ -320,6 +320,20 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem getContext().setCurrentMailFolder(folder); loadFolderDemands(nodesByFolder); + MailFolder folderWithShowReplyAction = folder; + while (folderWithShowReplyAction.getParent() != null + && folderWithShowReplyAction.getShowReplyAction() == null) { + folderWithShowReplyAction = folderWithShowReplyAction.getParent(); + } + getModel().setReplyActivated(Boolean.TRUE.equals(folderWithShowReplyAction.getShowReplyAction())); + + MailFolder folderWithShowForwardAction = folder; + while (folderWithShowForwardAction.getParent() != null + && folderWithShowForwardAction.getShowForwardAction() == null) { + folderWithShowForwardAction = folderWithShowForwardAction.getParent(); + } + getModel().setForwardActivated(Boolean.TRUE.equals(folderWithShowForwardAction.getShowForwardAction())); + DefaultMutableTreeNode node = nodesByFolder.get(folder); if (node != null) { navigationTree.setSelectionPath(new TreePath(node.getPath())); @@ -503,11 +517,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem if (log.isErrorEnabled()) { log.error("error while introspecting emailfilter for property " + property, e); } - } catch (InvocationTargetException e) { - if (log.isErrorEnabled()) { - log.error("error while calling getter for property " + property, e); - } - } catch (IllegalAccessException e) { + } catch (InvocationTargetException | IllegalAccessException e) { if (log.isErrorEnabled()) { log.error("error while calling getter for property " + property, e); } @@ -712,6 +722,10 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem && model.getSelectedEmails().get(0).isEditable() && isActionEnabled(model.getSelectedEmails().get(0), MailAction.REPLY)); + model.setForwardEnabled(selectedRowCount == 1 + && model.getSelectedEmails().get(0).isEditable() + && isActionEnabled(model.getSelectedEmails().get(0), MailAction.FORWARD)); + model.setArchiveEnabled(selectedRowCount > 0); model.setTransmitEnabled(selectedRowCount > 0); model.setPrintEnabled(selectedRowCount > 0); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java index 2fdac33..d61d6e4 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java @@ -48,7 +48,10 @@ public class DemandeListUIModel extends AbstractSerializableBean { public static final String PROPERTY_QUOTATION_NB = "quotationNb"; public static final String PROPERTY_PF_NB = "pfNb"; public static final String PROPERTY_SAV_NB = "savNb"; + public static final String PROPERTY_REPLY_ACTIVATED = "replyActivated"; public static final String PROPERTY_REPLY_ENABLED = "replyEnabled"; + public static final String PROPERTY_FORWARD_ACTIVATED = "forwardActivated"; + public static final String PROPERTY_FORWARD_ENABLED = "forwardEnabled"; public static final String PROPERTY_ARCHIVE_ENABLED = "archiveEnabled"; public static final String PROPERTY_TRANSMIT_ENABLED = "transmitEnabled"; public static final String PROPERTY_PRINT_ENABLED = "printEnabled"; @@ -76,8 +79,14 @@ public class DemandeListUIModel extends AbstractSerializableBean { protected MailFolder selectedFolder; + protected boolean replyActivated; + protected boolean replyEnabled; + protected boolean forwardActivated; + + protected boolean forwardEnabled; + protected boolean archiveEnabled; protected boolean transmitEnabled; @@ -202,6 +211,16 @@ public class DemandeListUIModel extends AbstractSerializableBean { firePropertyChange(PROPERTY_SELECTED_FOLDER, oldValue, selectedFolder); } + public boolean isReplyActivated() { + return replyActivated; + } + + public void setReplyActivated(boolean replyActivated) { + Object oldValue = isReplyActivated(); + this.replyActivated = replyActivated; + firePropertyChange(PROPERTY_REPLY_ACTIVATED, oldValue, replyActivated); + } + public boolean isReplyEnabled() { return replyEnabled; } @@ -212,6 +231,26 @@ public class DemandeListUIModel extends AbstractSerializableBean { firePropertyChange(PROPERTY_REPLY_ENABLED, oldValue, replyEnabled); } + public boolean isForwardActivated() { + return forwardActivated; + } + + public void setForwardActivated(boolean forwardActivated) { + Object oldValue = isForwardActivated(); + this.forwardActivated = forwardActivated; + firePropertyChange(PROPERTY_FORWARD_ACTIVATED, oldValue, forwardActivated); + } + + public boolean isForwardEnabled() { + return forwardEnabled; + } + + public void setForwardEnabled(boolean forwardEnabled) { + Object oldValue = isForwardEnabled(); + this.forwardEnabled = forwardEnabled; + firePropertyChange(PROPERTY_FORWARD_ENABLED, oldValue, forwardEnabled); + } + public boolean isArchiveEnabled() { return archiveEnabled; } 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 317e2e0..79b2ef1 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 @@ -65,9 +65,17 @@ #replyButton { text: "faxtomail.demande.reply.button.label"; actionIcon: reply; + visible: { model.isReplyActivated() }; enabled: { model.isReplyEnabled() }; } +#forwardButton { + text: "faxtomail.demande.forward.button.label"; + actionIcon: reply; + visible: { model.isForwardActivated() }; + enabled: { model.isForwardEnabled() }; +} + #groupButton { text: "faxtomail.demande.group.button.label"; actionIcon: group; 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 3cefae5..d67eff1 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 @@ -64,16 +64,34 @@ <!--</tab>--> </JTabbedPane> - <JPanel layout='{new GridLayout(1,0)}' - constraints='BorderLayout.SOUTH'> - <JButton id="backButton" onActionPerformed="handler.closeFrame()"/> - <JButton id="saveButton" onActionPerformed="handler.save()"/> - <JButton id="transmitButton" onActionPerformed="handler.transmitDemande()"/> - <JButton id="printButton" onActionPerformed="handler.print()"/> - <JButton id="archiveButton" onActionPerformed="handler.archive()"/> - <JButton id="replyButton" onActionPerformed="handler.reply()"/> - <JButton id="groupButton" onActionPerformed="handler.group()"/> - </JPanel> + <Table constraints='BorderLayout.SOUTH' fill="both" insets="0"> + <row> + <cell weightx="1" insets="0"> + <JButton id="backButton" onActionPerformed="handler.closeFrame()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="saveButton" onActionPerformed="handler.save()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="transmitButton" onActionPerformed="handler.transmitDemande()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="printButton" onActionPerformed="handler.print()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="archiveButton" onActionPerformed="handler.archive()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="replyButton" onActionPerformed="handler.reply()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="forwardButton" onActionPerformed="handler.forward()"/> + </cell> + <cell weightx="1" insets="0"> + <JButton id="groupButton" onActionPerformed="handler.group()"/> + </cell> + </row> + </Table> </JPanel> 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 e987300..7b037a8 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 @@ -27,8 +27,10 @@ package com.franciaflex.faxtomail.ui.swing.content.demande; import com.franciaflex.faxtomail.persistence.entities.Configuration; 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.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; @@ -46,8 +48,10 @@ import org.nuiton.jaxx.application.swing.tab.TabContentModel; import org.nuiton.jaxx.application.swing.tab.TabHandler; import org.nuiton.jaxx.application.swing.util.CloseableUI; -import javax.swing.*; -import java.awt.*; +import javax.swing.DefaultSingleSelectionModel; +import javax.swing.JComponent; +import javax.swing.JTabbedPane; +import java.awt.Component; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -179,8 +183,25 @@ public class DemandesUIHandler extends AbstractFaxToMailUIHandler<DemandesUIMode boolean printEnabled = isActionEnabled(model, MailAction.PRINT); getModel().setPrintEnabled(printEnabled); + MailFolder folderWithShowReplyAction = model.getMailFolder(); + while (folderWithShowReplyAction.getParent() != null + && folderWithShowReplyAction.getShowReplyAction() == null) { + folderWithShowReplyAction = folderWithShowReplyAction.getParent(); + } + getModel().setReplyActivated(Boolean.TRUE.equals(folderWithShowReplyAction.getShowReplyAction())); + boolean replyEnabled = (editable || archived) && isActionEnabled(model, MailAction.REPLY); getModel().setReplyEnabled(replyEnabled); + + MailFolder folderWithShowForwardAction = model.getMailFolder(); + while (folderWithShowForwardAction.getParent() != null + && folderWithShowForwardAction.getShowForwardAction() == null) { + folderWithShowForwardAction = folderWithShowForwardAction.getParent(); + } + getModel().setForwardActivated(Boolean.TRUE.equals(folderWithShowForwardAction.getShowForwardAction())); + + boolean forwardEnabled = (editable || archived) && isActionEnabled(model, MailAction.FORWARD); + getModel().setForwardEnabled(forwardEnabled); } @Override @@ -373,6 +394,11 @@ public class DemandesUIHandler extends AbstractFaxToMailUIHandler<DemandesUIMode runAction(SaveAndOpenReplyFormAction.class); } + public void forward() { + closeButtonPopups(); + runAction(SaveAndOpenForwardFormAction.class); + } + public void group() { closeButtonPopups(); runAction(SaveAndOpenSearchToGroupAction.class); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java index 9f7cf6b..48f38d0 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIModel.java @@ -40,13 +40,19 @@ public class DemandesUIModel extends AbstractBean { public static final String PROPERTY_ARCHIVE_ENABLED = "archiveEnabled"; public static final String PROPERTY_GROUP_ENABLED = "groupEnabled"; public static final String PROPERTY_PRINT_ENABLED = "printEnabled"; + public static final String PROPERTY_REPLY_ACTIVATED = "replyActivated"; public static final String PROPERTY_REPLY_ENABLED = "replyEnabled"; + public static final String PROPERTY_FORWARD_ACTIVATED = "forwardActivated"; + public static final String PROPERTY_FORWARD_ENABLED = "forwardEnabled"; protected boolean transmitEnabled; protected boolean archiveEnabled; protected boolean groupEnabled; protected boolean printEnabled; + protected boolean replyActivated; protected boolean replyEnabled; + protected boolean forwardActivated; + protected boolean forwardEnabled; protected List<DemandeUIModel> demands = new ArrayList<DemandeUIModel>(); @@ -94,6 +100,16 @@ public class DemandesUIModel extends AbstractBean { firePropertyChange(PROPERTY_PRINT_ENABLED, oldValue, printEnabled); } + public boolean isReplyActivated() { + return replyActivated; + } + + public void setReplyActivated(boolean replyActivated) { + Object oldValue = isReplyActivated(); + this.replyActivated = replyActivated; + firePropertyChange(PROPERTY_REPLY_ACTIVATED, oldValue, replyActivated); + } + public boolean isReplyEnabled() { return replyEnabled; } @@ -104,6 +120,26 @@ public class DemandesUIModel extends AbstractBean { firePropertyChange(PROPERTY_REPLY_ENABLED, oldValue, replyEnabled); } + public boolean isForwardActivated() { + return forwardActivated; + } + + public void setForwardActivated(boolean forwardActivated) { + Object oldValue = isForwardActivated(); + this.forwardActivated = forwardActivated; + firePropertyChange(PROPERTY_FORWARD_ACTIVATED, oldValue, forwardActivated); + } + + public boolean isForwardEnabled() { + return forwardEnabled; + } + + public void setForwardEnabled(boolean forwardEnabled) { + Object oldValue = isForwardEnabled(); + this.forwardEnabled = forwardEnabled; + firePropertyChange(PROPERTY_FORWARD_ENABLED, oldValue, forwardEnabled); + } + protected List<DemandeUIModel> getDemands() { return demands; } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenForwardFormAction.java similarity index 83% copy from faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java copy to faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenForwardFormAction.java index 545029b..bee286d 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenForwardFormAction.java @@ -25,10 +25,8 @@ package com.franciaflex.faxtomail.ui.swing.content.demande.actions; */ 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; @@ -37,7 +35,6 @@ 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.JFrame; @@ -52,12 +49,12 @@ import static org.nuiton.i18n.I18n.t; * @author Kevin Morin (Code Lutin) * @since 1.1 */ -public class OpenReplyFormAction extends AbstractFaxToMailAction<DemandeListUIModel, DemandeListUI, DemandeListUIHandler> { +public class OpenForwardFormAction extends AbstractFaxToMailAction<DemandeListUIModel, DemandeListUI, DemandeListUIHandler> { protected ReplyFormUI frameContent; protected JFrame frame; - public OpenReplyFormAction(DemandeListUIHandler handler) { + public OpenForwardFormAction(DemandeListUIHandler handler) { super(handler, false); } @@ -81,14 +78,8 @@ public class OpenReplyFormAction extends AbstractFaxToMailAction<DemandeListUIMo } model.setSigning(signingForDomain); + model.setForward(true); model.setOriginalDemand(demand); - - String sender = JAXXUtil.getStringValue(demand.getSender()); - if (demand.isFax()) { - MailFolder selectedFolder = getModel().getSelectedFolder(); - sender = FaxToMailServiceUtils.addFaxDomainToFaxNumber(sender, selectedFolder); - } - model.setTo(sender); } } @@ -96,7 +87,7 @@ public class OpenReplyFormAction extends AbstractFaxToMailAction<DemandeListUIMo public void postSuccessAction() { super.postSuccessAction(); frame = getHandler().openModalFrame(frameContent, - t("faxtomail.reply.title", getContext().getCurrentEmail().getTitle()), + t("faxtomail.reply.forwardsubject", getContext().getCurrentEmail().getSubject()), new Dimension(800, 600)); getContext().addPropertyChangeListener(FaxToMailUIContext.PROPERTY_BUSY, new PropertyChangeListener() { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java index 545029b..2248e6a 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenReplyFormAction.java @@ -81,6 +81,7 @@ public class OpenReplyFormAction extends AbstractFaxToMailAction<DemandeListUIMo } model.setSigning(signingForDomain); + model.setForward(false); model.setOriginalDemand(demand); String sender = JAXXUtil.getStringValue(demand.getSender()); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenForwardFormAction.java similarity index 77% copy from faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java copy to faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenForwardFormAction.java index 13d52b4..4bb7334 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenForwardFormAction.java @@ -25,12 +25,10 @@ package com.franciaflex.faxtomail.ui.swing.content.demande.actions; */ import com.franciaflex.faxtomail.persistence.entities.SigningForDomain; -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.Dimension; @@ -39,16 +37,15 @@ import static org.nuiton.i18n.I18n.t; /** * @author Kevin Morin (Code Lutin) */ -public class SaveAndOpenReplyFormAction extends SaveAndOpenModalFrameAction<ReplyFormUI> { +public class SaveAndOpenForwardFormAction extends SaveAndOpenModalFrameAction<ReplyFormUI> { - public SaveAndOpenReplyFormAction(DemandesUIHandler handler) { + public SaveAndOpenForwardFormAction(DemandesUIHandler handler) { super(handler); - setTakeIfNotTaken(true); } @Override public String getTitle() { - return t("faxtomail.reply.title", getModel().getTitle()); + return t("faxtomail.reply.titleForward", getModel().getTitle()); } @Override @@ -69,13 +66,7 @@ public class SaveAndOpenReplyFormAction extends SaveAndOpenModalFrameAction<Repl signingForDomain = getContext().newServiceContext().getConfigurationService().getSigningForEmailAddress(currentDemand.getRecipient()).orNull(); } model.setSigning(signingForDomain); - + model.setForward(true); model.setOriginalDemand(currentDemand); - - String sender = JAXXUtil.getStringValue(currentDemand.getSender()); - if (currentDemand.isFax()) { - sender = FaxToMailServiceUtils.addFaxDomainToFaxNumber(sender, currentDemand.getMailFolder()); - } - model.setTo(sender); } } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java index 13d52b4..4af49bd 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/SaveAndOpenReplyFormAction.java @@ -69,7 +69,7 @@ public class SaveAndOpenReplyFormAction extends SaveAndOpenModalFrameAction<Repl signingForDomain = getContext().newServiceContext().getConfigurationService().getSigningForEmailAddress(currentDemand.getRecipient()).orNull(); } model.setSigning(signingForDomain); - + model.setForward(false); model.setOriginalDemand(currentDemand); String sender = JAXXUtil.getStringValue(currentDemand.getSender()); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java index 7512e4d..f4b456d 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/DemandRepliesUIHandler.java @@ -208,6 +208,7 @@ public class DemandRepliesUIHandler extends AbstractToolbarPopupHandler<DemandeU MimeMessage message = MimeMessageUtils.createMimeMessage(null, replyContent.getSource()); ReplyFormUIModel replyModel = dialogContent.getModel(); replyModel.setEditable(editable); + replyModel.setForward(true); replyModel.setOriginalDemand(ui.getModel()); replyModel.setReadSentDate(reply.getSentDate()); replyModel.setSubject(t("faxtomail.reply.forwardsubject", message.getSubject())); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/actions/OpenReplyAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/actions/OpenReplyAction.java index db85c6d..375ce18 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/actions/OpenReplyAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/replies/actions/OpenReplyAction.java @@ -43,11 +43,11 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.mail.util.MimeMessageUtils; import javax.mail.internet.MimeMessage; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; import javax.swing.JFrame; import javax.swing.SwingUtilities; import java.awt.Dimension; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import static org.nuiton.i18n.I18n.t; @@ -87,6 +87,7 @@ public class OpenReplyAction extends AbstractFaxToMailAction<DemandeUIModel, Dem MimeMessage message = MimeMessageUtils.createMimeMessage(null, replyContent.getSource()); ReplyFormUIModel replyModel = frameContent.getModel(); replyModel.setEditable(editable); + replyModel.setForward(false); replyModel.setOriginalDemand(demand); replyModel.setReadonly(true); replyModel.setReadSentDate(reply.getSentDate()); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css index e813e30..cd8207a 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css @@ -156,27 +156,25 @@ enabled: { addAttachmentFile.getSelectedItem() != null }; } -#buttonPanelLayout { - selected: { String.valueOf(model.isReadonly()) }; -} - #forwardButton { actionIcon: transmit; text: "faxtomail.reply.action.forward"; toolTipText: "faxtomail.reply.action.forward.tip"; - visible: { getModel().isEditable() }; + visible: { model.isReadonly() && model.isEditable() }; } #closeButton { actionIcon: cancel; text: "faxtomail.reply.action.close"; toolTipText: "faxtomail.reply.action.close.tip"; + visible: {model.isReadonly()}; } #cancelButton { actionIcon: cancel; text: "faxtomail.reply.action.cancel"; toolTipText: "faxtomail.reply.action.cancel.tip"; + visible: {!model.isReadonly()}; } #validateButton { @@ -184,7 +182,7 @@ text: "faxtomail.reply.action.validate"; toolTipText: "faxtomail.reply.action.validate.tip"; _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.reply.actions.ReplyAction.class }; - + visible: {!model.isReadonly()}; /* FIXME echatellier 20140715 : ca doit pas se faire comme ca, mais pas trop d'idée */ enabled: { getModel().isValid() && getModel().isAttachmentSizeValid(getModel().getTotalAttachmentLength()) }; } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx index 66b2e4e..ce61164 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.jaxx @@ -61,9 +61,6 @@ <CardLayout2Ext id='fromPanelLayout' constructorParams='this, "fromPanel"'/> - <CardLayout2Ext id='buttonPanelLayout' - constructorParams='this, "buttonPanel"'/> - <Table constraints='BorderLayout.NORTH' fill='both'> <row> @@ -185,19 +182,23 @@ </JPanel> </JSplitPane> - <JPanel id="buttonPanel" - layout="{ buttonPanelLayout }" + <Table id="buttonPanel" + fill="both" insets="0" constraints='BorderLayout.SOUTH'> - <JPanel constraints='"true"' - layout='{new GridLayout(1, 0)}'> - <JButton id='forwardButton' onActionPerformed='handler.forward()'/> - <JButton id='closeButton' onActionPerformed='handler.cancel()'/> - </JPanel> - <JPanel constraints='"false"' - layout='{new GridLayout(1, 0)}'> - <JButton id='cancelButton' onActionPerformed='handler.cancel()'/> - <JButton id='validateButton'/> - </JPanel> - </JPanel> + <row> + <cell insets="0" weightx="1"> + <JButton id='forwardButton' onActionPerformed='handler.forward()'/> + </cell> + <cell insets="0" weightx="1"> + <JButton id='closeButton' onActionPerformed='handler.cancel()'/> + </cell> + <cell insets="0" weightx="1"> + <JButton id='cancelButton' onActionPerformed='handler.cancel()'/> + </cell> + <cell insets="0" weightx="1"> + <JButton id='validateButton'/> + </cell> + </row> + </Table> </JPanel> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java index 17d1066..4cb69d9 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIHandler.java @@ -139,25 +139,44 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo for (Attachment attachment : demandeUIModel.getAttachment()) { ReplyAttachmentModel replyOriginalAttachmentModel = - new ReplyAttachmentModel(attachment, true, prefix + attachment.getOriginalFileName()); + new ReplyAttachmentModel(attachment, true, prefix + " - " + attachment.getOriginalFileName()); model.addAvailableAttachment(replyOriginalAttachmentModel); if (!Strings.isNullOrEmpty(attachment.getEditedFileName())) { ReplyAttachmentModel replyEditedAttachmentModel = - new ReplyAttachmentModel(attachment, false, prefix + attachment.getEditedFileName()); - model.addAvailableAttachment(replyEditedAttachmentModel); + new ReplyAttachmentModel(attachment, false, prefix + " - " + attachment.getEditedFileName()); + + if (addAttchmentToReply(demand, model, demandeUIModel, attachment)) { + model.addAttachment(replyEditedAttachmentModel); + addAttachmentToReplyAction.setReplyAttachmentModel(replyEditedAttachmentModel); + getContext().getActionEngine().runInternalAction(addAttachmentToReplyAction); + } else { + model.addAvailableAttachment(replyEditedAttachmentModel); + } + + } else if (addAttchmentToReply(demand, model, demandeUIModel, attachment)){ + model.addAttachment(replyOriginalAttachmentModel); + model.removeAvailableAttachment(replyOriginalAttachmentModel); + addAttachmentToReplyAction.setReplyAttachmentModel(replyOriginalAttachmentModel); + getContext().getActionEngine().runInternalAction(addAttachmentToReplyAction); } } } - model.setSubject(t("faxtomail.reply.subject", demand.getSubject())); + String subject; + if (model.isForward()) { + subject = t("faxtomail.reply.forwardsubject", demand.getSubject()); + } else { + subject = t("faxtomail.reply.subject", demand.getSubject()); + } + model.setSubject(subject); String recipient = demand.getRecipient(); String signing; // this have to be disable for read only mode (useless) if (!model.isReadonly()) { - + // attachment combo JComboBox<AttachmentFile> addAttachmentFile = ui.getAddAttachmentFile(); addAttachmentFile.setModel(SwingUtil.newComboModel(model.getAvailableAttachments().toArray())); @@ -166,13 +185,10 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo // sender combo MailFolder folder = demand.getMailFolder(); List<String> folderReplyAdresses = new ArrayList<>(); -// List<String> folderReplyDomains = new ArrayList<>(); while (folder != null) { folderReplyAdresses.addAll(folder.getReplyAddresses()); -// folderReplyDomains.addAll(folder.getReplyDomains()); folder = folder.getParent(); } -// model.setSenderAllowedDomains(folderReplyDomains); List<String> replyToAddresses = Lists.newArrayList(); String selectedItem = null; @@ -181,9 +197,7 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo model.setFrom(recipient); selectedItem = recipient; } - if (folderReplyAdresses != null) { - replyToAddresses.addAll(folderReplyAdresses); - } + replyToAddresses.addAll(folderReplyAdresses); Collections.sort(replyToAddresses); ui.getFromComboBox().setBeanType(String.class); @@ -195,7 +209,7 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo initBeanFilterableComboBox(ui.getContactField(), getContext().getContactCache(), null); // signatures - signing = getSigningParagraph(createSigning(recipient)); + signing = getSigningParagraph(createSigning(model.getFrom())); } else { model.setFrom(recipient); @@ -205,7 +219,18 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo String plainContent = StringUtils.join(demand.getPlainContent(), CONTENT_SEPARATOR); String quotedText = plainContent != null ? plainContent.replaceAll("\n", "<br/> ") : ""; - String quotedReply = FaxToMailUIUtil.getQuotedReplyContent(signing, decorate(demand.getReceptionDate()), demand.getSender(), quotedText); + String quotedReply; + if (model.isForward()) { + quotedReply = FaxToMailUIUtil.getQuotedForwardContent(signing, + demand.getSubject(), + decorate(demand.getReceptionDate()), + demand.getSender(), + demand.getRecipient(), + demand.getCcRecipients(), + quotedText); + } else { + quotedReply = FaxToMailUIUtil.getQuotedReplyContent(signing, decorate(demand.getReceptionDate()), demand.getSender(), quotedText); + } model.setMessage(quotedReply); } }); @@ -256,6 +281,11 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo } + protected boolean addAttchmentToReply(DemandeUIModel demand, ReplyFormUIModel model, DemandeUIModel demandeUIModel, Attachment attachment) { + return model.isForward() && demandeUIModel.equals(demand) + && !attachment.isInlineAttachment() && !attachment.isLessImportant(); + } + @Override public void cancel() { closeFrame(); @@ -477,6 +507,7 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo // clear fields that need to be filled by hand replyModel.setReadonly(false); + replyModel.setForward(true); replyModel.setOriginalDemand(getModel().getOriginalDemand()); replyModel.setReadSentDate(null); replyModel.setTo(null); @@ -493,7 +524,7 @@ public class ReplyFormUIHandler extends AbstractFaxToMailUIHandler<ReplyFormUIMo originalReply); replyModel.setMessage(quotedReply); - openModalFrame(dialogContent, t("faxtomail.reply.forward", getModel().getSubject()), new Dimension(800, 600)); + openModalFrame(dialogContent, replyModel.getSubject(), new Dimension(800, 600)); } catch (Exception ex) { if (log.isErrorEnabled()) { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java index d68cd0a..f41a7c5 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUIModel.java @@ -64,6 +64,7 @@ public class ReplyFormUIModel extends AbstractSerializableBean { public static final String PROPERTY_READONLY = "readonly"; public static final String PROPERTY_EDITABLE = "editable"; public static final String PROPERTY_READ_SENT_DATE = "readSentDate"; + public static final String PROPERTY_FORWARD = "forward"; protected Contact contact; protected String to; @@ -77,6 +78,7 @@ public class ReplyFormUIModel extends AbstractSerializableBean { protected long maxAttachmentLength = 0; protected long totalAttachmentLength = 0; protected boolean valid = true; + protected boolean forward; /** Flag pour marquer les champs non editables dans le cas d'une lecture d'une réponse déjà envoyée. */ protected boolean readonly = false; @@ -314,6 +316,16 @@ public class ReplyFormUIModel extends AbstractSerializableBean { return result; } + public boolean isForward() { + return forward; + } + + public void setForward(boolean forward) { + Object oldValue = isForward(); + this.forward = forward; + firePropertyChange(PROPERTY_FORWARD, oldValue, forward); + } + /** * Test si un email est present dans une liste (sans tenir compte de la casse). * diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java index 67b9d32..d65eb95 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java @@ -507,13 +507,10 @@ public abstract class AbstractFaxToMailUIHandler<M, UI extends FaxToMailUI<M, ?> && !folderWithInvalidFormDisabledActions.isUseCurrentLevelInvalidFormDisabledActions()) { folderWithInvalidFormDisabledActions = folderWithInvalidFormDisabledActions.getParent(); } - boolean enabled = - waitingState == null && (valid || !FaxToMailServiceUtils.contains(folderWithInvalidFormDisabledActions.getInvalidFormDisabledActions(), action)) + return waitingState == null && (valid || !FaxToMailServiceUtils.contains(folderWithInvalidFormDisabledActions.getInvalidFormDisabledActions(), action)) || waitingState != null && (valid && !FaxToMailServiceUtils.contains(waitingState.getValidFormDisabledActions(), action) || !valid && !FaxToMailServiceUtils.contains(waitingState.getInvalidFormDisabledActions(), action)); - - return enabled; } protected <R, B> TableColumnExt addComboDataColumnToModel(TableColumnModel model, 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 3c2086e..a20908e 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 @@ -128,6 +128,7 @@ faxtomail.demande.docType.label=Type faxtomail.demande.ediError.label=Retour EDI faxtomail.demande.fax.label=Fax faxtomail.demande.firstOpened.label=Première ouverture +faxtomail.demande.forward.button.label=Transférer faxtomail.demande.gamme.label=Gamme faxtomail.demande.group.button.label=Grouper faxtomail.demande.group.successful=Groupement réussi @@ -163,6 +164,8 @@ faxtomail.demandeList.action.archive=Archiver faxtomail.demandeList.action.archive.tip=Archiver l'élément faxtomail.demandeList.action.computeQuantitiesByRange=Calculer les quantités par gamme faxtomail.demandeList.action.computeQuantitiesByRange.tip=Calculer les quantités par gamme +faxtomail.demandeList.action.forward=Transférer +faxtomail.demandeList.action.forward.tip=Transférer faxtomail.demandeList.action.newDemand=Créer une nouvelle demande faxtomail.demandeList.action.newDemand.tip=Créer une nouvelle demande faxtomail.demandeList.action.print=Imprimer @@ -316,6 +319,7 @@ faxtomail.reply.label.to=À \: faxtomail.reply.message=<html><body><p></p>%s<p>Le %s, %s a écrit \:</p><div style\='border-left\: 2px solid blue;padding-left\: 5px;'>%s</div> faxtomail.reply.subject=Re \: %s faxtomail.reply.title=Réponse à \: %s +faxtomail.reply.titleForward= faxtomail.search.action.error=Erreur lors de la recherche faxtomail.search.action.gotoFolder=Aller au dossier faxtomail.search.action.gotoFolder.tip=Aller au dossier -- 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 bd0dddd7babaa1c5e34e815cf7ca8696da88ed56 Merge: 0703d50 39ab5e9 Author: Kevin Morin <morin@codelutin.com> Date: Thu Mar 30 11:09:45 2017 +0200 fixes #9103 Ajouter une fonction transférer, pour transférer une demande avec toutes les pièces jointes qui ne sont pas dans "Divers" .../faxtomail/persistence/entities/MailAction.java | 1 + faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 35759 -> 35847 bytes .../h2/V2_4_170328_2__add_show_actions_config.sql | 5 ++ .../V2_4_170328_2__add_show_actions_config.sql | 7 +++ .../ui/swing/content/demande/DemandeListUI.css | 10 ++++ .../ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../content/demande/DemandeListUIHandler.java | 24 +++++++-- .../swing/content/demande/DemandeListUIModel.java | 39 ++++++++++++++ .../ui/swing/content/demande/DemandesUI.css | 8 +++ .../ui/swing/content/demande/DemandesUI.jaxx | 38 +++++++++---- .../swing/content/demande/DemandesUIHandler.java | 30 ++++++++++- .../ui/swing/content/demande/DemandesUIModel.java | 36 +++++++++++++ ...yFormAction.java => OpenForwardFormAction.java} | 17 ++---- .../demande/actions/OpenReplyFormAction.java | 1 + ...tion.java => SaveAndOpenForwardFormAction.java} | 17 ++---- .../actions/SaveAndOpenReplyFormAction.java | 2 +- .../demande/replies/DemandRepliesUIHandler.java | 1 + .../demande/replies/actions/OpenReplyAction.java | 5 +- .../ui/swing/content/reply/ReplyFormUI.css | 10 ++-- .../ui/swing/content/reply/ReplyFormUI.jaxx | 33 ++++++------ .../ui/swing/content/reply/ReplyFormUIHandler.java | 59 ++++++++++++++++----- .../ui/swing/content/reply/ReplyFormUIModel.java | 12 +++++ .../ui/swing/util/AbstractFaxToMailUIHandler.java | 5 +- .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 ++ .../i18n/faxtomail-ui-web_fr_FR.properties | 1 + .../WEB-INF/content/admin/configuration-input.jsp | 39 +++++++++++++- .../src/main/webapp/js/configuration.js | 8 +++ 27 files changed, 326 insertions(+), 87 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm