From 56d1709173e3795f232e509f66769124310d11ae Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Fri, 8 Mar 2019 12:14:31 +0100
Subject: [PATCH] FIX #9685 remove old functon + refactoring app-note

---
 src/app/note/models/NoteModel.php               | 17 -----------------
 .../close-and-index-action.component.html       |  2 +-
 .../confirm-action.component.html               |  2 +-
 ...cknowledgement-receipt-action.component.html |  2 +-
 ...nowledgement-send-date-action.component.html |  2 +-
 5 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/src/app/note/models/NoteModel.php b/src/app/note/models/NoteModel.php
index 8a2cdd4b9f5..4b5ac8b452e 100755
--- a/src/app/note/models/NoteModel.php
+++ b/src/app/note/models/NoteModel.php
@@ -218,21 +218,4 @@ class NoteModel
 
         return $notes;
     }
-
-    public static function getTemplateList(array $aArgs = [])
-    {
-        ValidatorModel::arrayType($aArgs, ['entityIds']);
-
-        //get notes
-        $aReturn = DatabaseModel::select([
-            'select'    => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
-            'table'     => ['templates','templates_association'],
-            'left_join' => ['templates.template_id = templates_association.template_id'],
-            'where'     => ['templates.template_target = ?','templates_association.value_field IN (?)'],
-            'data'      => ['notes', $aArgs['entityIds']],
-            'order_by'  => empty($aArgs['orderBy']) ? ['template_label'] : $aArgs['orderBy']
-        ]);
-
-        return $aReturn;
-    }
 }
diff --git a/src/frontend/app/actions/close-and-index-action/close-and-index-action.component.html b/src/frontend/app/actions/close-and-index-action/close-and-index-action.component.html
index bdf7e3715fe..3b7dd1c614d 100644
--- a/src/frontend/app/actions/close-and-index-action/close-and-index-action.component.html
+++ b/src/frontend/app/actions/close-and-index-action/close-and-index-action.component.html
@@ -12,7 +12,7 @@
             <div class="alert-message alert-message-danger" role="alert" style="margin-top: 30px;" [innerHTML]="lang.openIndexation"></div>
         </div>
         <div class="col-md-12">
-            <app-note-editor #noteEditor></app-note-editor>
+            <app-note-editor #noteEditor [resIds]="data.selectedRes"></app-note-editor>
         </div>
     </div>
 </div>
diff --git a/src/frontend/app/actions/confirm-action/confirm-action.component.html b/src/frontend/app/actions/confirm-action/confirm-action.component.html
index b271561a680..e1410cdafca 100644
--- a/src/frontend/app/actions/confirm-action/confirm-action.component.html
+++ b/src/frontend/app/actions/confirm-action/confirm-action.component.html
@@ -10,7 +10,7 @@
             <b *ngIf="!data.contextMode" color="primary" class="highlight">{{data.selectedRes.length}} {{lang.elements}}</b> ?
         </div>
         <div class="col-md-12">
-            <app-note-editor #noteEditor></app-note-editor>
+            <app-note-editor #noteEditor [resIds]="data.selectedRes"></app-note-editor>
         </div>
     </div>
 </div>
diff --git a/src/frontend/app/actions/create-acknowledgement-receipt-action/create-acknowledgement-receipt-action.component.html b/src/frontend/app/actions/create-acknowledgement-receipt-action/create-acknowledgement-receipt-action.component.html
index 90c9a9a478e..5ca026817a1 100644
--- a/src/frontend/app/actions/create-acknowledgement-receipt-action/create-acknowledgement-receipt-action.component.html
+++ b/src/frontend/app/actions/create-acknowledgement-receipt-action/create-acknowledgement-receipt-action.component.html
@@ -56,7 +56,7 @@
             </div>
         </div>
         <div class="col-md-12" *ngIf="acknowledgement.sendEmail || acknowledgement.sendPaper">
-            <app-note-editor #noteEditor></app-note-editor>
+            <app-note-editor #noteEditor [resIds]="data.selectedRes"></app-note-editor>
         </div>
     </div>
 </div>
diff --git a/src/frontend/app/actions/update-acknowledgement-send-date-action/update-acknowledgement-send-date-action.component.html b/src/frontend/app/actions/update-acknowledgement-send-date-action/update-acknowledgement-send-date-action.component.html
index 169e0ec88c2..ffd533c1a93 100644
--- a/src/frontend/app/actions/update-acknowledgement-send-date-action/update-acknowledgement-send-date-action.component.html
+++ b/src/frontend/app/actions/update-acknowledgement-send-date-action/update-acknowledgement-send-date-action.component.html
@@ -19,7 +19,7 @@
             </div>
         </div>
         <div class="col-md-12">
-            <app-note-editor #noteEditor></app-note-editor>
+            <app-note-editor #noteEditor [resIds]="data.selectedRes"></app-note-editor>
         </div>
     </div>
 </div>
-- 
GitLab