Skip to content
Snippets Groups Projects
Commit 5025f8a6 authored by Damien's avatar Damien
Browse files

FEAT #5398 Add a delete confirm message on signature book when there is only 1 attachment left

parent 82ba683e
No related branches found
No related tags found
No related merge requests found
...@@ -299,7 +299,12 @@ var SignatureBookComponent = (function () { ...@@ -299,7 +299,12 @@ var SignatureBookComponent = (function () {
SignatureBookComponent.prototype.delAttachment = function (attachment) { SignatureBookComponent.prototype.delAttachment = function (attachment) {
var _this = this; var _this = this;
if (attachment.canDelete) { if (attachment.canDelete) {
var r = confirm('Voulez-vous vraiment supprimer la pièce jointe ?'); if (this.signatureBook.attachments.length <= 1) {
var r = confirm('Attention, ceci est votre dernière pièce jointe pour ce courrier, voulez-vous vraiment la supprimer ?');
}
else {
var r = confirm('Voulez-vous vraiment supprimer la pièce jointe ?');
}
if (r) { if (r) {
var resId; var resId;
if (attachment.res_id == 0) { if (attachment.res_id == 0) {
......
...@@ -310,7 +310,11 @@ export class SignatureBookComponent implements OnInit { ...@@ -310,7 +310,11 @@ export class SignatureBookComponent implements OnInit {
delAttachment(attachment: any) { delAttachment(attachment: any) {
if (attachment.canDelete) { if (attachment.canDelete) {
let r = confirm('Voulez-vous vraiment supprimer la pièce jointe ?'); if (this.signatureBook.attachments.length <= 1) {
var r = confirm('Attention, ceci est votre dernière pièce jointe pour ce courrier, voulez-vous vraiment la supprimer ?');
} else {
var r = confirm('Voulez-vous vraiment supprimer la pièce jointe ?');
}
if (r) { if (r) {
var resId: number; var resId: number;
if (attachment.res_id == 0) { if (attachment.res_id == 0) {
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment