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 e3f2f18e7b49c1117c95db6e7a2269497ff519c1 Author: Kevin Morin <morin@codelutin.com> Date: Tue Mar 14 10:51:48 2017 +0100 fixes #9095 L'impression doit mettre à jour le champ "Pris par" (sans l'ouvris, via le clic droit) sauf si la demande est déjà prise. --- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 33796 -> 33882 bytes ...13_2__add_printActionEqualTakeOnlyIfNotTaken.sql | 4 ++++ ...13_2__add_printActionEqualTakeOnlyIfNotTaken.sql | 6 ++++++ .../swing/actions/PrintOnDefaultPrinterAction.java | 6 +++++- .../swing/content/demande/DemandeListUIHandler.java | 7 +++++++ .../print/AttachmentToPrintChooserUIHandler.java | 1 + .../WEB-INF/content/admin/configuration-input.jsp | 17 +++++++++++++++++ .../src/main/webapp/js/configuration.js | 4 ++++ 8 files changed, 44 insertions(+), 1 deletion(-) diff --git a/faxtomail-persistence/src/main/xmi/faxtomail.zargo b/faxtomail-persistence/src/main/xmi/faxtomail.zargo index 5268bc7..1d9a086 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_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql b/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql new file mode 100644 index 0000000..b1f5687 --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/h2/V2_2_3_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql @@ -0,0 +1,4 @@ +-- add printActionEqualTakeOnlyIfNotTaken + +alter table mailfolder add printActionEqualTakeOnlyIfNotTaken boolean; +update mailfolder set printActionEqualTakeOnlyIfNotTaken = 'f' where parent is null; \ No newline at end of file diff --git a/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql new file mode 100644 index 0000000..f7a105f --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/sqlserver/V2_2_3_170313_2__add_printActionEqualTakeOnlyIfNotTaken.sql @@ -0,0 +1,6 @@ +-- add printActionEqualTakeOnlyIfNotTaken + +alter table mailfolder add printActionEqualTakeOnlyIfNotTaken bit; +GO +update mailfolder set printActionEqualTakeOnlyIfNotTaken = 1 where parent is null; +GO \ No newline at end of file diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java index 154c72f..14c7c48 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/PrintOnDefaultPrinterAction.java @@ -56,17 +56,20 @@ public class PrintOnDefaultPrinterAction extends AbstractFaxToMailAction { protected Multimap<DemandeUIModel, AttachmentFile> attachmentsToPrintByDemand; protected boolean take; + protected boolean takeOnlyIfNotTaken; protected boolean printDemandDetails; protected List<DemandeUIModel> notPrintableDemands; public PrintOnDefaultPrinterAction(AbstractFaxToMailUIHandler handler, Multimap<DemandeUIModel, AttachmentFile> attachmentsToPrintByDemand, boolean take, + boolean takeOnlyIfNotTaken, boolean printDemandDetails) { super(handler, false); this.attachmentsToPrintByDemand = attachmentsToPrintByDemand; this.take = take; + this.takeOnlyIfNotTaken = takeOnlyIfNotTaken; this.printDemandDetails = printDemandDetails; setActionDescription(t("faxtomail.action.print.tip")); @@ -97,7 +100,7 @@ public class PrintOnDefaultPrinterAction extends AbstractFaxToMailAction { notPrintableDemands.add(demandeUIModel); } else { - if (take) { + if (take && (demandeUIModel.getTakenBy() == null || !takeOnlyIfNotTaken)) { demandeUIModel.setTakenBy(currentUser); } @@ -137,6 +140,7 @@ public class PrintOnDefaultPrinterAction extends AbstractFaxToMailAction { printedFiles.toArray(new String[printedFiles.size()])); printedFileNb += printedFiles.size(); demandeUIModel.setHistory(email.getHistory()); + demandeUIModel.setLastPrintingUser(email.getLastPrintingUser()); } } 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 216dd64..85be89e 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 @@ -788,6 +788,12 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem } boolean take = Boolean.TRUE.equals(selectedFolder.getPrintActionEqualTakeAction()); + selectedFolder = model.getSelectedFolder(); + while (selectedFolder.getParent() != null && selectedFolder.getPrintActionEqualTakeOnlyIfNotTaken() == null) { + selectedFolder = selectedFolder.getParent(); + } + boolean takeOnlyIfNotTaken = Boolean.TRUE.equals(selectedFolder.getPrintActionEqualTakeOnlyIfNotTaken()); + Multimap<DemandeUIModel, AttachmentFile> attachmentToPrints = HashMultimap.create(); for (DemandeUIModel demandeUIModel : model.getSelectedEmails()) { @@ -814,6 +820,7 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem PrintOnDefaultPrinterAction action = new PrintOnDefaultPrinterAction(this, attachmentToPrints, take, + takeOnlyIfNotTaken, true); getContext().getActionEngine().runAction(action); } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java index aafb86c..d31e34f 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java @@ -157,6 +157,7 @@ public class AttachmentToPrintChooserUIHandler extends AbstractFaxToMailUIHandle PrintOnDefaultPrinterAction action = new PrintOnDefaultPrinterAction(this, attachmentToPrints, false, + false, false) { @Override 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 e05a7b5..637a905 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 @@ -471,6 +471,23 @@ ({{parentScopeValues.printActionEqualTakeAction ? 'Oui' : 'Non'}}) </label> </div> + + <div class="form-group" ng-if="selectedMailFolder.printActionEqualTakeAction || selectedMailFolder.printActionEqualTakeAction == null && parentScopeValues.printActionEqualTakeAction"> + <label class="control-label">Seulement si l'élément n'est pas pris ?</label><br /> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.printActionEqualTakeOnlyIfNotTaken" ng-value="true"> oui + </label> + <label class="radio-inline"> + <input type="radio" + ng-model="selectedMailFolder.printActionEqualTakeOnlyIfNotTaken" ng-value="false"> non + </label> + <label class="radio-inline" ng-if="selectedMailFolder.$parent"> + <input type="radio" + ng-model="selectedMailFolder.printActionEqualTakeOnlyIfNotTaken" ng-value="undefined"> hériter du dossier parent + ({{parentScopeValues.printActionEqualTakeOnlyIfNotTaken ? 'Oui' : 'Non'}}) + </label> + </div> <div class="form-group"> <label class="control-label">Colorer les demandes invalides dans la listes ?</label><br /> diff --git a/faxtomail-ui-web/src/main/webapp/js/configuration.js b/faxtomail-ui-web/src/main/webapp/js/configuration.js index 4c572d0..2d9642f 100644 --- a/faxtomail-ui-web/src/main/webapp/js/configuration.js +++ b/faxtomail-ui-web/src/main/webapp/js/configuration.js @@ -794,6 +794,7 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo $scope.selectedMailFolder.colorizeInvalidDemands = $scope.selectedMailFolder.colorizeInvalidDemands || false; $scope.selectedMailFolder.openAttachmentReportNoTaken = $scope.selectedMailFolder.openAttachmentReportNoTaken || false; $scope.selectedMailFolder.printActionEqualTakeAction = $scope.selectedMailFolder.printActionEqualTakeAction || false; + $scope.selectedMailFolder.printActionEqualTakeOnlyIfNotTaken = $scope.selectedMailFolder.printActionEqualTakeOnlyIfNotTaken || false; $scope.selectedMailFolder.lockedDemandsOpenableInReadOnly = $scope.selectedMailFolder.lockedDemandsOpenableInReadOnly || false; $scope.selectedMailFolder.ediTransfer = $scope.selectedMailFolder.ediTransfer|| false; } @@ -882,6 +883,9 @@ ConfigurationModule.controller('ConfigurationTreeController', ['$scope', '$windo if (angular.isUndefined($scope.parentScopeValues.printActionEqualTakeAction)) { $scope.parentScopeValues.printActionEqualTakeAction = folder.printActionEqualTakeAction; } + if (angular.isUndefined($scope.parentScopeValues.printActionEqualTakeOnlyIfNotTaken)) { + $scope.parentScopeValues.printActionEqualTakeOnlyIfNotTaken = folder.printActionEqualTakeOnlyIfNotTaken; + } if (angular.isUndefined($scope.parentScopeValues.lockedDemandsOpenableInReadOnly)) { $scope.parentScopeValues.lockedDemandsOpenableInReadOnly = folder.lockedDemandsOpenableInReadOnly; } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.