diff --git a/apps/maarch_entreprise/indexing_searching/search_adv.php b/apps/maarch_entreprise/indexing_searching/search_adv.php
index bf2f98444dd96541805bbb6db58f41f86a4b7b78..6269eb45e4e122c23e03b4961c9b7aa534287050 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv.php
@@ -126,32 +126,29 @@ $browser_ie = 'false';
 $class_for_form = 'forms';
 $hr = '';
 $size = '';
-// $size = 'style="width:40px;"';
 
 // building of the parameters array used to pre-load the category list and the search elements
 $param = array();
 
-// Indexes specific to doctype
-$indexes = $type->get_all_indexes($coll_id);
+// Custom fields
+$customFields = \CustomField\models\CustomFieldModel::get();
+foreach ($customFields as $customField) {
+    $field = 'indexingCustomField_'.$customField['id'];
 
-for ($i = 0; $i < count($indexes); ++$i) {
-    $field = $indexes[$i]['column'];
-    if (preg_match('/^custom_/', $field)) {
-        $field = 'doc_'.$field;
-    }
-    if ($indexes[$i]['type_field'] == 'select') {
+    if (in_array($customField['type'], ['select', 'radio', 'checkbox'])) {
         $arr_tmp = array();
         array_push($arr_tmp, array('VALUE' => '', 'LABEL' => _CHOOSE.'...'));
-        for ($j = 0; $j < count($indexes[$i]['values']); ++$j) {
-            array_push($arr_tmp, array('VALUE' => $indexes[$i]['values'][$j]['id'], 'LABEL' => $indexes[$i]['values'][$j]['label']));
+        $customValues = json_decode($customField['values'], true);
+        foreach ($customValues as $customValue) {
+            array_push($arr_tmp, array('VALUE' => $customValue, 'LABEL' => $customValue));
         }
-        $arr_tmp2 = array('label' => $indexes[$i]['label'], 'type' => 'select_simple', 'param' => array('field_label' => $indexes[$i]['label'], 'default_label' => '', 'options' => $arr_tmp));
-    } elseif ($indexes[$i]['type'] == 'date') {
-        $arr_tmp2 = array('label' => $indexes[$i]['label'], 'type' => 'date_range', 'param' => array('field_label' => $indexes[$i]['label'], 'id1' => $field.'_from', 'id2' => $field.'_to'));
-    } elseif ($indexes[$i]['type'] == 'string') {
-        $arr_tmp2 = array('label' => $indexes[$i]['label'], 'type' => 'input_text', 'param' => array('field_label' => $indexes[$i]['label'], 'other' => $size));
-    } else {  // integer or float
-        $arr_tmp2 = array('label' => $indexes[$i]['label'], 'type' => 'num_range', 'param' => array('field_label' => $indexes[$i]['label'], 'id1' => $field.'_min', 'id2' => $field.'_max'));
+        $arr_tmp2 = array('label' => $customField['label'], 'type' => 'select_simple', 'param' => array('field_label' => $customField['label'], 'default_label' => '', 'options' => $arr_tmp));
+    } elseif ($customField['type'] == 'date') {
+        $arr_tmp2 = array('label' => $customField['label'], 'type' => 'date_range', 'param' => array('field_label' => $customField['label'], 'id1' => $field.'_from', 'id2' => $field.'_to'));
+    } elseif ($customField['type'] == 'string') {
+        $arr_tmp2 = array('label' => $customField['label'], 'type' => 'input_text', 'param' => array('field_label' => $customField['label'], 'other' => ''));
+    } else {  // integer
+        $arr_tmp2 = array('label' => $customField['label'], 'type' => 'num_range', 'param' => array('field_label' => $customField['label'], 'id1' => $field.'_min', 'id2' => $field.'_max'));
     }
     $param[$field] = $arr_tmp2;
 }
diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
index 5224cf831609cea160cd35ebf43a1cc6dde6b24c..13028bf80fc30d44fbb7e2b38a77a1c82b8871f5 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
@@ -133,14 +133,12 @@ if (count($_REQUEST['meta']) > 0) {
                 $arrayPDO = array_merge($arrayPDO, array(":initiatorServiceChosen" => $_REQUEST['initiatorServices_chosen']));
                 $json_txt .= '],';
             } elseif ($tab_id_fields[$j] == 'multifield' && !empty($_REQUEST['multifield'])) {
-                // MULTIFIELD : subject, title, doc_custom_t1, process notes
+                // MULTIFIELD : subject, process notes
                 $multifield = trim($_REQUEST['multifield']);
                 $json_txt .= "'multifield' : ['".addslashes(trim($multifield))."'],";
 
                 $where_request .= "(REGEXP_REPLACE(lower(translate(subject,'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')),'( ){2,}', ' ') like lower(:multifield) "
                     ."or (lower(translate(alt_identifier,'/','')) like lower(:multifield) OR lower(alt_identifier) like lower(:multifield)) "
-                    ."or lower(title) LIKE lower(:multifield) "
-                    ."or lower(doc_custom_t1) LIKE lower(:multifield) "
                     ."or lower(description) LIKE lower(:multifield) "
                     ."or lower(barcode) LIKE lower(:multifield) "
                     ."or res_id in (select identifier from notes where lower(translate(note_text,'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')) like lower(:multifield)) "
@@ -188,7 +186,7 @@ if (count($_REQUEST['meta']) > 0) {
             elseif ($tab_id_fields[$j] == 'signatory_group' && !empty($_REQUEST['signatory_group'])) {
                 $json_txt .= " 'signatory_group' : ['".addslashes(trim($_REQUEST['signatory_group']))."'],";
                 $where_request .= " (res_id in (select res_id from listinstance where item_id in (select user_id from usergroup_content where group_id = :signatoryGroup) "
-                        ."and coll_id = '" . $coll_id . "' and item_mode = 'sign' and difflist_type = 'VISA_CIRCUIT')) ";
+                        ."and item_mode = 'sign' and difflist_type = 'VISA_CIRCUIT')) ";
                 $arrayPDO = array_merge($arrayPDO, array(":signatoryGroup" => $_REQUEST['signatory_group']));
                 $where_request .=" and  ";
             }
@@ -432,8 +430,6 @@ if (count($_REQUEST['meta']) > 0) {
                 $where_request_welcome .= "( REGEXP_REPLACE(lower(translate(subject,'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')),'( ){2,}', ' ') like lower(:multifieldWelcome) "
                     ."or lower(external_reference) LIKE lower(:multifieldWelcomeReference) "
                     ."or (lower(translate(alt_identifier,'/','')) like lower(:multifieldWelcome) OR lower(alt_identifier) like lower(:multifieldWelcome)) "
-                    ."or lower(title) LIKE lower(:multifieldWelcome) "
-                    ."or lower(description) LIKE lower(:multifieldWelcome) "
                     ."or lower(barcode) LIKE lower(:multifieldWelcome) "
                     ."or res_id in (select identifier from notes where lower(translate(note_text,'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ','aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr')) like lower(:multifieldWelcome)) "
                     ."or res_id in (select res_id_master from res_view_attachments where (lower(translate(identifier,'/','')) like lower(:multifieldWelcome) OR lower(identifier) like lower(:multifieldWelcome)) AND status NOT IN ('DEL','OBS','TMP')) "
diff --git a/apps/maarch_entreprise/keywords_help.php b/apps/maarch_entreprise/keywords_help.php
deleted file mode 100755
index c9b8312f83b1a03a4a9ed1334a1d7236116e4502..0000000000000000000000000000000000000000
--- a/apps/maarch_entreprise/keywords_help.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2015 Maarch
-*
-*  This file is part of Maarch Framework.
-*
-*   Maarch Framework is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU General Public License as published by
-*   the Free Software Foundation, either version 3 of the License, or
-*   (at your option) any later version.
-*
-*   Maarch Framework is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*    along with Maarch Framework.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
-* File : keywords_help.php
-*
-* Help for keywords
-*
-* @package  Maarch Letterbox 3.0
-* @version 2.1
-* @since 10/2005
-* @license GPL
-* @author  Loïc Vinet  <dev@maarch.org>
-*/
-
-function show_helper($mode)
-{
-    $core_tools = new core_tools();
-    $core_tools->load_lang();
-    $core_tools->load_html();
-    ?>
-    <div class="block small_text" >
-
-
-    <h3><i class ="fa fa-info-circle fa-3x" ></i> <?php echo _HELP_KEYWORDS;?></h3>
-    <?php  
-
-        echo "<p align='right'>";
-            echo "<b><u>"._HELP_BY_CORE.":</u></b><br/><br/>";
-        echo "</p>";
-        echo "<p>";
-            echo "<b>@user : </b><em>"._HELP_KEYWORD0."</em>";
-        echo "</p>";
-        echo "<p>";
-            echo "<b>@email : </b><em>" . _HELP_KEYWORD_EMAIL . "</em>";
-        echo "</p><br/>";
-
-    if($core_tools->is_module_loaded('entities') == true)
-    {
-            echo "<p align='right'>";
-                echo "<b><u>"._HELP_BY_ENTITY.":</u></b><br/><br/>";
-            echo "</p>";
-            echo "<p align='justify'>";
-                echo "<p><b>@my_entities : </b><em>"._HELP_KEYWORD1."</em></p>";
-                echo "<p><b>@my_primary_entity : </b><em>"._HELP_KEYWORD2."</em></p>";
-                echo "<p><b>@subentities[('entity_1',...,'entity_n')] : </b><em>"._HELP_KEYWORD3."</em><br/></p>";
-                echo "<p><b>@parent_entity['entity_id'] : <em></b>"._HELP_KEYWORD4."</em><br/></p>";
-                echo "<p><b>@sisters_entities['entity_id'] : <em></b>"._HELP_KEYWORD5."</em><br/></p>";
-                echo "<p><b>@entity_type['type'] : <em></b>"._HELP_KEYWORD9."</em><br/></p>";
-                echo "<p><b>@all_entities : <em></b>"._HELP_KEYWORD6."</em><br/></p>";
-                echo "<p><b>@immediate_children['entity_1',..., 'entity_id'] : </b><em>"._HELP_KEYWORD7."</em><br/></p>";
-                echo "<p><b>@ancestor_entities['entity_id'][depth] : </b><em>"._HELP_KEYWORD8."</em><br/></p>";
-                echo "<br/>"._HELP_KEYWORD_EXEMPLE_TITLE."<br/><br/>";
-                echo "<div style='border:1px black solid; padding:3px;'><b>"._HELP_KEYWORD_EXEMPLE."</b></div>";
-            echo "</p>";
-    }
-    echo "</div>";
-    echo "<div class='block_end'>&nbsp;</div>";
-    if($mode == 'popup')
-    {
-        echo '<br/><div align="center"><input type="button" class="button" name="close" value="'._CLOSE_WINDOW.'" onclick="self.close();"</div>';
-    }
-}
-
-if(isset($_REQUEST['mode']))
-{
-    $mode = trim($_REQUEST['mode']);
-}
-else
-{
-    $mode = '';
-}
-
-$core_tools = new core_tools();
-$core_tools->load_lang();
-$core_tools->load_html();
-$core_tools->load_header();
-echo '<div id="header">';
-show_helper($mode);
-echo '</div></body></html>';
-
-
diff --git a/core/class/SecurityControler.php b/core/class/SecurityControler.php
index f77a5033aca2885ca9129edff64247f9839da3e6..87d19a0ff56ed2c499819ca8284ad40ce2eebc75 100755
--- a/core/class/SecurityControler.php
+++ b/core/class/SecurityControler.php
@@ -403,19 +403,19 @@ class SecurityControler
     */
     public function process_where_clause($whereClause, $userId)
     {
+        if (preg_match('/@user_id/', $whereClause)) {
+            $user = \User\models\UserModel::getByLogin(['login' => $userId, 'select' => ['id']]);
+            $whereClause = str_replace('@user_id', "{$user['id']}", $whereClause);
+        }
         if (preg_match('/@user/', $whereClause)) {
             $whereClause = str_replace(
                 "@user", "'" . trim($userId) . "'", $whereClause
             );
         }
-        $db = new Database();
-        
-        $query = "select mail from " . USERS_TABLE . " where user_id = ?";
-        $stmt = $db->query($query, array($userId));
-        $userObj = $stmt->fetchObject();
         if (preg_match('/@email/', $whereClause)) {
+            $user = \User\models\UserModel::getByLogin(['login' => $userId, 'select' => ['mail']]);
             $whereClause = str_replace(
-                "@email", "'" . trim($userObj->mail) . "'", $whereClause
+                "@email", "'" . trim($user['mail']) . "'", $whereClause
             );
         }
         return $whereClause;
diff --git a/migration/19.12/1912.sql b/migration/19.12/1912.sql
index 2df2e41cc6552797508864fd082991e959bdcd8e..82903dab84aaf0e47694b8b014e3ab0c1ded4f24 100644
--- a/migration/19.12/1912.sql
+++ b/migration/19.12/1912.sql
@@ -243,10 +243,11 @@ DO $$ BEGIN
         ALTER TABLE res_letterbox ALTER COLUMN typist_tmp set not null;
         ALTER TABLE res_letterbox DROP COLUMN IF EXISTS typist;
         ALTER TABLE res_letterbox RENAME COLUMN typist_tmp TO typist;
+        UPDATE baskets SET basket_clause = REPLACE(basket_clause, 'typist = @user', 'typist = @user_id');
+        UPDATE security SET where_clause = REPLACE(where_clause, 'typist = @user', 'typist = @user_id');
     END IF;
 END$$;
 
-
 /* MLB COLL EXT */
 DO $$ BEGIN
     IF (SELECT count(attname) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'res_letterbox') AND attname = 'category_id') = 0 THEN
@@ -422,12 +423,14 @@ ALTER TABLE res_letterbox DROP COLUMN IF EXISTS tablename;
 ALTER TABLE res_letterbox DROP COLUMN IF EXISTS validation_date;
 ALTER TABLE listinstance DROP COLUMN IF EXISTS added_by_entity;
 ALTER TABLE listinstance DROP COLUMN IF EXISTS coll_id;
+UPDATE baskets SET basket_clause = REPLACE(basket_clause, 'coll_id = ''letterbox_coll'' AND', '') WHERE basket_id in ('CopyMailBasket', 'DdeAvisBasket');
+UPDATE baskets SET basket_clause = REPLACE(basket_clause, 'coll_id = ''letterbox_coll'' and', '') WHERE basket_id in ('CopyMailBasket', 'DdeAvisBasket');
+
 ALTER TABLE listinstance DROP COLUMN IF EXISTS listinstance_type;
 ALTER TABLE listinstance DROP COLUMN IF EXISTS visible;
 ALTER TABLE listinstance_history_details DROP COLUMN IF EXISTS added_by_entity;
 
 
-
 /* RE CREATE VIEWS */
 CREATE VIEW res_view_attachments AS
   SELECT '0' as res_id, res_id as res_id_version, title, subject, description, type_id, format, typist,
diff --git a/modules/life_cycle/batch/extract_data.php b/modules/life_cycle/batch/extract_data.php
index f8e8cd7cd0fc12f3cf739c57dc79ef7435fb3651..0e5236ab3c5a8ca11d0e57ab30d9275890e46f93 100755
--- a/modules/life_cycle/batch/extract_data.php
+++ b/modules/life_cycle/batch/extract_data.php
@@ -200,8 +200,8 @@ try {
 
         #### Department Full Name ####
         $department_name = "";
-        if($selectedFile->doc_custom_t1 <> ""){
-            $department_name = $selectedFile->doc_custom_t1 . " - " .$depts[$selectedFile->doc_custom_t1];
+        if($selectedFile->department_number_id <> ""){
+            $department_name = $selectedFile->department_number_id . " - " .$depts[$selectedFile->department_number_id];
         }
 
         #### Info contacts ####
diff --git a/modules/life_cycle/batch/extract_data_2.php b/modules/life_cycle/batch/extract_data_2.php
index 2a11c930428eed7f6a8000a2168698ba94adefd6..47a6db9658bcb9b0aded61fc2bd9f6e92de5880b 100755
--- a/modules/life_cycle/batch/extract_data_2.php
+++ b/modules/life_cycle/batch/extract_data_2.php
@@ -193,8 +193,8 @@ try {
 
         #### Department Full Name ####
         $department_name = "";
-        if($selectedFile->doc_custom_t1 <> ""){
-            $department_name = $selectedFile->doc_custom_t1 . " - " .$depts[$selectedFile->doc_custom_t1];
+        if($selectedFile->department_number_id <> ""){
+            $department_name = $selectedFile->department_number_id . " - " .$depts[$selectedFile->department_number_id];
         }
 
         #### Info contacts ####
diff --git a/sql/data_fr.sql b/sql/data_fr.sql
index 6b46092f504f262af97da4bf930d10ce806085fc..c4bad2f200c96ba9fa01fd43ada168446dd8cb4c 100755
--- a/sql/data_fr.sql
+++ b/sql/data_fr.sql
@@ -637,7 +637,7 @@ INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id
 DELETE FROM baskets WHERE basket_id = 'CopyMailBasket';
 DELETE FROM actions_groupbaskets WHERE basket_id = 'CopyMailBasket';
 DELETE FROM groupbasket_redirect WHERE basket_id = 'CopyMailBasket';
-INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id, is_visible, flag_notif, enabled, basket_order) VALUES ('CopyMailBasket', 'Courriers en copie', 'Courriers en copie non clos ou sans suite', '(res_id in (select res_id from listinstance WHERE coll_id = ''letterbox_coll'' and item_type = ''user_id'' and item_id = @user and item_mode = ''cc'') or res_id in (select res_id from listinstance WHERE coll_id = ''letterbox_coll'' and item_type = ''entity_id'' and item_mode = ''cc'' and item_id in (@my_entities))) and status not in ( ''DEL'', ''END'', ''SSUITE'') and res_id not in (select res_id from res_mark_as_read WHERE user_id = @user)', 'letterbox_coll', 'Y', 'N', 'Y',60);
+INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id, is_visible, flag_notif, enabled, basket_order) VALUES ('CopyMailBasket', 'Courriers en copie', 'Courriers en copie non clos ou sans suite', '(res_id in (select res_id from listinstance WHERE item_type = ''user_id'' and item_id = @user and item_mode = ''cc'') or res_id in (select res_id from listinstance WHERE item_type = ''entity_id'' and item_mode = ''cc'' and item_id in (@my_entities))) and status not in ( ''DEL'', ''END'', ''SSUITE'') and res_id not in (select res_id from res_mark_as_read WHERE user_id = @user)', 'letterbox_coll', 'Y', 'N', 'Y',60);
 DELETE FROM baskets WHERE basket_id = 'RetourCourrier';
 DELETE FROM actions_groupbaskets WHERE basket_id = 'RetourCourrier';
 DELETE FROM groupbasket_redirect WHERE basket_id = 'RetourCourrier';
@@ -645,7 +645,7 @@ INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id
 DELETE FROM baskets WHERE basket_id = 'DdeAvisBasket';
 DELETE FROM actions_groupbaskets WHERE basket_id = 'DdeAvisBasket';
 DELETE FROM groupbasket_redirect WHERE basket_id = 'DdeAvisBasket';
-INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id, is_visible, flag_notif, enabled, basket_order) VALUES ('DdeAvisBasket', 'Avis : Avis à émettre', 'Courriers nécessitant un avis', 'status = ''EAVIS'' AND res_id IN (SELECT res_id FROM listinstance WHERE coll_id = ''letterbox_coll'' AND item_type = ''user_id'' AND item_id = @user AND item_mode = ''avis'' and process_date is NULL)', 'letterbox_coll', 'Y', 'N', 'Y',80);
+INSERT INTO baskets (basket_id, basket_name, basket_desc, basket_clause, coll_id, is_visible, flag_notif, enabled, basket_order) VALUES ('DdeAvisBasket', 'Avis : Avis à émettre', 'Courriers nécessitant un avis', 'status = ''EAVIS'' AND res_id IN (SELECT res_id FROM listinstance WHERE item_type = ''user_id'' AND item_id = @user AND item_mode = ''avis'' and process_date is NULL)', 'letterbox_coll', 'Y', 'N', 'Y',80);
 DELETE FROM baskets WHERE basket_id = 'SupAvisBasket';
 DELETE FROM actions_groupbaskets WHERE basket_id = 'SupAvisBasket';
 DELETE FROM groupbasket_redirect WHERE basket_id = 'SupAvisBasket';
diff --git a/sql/sample.sql b/sql/sample.sql
index 79dfe995efbccb7a7b8001b35d4deee5b52fc888..2a2d802b617a2e9a8f057c7f999445ab10526290 100644
--- a/sql/sample.sql
+++ b/sql/sample.sql
@@ -3,52 +3,52 @@ TRUNCATE TABLE res_letterbox;
 ALTER SEQUENCE res_id_mlb_seq restart WITH 1;
 -- to sign documents
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (1, 'Demande de dérogation carte scolaire', '', 305, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_derogation.pdf', '', '0', 24942, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'bbain', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/1', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (1, 'Demande de dérogation carte scolaire', '', 305, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_derogation.pdf', '', '0', 24942, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'bbain', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/1', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (2, 'Demande de travaux route 66', '', 918, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'sva_route_66.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/2', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (2, 'Demande de travaux route 66', '', 918, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'sva_route_66.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/2', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (3, 'Plainte voisin chien bruyant', '', 503, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'svr_route_chien_bruyant.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/3', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (3, 'Plainte voisin chien bruyant', '', 503, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'svr_route_chien_bruyant.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/3', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (4, 'Invitation pour échanges journées des sports', '', 110, 'pdf', 'bbain', NOW(), NOW(), NULL, NULL, 'with_empty_file', NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'empty.pdf', '', '0', 111108, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'PJS', 'bbain', 'outgoing', NULL, NULL, 4, NULL, 'MAARCH/2019D/4', NULL, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (4, 'Invitation pour échanges journées des sports', '', 110, 'pdf', 19, NOW(), NOW(), NULL, NULL, 'with_empty_file', NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'empty.pdf', '', '0', 111108, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'PJS', 'bbain', 'outgoing', NULL, NULL, 4, NULL, 'MAARCH/2019D/4', NULL, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (5, 'Demande de place en creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/4', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (5, 'Demande de place en creche', '', 307, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/4', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (6, 'Relance place en creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'relance_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/5', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (6, 'Relance place en creche', '', 307, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'relance_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/5', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to annotate documents
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (7, 'Pétition pour la survie du square Carré', '', 201, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'petition_square_carre.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 7, 'incoming', 5, NULL, NULL, NULL, 'MAARCH/2019A/6', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 7, 1);
+VALUES (7, 'Pétition pour la survie du square Carré', '', 201, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'petition_square_carre.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 7, 'incoming', 5, NULL, NULL, NULL, 'MAARCH/2019A/6', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 7, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (8, 'Félicitations élections', '', 205, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'felicitations.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 8, 'incoming', 6, NULL, NULL, NULL, 'MAARCH/2019A/7', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 8, 1);
+VALUES (8, 'Félicitations élections', '', 205, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'felicitations.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 8, 'incoming', 6, NULL, NULL, NULL, 'MAARCH/2019A/7', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 8, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (9, 'Demande place creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'formulaire_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 9, 'incoming', 7, NULL, NULL, NULL, 'MAARCH/2019A/8', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 9, 1);
+VALUES (9, 'Demande place creche', '', 307, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'formulaire_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 9, 'incoming', 7, NULL, NULL, NULL, 'MAARCH/2019A/8', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 9, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (10, 'Demande subvention jokkolabs', '', 406, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_subvention.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 10, 'incoming', 1, NULL, NULL, NULL, 'MAARCH/2019A/9', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 10, 1);
+VALUES (10, 'Demande subvention jokkolabs', '', 406, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_subvention.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 10, 'incoming', 1, NULL, NULL, NULL, 'MAARCH/2019A/9', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 10, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (11, 'Facture Maarch', '', 407, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'facture.pdf', '', '0', 24877, 'ATT_MP', 'FIN', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'sstar', 11, 'incoming', 1, NULL, NULL, NULL, 'MAARCH/2019A/10', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 10, 1);
+VALUES (11, 'Facture Maarch', '', 407, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'facture.pdf', '', '0', 24877, 'ATT_MP', 'FIN', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'sstar', 11, 'incoming', 1, NULL, NULL, NULL, 'MAARCH/2019A/10', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 10, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (12, 'Demande état civil', '', 602, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'etat_civil.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 12, 'incoming', 8, NULL, NULL, NULL, 'MAARCH/2019A/11', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 11, 1);
+VALUES (12, 'Demande état civil', '', 602, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'etat_civil.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'rrenaud', 12, 'incoming', 8, NULL, NULL, NULL, 'MAARCH/2019A/11', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 11, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (13, 'Arret maladie vide', '', 701, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'arret_maladie.pdf', '', '0', 24877, 'ATT_MP', 'DRH', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ppruvost', 13, 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/12', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (13, 'Arret maladie vide', '', 701, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'arret_maladie.pdf', '', '0', 24877, 'ATT_MP', 'DRH', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ppruvost', 13, 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/12', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, external_signatory_book_id, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (14, 'Inscription école', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'inscription_ecole.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 14, 'incoming', 7, NULL, NULL, NULL, 'MAARCH/2019A/13', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 9, 1);
+VALUES (14, 'Inscription école', '', 307, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'inscription_ecole.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ssaporta', 14, 'incoming', 7, NULL, NULL, NULL, 'MAARCH/2019A/13', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 9, 1);
 -- to qualify document
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (15, 'Demande intervention à qualifier', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'INIT', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/14', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (15, 'Demande intervention à qualifier', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'INIT', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/14', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to validate document
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (16, 'Demande intervention à valider', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'VAL', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/15', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (16, 'Demande intervention à valider', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'VAL', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/15', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to process document ccharles
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (17, 'Demande intervention à traiter', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/16', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (17, 'Demande intervention à traiter', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/16', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to process document nnataly
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (18, 'Demande intervention à envoyer au parapheur', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PSO', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'nnataly', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/17', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (18, 'Demande intervention à envoyer au parapheur', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PSO', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'nnataly', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/17', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to paraph document ppetit
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (19, 'Demande intervention à signer', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/18', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (19, 'Demande intervention à signer', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/18', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 -- to archive document ggrand
 INSERT INTO res_letterbox (res_id, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, reference_number, tablename, initiator, dest_user, category_id, exp_contact_id, exp_user_id, dest_contact_id, dest_user_id, alt_identifier, admission_date, process_limit_date, closing_date, alarm1_date, alarm2_date, flag_alarm1, flag_alarm2, is_multicontacts, address_id, model_id)
-VALUES (20, 'Demande intervention à archiver', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'END', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/19', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
+VALUES (20, 'Demande intervention à archiver', '', 505, 'pdf', 21, NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'END', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', '', 'res_letterbox', 'COU', 'ccharles', 'incoming', 4, NULL, NULL, NULL, 'MAARCH/2019A/19', CURRENT_DATE, CURRENT_DATE + 21, NULL, NULL, NULL, 'N', 'N', NULL, 6, 1);
 
 Select setval('res_id_mlb_seq', (select max(res_id)+1 from res_letterbox), false);
 
diff --git a/src/core/controllers/PreparedClauseController.php b/src/core/controllers/PreparedClauseController.php
index 228e0f1e9f52573d8936ff209c0a2d7e9110bcf5..ca59650018c864a8f9cc9e97a21d66024d569eb8 100755
--- a/src/core/controllers/PreparedClauseController.php
+++ b/src/core/controllers/PreparedClauseController.php
@@ -28,6 +28,10 @@ class PreparedClauseController
 
         $clause = $aArgs['clause'];
 
+        if (preg_match('/@user_id/', $clause)) {
+            $user = UserModel::getByLogin(['login' => $aArgs['login'], 'select' => ['id']]);
+            $clause = str_replace('@user_id', "{$user['id']}", $clause);
+        }
         if (preg_match('/@user/', $clause)) {
             $clause = str_replace('@user', "'{$aArgs['login']}'", $clause);
         }
diff --git a/src/frontend/app/administration/basket/basket-administration-settings-modal.component.html b/src/frontend/app/administration/basket/basket-administration-settings-modal.component.html
index e3354ef0fc273cd415fd8ab9e5e3f27a8507cddd..c79b4a98fc03c2593791782e9bb1fffbd7ffcf8c 100755
--- a/src/frontend/app/administration/basket/basket-administration-settings-modal.component.html
+++ b/src/frontend/app/administration/basket/basket-administration-settings-modal.component.html
@@ -62,6 +62,8 @@
                             </div>
                             <h4 mat-line style="font-weight:bold;font-size:10px;">@user :</h4>
                             <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_1}}</p>
+                            <h4 mat-line style="font-weight:bold;font-size:10px;">@user_id :</h4>
+                            <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_12}}</p>
                             <h4 mat-line style="font-weight:bold;font-size:10px;">@email :</h4>
                             <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_2}}</p>
                             <h4 mat-line style="font-weight:bold;font-size:10px;">@my_entities :</h4>
diff --git a/src/frontend/app/administration/basket/basket-administration.component.html b/src/frontend/app/administration/basket/basket-administration.component.html
index 4ce327b71b71eb753126a318ac189f52f01d481f..b182a0ddb145a0a7211fcf4465dae11c00389271 100755
--- a/src/frontend/app/administration/basket/basket-administration.component.html
+++ b/src/frontend/app/administration/basket/basket-administration.component.html
@@ -205,6 +205,8 @@
                 </div>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@user :</h4>
                 <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_1}}</p>
+                <h4 mat-line style="font-weight:bold;font-size:10px;">@user_id :</h4>
+                <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_12}}</p>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@email :</h4>
                 <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_2}}</p>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@my_entities :</h4>
diff --git a/src/frontend/app/administration/group/group-administration.component.html b/src/frontend/app/administration/group/group-administration.component.html
index 887a8b64cd4ef4017e2c71792d970f32338b7274..2f72d9e9cc70f720fe8b89d54faf75ecd5d107c4 100755
--- a/src/frontend/app/administration/group/group-administration.component.html
+++ b/src/frontend/app/administration/group/group-administration.component.html
@@ -153,6 +153,8 @@
                 </div>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@user :</h4>
                 <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_1}}</p>
+                <h4 mat-line style="font-weight:bold;font-size:10px;">@user_id :</h4>
+                <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_12}}</p>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@email :</h4>
                 <p mat-line style="font-size:10px;">{{lang.keywordHelpDesc_2}}</p>
                 <h4 mat-line style="font-weight:bold;font-size:10px;">@my_entities :</h4>
diff --git a/src/frontend/lang/lang-en.ts b/src/frontend/lang/lang-en.ts
index a86c23aec0567dbfa9b000072e2e865dbd47f926..471785867277f5c2d8864fd140fb569ed12572fb 100755
--- a/src/frontend/lang/lang-en.ts
+++ b/src/frontend/lang/lang-en.ts
@@ -473,6 +473,7 @@ export const LANG_EN = {
     "keyword"                               : "Keyword",
     "keywordHelp"                           : "Keyword help",
     "keywordHelpDesc_1"                     : "Identifier of logged user",
+    "keywordHelpDesc_12"                    : "Technical user id of logged user",
     "keywordHelpDesc_10"                    : "Immediate sub-entities (n-1) of entities passed in argument",
     "keywordHelpDesc_11"                    : "Example of security definition for a group (where clause) : access of main entity of logged user or sub-entity of this entity",
     "keywordHelpDesc_2"                     : "Email of logged user",
diff --git a/src/frontend/lang/lang-fr.ts b/src/frontend/lang/lang-fr.ts
index fe35b41e487907c109df659d2132aa687843cfde..9e05383b3fdf9be3d7e1320b487d7c2b93129b4b 100755
--- a/src/frontend/lang/lang-fr.ts
+++ b/src/frontend/lang/lang-fr.ts
@@ -496,6 +496,7 @@ export const LANG_FR = {
     "keyword"                               : "Mot-clé",
     "keywordHelp"                           : "Aide sur les mots-clés",
     "keywordHelpDesc_1"                     : "Identifiant de l'utilisateur connecté",
+    "keywordHelpDesc_12"                    : "Identifiant technique de l'utilisateur connecté",
     "keywordHelpDesc_10"                    : "Sous-entités immédiates (n-1) des entités données en argument",
     "keywordHelpDesc_11"                    : "Exemple de périmètre documentaire : accès aux ressources concernant le service principal de l'utilisateur connecté, ou les sous-services de ce service",
     "keywordHelpDesc_2"                     : "Courriel de l'utilisateur connecté",
diff --git a/src/frontend/lang/lang-nl.ts b/src/frontend/lang/lang-nl.ts
index adc742e214e70aada1e6b8e1af3b6b91982203c5..9e0ab6f410abf354b6606cffa406c8d417d0b3ff 100755
--- a/src/frontend/lang/lang-nl.ts
+++ b/src/frontend/lang/lang-nl.ts
@@ -488,6 +488,7 @@ export const LANG_NL = {
     "keyword"                               : "Sleutelwoord",
     "keywordHelp"                           : "Hulp voor sleutelwoorden",
     "keywordHelpDesc_1"                     : "Gebruikersnaam van de verbonden gebruiker",
+    "keywordHelpDesc_12"                    : "Technical user id of logged user", //_TO_TRANSLATE
     "keywordHelpDesc_10"                    : "Subeenheden die direct onder (n-1) de in het argument gegeven eenheden liggen",
     "keywordHelpDesc_11"                    : "Voorbeeld van documentaire perimeter toegang tot assets met betrekking tot de hoofddienst van de verbonden gebruiker of tot de subdiensten van deze dienst",
     "keywordHelpDesc_2"                     : "E-mail van de verbonden gebruiker",