From db2bd56103255b9a307c37a7985dec574b244a1e Mon Sep 17 00:00:00 2001
From: Alex Orluc <alex.orluc@maarch.org>
Date: Fri, 15 Jun 2018 17:52:57 +0200
Subject: [PATCH] FEAT #7737 ergo template

---
 .../app/administration/template-administration.component.ts    | 3 ++-
 apps/maarch_entreprise/js/angular/lang/lang-en.ts              | 1 +
 apps/maarch_entreprise/js/angular/lang/lang-fr.ts              | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/maarch_entreprise/js/angular/app/administration/template-administration.component.ts b/apps/maarch_entreprise/js/angular/app/administration/template-administration.component.ts
index 1aded62c83f..437b4678921 100755
--- a/apps/maarch_entreprise/js/angular/app/administration/template-administration.component.ts
+++ b/apps/maarch_entreprise/js/angular/app/administration/template-administration.component.ts
@@ -229,6 +229,7 @@ export class TemplateAdministrationComponent implements OnInit {
             .subscribe((data: any) => {
                 this.lockFound = data.lockFileFound;
                 if(!this.lockFound){
+                    this.notify.success(this.lang.modelUpdated);
                     clearInterval(this.intervalLockFile);
                 }
             });
@@ -255,7 +256,7 @@ export class TemplateAdministrationComponent implements OnInit {
         if(this.template.template_target!='notifications'){
             this.template.template_datasource=='letterbox_attachment';
         }
-        if(this.creationMode && this.template.template_style != 'uploadFile' && !this.template.userUniqueId){
+        if(this.creationMode && this.template.template_style != 'uploadFile' && !this.template.userUniqueId && this.template.target == 'OFFICE'){
             alert(this.lang.editModelFirst);
             return;
         }
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-en.ts b/apps/maarch_entreprise/js/angular/lang/lang-en.ts
index c28d8575f3a..24ad8d62a32 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-en.ts
+++ b/apps/maarch_entreprise/js/angular/lang/lang-en.ts
@@ -546,6 +546,7 @@ export const LANG_EN = {
     "confirmDuplicate"                  : "Do you really want to duplicate this template ?",
     "noDatasource"                      : "No datasources",
     "templateDuplicated"                : "Template duplicated",
+    "modelUpdated"                      : "Model updated",
     "importFile"                        : "Import a file",
     "allAttachments"                    : "All attachments",
     "editModelFirst"                    : "Please edit model first"
diff --git a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
index ffae694d4ad..411015169f2 100755
--- a/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
+++ b/apps/maarch_entreprise/js/angular/lang/lang-fr.ts
@@ -568,6 +568,7 @@ export const LANG_FR = {
     "confirmDuplicate"                  : "Voulez-vous vraiment dupliquer ce template ?",
     "noDatasource"                      : "Aucune source de données",
     "templateDuplicated"                : "Modèle dupliqué",
+    "modelUpdated"                      : "Le Modèle a été mis à jour",
     "importFile"                        : "Importer un fichier",
     "allAttachments"                    : "Tous les attachements",
     "editModelFirst"                    : "Veuillez éditer le modèle avant de valider"
-- 
GitLab