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 2a02ea0eacca0aebf76e9788a8e5d85c31f56659 Author: Kevin Morin <morin@codelutin.com> Date: Tue Feb 14 11:34:32 2017 +0100 fixes #9050 Liste des éléments : permettre de ne pas afficher les lignes non valides en rouge --- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 33422 -> 33469 bytes ...14__add_colorize_invalid_demands_on_folders.sql | 3 +++ ...14__add_colorize_invalid_demands_on_folders.sql | 3 +++ .../content/demande/DemandeListUIHandler.java | 22 ++++++++++++++------- .../demande/actions/LoadFolderEmailsAction.java | 2 ++ .../content/search/SearchToGroupUIHandler.java | 12 ++++++++--- .../util/AbstractFaxToMailDemandListHandler.java | 16 ++++++++++++++- .../WEB-INF/content/admin/configuration-input.jsp | 17 ++++++++++++++++ .../src/main/webapp/js/configuration.js | 4 ++++ 9 files changed, 68 insertions(+), 11 deletions(-) diff --git a/faxtomail-persistence/src/main/xmi/faxtomail.zargo b/faxtomail-persistence/src/main/xmi/faxtomail.zargo index 23ac433..033fb8c 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_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 new file mode 100644 index 0000000..019223f --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql @@ -0,0 +1,3 @@ +-- 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 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 new file mode 100644 index 0000000..f7830a0 --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170214__add_colorize_invalid_demands_on_folders.sql @@ -0,0 +1,3 @@ +-- 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 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 f524649..e09be17 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 @@ -38,9 +38,9 @@ import com.franciaflex.faxtomail.persistence.entities.MailField; import com.franciaflex.faxtomail.persistence.entities.MailFolder; import com.franciaflex.faxtomail.persistence.entities.OriginalEmailImpl; import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; +import com.franciaflex.faxtomail.ui.swing.actions.PrintOnDefaultPrinterAction; import com.franciaflex.faxtomail.ui.swing.content.demande.actions.ComputeQuantitiesByRangeAction; import com.franciaflex.faxtomail.ui.swing.content.demande.actions.LoadFolderEmailsAction; -import com.franciaflex.faxtomail.ui.swing.actions.PrintOnDefaultPrinterAction; import com.franciaflex.faxtomail.ui.swing.content.demande.actions.SaveDemandeFromListAction; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler; import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel; @@ -68,7 +68,14 @@ import org.nuiton.jaxx.application.swing.util.CloseableUI; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JPopupMenu; +import javax.swing.JRootPane; +import javax.swing.JTree; +import javax.swing.KeyStroke; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; +import javax.swing.Timer; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TreeSelectionEvent; @@ -76,7 +83,9 @@ import javax.swing.event.TreeSelectionListener; import javax.swing.table.TableCellEditor; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -180,7 +189,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem // init table final JXTable dataTable = getUI().getDataTable(); - initDemandeTable(dataTable, false); + initDemandeTable(dataTable); tableFilter = new DemandeListTableFilter(dataTable, this); @@ -580,8 +589,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem } } - @Override - public void initDemandeTable(final JXTable table, boolean sortable) { + public void initDemandeTable(final JXTable table) { HighlightPredicate reportNotTakenPredicate = new HighlightPredicate() { @Override public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { @@ -602,7 +610,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem Color color = Color.ORANGE; table.addHighlighter(new ColorHighlighter(reportNotTakenPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); - super.initDemandeTable(table, sortable); + initDemandeTable(table, false); } @Override diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java index fdef7ad..10fde07 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/LoadFolderEmailsAction.java @@ -104,6 +104,8 @@ public class LoadFolderEmailsAction extends AbstractFaxToMailAction<DemandeListU } } + getHandler().updateColorizeInvalidDemands(); + return result; } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java index 523315e..19edf99 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java @@ -31,9 +31,9 @@ import com.franciaflex.faxtomail.persistence.entities.HasLabel; import com.franciaflex.faxtomail.persistence.entities.MailField; import com.franciaflex.faxtomail.persistence.entities.SearchFilter; import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; import com.franciaflex.faxtomail.ui.swing.content.search.actions.GroupAction; import com.franciaflex.faxtomail.ui.swing.content.search.actions.SearchToGroupAction; -import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler; import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel; import com.franciaflex.faxtomail.ui.swing.util.PaginationComboModel; @@ -50,10 +50,15 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.nuiton.jaxx.application.swing.util.Cancelable; import org.nuiton.util.pagination.PaginationParameter; -import javax.swing.*; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JTextField; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -167,6 +172,7 @@ public class SearchToGroupUIHandler extends AbstractFaxToMailDemandListHandler<S final JXTable dataTable = getUI().getDataTable(); dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + updateColorizeInvalidDemands(); initDemandeTable(dataTable, true); model.addPropertyChangeListener(SearchUIModel.PROPERTY_RESULTS, new PropertyChangeListener() { 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 d1509d3..8ddba10 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 @@ -29,6 +29,7 @@ import com.franciaflex.faxtomail.persistence.entities.DemandStatus; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.HasLabel; import com.franciaflex.faxtomail.persistence.entities.MailField; +import com.franciaflex.faxtomail.persistence.entities.MailFolder; import com.franciaflex.faxtomail.persistence.entities.Priority; import com.franciaflex.faxtomail.persistence.entities.RangeRow; import com.franciaflex.faxtomail.persistence.entities.Reply; @@ -44,6 +45,7 @@ import com.google.common.base.Function; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -85,6 +87,17 @@ public abstract class AbstractFaxToMailDemandListHandler<M, UI extends FaxToMail protected NuitonValidator<DemandeUIModel> demandeUIModelNuitonValidator = NuitonValidatorFactory.newValidator(DemandeUIModel.class);; + protected boolean colorizeInvalidDemands = true; + + public void updateColorizeInvalidDemands() { + MailFolder mailFolder = getContext().getCurrentMailFolder(); + while (mailFolder != null && mailFolder.getParent() != null + && mailFolder.getColorizeInvalidDemands() == null) { + mailFolder = mailFolder.getParent(); + } + colorizeInvalidDemands = mailFolder != null && BooleanUtils.isNotFalse(mailFolder.getColorizeInvalidDemands()); + } + public void initDemandeTable(final JXTable table, boolean sortable) { // table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN); @@ -128,12 +141,13 @@ public abstract class AbstractFaxToMailDemandListHandler<M, UI extends FaxToMail table.addHighlighter(highlighter); HighlightPredicate rowIsInvalidPredicate = new HighlightPredicate() { + @Override public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { int viewRow = adapter.row; int modelRow = adapter.convertRowIndexToModel(viewRow); DemandeUIModel row = ((DemandeTableModel) table.getModel()).getEntry(modelRow); - return !row.isValid() && row.getTakenBy() != null; + return colorizeInvalidDemands && !row.isValid() && row.getTakenBy() != null; } }; Color color = new Color(255, 51, 51); 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 2854f51..6f3e675 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 @@ -473,6 +473,23 @@ </div> <div class="form-group"> + <label class="control-label">Colorer les demandes invalides dans la listes ?</label><br /> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.colorizeInvalidDemands" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.colorizeInvalidDemands" ng-value="false"> non + </label> + <label class="radio-inline" ng-if="selectedMailFolder.$parent"> + <input type="radio" + ng-model="selectedMailFolder.colorizeInvalidDemands" ng-value="undefined"> hériter du dossier parent + ({{parentScopeValues.colorizeInvalidDemands ? 'Oui' : 'Non'}}) + </label> + </div> + + <div class="form-group"> <label class="control-label">Ouvrir une pièce jointe sans prendre, met-il la ligne en orange ?</label><br /> <label class="radio-inline"> <input type="radio" diff --git a/faxtomail-ui-web/src/main/webapp/js/configuration.js b/faxtomail-ui-web/src/main/webapp/js/configuration.js index f401166..07b4ae0 100644 --- a/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -791,6 +791,7 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo if (!$scope.selectedMailFolder.$parent) { $scope.selectedMailFolder.allowCreateDemandIntoFolder = $scope.selectedMailFolder.allowCreateDemandIntoFolder || false; $scope.selectedMailFolder.allowMoveDemandIntoFolder = $scope.selectedMailFolder.allowMoveDemandIntoFolder || false; + $scope.selectedMailFolder.colorizeInvalidDemands = $scope.selectedMailFolder.colorizeInvalidDemands || false; $scope.selectedMailFolder.openAttachmentReportNoTaken = $scope.selectedMailFolder.openAttachmentReportNoTaken || false; $scope.selectedMailFolder.printActionEqualTakeAction = $scope.selectedMailFolder.printActionEqualTakeAction || false; $scope.selectedMailFolder.ediTransfer = $scope.selectedMailFolder.ediTransfer|| false; @@ -871,6 +872,9 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo if (angular.isUndefined($scope.parentScopeValues.allowMoveDemandIntoFolder)) { $scope.parentScopeValues.allowMoveDemandIntoFolder = folder.allowMoveDemandIntoFolder; } + if (angular.isUndefined($scope.parentScopeValues.colorizeInvalidDemands)) { + $scope.parentScopeValues.colorizeInvalidDemands = folder.colorizeInvalidDemands; + } if (angular.isUndefined($scope.parentScopeValues.openAttachmentReportNoTaken)) { $scope.parentScopeValues.openAttachmentReportNoTaken = folder.openAttachmentReportNoTaken; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.