branch develop updated (a9d3a1b -> d852191)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository faxtomail. See http://git.codelutin.com/faxtomail.git from a9d3a1b add missing conf new d852191 fixes #6519 Certaines lignes de gamme ne sont plus reliées à l'email The 1 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 d8521919aa99e92e3b79a9ee14c0ef9090b5fa83 Author: Kevin Morin <morin@codelutin.com> Date: Wed Jan 21 16:54:50 2015 +0100 fixes #6519 Certaines lignes de gamme ne sont plus reliées à l'email Summary of changes: .../persistence/entities/HistoryType.java | 2 ++ .../i18n/faxtomail-persistence_fr_FR.properties | 2 ++ .../services/service/EmailServiceImpl.java | 24 ++++++++++++++++++++++ .../ui/swing/actions/LoadFolderEmailsAction.java | 16 +-------------- .../ui/swing/actions/OpenGroupedDemandAction.java | 15 +------------- .../ui/swing/actions/SaveDemandeAction.java | 8 +++++++- .../faxtomail/ui/swing/actions/SearchAction.java | 16 +-------------- .../ui/swing/actions/SearchToGroupAction.java | 17 +-------------- .../ui/swing/content/demande/DemandeUIHandler.java | 12 ----------- .../ui/swing/content/demande/DemandeUIModel.java | 17 +++++++++++++++ .../util/AbstractFaxToMailDemandListHandler.java | 1 - .../faxtomail/ui/swing/util/DemandeTableModel.java | 11 +++++++--- 12 files changed, 64 insertions(+), 77 deletions(-) -- 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 http://git.codelutin.com/faxtomail.git commit d8521919aa99e92e3b79a9ee14c0ef9090b5fa83 Author: Kevin Morin <morin@codelutin.com> Date: Wed Jan 21 16:54:50 2015 +0100 fixes #6519 Certaines lignes de gamme ne sont plus reliées à l'email --- .../persistence/entities/HistoryType.java | 2 ++ .../i18n/faxtomail-persistence_fr_FR.properties | 2 ++ .../services/service/EmailServiceImpl.java | 24 ++++++++++++++++++++++ .../ui/swing/actions/LoadFolderEmailsAction.java | 16 +-------------- .../ui/swing/actions/OpenGroupedDemandAction.java | 15 +------------- .../ui/swing/actions/SaveDemandeAction.java | 8 +++++++- .../faxtomail/ui/swing/actions/SearchAction.java | 16 +-------------- .../ui/swing/actions/SearchToGroupAction.java | 17 +-------------- .../ui/swing/content/demande/DemandeUIHandler.java | 12 ----------- .../ui/swing/content/demande/DemandeUIModel.java | 17 +++++++++++++++ .../util/AbstractFaxToMailDemandListHandler.java | 1 - .../faxtomail/ui/swing/util/DemandeTableModel.java | 11 +++++++--- 12 files changed, 64 insertions(+), 77 deletions(-) diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java index 1fd582b..6134c7f 100644 --- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java +++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/HistoryType.java @@ -36,6 +36,8 @@ public enum HistoryType implements HasLabel { OPENING(n("faxtomail.historyType.opening"), false), MODIFICATION(n("faxtomail.historyType.modification"), true), TRANSMISSION_TO_EDI(n("faxtomail.historyType.transmissionToEdi"), true), + TRANSMITTED_TO_EDI(n("faxtomail.historyType.transmittedToEdi"), true), + EDI_RETURN(n("faxtomail.historyType.ediReturn"), true), TRANSMISSION(n("faxtomail.historyType.transmission"), true), REPLY(n("faxtomail.historyType.reply"), false), PRINTING(n("faxtomail.historyType.printing"), false), diff --git a/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties b/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties index 8caba78..fbc0a2d 100644 --- a/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties +++ b/faxtomail-persistence/src/main/resources/i18n/faxtomail-persistence_fr_FR.properties @@ -34,6 +34,7 @@ faxtomail.historyType.attachmentAddition=Ajout de pièce jointe faxtomail.historyType.attachmentModification=Modification de pièce jointe faxtomail.historyType.attachmentOpening=Ouverture de pièce jointe faxtomail.historyType.creation=Création +faxtomail.historyType.ediReturn=Retour EDI faxtomail.historyType.group=Groupement faxtomail.historyType.modification=Modification faxtomail.historyType.opening=Ouverture @@ -41,6 +42,7 @@ faxtomail.historyType.printing=Impression faxtomail.historyType.reply=Réponse faxtomail.historyType.transmission=Déplacement faxtomail.historyType.transmissionToEdi=Transmission à l'EDI +faxtomail.historyType.transmittedToEdi=Transmis à l'EDI faxtomail.persistence.loader.error= faxtomail.persistence.mkDir.error= faxtomail.service.config.deleteTempDirectory.error= diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java index 8899f6f..7f593ff 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java @@ -701,7 +701,12 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe // changement du status EmailTopiaDao dao = getPersistenceContext().getEmailDao(); + HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao(); email.setDemandStatus(DemandStatus.TRANSMITTED_TO_EDI); + History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.TRANSMITTED_TO_EDI, + History.PROPERTY_MODIFICATION_DATE, new Date(), + History.PROPERTY_EMAIL, email); + email.addHistory(history); dao.update(email); } @@ -1306,6 +1311,7 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe public void updateRangeRowsWithEdiReturns() { final RangeRowTopiaDao rangeRowTopiaDao = getPersistenceContext().getRangeRowDao(); final EmailTopiaDao emailTopiaDao = getPersistenceContext().getEmailDao(); + final HistoryTopiaDao historyDao = getPersistenceContext().getHistoryDao(); final Set<Email> emailsToUpdate = new HashSet<>(); @@ -1352,6 +1358,8 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe rangeRowTopiaIdsInEdiReturnToDelete.add(rangeRowTopiaId); + Set<String> modifiedFields = new HashSet<>(); + if (StringUtils.isNotBlank(error)) { //error String oldError = email.getEdiError(); @@ -1359,10 +1367,12 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe error = oldError + ", " + error; } email.setEdiError(error); + modifiedFields.add(Email.PROPERTY_EDI_ERROR); } else { rangeRow.setCommandNumber(commandNumber); rangeRowTopiaDao.update(rangeRow); + modifiedFields.add(Email.PROPERTY_RANGE_ROW); } History transmission = CollectionUtils.find(email.getHistory(), new Predicate<History>() { @@ -1378,6 +1388,20 @@ public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailSe } else { email.setDemandStatus(DemandStatus.IN_PROGRESS); } + modifiedFields.add(Email.PROPERTY_DEMAND_STATUS); + + History history = historyDao.create(History.PROPERTY_TYPE, HistoryType.MODIFICATION, + History.PROPERTY_MODIFICATION_DATE, new Date(), + History.PROPERTY_EMAIL, email, + History.PROPERTY_FIELDS_JSON, AbstractFaxToMailTopiaDao.GSON_INSTANCE.toJson(modifiedFields)); + + email.addHistory(history); + + history = historyDao.create(History.PROPERTY_TYPE, HistoryType.EDI_RETURN, + History.PROPERTY_MODIFICATION_DATE, new Date(), + History.PROPERTY_EMAIL, email); + + email.addHistory(history); emailsToUpdate.add(email); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java index 0d611e5..9fdada7 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java @@ -138,21 +138,7 @@ public class LoadFolderEmailsAction extends AbstractFaxToMailAction<DemandeListU for (Email email : emails) { DemandeUIModel demand = new DemandeUIModel(); demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_HISTORY)); - - // on ajoute toutes les lignes de rangeRow, - // qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides - Collection<RangeRow> rangeRows = demand.getRangeRow(); - if (rangeRows != null) { - for (RangeRow rangeRow : rangeRows) { - if (rangeRow != null) { - RangeRowModel rangeRowModel = new RangeRowModel(); - rangeRowModel.fromEntity(rangeRow); - if (rangeRowModel.isValid()) { - demand.addValidRangeRow(rangeRowModel); - } - } - } - } + demand.recomputeValidRangeRows(); demand.setMailFolder(folder); demand.setEditable(folder.isFolderWritable() && demand.getDemandStatus().isEditableStatus()); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java index 72d290a..d8bc25d 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/OpenGroupedDemandAction.java @@ -156,20 +156,7 @@ public class OpenGroupedDemandAction extends AbstractFaxToMailAction<DemandeUIMo takeEmail); demandToOpen.fromEntity(email); - ArrayList<RangeRowModel> validRangeRowModels = new ArrayList<RangeRowModel>(); - Collection<RangeRow> rangeRows = demandToOpen.getRangeRow(); - if (rangeRows != null) { - for (RangeRow rangeRow : rangeRows) { - if (rangeRow != null) { - RangeRowModel rangeRowModel = new RangeRowModel(); - rangeRowModel.fromEntity(rangeRow); - if (rangeRowModel.isValid()) { - validRangeRowModels.add(rangeRowModel); - } - } - } - } - demandToOpen.setValidRangeRowModels(validRangeRowModels); + demandToOpen.recomputeValidRangeRows(); MailFolder folder = demandToOpen.getMailFolder(); if (demandToOpen.getArchiveDate() != null diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java index 47f63d8..71b4558 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SaveDemandeAction.java @@ -39,6 +39,7 @@ import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUI; import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIHandler; import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; import com.franciaflex.faxtomail.ui.swing.content.demande.RangeRowModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.RangeTableModel; import com.google.common.collect.Maps; import org.apache.commons.lang3.StringUtils; import org.nuiton.topia.persistence.TopiaEntities; @@ -138,10 +139,15 @@ public class SaveDemandeAction extends AbstractFaxToMailAction<DemandeUIModel, D boolean folderWritable = folder.isFolderWritable(); if (model.getArchiveDate() != null || !folderWritable - || !demandStatus.isEditableStatus()) { + || !model.getDemandStatus().isEditableStatus()) { model.setEditable(false); } + // reload range rows with ids + RangeTableModel rangeTableModel = (RangeTableModel) getUI().getRangeTable().getModel(); + model.recomputeValidRangeRows(); + rangeTableModel.setRows(model.getValidRangeRowModels()); + getModel().setModify(false); monitor.clearModified(); } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java index cbe691f..23c615a 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java @@ -76,21 +76,7 @@ public class SearchAction extends AbstractFaxToMailAction<SearchUIModel, SearchU for (Email email : emails) { DemandeUIModel demand = new DemandeUIModel(); demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY)); - - // on ajoute toutes les lignes de rangeRow, - // qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides - Collection<RangeRow> rangeRows = demand.getRangeRow(); - if (rangeRows != null) { - for (RangeRow rangeRow : rangeRows) { - if (rangeRow != null) { - RangeRowModel rangeRowModel = new RangeRowModel(); - rangeRowModel.fromEntity(rangeRow); - if (rangeRowModel.isValid()) { - demand.addValidRangeRow(rangeRowModel); - } - } - } - } + demand.recomputeValidRangeRows(); demand.setValid(handler.isDemandeValid(demand)); WaitingState waitingState = email.getWaitingState(); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java index 5690660..e92da3a 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java @@ -76,23 +76,8 @@ public class SearchToGroupAction extends AbstractFaxToMailAction<SearchUIModel, for (Email email : emails) { DemandeUIModel demand = new DemandeUIModel(); demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_HISTORY)); + demand.recomputeValidRangeRows(); - // on ajoute toutes les lignes de rangeRow, - // qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides - Collection<RangeRow> rangeRows = demand.getRangeRow(); - if (rangeRows != null) { - for (RangeRow rangeRow : rangeRows) { - if (rangeRow != null) { - RangeRowModel rangeRowModel = new RangeRowModel(); - rangeRowModel.fromEntity(rangeRow); - if (rangeRowModel.isValid()) { - demand.addValidRangeRow(rangeRowModel); - } - } - } - } - - MailFolder mailFolder = email.getMailFolder(); demand.setValid(handler.isDemandeValid(demand)); WaitingState waitingState = email.getWaitingState(); if (waitingState != null) { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java index 230bf4a..2455bf7 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java @@ -252,18 +252,6 @@ public class DemandeUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, // init range model final RangeTableModel rangeTableModel = new RangeTableModel(columnModel); List<RangeRowModel> rangeRowModels = new ArrayList<RangeRowModel>(model.getValidRangeRowModels()); - -// Collection<RangeRow> rangeRows = model.getRangeRow(); -// if (rangeRows != null) { -// for (RangeRow rangeRow : rangeRows) { -// RangeRowModel rangeRowModel = new RangeRowModel(); -// rangeRowModel.fromEntity(rangeRow); -// rangeRowModels.add(rangeRowModel); -// // on ajoute toutes les lignes de rangeRow, -// // qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides -// model.getValidRangeRowModels().add(rangeRowModel); -// } -// } rangeTableModel.setRows(rangeRowModels); Map<String, Integer> quantities = FaxToMailUIUtil.computeQuantities(rangeRowModels); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java index 477b026..968200d 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java @@ -807,6 +807,23 @@ public class DemandeUIModel extends AbstractFaxToMailBeanUIModel<Email, DemandeU firePropertyChanged(PROPERTY_VALID_RANGE_ROW_MODELS, oldValue, validRangeRowModels); } + public void recomputeValidRangeRows() { + ArrayList<RangeRowModel> validRangeRowModels = new ArrayList<RangeRowModel>(); + Collection<RangeRow> rangeRows = getRangeRow(); + if (rangeRows != null) { + for (RangeRow rangeRow : rangeRows) { + if (rangeRow != null) { + RangeRowModel rangeRowModel = new RangeRowModel(); + rangeRowModel.fromEntity(rangeRow); + if (rangeRowModel.isValid()) { + validRangeRowModels.add(rangeRowModel); + } + } + } + } + setValidRangeRowModels(validRangeRowModels); + } + /** * Appelée par la validation. * 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 336f0c9..37a3198 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 @@ -151,7 +151,6 @@ public abstract class AbstractFaxToMailDemandListHandler<M, UI extends FaxToMail for (MailField columnName : columns) { if (MailField.PRIORITY.equals(columnName)) { - FaxToMailServiceContext serviceContext = getContext().newServiceContext(); addComboDataColumnToModel(columnModel, DemandeTableModel.COLUMN_IDENTIFIERS.get(columnName), getDecorator(Priority.class, null), diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java index 5f84fc5..01c3426 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/DemandeTableModel.java @@ -379,8 +379,7 @@ public class DemandeTableModel extends AbstractTableModel { @Override public final boolean isCellEditable(int rowIndex, int columnIndex) { ColumnIdentifier<DemandeUIModel> identifier = getIdentifier(columnIndex); - boolean result = isCellEditable(rowIndex, columnIndex, identifier); - return result; + return isCellEditable(rowIndex, columnIndex, identifier); } protected void setValueAt(Object aValue, @@ -397,7 +396,13 @@ public class DemandeTableModel extends AbstractTableModel { protected boolean isCellEditable(int rowIndex, int columnIndex, ColumnIdentifier<DemandeUIModel> propertyName) { - boolean result = !noneEditableCols.contains(propertyName); + DemandeUIModel entry = getEntry(rowIndex); + + + boolean result = (COLUMN_IDENTIFIERS.get(MailField.ATTACHMENT).equals(propertyName) || + COLUMN_IDENTIFIERS.get(MailField.REPLIES).equals(propertyName) || + entry.isEditable()) + && !noneEditableCols.contains(propertyName); return result; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm