r186 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-persistence/src/main/xmi faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util faxtomail-ui-swing/src/main/resources/i18n faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin faxtoma
Author: kmorin Date: 2014-06-11 13:02:07 +0200 (Wed, 11 Jun 2014) New Revision: 186 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/186 Log: suppression des actions pour les dossiers ajout des actions possibles quand un ?\195?\169lement est invalide mais n'a pas d'?\195?\169tat d'attente. Removed: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js Deleted: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/FolderAction.java 2014-06-11 11:02:07 UTC (rev 186) @@ -1,35 +0,0 @@ -package com.franciaflex.faxtomail.persistence.entities; - -/* - * #%L - * FaxToMail :: Persistence - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2014 Franciaflex, 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% - */ - -/** - * @author Kevin Morin (Code Lutin) - * @since x.x - */ -public enum FolderAction { - - COMPUTE_RANGE, - NEW_DEMANDE -} Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo =================================================================== (Binary files differ) Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/TransmitAction.java 2014-06-11 11:02:07 UTC (rev 186) @@ -52,7 +52,6 @@ model.setDemandStatus(DemandStatus.QUALIFIED); model.setTakenBy(null); - //TODO kmorin 20140306 DemandesUI parentUI = (DemandesUI) getUI().getContextValue(JAXXContext.class, JAXXUtil.PARENT); DemandeUI demandeUI = (DemandeUI) parentUI.getDemandsTabPane().getSelectedComponent(); SaveDemandeAction action = getContext().getActionFactory().createLogicAction(demandeUI.getHandler(), Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-11 11:02:07 UTC (rev 186) @@ -31,7 +31,6 @@ import com.franciaflex.faxtomail.persistence.entities.DemandStatus; import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; -import com.franciaflex.faxtomail.persistence.entities.FolderAction; import com.franciaflex.faxtomail.persistence.entities.MailField; import com.franciaflex.faxtomail.persistence.entities.History; import com.franciaflex.faxtomail.persistence.entities.HistoryImpl; @@ -53,6 +52,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; +import org.jdesktop.swingx.decorator.ColorHighlighter; +import org.jdesktop.swingx.decorator.ComponentAdapter; +import org.jdesktop.swingx.decorator.HighlightPredicate; import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel; import javax.swing.*; @@ -283,6 +285,31 @@ } @Override + public void initDemandeTable(final JXTable table, boolean sortable) { + super.initDemandeTable(table, sortable); + + HighlightPredicate testPredicate = new HighlightPredicate() { + @Override + public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { + int viewRow = adapter.row; + int modelRow = adapter.convertRowIndexToModel(viewRow); + DemandeUIModel row = ((AbstractApplicationTableModel<DemandeUIModel>) table.getModel()).getEntry(modelRow); + MailFolder folder = getModel().getSelectedFolder(); + while (folder.getOpenAttachmentReportNoTaken() == null + && folder.getParent() != null) { + folder = folder.getParent(); + } + + return Boolean.TRUE.equals(folder.getOpenAttachmentReportNoTaken()) + && row.getLastAttachmentOpeningInThisFolderUser() != null + && !row.getLastAttachmentOpeningInThisFolderUser().equals(row.getTakenBy()); + } + }; + Color color = Color.ORANGE; + table.addHighlighter(new ColorHighlighter(testPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); + } + + @Override protected List<MailField> getColumns() { List<MailField> tableColumns = null; MailFolder selectedFolder = getModel().getSelectedFolder(); @@ -356,7 +383,6 @@ int selectedRowCount = getUI().getDataTable().getSelectedRowCount(); DemandeListUIModel model = getModel(); - //TODO kmorin 20140605 prendre en compte la conf en fonction des états d'attente model.setReplyEnabled(selectedRowCount == 1 && model.getCurrentEmails().get(0).isEditable()); model.setArchiveEnabled(selectedRowCount > 1 || selectedRowCount > 0 && model.getCurrentEmails().get(0).isEditable()); Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailDemandListHandler.java 2014-06-11 11:02:07 UTC (rev 186) @@ -135,19 +135,6 @@ Color color = new Color(255, 51, 51); table.addHighlighter(new ColorHighlighter(rowIsInvalidPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); - HighlightPredicate testPredicate = new HighlightPredicate() { - @Override - public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { - int viewRow = adapter.row; - int modelRow = adapter.convertRowIndexToModel(viewRow); - DemandeUIModel row = ((AbstractApplicationTableModel<DemandeUIModel>) table.getModel()).getEntry(modelRow); - return row.getLastAttachmentOpeningInThisFolderUser() != null - && !row.getLastAttachmentOpeningInThisFolderUser().equals(row.getTakenBy()); - } - }; - color = Color.ORANGE; - table.addHighlighter(new ColorHighlighter(testPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); - table.addMouseListener(getDataTableMouseListener()); } Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties =================================================================== --- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-06-11 11:02:07 UTC (rev 186) @@ -159,6 +159,8 @@ faxtomail.demandeList.table.header.brand.tip=Marque faxtomail.demandeList.table.header.client=Client faxtomail.demandeList.table.header.client.tip=Client +faxtomail.demandeList.table.header.commen= +faxtomail.demandeList.table.header.commen.tip= faxtomail.demandeList.table.header.companyReference=Notre ref faxtomail.demandeList.table.header.companyReference.tip=Notre référence faxtomail.demandeList.table.header.ediCodeNumber=Code EDI Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java =================================================================== --- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ConfigurationAction.java 2014-06-11 11:02:07 UTC (rev 186) @@ -44,7 +44,6 @@ import com.franciaflex.faxtomail.persistence.entities.EtatAttente; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUserGroup; -import com.franciaflex.faxtomail.persistence.entities.FolderAction; import com.franciaflex.faxtomail.persistence.entities.MailAction; import com.franciaflex.faxtomail.persistence.entities.MailFilter; import com.franciaflex.faxtomail.persistence.entities.MailFolder; @@ -214,10 +213,6 @@ return getEnumAsMap(MailAction.values()); } - public Map<FolderAction, String> getFolderActions() { - return getEnumAsMap(FolderAction.values()); - } - public Map<MailField, String> getCanBeRequiredMailFields() { return getEnumAsMap(MailField.getCanBeRequiredMailFields()); } Modified: trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-web/src/main/webapp/WEB-INF/content/admin/configuration-input.jsp 2014-06-11 11:02:07 UTC (rev 186) @@ -36,7 +36,6 @@ ConfigurationModule.value('ConfigurationData', { // enums 'mailActions': <s:property value="toJson(mailActions)" escapeHtml="false"/>, - 'folderActions': <s:property value="toJson(folderActions)" escapeHtml="false"/>, 'canBeRequiredMailFields': <s:property value="toJson(canBeRequiredMailFields)" escapeHtml="false"/>, 'tableMailFields': <s:property value="toJson(tableMailFields)" escapeHtml="false"/>, 'emailProtocolPorts': <s:property value="toJson(emailProtocolPorts)" escapeHtml="false"/>, @@ -87,7 +86,15 @@ <label class="control-label" for="configurationEmailMaxSizeField">Taille maximale des email (en bits)</label> <input type="text" id="configurationEmailMaxSizeField" class="form-control" ng-model="configuration.emailMaxSize" /> </div> - + + <div class="form-group"> + Actions autorisées lorsque la demande n'a pas d'état d'attente et est <strong>invalide</strong> : + <label class="checkbox" ng-repeat="(mailAction,label) in mailActions"> + <input type="checkbox" ng-checked="configuration.invalidFormDisabledActions.indexOf(mailAction) == -1" + ng-click="changeInvalidAction(mailAction)"> {{label}} + </label> + </div> + <table class="table table-bordered"> <caption>Commande de traitement des extensions de pièces jointes</caption> <thead> @@ -565,40 +572,6 @@ </div> </div> - - <!-- Liste des emails expéditeur --> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#accordion" href="#collapse5"> - Actions possibles du menu contextuel pour ce dossier - </a> - </h4> - </div> - <div id="collapse5" class="panel-collapse collapse"> - <div class="panel-body"> - <label ng-if="selectedMailFolder.$parent"> - <input type="radio" ng-model="selectedMailFolder.useCurrentLevelFolderActions" - ng-value="false" ng-change="initFolderActions()" /> - Hériter des actions contextuelles déclarées sur les dossiers parent : - </label> - <label class="checkbox" ng-repeat="(folderAction,label) in folderActions" ng-if="selectedMailFolder.$parent && !selectedMailFolder.useCurrentLevelFolderActions"> - <input type="checkbox" ng-checked="parentScopeValues.folderActions.indexOf(folderAction) != -1" - disabled> {{label}} - </label> - <label> - <input type="radio" ng-model="selectedMailFolder.useCurrentLevelFolderActions" ng-value="true" - ng-change="initFolderActions()" ng-if="selectedMailFolder.$parent" /> - Définir les actions contextuelles possibles pour ce dossier : - </label> - <label class="checkbox" ng-repeat="(folderAction,label) in folderActions" ng-if="selectedMailFolder.useCurrentLevelFolderActions || !selectedMailFolder.$parent"> - <input type="checkbox" ng-checked="selectedMailFolder.folderActions.indexOf(folderAction) != -1" - ng-click="changeFolderAction(folderAction)"> {{label}} - </label> - </div> - </div> - </div> - <!-- configuration des colonnes a afficher --> <div class="panel panel-default"> <div class="panel-heading"> Modified: trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js =================================================================== --- trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-11 05:32:51 UTC (rev 185) +++ trunk/faxtomail-ui-web/src/main/webapp/js/configuration.js 2014-06-11 11:02:07 UTC (rev 186) @@ -37,8 +37,6 @@ $scope.canBeRequiredMailFields = ConfigurationData.canBeRequiredMailFields; //{Map} les champs possibles du tableau $scope.tableMailFields = ConfigurationData.tableMailFields; - //{Map} les actions contextuelles possibles pour les dossiers - $scope.folderActions = ConfigurationData.folderActions; //{Array} les etats d'attentes disponibles $scope.etatAttentes = ConfigurationData.etatAttentes; //{Array} les types de documents @@ -105,6 +103,16 @@ ConfigurationModule.controller('ConfigurationMiscController', ['$scope', '$window', 'ConfigurationData', function($scope, $window, ConfigurationData) { + // selection/deselection d'une action + $scope.changeInvalidAction = function(action) { + var index = $scope.configuration.invalidFormDisabledActions.indexOf(action); + if (index != -1) { + $scope.configuration.invalidFormDisabledActions.splice(index, 1); + } else { + $scope.configuration.invalidFormDisabledActions.push(action); + } + }; + // Ajout d'une nouvelle ligne vide d'extension $scope.addExtensionRow = function() { if (!$scope.configuration.extensionCommands) { @@ -285,7 +293,6 @@ useCurrentLevelEtatAttente: false, useCurrentLevelTableColumns: false, useCurrentLevelFaxDomain: false, - useCurrentLevelFolderActions: false, useCurrentLevelEdiFolder: false }; // extend node (in faxtomail collapsed = extended) @@ -320,9 +327,6 @@ if (!$scope.selectedMailFolder.replyDomains) { $scope.selectedMailFolder.replyDomains = []; } - if (!$scope.selectedMailFolder.folderActions) { - $scope.selectedMailFolder.folderActions = []; - } if (!$scope.selectedMailFolder.folderTableColumns) { $scope.selectedMailFolder.folderTableColumns = []; } @@ -424,7 +428,6 @@ customerResponsibles: [], replyAddresses: [], replyDomains: [], - folderActions: [], folderTableColumns: [], etatAttentes: [], //rigths @@ -508,9 +511,6 @@ if (!$scope.parentScopeValues.ediFolder) { $scope.parentScopeValues.ediFolder = folder.ediFolder; } - if ((!$scope.parentScopeValues.folderActions || $scope.parentScopeValues.folderActions.length == 0) && folder.folderActions) { - $scope.parentScopeValues.folderActions = folder.folderActions; - } if ((!$scope.parentScopeValues.folderTableColumns || $scope.parentScopeValues.folderTableColumns.length == 0) && folder.folderTableColumns) { $scope.parentScopeValues.folderTableColumns = folder.folderTableColumns; } @@ -675,30 +675,9 @@ }; // initialise la liste des actions possibles avec celle des niveaux supérieurs - $scope.initFolderActions = function() { - if ($scope.selectedMailFolder.useCurrentLevelFolderActions) { - if ($scope.parentScopeValues.folderActions) { - $scope.selectedMailFolder.folderActions = $scope.parentScopeValues.folderActions.slice(); // soft copy - } - } else { - delete $scope.selectedMailFolder.folderActions; - } - }; - - // selection/deselection d'une action possible du menu contextuel pour ce dossier - $scope.changeFolderAction = function(folderAction) { - var index = $scope.selectedMailFolder.folderActions.indexOf(folderAction); - if (index != -1) { - $scope.selectedMailFolder.folderActions.splice(index, 1); - } else { - $scope.selectedMailFolder.folderActions.push(folderAction); - } - }; - - // initialise la liste des actions possibles avec celle des niveaux supérieurs $scope.initFolderColumns = function() { if ($scope.selectedMailFolder.useCurrentLevelTableColumns) { - if ($scope.parentScopeValues.folderActions) { + if ($scope.parentScopeValues.folderTableColumns) { $scope.selectedMailFolder.folderTableColumns = $scope.parentScopeValues.folderTableColumns.slice(); // soft copy // init select2 data
participants (1)
-
kmorin@users.forge.codelutin.com