From 9f515947e084987e510cb3800f4cc8478b6fe7ad Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Thu, 29 Aug 2019 15:19:45 +0100
Subject: [PATCH] FEAT #11422 TIME 1:15 delete folder elements

---
 apps/maarch_entreprise/actions/index_mlb.php  |  103 --
 apps/maarch_entreprise/actions/process.php    |  124 +-
 .../actions/validate_mail.php                 |   99 +-
 .../class_business_app_tools_Abstract.php     |   30 +-
 .../class/class_chrono_Abstract.php           |   43 -
 .../class_indexing_searching_app_Abstract.php |   75 -
 .../class/class_lists_Abstract.php            |   83 --
 .../definition_mail_categories.php            |  105 +-
 .../indexing_searching/details.php            |   24 +-
 .../documents_list_mlb_search_adv.php         |    4 -
 .../indexing_searching/search_adv.php         |   12 -
 .../indexing_searching/search_adv_result.php  |   20 -
 apps/maarch_entreprise/js/indexing.js         |   24 -
 apps/maarch_entreprise/lang/en.php            |   53 -
 apps/maarch_entreprise/lang/fr.php            |   53 +-
 apps/maarch_entreprise/lang/nl.php            |   17 -
 apps/maarch_entreprise/welcome.php            |    1 -
 apps/maarch_entreprise/xml/config.xml.default |    4 -
 core/manage_action.php                        |   18 +-
 migration/19.12/1912.sql                      |    3 +-
 modules/basket/lang/en.php                    |    4 -
 modules/basket/lang/fr.php                    |    4 -
 modules/basket/lang/nl.php                    |    6 -
 .../entities/admin_listmodel_setObjectId.php  |   22 -
 modules/folder/ajax_get_folder.php            |  255 ----
 modules/folder/ajax_get_project.php           |   63 -
 modules/folder/autocomplete_folders.php       |   99 --
 modules/folder/choose_doctypes.php            |  151 --
 .../folder/class/class_admin_foldertypes.php  |   27 -
 .../class_admin_foldertypes_Abstract.php      | 1218 -----------------
 modules/folder/class/class_folders_show.php   |   42 -
 .../class/class_folders_show_Abstract.php     |  388 ------
 modules/folder/class/class_modules_tools.php  |   40 -
 .../class/class_modules_tools_Abstract.php    | 1029 --------------
 .../class/cmis/cmis_folder_controller.php     |  616 ---------
 modules/folder/class/ws.php                   |   22 -
 modules/folder/close_folder.php               |   13 -
 modules/folder/create_folder_form.php         |  144 --
 modules/folder/create_folder_form_iframe.php  |  190 ---
 .../folder/create_folder_get_folder_index.php |  139 --
 .../create_folder_get_folder_index_comp.php   |   14 -
 modules/folder/css/module.css                 |  138 --
 modules/folder/documents_list_in_details.php  |  191 ---
 modules/folder/filling_res.php                |  250 ----
 modules/folder/folder_freeze.php              |   22 -
 modules/folder/folder_history.php             |  189 ---
 modules/folder/folder_tables.php              |   46 -
 modules/folder/folder_view_stats.php          |   32 -
 modules/folder/folders_list_by_id.php         |   66 -
 modules/folder/folders_list_by_name.php       |   65 -
 modules/folder/folders_list_search_adv.php    |  216 ---
 modules/folder/foldertype_add.php             |   28 -
 modules/folder/foldertype_add_db.php          |   12 -
 modules/folder/foldertype_del.php             |   21 -
 modules/folder/foldertype_list_by_name.php    |   65 -
 modules/folder/foldertype_up.php              |   39 -
 modules/folder/foldertype_up_db.php           |   12 -
 modules/folder/foldertypes.php                |  113 --
 modules/folder/get_folder_search_index.php    |  171 ---
 modules/folder/get_folder_view_stats_val.php  |  301 ----
 modules/folder/get_foldertypes.php            |   44 -
 modules/folder/js/functions.js                |  196 ---
 modules/folder/lang/en.php                    |  478 -------
 modules/folder/lang/fr.php                    |  482 -------
 modules/folder/lang/nl.php                    |  458 -------
 modules/folder/list_doc.php                   |   70 -
 modules/folder/manage_create_folder.php       |   10 -
 modules/folder/missing_res.php                |   91 --
 modules/folder/res_select_folder.php          |   75 -
 modules/folder/result_folder.php              |  125 --
 modules/folder/search_adv_folder.php          |  262 ----
 modules/folder/search_adv_folder_result.php   |  253 ----
 modules/folder/search_folder_tree.php         |  443 ------
 modules/folder/select_folder.php              |  191 ---
 modules/folder/select_user_report.php         |  149 --
 modules/folder/show_folder.php                |  468 -------
 modules/folder/xml/IVS/data_types.xml         |    3 -
 .../folder/xml/IVS/requests_definitions.xml   |  112 --
 modules/folder/xml/IVS/validation_rules.xml   |  129 --
 modules/folder/xml/config.xml                 |   36 -
 modules/folder/xml/folder_index.xml           |   65 -
 modules/folder/xml/menu.xml                   |   21 -
 modules/folder/xml/services.xml               |  141 --
 modules/notes/notes.php                       |    8 +-
 modules/notes/notes_ajax_content.php          |   15 +-
 modules/sendmail/sendmail_ajax_content.php    |    8 -
 sql/index_creation.sql                        |   10 -
 sql/reinit_sequences.sql                      |    2 -
 sql/sample.sql                                |  112 +-
 src/core/lang/lang-en.php                     |    3 -
 src/core/lang/lang-fr.php                     |    3 -
 src/core/lang/lang-nl.php                     |    3 -
 .../reports-administration.component.html     |    6 +-
 93 files changed, 78 insertions(+), 11752 deletions(-)
 delete mode 100755 modules/folder/ajax_get_folder.php
 delete mode 100755 modules/folder/ajax_get_project.php
 delete mode 100755 modules/folder/autocomplete_folders.php
 delete mode 100755 modules/folder/choose_doctypes.php
 delete mode 100755 modules/folder/class/class_admin_foldertypes.php
 delete mode 100755 modules/folder/class/class_admin_foldertypes_Abstract.php
 delete mode 100755 modules/folder/class/class_folders_show.php
 delete mode 100755 modules/folder/class/class_folders_show_Abstract.php
 delete mode 100755 modules/folder/class/class_modules_tools.php
 delete mode 100755 modules/folder/class/class_modules_tools_Abstract.php
 delete mode 100755 modules/folder/class/cmis/cmis_folder_controller.php
 delete mode 100755 modules/folder/class/ws.php
 delete mode 100755 modules/folder/close_folder.php
 delete mode 100755 modules/folder/create_folder_form.php
 delete mode 100755 modules/folder/create_folder_form_iframe.php
 delete mode 100755 modules/folder/create_folder_get_folder_index.php
 delete mode 100755 modules/folder/create_folder_get_folder_index_comp.php
 delete mode 100755 modules/folder/css/module.css
 delete mode 100755 modules/folder/documents_list_in_details.php
 delete mode 100755 modules/folder/filling_res.php
 delete mode 100755 modules/folder/folder_freeze.php
 delete mode 100755 modules/folder/folder_history.php
 delete mode 100755 modules/folder/folder_tables.php
 delete mode 100755 modules/folder/folder_view_stats.php
 delete mode 100755 modules/folder/folders_list_by_id.php
 delete mode 100755 modules/folder/folders_list_by_name.php
 delete mode 100755 modules/folder/folders_list_search_adv.php
 delete mode 100755 modules/folder/foldertype_add.php
 delete mode 100755 modules/folder/foldertype_add_db.php
 delete mode 100755 modules/folder/foldertype_del.php
 delete mode 100755 modules/folder/foldertype_list_by_name.php
 delete mode 100755 modules/folder/foldertype_up.php
 delete mode 100755 modules/folder/foldertype_up_db.php
 delete mode 100755 modules/folder/foldertypes.php
 delete mode 100755 modules/folder/get_folder_search_index.php
 delete mode 100755 modules/folder/get_folder_view_stats_val.php
 delete mode 100755 modules/folder/get_foldertypes.php
 delete mode 100755 modules/folder/js/functions.js
 delete mode 100755 modules/folder/lang/en.php
 delete mode 100755 modules/folder/lang/fr.php
 delete mode 100755 modules/folder/lang/nl.php
 delete mode 100755 modules/folder/list_doc.php
 delete mode 100755 modules/folder/manage_create_folder.php
 delete mode 100755 modules/folder/missing_res.php
 delete mode 100755 modules/folder/res_select_folder.php
 delete mode 100755 modules/folder/result_folder.php
 delete mode 100755 modules/folder/search_adv_folder.php
 delete mode 100755 modules/folder/search_adv_folder_result.php
 delete mode 100755 modules/folder/search_folder_tree.php
 delete mode 100755 modules/folder/select_folder.php
 delete mode 100755 modules/folder/select_user_report.php
 delete mode 100755 modules/folder/show_folder.php
 delete mode 100755 modules/folder/xml/IVS/data_types.xml
 delete mode 100755 modules/folder/xml/IVS/requests_definitions.xml
 delete mode 100755 modules/folder/xml/IVS/validation_rules.xml
 delete mode 100755 modules/folder/xml/config.xml
 delete mode 100755 modules/folder/xml/folder_index.xml
 delete mode 100755 modules/folder/xml/menu.xml
 delete mode 100755 modules/folder/xml/services.xml

diff --git a/apps/maarch_entreprise/actions/index_mlb.php b/apps/maarch_entreprise/actions/index_mlb.php
index 0236599c6d9..c19b5958cf1 100755
--- a/apps/maarch_entreprise/actions/index_mlb.php
+++ b/apps/maarch_entreprise/actions/index_mlb.php
@@ -34,9 +34,6 @@ $contacts_v2 = new contacts_v2();
 if ($core->is_module_loaded('entities')) {
     require_once 'modules/entities/entities_tables.php';
 }
-if ($core->is_module_loaded('folder')) {
-    require_once 'modules/folder/folder_tables.php';
-}
 require_once 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id']
     .DIRECTORY_SEPARATOR.'apps_tables.php';
 /**
@@ -904,37 +901,6 @@ function get_form_txt($values, $pathManageAction, $actionId, $table, $module, $c
             .'style="display:inline;"><i class="fa fa-star"></i></span>&nbsp;</td>';
     $frmStr .= '</tr>';
 
-    /*** Folder ***/
-    if ($core->is_module_loaded('folder') && ($core->test_service('associate_folder', 'folder', false) == 1)) {
-        require_once 'modules'.DIRECTORY_SEPARATOR.'folder'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_modules_tools.php';
-
-        $folders = new folder();
-
-        $folder_info = $folders->get_folders_tree('0');
-
-        $frmStr .= '<tr id="folder_tr" style="display:'.$displayValue.';">';
-        $frmStr .= '<td><label for="folder" class="form_title" >'._FOLDER_OR_SUBFOLDER.'</label></td>';
-        $frmStr .= '<td class="indexing_field" style="text-align:right;"><select id="folder" name="folder" onchange="displayFatherFolder(\'folder\')"><option value="">'._SELECT_FOLDER_TITLE.'</option>';
-
-        foreach ($folder_info as $key => $value) {
-            $frmStr .= '<option value="'.$value['folders_system_id'].'" parent="'.$value['parent_id'].'">'.$value['folder_name'].'</option>';
-        }
-        $frmStr .= '</select></td>';
-        if ($core->test_service('create_folder', 'folder', false) == 1) {
-            $pathScriptTab = $_SESSION['config']['businessappurl']
-                .'index.php?page=create_folder_form_iframe&module=folder&display=false';
-
-            $frmStr .= '<td style="width:5%;"> <a href="#" id="create_folder" title="'._CREATE_FOLDER
-                .'" onclick="loadTab(\''.$res_id.'\',\''.$coll_id.'\',\''._CREATE_FOLDER.'\',\''.$pathScriptTab.'\',\'folders\');return false;" '
-                .'style="display:inline;" ><i class="fa fa-plus-circle" title="'
-                ._CREATE_FOLDER.'"></i></a></td>';
-        }
-        $frmStr .= '<td><span class="red_asterisk" id="folder_mandatory" style="display:inline;"><i class="fa fa-star"></i></span>&nbsp;</td>';
-        $frmStr .= '</tr>';
-        $frmStr .= '<tr id="parentFolderTr" style="display: none;text-align:center;"><td>&nbsp;</td><td colspan="2"><span id="parentFolderSpan" style="font-style: italic;font-size: 10px"></span></td></tr>';
-        $frmStr .= '<script>$j("#folder").chosen({width: "226px", disable_search_threshold: 10, search_contains: true});</script>';
-    }
-
     /*** Thesaurus ***/
     if ($core->is_module_loaded('thesaurus') && $core->test_service('thesaurus_view', 'thesaurus', false)) {
         require_once 'modules'.DIRECTORY_SEPARATOR.'thesaurus'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_modules_tools.php';
@@ -1427,46 +1393,6 @@ function process_category_check($catId, $values)
             }
         }
     }
-    if ($core->is_module_loaded('folder')) {
-        $folderId = '';
-        $foldertypeId = '';
-
-        $folderId = get_value_fields($values, 'folder');
-
-        if (isset($_ENV['categories'][$catId]['other_cases']['folder'])
-            && $_ENV['categories'][$catId]['other_cases']['folder']['mandatory'] == true
-        ) {
-            if (empty($folderId)) {
-                $_SESSION['action_error'] = $_ENV['categories'][$catId]['other_cases']['folder']['label']
-                    .' '._IS_EMPTY;
-
-                return false;
-            }
-        }
-
-        if (!empty($typeId) && !empty($folderId)) {
-            $stmt = $db->query(
-                'SELECT foldertype_id FROM '.FOLD_FOLDERS_TABLE
-                .' WHERE folders_system_id = ?',
-                array($folderId)
-            );
-
-            $res = $stmt->fetchObject();
-            $foldertypeId = $res->foldertype_id;
-            $stmt = $db->query(
-                'SELECT fdl.foldertype_id FROM '
-                .FOLD_FOLDERTYPES_DOCTYPES_LEVEL1_TABLE.' fdl, '
-                .DOCTYPES_TABLE.' d WHERE d.doctypes_first_level_id = '
-                .'fdl.doctypes_first_level_id and fdl.foldertype_id = ? and d.type_id = ?',
-                array($foldertypeId, $typeId)
-            );
-            if ($stmt->rowCount() == 0) {
-                $_SESSION['action_error'] .= _ERROR_COMPATIBILITY_FOLDER;
-
-                return false;
-            }
-        }
-    }
 
     //For specific case => chrono number
     $chronoOut = get_value_fields($values, 'chrono_number');
@@ -1796,21 +1722,6 @@ function manage_form($arrId, $history, $actionId, $label_action, $status, $collI
         }
     }
 
-    if ($core->is_module_loaded('folder')) {
-        $folderId = get_value_fields($formValues, 'folder');
-
-        if (!empty($folderId)) {
-            array_push(
-                $_SESSION['data'],
-                array(
-                    'column' => 'folders_system_id',
-                    'value' => $folderId,
-                    'type' => 'integer',
-                )
-            );
-        }
-    }
-
     if ($core->is_module_loaded('entities')) {
         // Diffusion list
         $loadListDiff = false;
@@ -2005,20 +1916,6 @@ function manage_form($arrId, $history, $actionId, $label_action, $status, $collI
                    .' values '.$queryExtValues;
 
         $db->query($queryExt, $arrayPDO);
-        if ($core->is_module_loaded('folder') && !empty($folderId)
-            && $_SESSION['history']['folderup']
-        ) {
-            $hist = new history();
-            $hist->add(
-                $_SESSION['tablename']['fold_folders'],
-                $folderId,
-                'UP',
-                'folderup',
-                _DOC_NUM.$resId._ADDED_TO_FOLDER,
-                $_SESSION['config']['databasetype'],
-                'apps'
-            );
-        }
 
         if ($core->is_module_loaded('entities')) {
             if ($loadListDiff) {
diff --git a/apps/maarch_entreprise/actions/process.php b/apps/maarch_entreprise/actions/process.php
index 2b5dcc5b2cb..c0f77e7c1fe 100755
--- a/apps/maarch_entreprise/actions/process.php
+++ b/apps/maarch_entreprise/actions/process.php
@@ -276,7 +276,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module,
     $frm_str .= '<table width="95%" align="left" border="0">';
     // Displays the document indexes
     foreach (array_keys($data) as $key) {
-        if (!in_array($key, ['is_multicontacts', 'barcode', 'external_id','folder']) || ($key == 'is_multicontacts' && $data[$key]['show_value'] == 'Y') || (in_array($key, ['barcode', 'external_id']) && !empty($data[$key]['value']))) {
+        if (!in_array($key, ['is_multicontacts', 'barcode', 'external_id']) || ($key == 'is_multicontacts' && $data[$key]['show_value'] == 'Y') || (in_array($key, ['barcode', 'external_id']) && !empty($data[$key]['value']))) {
             $frm_str .= '<tr>';
             $frm_str .= '<td width="50%" align="left"><span class="form_title_process">'
                 .$data[$key]['label'].' :</span>';
@@ -443,59 +443,6 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module,
         include_once 'modules'.DIRECTORY_SEPARATOR.'tags'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'process'.DIRECTORY_SEPARATOR.'index.php';
     }
 
-    //FOLDERS
-    if ($core_tools->is_module_loaded('folder') && ($core->test_service('view_folder_tree', 'folder', false))) {
-        require_once 'modules'.DIRECTORY_SEPARATOR.'folder'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_modules_tools.php';
-        $folders = new folder();
-        $folder_info = $folders->get_folders_tree('0');
-        $folder = '';
-        $folder_id = '';
-
-        if (isset($data['folder']) && !empty($data['folder'])) {
-            $folder = $data['folder']['show_value'];
-            $folder_id = str_replace(')', '', substr($folder, strrpos($folder, '(') + 1));
-        }
-
-        $frm_str .= '<tr>';
-        $frm_str .= '<td colspan="2">'._FOLDER.'</td>';
-        $frm_str .= '</tr>';
-        $frm_str .= '<tr>';
-        $frm_str .= '<td class="indexing_field"><select id="folder" name="folder"';
-
-        if (!$core->test_service('associate_folder', 'folder', false)) {
-            $frm_str .= ' disabled="disabled"';
-        }
-
-        $frm_str .= ' onchange="displayFatherFolder(\'folder\')" style="width:95%;"><option value="">'._SELECT_FOLDER_TITLE.'</option>';
-        foreach ($folder_info as $key => $value) {
-            if ($value['folders_system_id'] == $folder_id) {
-                $frm_str .= '<option selected="selected" value="'.$value['folders_system_id'].'" parent="'.$value['parent_id'].'">'.$value['folder_name'].'</option>';
-            } else {
-                $frm_str .= '<option value="'.$value['folders_system_id'].'" parent="'.$value['parent_id'].'">'.$value['folder_name'].'</option>';
-            }
-        }
-
-        $frm_str .= '</select></td>';
-        if ($core->test_service('create_folder', 'folder', false) == 1 && $core->test_service('associate_folder', 'folder', false)) {
-            $pathScriptTab = $_SESSION['config']['businessappurl']
-                .'index.php?page=create_folder_form_iframe&module=folder&display=false';
-
-            $frm_str .= '<td style="width:5px;"> <a href="#" id="create_folder" title="'._CREATE_FOLDER
-                .'" onclick="loadTab(\''.$res_id.'\',\''.$coll_id.'\',\''._CREATE_FOLDER.'\',\''.$pathScriptTab.'\',\'folders\');return false;" '
-                .'style="display:inline;" ><i class="fa fa-plus-circle" title="'
-                ._CREATE_FOLDER.'"></i></a></td>';
-        }
-        $frm_str .= '</tr>';
-        $frm_str .= '<tr id="parentFolderTr" style="display: none"><td colspan="2"><span id="parentFolderSpan" style="font-style: italic;font-size: 10px"></span></td></tr>';
-        $frm_str .= '<input type="hidden" name="res_id_to_process" id="res_id_to_process"  value="'.$res_id.'" />';
-
-        //script
-        $frm_str .= '<script>';
-        $frm_str .= '$j("#folder").chosen({width: "100%", disable_search_threshold: 10, search_contains: true});displayFatherFolder(\'folder\');';
-
-        $frm_str .= '</script>';
-    }
-
 	//AUTRES INFORMATIONS
 	$frm_str .= '<tr id="description_tr" style="display:'.$display_value.';">';
         $frm_str .= '<td colspan="2">' . _OTHERS_INFORMATIONS . '</td>';
@@ -806,43 +753,6 @@ function check_form($form_id, $values)
     $folder_id = '';
     $foldertype_id = '';
 
-    if ($core->is_module_loaded('folder')) {
-        if (!empty($folder)) {
-            $folder_id = $folder;
-            $stmt = $db->query('SELECT folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($folder_id));
-            if ($stmt->rowCount() == 0) {
-                $_SESSION['action_error'] = _FOLDER.' '.$folder_id.' '._UNKNOWN;
-
-                return false;
-            }
-        }
-
-        if (!empty($res_id) && !empty($coll_id) && !empty($folder_id)) {
-            require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_security.php';
-            $sec = new security();
-            $table = $sec->retrieve_table_from_coll($coll_id);
-            if (empty($table)) {
-                $_SESSION['action_error'] .= _COLLECTION.' '._UNKNOWN;
-
-                return false;
-            }
-            $stmt = $db->query('SELECT type_id FROM '.$table.' WHERE res_id = ?', array($res_id));
-            $res = $stmt->fetchObject();
-            $type_id = $res->type_id;
-            $stmt = $db->query('SELECT foldertype_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($folder_id));
-            $res = $stmt->fetchObject();
-            $foldertype_id = $res->foldertype_id;
-            $stmt = $db->query('SELECT fdl.foldertype_id FROM '.$_SESSION['tablename']['fold_foldertypes_doctypes_level1']
-                .' fdl, '.$_SESSION['tablename']['doctypes']
-                .' d WHERE d.doctypes_first_level_id = fdl.doctypes_first_level_id and fdl.foldertype_id = ? and d.type_id = ?', array($foldertype_id, $type_id));
-            if ($stmt->rowCount() == 0) {
-                $_SESSION['action_error'] .= _ERROR_COMPATIBILITY_FOLDER;
-
-                return false;
-            }
-        }
-    }
-
     return $check;
 }
 
@@ -880,9 +790,6 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col
     $thesaurusList = '';
 
     for ($j = 0; $j < count($values_form); ++$j) {
-        if ($values_form[$j]['ID'] == 'folder') {
-            $folder = $values_form[$j]['VALUE'];
-        }
         if ($values_form[$j]['ID'] == "description") {
             $description = $values_form[$j]['VALUE'];
         }
@@ -915,35 +822,6 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col
         $thesaurus->updateResThesaurusList($thesaurusList, $arr_id[0]);
     }
 
-    //FOLDERS
-    if ($core->is_module_loaded('folder') && ($core->test_service('associate_folder', 'folder', false) == 1)) {
-        $folder_id = '';
-        $old_folder_id = '';
-
-        //get old folder ID
-        $stmt = $db->query('SELECT folders_system_id FROM '.$res_table.' WHERE res_id = ?', array($arr_id[0]));
-        $res = $stmt->fetchObject();
-        $old_folder_id = $res->folders_system_id;
-
-        if (!empty($folder)) {
-            $folder_id = $folder;
-
-            if ($folder_id != $old_folder_id && $_SESSION['history']['folderup']) {
-                require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_history.php';
-
-                $hist = new history();
-
-                $hist->add($_SESSION['tablename']['fold_folders'], $folder_id, 'UP', 'folderup', _DOC_NUM.$arr_id[0]._ADDED_TO_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-                if (isset($old_folder_id) && !empty($old_folder_id)) {
-                    $hist->add($_SESSION['tablename']['fold_folders'], $old_folder_id, 'UP', 'folderup', _DOC_NUM.$arr_id[0]._DELETED_FROM_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-                }
-            }
-
-            $db->query('UPDATE '.$res_table.' SET folders_system_id = ? WHERE res_id = ? ', array($folder_id, $arr_id[0]));
-        } elseif (empty($folder) && !empty($old_folder_id)) { //Delete folder reference in res_X
-            $db->query('UPDATE '.$res_table.' SET folders_system_id = NULL WHERE res_id = ?', array($arr_id[0]));
-        }
-    }
     //DIFFLIST
     if ($core->is_module_loaded('entities') && (empty($_SESSION['redirect']['diff_list']) || !is_array($_SESSION['redirect']['diff_list']) || count($_SESSION['redirect']['diff_list']) == 0)) {
         require_once 'modules/entities/class/class_manage_listdiff.php';
diff --git a/apps/maarch_entreprise/actions/validate_mail.php b/apps/maarch_entreprise/actions/validate_mail.php
index d4bdfea1b1c..2ce8019768f 100755
--- a/apps/maarch_entreprise/actions/validate_mail.php
+++ b/apps/maarch_entreprise/actions/validate_mail.php
@@ -1115,50 +1115,6 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module,
     $frm_str .= '<table width="100%" align="center" border="0" '
         .'id="indexing_fields" style="display:table;">';
 
-    /*** Folder  ***/
-    if ($core_tools->is_module_loaded('folder') && ($core->test_service('associate_folder', 'folder', false) == 1)) {
-        //DECLARATIONS
-        require_once 'modules'.DIRECTORY_SEPARATOR.'folder'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_modules_tools.php';
-
-        //INSTANTIATE
-        $folders = new folder();
-
-        //INITIALIZE
-        $folder_info = $folders->get_folders_tree('0');
-        $folder = '';
-        $folder_id = '';
-
-        if (isset($data['folder']) && !empty($data['folder'])) {
-            $folder = $data['folder'];
-            $folder_id = str_replace(')', '', substr($folder, strrpos($folder, '(') + 1));
-        }
-        $frm_str .= '<tr id="folder_tr" style="display:'.$display_value.';">';
-        $frm_str .= '<td><label for="folder" class="form_title" >'._FOLDER_OR_SUBFOLDER.'</label></td>';
-        $frm_str .= '<td class="indexing_field" style="text-align:right;"><select id="folder" name="folder" onchange="displayFatherFolder(\'folder\')"><option value="">'._SELECT_FOLDER_TITLE.'</option>';
-
-        foreach ($folder_info as $key => $value) {
-            if ($value['folders_system_id'] == $folder_id) {
-                $frm_str .= '<option selected="selected" value="'.$value['folders_system_id'].'" parent="'.$value['parent_id'].'">'.$value['folder_name'].'</option>';
-            } else {
-                $frm_str .= '<option value="'.$value['folders_system_id'].'" parent="'.$value['parent_id'].'">'.$value['folder_name'].'</option>';
-            }
-        }
-        $frm_str .= '</select>';
-        $frm_str .= '</td>';
-        if ($core->test_service('create_folder', 'folder', false) == 1) {
-            $pathScriptTab = $_SESSION['config']['businessappurl']
-                    .'index.php?page=create_folder_form_iframe&module=folder&display=false';
-
-            $frm_str .= '<td style="width:5%;"> <a href="#" id="create_folder" title="'._CREATE_FOLDER
-                    .'" onclick="loadTab(\''.$res_id.'\',\''.$coll_id.'\',\''._CREATE_FOLDER.'\',\''.$pathScriptTab.'\',\'folders\');return false;" '
-                    .'style="display:inline;" ><i class="fa fa-plus-circle" title="'
-                    ._CREATE_FOLDER.'"></i></a></td>';
-        }
-        $frm_str .= '</tr>';
-        $frm_str .= '<tr id="parentFolderTr" style="display: none"><td>&nbsp;</td><td colspan="2"><span id="parentFolderSpan" style="font-style: italic;font-size: 10px"></span></td></tr>';
-        $frm_str .= '<script>$j("#folder").chosen({width: "226px", disable_search_threshold: 10, search_contains: true});</script>';
-    }
-
     /*** Thesaurus ***/
     if ($core->is_module_loaded('thesaurus') && $core->test_service('thesaurus_view', 'thesaurus', false)) {
         //DECLARATIONS
@@ -1357,7 +1313,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module,
     $frm_str .= '</div>';
 
     /*** Extra javascript ***/
-    $frm_str .= '<script type="text/javascript">$j(\'#validright\').css(\'display\',\'block\');displayFatherFolder(\'folder\');window.scrollTo(0,0);';
+    $frm_str .= '<script type="text/javascript">$j(\'#validright\').css(\'display\',\'block\');window.scrollTo(0,0);';
 
     $frm_str .= 'init_validation(\''.$_SESSION['config']['businessappurl']
         .'index.php?display=true&dir=indexing_searching&page=autocomplete_contacts\', \''
@@ -1667,33 +1623,6 @@ function process_category_check($cat_id, $values)
             }
         }
     }
-    if ($core->is_module_loaded('folder')) {
-        $folder_id = '';
-        $foldertype_id = '';
-
-        $folder_id = get_value_fields($values, 'folder');
-
-        if (isset($_ENV['categories'][$cat_id]['other_cases']['folder']) && $_ENV['categories'][$cat_id]['other_cases']['folder']['mandatory'] == true) {
-            if (empty($folder)) {
-                $_SESSION['action_error'] = $_ENV['categories'][$cat_id]['other_cases']['folder']['label'].' '._IS_EMPTY;
-
-                return false;
-            }
-        }
-        if (!empty($type_id) && !empty($folder_id)) {
-            $stmt = $db->query('SELECT foldertype_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($folder_id));
-            $res = $stmt->fetchObject();
-            $foldertype_id = $res->foldertype_id;
-            $stmt = $db->query('SELECT fdl.foldertype_id FROM '
-                .$_SESSION['tablename']['fold_foldertypes_doctypes_level1'].' fdl, '
-                .$_SESSION['tablename']['doctypes'].' d WHERE d.doctypes_first_level_id = fdl.doctypes_first_level_id and fdl.foldertype_id = ? and d.type_id = '.$type_id, array($foldertype_id));
-            if ($stmt->rowCount() == 0) {
-                $_SESSION['action_error'] .= _ERROR_COMPATIBILITY_FOLDER;
-
-                return false;
-            }
-        }
-    }
 
     return true;
 }
@@ -1954,32 +1883,6 @@ function manage_form($arr_id, $history, $id_action, $label_action, $status, $col
         ]);
     }
 
-    if ($core->is_module_loaded('folder') && ($core->test_service('associate_folder', 'folder', false) == 1)) {
-        $folder_id = get_value_fields($values_form, 'folder');
-
-        $stmt = $db->query('SELECT folders_system_id FROM '.$table.' WHERE res_id = ?', array($res_id));
-        $res = $stmt->fetchObject();
-        $old_folder_id = $res->folders_system_id;
-
-        if (!empty($folder_id)) {
-            $query_res .= ', folders_system_id = ?';
-            $arrayPDOres = array_merge($arrayPDOres, array($folder_id));
-        } elseif (empty($folder_id) && !empty($old_folder_id)) {
-            $query_res .= ', folders_system_id = NULL';
-        }
-
-        if ($folder_id != $old_folder_id && $_SESSION['history']['folderup']) {
-            require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_history.php';
-
-            $hist = new history();
-
-            $hist->add($_SESSION['tablename']['fold_folders'], $folder_id, 'UP', 'folderup', _DOC_NUM.$res_id._ADDED_TO_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-            if (isset($old_folder_id) && !empty($old_folder_id)) {
-                $hist->add($_SESSION['tablename']['fold_folders'], $old_folder_id, 'UP', 'folderup', _DOC_NUM.$res_id._DELETED_FROM_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-            }
-        }
-    }
-
     if ($core->is_module_loaded('entities') && $_SESSION['ListDiffFromRedirect'] == false) {
         // Diffusion list
         $load_list_diff = false;
diff --git a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php
index e0cf002f1ef..697be92bf8d 100755
--- a/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php
+++ b/apps/maarch_entreprise/class/class_business_app_tools_Abstract.php
@@ -711,35 +711,7 @@ abstract class business_app_tools_Abstract extends Database
         if (! isset($name) || empty($name)) {
             return false;
         }
-        if ($name == 'structures' || $name == 'structures_list_by_name'
-            || $name == 'structure_up' || $name == 'structure_del'
-        ) {
-            $path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
-                  . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR
-                  . 'architecture' . DIRECTORY_SEPARATOR . 'structures'
-                  . DIRECTORY_SEPARATOR . $name . '.php';
-            return $path;
-        } else if ($name == 'subfolders' || $name == 'subfolders_list_by_name'
-            || $name == 'subfolder_up' || $name == 'subfolder_del'
-        ) {
-            $path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
-                  . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR
-                  . 'architecture' . DIRECTORY_SEPARATOR . 'subfolders'
-                  . DIRECTORY_SEPARATOR . $name . '.php';
-            return $path;
-        } else if ($name == 'types' || $name == 'types_up'
-            || $name == 'types_up_db' || $name == 'types_add'
-            || $name == 'types_del' || $name == 'get_index'
-            || $name == 'choose_index' || $name == 'choose_coll'
-            || $name == 'types_list_by_name'
-        ) {
-            $path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
-                  . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR
-                  . 'architecture' . DIRECTORY_SEPARATOR . 'types'
-                  . DIRECTORY_SEPARATOR . $name . '.php';
-
-            return $path;
-        } else if ($name == 'contact_types' || $name == 'contact_types_list_by_name'
+        if ($name == 'contact_types' || $name == 'contact_types_list_by_name'
             || $name == 'contact_types_up' || $name == 'contact_types_del'
         ) {
             $path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
diff --git a/apps/maarch_entreprise/class/class_chrono_Abstract.php b/apps/maarch_entreprise/class/class_chrono_Abstract.php
index 6e7a049de65..39253da7ae0 100755
--- a/apps/maarch_entreprise/class/class_chrono_Abstract.php
+++ b/apps/maarch_entreprise/class/class_chrono_Abstract.php
@@ -195,10 +195,6 @@ abstract class chrono_Abstract
                     $chronoArray[$i]['VALUE'] = $this->execute_chrono_by_res_id(
                         $phpVar['res_id']
                     );
-                } else if ($chronoArray[$i]['VALUE'] == "chr_by_folder") {
-                   $chronoArray[$i]['VALUE'] = $this->execute_chrono_by_folder(
-                       $phpVar['folder_id']
-                   );
                 }
             }
         }
@@ -286,26 +282,6 @@ abstract class chrono_Abstract
 
     }
 
-    public function execute_chrono_by_folder($folder)
-    {
-        $db = new Database();
-        $folders_system_id = $_SESSION['folderId'];
-        //Get the crono key for this folder
-        $stmt = $db->query(
-                "SELECT param_value_int FROM " . PARAM_TABLE
-            . " WHERE id = ? ",
-            array('chrono_folder_' . $folders_system_id)
-        );
-        if ($stmt->rowCount() == 0) {
-                $chrono = $this->_createNewChronoForFolder($db, $folder);
-        } else {
-                $fetch = $stmt->fetchObject();
-                $chrono = $fetch->param_value_int;
-        }
-        $this->_updateChronoForFolder($chrono, $db, $folder);
-        return $chrono;
-    }
-
     protected function _executeCategoryChar($phpVar)
     {
         if (! $phpVar['category_id']) {
@@ -382,25 +358,6 @@ abstract class chrono_Abstract
         return 1;
     }
     
-    // For specific chrono => folder
-    protected function _updateChronoForFolder($actualChrono, $db, $folder)
-    {
-        $actualChrono++;
-        $db->query(
-                "UPDATE " . PARAM_TABLE . " SET param_value_int = ?  WHERE id = ? ",
-            array($actualChrono, 'chrono_folder_' . $folder)
-        );
-    }
-    
-    protected function _createNewChronoForFolder($db, $folder)
-    {
-        $db->query(
-                "INSERT INTO " . PARAM_TABLE . " (id, param_value_int) VALUES "
-            . "(?, '1')",
-            array('chrono_folder_' . $folder)
-        );
-        return 1;
-    }
     public function generate_chrono($chronoId, $phpVar='false', $form='false')
     {
         $tmp = $this->get_structure($chronoId);
diff --git a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php
index 77130c270e2..1febb45b7e0 100755
--- a/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php
+++ b/apps/maarch_entreprise/class/class_indexing_searching_app_Abstract.php
@@ -298,81 +298,6 @@ abstract class indexing_searching_app_Abstract extends Database
             ]);
         }
 
-        if ($core->is_module_loaded('folder')) {
-            $stmt = $db->query('SELECT folders_system_id FROM '.$table.' WHERE res_id = ?', array($id_to_update));
-            $res = $stmt->fetchObject();
-            $old_folder_id = $res->folders_system_id;
-            $market = '';
-            if (isset($post['folder'])) {
-                $market = $post['folder'];
-            }
-            $project_id = '';
-            $market_id = '';
-            if (isset($_ENV['categories'][$cat_id]['other_cases']['folder']) && $_ENV['categories'][$cat_id]['other_cases']['folder']['mandatory'] == true) {
-                if (empty($market)) {
-                    $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['folder']['label'].' '._IS_EMPTY;
-                }
-            }
-            if (!empty($market)) {
-                if (!preg_match('/\([0-9]+\)$/', $market)) {
-                    $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['folder']['label'].' '._WRONG_FORMAT.'. '._USE_AUTOCOMPLETION;
-                } else {
-                    $market_id = str_replace(')', '', substr($market, strrpos($market, '(') + 1));
-                    $stmt = $db->query('SELECT folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($market_id));
-                    if ($stmt->rowCount() == 0) {
-                        $_SESSION['error'] .= _MARKET.' '.$market_id.' '._UNKNOWN;
-                    }
-                }
-            }
-            $project = '';
-            if (isset($post['project'])) {
-                $project = $post['project'];
-            }
-            if (isset($_ENV['categories'][$cat_id]['other_cases']['project']) && $_ENV['categories'][$cat_id]['other_cases']['project']['mandatory'] == true) {
-                if (empty($project)) {
-                    $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['project']['label'].' '._IS_EMPTY;
-                }
-            }
-            if (!empty($project)) {
-                if (!preg_match('/\([0-9]+\)$/', $project)) {
-                    $_SESSION['error'] .= $_ENV['categories'][$cat_id]['other_cases']['project']['label'].' '._WRONG_FORMAT;
-                }
-                $project_id = str_replace(')', '', substr($project, strrpos($project, '(') + 1));
-                $stmt = $db->query('SELECT folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($project_id));
-                if ($stmt->rowCount() == 0) {
-                    $_SESSION['error'] .= _MARKET.' '.$project_id.' '._UNKNOWN;
-                }
-            }
-            if (!empty($project_id) && !empty($market_id)) {
-                $stmt = $db->query('SELECT folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ? and parent_id = ?', array($market_id, $project_id));
-                if ($stmt->rowCount() == 0) {
-                    $_SESSION['error'] .= _INCOMPATIBILITY_MARKET_PROJECT;
-                }
-            }
-
-            if (empty($_SESSION['error'])) {
-                $folder_id = '';
-                if (!empty($market_id)) {
-                    $folder_id = $market_id;
-                } elseif (!empty($project_id)) {
-                    $folder_id = $project_id;
-                }
-                if (!empty($folder_id)) {
-                    array_push($data_res, array('column' => 'folders_system_id', 'value' => $folder_id, 'type' => 'integer'));
-                } else {
-                    array_push($data_res, array('column' => 'folders_system_id', 'value' => 'NULL', 'type' => 'integer'));
-                }
-                if ($folder_id != $old_folder_id && $_SESSION['history']['folderup']) {
-                    require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_history.php';
-                    $hist = new history();
-                    $hist->add($_SESSION['tablename']['fold_folders'], $folder_id, 'UP', 'folderup', _DOC_NUM.$id_to_update._ADDED_TO_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-                    if (isset($old_folder_id) && !empty($old_folder_id)) {
-                        $hist->add($_SESSION['tablename']['fold_folders'], $old_folder_id, 'UP', 'folderup', _DOC_NUM.$id_to_update._DELETED_FROM_FOLDER, $_SESSION['config']['databasetype'], 'apps');
-                    }
-                }
-            }
-        }
-
         if ($core->is_module_loaded('entities') && $_SESSION['details']['diff_list']['key_value'] == md5($res_id)) {
             //Mise a jour du dest_user :: seulement sur demande
             if (!empty($_SESSION['details']['diff_list']['dest']['user_id'])) {
diff --git a/apps/maarch_entreprise/class/class_lists_Abstract.php b/apps/maarch_entreprise/class/class_lists_Abstract.php
index d9c9ea2aa9b..9a2ef0438b4 100755
--- a/apps/maarch_entreprise/class/class_lists_Abstract.php
+++ b/apps/maarch_entreprise/class/class_lists_Abstract.php
@@ -360,24 +360,6 @@ abstract class lists_Abstract extends Database
                 $filters .= '<script> $j("#isViewed").chosen({width:"150px", disable_search: true, allow_single_deselect: true});</script>';
             break;
 
-            case 'folder':
-                if (isset($_SESSION['filters']['folder']['VALUE']) && !empty($_SESSION['filters']['folder']['VALUE'])) {
-                    $folder = $_SESSION['filters']['folder']['VALUE'];
-                } else {
-                    $folder = '['._FOLDER.']';
-                }
-                $filters .= '<input type="text" name="folder_id" id="folder_id" placeholder="'.$folder.'" size="40" '
-                            .'onfocus="if(this.value==\'['._FOLDER.']\'){this.value=\'\';}'
-                            .'onKeyPress="if(event.keyCode == 9 || event.keyCode == 13) loadList(\''.$this->link
-                            .'&filter=folder&value=\' + this.value, \''.$this->divListId.'\', '
-                            .$this->modeReturn.');" />&nbsp;';
-                //Autocompletion script and div
-                $filters .= '<div id="folderListByName" class="autocomplete"></div>';
-                $filters .= '<script type="text/javascript">initList(\'folder_id\', \'folderListByName\', \''
-                            .$_SESSION['config']['businessappurl'].'index.php?display=true&module='
-                            .'folder&page=folders_list_by_name\', \'folder\', \'2\');</script>';
-            break;
-
             case 'contact':
                 //if(isset($_SESSION['filters']['contact']['VALUE']) && !empty($_SESSION['filters']['contact']['VALUE'])) {
                     require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_request.php';
@@ -419,51 +401,6 @@ abstract class lists_Abstract extends Database
                     //$filters .= '<script>new c($(\'contact_id_list\'),{width: "150px",max_shown_results: "10"});</script>';
                     $filters .= '<script> $j("#contact_id_list").chosen({width:"150px",max_shown_results: "10"});</script>';
 
-                    /*if (is_numeric($_SESSION['filters']['contact']['VALUE'])) {
-                        $query = "SELECT society, lastname, firstname, is_corporate_person, society_short FROM "
-                            . $_SESSION['tablename']['contacts_v2'] . " WHERE contact_id = ?";
-
-                        $stmt = $db->query($query, array($_SESSION['filters']['contact']['VALUE']));
-                        $line = $stmt->fetchObject();
-
-                        if($line->is_corporate_person == 'N'){
-                            $contact = functions::show_string($line->lastname)." ".functions::show_string($line->firstname);
-                            if($line->society <> ''){
-                                $contact .= ' ('.$line->society.')';
-                            }
-                        } else {
-                            $contact .= $line->society;
-                            if($line->society_short <> ''){
-                                $contact .= ' ('.$line->society_short.')';
-                            }
-                        }
-                    } else {
-                        $query = "SELECT lastname, firstname FROM users WHERE user_id = ?";
-
-                        $stmt = $db->query($query, array($_SESSION['filters']['contact']['VALUE']));
-                        $line = $stmt->fetchObject();
-
-                        $contact .= functions::show_string($line->firstname) . " " . functions::show_string($line->lastname);
-                    }
-
-                } else {
-                    $contact = '['._CONTACT.']';
-                }
-                $filters .='<input type="text" name="contact_id" id="contact_id" placeholder="'.$contact.'" size="25" '
-                            .'onfocus="if(this.value==\'['._CONTACT.']\'){this.value=\'\';}" '
-                            .'onKeyPress="if(event.keyCode == 9 || event.keyCode == 13)loadList(\''.$this->link
-                            .'&filter=contact&value=\' + $(\'contactidFilters\').value, \''.$this->divListId.'\', '
-                            .$this->modeReturn.');" />&nbsp;';
-                //Autocompletion script and div
-                $filters .='<div id="contactListByName" class="autocomplete"></div>';
-                $filters .='<script type="text/javascript">initList_hidden_input(\'contact_id\', \'contactListByName\', \''
-                            .$_SESSION['config']['businessappurl'].'index.php?display=true&page='
-                            .'contacts_v2_list_by_name_filters&dir=indexing_searching\', \'what\', \'2\', \'contactidFilters\');</script>';
-                $filters .= '<input type="hidden" id="contactidFilters" name="contactidFilters" ';
-                if(isset($_SESSION['filters']['contact']['VALUE']) && !empty($_SESSION['filters']['contact']['VALUE'])) {
-                    $filters .= 'value="'.$_SESSION['filters']['contact']['VALUE'].'"';
-                }
-                $filters .='/>';*/
             break;
 
             case 'res_id':
@@ -516,21 +453,6 @@ abstract class lists_Abstract extends Database
                 }
                 $filters .= '</select>&nbsp;';
                 $filters .= '<script> $j("#subjectFilters").chosen({width:"150px",max_shown_results: "10"});</script>';
-                /*$subject = '['._SUBJECT.']';
-                $filters .='<input type="text" name="subject" id="subject" placeholder="'.$subject.'" size="40" '
-                            .'onChange="myFunction(), loadList(\''.$this->link
-                            .'&filter=subject&value=\' + $(\'subjectFilters\').value, \''.$this->divListId.'\', '
-                            .$this->modeReturn.');" />&nbsp;';
-                //Autocompletion script and div
-                $filters .='<script type="text/javascript">function myFunction() {';
-                $filters .='var x = document.getElementById("subject").value;';
-                $filters .='document.getElementById("subjectFilters").value = x;';
-                $filters .='}</script>';
-                $filters .= '<input type="hidden" id="subjectFilters" name="subjectFilters" ';
-                if(isset($_SESSION['filters']['subject']['VALUE']) && !empty($_SESSION['filters']['subject']['VALUE'])) {
-                    $filters .= 'value="'.$_SESSION['filters']['subject']['VALUE'].'"';
-                }
-                $filters .='/>';*/
             break;
 
             case 'type':
@@ -788,11 +710,6 @@ abstract class lists_Abstract extends Database
                         } else {
                             $_SESSION['filters']['contact']['CLAUSE'] = "(exp_user_id = '".$_SESSION['filters']['contact']['VALUE']."' or dest_user_id = '".$_SESSION['filters']['contact']['VALUE']."')";
                         }
-                    } elseif ($_REQUEST['filter'] == 'folder') {
-                        $folderId = $this->protect_string_db(str_replace(')', '',
-                            substr($_SESSION['filters']['folder']['VALUE'],
-                            strrpos($_SESSION['filters']['folder']['VALUE'], '(') + 1)));
-                        $_SESSION['filters']['folder']['CLAUSE'] = "folder_id = '".$folderId."'";
                     } elseif ($_REQUEST['filter'] == 'identifier') {
                         $_SESSION['filters']['identifier']['CLAUSE'] = "alt_identifier ilike ('%".$_SESSION['filters']['identifier']['VALUE']."%')";
                     } elseif ($_REQUEST['filter'] == 'type') {
diff --git a/apps/maarch_entreprise/definition_mail_categories.php b/apps/maarch_entreprise/definition_mail_categories.php
index 2cbc41db3f7..f41b974e081 100755
--- a/apps/maarch_entreprise/definition_mail_categories.php
+++ b/apps/maarch_entreprise/definition_mail_categories.php
@@ -854,63 +854,6 @@ if ($core->is_module_loaded('entities')) {
     );
 }
 
-if ($core->is_module_loaded('folder')) {
-    //Folder (incoming)
-    $_ENV['categories']['incoming']['other_cases']['folder'] = array(
-        'type_form' => 'string',
-        'type_field' => 'string',
-        'mandatory' => false,
-        'label' => _FOLDER,
-        'table' => 'none',
-        'img' => 'folder',
-        'modify' => true,
-        'form_show' => 'autocomplete',
-    );
-    //Folder (outgoing)
-    $_ENV['categories']['outgoing']['other_cases']['folder'] = array(
-        'type_form' => 'string',
-        'type_field' => 'string',
-        'mandatory' => false,
-        'label' => _FOLDER,
-        'table' => 'none',
-        'img' => 'folder',
-        'modify' => true,
-        'form_show' => 'autocomplete',
-    );
-    //Folder (internal)
-    $_ENV['categories']['internal']['other_cases']['folder'] = array(
-        'type_form' => 'string',
-        'type_field' => 'string',
-        'mandatory' => false,
-        'label' => _FOLDER,
-        'table' => 'none',
-        'img' => 'folder',
-        'modify' => true,
-        'form_show' => 'autocomplete',
-    );
-    //Folder (folder_document)
-    $_ENV['categories']['folder_document']['other_cases']['folder'] = array(
-        'type_form' => 'string',
-        'type_field' => 'string',
-        'mandatory' => false,
-        'label' => _FOLDER,
-        'table' => 'none',
-        'img' => 'folder',
-        'modify' => true,
-        'form_show' => 'autocomplete',
-    );
-    //Folder (ged_doc)
-    $_ENV['categories']['ged_doc']['other_cases']['folder'] = array(
-        'type_form' => 'string',
-        'type_field' => 'string',
-        'mandatory' => false,
-        'label' => _FOLDER,
-        'table' => 'none',
-        'img' => 'folder',
-        'modify' => true,
-        'form_show' => 'autocomplete',
-    );
-}
 /************************* END *************************************************************/
 
 /**
@@ -1141,30 +1084,6 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
         $arr[] = 'resourceContact';
     }
 
-    // Folder
-    if (isset($_ENV['categories'][$cat_id]['other_cases']['folder']) && count($_ENV['categories'][$cat_id]['other_cases']['folder']) > 0 && (!isset($params['show_folder']) || $params['show_folder'] == true)) {
-        $fields .= 'folders_system_id,';
-
-        array_push($arr, 'folder');
-        if ($mode == 'full' || $mode == 'form') {
-            $data['folder'] = array(
-                'value' => '',
-                'show_value' => '',
-                'label' => $_ENV['categories'][$cat_id]['other_cases']['folder']['label'],
-                'display' => 'textinput',
-                'img' => $_ENV['categories'][$cat_id]['other_cases']['folder']['img'],
-            );
-
-            $data['folder']['readonly'] = true;
-            if ($mode == 'form' && $_ENV['categories'][$cat_id]['other_cases']['folder']['modify']) {
-                $data['folder']['field_type'] = $_ENV['categories'][$cat_id]['other_cases']['folder']['form_show'];
-                $data['folder']['readonly'] = false;
-            }
-        } else {
-            $data['folder'] = '';
-        }
-    }
-
     if ($mode == 'full' || $mode == 'form') {
         $fields = preg_replace('/,$/', ',type_label', $fields);
     } else {
@@ -1181,7 +1100,7 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
             if (isset($line->{$arr[$i]})) {
                 $data[$arr[$i]]['value'] = $line->{$arr[$i]};
             }
-            if ($arr[$i] != 'folder' || $arr[$i] <> 'description') {
+            if ($arr[$i] <> 'description') {
                 $data[$arr[$i]]['show_value'] = functions::show_string($data[$arr[$i]]['value']);
             }
             if (isset($_ENV['categories'][$cat_id][$arr[$i]]['type_field'])
@@ -1366,18 +1285,6 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
                 }
 
             }
-            // Folder
-            elseif ($arr[$i] == 'folder' && isset($line->folders_system_id) && $line->folders_system_id != '') {
-                $stmt2 = $db->query('SELECT folder_id, folder_name, subject, folders_system_id, parent_id FROM '
-                    .$_SESSION['tablename']['fold_folders']
-                    ." WHERE status <> 'FOLDDEL' and folders_system_id = ?",
-                     array($line->folders_system_id));
-
-                if ($stmt2->rowCount() > 0) {
-                    $res = $stmt2->fetchObject();
-                    $data['folder']['show_value'] = $res->folder_id.', '.$res->folder_name.' ('.$res->folders_system_id.')';
-                }
-            }
         } else { // 'mimimal' mode
             // Normal cases
             $data[$arr[$i]] = $line->{$arr[$i]};
@@ -1441,16 +1348,6 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
                 }
                 unset($data[$arr[$i]]);
             }
-            // Folder
-            elseif ($arr[$i] == 'folder' && isset($line->folders_system_id) && $line->folders_system_id != '') {
-                $stmt2 = $db->query('SELECT folder_id, folder_name, subject, folders_system_id, parent_id FROM '
-                .$_SESSION['tablename']['fold_folders']
-                ." WHERE status <> 'FOLDDEL' and folders_system_id = ?",
-                    array($line->folders_system_id));
-
-                $res = $stmt2->fetchObject();
-                $data['folder'] = $res->folder_id.', '.$res->folder_name.' ('.$res->folders_system_id.')';
-            }
         }
     }
 
diff --git a/apps/maarch_entreprise/indexing_searching/details.php b/apps/maarch_entreprise/indexing_searching/details.php
index ba2eaa4570f..5204abf394d 100755
--- a/apps/maarch_entreprise/indexing_searching/details.php
+++ b/apps/maarch_entreprise/indexing_searching/details.php
@@ -605,13 +605,7 @@ if ($stmt->rowCount() == 0) {
                 echo '<tr class="col">';
             }
             $folder_id = '';
-            if ($key == 'folder' && $data[$key]['show_value'] != '') {
-                $folderTmp = $data[$key]['show_value'];
-                $find1 = strpos($folderTmp, '(');
-                $folder_id = substr($folderTmp, $find1, strlen($folderTmp));
-                $folder_id = str_replace('(', '', $folder_id);
-                $folder_id = str_replace(')', '', $folder_id);
-            }
+
             //GET DATA ICON
             echo '<th align="center" class="picto" >';
 
@@ -896,20 +890,8 @@ if ($stmt->rowCount() == 0) {
                     echo "<input type='radio' name='{$key}' id='{$key}_{$inputId}' value='{$inputId}' class='{$disabledClass}' {$disabledAttr} {$inputAttr}/>{$inputValue}";
                 }
             } elseif ($data[$key]['field_type'] == 'autocomplete') {
-                if ($key == 'folder' && $core->is_module_loaded('folder') && ($core->test_service('associate_folder', 'folder', false) == 1)) {
-                    $inputValue = $data['folder']['show_value'];
-
-                    echo '<div class="typeahead__container" style="width:206px">
-                    	     <div class="typeahead__field">
-                                <input type="text" name="folder" id="folder" value="'.$inputValue.'" class="folderSearch '.$disabledClass.'" '.$disabledAttr.' autocomplete="off" style="font-size: small;"/>
-                    	     </div>
-                         </div>';
-
-                    echo '<script type="text/javascript">loadTypeahead(\'.folderSearch\', \'desc\', true, \'index.php?display=true&module=folder&page=autocomplete_folders&mode=folder\');</script>';
-                } else {
-                    $inputValue = $data['folder']['show_value'];
-                    echo "<input type='text' name='folder' id='folder' class='readonly' onblur='' value='{$inputValue}' readonly='readonly'/>";
-                }
+                $inputValue = $data['folder']['show_value'];
+                echo "<input type='text' name='folder' id='folder' class='readonly' onblur='' value='{$inputValue}' readonly='readonly'/>";
             } elseif ($data[$key]['display'] == 'textinput') {
                 $inputValue = $data[$key]['show_value'];
                 echo "<input type='text' name='{$key}' id='{$key}' value='{$inputValue}' title='{$inputValue}' alt='{$inputValue}' size='40' class='{$disabledClass}' {$disabledAttr}/>";
diff --git a/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php b/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php
index 9103705c977..7ea23954a45 100755
--- a/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php
+++ b/apps/maarch_entreprise/indexing_searching/documents_list_mlb_search_adv.php
@@ -258,10 +258,6 @@ if ($mode == 'normal') {
         'filename',
         'res_id as real_dest'
     );
-    //Folder
-    if ($core_tools->is_module_loaded('folder')) {
-        array_push($select[$view], 'folders_system_id', 'folder_name');
-    }
 //Where clause
     $where_tab = array();
     $arrayPDO = array();
diff --git a/apps/maarch_entreprise/indexing_searching/search_adv.php b/apps/maarch_entreprise/indexing_searching/search_adv.php
index cc01da87536..858a4dca9fc 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv.php
@@ -329,18 +329,6 @@ $param['department_number_mu'] = array('label' => _DEPARTMENT_NUMBER, 'type' =>
 $arr_tmp2 = array('label' => _N_GED, 'type' => 'input_text', 'param' => array('field_label' => _N_GED, 'other' => $size));
 $param['numged'] = $arr_tmp2;
 
-// Num Case
-$arr_tmp2 = array('label' => _CASE_NUMBER, 'type' => 'input_text', 'param' => array('field_label' => _CASE_NUMBER, 'other' => $size));
-$param['numcase'] = $arr_tmp2;
-
-// Label Case
-$arr_tmp2 = array('label' => _CASE_LABEL, 'type' => 'input_text', 'param' => array('field_label' => _CASE_LABEL, 'other' => $size));
-$param['labelcase'] = $arr_tmp2;
-
-// Description Case
-$arr_tmp2 = array('label' => _CASE_DESCRIPTION, 'type' => 'input_text', 'param' => array('field_label' => _CASE_DESCRIPTION, 'other' => $size));
-$param['descriptioncase'] = $arr_tmp2;
-
 //status
 $status = $status_obj->get_searchable_status();
 $arr_tmp = array();
diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
index 609500b4401..b7c26488ccc 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
@@ -246,26 +246,6 @@ if (count($_REQUEST['meta']) > 0) {
                 $where_request .= " (contact_id in(select contact_id from view_contacts where contact_type = :contactType))) and ";
                 $arrayPDO = array_merge($arrayPDO, array(":contactType" => $_REQUEST['contact_type']));
             }
-            // FOLDER : MARKET
-            elseif ($tab_id_fields[$j] == 'market' && !empty($_REQUEST['market'])) {
-                $json_txt .= " 'market' : ['".addslashes(trim($_REQUEST['market']))."'],";
-                $market = $func->wash($_REQUEST['market'], "no", _MARKET, "no");
-                $where_request .= " (lower(folder_name) like lower(:referenceNumber) or folder_id like :referenceNumber ) and ";
-                $arrayPDO = array_merge($arrayPDO, array(":referenceNumber" => "%".$market."%"));
-            }
-            // FOLDER : PROJECT
-            elseif ($tab_id_fields[$j] == 'project' && !empty($_REQUEST['project'])) {
-                $json_txt .= " 'project' : ['".addslashes(trim($_REQUEST['project']))."'],";
-                $project = $func->wash($_REQUEST['project'], "no", _MARKET, "no");
-                $where_request .= " (lower(folder_name) like lower(:project) or folder_id like :project "
-                    ."or folders_system_id in (select parent_id from ".$_SESSION['tablename']['fold_folders']." where lower(folder_name) like lower(:project) or folder_id like :project)) and ";
-                $arrayPDO = array_merge($arrayPDO, array(":project" => "%".$project."%"));
-            } elseif ($tab_id_fields[$j] == 'folder_name' && !empty($_REQUEST['folder_name'])) {
-                $json_txt .= " 'folder_name' : ['".addslashes(trim($_REQUEST['folder_name']))."'],";
-                $folder_name = $func->wash($_REQUEST['folder_name'], "no", _FOLDER_NAME, "no");
-                $where_request .= " (lower(folder_name) like lower(:folderName) and ";
-                $arrayPDO = array_merge($arrayPDO, array(":folderName" => "%".$folder_name."%"));
-            }
             // GED NUM
             elseif ($tab_id_fields[$j] == 'numged' && !empty($_REQUEST['numged'])) {
                 $json_txt .= " 'numged' : ['".addslashes(trim($_REQUEST['numged']))."'],";
diff --git a/apps/maarch_entreprise/js/indexing.js b/apps/maarch_entreprise/js/indexing.js
index 1464f6f8f53..ed088a92a33 100755
--- a/apps/maarch_entreprise/js/indexing.js
+++ b/apps/maarch_entreprise/js/indexing.js
@@ -197,27 +197,6 @@ function updateProcessDate(path_manage_script)
     }
 }
 
-function displayFatherFolder(select)
-{
-    if ($(select) && $j('#parentFolderSpan') && $j('#parentFolderTr')) {
-        var tmpParSpan = $j('#parentFolderSpan');
-        var tmpParTr = $j('#parentFolderTr');
-        var selectFolders = $(select);
-    } else {
-        return ;
-    }
-
-    for (var i = 0; i < selectFolders.options.length; i++) {
-        if (selectFolders.options[i].getAttribute('value') == selectFolders.options[selectFolders.selectedIndex].getAttribute('parent')) {
-            tmpParTr.css("display","block");
-
-            tmpParSpan.html( "Dossier Parent : " + selectFolders.options[i].label);
-            return;
-        }
-    }
-    tmpParTr.css("display","none");
-}
-
 function checkRealDate(arg) {
 
     var cat = $('category_id').options[$('category_id').selectedIndex].value
@@ -1967,9 +1946,6 @@ function saveIndexingModel() {
         if ($j('#destination').val() != '') {
             obj['destination'] = $j('#destination').val();
         }
-        if ($j('#folder').val() != '') {
-            obj['folder'] = $j('#folder').val();
-        }
         if ($j('#thesaurus').length) {
             obj['thesaurus'] = [];
                 $j("#thesaurus > option").each(function() {
diff --git a/apps/maarch_entreprise/lang/en.php b/apps/maarch_entreprise/lang/en.php
index 7fce7bff35d..f5718817d28 100755
--- a/apps/maarch_entreprise/lang/en.php
+++ b/apps/maarch_entreprise/lang/en.php
@@ -119,16 +119,6 @@ if (!defined('_NO_RIGHTS_ON')) {
 if (!defined('_NO_LABEL_FOUND')) {
     define('_NO_LABEL_FOUND', 'No found label for this department');
 }
-
-if (!defined('_FOLDERTYPES_LIST')) {
-    define('_FOLDERTYPES_LIST', 'folder types list');
-}
-if (!defined('_FOLDERTYPE_ADDED')) {
-    define('_FOLDERTYPE_ADDED', 'Added new file');
-}
-if (!defined('_FOLDERTYPE_DELETION')) {
-    define('_FOLDERTYPE_DELETION', 'Deleted folder');
-}
 if (!defined('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH')) {
     define('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH', "Warning : Maarch's datas model must be updated...");
 }
@@ -916,43 +906,9 @@ if (!defined('_FIELD_VALUES')) {
 }
 
 /************** structures : List + Form**************/
-if (!defined('_STRUCTURE_LIST')) {
-    define('_STRUCTURE_LIST', 'Sub-folders list');
-}
-if (!defined('_STRUCTURES')) {
-    define('_STRUCTURES', 'sub-folder(s)');
-}
 if (!defined('_STRUCTURE')) {
     define('_STRUCTURE', 'Sub-folder');
 }
-if (!defined('_ALL_STRUCTURES')) {
-    define('_ALL_STRUCTURES', 'All the sub-folders');
-}
-
-if (!defined('_THE_STRUCTURE')) {
-    define('_THE_STRUCTURE', ' The sub-folder');
-}
-if (!defined('_STRUCTURE_MODIF')) {
-    define('_STRUCTURE_MODIF', 'Sub-folder modification');
-}
-if (!defined('_ID_STRUCTURE_PB')) {
-    define('_ID_STRUCTURE_PB', 'There is a problem with the sub-folder ID');
-}
-if (!defined('_NEW_STRUCTURE_ADDED')) {
-    define('_NEW_STRUCTURE_ADDED', 'Add a new sub-folder');
-}
-if (!defined('_NEW_STRUCTURE')) {
-    define('_NEW_STRUCTURE', 'New sub-folder');
-}
-if (!defined('_DESC_STRUCTURE_MISSING')) {
-    define('_DESC_STRUCTURE_MISSING', "It's missing sub-folder description");
-}
-if (!defined('_STRUCTURE_DEL')) {
-    define('_STRUCTURE_DEL', 'Sub-folder deletion');
-}
-if (!defined('_DELETED_STRUCTURE')) {
-    define('_DELETED_STRUCTURE', 'Deleted sub-folder');
-}
 if (!defined('_FONT_COLOR')) {
     define('_FONT_COLOR', 'Font colour');
 }
@@ -1014,15 +970,6 @@ if (!defined('_PURPLE')) {
 }
 
 /************** Sub-folders : List + Form**************/
-if (!defined('_SUBFOLDER_LIST')) {
-    define('_SUBFOLDER_LIST', 'Sub-folder list');
-}
-if (!defined('_SUBFOLDERS')) {
-    define('_SUBFOLDERS', 'Sub-folder(s)');
-}
-if (!defined('_ALL_SUBFOLDERS')) {
-    define('_ALL_SUBFOLDERS', 'All the sub-folders');
-}
 if (!defined('_SUBFOLDER')) {
     define('_SUBFOLDER', 'sub-folder');
 }
diff --git a/apps/maarch_entreprise/lang/fr.php b/apps/maarch_entreprise/lang/fr.php
index 55d64232bb1..487a8093029 100755
--- a/apps/maarch_entreprise/lang/fr.php
+++ b/apps/maarch_entreprise/lang/fr.php
@@ -115,15 +115,6 @@ if (!defined('_NO_LABEL_FOUND')) {
     define('_NO_LABEL_FOUND', 'Aucun label trouvé pour ce service');
 }
 
-if (!defined('_FOLDERTYPES_LIST')) {
-    define('_FOLDERTYPES_LIST', 'Liste des types de dossier');
-}
-if (!defined('_FOLDERTYPE_ADDED')) {
-    define('_FOLDERTYPE_ADDED', 'Nouveau dossier ajouté');
-}
-if (!defined('_FOLDERTYPE_DELETION')) {
-    define('_FOLDERTYPE_DELETION', 'Dossier supprimé');
-}
 if (!defined('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH')) {
     define('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH', 'Attention: Le modèle de données de Maarch doit être mis à jour...');
 }
@@ -910,43 +901,10 @@ if (!defined('_FIELD_VALUES')) {
 }
 
 /************** structures : Liste + Formulaire**************/
-if (!defined('_STRUCTURE_LIST')) {
-    define('_STRUCTURE_LIST', 'Liste des chemises');
-}
-if (!defined('_STRUCTURES')) {
-    define('_STRUCTURES', 'chemise(s)');
-}
+
 if (!defined('_STRUCTURE')) {
     define('_STRUCTURE', 'Chemise');
 }
-if (!defined('_ALL_STRUCTURES')) {
-    define('_ALL_STRUCTURES', 'Toutes les chemises');
-}
-
-if (!defined('_THE_STRUCTURE')) {
-    define('_THE_STRUCTURE', 'La chemise');
-}
-if (!defined('_STRUCTURE_MODIF')) {
-    define('_STRUCTURE_MODIF', 'Modification de la chemise');
-}
-if (!defined('_ID_STRUCTURE_PB')) {
-    define('_ID_STRUCTURE_PB', "Il y a un problème avec l'identifiant de la chemise");
-}
-if (!defined('_NEW_STRUCTURE_ADDED')) {
-    define('_NEW_STRUCTURE_ADDED', "Ajout d'une nouvelle chemise");
-}
-if (!defined('_NEW_STRUCTURE')) {
-    define('_NEW_STRUCTURE', 'Nouvelle chemise');
-}
-if (!defined('_DESC_STRUCTURE_MISSING')) {
-    define('_DESC_STRUCTURE_MISSING', 'Il manque la description de la chemise');
-}
-if (!defined('_STRUCTURE_DEL')) {
-    define('_STRUCTURE_DEL', 'Suppression de la chemise');
-}
-if (!defined('_DELETED_STRUCTURE')) {
-    define('_DELETED_STRUCTURE', 'Chemise supprimée');
-}
 if (!defined('_FONT_COLOR')) {
     define('_FONT_COLOR', 'Couleur de la police');
 }
@@ -1008,15 +966,6 @@ if (!defined('_PURPLE')) {
 }
 
 /************** sous-dossiers : Liste + Formulaire**************/
-if (!defined('_SUBFOLDER_LIST')) {
-    define('_SUBFOLDER_LIST', 'Liste des sous-chemises');
-}
-if (!defined('_SUBFOLDERS')) {
-    define('_SUBFOLDERS', 'sous-chemise(s)');
-}
-if (!defined('_ALL_SUBFOLDERS')) {
-    define('_ALL_SUBFOLDERS', 'Toutes les sous-chemises');
-}
 if (!defined('_SUBFOLDER')) {
     define('_SUBFOLDER', 'sous-chemise');
 }
diff --git a/apps/maarch_entreprise/lang/nl.php b/apps/maarch_entreprise/lang/nl.php
index 413121ad48c..79848783eff 100755
--- a/apps/maarch_entreprise/lang/nl.php
+++ b/apps/maarch_entreprise/lang/nl.php
@@ -44,9 +44,6 @@ if (!defined('_ADMIN_STATUS_DESC')) { define('_ADMIN_STATUS_DESC', 'Statussen aa
 if (!defined('_ADMIN_ACTIONS_DESC')) { define('_ADMIN_ACTIONS_DESC', 'Acties aanmaken of wijzigen.');}
 if (!defined('_NO_RIGHTS_ON')) { define('_NO_RIGHTS_ON', 'Geen recht op');}
 if (!defined('_NO_LABEL_FOUND')) { define('_NO_LABEL_FOUND', 'Geen label gevonden voor deze dienst');}
-if (!defined('_FOLDERTYPES_LIST')) { define('_FOLDERTYPES_LIST', 'Lijst van de maptypes');}
-if (!defined('_FOLDERTYPE_ADDED')) { define('_FOLDERTYPE_ADDED', 'Nieuwe map toegevoegd');}
-if (!defined('_FOLDERTYPE_DELETION')) { define('_FOLDERTYPE_DELETION', 'Map verwijderd');}
 if (!defined('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH')) { define('_VERSION_BASE_AND_XML_BASEVERSION_NOT_MATCH', 'Let op: Het gegevensmodel van Maarch Courrier moet bijgewerkt worden...');}
 if (!defined('_MODE')) { define('_MODE', 'Modus');}
 if (!defined('_GO_TO_PAGE')) { define('_GO_TO_PAGE', 'Naar pagina');}
@@ -295,18 +292,7 @@ if (!defined('_NATURE_FIELD')) { define('_NATURE_FIELD', 'Aard veld');}
 if (!defined('_TYPE_FIELD')) { define('_TYPE_FIELD', 'Type veld');}
 if (!defined('_DB_COLUMN')) { define('_DB_COLUMN', 'Kolom Database');}
 if (!defined('_FIELD_VALUES')) { define('_FIELD_VALUES', 'Waarden');}
-if (!defined('_STRUCTURE_LIST')) { define('_STRUCTURE_LIST', 'Mappenlijst');}
-if (!defined('_STRUCTURES')) { define('_STRUCTURES', 'map(pen)');}
 if (!defined('_STRUCTURE')) { define('_STRUCTURE', 'Map');}
-if (!defined('_ALL_STRUCTURES')) { define('_ALL_STRUCTURES', 'Alle mappen');}
-if (!defined('_THE_STRUCTURE')) { define('_THE_STRUCTURE', 'De map');}
-if (!defined('_STRUCTURE_MODIF')) { define('_STRUCTURE_MODIF', 'Map wijzigen');}
-if (!defined('_ID_STRUCTURE_PB')) { define('_ID_STRUCTURE_PB', 'Er is een probleem met de gebruikersnaam van de map');}
-if (!defined('_NEW_STRUCTURE_ADDED')) { define('_NEW_STRUCTURE_ADDED', 'Toevoeging van een nieuwe map');}
-if (!defined('_NEW_STRUCTURE')) { define('_NEW_STRUCTURE', 'Nieuwe map');}
-if (!defined('_DESC_STRUCTURE_MISSING')) { define('_DESC_STRUCTURE_MISSING', 'Beschrijving van de map ontbreekt');}
-if (!defined('_STRUCTURE_DEL')) { define('_STRUCTURE_DEL', 'Map verwijderen');}
-if (!defined('_DELETED_STRUCTURE')) { define('_DELETED_STRUCTURE', 'Map verwijderd');}
 if (!defined('_FONT_COLOR')) { define('_FONT_COLOR', 'Kleur van het lettertype');}
 if (!defined('_FONT_SIZE')) { define('_FONT_SIZE', 'Grootte van het lettertype');}
 if (!defined('_CSS_STYLE')) { define('_CSS_STYLE', 'Stijl');}
@@ -326,9 +312,6 @@ if (!defined('_PINK')) { define('_PINK', 'Roze');}
 if (!defined('_RED')) { define('_RED', 'Rood');}
 if (!defined('_GREEN')) { define('_GREEN', 'Groen');}
 if (!defined('_PURPLE')) { define('_PURPLE', 'Paars');}
-if (!defined('_SUBFOLDER_LIST')) { define('_SUBFOLDER_LIST', 'Submappenlijst');}
-if (!defined('_SUBFOLDERS')) { define('_SUBFOLDERS', 'submap(pen)');}
-if (!defined('_ALL_SUBFOLDERS')) { define('_ALL_SUBFOLDERS', 'Alle submappen');}
 if (!defined('_SUBFOLDER')) { define('_SUBFOLDER', 'submap');}
 if (!defined('_ADD_SUBFOLDER')) { define('_ADD_SUBFOLDER', 'Een nieuwe submap toevoegen');}
 if (!defined('_THE_SUBFOLDER')) { define('_THE_SUBFOLDER', 'De submap');}
diff --git a/apps/maarch_entreprise/welcome.php b/apps/maarch_entreprise/welcome.php
index 1b6e213807e..a41c29796f2 100755
--- a/apps/maarch_entreprise/welcome.php
+++ b/apps/maarch_entreprise/welcome.php
@@ -29,7 +29,6 @@
 * @ingroup apps
 */
 
-$_SESSION['FOLDER']['SEARCH'] = array();
 
 $core_tools = new core_tools();
 $_SESSION['location_bar']['level2']['path']	= "";
diff --git a/apps/maarch_entreprise/xml/config.xml.default b/apps/maarch_entreprise/xml/config.xml.default
index da0b9c57db7..5071ff06446 100755
--- a/apps/maarch_entreprise/xml/config.xml.default
+++ b/apps/maarch_entreprise/xml/config.xml.default
@@ -241,10 +241,6 @@
         <moduleid>entities</moduleid>
         <comment>_ENTITIES_COMMENT</comment>
     </MODULES>
-    <MODULES>
-        <moduleid>folder</moduleid>
-        <comment>_FOLDERS_COMMENT</comment>
-    </MODULES>
     <MODULES>
         <moduleid>notes</moduleid>
         <comment>_NOTES_COMMENT</comment>
diff --git a/core/manage_action.php b/core/manage_action.php
index a17a11ee481..849f454da6d 100755
--- a/core/manage_action.php
+++ b/core/manage_action.php
@@ -125,13 +125,10 @@ if ($_POST['req'] == 'valid_form' && !empty($_POST['action_id']) && isset($_POST
             $arr_id[$i] = str_replace('#', '', $arr_id[$i]);
             $result .= $arr_id[$i].'#';
             if (trim($_POST['new_status']) <> '' && is_numeric($arr_id[$i])) {
-                if ($_POST['table'] == 'folders') {
-                    $query_str = "update " . $_POST['table']
-                        .  " set status = ? where folders_system_id = ?";
-                } else {
-                    $query_str = "update " . $_POST['table']
-                        . " set status = ? where res_id = ?";
-                }
+                
+                $query_str = "update " . $_POST['table']
+                    . " set status = ? where res_id = ?";
+                
                 $stmt = $db->query($query_str, array($_POST['new_status'], $arr_id[$i]));
                 if (!$stmt) {
                     $_SESSION['action_error'] = _SQL_ERROR.' : '.$query_str;
@@ -200,13 +197,10 @@ elseif (empty($_POST['values']) || !isset($_POST['action_id']) || empty($_POST['
                 $arr_id[$i] = str_replace('#', '', $arr_id[$i]);
                 $result .= $arr_id[$i].'#';
                 if (trim($status) <> '') {
-                    if ($_POST['table'] == 'folders') {
-                        $query_str = "update " . $_POST['table']
-                            .  " set status = ? where folders_system_id = ?";
-                    } else {
+                    
                         $query_str = "update " . $_POST['table']
                             .  " set status = ? where res_id = ?";
-                    }
+                    
                     $stmt = $db->query($query_str, array($status, $arr_id[$i]));
                     if (!$stmt) {
                         $_SESSION['action_error'] = _SQL_ERROR . ' : ' . $query_str;
diff --git a/migration/19.12/1912.sql b/migration/19.12/1912.sql
index 1508f1fc3d8..b4d1ef0ed86 100644
--- a/migration/19.12/1912.sql
+++ b/migration/19.12/1912.sql
@@ -180,9 +180,10 @@ DELETE FROM usergroups_services WHERE service_id = 'join_res_case';
 DELETE FROM usergroups_services WHERE service_id = 'join_res_case_in_process';
 DELETE FROM usergroups_services WHERE service_id = 'close_case';
 DELETE FROM usergroups_services WHERE service_id = 'add_cases';
+DELETE FROM usergroups_services WHERE service_id IN ('folder_search', 'view_folder_tree', 'select_folder', 'show_history_folder', 'modify_folder', 'associate_folder', 'delete_folder', 'admin_foldertypes', 'create_folder', 'folder_freeze', 'close_folder');
 ALTER TABLE res_attachments DROP COLUMN IF EXISTS folders_system_id;
 ALTER TABLE res_version_attachments DROP COLUMN IF EXISTS folders_system_id;
-
+DELETE FROM notes WHERE origin = 'folder';
 
 /* REFACTORING MODIFICATION */
 ALTER TABLE notif_email_stack ALTER COLUMN attachments TYPE text;
diff --git a/modules/basket/lang/en.php b/modules/basket/lang/en.php
index 6d38e9c358d..1be6b5db0bd 100755
--- a/modules/basket/lang/en.php
+++ b/modules/basket/lang/en.php
@@ -133,10 +133,6 @@ if (!defined("_DEFAULT_ACTION_LIST"))
 if (!defined("_NO_ACTION_DEFINED"))
     define("_NO_ACTION_DEFINED", "No defined action");
 //BASKETS
-if (!defined("_PROCESS_FOLDER_LIST"))
-    define("_PROCESS_FOLDER_LIST", "Processed folders list");
-if (!defined("_INCOMPLETE_FOLDERS_LIST"))
-    define("_INCOMPLETE_FOLDERS_LIST", "Incomplete folders list");
 if (!defined("_WAITING_VAL_LIST"))
     define("_WAITING_VAL_LIST", "Validation files list on hold");
 if (!defined("_WAITING_QUAL_LIST"))
diff --git a/modules/basket/lang/fr.php b/modules/basket/lang/fr.php
index 9e0923d4431..26890ad6108 100755
--- a/modules/basket/lang/fr.php
+++ b/modules/basket/lang/fr.php
@@ -133,10 +133,6 @@ if (!defined("_DEFAULT_ACTION_LIST"))
 if (!defined("_NO_ACTION_DEFINED"))
     define("_NO_ACTION_DEFINED", "Aucune action définie");
 //BASKETS
-if (!defined("_PROCESS_FOLDER_LIST"))
-    define("_PROCESS_FOLDER_LIST", "Liste des dossiers traités");
-if (!defined("_INCOMPLETE_FOLDERS_LIST"))
-    define("_INCOMPLETE_FOLDERS_LIST", "Liste des dossiers incomplets");
 if (!defined("_WAITING_VAL_LIST"))
     define("_WAITING_VAL_LIST", "Liste des pièces en attente de validation");
 if (!defined("_WAITING_QUAL_LIST"))
diff --git a/modules/basket/lang/nl.php b/modules/basket/lang/nl.php
index 92ef04b6af4..10a5edb397d 100755
--- a/modules/basket/lang/nl.php
+++ b/modules/basket/lang/nl.php
@@ -165,12 +165,6 @@ if (!defined('_DEFAULT_ACTION_LIST')) {
 if (!defined('_NO_ACTION_DEFINED')) {
     define('_NO_ACTION_DEFINED', 'Geen actie gedefinieerd');
 }
-if (!defined('_PROCESS_FOLDER_LIST')) {
-    define('_PROCESS_FOLDER_LIST', 'Lijst van de verwerkte mappen');
-}
-if (!defined('_INCOMPLETE_FOLDERS_LIST')) {
-    define('_INCOMPLETE_FOLDERS_LIST', 'Lijst van de onvolledige mappen');
-}
 if (!defined('_WAITING_VAL_LIST')) {
     define('_WAITING_VAL_LIST', 'Lijst van de stukken die op bevestiging wachten');
 }
diff --git a/modules/entities/admin_listmodel_setObjectId.php b/modules/entities/admin_listmodel_setObjectId.php
index 3c8704a2816..f1733056ff8 100755
--- a/modules/entities/admin_listmodel_setObjectId.php
+++ b/modules/entities/admin_listmodel_setObjectId.php
@@ -137,28 +137,6 @@ case 'type_id':
     
     break;
     
-case 'foldertype_id':
-    require_once 'core/class/class_db.php';
-    require_once 'modules/folder/folder_tables.php';
-    $db = new Database();
-    $stmt = $db->query("SELECT foldertype_id, foldertype_label FROM  " . FOLD_FOLDERTYPES_TABLE);
-    while($foldertype = $stmt->fetchObject()) {
-        $foldertype_id = $foldertype->foldertype_id;
-        $existinglist = 
-            $difflist->get_listmodel(
-                'foldertype_id',
-                $foldertype_id
-            );
-        if(!$existinglist) {
-            $foldertypes[$foldertype_id] = $foldertype->foldertype_label; 
-        }
-    }
-    if(count($foldertypes) > 0)
-        echo asSelect($foldertypes, $objectId);
-    else    
-        echo asSelect(array("" => _ALL_OBJECTS_ARE_LINKED));
-    break;
-    
 case 'user_defined_id':
 default:
     if(!$objectId) 
diff --git a/modules/folder/ajax_get_folder.php b/modules/folder/ajax_get_folder.php
deleted file mode 100755
index 715224925a5..00000000000
--- a/modules/folder/ajax_get_folder.php
+++ /dev/null
@@ -1,255 +0,0 @@
-<?php
-/*
- * Copyright (C) 2008-2015 Maarch
- *
- * This file is part of Maarch.
- *
- * Maarch 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 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.  If not, see <http://www.gnu.org/licenses/>.
- */
-/**
-* File : ajax_get_project.php
-*
-* Script called by an ajax object to get the project id  given a market id (index_mlb.php)
-*
-* @package  maarch
-* @version 1
-* @since 10/2005
-* @license GPL v3
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-$db = new Database();
-
-$core = new core_tools();
-$core->load_lang();
-require_once "core/class/class_security.php";
-$sec = new security();
-$whereClause = $sec->get_where_clause_from_coll_id($_SESSION['collection_id_choice']);
-if($_POST['FOLDER_TREE']){
-	$folders = array();
-	$stmt = $db->query('SELECT folders_system_id, folder_name, parent_id, folder_level FROM folders WHERE foldertype_id not in (100) AND parent_id=? AND status NOT IN (\'DEL\') order by folder_id asc', array($_POST["folders_system_id"]));
-	while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
-	
-		$stmt2 = $db->query(
-				"SELECT count(*) as total FROM res_view_letterbox WHERE folders_system_id in (?) AND (".$whereClause.") AND status NOT IN ('DEL')"
-				,array($row['folders_system_id']));
-		$row2 = $stmt2->fetch(PDO::FETCH_ASSOC);
-		$stmt3 = $db->query(
-		"SELECT count(*) as total FROM folders WHERE foldertype_id not in (100) AND parent_id IN (?) AND status NOT IN ('DEL')"
-		,array($row['folders_system_id']));
-		$row3 = $stmt3->fetch(PDO::FETCH_ASSOC);
-		$folders[] = array(
-			'parent_id' => $row['parent_id'],
-			'folders_system_id' => $row['folders_system_id'],
-			'nom_folder' => $row['folder_name'],
-			'folder_level' => $row['folder_level'],
-			'nb_doc' => $row2['total'],
-			'nb_subfolder' => $row3['total']
-		);
-	}
-	echo json_encode($folders);
-	exit();
-}else if($_POST['FOLDER_TREE_RESET']){
-	$folders = array();
-	$stmt = $db->query('SELECT folders_system_id, folder_name, parent_id, folder_level FROM folders WHERE foldertype_id not in (100) AND folders_system_id=? AND status NOT IN (\'DEL\') order by folder_id asc', array($_POST["folders_system_id"]));
-	while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
-		$stmt2 = $db->query(
-				"SELECT count(*) as total FROM res_view_letterbox WHERE folders_system_id in (?) AND (".$whereClause.") AND status NOT IN ('DEL')", array($_POST['folders_system_id'])
-				);
-		$row2 = $stmt2->fetch(PDO::FETCH_ASSOC);
-		$stmt3 = $db->query(
-			"SELECT count(*) as total FROM folders WHERE foldertype_id not in (100) AND parent_id IN (".$row['folders_system_id'].")  AND status NOT IN ('DEL')"
-		);
-		$row3 = $stmt3->fetch(PDO::FETCH_ASSOC);
-		$folders[] = array(
-			'parent_id' => $row['parent_id'],
-			'folders_system_id' => $row['folders_system_id'],
-			'nom_folder' => $row['folder_name'],
-			'folder_level' => $row['folder_level'],
-			'nb_doc' => $row2['total'],
-			'nb_subfolder' => $row3['total']
-		);
-	}
-	echo json_encode($folders);
-	exit();
-}else if($_POST['FOLDER_TREE_DOCS']){
-	$docs = array();
-	$entitiesForCurrentUser = $sec->getEntitiesForCurrentUser();
-	if (empty($entitiesForCurrentUser)) {
-		$stmt = $db->query('SELECT res_id, type_label, subject,doctypes_first_level_label,doctypes_second_level_label, folder_level
-							FROM res_view_letterbox
-							WHERE folders_system_id in (?) AND (' .$whereClause. ') AND status NOT IN (?)',
-							[$_POST['folders_system_id'], 'DEL']);
-	} else {
-		$stmt = $db->query('SELECT res_id, type_label, subject,doctypes_first_level_label,doctypes_second_level_label, folder_level
-							FROM res_view_letterbox
-							WHERE folders_system_id in (?) AND (' .$whereClause. ' OR folder_destination IN (?)) AND status NOT IN (?)',
-							[$_POST['folders_system_id'], $sec->getEntitiesForCurrentUser(), 'DEL']);
-	}
-
-	while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
-		
-		$docs[$row['doctypes_first_level_label']][$row['doctypes_second_level_label']][] = array(
-			'res_id' => $row['res_id'],
-			'type_label' => $row['type_label'],
-			'subject' => $row['subject'],
-			'folder_level' => $row['folder_level']
-		);
-	}
-	echo json_encode($docs);
-	exit();
-}else if($_POST['AUTOFOLDERS_TREE'] && $admin->is_module_loaded('autofoldering')) {
-	$config_autofoldering = "modules/autofoldering/xml/autofoldering.xml";
-	$xml=simplexml_load_file($config_autofoldering);
-	//print_r($xml->tree);
-	$autofolders = array();
-
-	foreach($xml->tree as $tree) {
-		$autofolders[] = array(
-			'id' => $tree->id,
-			'desc' => $tree->desc,
-			'tree_level' => 1
-		);
-	}
-	echo json_encode($autofolders);
-	exit();
-}else if($_POST['AUTOFOLDER_FOLDERS'] && $admin->is_module_loaded('autofoldering')) {
-	$config_autofoldering = "modules/autofoldering/xml/autofoldering.xml";
-	$xml=simplexml_load_file($config_autofoldering);
-	$path_folder = explode(";", $_POST['path_folder']);	
-	//print_r($path_folder);
-	$folders = array();
-	$level = $_POST['folder_level'];
-	$level=$level-1;
-	$level_comp=$level-1;
-	$arrayPDO = array();
-	foreach($xml->tree as $tree) {
-		if($tree->id == $_POST['id']){
-			$view = $sec->retrieve_view_from_coll_id($tree->coll_id);
-				for ($i=0; $i < $level ; $i++) { 
-					if($i<>0){
-						$where .= " AND (".$tree->nodes->node[$i]->target_column[0]." = ?)";
-						$arrayPDO = array_merge($arrayPDO, array("path_".$i => $path_folder[$i+1]));
-					}else{
-						$where = "WHERE (".$tree->nodes->node[$i]->target_column[0]." = ?)";
-						$arrayPDO = array_merge($arrayPDO, array("path_".$i => $path_folder[$i+1]));
-					}
-				}
-				$select=$tree->nodes->node[$level]->target_column[0];
-				if($_POST['folder_level']==$tree->nodes->node->count()){
-					$check_docs=true;
-				}else{
-					$check_docs=false;
-				}
-			
-			break;
-		}
-		
-	}
-
-	if(!empty($where)){
-		$where.= ' AND ('.$whereClause.')';
-	}else{
-		$where = 'WHERE ('.$whereClause.')';
-	}
-
-	if($level<>0){
-		$order="ORDER BY ".$select." ASC";
-	}
-	$stmt = $db->query('SELECT DISTINCT ('.$select.') as libelle FROM '.$view.' '.$where.' '.$order, $arrayPDO);
-
-	while($row=$stmt->fetch(PDO::ASSOC)){
-		$folders[] = array(
-			'libelle' => $row['libelle'],
-			'folder_level' => $level + 2,
-			'check_docs' => $check_docs,
-		);
-	}
-	echo json_encode($folders);
-	exit();
-}else if($_POST['AUTOFOLDER_FOLDER_DOCS'] && $admin->is_module_loaded('autofoldering')) {
-	$config_autofoldering = "modules/autofoldering/xml/autofoldering.xml";
-	$xml=simplexml_load_file($config_autofoldering);
-	$path_folder = explode(";", $_POST['path_folder']);
-	//print_r($path_folder);
-	$docs = array();
-	$arrayPDO = array();
-	foreach($xml->tree as $tree) {
-		if($tree->id == $_POST['id']){
-			$view = $sec->retrieve_view_from_coll_id($tree->coll_id);
-			for ($i=0; $i <= $tree->nodes->node->count()-1 ; $i++) { 
-				if($i<>0){
-					$where .= " AND (".$tree->nodes->node[$i]->target_column[0]." = ?)";
-					$arrayPDO = array_merge($arrayPDO, array("path_".$i => $path_folder[$i+1]));
-				}else{
-					$where = "WHERE (".$tree->nodes->node[$i]->target_column[0]." = ?)";
-					$arrayPDO = array_merge($arrayPDO, array("path_".$i => $path_folder[$i+1]));
-				}
-			}
-			
-			break;
-		}
-		
-	}
-	if(!empty($where)){
-		$where.= ' AND ('.$whereClause.')';
-	}else{
-		$where= 'WHERE ('.$whereClause.')';
-	}
-	//echo "requete where: ".$where;exit();
-	$stmt = $db->query('SELECT res_id, type_label, subject,doctypes_first_level_label,doctypes_second_level_label, folder_level FROM '.$view.' '.$where, $arrayPDO);
-
-	while($row=$stmt->fetch(PDO::ASSOC)){
-		$docs[] = array(
-			'res_id' => $row['res_id'],
-			'type_label' => $row['type_label'],
-			'subject' => $row['subject'],
-			'doctypes_first_level_label' => $row['doctypes_first_level_label'],
-			'doctypes_second_level_label' => $row['doctypes_second_level_label'],
-			'folder_level' => $row['folder_level']
-		);
-	}
-	echo json_encode($docs);
-	exit();
-}else{
-
-if(!isset($_REQUEST['id_subfolder']) || empty($_REQUEST['id_subfolder']))
-{
-	//$_SESSION['error'] = _SUBFOLDER.' '._IS_EMPTY;
-	echo "{status : 1, error_txt : '".addslashes( _SUBFOLDER.' '._IS_EMPTY)."'}";
-	exit();
-}
-$stmt = $db->query('SELECT parent_id FROM '.$_SESSION['tablename']['fold_folders'].' where folders_system_id = ? AND status NOT IN (\'DEL\')', array($_REQUEST['id_subfolder']));
-
-if($stmt->rowCount() < 1)
-{
-	//$_SESSION['error'] = _NO_SUBFOLDER;
-	echo "{status : 1, error_txt : '".addslashes(_NO_SUBFOLDER)."'}";
-	exit();
-}
-$res = $stmt->fetchObject();
-$parent_id = $res->parent_id;
-$stmt = $db->query('SELECT folder_name, subject, folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' where folders_system_id = ? AND status NOT IN (\'DEL\')', array($parent_id));
-
-if($stmt->rowCount() < 1)
-{
-	//$_SESSION['error'] =_NO_FOLDER;
-	echo "{status : 1, error_txt : '".addslashes(_NO_FOLDER)."'}";
-	exit();
-}
-$res = $stmt->fetchObject();
-echo "{status : 0, value : '".functions::show_string($res->folder_name).', '.functions::show_string($res->subject).' ('.functions::show_string($res->folders_system_id).')'."'}";
-exit();
-}
-?>
diff --git a/modules/folder/ajax_get_project.php b/modules/folder/ajax_get_project.php
deleted file mode 100755
index 86ef128204b..00000000000
--- a/modules/folder/ajax_get_project.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/*
- * Copyright (C) 2008-2015 Maarch
- *
- * This file is part of Maarch.
- *
- * Maarch 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 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.  If not, see <http://www.gnu.org/licenses/>.
- */
-/**
-* File : ajax_get_project.php
-*
-* Script called by an ajax object to get the project id  given a market id (index_mlb.php)
-*
-* @package  maarch
-* @version 1
-* @since 10/2005
-* @license GPL v3
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-$db = new Database();
-$core = new core_tools();
-$core->load_lang();
-
-if(!isset($_REQUEST['id_market']) || empty($_REQUEST['id_market']))
-{
-	//$_SESSION['error'] = _MARKET.' '._IS_EMPTY;
-	echo "{status : 1, error_txt : '".addslashes( _MARKET.' '._IS_EMPTY)."'}";
-	exit();
-}
-$stmt = $db->query('SELECT parent_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($_REQUEST['id_market']));
-
-if($stmt->rowCount() < 1)
-{
-	//$_SESSION['error'] = _MARKET.' '._IS_EMPTY;
-	echo "{status : 1, error_txt : '".addslashes( _MARKET.' '._IS_EMPTY)."'}";
-	exit();
-}
-$res = $stmt->fetchObject();
-$parent_id = $res->parent_id;
-$stmt = $db->query('SELECT folder_name, subject, folders_system_id FROM '.$_SESSION['tablename']['fold_folders'].' WHERE folders_system_id = ?', array($parent_id));
-
-if($stmt->rowCount() < 1)
-{
-	//$_SESSION['error'] = _MARKET.' '._IS_EMPTY;
-	echo "{status : 1, error_txt : '".addslashes( _MARKET.' '._IS_EMPTY)."'}";
-	exit();
-}
-$res = $stmt->fetchObject();
-echo "{status : 0, value : '".functions::show_string($res->folder_name).', '.functions::show_string($res->subject).' ('.functions::show_string($res->folders_system_id).')'."'}";
-exit();
-?>
diff --git a/modules/folder/autocomplete_folders.php b/modules/folder/autocomplete_folders.php
deleted file mode 100755
index 0e68d5c4b90..00000000000
--- a/modules/folder/autocomplete_folders.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-
-/**
-* Copyright Maarch since 2008 under licence GPLv3.
-* See LICENCE.txt file at the root folder for more details.
-* This file is part of Maarch software.
-*
-*/
-/**
-* File : autocomplete_folders.php
-*
-* Autocompletion list on folder or subfolder
-*
-* @package  maarch
-* @version 1
-* @since 10/2005
-* @license GPL v3
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-require('core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_request.php');
-$req = new request();
-$db  = new Database();
-
-//Build query
-$select = array();
-//Table
-$table = $_SESSION['tablename']['fold_folders'];
-//Fields
-$select[$table]= array( 'folder_id', 'folder_name',  'folders_system_id');
-//Where
-$where = '';
-
-$category_id = $_SESSION['category_id_session'];
-
-if ($category_id != null and $category_id != '') {
-    $stmt = $db->query("SELECT doctypes_first_level_id FROM doctypes WHERE type_id = ?", array($category_id));
-
-    $res = $stmt->fetchObject();
-    
-    $stmt = $db->query("SELECT foldertype_id FROM foldertypes_doctypes_level1 Where doctypes_first_level_id = ?", array($res->doctypes_first_level_id));
-    $res = $stmt->fetchObject();
-
-    if (isset($_SESSION['user']['entities']['0'])) {
-        $finalDest = '(';
-        foreach ($_SESSION['user']['entities'] as $tmp) {
-            $finalDest .= ($finalDest[strlen($finalDest) - 1] == '(' ? '\'' . $tmp['ENTITY_ID'] . '\'' : ', \'' . $tmp['ENTITY_ID'] . '\'');
-        }
-        $finalDest .= ')';
-        $where .= " (foldertype_id = :folderTypeId) and (lower(folder_name) like lower(:Input) or lower(folder_id) like lower(:Input) ) and (status NOT IN('DEL','FOLDDEL')) and (destination in " . $finalDest . " OR destination is null)";
-    } else {
-        $where .= " (foldertype_id = :folderTypeId) and (lower(folder_name) like lower(:Input) or lower(folder_id) like lower(:Input) ) and (status NOT IN('DEL','FOLDDEL'))";
-    }
-    $arrayPDO = array(":folderTypeId" => $res->foldertype_id, ":Input" => "%" .$_REQUEST['Input']."%");
-    //Order
-    $order = 'order by folders_system_id, folder_name';
-} else {
-    $stmt = $db->query("SELECT doctypes_first_level_id FROM doctypes");
-    $doctypes_1 = '';
-    $arrayPDO = array();
-    while ($res = $stmt->fetchObject()) {
-        $doctypes_1 .= "?,";
-        $arrayPDO = array_merge($arrayPDO, array($res->doctypes_first_level_id));
-    }
-    $doctypes_1 .= 0 ;
-    $stmt = $db->query("SELECT foldertype_id FROM foldertypes_doctypes_level1 Where doctypes_first_level_id in ( ".$doctypes_1.")", $arrayPDO);
-    $wh = '';
-    $arrayPDO = array();
-    while ($res = $stmt->fetchObject()) {
-        $wh .= "?,";
-        $arrayPDO = array_merge($arrayPDO, array($res->foldertype_id));
-    }
-    $wh .= 0 ;
-    if (isset($_SESSION['user']['entities']['0'])) {
-        $finalDest = '(';
-        foreach ($_SESSION['user']['entities'] as $tmp) {
-            $finalDest .= ($finalDest[strlen($finalDest) - 1] == '(' ? '\'' . $tmp['ENTITY_ID'] . '\'' : ', \'' . $tmp['ENTITY_ID'] . '\'');
-        }
-        $finalDest .= ')';
-        $where .= " (foldertype_id in (".$wh.")) and (lower(folder_name) like lower(?) or lower(folder_id) like lower(?)) and (status NOT IN('DEL','FOLDDEL')) and (destination in " . $finalDest . " OR destination is null)";
-    } else {
-        $where .= " (foldertype_id in (".$wh.")) and (lower(folder_name) like lower(?) or lower(folder_id) like lower(?)) and (status NOT IN('DEL','FOLDDEL'))";
-    }
-    $arrayPDO = array_merge($arrayPDO, array("%" .$_REQUEST['Input']."%", "%" .$_REQUEST['Input']."%"));
-    //Order
-    $order = 'order by folders_system_id, folder_name';
-}
-    
-//Query
-$res = $req->PDOselect($select, $where, $arrayPDO, $order, $_SESSION['config']['databasetype'], 11, false, "", "", "", false);
-
-//Autocompletion output
-$arrayDossier = array();
-$countRes     = count($res);
-for ($i=0; $i< $countRes; $i++) {
-    array_push($arrayDossier, htmlspecialchars_decode($res[$i][0]['value'].', '.$res[$i][1]['value'].' ('.$res[$i][2]['value'].')', ENT_QUOTES));
-}
-
-echo json_encode($arrayDossier, JSON_UNESCAPED_UNICODE);
diff --git a/modules/folder/choose_doctypes.php b/modules/folder/choose_doctypes.php
deleted file mode 100755
index 4744ab8c7ae..00000000000
--- a/modules/folder/choose_doctypes.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-/**
-* File : choose_doctypes.php
-*
-* Form to choose doctypes (used in foldertypes admin)
-*
-* @package  Maarch PeopleBox 1.0
-* @version 2.1
-* @since 06/2006
-* @license GPL
-*/
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-
-$core = new core_tools();
-$core->test_admin('admin_foldertypes', 'folder');
-$core->load_lang();
-$core->load_html();
-$core->load_header();
-
-if (isset($_SESSION['m_admin']['mode']) && $_SESSION['m_admin']['mode'] == "up" 
-	&& isset($_SESSION['m_admin']['init']) 
-	&& $_SESSION['m_admin']['init'] == true
-) {
-	$_SESSION['m_admin']['chosen_doctypes'] = array();
-	$_SESSION['m_admin']['chosen_doctypes'] = $_SESSION['m_admin']['foldertype']['doctypes'];
-	$_SESSION['m_admin']['init'] = false;
-}
-
-if(!isset($_SESSION['m_admin']['chosen_doctypes'])) {
-    $_SESSION['m_admin']['chosen_doctypes'] = array();
-}
-if(isset($_REQUEST['doctypes']) && count($_REQUEST['doctypes']) > 0)
-{
-	for($i=0; $i < count($_REQUEST['doctypes']); $i++)
-	{
-		if(!in_array(trim($_REQUEST['doctypes'][$i]), $_SESSION['m_admin']['chosen_doctypes']))
-		{
-			array_push($_SESSION['m_admin']['chosen_doctypes'], trim($_REQUEST['doctypes'][$i]));
-		}
-	}
-	$_SESSION['m_admin']['foldertype']['doctypes'] = $_SESSION['m_admin']['chosen_doctypes'];
-}
-else if(isset($_REQUEST['doctypeslist']) && count($_REQUEST['doctypeslist']) > 0)
-{
-	for($i=0; $i < count($_SESSION['m_admin']['chosen_doctypes']); $i++)
-	{
-
-		for($j=0; $j < count($_REQUEST['doctypeslist']); $j++)
-		{
-			if(trim($_REQUEST['doctypeslist'][$j]) == trim($_SESSION['m_admin']['chosen_doctypes'][$i]))
-			{
-				unset($_SESSION['m_admin']['chosen_doctypes'][$i]);
-			}
-		}
-	}
-	$_SESSION['m_admin']['chosen_doctypes'] = array_values($_SESSION['m_admin']['chosen_doctypes']);
-	$_SESSION['m_admin']['foldertype']['doctypes'] = $_SESSION['m_admin']['chosen_doctypes'];
-}
-elseif(isset($_REQUEST['doctypes']) && count($_REQUEST['doctypes']) <= 0)
-{
-	$_SESSION['m_admin']['chosen_doctypes'] = array();
-	$_SESSION['m_admin']['foldertype']['doctypes'] = $_SESSION['m_admin']['chosen_doctypes'];
-}
-?>
-<body>
-
-<?php  if(isset($_SESSION['m_admin']['foldertype']['structures']) && count($_SESSION['m_admin']['foldertype']['structures'])> 0)
-{?>
-<form name="choose_doctypes" id="choose_doctypes" method="post" action="<?php echo $_SESSION['config']['businessappurl'];?>index.php?display=true&module=folder&page=choose_doctypes">
-	<input type="hidden" name="display"  value="true" />
-	<input type="hidden" name="module"  value="folder" />
-	<input type="hidden" name="page"  value="choose_doctypes" />
-		<table align="left" border="0" width="100%">
-		<tr>
-			<td valign="top" width="48%"><b class="tit"><?php echo _DOCTYPES_LIST;?></b></td>
-			<td width="5%" >&nbsp;</td>
-			<td valign="top" width="47%"><b class="tit"><?php echo _SELECTED_DOCTYPES;?></b></td>
-		</tr>
-
-		<tr>
-		 <td width="45%" align="center" valign="top">
-			<select name="doctypeslist[]" class="multiple_list" ondblclick='moveclick(document.choose_doctypes.elements["doctypeslist[]"],document.choose_doctypes.elements["doctypes[]"]);this.form.submit();' multiple="multiple">
-			<?php
-			for($i=0;$i<count($_SESSION['m_admin']['doctypes']);$i++)
-			{
-			$state_doctypes = false;
-
-			for($j=0;$j<count($_SESSION['m_admin']['chosen_doctypes']);$j++)
-			{
-				if(trim($_SESSION['m_admin']['doctypes'][$i]['ID']) == trim($_SESSION['m_admin']['chosen_doctypes'][$j]))
-				{
-					$state_doctypes = true;
-				}
-			}
-
-			if($state_doctypes == false)
-			{
-				?>
-				<option value="<?php functions::xecho($_SESSION['m_admin']['doctypes'][$i]['ID']);?>"><?php functions::xecho($_SESSION['m_admin']['doctypes'][$i]['COMMENT']);?></option>
-				<?php
-			}
-		}
-		?>
-    </select>
-	<br/><br/>
-	<a href='javascript:selectall(document.forms["choose_doctypes"].elements["doctypeslist[]"]);' class="choice"><?php echo _SELECT_ALL;?></a></td>
-    <td width="10%" align="center">
-	<input type="button" class="button" value="<?php echo _ADD;?>" onclick='Move(document.choose_doctypes.elements["doctypeslist[]"],document.choose_doctypes.elements["doctypes[]"]);this.form.submit();' align="middle"/>
-	<br />
-	<br />
-	<input type="button" class="button"  value="<?php echo _REMOVE;?>" onclick='Move(document.choose_doctypes.elements["doctypes[]"],document.choose_doctypes.elements["doctypeslist[]"]);this.form.submit();' align="middle"/>
-	</td>
-    <td width="45%" align="center" valign="top">
-	<select name="doctypes[]" class="multiple_list" ondblclick='moveclick(document.choose_doctypes.elements["doctypes[]"],document.choose_doctypes.elements["doctypeslist"])this.form.submit();' multiple="multiple" >
-		<?php
-		for($i=0;$i<count($_SESSION['m_admin']['doctypes']);$i++)
-		{
-			$state_doctypes = false;
-
-			for($j=0;$j<count($_SESSION['m_admin']['chosen_doctypes']);$j++)
-			{
-				if(trim($_SESSION['m_admin']['doctypes'][$i]['ID']) == trim($_SESSION['m_admin']['chosen_doctypes'][$j]))
-				{
-					$state_doctypes = true;
-				}
-			}
-
-
-			if($state_doctypes == true)
-			{
-				?>
-				<option value="<?php functions::xecho($_SESSION['m_admin']['doctypes'][$i]['ID']);?>" ><?php functions::xecho($_SESSION['m_admin']['doctypes'][$i]['COMMENT']);?></option>
-				<?php
-			}
-		}
-		?>
-    </select>
-	<br/><br/>
-	<a href='javascript:selectall(document.forms["choose_doctypes"].elements["doctypes[]"]);' class="choice">
-	<?php echo _SELECT_ALL;?></a></td>
-	</tr>
-	<tr> <td height="10">&nbsp;</td></tr>
-		</table>
-		</form>
-<?php  }
-else
-{
-	echo _NO_STRUCTURE_ATTACHED2;
-}?>
-</body>
-</html>
diff --git a/modules/folder/class/class_admin_foldertypes.php b/modules/folder/class/class_admin_foldertypes.php
deleted file mode 100755
index cda34b94767..00000000000
--- a/modules/folder/class/class_admin_foldertypes.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/*
- * Copyright (C) 2008-2016 Maarch
- *
- * This file is part of Maarch.
- *
- * Maarch 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 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.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-require_once 'modules/folder/class/class_admin_foldertypes_Abstract.php';
-
-class foldertype extends foldertype_Abstract
-{
-    // custom
-}
diff --git a/modules/folder/class/class_admin_foldertypes_Abstract.php b/modules/folder/class/class_admin_foldertypes_Abstract.php
deleted file mode 100755
index 4fb6115ae72..00000000000
--- a/modules/folder/class/class_admin_foldertypes_Abstract.php
+++ /dev/null
@@ -1,1218 +0,0 @@
-<?php
-
-/*
- * Copyright (C) 2008-2016 Maarch
- *
- * This file is part of Maarch.
- *
- * Maarch 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 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.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-require_once "core/class/class_security.php";
-require_once "core/class/class_history.php";
-
-abstract class foldertype_Abstract
-{
-    /**
-    * Load data from the foldertypes_doctypes table in the session 
-    * ( $_SESSION['m_admin']['foldertype']['doctypes']  array)
-    *
-    * @param    string  $id  foldertype identifier
-    */
-
-    protected function load_doctypes($id)
-    {
-        $db = new Database();
-        $_SESSION['m_admin']['foldertype']['structures'] = array();
-        $stmt = $db->query(
-        	"SELECT doctypes_first_level_id FROM "
-        	. $_SESSION['tablename']['fold_foldertypes_doctypes_level1']
-        	. " WHERE foldertype_id = ?", array($id)
-        );
-        while ($res = $stmt->fetchObject()) {
-            array_push(
-            	$_SESSION['m_admin']['foldertype']['structures'], 
-            	$res->doctypes_first_level_id
-            );
-        }
-        $_SESSION['m_admin']['doctypes'] = array();
-        for ($i = 0; $i < count(
-        	$_SESSION['m_admin']['foldertype']['structures']
-        ); $i ++
-        ) {
-            $tmp = array();
-            $stmt = $db->query(
-            	"SELECT d.description, d.type_id FROM "
-            	. $_SESSION['tablename']['doctypes'] 
-            	. " d WHERE d.doctypes_first_level_id = ?",
-            	array($_SESSION['m_admin']['foldertype']['structures'][$i])
-            );
-            while ($res = $stmt->fetchObject()) {
-                $typeId = $res->type_id;
-                if (! in_array($typeId, $tmp)) {
-                    array_push($tmp, $typeId);
-                    array_push(
-                    	$_SESSION['m_admin']['doctypes'], 
-                    	array(
-                    		'ID' => $typeId, 
-                    		'COMMENT' => functions::show_string($res->description)
-                    	)
-                    );
-                }
-            }
-        }
-
-        $_SESSION['m_admin']['foldertype']['doctypes'] = array();
-        $stmt = $db->query(
-        	"SELECT d.description, fd.doctype_id FROM "
-        	. $_SESSION['tablename']['fold_foldertypes_doctypes'] . " fd, "
-        	. $_SESSION['tablename']['doctypes'] 
-        	. " d WHERE d.type_id = fd.doctype_id and fd.foldertype_id = ? order by d.description ", array($id)
-        );
-        while ($res = $stmt->fetchObject()) {
-            array_push(
-            	$_SESSION['m_admin']['foldertype']['doctypes'], 
-            	$res->doctype_id
-            );
-        }
-        $_SESSION['m_admin']['load_doctypes'] = false;
-    }
-
-
-    /**
-    * Form for the management of the foldertype.
-    *
-    * @param    string  $mode administrator mode (modification, suspension, authorization, delete)
-    * @param    string  $id  foldertype identifier (empty by default)
-    */
-    public function formfoldertype($mode, $id = "")
-    {
-        $func = new functions();
-        $db = new Database();
-        $state = true;
-       
-        $sec = new security();
-        $_SESSION['m_admin']['foldertype']['COLL_ID'] = "";
-        if ($mode == "up") {
-            $_SESSION['m_admin']['mode'] = "up";
-            if (empty($_SESSION['error'])) {
-                $stmt = $db->query(
-                	"SELECT * FROM " 
-                	. $_SESSION['tablename']['fold_foldertypes']
-                	. " WHERE foldertype_id = ?", array($id)
-                );
-                if ($stmt->rowCount() == 0) {
-                    $_SESSION['error'] = _FOLDERTYPE_MISSING;
-                    $state = false;
-                } else {
-                    $_SESSION['m_admin']['foldertype']['foldertypeId'] = $id;
-                    $line = $stmt->fetchObject();
-
-                    $_SESSION['m_admin']['foldertype']['desc'] =  $line->foldertype_label;
-                    $_SESSION['m_admin']['foldertype']['comment'] = $line->maarch_comment;
-
-                    $_SESSION['m_admin']['foldertype']['indexes'] = $this->get_indexes(
-                    	$id, 'minimal'
-                    );
-                    $_SESSION['m_admin']['foldertype']['mandatory_indexes'] = $this->get_mandatory_indexes($id);
-
-                    if (! isset($_SESSION['m_admin']['load_doctypes']) 
-                    	|| $_SESSION['m_admin']['load_doctypes'] == true
-                    ) {
-                        $this->load_doctypes($id);
-                        $_SESSION['m_admin']['load_doctypes'] = false;
-                    }
-
-                    $_SESSION['m_admin']['foldertype']['COLL_ID'] = $line->coll_id;
-                    $table_view = $sec->retrieve_view_from_coll_id(
-                    	$_SESSION['m_admin']['foldertype']['COLL_ID']
-                    );
-                    $res = $db->query(
-                    	"SELECT count(*) as total_doc FROM " . $table_view
-                    	. " WHERE foldertype_id = ?",
-                    	array($_SESSION['m_admin']['foldertype']['foldertypeId'])
-                    );
-                    if ($res) {
-	                    $line = $res->fetchObject();
-    	                $totalDoc = $line->total_doc;
-                    }
-                }
-            }
-        } else {
-            $_SESSION['m_admin']['foldertype']['indexes'] = array();
-            $_SESSION['m_admin']['foldertype']['mandatory_indexes'] = array();
-        }
-        //$this->show_array($_SESSION['m_admin']);
-        if ($mode == "add") {
-            echo '<h1><i class="fa fa-briefcase fa-2x"'
-            	. ' title="" /></i> ' . _FOLDERTYPE_ADDITION . '</h1>';
-        } else if ($mode == "up") {
-            echo '<h1><i class="fa fa-briefcase fa-2x"'
-            	. ' title="" /></i> ' . _FOLDERTYPE_MODIFICATION . '</h1>';
-        }
-        ?>
-        <div id="inner_content" class="clearfix">
-            <?php
-        if ($state == false) {
-        	echo "<br /><br /><br /><br />" . _FOLDERTYPE . ' ' . _UNKNOWN
-        		. "<br /><br /><br /><br />";
-        } else {
-            ?>
-            <div class="block">
-            <form name="formfoldertype" id="formfoldertype" method="post" action="<?php  
-            if ($mode == "up") { 
-            	echo $_SESSION['config']['businessappurl']
-            		. "index.php?display=true&module=folder&page=foldertype_up_db"; 
-            } else if ($mode == "add") { 
-            	echo $_SESSION['config']['businessappurl']
-            		. "index.php?display=true&module=folder&page=foldertype_add_db"; 
-            } 
-            ?>" class="forms">
-            	<input type="hidden" name="display" value="true" />
-                <input type="hidden" name="module" value="folder" />
-                <?php  
-            if ($mode == "up") {
-            	?>
-                <input type="hidden" name="page" value="foldertype_up_db" />
-                <?php 
-            } else if ($mode == "add") {
-            	?>
-                <input type="hidden" name="page" value="foldertype_add_db" />
-                <?php 
-            } 
-            ?>
-               <input type="hidden" name="order" id="order" value="<?php 
-            if (isset($_REQUEST['order'])) {
-            	functions::xecho($_REQUEST['order']);
-            }
-            ?>" />
-               <input type="hidden" name="order_field" id="order_field" value="<?php 
-            if (isset($_REQUEST['order_field'])) {
-            	functions::xecho($_REQUEST['order_field']);
-        	}
-        	?>" />
-               <input type="hidden" name="what" id="what" value="<?php 
-            if (isset($_REQUEST['what'])) {
-            	functions::xecho($_REQUEST['what']);
-        	}
-        	?>" />
-               <input type="hidden" name="start" id="start" value="<?php 
-            if (isset($_REQUEST['start'])) {
-            	functions::xecho($_REQUEST['start']);
-        	}
-        	?>" />
-            <?php
-            if ($mode == "up") {
-            	if (isset($totalDoc) && $totalDoc > 0) {
-                	?>
-                    <p style="width: 400px;margin: auto;">
-                        <input name="collection_show" id="collection_show" type="hidden" value="letterbox_coll"/>
-                    	<input name="collection" id="collection" type="hidden" value="letterbox_coll"/>
-                     </p>
-                     <?php
-                 } else {
-                 	?>
-                    <p style="width: 400px;margin: auto;">                                          
-                        <input name="collection" id="collection" value="letterbox_coll" hidden/>                
-                    </p>
-                    <?php
-                }
-            } else {
-            	?>
-                <p style="width: 400px;margin: auto;">
-                    <input name="collection" id="collection" value="letterbox_coll" hidden/>
-                </p>
-                <?php
-            }
-
-            if ($mode == "up") {
-            	?>
-                <p style="width: 400px;margin: auto;">
-                	<label><?php echo _ID;?> : </label>
-                    <input name="foldertypeId" id="foldertypeId" type="text" value="<?php  
-                functions::xecho(
-                	$_SESSION['m_admin']['foldertype']['foldertypeId']
-                ); 
-                ?>" <?php  
-                if ($mode == "up") { 
-                	echo 'readonly="readonly" class="readonly"';
-                } 
-                ?> />
-                    <input type="hidden"  name="id" value="<?php functions::xecho($id);?>" />
-                    <input type="hidden"  name="mode" value="<?php functions::xecho($mode);?>" />
-                </p>
-                <?php
-            }
-            
-            ?>
-            <p style="width: 400px;margin: auto;">
-            	<label for="desc"><?php echo _DESC;?> : </label>
-                <input name="desc"  type="text" id="desc" value="<?php functions::xecho($_SESSION['m_admin']['foldertype']['desc']);?>" />
-            </p>
-            <p style="width: 400px;margin: auto;">
-            	<label for="comment"><?php echo _COMMENTS;?> : </label>
-                <textarea  cols="30" rows="4"  name="comment"  id="comment" ><?php functions::xecho($_SESSION['m_admin']['foldertype']['comment']); ?></textarea>
-            </p>
-            <div id="opt_index"></div>
-                <p class="buttons" style="text-align:center;">
-                	<input type="submit" name="Submit" value="<?php echo _VALIDATE;?>" class="button" />
-                    <input type="button" name="cancel" value="<?php echo _CANCEL;?>" class="button"  onclick="javascript:window.top.location.href='<?php echo $_SESSION['config']['businessappurl'];?>index.php?page=foldertypes&amp;module=folder';"/>
-                </p>
-           </form>
-           </div>
-           <script type="text/javascript">
-                	get_ft_opt_index('<?php
-            			echo $_SESSION['config']['businessappurl'];
-            		?>index.php?display=true&page=get_index&module=folder');
-                </script>
-         
-                <?php
-            }
-        ?>
-        </div>
-        <?php
-    }
-
-    /**
-    * Processes data returned by formgroups()
-    *
-    * @param    string  $mode administrator mode (modification, suspension, authorization, delete)
-    */
-    protected function foldertypeinfo($mode)
-    {
-        $func = new functions();
-
-        if ($mode == "up") {
-            if (empty($_REQUEST['id']) || !isset($_REQUEST['id'])) {
-                $_SESSION['error'] .= _ID_MISSING;
-            } else {
-                $_SESSION['m_admin']['foldertype']['foldertypeId'] = $func->wash(
-                	$_REQUEST['id'], "alphanum", _THE_ID
-                );
-            }
-        }
-        if (isset($_REQUEST['desc']) && ! empty($_REQUEST['desc'])) {
-            $_SESSION['m_admin']['foldertype']['desc'] = $func->wash(
-            	$_REQUEST['desc'], "no", _THE_DESC
-            );
-        } else {
-            $_SESSION['error'] .= _DESC_MISSING;
-        }
-        if (isset($_REQUEST['collection']) && ! empty($_REQUEST['collection'])) {
-            $_SESSION['m_admin']['foldertype']['COLL_ID'] = $func->wash(
-            	$_REQUEST['collection'], "no", _COLLECTION
-            );
-        } else {
-            $_SESSION['error'] .= _COLLECTION . ' ' . _MISSING;
-        }
-        if (isset($_REQUEST['comment']) && ! empty($_REQUEST['comment'])) {
-            $_SESSION['m_admin']['foldertype']['comment'] = $_REQUEST['comment'];
-        }
-        $_SESSION['m_admin']['foldertype']['indexes'] = array();
-        $_SESSION['m_admin']['foldertype']['mandatory_indexes'] = array();
-        if (isset($_REQUEST['fields'])) {
-            for ($i = 0; $i < count($_REQUEST['fields']); $i ++) {
-                array_push(
-                	$_SESSION['m_admin']['foldertype']['indexes'], 
-                	$_REQUEST['fields'][$i]
-                );
-            }
-        }
-        if (isset($_REQUEST['mandatory_fields'])) {
-            for ($i = 0; $i < count($_REQUEST['mandatory_fields']); $i ++) {
-                if (! in_array(
-                	$_REQUEST['mandatory_fields'][$i], 
-                	$_SESSION['m_admin']['foldertype']['indexes']
-                )
-                ) {
-                    $_SESSION['error'] .= _IF_CHECKS_MANDATORY_MUST_CHECK_USE;
-                }
-                array_push(
-                	$_SESSION['m_admin']['foldertype']['mandatory_indexes'], 
-                	$_REQUEST['mandatory_fields'][$i]
-                );
-            }
-        }
-        $_SESSION['m_admin']['foldertype']['order'] = $_REQUEST['order'];
-        $_SESSION['m_admin']['foldertype']['order_field'] = $_REQUEST['order_field'];
-        $_SESSION['m_admin']['foldertype']['what'] = $_REQUEST['what'];
-        $_SESSION['m_admin']['foldertype']['start'] = $_REQUEST['start'];
-    }
-
-    /**
-    * Add ou modify foldertype in the database
-    *
-    * @param string $mode up or add
-    */
-    public function addupfoldertype($mode)
-    {
-        // add ou modify basket in the database
-        $this->foldertypeinfo($mode);
-        $order = $_SESSION['m_admin']['foldertype']['order'];
-        $orderField = $_SESSION['m_admin']['foldertype']['order_field'];
-        $what = $_SESSION['m_admin']['foldertype']['what'];
-        $start = $_SESSION['m_admin']['foldertype']['start'];
-        $db = new Database();
-
-        if (! empty($_SESSION['error'])) {
-            if ($mode == "up") {
-                if (! empty($_SESSION['m_admin']['foldertype']['foldertypeId'])) {
-                    header(
-                    	"location: " . $_SESSION['config']['businessappurl']
-                    	. "index.php?page=foldertype_up&id="
-                    	. $_SESSION['m_admin']['foldertype']['foldertypeId'] 
-                    	. "&module=folder"
-                    );
-                    exit();
-                } else {
-                    header(
-                    	"location: " . $_SESSION['config']['businessappurl']
-                    	. "index.php?page=foldertypes&module=folder&order="
-                    	. $order . "&order_field=" . $orderField . "&start="
-                    	. $start . "&what=" . $what
-                    );
-                    exit();
-                }
-            } else if ($mode == "add") {
-                header(
-                	"location: " . $_SESSION['config']['businessappurl']
-                	. "index.php?page=foldertype_add&module=folder"
-                	);
-                exit();
-            }
-        } else {
-            if ($mode == "add") {
-                $stmt = $db->query(
-                	"SELECT foldertype_label FROM " 
-                	. $_SESSION['tablename']['fold_foldertypes']
-                	. " WHERE foldertype_label= ? ", array($_SESSION['m_admin']['foldertype']['desc'])
-                );
-                if ($stmt->rowCount() > 0) {
-                    $_SESSION['error'] = $_SESSION['m_admin']['foldertype']['desc'] 
-                    	. " " . _ALREADY_EXISTS . "<br />";
-                    header(
-                    	"location: " . $_SESSION['config']['businessappurl']
-                    	. "index.php?page=foldertype_add&module=folder"
-                    );
-                    exit();
-                } else {
-                    $db->query(
-                    	"INSERT INTO " 
-                    	. $_SESSION['tablename']['fold_foldertypes']
-                    	. " (foldertype_label, maarch_comment, coll_id) VALUES (?, ?, ?)",
-                        array($_SESSION['m_admin']['foldertype']['desc'], $_SESSION['m_admin']['foldertype']['comment'], $_SESSION['m_admin']['foldertype']['COLL_ID'])
-                    );
-                    $stmt = $db->query(
-                    	'SELECT foldertype_id FROM '
-                    	. $_SESSION['tablename']['fold_foldertypes']
-                    	. " WHERE foldertype_label = ? and maarch_comment = ?",
-                        array($_SESSION['m_admin']['foldertype']['desc'], $_SESSION['m_admin']['foldertype']['comment'])
-                    );
-                    $res = $stmt->fetchObject();
-                    $_SESSION['m_admin']['foldertype']['foldertypeId'] = $res->foldertype_id;
-                    $this->load_db();
-
-                    for ($i = 0; $i < count(
-                    	$_SESSION['m_admin']['foldertype']['indexes']
-                    ); $i ++
-                    ) {
-                        $mandatory = 'N';
-                        if (in_array(
-                        	$_SESSION['m_admin']['foldertype']['indexes'][$i], 
-                        	$_SESSION['m_admin']['foldertype']['mandatory_indexes'] 
-                        )
-                        ) {
-                            $mandatory = 'Y';
-                        }
-                        $stmt = $db->query(
-                        	"INSERT INTO " 
-                        	. $_SESSION['tablename']['fold_foldertypes_indexes']
-                        	. " (foldertype_id, field_name, mandatory) values(?, ?, ?)",
-                            array($_SESSION['m_admin']['foldertype']['foldertypeId'], $_SESSION['m_admin']['foldertype']['indexes'][$i], $mandatory)
-                        );
-                    }
-
-                    if ($_SESSION['history']['foldertypeadd'] == "true") {
-                        $hist = new history();
-                        $hist->add(
-                        	$_SESSION['tablename']['fold_foldertypes'], 
-                        	$_SESSION['m_admin']['foldertype']['foldertypeId'],
-                        	"ADD", 'foldertypeadd', _FOLDERTYPE_ADDED . " : " 
-                        	. $_SESSION['m_admin']['foldertype']['foldertypeId'], 
-                        	$_SESSION['config']['databasetype'], 'folder'
-                        );
-                    }
-                    $this->clearfoldertypeinfos();
-                    $_SESSION['info'] = _FOLDERTYPE_ADDED;
-                    unset($_SESSION['m_admin']);
-                    header(
-                    	"location: " . $_SESSION['config']['businessappurl']
-                    	. "index.php?page=foldertypes&module=folder&order="
-                    	. $order . "&order_field=" . $orderField . "&start="
-                    	. $start . "&what=" . $what
-                    );
-                    exit();
-                }
-            } else if ($mode == "up") {
-                $db->query(
-                	"UPDATE " . $_SESSION['tablename']['fold_foldertypes']
-                	. " SET foldertype_label = ? , maarch_comment = ? , coll_id = ? where foldertype_id= ?",
-                    array($_SESSION['m_admin']['foldertype']['desc'], $_SESSION['m_admin']['foldertype']['comment'], $_SESSION['m_admin']['foldertype']['COLL_ID'], $_SESSION['m_admin']['foldertype']['foldertypeId'])
-                );
-                $this->load_db();
-
-                $db->query(
-                	"DELETE FROM " 
-                	. $_SESSION['tablename']['fold_foldertypes_indexes']
-                	. " WHERE foldertype_id = ?",
-                	array($_SESSION['m_admin']['foldertype']['foldertypeId'])
-                );
-
-                for ($i = 0; $i < count(
-                	$_SESSION['m_admin']['foldertype']['indexes']
-                ); $i ++
-                ) {
-                    $mandatory = 'N';
-                    if (in_array(
-                    	$_SESSION['m_admin']['foldertype']['indexes'][$i], 
-                    	$_SESSION['m_admin']['foldertype']['mandatory_indexes'] 
-                    )
-                    ) {
-                        $mandatory = 'Y';
-                    }
-                    $db->query(
-                    	"INSERT INTO "
-                    	. $_SESSION['tablename']['fold_foldertypes_indexes']
-                    	. " ( foldertype_id, field_name, mandatory) values(?, ?, ?)",
-                    array($_SESSION['m_admin']['foldertype']['foldertypeId'], $_SESSION['m_admin']['foldertype']['indexes'][$i], $mandatory)
-                    );
-                }
-                if ($_SESSION['history']['foldertypeup'] == "true") {
-                    $hist = new history();
-                    $hist->add(
-                    	$_SESSION['tablename']['fold_foldertypes'], 
-                    	$_SESSION['m_admin']['foldertype']['foldertypeId'], 
-                    	"UP", 'foldertypeup', _FOLDERTYPE_UPDATE . " : " 
-                    	. $_SESSION['m_admin']['foldertype']['foldertypeId'], 
-                    	$_SESSION['config']['databasetype'], 'folder'
-                    );
-                }
-                $this->clearfoldertypeinfos();
-                $_SESSION['info'] = _FOLDERTYPE_UPDATE;
-                unset($_SESSION['m_admin']);
-                header(
-                	"location: " . $_SESSION['config']['businessappurl']
-                	. "index.php?page=foldertypes&module=folder&order="
-                	. $order . "&order_field=" . $orderField . "&start=" 
-                	. $start . "&what=" . $what
-                );
-                exit();
-            }
-        }
-    }
-
-    /**
-    * Clear the session variable for the foldertypes
-    */
-    protected function clearfoldertypeinfos()
-    {
-        unset($_SESSION['m_admin']);
-    }
-
-    /**
-    * Load the foldertype data in the database
-    */
-    protected function load_db()
-    {
-        $db = new Database();
-        $db->query(
-        	"DELETE FROM " . $_SESSION['tablename']['fold_foldertypes_doctypes'] 
-        	. " WHERE foldertype_id= ?",
-        	array($_SESSION['m_admin']['foldertype']['foldertypeId']) 
-        );
-
-        for ($i = 0; $i < count(
-        	$_SESSION['m_admin']['foldertype']['doctypes'] 
-        ); $i ++
-        ) {
-            $db->query(
-            	"INSERT INTO " 
-            	. $_SESSION['tablename']['fold_foldertypes_doctypes']
-            	. " values (?, ?)",
-                array($_SESSION['m_admin']['foldertype']['foldertypeId'], $_SESSION['m_admin']['foldertype']['doctypes'][$i])
-            );
-        }
-    }
-
-    /**
-    *  delete foldertype in the database
-    *
-    * @param string $id foldertype identifier
-    * @param string $mode allow, ban or del
-    */
-    public function adminfoldertype($id,$mode)
-    {
-        $order = $_REQUEST['order'];
-        $orderField = $_REQUEST['order_field'];
-        $start = $_REQUEST['start'];
-        $what = $_REQUEST['what'];
-        $db = new Database();
-        if (! empty($_SESSION['error'])) {
-            header(
-            	"location: " . $_SESSION['config']['businessappurl']
-            	. "index.php?page=foldertypes&module=folder&order=" . $order
-            	. "&order_field=" . $orderField . "&start=" . $start . "&what="
-            	. $what
-            );
-            exit();
-        } else {
-            $stmt = $db->query(
-            	"SELECT foldertype_id FROM "
-            	. $_SESSION['tablename']['fold_foldertypes']
-            	. " WHERE foldertype_id= ?", array($id)
-            );
-            if ($stmt->rowCount() == 0) {
-                $_SESSION['error'] = _FOLDERTYPE_MISSING;
-                header(
-                	"location: " . $_SESSION['config']['businessappurl']
-                	. "index.php?page=foldertypes&module=folder&order=" . $order
-                	. "&order_field=" . $orderField . "&start=" . $start
-                	. "&what=" . $what
-                );
-                exit();
-            } else {
-                $info = $stmt->fetchObject();
-                if ($mode == "del") {
-                    $db->query(
-                    	"DELETE FROM " 
-                    	. $_SESSION['tablename']['fold_foldertypes']
-                    	. "  WHERE foldertype_id = ?", array($id) 
-                    );
-                    $db->query(
-                    	"DELETE FROM "
-                    	. $_SESSION['tablename']['fold_foldertypes_doctypes']
-                    	. "  WHERE foldertype_id = ?", array($id)
-                    );
-                    $db->query(
-                    	"DELETE FROM " 
-                    	. $_SESSION['tablename']['fold_foldertypes_indexes']
-                    	. "  WHERE foldertype_id = ?", array($id)
-                    );
-
-                    if ($_SESSION['history']['foldertypedel'] == "true") {
-                        $users = new history();
-                        $users->add(
-                        	$_SESSION['tablename']['fold_foldertypes'], $id,
-                        	"DEL", 'foldertypedel', _FOLDERTYPE_DELETION . " : " . $id, 
-                        	$_SESSION['config']['databasetype'], 'folder'
-                        );
-                    }
-                    $_SESSION['error'] = _FOLDERTYPE_DELETION;
-                }
-                header(
-                	"location: " . $_SESSION['config']['businessappurl']
-                	. "index.php?page=foldertypes&module=folder&order=" . $order
-                	. "&order_field=" . $orderField . "&start=" . $start 
-                	. "&what=" . $what
-                );
-                exit();
-            }
-        }
-    }
-
-    /**
-    * Returns in an array all indexes possible
-    *
-    * @return array $indexes[$i]
-    *                   ['column'] : database field of the index
-    *                   ['label'] : Index label
-    *                   ['type'] : Index type ('date', 'string', 'integer' or 'float')
-    *                   ['img'] : url to the image index
-    */
-  public function get_all_indexes()
-    {
-        if (file_exists(
-            $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-            . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-            . DIRECTORY_SEPARATOR . 'folder' . DIRECTORY_SEPARATOR . 'xml'
-            . DIRECTORY_SEPARATOR . 'folder_index.xml'
-        )
-        ) {
-            $path = $_SESSION['config']['corepath'] . 'custom'
-                . DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
-                . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR 
-                . 'folder' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR
-                . 'folder_index.xml';
-        } else {
-            $path = 'modules' . DIRECTORY_SEPARATOR . 'folder'
-                . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR 
-                .'folder_index.xml';
-        }
-        $xmlfile = simplexml_load_file($path);
-        include_once 'modules' . DIRECTORY_SEPARATOR . 'folder'
-            . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR
-            . $_SESSION['config']['lang'] . '.php';
-        $indexes = array();
-        foreach ($xmlfile->INDEX as $item) {
-            $label = (string) $item->label;
-            if (!empty($label) && defined($label) && constant($label) <> NULL) {
-                $label = constant($label);
-            }
-
-            $img = (string) $item->img;
-            if (isset($item->default_value) && ! empty($item->default_value)) {
-                $default = (string) $item->default_value;
-                if (!empty($default) && defined($default) 
-                    && constant($default) <> NULL
-                ) {
-
-                    $default = constant($default);
-                }
-
-            } else {
-                $default = false;
-            }
-            if (isset($item->values_list)) {
-                $values = array();
-                $list = $item->values_list ;
-                foreach ($list->value as $val) {
-                    $labelVal = (string) $val->label;
-                    if (!empty($labelVal) && defined($labelVal) 
-                        && constant($labelVal) <> NULL
-                    ) {
-
-                        $labelVal = constant($labelVal);
-                    }
-                   
-
-                    array_push(
-                        $values,
-                        array(
-                            'id' => (string) $val->id,
-                            'label' => $labelVal,
-                        )
-
-                    );
-                }
-                $tmpArr = array(
-
-                    'column' => (string) $item->column,
-                    'label' => $label,
-                    'type' => (string) $item->type,
-                    'img' => $_SESSION['config']['businessappurl']
-                    . 'static.php?filename=' . $img,
-                    'type_field' => 'select',
-                    'values' => $values,
-                    'default_value' => $default
-                );
-            } else if (isset($item->table)) {
-                $values = array();
-                $tableXml = $item->table;
-                //$this->show_array($tableXml);
-                $tableName = (string) $tableXml->table_name;
-                $foreignKey = (string) $tableXml->foreign_key;
-                $foreignLabel = (string) $tableXml->foreign_label;
-                $whereClause = (string) $tableXml->where_clause;
-                $order = (string) $tableXml->order;
-                $query = "SELECT " . $foreignKey . ", " . $foreignLabel
-                       . " FROM " . $tableName;
-                if (isset($whereClause) && ! empty($whereClause)) {
-                    $query .= " WHERE " . $whereClause;
-                }
-                if (isset($order) && ! empty($order)) {
-                    $query .= ' '.$order;
-                }
-
-                $stmt = $db->query($query);
-                while ($res = $stmt->fetch(PDO::FETCH_ASSOC)) {
-                     array_push(
-                         $values,
-                         array(
-                             'id' => (string) $res[0],
-                             'label' => (string) $res[1],
-
-
-                         )
-                     );
-                }
-                $tmpArr = array(
-                    'column' => (string) $item->column,
-                    'label' => $label,
-                    'type' => (string) $item->type,
-                    'img' => $_SESSION['config']['businessappurl']
-                    . 'static.php?filename=' . $img,
-                    'type_field' => 'select',
-                    'values' => $values,
-                    'default_value' => $default,
-                );
-            } else {
-                $tmpArr = array(
-
-                    'column' => (string) $item->column,
-                    'label' => $label,
-                    'type' => (string) $item->type,
-                    'img' => $_SESSION['config']['businessappurl']
-                    . 'static.php?filename=' . $img,
-                    'type_field' => 'input',
-                    'default_value' => $default,
-                );
-            }
-            //$this->show_array($tmpArr);
-            array_push($indexes, $tmpArr);
-        }
-        return $indexes;
-    }
-
-    /**
-    * Returns in an array all indexes for a doctype
-    *
-    * @param string $foldertypeId Document type identifier
-    * @param string $mode Mode 'full' or 'minimal', 'full' by default
-    * @return array array of the indexes, depends on the chosen mode :
-    *       1) mode = 'full' : $indexes[field_name] :  the key is the field name in the database
-    *                                       ['label'] : Index label
-    *                                       ['type'] : Index type ('date', 'string', 'integer' or 'float')
-    *                                       ['img'] : url to the image index
-    *       2) mode = 'minimal' : $indexes[$i] = field name in the database
-    */
-    public function get_indexes($foldertypeId, $mode= 'full')
-    {
-        $fields = array();
-        $db = new Database();
-
-        if ($mode == 'minimal') {
-            $stmt = $db->query(
-                "SELECT field_name FROM "
-                . $_SESSION['tablename']['fold_foldertypes_indexes']
-                . " WHERE  foldertype_id = ?", array($foldertypeId)
-            );
-    
-            while ($res = $stmt->fetchObject()) {
-                array_push($fields, $res->field_name);
-            }
-            return $fields;
-        } else {
-            $arr_mandatory = array();
-            $stmt = $db->query(
-                "SELECT field_name, mandatory FROM "
-                . $_SESSION['tablename']['fold_foldertypes_indexes']
-                . " WHERE  foldertype_id = ?", array($foldertypeId)
-            );
-
-            while ($res = $stmt->fetchObject()) {
-                array_push($fields, $res->field_name);
-                array_push($arr_mandatory, $res->mandatory);
-            }
-        }
-        $indexes = array();
-        if (file_exists(
-        	$_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-        	. $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . 'modules'
-        	. DIRECTORY_SEPARATOR . 'folder' . DIRECTORY_SEPARATOR . 'xml'
-        	. DIRECTORY_SEPARATOR . 'folder_index.xml'
-        )
-        ) {
-            $path = $_SESSION['config']['corepath'] . 'custom' 
-            	. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
-            	. DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR
-            	. 'folder' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR
-            	. 'folder_index.xml';
-        } else {
-            $path = 'modules' . DIRECTORY_SEPARATOR . 'folder' 
-            	. DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR
-            	. 'folder_index.xml';
-        }
-        $xmlfile = simplexml_load_file($path);
-        include_once 'modules' . DIRECTORY_SEPARATOR . 'folder'
-        	. DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR
-        	. $_SESSION['config']['lang'] . '.php';
-        foreach ($xmlfile->INDEX as $item) {
-            $label = (string) $item->label;
-            if (!empty($label) && defined($label) && constant($label) <> NULL) {
-            	$label = constant($label);
-            }
-            $col = (string) $item->column;
-            $img = (string) $item->img;
-            if (isset($item->default_value) && ! empty($item->default_value)) {
-                $default = (string) $item->default_value;
-            	if (! empty($default) && defined($default) 
-            		&& constant($default) <> NULL
-            	) {
-            		$default = constant($default);
-            	}
-            } else {
-                $default = false;
-            }
-            if (in_array($col, $fields)) {
-                if (isset($item->values_list)) {
-                    $values = array();
-                    $list = $item->values_list ;
-                    foreach ($list->value as $val) {
-                        $labelVal = (string) $val->label;
-                   		if (! empty($labelVal) && defined($labelVal) 
-            				&& constant($labelVal) <> NULL
-            			) {
-            				$labelVal = constant($labelVal);
-            			}
-                        array_push(
-                        	$values, 
-                        	array(
-                        		'id' => (string) $val->id, 
-                        		'label' => $labelVal
-                        	)
-                        );
-                    }
-                    $indexes[$col] = array( 
-                    	'label' => $label, 
-                    	'type' => (string) $item->type, 
-                    	'img' => $_SESSION['config']['businessappurl']
-                    		. 'static.php?module=folder&filename=' . $img, 
-                    	'type_field' => 'select', 
-                    	'values' => $values, 
-                    	'default_value' => $default,
-                    );
-                } else if (isset($item->table)) {
-                    $values = array();
-                    $tableXml = $item->table;
-                    //$this->show_array($tableXml);
-                    $tableName = (string) $tableXml->table_name;
-                    $foreignKey = (string) $tableXml->foreign_key;
-                    $foreignLabel = (string) $tableXml->foreign_label;
-                    $whereClause = (string) $tableXml->where_clause;
-                    $order = (string) $tableXml->order;
-                    $query = "SELECT " . $foreignKey . ", " . $foreignLabel
-                           . " FROM " . $tableName;
-                    if (isset($whereClause) && ! empty($whereClause)) {
-                        $query .= " where " . $whereClause;
-                    }
-                    if (isset($order) && ! empty($order)) {
-                        $query .= ' '.$order;
-                    }
-                    $stmt = $db->query($query);
-                    while ($res = $stmt->fetchObject()) {
-                         array_push(
-                             $values,
-                             array(
-                                 'id' => (string) $res->{$foreignKey},
-                                 'label' => $res->{$foreignLabel},
-                             )
-                         );
-                    }
-                    $indexes[$col] = array(
-                        'label' => $label,
-                        'type' => (string) $item->type,
-                        'img' => $_SESSION['config']['businessappurl']
-                        . 'static.php?filename=' . $img,
-                        'type_field' => 'select',
-                        'values' => $values,
-                        'default_value' => $default,
-                    );
-                } else {
-                    $indexes[$col] = array( 
-                    	'label' => $label, 
-                    	'type' => (string) $item->type, 
-                    	'img' => $_SESSION['config']['businessappurl']
-                    		. 'static.php?module=folder&filename=' . $img, 
-                    	'type_field' => 'input', 
-                    	'default_value' => $default
-                    );
-                }
-            }
-        }
-        ksort($indexes);
-        $keys = array_keys($indexes);
-        for($i=0;$i<count($indexes);$i++){
-            $indexes[$keys[$i]]['mandatory'] = $arr_mandatory[$i];
-
-        }
-        return $indexes;
-    }
-
-    /**
-    * Returns in an array all manadatory indexes possible for a given type
-    *
-    * @param string $foldertypeId Document type identifier
-    * @return array Array of the manadatory indexes, $indexes[$i] = field name in the db
-    */
-    public function get_mandatory_indexes($foldertypeId)
-    {
-        $fields = array();
-        $db = new Database();
-        $stmt = $db->query(
-        	"SELECT field_name FROM " 
-        	. $_SESSION['tablename']['fold_foldertypes_indexes']
-        	. " WHERE foldertype_id = ? and mandatory = 'Y'", array($foldertypeId)
-        );
-
-        while ($res = $stmt->fetchObject()) {
-            array_push($fields, $res->field_name);
-        }
-        return $fields;
-    }
-
-    /**
-    * Checks validity of indexes
-    *
-    * @param string $foldertypeId Folder type identifier
-    * @param array $values Values to check
-    * @return bool true if checks is ok, false if an error occurs
-    */
-    public function check_indexes($foldertypeId, $values)
-    {
-        if (empty($foldertypeId)) {
-            return false;
-        }
-
-        // Checks the manadatory indexes
-        $indexes = $this->get_indexes($foldertypeId);
-        $mandatoryIndexes = $this->get_mandatory_indexes($foldertypeId);
-        
-        for ($i = 0; $i < count($mandatoryIndexes); $i ++) {
-            if (empty($values[$mandatoryIndexes[$i]])) { // Pb 0
-                $_SESSION['error'] .= $indexes[$mandatoryIndexes[$i]]['label']
-                    . ' ' . _IS_EMPTY;
-                return false;
-            }
-        }
-
-        $functions = new functions(); 
-        // Checks type indexes
-        $datePattern = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/";
-        foreach (array_keys($values) as $key) {
-            if (! empty($_SESSION['error'])) {
-                return false;
-            }
-            if ($indexes[$key]['type'] == 'date' && !empty($values[$key])) {
-                if (preg_match($datePattern, $values[$key]) == 0) {
-                    $_SESSION['error'] .= $indexes[$key]['label'] . " "
-                    	. _WRONG_FORMAT . ".<br/>";
-                    return false;
-                }
-            } else if ($indexes[$key]['type'] == 'string'  
-            	&& ! empty($values[$key])
-            ) {
-                $fieldValue = $functions->wash(
-                	$values[$key], "no", $indexes[$key]['label']
-                );
-            } else if ($indexes[$key]['type'] == 'float' 
-            	&& ! empty($values[$key]) 
-            ) {
-                $fieldValue = $functions->wash(
-                	$values[$key], "float", $indexes[$key]['label']
-                );
-            } else if ($indexes[$key]['type'] == 'integer' 
-            	&& ! empty($values[$key]) 
-            ) {
-                $fieldValue = $functions->wash(
-                	$values[$key], "num", $indexes[$key]['label']
-                );
-            }
-
-            if (isset($indexes[$key]['values']) 
-            	&& count($indexes[$key]['values']) > 0
-            ) {
-                $found = false;
-                for ($i = 0; $i < count($indexes[$key]['values']); $i ++) {
-                    if ($values[$key] == $indexes[$key]['values'][$i]['id'] || $values[$key] == "") {
-                        $found = true;
-                        break;
-                    }
-                }
-                if (! $found) {
-                    $_SESSION['error'] .= $indexes[$key]['label'] . " : "
-                    	. _ITEM_NOT_IN_LIST . ".<br/>";
-                    return false;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-    * Returns a string to use in an sql update query
-    *
-    * @param string $foldertypeId Folder type identifierer
-    * @param array $values Values to update
-    * @return string Part of the update sql query
-    */
-    public function get_sql_update($foldertypeId, $values)
-    {
-        $indexes = $this->get_indexes($foldertypeId);
-
-        $req = '';
-        foreach (array_keys($values) as $key) {
-            if ($indexes[$key]['type'] == 'date' && ! empty($values[$key])) {
-                $req .= ", " . $key . " = '" 
-                	. functions::format_date_db($values[$key]) . "'";
-            } else if ($indexes[$key]['type'] == 'string' 
-            	&& ! empty($values[$key])
-            ) {
-                $req .= ", " . $key . " = '"
-                	. functions::protect_string_db($values[$key]) . "'";
-            } else if ($indexes[$key]['type'] == 'float' 
-            	&& ! empty($values[$key])
-            ) {
-                $req .= ", " . $key . " = " . $values[$key];
-            } else if ($indexes[$key]['type'] == 'integer' 
-            	&& ! empty($values[$key])
-            ) {
-                $req .= ", " . $key . " = " . $values[$key];
-            }
-        }
-        return $req;
-    }
-
-    /**
-    * Returns an array used to insert data in the database
-    *
-    * @param string $foldertypeId Folder type identifier
-    * @param array $values Values to update
-    * @param array $data Return array
-    * @return array
-    */
-    public function fill_data_array($foldertypeId, $values, $data = array())
-    {
-        $indexes = $this->get_indexes($foldertypeId);
-
-        foreach (array_keys($values) as $key) {
-            if ($indexes[$key]['type'] == 'date') {
-                if($values[$key] === ''){
-                    $values[$key] = NULL;
-                }
-
-                array_push(
-                	$data, 
-                	array(
-                		'column' => $key, 
-                		'value' => functions::format_date_db($values[$key]), 
-                		'type' => "date"
-                	)
-                );
-            } else if ($indexes[$key]['type'] == 'string') {
-                if($values[$key] === ''){
-                    $values[$key] = NULL;
-                }
-
-                array_push(
-                	$data, 
-                	array(
-                		'column' => $key, 
-                		'value' => functions::protect_string_db($values[$key]), 
-                		'type' => "string"
-                	)
-                );
-            } else if ($indexes[$key]['type'] == 'float') {
-                if($values[$key] === ''){
-                    $values[$key] = NULL;
-                }
-
-                array_push(
-                	$data, 
-                	array(
-                		'column' => $key, 
-                		'value' => $values[$key], 
-                		'type' => "float"
-                	)
-                );
-            } else if ($indexes[$key]['type'] == 'integer') {
-                if($values[$key] === ''){
-                    $values[$key] = NULL;
-                }
-
-                array_push(
-                	$data, 
-                	array(
-                		'column' => $key, 
-                		'value' => $values[$key], 
-                		'type' => "integer"
-                	)
-                );
-            }
-        }
-        return $data;
-    }
-
-    /**
-    * Inits in the database the indexes for a given folder id to null
-    *
-    * @param string $folderSysId Folder identifier
-    */
-    public function inits_opt_indexes($folderSysId)
-    {
-        $indexes = $this->get_all_indexes( );
-        $query = "UPDATE " . $_SESSION['tablename']['fold_folders'] . " SET ";
-        for ($i = 0; $i < count($indexes); $i ++) {
-            $query .= $indexes[$i]['column'] . " = NULL, ";
-        }
-        $query = preg_replace(
-        	'/, $/', ' WHERE folders_system_id = ?', $query
-        );
-        $arrayPDO = array($folderSysId);
-
-        $db = new Database();
-        $db->query($query, $arrayPDO);
-    }
-
-
-    public function search_checks($indexes, $fieldName, $val, $table_or_view = '' )
-    {
-		if (empty($table_or_view)) { $table_or_view = $_SESSION['tablename']['fold_folders']; }
-		
-        $whereRequest = '';
-        $datePattern = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/";
-        foreach (array_keys($indexes) as $key) {
-            if ($key == $fieldName) {// type == 'string'
-                if (!empty($val)) {
-                    $whereRequest .= " lower(" . $table_or_view
-                        . "." . $key . ") like lower('%" 
-                        . functions::protect_string_db($val) . "%') and ";
-                }
-                break;
-            } else if ($key.'_from' == $fieldName || $key.'_to' == $fieldName) { 
-            	// type == 'date'
-                if (preg_match($datePattern, $val) == false) {
-                    $_SESSION['error'] .= _WRONG_DATE_FORMAT . ' : ' . $val;
-                } else {
-                    $whereRequest .= " (" . $table_or_view
-                    	. "." . $key . " >= '" . functions::format_date_db($val)
-                    	. "') and ";
-                }
-                break;
-            } else if ($key . '_min' == $fieldName 
-            	|| $key . '_max' == $fieldName 
-            ) {
-                if ($indexes[$key]['type'] == 'integer' 
-                	|| $indexes[$key]['type'] == 'float'
-                ) {
-                    if ($indexes[$key]['type'] == 'integer') {
-                        $checkedVal = functions::wash(
-                        	$val, "num", $indexes[$key]['label'], "no"
-                        );
-                    } else {
-                        $checkedVal = functions::wash(
-                        	$val, "float", $indexes[$key]['label'], "no"
-                        );
-                    }
-                    if (empty($_SESSION['error'])) {
-                        $whereRequest .= " (" . $table_or_view
-                        	. "." . $key . " >= " . $checkedVal . ") and ";
-                    }
-                }
-                break;
-            }
-        }
-        return  $whereRequest;
-    }
-}
diff --git a/modules/folder/class/class_folders_show.php b/modules/folder/class/class_folders_show.php
deleted file mode 100755
index 8d9c0537c00..00000000000
--- a/modules/folder/class/class_folders_show.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2016 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/>.
-*/
-
-/**
-* List Class
-*
-*  Contains all the function to make list whith results
-*
-* @package  Maarch PeopleBox 1.0
-* @version 1.0
-* @since 10/2005
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-* @author  Loïc Vinet  <dev@maarch.org>
-* @author  Laurent Giovannoni  <dev@maarch.org>
-*
-*/
-
-require_once 'modules/folder/class/class_folders_show_Abstract.php';
-
-class folders_show extends folders_show_Abstract
-{
-	// custom
-}
diff --git a/modules/folder/class/class_folders_show_Abstract.php b/modules/folder/class/class_folders_show_Abstract.php
deleted file mode 100755
index 49fa4be5e49..00000000000
--- a/modules/folder/class/class_folders_show_Abstract.php
+++ /dev/null
@@ -1,388 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2016 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/>.
-*/
-
-/**
-* List Class
-*
-*  Contains all the function to make list whith results
-*
-* @package  Maarch PeopleBox 1.0
-* @version 1.0
-* @since 10/2005
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-* @author  Loïc Vinet  <dev@maarch.org>
-* @author  Laurent Giovannoni  <dev@maarch.org>
-*
-*/
-
-
-abstract class folders_show_Abstract extends functions
-{
-
-	/**
-	* Show the tree of folder
-	*
-	* @param array $result array of the tree folder
-	* @param string $link link to the form page
-	*/
-	public function folder_tree($result,$link)
-	{
-		$second_level=0;
-		$third_level=0;
-
-		echo "<div  >";
-		for ($i=0;$i<count($result);$i++)
-		{
-			foreach(array_keys($result[$i]) as $value)
-			{
-				if($value == "first_level_id")
-				{
-					?><img src="<?php echo $_SESSION['config']['businessappurl'];?>static.php?filename=dossiers2.gif" align="middle" alt="" />
-				<span class='selected'>
-					<?php functions::xecho($result[$i]['first_level_label']);?><br />
-					</span>
-					<div class='dir_second_level'>
-                    <?php
-					for ($j=0;$j<count($result[$i]['level2']['second_level_id']);$j++)
-					{
-						if($_GET['second_level'] == $result[$i]['level2']['second_level_id'][$second_level])
-						{
-							?><span class="selected">
-							<a href="<?php echo $_SESSION['config']['businessappurl'];?>index.php?page=<?php functions::xecho($link);?>"><img src="<?php echo $_SESSION['config']['businessappurl'];?>static.php?filename=dir_open.gif" border="0" align='middle' alt="" /> 		
-							<?php functions::xecho($result[$i]['level2']['second_level_label'][$second_level]);?></a><br/>
-							</span>
-							<div class='dir_third_level'>
-							<?php  for($k=0;$k<count($result[$i]['level2'][$second_level]['level3']['type_id']);$k++)
-							{
-								?>
-								<a href="<?php echo $_SESSION['config']['businessappurl'];?>index.php?page=<?php functions::xecho($link);?>&amp;type_id=<?php functions::xecho($result[$i]['level2'][$second_level]['level3']['type_id'][$third_level]);?>&amp;second_level=<?php functions::xecho($result[$i]['level2']['second_level_id'][$second_level]);?>&amp;coll_id=<?php functions::xecho($result[$i]['level2'][$second_level]['level3']['coll_id'][$third_level]); ?>"><img src="<?php echo $_SESSION['config']['businessappurl'];?>static.php?filename=arrow_primary.gif" border="0" align="middle" alt="" /> 
-								<?php functions::xecho($result[$i]['level2'][$second_level]['level3']['type_label'][$third_level]);?></a><br/> <?php
-								$third_level++;
-							}
-							$second_level++;
-							echo "</div>";
-						}
-						else
-						{
-							for($k=0;$k<count($result[$i]['level2'][$second_level]['level3']['type_id']);$k++)
-							{
-								$third_level++;
-							}
-							?><a href="<?php echo $_SESSION['config']['businessappurl'];?>index.php?page=<?php functions::xecho($link);?>&amp;second_level=<?php functions::xecho($result[$i]['level2']['second_level_id'][$second_level]);?>"><img src="<?php echo $_SESSION['config']['businessappurl'];?>static.php?module=folder&filename=dir_close.gif" align="top" border="0" alt="" /> <?php functions::xecho($result[$i]['level2']['second_level_label'][$second_level]);?></a><br/><?php
-							$second_level++;
-						}
-					}
-					echo "</div>";
-				}
-			}
-		}
-		echo "</div>";
-	}
-
-	/**
-	* construct the folders tree
-	*
-	*/
-	public function construct_tree()
-	{
-		$sun= new functions();
-		$conn = new Database();
-
-		$query="SELECT ".$_SESSION['tablename']['doctypes'].".coll_id, ".$_SESSION['tablename']['doctypes'].".type_id as type_id, ".$_SESSION['tablename']['doctypes'].".description as type_description, ".$_SESSION['tablename']['doctypes'].".doctypes_first_level_id as first_level_id, ".$_SESSION['tablename']['doctypes'].".doctypes_second_level_id as second_level_id,
-		".$_SESSION['tablename']['doctypes_first_level'].".doctypes_first_level_label as first_level_label, ".$_SESSION['tablename']['doctypes_second_level'].".doctypes_second_level_label as second_level_label
-		FROM ".$_SESSION['tablename']['doctypes']."
-		left join ".$_SESSION['tablename']['doctypes_first_level']." on ".$_SESSION['tablename']['doctypes'].".doctypes_first_level_id = ".$_SESSION['tablename']['doctypes_first_level'].".doctypes_first_level_id
-		left join ".$_SESSION['tablename']['doctypes_second_level']." on ".$_SESSION['tablename']['doctypes'].".doctypes_second_level_id = ".$_SESSION['tablename']['doctypes_second_level'].".doctypes_second_level_id
-		WHERE ".$_SESSION['tablename']['doctypes'].".enabled = 'Y' and ".$_SESSION['tablename']['doctypes_second_level'].".enabled = 'Y' and ".$_SESSION['tablename']['doctypes_first_level'].".enabled = 'Y' order by ".$_SESSION['tablename']['doctypes'].".doctypes_first_level_id, ".$_SESSION['tablename']['doctypes'].".doctypes_second_level_id, ".$_SESSION['tablename']['doctypes'].".description";
-
-		$stmt = $conn->query($query);
-
-		$tab_result = array();
-		$tab_tree = array();
-		$i=0;
-		while ($value = $stmt->fetchObject())
-		{
-			$tab_result[$i]['type_id'] = $value->type_id;
-
-			$tab_result[$i]['type_description'] = functions::show_string($value->type_description);
-			$tab_result[$i]['first_level_id'] = $value->first_level_id;
-			$tab_result[$i]['first_level_label'] = functions::show_string($value->first_level_label);
-			$tab_result[$i]['second_level_id'] = $value->second_level_id;
-			$tab_result[$i]['second_level_label'] = functions::show_string($value->second_level_label);
-			$i++;
-		}
-
-		$query="SELECT doctypes_first_level_id, doctypes_first_level_label FROM ".$_SESSION['tablename']['doctypes_first_level']." WHERE enabled = 'Y' order by doctypes_first_level_label";
-		$stmt = $conn->query($query);
-		$i=0;
-		while ($value = $stmt->fetchObject())
-		{
-			$tab_tree[$i]['first_level_id'] = $value->doctypes_first_level_id;
-			$tab_tree[$i]['first_level_label'] = functions::show_string($value->doctypes_first_level_label);
-			$tab_tree[$i]['level2']=array();
-			$i++;
-		}
-		$j=0;
-		$k=0;
-		for ($i=0;$i<count($tab_tree);$i++)
-		{
-			foreach(array_keys($tab_tree[$i]) as $value)
-			{
-				if($value == "first_level_id")
-				{
-					$query="SELECT doctypes_second_level_id, doctypes_second_level_label FROM ".$_SESSION['tablename']['doctypes_second_level']." WHERE doctypes_first_level_id = ? and enabled = 'Y' order by doctypes_second_level_label";
-					$arrayPDO = array($tab_tree[$i]['first_level_id']);
-					$stmt = $conn->query($query, $arrayPDO);
-					while ($val = $stmt->fetchObject())
-					{
-						$tab_tree[$i]['level2']['second_level_id'][$j]=$val->doctypes_second_level_id;
-						$tab_tree[$i]['level2']['second_level_label'][$j]=functions::show_string($val->doctypes_second_level_label);
-						$tab_tree[$i]['level2'][$j]['level3']=array();
-						$query2="SELECT type_id, description, coll_id FROM ".$_SESSION['tablename']['doctypes']." WHERE doctypes_first_level_id = ? and doctypes_second_level_id= ? and enabled = 'Y' order by description";
-						$stmt2 = $conn->query($query2, array($tab_tree[$i]['first_level_id'], $tab_tree[$i]['level2']['second_level_id'][$j]));
-						while ($val2 = $stmt2->fetchObject())
-						{
-							$tab_tree[$i]['level2'][$j]['level3']['type_id'][$k]=$val2->type_id;							
-							$tab_tree[$i]['level2'][$j]['level3']['coll_id'][$k]=$val2->coll_id;
-							$tab_tree[$i]['level2'][$j]['level3']['type_label'][$k]=functions::show_string($val2->description);
-							$k++;
-						}
-						$j++;
-					}
-				}
-			}
-		}
-		//$this->show_array($tab_tree);
-		$this->folder_tree($tab_tree,"view_folder&amp;module=folder");
-	}
-
-
-
-	/**
-	* Show all the folder data (used in the salary sheet and view folder)
-	*
-	* @param array $folder_array array containing folder data
-	* @param string $link link to the form result
-	* @param string $path_trombi path to the photo
-	*/
-	public function view_folder_info_details($folder_array,$link,$path_trombi = '')
-	{
-		if ($_SESSION['user']['services']['modify_folder'] )
-		{
-			$up = true;
-		 }
-		 else
-		 {
-		 	$up=false;
-		 }
-		$db = new Database();
-		 ?>
-         	<form name="view_folder_detail" method='post' action='<?php functions::xecho($link);?>' class="folder_forms" ><?php
-		if($up)
-		{
-		?><input type="hidden" value="up" name="mode" />
-		<input type="hidden" value="true" name="folder_index" />
-		<?php
-		}?>
-
-			<?php
-					if($folder_array['complete'] == "Y")
-					{
-						$complete = _FOLDER.' '.strtolower(_COMPLETE);
-					}
-					else
-					{
-						$complete = _FOLDER.' '.strtolower(_INCOMPLETE);
-					}
-					?><br/>
-                    <div align="center">
-                    <span>
-                    	<label><?php echo _MATRICULE;?> :</label>
-                        <input type="text" readonly="readonly" value="<?php functions::xecho($folder_array['folder_id']);?>" class="readonly" />
-                        &nbsp;&nbsp;&nbsp;
-                          <label><?php echo _FOLDERTYPE;?> :</label>
-                        <input type="text" readonly="readonly" value="<?php functions::xecho($folder_array['foldertype_label']);?>" class="readonly" />
-                        </span>
-                        <span >
-                        <br/><small>(
-                        <?php functions::xecho($complete);?>)</small>
-                        </span>
-
-
-
-                    <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
-                    <span id="link_right" >
-                    	<?php  if($_SESSION['origin'] == "view_folder")
-						{?><a href="<?php echo $_SESSION['config']['businessappurl'];?>index.php?page=show_folder&amp;module=folder&amp;field=<?php functions::xecho($_SESSION['current_folder_id']);?>"><img src="<?php echo $_SESSION['config']['businessappurl'];?>static.php?module=folder&filename=s_sheet_c.gif" width="20px" height="25px"
-                    	alt="logo"/><?php echo _VIEW_SALARY_SHEET;?></a>
-                        <?php  } ?>
-                    </span>
-                  </div>
-                    <br/>
-
-
-            <table border="0" width="100%">
-		<?php
-			//$this->show_array( $folder_array);
-			for($i=0; $i < count($folder_array['index']);$i++)
-			{
-				 if ($i%2 != 1 || $i==0) // pair
-				 {
-   					echo '<tr>'	;
-				}
-				?>
-				<td width="24%" align="left" >
-					<span>
-						<?php
-						if($folder_array['index'][$i]['mandatory'])
-						{
-							echo "<b>".$folder_array['index'][$i]['label']."</b> : ";
-						}
-						else
-						{
-							functions::xecho($folder_array['index'][$i]['label'])." : ";
-						}
-						?>
-                    </span>
-                  </td>
-                  <td width="25%" align="left">
-                    <?php
-			if($up==true)
-			{
-
-					if((isset($folder_array['index'][$i]['foreign_key']) && !empty($folder_array['index'][$i]['foreign_key']) && isset($folder_array['index'][$i]['foreign_label']) && !empty($folder_array['index'][$i]['foreign_label']) && isset($folder_array['index'][$i]['tablename']) && !empty($folder_array['index'][$i]['tablename'])) || (isset($folder_array['index'][$i]['values']) && count($folder_array['index'][$i]['values']) > 0))
-					{
-					?>
-                    	<select name="<?php functions::xecho($folder_array['index'][$i]['column']);?>" id="<?php functions::xecho($folder_array['index'][$i]['column']);?>">
-                        <option value=""><?php echo _CHOOSE;?></option>
-                        <?php
-						if(isset($folder_array['index'][$i]['values']) && count($folder_array['index'][$i]['values']) > 0)
-						{
-							for($k=0; $k < count($folder_array['index'][$i]['values']); $k++)
-							{
-							?>
-                            	<option value="<?php functions::xecho($folder_array['index'][$i]['values'][$k]['label']);?>" <?php  if($folder_array['index'][$i]['values'][$k]['label'] == $folder_array['index'][$i]['value']){ echo 'selected="selected"'; } ?>><?php functions::xecho($folder_array['index'][$i]['values'][$k]['label']);?></option>
-                            <?php
-							}
-						}
-						else
-						{
-							$query = "SELECT ".$folder_array['index'][$i]['foreign_key'].", ".$folder_array['index'][$i]['foreign_label']." FROM ".$folder_array['index'][$i]['tablename'];
-
-							$arrayPDO = array();
-							if(isset($folder_array['index'][$i]['where']) && !empty($folder_array['index'][$i]['where']))
-							{
-								$query .= " WHERE ? ";
-								$arrayPDO = array_merge($arrayPDO, array($folder_array['index'][$i]['where']));
-							}
-							if(isset($folder_array['index'][$i]['order']) && !empty($folder_array['index'][$i]['order']))
-							{
-								$query .= ' '.$folder_array['index'][$i]['order'];
-							}
-
-							$stmt = $db->query($query, $arrayPDO);
-
-							while($res = $stmt->fetchObject())
-							{
-							?>
-                            <option value="<?php functions::xecho($res->{$folder_array['index'][$i]['foreign_key']});?>" <?php  if($res->{$folder_array['index'][$i]['foreign_key']} == $folder_array['index'][$i]['value']){ echo 'selected="selected"';}?>><?php functions::xecho($res->{$folder_array['index'][$i]['foreign_label']});?></option>
-                            <?php
-							}
-						}
-						?>
-                        </select>
-                    <?php
-					}
-					else
-					{
-						?>
-						<input type="text" name="<?php functions::xecho($folder_array['index'][$i]['column']);?>" id="<?php functions::xecho($folder_array['index'][$i]['column']);?>" 
-						<?php  if($_SESSION['field_error'][$folder_array['index'][$i]['column']]){?>style="background-color:#FF0000" <?php } 
-						if($folder_array['index'][$i]['date'])
-						{ echo 'class="medium"'; } ?> value="<?php
-						if($folder_array['index'][$i]['date'])
-						{
-							echo functions::format_date_db($folder_array['index'][$i]['value']);
-						}
-						else
-						{
-							functions::xecho($folder_array['index'][$i]['value']);
-						}
-						?> "
-						<?php
-						if($folder_array['index'][$i]['date'])
-						{
-						?>
-						onclick="showCalender(this);"
-						<?php  }?>
-						/>
-                    <?php
-					}
-					if($folder_array['index'][$i]['mandatory'])
-					{
-						?>
-                        <input type="hidden" name="mandatory_<?php functions::xecho($folder_array['index'][$i]['column']);?>" id="mandatory_<?php functions::xecho($folder_array['index'][$i]['column']);?>" value="true" />
-                        <?php
-					}
-			}
-			else
-			{
-				?><input type="text" name="<?php functions::xecho($folder_array['index'][$i]['column']);?>" id="<?php functions::xecho($folder_array['index'][$i]['column']);?>" <?php  if($folder_array['index'][$i]['date'])
-						{ echo 'class="medium"'; } ?> value="<?php functions::xecho($folder_array['index'][$i]['value']) ?>" readonly="readonly" class="readonly" /><?php
-			}
-
-					?>
-				</td>
-				<?php
-				if ($i%2 == 1 && $i!=0) // impair
-				 {
-   					echo '</tr>'	;
-				}
-				else
-				{
-
-					if($i+1 == count($folder_array['index']))
-					{
-						echo '<td width="2" colspan="3">&nbsp;</td></tr>';
-					}
-					else
-					{
-						echo  '<td width="2">&nbsp;</td>';
-					}
-				}
-			}
-		?></table>
-		<div align="right">
-		<?php
-       	if($up==true)
-		{ ?>
-			<input type="submit" class="button" value="<?php echo _UPDATE_FOLDER;?>" />
-		<?php  }
-		//require_once($_SESSION['pathtocoreclass'].'class_core_tools.php');
-		$ct = new core_tools();
-		$ct->execute_modules_services($_SESSION['modules_services'], "index.php?page=".$_SESSION['origin'], '', 'delete_folder', 'folder');
-				?>
-         </div>
-		</form><?php
-	}
-}
-?>
diff --git a/modules/folder/class/class_modules_tools.php b/modules/folder/class/class_modules_tools.php
deleted file mode 100755
index 307826e5cdd..00000000000
--- a/modules/folder/class/class_modules_tools.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2016 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/>.
-*/
-
-/**
-* modules tools Class for workflow
-*
-*  Contains all the functions to  modules tables for workflow
-*
-* @package  maarch
-* @version 3.0
-* @since 10/2005
-* @license GPL v3
-* @author  Laurent Giovannoni  <dev@maarch.org>
-*
-*/
-
-require_once 'modules/folder/class/class_modules_tools_Abstract.php';
-
-class folder extends folder_Abstract
-{
-	// custom
-}
diff --git a/modules/folder/class/class_modules_tools_Abstract.php b/modules/folder/class/class_modules_tools_Abstract.php
deleted file mode 100755
index a375c56e54a..00000000000
--- a/modules/folder/class/class_modules_tools_Abstract.php
+++ /dev/null
@@ -1,1029 +0,0 @@
-<?php
-
-/*
-*   Copyright 2008-2016 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/>.
-*/
-
-/**
-* modules tools Class for workflow
-*
-*  Contains all the functions to  modules tables for workflow
-*
-* @package  maarch
-* @version 3.0
-* @since 10/2005
-* @license GPL v3
-* @author  Laurent Giovannoni  <dev@maarch.org>
-*
-*/
-require_once 'core' . DIRECTORY_SEPARATOR . 'class' . DIRECTORY_SEPARATOR
-. 'class_request.php';
-require_once 'core' . DIRECTORY_SEPARATOR . 'core_tables.php';
-require_once 'modules' . DIRECTORY_SEPARATOR . 'folder' . DIRECTORY_SEPARATOR
-    . 'class' . DIRECTORY_SEPARATOR . 'class_admin_foldertypes.php';
-require_once 'modules/folder/folder_tables.php';
-require_once "core" . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR
-    . "class_history.php";
-
-
-abstract class folder_Abstract extends request
-{
-	/**
-	* System Identifier of the folder
-    * @access private
-    * @var integer
-    */
-	protected $system_id;
-	/**
-	* Identifier of the foldertype
-    * @access private
-    * @var integer
-    */
-	protected $foldertype_id;
-
-	/**
-	* Label of the foldertype
-    * @access private
-    * @var integer
-    */
-	protected $foldertype_label;
-
-	/**
-	* Identifier of the folder (Matricule)
-    * @access private
-    * @var integer
-    */
-	protected $folder_id;
-
-	/**
-	* Folder Name
-    * @access private
-    * @var integer
-    */
-	protected $folder_name;
-
-	/**
-	* System Identifier of the parent folder
-    * @access private
-    * @var integer
-    */
-	protected $parent_id;
-
-
-	/**
-	* Identifier of the folder creator
-    * @access private
-    * @var string
-    */
-	protected $typist;
-
-	/**
-	* Folder status
-    * @access private
-    * @var string
-    */
-	protected $status;
-
-	/**
-	* Level of the folder
-    * @access private
-    * @var integer
-    */
-	protected $level;
-
-
-	/**
-	* Time of the folder retention
-    * @access private
-    * @var string
-    */
-	//protected $retention_time;
-
-	/**
-	* Creation date of the folder
-    * @access private
-    * @var date
-    */
-	protected $creation_date;
-
-	/**
-	* identifier of the folder out card
-    * @access private
-    * @var integer
-    */
-	protected $folder_out_id;
-
-	/**
-	* folder is complete or not
-    * @access private
-    * @var boolean
-    */
-	protected $complete;
-
-	/**
-	* Collection identifier
-    * @access private
-    * @var string
-    */
-	protected $coll_id;
-	/**
-	* Collection identifier
-    * @access private
-    * @var string
-    */
-	protected $last_modified_date;
-
-	/**
-	* Last modification date
-    * @access private
-    * @var date
-    */
-	protected $desarchive;
-
-	/**
-	* Folder is in frozen state or not
-    * @access private
-    * @var string
-    */
-	protected $is_frozen;
-    
-    /**
-	* Dynamic index
-    * @access private
-    * @var array
-    */
-	protected $index;
-
-    protected $destination;
-    
-    protected $dest_user;
-
-	function __construct()
-	{
-		parent::__construct();
-		$this->index = array();
-	}
-
-	/**
-	* Build Maarch module tables into sessions vars with a xml
-	* configuration file
-	*/
-	public function build_modules_tables()
-	{
-		if (file_exists(
-			$_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-			. $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . "modules"
-			. DIRECTORY_SEPARATOR . "folder" . DIRECTORY_SEPARATOR . "xml"
-			. DIRECTORY_SEPARATOR . "config.xml"
-		)
-		) {
-			$path = $_SESSION['config']['corepath'] . 'custom'
-				. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
-				. DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR
-				. "folder" . DIRECTORY_SEPARATOR . "xml" . DIRECTORY_SEPARATOR
-				. "config.xml";
-		} else {
-			$path = "modules" . DIRECTORY_SEPARATOR . "folder"
-				. DIRECTORY_SEPARATOR . "xml" . DIRECTORY_SEPARATOR
-				. "config.xml";
-		}
-		$xmlconfig = simplexml_load_file($path);
-
-		$tableName = $xmlconfig->TABLENAME;
-		$_SESSION['tablename']['fold_folders'] = (string) $tableName->fold_folders;
-		$_SESSION['tablename']['fold_folders_out'] = (string) $tableName->fold_folders_out;
-		$_SESSION['tablename']['fold_foldertypes'] = (string) $tableName->fold_foldertypes;
-		$_SESSION['tablename']['fold_foldertypes_doctypes'] = (string) $tableName->fold_foldertypes_doctypes;
-		$_SESSION['tablename']['fold_foldertypes_indexes'] = (string) $tableName->fold_foldertypes_indexes;
-		$_SESSION['tablename']['fold_foldertypes_doctypes_level1'] = (string) $tableName->fold_foldertypes_doctypes_level1;
-
-        $view = $xmlconfig->VIEW;
-		$_SESSION['view']['view_folders'] = (string) $view->view_folders;
-        
-		$history = $xmlconfig->HISTORY;
-		$_SESSION['history']['folderdel'] = (string) $history->folderdel;
-		$_SESSION['history']['folderadd'] = (string) $history->folderadd;
-		$_SESSION['history']['folderup'] = (string) $history->folderup;
-		$_SESSION['history']['folderview'] = (string) $history->folderview;
-		$_SESSION['history']['foldertypeadd'] = (string) $history->foldertypeadd;
-		$_SESSION['history']['foldertypeup'] = (string) $history->foldertypeup;
-		$_SESSION['history']['foldertypedel'] = (string) $history->foldertypedel;
-	}
-
-
-	/**
-	* load folder object from the folder system id
-	*
-	* @param int $id folder system id
-	* @param string $table folder table
-	*/
-	function load_folder($id, $table)
-	{
-		$ft = new foldertype();
-		$db = new Database();
-		$stmt = $db->query("SELECT foldertype_id FROM ".$table." WHERE folders_system_id = ?", array($id));
-		$res = $stmt->fetchObject();
-		$this->foldertype_id = $res->foldertype_id;
-		$this->system_id = $id;
-		$tab_index = $ft->get_indexes($this->foldertype_id);
-
-		$fields = " folder_id, parent_id, folder_name, subject, description, "
-		    . "author, typist, status, folder_level, creation_date, destination, "
-		    . "dest_user, folder_out_id, is_complete, is_folder_out, last_modified_date, "
-		    . "folder_name, is_frozen";
-		foreach(array_keys($tab_index) as $key)
-		{
-			$fields .= ", ".$key;
-		}
-		$stmt = $db->query("SELECT ".$fields." FROM ".FOLD_FOLDERS_TABLE." WHERE folders_system_id = ?", array($id));
-		//$this->show();
-		$res = $stmt->fetchObject();
-
-		$this->folder_id = functions::show_string($res->folder_id);
-		$this->folder_name = $res->folder_name;
-		$this->parent_id = $res->parent_id;
-		$this->typist = functions::show_string($res->typist);
-		$this->status = $res->status;
-		$this->level = $res->folder_level;
-		$this->creation_date = functions::format_date_db($res->creation_date, true);
-		$this->folder_out_id = $res->folder_out_id;
-		$this->complete = $res->is_complete;
-		$this->desarchive = $res->is_folder_out;
-		$this->is_frozen = $res->is_frozen;
-		$this->destination = $res->destination;
-		$this->dest_user = $res->dest_user;
-		$this->last_modified_date = functions::format_date_db($res->last_modified_date, true);
-
-		foreach(array_keys($tab_index) as $key)
-		{
-			$tab_index[$key]['value'] = $res->{$key};
-			$tab_index[$key]['show_value'] = $res->{$key};
-			if($tab_index[$key]['type_field'] == 'select')
-			{
-				for($i=0;$i<count($tab_index[$key]['values']);$i++)
-				{
-					if($tab_index[$key]['values'][$i]['id'] == $tab_index[$key]['value'] )
-					{
-						$tab_index[$key]['show_value'] = $tab_index[$key]['values'][$i]['label'];
-						break;
-					}
-				}
-			}
-			elseif($tab_index[$key]['type'] == 'date')
-			{
-				$tab_index[$key]['show_value'] = $this->format_date_db($tab_index[$key]['value'], true);
-			}
-			elseif($tab_index[$key]['type'] == 'string')
-			{
-				$tab_index[$key]['show_value'] = functions::show_string($tab_index[$key]['value']);
-			}
-		}
-		$this->index = array();
-		$this->index = $tab_index;
-
-		$stmt = $db->query("SELECT foldertype_label, coll_id FROM ".$_SESSION['tablename']['fold_foldertypes']." WHERE foldertype_id = ?", array($this->foldertype_id));
-		$res = $stmt->fetchObject();
-		$this->foldertype_label = $res->foldertype_label;
-		$this->coll_id = functions::show_string($res->coll_id);
-
-	}
-
-	/**
-	* Creates a folder
-	*/
-	public function create_folder($iframe=false)
-	{
-		$db = new Database();
-		$this->checks_folder_data();
-		if (! empty($_SESSION['error'])) {
-			if($iframe == true){
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form_iframe&module=folder&display=false"
-					);
-				}else{
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form&module=folder"
-					);
-				}
-			exit();
-		} else if(preg_match('/\'|\"/',$_SESSION['m_admin']['folder']['folder_id'])) 
-{ 
-			$_SESSION['error'] = _CHAR_ERROR . "<br />";
-				if($iframe == true){
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form_iframe&module=folder&display=false"
-					);
-				}else{
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form&module=folder"
-					);
-				}
-				exit();
-		}else{
-			$stmt = $db->query(
-				"SELECT folder_id FROM " . FOLD_FOLDERS_TABLE
-			    . " WHERE folder_id= ? and status != 'DEL'",
-			    array($_SESSION['m_admin']['folder']['folder_id'])
-			);
-			if ($stmt->rowCount() > 0) {
-				$_SESSION['error'] = $_SESSION['m_admin']['folder']['folder_id']
-				    . " " . _ALREADY_EXISTS . "<br />";
-				if($iframe == true){
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form_iframe&module=folder&display=false"
-					);
-				}else{
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form&module=folder"
-					);
-				}
-				exit();
-			} else {
-				if ($_SESSION['m_admin']['folder']['folder_parent']) {
-					$stmt = $db->query(
-						"SELECT destination FROM " . FOLD_FOLDERS_TABLE . " WHERE folders_system_id = ? and status != 'DEL'",
-						array($_SESSION['m_admin']['folder']['folder_parent'])
-					);
-					$resQuery = $stmt->fetchObject();
-				}
-
-
-				$folderDest = null;
-				if (isset($resQuery)) {
-					$folderDest = $resQuery->destination;
-				} else if (isset($_REQUEST['folder_dest']) && $_REQUEST['folder_dest'] && isset($_SESSION['user']['primaryentity']['id'])) {
-					$folderDest = $_SESSION['user']['primaryentity']['id'];
-				}
-				$db->query(
-					"INSERT INTO " . FOLD_FOLDERS_TABLE
-					. " (folder_id, folder_name, foldertype_id, creation_date, "
-					. "typist, last_modified_date, parent_id,folder_level, destination) VALUES (?, ?, ?,  CURRENT_TIMESTAMP, ?, CURRENT_TIMESTAMP, ?, ?, ?)",
-					[	$_SESSION['m_admin']['folder']['folder_id'],
-						$_SESSION['m_admin']['folder']['folder_name'],
-						$_SESSION['m_admin']['folder']['foldertype_id'],
-						$_SESSION['user']['UserId'],
-						$_SESSION['m_admin']['folder']['folder_parent'],
-						$_SESSION['m_admin']['folder']['folder_level'],
-						$folderDest
-					]
-				);
-
-				$stmt = $db->query(
-					'SELECT folders_system_id FROM ' . FOLD_FOLDERS_TABLE
-				    . " WHERE folder_id = ?", array($_SESSION['m_admin']['folder']['folder_id'])
-				);
-				$res = $stmt->fetchObject();
-				$id = $res->folders_system_id;
-
-				$_SESSION['m_admin']['folder']['folders_system_id'] = $id;
-
-				$foldertype = new foldertype();
-
-				$query = $foldertype->get_sql_update(
-				    $_SESSION['m_admin']['folder']['foldertype_id'],
-				    $_SESSION['m_admin']['folder']['indexes']
-				);
-				if (! empty($query)) {
-					$query = preg_replace('/^,/', '', $query);
-					$query = "UPDATE  " .FOLD_FOLDERS_TABLE . " SET " . $query
-					    . " WHERE folders_system_id = ?";
-					$db->query($query, array($id));
-				}
-				if ($_SESSION['history']['folderadd'] == "true") {
-					$hist = new history();
-					$hist->add(
-					    FOLD_FOLDERS_TABLE, $id, "ADD",'folderadd',
-					    _FOLDER_ADDED . " : "
-					    . $_SESSION['m_admin']['folder']['folder_id'],
-					    $_SESSION['config']['databasetype'], 'folder'
-					);
-				}
-
-				$_SESSION['info'] = _FOLDER_ADDED;
-				//unset($_SESSION['m_admin']);
-				if($iframe == true){
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=create_folder_form_iframe&module=folder&display=false&show_iframe=false"
-					);
-				}else{
-					unset($_SESSION['m_admin']);
-					header(
-					"location: " . $_SESSION['config']['businessappurl']
-				    . "index.php?page=show_folder&module=folder&id=" . $id
-					);
-				}
-				exit();
-			}
-
-		}
-	}
-
-	/**
-	* Processes data during folder creation
-	*/
-	protected function checks_folder_data()
-	{
-		$foldertype = new foldertype();
-
-		if (isset($_REQUEST['folder_id']) && ! empty($_REQUEST['folder_id'])) {
-			$_SESSION['m_admin']['folder']['folder_id'] = $this->wash(
-			    $_REQUEST['folder_id'], "no", _FOLDER_ID
-			);
-		} else {
-			$_SESSION['m_admin']['folder']['folder_id'] = '';
-			$_SESSION['error'] .= _FOLDER_ID . ' ' . _IS_EMPTY . '<br/>';
-		}
-
-		if (isset($_REQUEST['folder_name'])
-		    && ! empty($_REQUEST['folder_name'])
-		) {
-			$_SESSION['m_admin']['folder']['folder_name'] = $this->wash(
-			    $_REQUEST['folder_name'], "no", _FOLDERNAME
-			);
-		} else {
-			$_SESSION['m_admin']['folder']['folder_name'] = '';
-			$_SESSION['error'] .= _FOLDERNAME . ' ' . _IS_EMPTY . '<br/>';
-		}
-
-		$_SESSION['m_admin']['folder']['folder_parent'] = 0;
-		$_SESSION['m_admin']['folder']['folder_level'] = 1;
-
-		if (isset($_REQUEST['folder_parent'])
-		    && ! empty($_REQUEST['folder_parent'])
-		) {
-			$_SESSION['m_admin']['folder']['folder_parent'] = $this->wash(
-			    $_REQUEST['folder_parent'], "num", _FOLDER_PARENT
-			);
-			$_SESSION['m_admin']['folder']['folder_level'] = 2;
-		}
-
-		if (isset($_REQUEST['foldertype']) && ! empty($_REQUEST['foldertype'])) {
-			$_SESSION['m_admin']['folder']['foldertype_id'] = $this->wash(
-			    $_REQUEST['foldertype'], "no", _FOLDERTYPE
-			);
-			$indexes = $foldertype->get_indexes(
-			    $_SESSION['m_admin']['folder']['foldertype_id']
-			);
-
-			$values = array();
-			foreach (array_keys($indexes) as $key) {
-				if (isset($_REQUEST[$key])) {
-					$values [$key] = $_REQUEST[$key];
-				} else {
-					$values [$key] = '';
-				}
-			}
-
-			$_SESSION['m_admin']['folder']['indexes'] = $values ;
-			$foldertype->check_indexes($_SESSION['m_admin']['folder']['foldertype_id'], $values );
-		}
-		else
-		{
-			$_SESSION['m_admin']['folder']['foldertype'] = '';
-			$_SESSION['error'] .= _FOLDERTYPE.' '._IS_EMPTY.'<br/>';
-		}
-	}
-
-
-	/**
-	* get all data from the current folder object
-	*/
-	public function get_folder_info()
-	{
-		$folder = array();
-		$folder['system_id'] = $this->system_id ;
-		$folder['foldertype_id'] = $this->foldertype_id ;
-		$folder['folder_name'] = $this->folder_name ;
-		$folder['foldertype_label'] = $this->foldertype_label ;
-		$folder['folder_id'] = $this->folder_id ;
-		$folder['parent_id'] = $this->parent_id ;
-		$folder['typist'] = $this->typist ;
-		$folder['status'] = $this->status;
-		$folder['level'] = $this->level ;
-		$folder['creation_date'] = $this->creation_date ;
-		$folder['folder_out_id'] = $this->folder_out_id ;
-		$folder['complete'] = $this->complete ;
-		$folder['desarchive'] = $this->desarchive ;
-		$folder['is_frozen'] = $this->is_frozen ;
-		$folder['coll_id'] = $this->coll_id ;
-		$folder['last_modified_date'] = $this->last_modified_date ;
-		$folder['destination'] = $this->destination;
-		$folder['index'] = array();
-		$folder['index'] = $this->index;
-
-		return $folder;
-	}
-
-	public function get_field($field_name, $in_index = false)
-	{
-		if($field_name == 'folders_system_id')
-		{
-			return $this->system_id;
-		}
-		elseif($field_name == 'foldertype_id')
-		{
-			return $this->foldertype_id;
-		}
-		elseif($field_name == 'folder_name')
-		{
-			return $this->folder_name;
-		}
-		elseif($field_name == 'folder_id')
-		{
-			return $this->folder_id;
-		}
-		elseif($field_name == 'parent_id')
-		{
-			return $this->parent_id;
-		}
-		elseif($field_name == 'subject')
-		{
-			return $this->subject;
-		}
-		elseif($field_name == 'typist')
-		{
-			return $this->typist;
-		}
-		elseif($field_name == 'status')
-		{
-			return $this->status;
-		}
-		elseif($field_name == 'level')
-		{
-			return $this->level;
-		}
-		elseif($field_name == 'creation_date')
-		{
-			return $this->creation_date;
-		}
-		elseif($field_name == 'folder_out_id')
-		{
-			return $this->folder_out_id;
-		}
-		elseif($field_name == 'complete')
-		{
-			return $this->complete;
-		}
-		elseif($field_name == 'desarchive')
-		{
-			return $this->desarchive;
-		}
-	    elseif($field_name == 'is_frozen')
-		{
-			return $this->is_frozen;
-		}
-		elseif($field_name == 'coll_id')
-		{
-			return $this->coll_id;
-		}
-		elseif($in_index)
-		{
-			for($i=0; $i < count($this->index);$i++)
-			{
-				if($field_name == $this->index[$i]['column'])
-				{
-					return $this->index[$i]['value'];
-				}
-			}
-			return '';
-		}
-		else
-		{
-			return '';
-		}
-	}
-
-	/**
-	* calculate the missing document types from a folder
-	*
-	* @param string $table_res resources table
-	* @param string $table_foldertypes_doc foldertypes doctypes table
-	* @param string $table_doctypes doctypes table
-	* @param string $id folder system id
-	* @param string $foldertype_id id of the foldertype
-	*/
-	public function missing_res($table_res,  $table_foldertypes_doc, $table_doctypes, $id, $foldertype_id)
-	{
-		$db = new Database();
-		$indexed_types = array();
-		$stmt = $db->query("SELECT distinct type_id as type FROM ".$table_res." WHERE status <> 'DEL' and folders_system_id = ?", array($id));
-		while($res = $stmt->fetchObject())
-		{
-			array_push($indexed_types, $res->type );
-		}
-
-		$waited_types = array();
-		$stmt = $db->query("SELECT doctype_id FROM ".$table_foldertypes_doc." WHERE foldertype_id = ?", array($foldertype_id));
-
-		while($res = $stmt->fetchObject())
-		{
-			array_push($waited_types, $res->doctype_id );
-		}
-		$temp = array();
-		$temp = array_diff($waited_types, $indexed_types);
-		$temp = array_values($temp);
-		$missing_res = array();
-		for($i=0; $i < count($temp); $i++)
-		{
-			$stmt = $db->query("SELECT type_id, description FROM ".$table_doctypes." WHERE type_id = ?", array($temp[$i]));
-			//$this->show();
-			$res = $stmt->fetchObject();
-			if($res->type_id <> "")
-			{
-				array_push($missing_res, array('ID' => $res->type_id, 'LABEL' => functions::show_string($res->description)));
-			}
-		}
-		return $missing_res ;
-	}
-
-
-	/* calculate the missing document types from a folder
-	*
-	* @param string $table_res resources table
-	* @param string $table_foldertypes_doc foldertypes doctypes table
-	* @param string $table_doctypes doctypes table
-	* @param string $id folder system id
-	* @param string $foldertype_id id of the foldertype
-	*/
-	public function missing_res2($table_res,  $table_foldertypes_doc, $table_doctypes, $id, $foldertype_id)
-	{
-		$db = new Database();
-		$indexed_types = array();
-		$stmt = $db->query("SELECT distinct type_id as type FROM ".$table_res." WHERE status <> 'DEL' and folders_system_id = ?", array($id));
-
-		while($res = $stmt->fetchObject())
-		{
-			array_push($indexed_types, $res->type );
-		}
-		$waited_types = array();
-		$stmt = $db->query("SELECT doctype_id FROM ".$table_foldertypes_doc." WHERE foldertype_id = ?", array($foldertype_id));
-		while($res = $stmt->fetchObject())
-		{
-			array_push($waited_types, $res->doctype_id );
-		}
-		$html_tab = "<table width=\"100%\" border=\"1\" align=\"center\"><tr><td>"._PIECE_TYPE."</td><td>"._MISSING."</td></tr>";
-		for($i=0; $i < count($waited_types); $i++)
-		{
-			$stmt = $db->query("SELECT type_id, description FROM ".$table_doctypes." WHERE type_id = ?", array($waited_types[$i]));
-			$res = $stmt->fetchObject();
-			if($res->type_id <> "")
-			{
-				$stmt = $db->query("SELECT type_id as type FROM ".$table_res." WHERE status <> 'DEL' and folders_system_id = ? and type_id = ?", array($id, $waited_types[$i]));
-				$res2 = $stmt->fetchObject();
-				if($waited_types[$i] <> $res2->type)
-				{
-					$html_tab .= "<tr><td><b>". functions::show_string($res->description)."</b></td><td>";
-					$html_tab .= "<b>X</b>";
-				}
-				else
-				{
-					$html_tab .= "<tr><td>".functions::show_string($res->description)."</td><td>";
-					$html_tab .= "&nbsp;";
-				}
-			}
-			$html_tab .= "</td></tr>";
-		}
-		$html_tab .= "</table>";
-		return $html_tab ;
-	}
-
-
-	/**
-	* calculate if a folder is complete or no
-	*
-	* @param string $table_res resources table
-	* @param string $table_foldertypes_doc foldertypes doctypes table
-	* @param string $table_doctypes doctypes table
-	* @param string $id folder system id
-	*/
-	public function is_complete($table_res, $table_foldertypes_doc, $table_doctypes, $id)
-	{
-		$tab = $this->missing_res($table_res, $table_foldertypes_doc, $table_doctypes, $id, $this->foldertype_id);
-
-		if(count($tab) > 0)
-		{
-			return false;
-		}
-		else
-		{
-			return true;
-		}
-	}
-
-	/**
-	* get all the history data of the current folder
-	*
-	* @param string $table_history history table
-	* @param string $table_folder folders table
-	*/
-	public function get_history()
-	{
-		$db = new Database();
-
-		$history = array();
-
-		$stmt = $db->query("SELECT h.event_date, h.info, h.user_id, u.lastname, u.firstname 
-							FROM ".$_SESSION['tablename']['history']." h, ".$_SESSION['tablename']['users']." u 
-							WHERE h.table_name = ? and h.record_id = ? and h.event_type <> 'UP_CONTRACT' and h.user_id = u.user_id order by h.event_date desc ",
-							array($_SESSION['tablename']['fold_folders'], $this->system_id));
-		//$this->show();
-		while($res = $stmt->fetchObject())
-		{
-			array_push($history, array( 'DATE' => $res->event_date, 'EVENT' => functions::show_string($res->info), 'USER' => functions::show_string($res->lastname.' '.$res->firstname) ));
-		}
-
-		return $history;
-	}
-
-
-	/**
-	* modify the folder in the users table
-	*
-	* @param string $id folder identifier
-	* @param string $user_id user identifier
-	* @param string $table users table
-	*/
-	public function modify_default_folder_in_db($id, $user_id, $table)
-	{
-		$db = new Database();
-		$db->query('UPDATE '.$table." SET custom_t1 = ? WHERE user_id = ?", array($id, $user_id));
-	}
-
-	public function update_folder($values, $id_to_update)
-	{
-		$data = array();
-		$foldertype = new foldertype();
-		$request = new request();
-		$func = new functions();
-		$foldertype_id =  $values['foldertype_id'];
-		$folderDest = null;
-		if (!empty($values['folder_dest']) && isset($_SESSION['user']['primaryentity']['id'])) {
-			$folderDest = $_SESSION['user']['primaryentity']['id'];
-		}
-		if(!empty($foldertype_id))
-		{
-			$indexes = $foldertype->get_indexes($foldertype_id,'minimal');
-			$val_indexes = array();
-			for($i=0; $i<count($indexes);$i++)
-			{
-				$val_indexes[$indexes[$i]] =  $values[$indexes[$i]];
-			}
-
-			$test_type = $foldertype->check_indexes($foldertype_id, $val_indexes );
-			if($test_type)
-			{
-				$data = $foldertype->fill_data_array($foldertype_id, $val_indexes, $data);
-			}
-		}
-		else
-		{
-			$_SESSION['error'] .= _FOLDERTYPE.' '._IS_EMPTY;
-		}
-
-		$func->wash($values['folder_name'], "no", _FOLDERNAME, "yes", "", "255", '', '');
-
-		if(empty($_SESSION['error']))
-		{
-			$where = " folders_system_id = ?";
-			$arrayPDO = array($id_to_update);
-			array_push($data, array('column' => 'folder_name', 		  'value' =>functions::protect_string_db($values['folder_name']),		   'type' =>"string"));
-			array_push($data, array('column' => 'last_modified_date', 'value' => $request->current_datetime(), 'type' => "date"));
-			if (isset($_SESSION['user']['primaryentity']['id']))
-				$data[] = ['column' => 'destination', 'value' => $folderDest, 'type' => 'string'];
-			
-			$request->PDOupdate($_SESSION['tablename']['fold_folders'], $data, $where, $arrayPDO, $_SESSION['config']['databasetype']);
-
-			//$_SESSION['error'] = _FOLDER_INDEX_UPDATED." (".$values['folder_id'].")";
-			$_SESSION['info'] = _FOLDER_UPDATED." (".$values['folder_id'].")";
-			if($_SESSION['history']['folderup'])
-			{
-				$hist = new history();
-				$hist->add(FOLD_FOLDERS_TABLE, $id_to_update, "UP", 'folderup', $_SESSION['error'], $_SESSION['config']['databasetype'],'folder');
-			}
-		} else {
-			$_SESSION['error_page'] = $_SESSION['error'];
-			$_SESSION['error']= ''; ?>
-			<script  type="text/javascript">
-			//window.opener.reload();
-			var error_div = $('main_error');
-			if(error_div)
-			{
-				error_div.innerHTML = '<?php echo addslashes($_SESSION['error_page']);?>';
-				$j('#main_error').show();
-				setTimeout(() => {
-					$j('#main_error').hide();
-				}, 5000);
-			}
-		</script>
-		<?php
-		}
-	}
-
-	public function closeFolder($folderId)
-	{
-	    if (empty($folderId)) {
-	         return false;
-	    }
-	    $db = new Database();
-	    $db->query(
-	    	"UPDATE " . FOLD_FOLDERS_TABLE . " SET status = 'END' "
-	        . "WHERE folders_system_id = ?", array($folderId)
-	    );
-	    if ($_SESSION['history']['folderup']) {
-			$hist = new history();
-			$msg = _FOLDER_CLOSED .' : ' . $folderId ;
-			$hist->add(
-			    FOLD_FOLDERS_TABLE, $folderId, "UP", 'folderup', $msg,
-			    $_SESSION['config']['databasetype'], 'folder'
-			);
-		}
-	}
-	public function freezeFolder($folderId, $params=array())
-	{
-	 	if (empty($folderId)) {
-	         return false;
-	    }
-	    $db = new Database();
-	    $db->query(
-	    	"UPDATE " . FOLD_FOLDERS_TABLE . " SET is_frozen = 'Y' "
-	        . "WHERE folders_system_id = ?", array($folderId)
-	    );
-	 	if ($_SESSION['history']['folderup']) {
-			$hist = new history();
-			$msg = _FROZEN_FOLDER .' : ' . $folderId ;
-			$hist->add(
-			    FOLD_FOLDERS_TABLE, $folderId, "UP", 'folderup', $msg,
-			    $_SESSION['config']['databasetype'], 'folder'
-			);
-		}
-	}
-
-
-	public function unfreezeFolder($folderId, $params=array())
-	{
-	 	if (empty($folderId)) {
-	         return false;
-	    }
-	    $db = new Database();
-	    $db->query(
-	    	"UPDATE " . FOLD_FOLDERS_TABLE . " SET is_frozen = 'N' "
-	        . "WHERE folders_system_id = ?", array($folderId)
-	    );
-	 	if ($_SESSION['history']['folderup']) {
-			$hist = new history();
-			$msg = _UNFROZEN_FOLDER .' : ' . $folderId ;
-			$hist->add(
-			    FOLD_FOLDERS_TABLE, $folderId, "UP", 'folderup', $msg,
-			    $_SESSION['config']['databasetype'], 'folder'
-			);
-		}
-	}
-
-	public function delete_folder($folder_sys_id, $foldertype)
-	{
-		$db = new Database();
-		$stmt = $db->query("SELECT coll_id FROM ".$_SESSION['tablename']['fold_foldertypes']." WHERE foldertype_id = ?", array($foldertype));
-		$res = $stmt->fetchObject();
-		$coll_id = $res->coll_id;
-		require_once('core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_security.php');
-		$sec = new security();
-		$table = $sec->retrieve_table_from_coll($coll_id);
-
-		if(!empty($table) && !empty($folder_sys_id))
-		{
-			$stmt = $db->query("SELECT folder_level, folder_id FROM ".$_SESSION['tablename']['fold_folders']." WHERE folders_system_id = ?", array($folder_sys_id));
-			$res = $stmt->fetchObject();
-			$level = $res->folder_level;
-			$fold_id = $res->folder_id;
-			$where = '';
-
-			$arrayPDO = array($folder_sys_id);
-			if($level == 1)
-			{
-				$stmt = $db->query("SELECT folders_system_id FROM ".$_SESSION['tablename']['fold_folders']." WHERE parent_id = ? and folder_level = 2", array($folder_sys_id));
-				if($stmt->rowCount() > 0)
-				{
-					while($res = $stmt->fetchObject())
-					{
-						$where .= " or folders_system_id = ?";
-						$arrayPDO = array_merge($arrayPDO, array($res->folders_system_id));
-					}
-				}
-			}
-			$db->query("UPDATE ".$table." SET status = 'DEL' WHERE folders_system_id = ? ".$where, $arrayPDO);
-			$db->query("UPDATE ".$_SESSION['tablename']['fold_folders']." SET status = 'DEL' WHERE folders_system_id = ? ".$where, $arrayPDO);
-			$_SESSION['info'] = _FOLDER_DELETED." (".$fold_id.")";
-		}
-	}
-
-	public function is_folder_exists($folder_system_id)
-	{
-		if($folder_system_id <> "")
-		{
-			$db = new Database();
-			$stmt = $db->query("SELECT folder_id FROM ".$_SESSION['tablename']['fold_folders']." WHERE folders_system_id = ?", array($folder_system_id));
-			$res = $stmt->fetchObject();
-			if($res->folder_id <> "")
-			{
-				$find = true;
-			}
-			else
-			{
-				$find = false;
-			}
-		}
-		else
-		{
-			$find = false;
-		}
-		return $find;
-	}
-
-	/**
-	* calculate if a folder is empty
-	*
-	* @param string $table_res resources table
-	* @param string $id folder system id
-	*/
-	public function is_folder_empty($table_res, $id)
-	{
-		$db = new Database();
-		$indexed_types = array();
-		$stmt = $db->query("SELECT * FROM ".$table_res." WHERE status <> 'DEL' and folders_system_id = ?", array($id));
-		if($stmt->rowCount() > 0)
-		{
-			$empty = false;
-		}
-		else
-		{
-			$empty = true;
-		}
-		return $empty;
-	}
-    
-    public function get_foldertypes_doctype($type_id)
-	{
-		$foldertypes = array();
-        if($type_id <> "") {
-            $db = new Database();
-            $stmt = $db->query("SELECT foldertype_id FROM ".$_SESSION['tablename']['fold_foldertypes_doctypes']." WHERE doctype_id = ?", array($type_id));
-            //$this->show();
-            while($res = $stmt->fetchObject())
-            {
-                array_push($foldertypes, $res->foldertype_id );
-            }
-        }
-        return $foldertypes ;
-    }
-
-
-    public function get_folders_tree($parent_id)
-	{
-		$folders = array();
-		$db = new Database();
-		$stmt = $db->query('SELECT folders_system_id, folder_name, parent_id, folder_level FROM folders WHERE foldertype_id not in (100) AND status NOT IN (\'DEL\') AND parent_id = \''.$parent_id.'\' AND (destination IS NULL OR destination = ?) order by folder_id asc', array($_SESSION['user']['primaryentity']['id']));
-		while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
-			$stmt3 = $db->query(
-				"SELECT count(folders_system_id) as total FROM folders WHERE foldertype_id not in (100) AND parent_id IN (".$row['folders_system_id'].")  AND status NOT IN ('DEL')"
-			);
-			$row3 = $stmt3->fetch(PDO::FETCH_ASSOC);
-			$nbsp ='';
-			for ($i=1; $i < $row['folder_level'] ; $i++) { 
-				$nbsp .= '&emsp;&emsp; ';
-			}
-			$row['folder_name'] = $nbsp.$row['folder_name'];
-
-			$folders[] = array(
-				'parent_id' => $row['parent_id'],
-				'folders_system_id' => $row['folders_system_id'],
-				'folder_name' => $row['folder_name'],
-				'folder_level' => $row['folder_level'],
-				'nb_subfolder' => $row3['total']
-			);
-			$folders = array_merge($folders,$this->get_folders_tree($row['folders_system_id']));
-		}
-        return $folders ;
-    }
-}
diff --git a/modules/folder/class/cmis/cmis_folder_controller.php b/modules/folder/class/cmis/cmis_folder_controller.php
deleted file mode 100755
index c5adae9d329..00000000000
--- a/modules/folder/class/cmis/cmis_folder_controller.php
+++ /dev/null
@@ -1,616 +0,0 @@
-<?php
-
-require_once 'apps/maarch_entreprise/class/cmis/cmis_res_controller.php';
-require_once 'apps/maarch_entreprise/class/cmis/xmlParser.class.php';
-require_once 'apps/maarch_entreprise/class/cmis/cmis_class_object.php';
-require_once 'apps/maarch_entreprise/class/cmis/cmis_class_property.php';
-
-
-class folderCMIS extends objectCMIS
-{
-
-    //properties
-    protected $name ;
-    protected $parentId;
-    protected $path;
-    protected $allowedChildObjectTypeIds ;
-    private   $typist;
-    private   $folderId;
-
-    //
-    protected $propertiesInXml;
-
-    public function __construct() {
-
-        $this->Id = "cmis:folder";
-        $this->queryName = "cmis:folder";
-        $this->baseId = "cmis:folder";
-        $this->fileable = true;
-        $this->queryable = true;
-        $this->localName = "cmis:folder";
-        $this->displayName = "cmis:folder";
-        $this->creatable = true;
-        $this->fulltextIndexed = 'none';
-
-
-
-        //properties
-        $this->parentId = new PropertyId(false, false, 'Id', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);;
-
-        $this->name = new PropertyString($required, $inherited, $propertyType,
-            $cardinality, $updatability, $choices, $openChoice, $queryable,
-            $orderable);
-        $this->name->setRequired(true);
-        $this->name->setInherited(false);
-        $this->name->setPropertyType('String');
-        $this->name->setCardinality('Single');
-        $this->name->setId('name');
-        $this->name->setOpenChoice(true);
-
-        $this->objectId = new PropertyId(false, false, 'Id', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->objectId->setId('objectId');
-
-        $this->baseTypeId = new PropertyId(false, false, 'Id', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->baseTypeId->setId('baseTypeId');
-
-        $this->objectTypeId = new PropertyId(true, false, 'Id', 'Single',
-                 'oncreate', 'NotApplicable', 'NotApplicable', false, false);
-        $this->objectTypeId->setId('objectTypeId');
-        $this->objectTypeId->setValue('cmis:folder');
-
-        $this->createdBy = new PropertyString(false, false, 'String', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->createdBy->setId('createdBy');
-
-        $this->creationDate = new PropertyDateTime(false, false, 'DateTime', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->creationDate->setId('creationDate');
-
-        $this->lastModifiedBy = new PropertyString(false, false, 'String', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->lastModifiedBy->setId('lastModifiedBy');
-
-        $this->lastModificationDate = new PropertyDateTime(false, false, 'DateTime', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->lastModificationDate->setId('lastModificationDate');
-
-        $this->changeToken = new PropertyString(false, false, 'String', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->changeToken->setId('changeToken');
-
-        $this->parentId = new PropertyId(false, false, 'Id', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->parentId->setId('parentId');
-
-        $this->folderId = new PropertyId(true, false, 'Id', 'Single',
-                'ReadOnly', 'NotApplicable', 'NotApplicable', true, true);
-        $this->folderId->setId('folderId');
-
-
-        $this->path = new PropertyString(false, false, 'String', 'Single',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->path->setId('path');
-
-        $this->allowedChildObjectTypeIds = new PropertyId(false, false, 'Id', 'Multi',
-                 'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->allowedChildObjectTypeIds->setId('allowedChildObjectTypeIds');
-
-        $this->typist = new PropertyString(false, false, 'String', 'Single',
-                'ReadOnly', 'NotApplicable', 'NotApplicable', false, false);
-        $this->typist->setId('typist');
-
-        $this->properties = array(
-                $this->name, $this->objectId, $this->baseTypeId, $this->objectTypeId, $this->createdBy, $this->creationDate,
-                $this->lastModifiedBy, $this->lastModificationDate, $this->changeToken, $this->parentId, $this->folderId,
-                $this->path, $this->allowedChildObjectTypeIds, $this->typist
-        );
-
-        $this->propertiesInXml = array( $this->folderId, $this->typist, $this->creationDate);
-    }
-
-
-    public function setNameValue($name){
-        $this->name->setValue($name);
-    }
-
-    public function setFolderIdValue($id){
-        $this->folderId->setValue($id);
-        $this->objectId->setValue($id);
-    }
-
-    public function setCreationDateValue($creationDate){
-        $this->creationDate->setValue($creationDate);
-    }
-
-    public function setLastModificationDateValue($modificationDate){
-        $this->lastModificationDate->setValue($modificationDate);
-    }
-
-    public function setTypistValue($typist){
-        $this->typist->setValue($typist);
-    }
-
-    public function getNameValue(){
-        return $this->name->getValue();
-    }
-
-    public function getFolderIdValue(){
-        return $this->folderId->getValue();
-    }
-
-    public function setName($name){
-        $this->name  =  $name;
-    }
-
-    public function setObjectId($objectId){
-        $this->objectId  = $objectId ;
-    }
-
-    public function setBaseTypeId($baseTypeId){
-        $this->baseTypeId  =  $baseTypeId;
-    }
-
-    public function setObjectTypeId($objectTypeId){
-        $this->objectTypeId  =  $objectTypeId;
-    }
-
-    public function setCreatedBy($createdBy){
-        $this->createdBy  =  $createdBy;
-    }
-
-    public function setCreationDate($creationDate){
-        $this->creationDate  =  $creationDate;
-    }
-
-    public function setLastModifiedBy($lastModifiedBy){
-        $this->lastModifiedBy  =  $lastModifiedBy;
-    }
-
-    public function setLastModificationDate($lastModificationDate){
-        $this->lastModificationDate  =  $lastModificationDate;
-    }
-
-    public function setChangeToken($changeToken){
-        $this->changeToken  =  $changeToken;
-    }
-
-    public function setParentId($parentId){
-        $this->parentId  =  $parentId;
-    }
-
-    public function setPath($path){
-        $this->path  =  $path;
-    }
-
-    public function setAllowedChildObjecTypeIds( $allowedChildObjecTypeIds ){
-        $this->allowedChildObjectTypeIds  =  $allowedChildObjecTypeIds;
-    }
-
-
-    public function getProperties(){
-        return $this->properties;
-    }
-
-
-
-
-    public function entryMethod ($atomFileContent, $requestedResourceId)
-    {
-
-        if(isset($atomFileContentf) && !isset($requestedResourceId)){
-            $str = 'AtomFileContent create folder ';
-
-            //new parser atom xml file
-            $xmlParser = new xmlParser();
-
-            echo $atomFileContent;
-
-            //build a new folder from atom xml file (the folder is a cmis folder)
-            $newCmisFolder = $xmlParser->getCmisFolderFromXml($atomFileContent);
-
-
-            if( $this->creatable){
-                if($newCmisFolder->folderId->valueIsSet() && $newCmisFolder->name->valueIsSet() ){
-                    $this->saveFolder($newCmisFolder);
-                }
-                else{
-                    //TODO throw constraintException
-                    echo "<br />ERREUR : constraintException.<br />";
-                }
-            }
-            else{
-                //TODO throw constraintException
-                echo "<br />ERREUR : constraintException.<br />";
-            }
-
-        }
-        elseif(!isset($atomFileContent) && isset($requestedResourceId)){
-            //get the folder whose Id is $requestedResourceId (whith its documents)
-            if($folder = $this->getFolderByFolderId($requestedResourceId)){
-
-                $documents = $folder->getDocumentsInFolder($requestedResourceId);
-                $title = trim('Documents in folder '.$requestedResourceId);
-                $folderXml = resCMIS::getFeed($documents, $title, $folder);
-
-                echo $folderXml->saveXML();
-            }
-            else{
-            //TODO throw objectNotFound
-                echo "<br />ERREUR : objectNotFound.<br />";
-            }
-        }
-        else{
-            //TODO throw notSupported or invalidArgument
-                echo "<br />ERREUR : notSupported or invalidArgument.<br />";
-        }
-
-        //return $requestedResourceId . ' ' . $atomFileContent;
-    }
-
-
-    private function getFolderByFolderId($requestedResourceId){
-        require_once('core/class/class_db_pdo.php');
-        $db = new Database();
-
-        $requestedResourceId = pg_escape_string($requestedResourceId);
-        $statement = "select * from folders where folder_id = '".$requestedResourceId."'";
-
-        $result = $db->query($statement);
-
-        if($result === false){
-            //TODO throw objectNotFound or invalidArgument or runtime
-            echo "<br />ERREUR : requête non exécutée runtime.<br />";
-            return null;
-        }
-
-        $folder = new folderCMIS();
-        //$folder->FolderCmis();
-
-        //premier tuple retourne
-        if ($recordset = $result->fetchObject()) {
-            $folder->setFolderIdValue($recordset->folder_id);
-            $folder->setNameValue($recordset->folder_name);
-            $folder->setCreationDateValue($recordset->creation_date);
-            $folder->setLastModificationDateValue($recordset->last_modified_date);
-            $folder->setTypistValue($recordset->typist);
-        }
-        else{
-            //TODO throw objectNotFound
-            echo "<br />ERREUR : fichier inexistant objectNotFound.<br />";
-            return null;
-        }
-
-        return $folder;
-    }
-
-    private function getDocumentsInFolder($requestedResourceId){
-        require_once('core/class/class_db_pdo.php');
-        $db = new Database();
-
-        $requestedResourceId = pg_escape_string($requestedResourceId);
-
-        //$resArray = null
-        $statement = "select * from res_view_letterbox where folder_id = '".$requestedResourceId."'";
-
-        $result = $db->query($statement);
-
-        //TODO gerer les cas d erreurs
-        if($result === false){
-            //TODO throw objectNotFound or invalidArgument or runtime
-            echo "<br />ERREUR : requete non réalisée runtime.<br />";
-        }
-
-        $resArray = array();
-        while ($recordset = $result->fetchObject()) {
-            //var_dump($recordset);
-            $documentCmis = new resCMIS();
-            $documentCmis->DocumentCmis();
-            $documentCmis->setRes(
-                    array('res_id' => $recordset->res_id,
-                            'type_label'=> $recordset->type_label,
-                            'contact_society' => $recordset->contact_society ,
-                            'contact_firstname' => $recordset->contact_firstname ,
-                            'contact_lastname' => $recordset->contact_lastname ,
-                            'entity_label' => $recordset->entity_label ,
-                            'dest_user' => $recordset->dest_user ,
-                            'doc_date' => $recordset->doc_date ,
-                            'process_limit_date' => $recordset->process_limit_date,
-                            'author' => $recordset->author
-                        ));
-            array_push($resArray, $documentCmis);
-         }
-
-         return $resArray;
-    }
-
-    private function saveFolder($newCmisFolder){
-        $foldertype_id = 5;
-        require_once('core/class/class_db_pdo.php');
-        $db = new Database();
-        
-        $creation_date = $db->current_datetime();
-
-        //TODO gerer les cas d erreurs
-
-        if(!$newCmisFolder->isWellFormed()){
-            //TODO throw constraintException
-            echo "<br />ERREUR : création du fichier non réalisée : toutes les propriétés requises n'ont pas été renseignées.<br />";
-            return;
-        }
-
-
-        //insert into folders ( folder_id , foldertype_id , folder_name , creation_date ) values ( 'folderid' , 5 , 'foldername' , current_date)
-        $statement = "insert into folders ( folder_id , foldertype_id , folder_name , creation_date ) values ( '"
-                .pg_escape_string($newCmisFolder->getFolderIdValue())."' , '"
-                .pg_escape_string($foldertype_id)."' , '"
-                .pg_escape_string($newCmisFolder->getNameValue())."' , "
-                .pg_escape_string($creation_date)." ) ";
-
-        $result = $db->query($statement);
-
-        //TODO gerer les cas d erreurs
-        if($result === false){
-            //TODO throw storageException
-            echo "<br />ERREUR : création du fichier non réalisée storageException.<br />";
-        }
-
-    }
-
-
-    private function isWellFormed(){
-        $folderOk = true;
-        $i=0;
-        $properties = $this->getProperties();
-        while($folderOk && $property=$properties[$i++]){
-            //echo '<br />'.$property->getLocalName()." = ".$property->getValue().'<br />';
-            $folderOk = !$property->isRequired() || $property->valueIsSet();
-        }
-
-        return $folderOk;
-    }
-
-
-    public function toAtomXml(){
-        //creer un document atom xml
-        $doc = new DOMDocument('1.0', 'utf-8');
-        $doc->xmlStandalone = true;
-        $doc->formatOutput = true;
-
-        /**/
-        $this->getAtomXmlEntry($doc);
-
-        return $doc;
-    }
-
-    public function getAtomXmlEntry(&$doc, &$feed){
-
-        if(isset($feed)){
-            $root = $doc->createElement('atom:entry');
-            $feed->appendChild($root);
-        }
-        else{
-            //atom:entry
-            $root = $doc->createElementNS('http://www.w3.org/2005/Atom', 'atom:entry');
-            $root->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:cmisra', 'http://docs.oasis-open.org/ns/cmis/restatom/200908/');
-            $root->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:cmis', 'http://docs.oasis-open.org/ns/cmis/core/200908/');
-            $root->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:maarch', 'http://www.maarch.org');
-            $doc->appendChild($root);
-        }
-
-        //atom:author
-        //MUST be the CMIS property cmis:createdBy
-        $eAuthor = $doc->createElement('atom:author');
-        $root->appendChild($eAuthor);
-        //$uri = 'uri';
-        $name = $_SESSION['user']['FirstName'].' '.$_SESSION['user']['LastName'];
-        //$email = 'email';
-        //$eUri = $doc->createElement('atom:uri', $uri);
-        $eName = $doc->createElement('atom:name', $name);
-        //$eEmail = $doc->createElement('atom:email', $email);
-        $eAuthor->appendChild($eName);
-        //$eAuthor->appendChild($eUri);
-        //$eAuthor->appendChild($eEmail);
-
-
-        //atom:content
-        $attSrcContent = 'src';
-        $eContent = $doc->createElement('atom:content');
-        $root->appendChild($eContent);
-        //$eContent->setAttribute('src', $attSrcContent);
-
-        //atom:Id
-        //SHOULD be derived from cmis:objectId.
-        //This Id MUST be compliant with atom's specification and be a valId URI
-        if($this->objectId->valueIsSet()){
-            $Id = $this->objectId->getValue();
-            $eId = $doc->createElement('atom:Id', $Id);
-            $root->appendChild($eId);
-        }
-
-
-        //atom:title
-        //MUST be the CMIS property cmis:name
-        if($this->name->valueIsSet()){
-            $title = $this->name->getValue();
-            $attTypeTitle = 'text';
-            $eTitle = $doc->createElement('atom:title', $title);
-            $root->appendChild($eTitle);
-            $eTitle->setAttribute('type', $attTypeTitle);
-        }
-
-
-        //atom:updated
-        //SHOULD be the latest time the folder or its contents was updated
-        //If unknown by the underlying repository, it MUST be the current time
-        if($this->lastModificationDate->valueIsSet()){
-            $updated = $this->lastModificationDate->getValue();
-            $eUpdated = $doc->createElement('atom:updated', $updated);
-            $root->appendChild($eUpdated);
-        }
-
-
-        //atom:published
-        if($this->creationDate->valueIsSet()){
-            $published = $this->creationDate->getValue();
-            $ePublished = $doc->createElement('atom:published', $published);
-            $root->appendChild($ePublished);
-        }
-
-        //atom:summary
-        //$summary = 'summary';
-        //$attTypeSummary = 'text';
-        //$eSummary = $doc->createElement('atom:summary', $summary);
-        //$root->appendChild($eSummary);
-        //$eSummary->setAttribute('type', $attTypeSummary);
-
-
-        //atom:link rel="self"
-        //points to the URI to retrieve this atom entry
-        /*
-        $attHrefLinkSelf = 'href link self';
-        $eLinkSelf = $doc->createElement('atom:link');
-        $root->appendChild($eSummary);
-        $eLinkSelf->setAttribute('rel', 'self');
-        $eLinkSelf->setAttribute('href', $attHrefLinkSelf);
-        */
-
-
-        //atom:link rel="edit"
-        //points to the URI to update this atom entry via POST
-        /*$attHrefLinkEdit = 'href link edit';
-        $eLinkEdit = $doc->createElement('atom:link');
-        $root->appendChild($eSummary);
-        $eLinkEdit->setAttribute('rel', 'edit');
-        $eLinkEdit->setAttribute('href', $attHrefLinkEdit);*/
-
-
-        //atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions"
-        //points to the allowable actions document for this object
-
-
-        //atom:link rel="describedby"
-        //points to the type definition as an atom entry for the type of this folder entry
-        /*$attHrefLinkDesc = 'href link described by';
-        $eLinkDesc = $doc->createElement('atom:link');
-        $root->appendChild($eLinkDesc);
-        $eLinkDesc->setAttribute('rel', 'describedby');
-        $eLinkDesc->setAttribute('type', 'application/atom+xml;type=entry');
-        $eLinkDesc->setAttribute('href', $attHrefLinkDesc);
-         */
-
-
-        //atom:link rel="service"
-        //points to service document containing the CMIS repository.
-        //The service document MUST contain only one workspace element
-        //Media Type: application/atomsvc+xml
-        /*$attHrefLinkService = 'href link service';
-        $eLinkService = $doc->createElement('atom:link');
-        $root->appendChild($eLinkService);
-        $eLinkService->setAttribute('rel', 'service');
-        $eLinkService->setAttribute('type', 'application/atomsvc+xml');
-        $eLinkService->setAttribute('href', $attHrefLinkService);*/
-
-
-        //atom:link rel="alternate"
-        //this is used to identify the renditions available for the specified object
-        /*$attHrefAlternate = 'href link alternate';
-        $eLinkAlternate = $doc->createElement('atom:link');
-        $root->appendChild($eLinkAlternate);
-        $eLinkAlternate->setAttribute('rel', 'alternate');
-        $eLinkAlternate->setAttribute('href', $attHrefAlternate);*/
-
-
-
-        //atom:link type="application/atom+xml;type=feed" rel="up"
-        //points to the atom entry for the parent
-        //if the root folder, this link will not be present
-        /*$attHrefLinkUp = 'href link up';
-        $eLinkUp = $doc->createElement('atom:link');
-        $root->appendChild($eLinkUp);
-        $eLinkUp->setAttribute('rel', 'up');
-        $eLinkUp->setAttribute('type', 'application/atom+xml;type=feed');
-        $eLinkUp->setAttribute('href', $attHrefLinkUp);*/
-
-
-        //atom:link type="application/atom+xml;type=feed" rel="down"
-        //atom:link type="application/cmistree+xml" rel="down" href="http://.../tree"
-        //points to the children of this folder
-        //application/atom+xml : Points to the atom feed document representing the children feed for this same folder
-        //application/cmistree+xml: Points to the descendants feed of the same folder
-
-
-        //atom:link type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://.../foldertree"
-        //points to the folder tree for this folder
-
-
-        //atom:link type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200908/relationships" href="http://.../relationships"
-        //points to the relationships feed for this object
-        /*$attRel = 'rel link relationships';
-        $eLinkRel = $doc->createElement('atom:link');
-        $root->appendChild($eLinkRel);
-        $eLinkRel->setAttribute('rel', $attRel);
-        $eLinkRel->setAttribute('type', 'application/atom+xml;type=feed');*/
-
-
-        //atom:link type="application/atom+xml;type=feed" rel="http://docs.oasis-open.org/ns/cmis/link/200908/policies" href="http://.../policies"
-        //points to the policy feed for this object
-        /*$attPol = 'rel link policies';
-        $eLinkPol = $doc->createElement('atom:link');
-        $root->appendChild($eLinkPol);
-        $eLinkPol->setAttribute('rel', $attPol);
-        $eLinkPol->setAttribute('type', 'application/atom+xml;type=feed');*/
-
-
-        //atom:link type="application/cmisacl+xml" rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://.../acl"
-        //points to ACL document for this object
-        /*$attAcl = 'rel link acl';
-        $eLinkAcl = $doc->createElement('atom:link');
-        $root->appendChild($eLinkAcl);
-        $eLinkAcl->setAttribute('rel', $attAcl);
-        $eLinkAcl->setAttribute('type', 'application/atom+xml;type=feed');*/
-
-
-        //cmisra:object
-        $eObject = $doc->createElement('cmisra:object');
-        $root->appendChild($eObject);
-
-        //  cmis:properties
-        $eProperties = $doc->createElement('cmis:properties');
-        $eObject->appendChild($eProperties);
-
-        //    cmis:property
-        //      cmis:value
-        //getFolderPropertiesXml($eProperties);
-        foreach($this->propertiesInXml as $property){
-            $propertyValue = $property->getValue();
-            if($property->valueIsSet()){
-                $eProperty = $doc->createElement('cmis:property');
-                $eProperties->appendChild($eProperty);
-                $eProperty->setAttribute('localName', $property->getLocalName());
-                $eProperty->setAttribute('propertyDefinitionId', $property->getId());
-
-                if(strcmp($property->getCardinality(), 'Single')==0 ){
-                    $eValue = $doc->createElement('cmis:value', $propertyValue);
-                    $eProperty->appendChild($eValue);
-                }
-                else{
-                    //au moins une valeur non nulle
-                    foreach($propertyValue as $value){
-                        if($value != null && strcmp($value,'notset')!=0){
-                            $eValue = $doc->createElement('cmis:value', $value);
-                            $eProperty->appendChild($eValue);
-                        }
-                    }
-                }
-            }
-        }
-
-    }
-
-
-
-}
-
diff --git a/modules/folder/class/ws.php b/modules/folder/class/ws.php
deleted file mode 100755
index b8e21fed473..00000000000
--- a/modules/folder/class/ws.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php 
-global $SOAP_dispatch_map;
-global $XMLRPC_dispatch_map;
-global $SOAP_typedef;
-global $REST_dispatch_map;
-
-$XMLRPC_dispatch_map['getFolder'] = Array(
-    'function' => 'getFolder',
-    'signature' => array(array('string','string')),
-    'docstring' => '',
-    'method' => "modules/folder#folder::get"
-);
-
-$SOAP_dispatch_map['getFolder'] = Array(
-    'in'  => Array('in' => 'string'),
-    'out' => Array('out' => 'string'),
-    'method' => "modules/folder#folder::get"
-);
-
-$REST_dispatch_map['folder'] = Array(
-    'pathToController' => "modules/folder/class/cmis/cmis_folder_controller.php"
-);
diff --git a/modules/folder/close_folder.php b/modules/folder/close_folder.php
deleted file mode 100755
index 69cca411cfd..00000000000
--- a/modules/folder/close_folder.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-
-if (isset($_SESSION['folder'])
-    && ($_SESSION['folder']['status'] == 'NEW')
-) {
-    ?>
-    <input type="submit" name="closeFolder" id="closeFolder" class="button" value="<?php
-    echo _CLOSE_FOLDER;
-    ?>"  onclick="return(confirm('<?php
-        echo _REALLY_CLOSE_THIS_FOLDER . '?\n\r\n\r';
-        ?>'));" />
-    <?php
-}
\ No newline at end of file
diff --git a/modules/folder/create_folder_form.php b/modules/folder/create_folder_form.php
deleted file mode 100755
index b3e095e0bfc..00000000000
--- a/modules/folder/create_folder_form.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*
-*    Copyright 2008,2009 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 : create_folder_form.php
-*
-* Form to create a folder
-*
-* @package  Folder
-* @version 1.0
-* @since 06/2007
-* @license GPL
-* @author  <dev@maarch.org>
-*/
-
-$core = new core_tools();
-$core->load_lang();
-$core->test_service('create_folder', 'folder');
-
- /****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true") {
-    $init = true;
-}
-$level = "";
-if (isset($_REQUEST['level']) && ( $_REQUEST['level'] == 2
-    || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4
-    || $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$pagePath = $_SESSION['config']['businessappurl'].'index.php?page=create_folder_form&module=folder';
-$pageLabel = _CREATE_FOLDER;
-$pageId = "fold_create_folder_form";
-$core->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level);
-/***********************************************************/
-$core->load_html();
-
-$db = new Database();
-
-$stmt = $db->query("SELECT foldertype_id, foldertype_label FROM " .
-    $_SESSION['tablename']['fold_foldertypes'] . " order by foldertype_label");
-
-$foldertypes = array();
-while ($res = $stmt->fetchObject()) {
-    array_push(
-        $foldertypes,
-        array(
-        	'id' => $res->foldertype_id,
-        	'label' => $res->foldertype_label,
-        )
-    );
-}
-$init = false;
-?>
-
-<h1><i class="fa fa-folder-open fa-2x" title="" ></i> <?php echo _CREATE_FOLDER;?></h1>
-<div id="inner_content">
-    <div class="block">
-        <form name="create_folder" id="create_folder" method="post" class="forms"
-              action="<?php echo $_SESSION['config']['businessappurl'];?>index.php?display=true&module=folder&page=manage_create_folder" >
-            <input type="hidden" name="display"  value="true" />
-            <input type="hidden" name="module"  value="folder" />
-            <input type="hidden" name="page"  value="manage_create_folder" />
-            <p>
-                <label for="foldertype"><?php echo _FOLDERTYPE;?> :</label>
-                <select name="foldertype" id="foldertype"
-                        onchange="get_folder_index('<?php echo $_SESSION['config']['businessappurl'] . 'index.php?display=true' . '&module=folder&page=create_folder_get_folder_index'; ?>'
-                            , this.options[this.options.selectedIndex].value, 'folder_indexes');">
-                    <option value=""><?php echo _CHOOSE_FOLDERTYPE;?></option>
-                    <?php
-                    for ($i = 0; $i < count($foldertypes); $i ++) { ?>
-                        <option value="<?php functions::xecho($foldertypes[$i]['id']); ?>"
-                            <?php
-                            if (isset($_SESSION['m_admin']['folder']['foldertype_id'])
-                            && $_SESSION['m_admin']['folder']['foldertype_id'] == $foldertypes[$i]['id']) {
-                                echo 'selected="selected"';
-                            } else if($i == 0) {
-                                $init = true;
-                                echo 'selected="selected"';
-                            }
-                            ?>
-                        >
-                            <?php functions::xecho($foldertypes[$i]['label']); ?>
-                        </option>
-                    <?php } ?>
-                </select> <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <p>
-                <label for="folder_id"><?php echo _FOLDERID_LONG;?></label>
-                <input name="folder_id" id="folder_id"
-                       value="<?php if (isset($_SESSION['m_admin']['folder']['folder_id'])) { functions::xecho($_SESSION['m_admin']['folder']['folder_id']);}?>" />
-                <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <p>
-                <label for="folder_name"><?php echo _FOLDERNAME;?></label>
-                <input name="folder_name" id="folder_name"
-                       value="<?php if (isset($_SESSION['m_admin']['folder']['folder_name'])) { functions::xecho($_SESSION['m_admin']['folder']['folder_name']);} ?>" />
-                <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <div id="folder_indexes"></div>
-            <div id="folder_dest_div">
-                <p>
-                    <label for="folder_dest"><?php echo _FOLDER_DESTINATION_QUESTION;?></label>
-                    <input name="folder_dest" id="folder_dest" type="checkbox" style="margin-left: -0.1%"/>
-                </p>
-            </div>
-            <p class="buttons" style="text-align:center;">
-                <input type="submit" name="validate" id="validate" value="<?php echo _VALIDATE; ?>" class="button"/>
-                <input type="button" name="cancel" id="cancel" value="<?php echo _CANCEL; ?>"
-                       class="button" onclick="window.top.location='<?php echo $_SESSION['config']['businessappurl']; ?>index.php';" />
-            </p>
-        </form>
-    </div>
-    <?php
-    if ((isset($_SESSION['m_admin']['folder']['foldertype_id'])
-            && ! empty($_SESSION['m_admin']['folder']['foldertype_id'] )) || $init)
-    { ?>
-        <script type="text/javascript">
-            var ft_list = $('foldertype');
-            if (ft_list) {
-                get_folder_index('<?php echo $_SESSION['config']['businessappurl'] . 'index.php?display=true' . '&module=folder&page=create_folder_get_folder_index'; ?>'
-                    , ft_list.options[ft_list.options.selectedIndex].value, 'folder_indexes');
-            }
-        </script>
-    <?php } ?>
-</div>
diff --git a/modules/folder/create_folder_form_iframe.php b/modules/folder/create_folder_form_iframe.php
deleted file mode 100755
index 0bc7b94f4a0..00000000000
--- a/modules/folder/create_folder_form_iframe.php
+++ /dev/null
@@ -1,190 +0,0 @@
-<?php
-/*
-*    Copyright 2008,2009 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 : create_folder_form.php.
- *
- * Form to create a folder
- *
- * @version 1.0
- *
- * @since 06/2007
- *
- * @license GPL
- * @author  <dev@maarch.org>
- */
-$core_tools2 = new core_tools();
-$core_tools2->load_lang();
-$core_tools2->test_service('create_folder', 'folder');
-$core_tools2->load_html();
-$core_tools2->load_header('', true, true);
-if (isset($_SESSION['error'])) {
-    ?>
-    <div class="error" id="main_error_popup" onclick="$(this).hide();">
-        <?php
-        echo functions::xssafe($_SESSION['error']); ?>
-    </div>
-<?php
-}
- if (isset($_SESSION['error']) && $_SESSION['error'] != '') {
-     ?>
-    <script>
-        var main_error = $('main_error_popup');
-        if (main_error != null) {
-            main_error.style.display = 'table-cell';
-            Element.hide.delay(10, 'main_error_popup');
-        }
-    </script>
-    <?php
-    $_SESSION['error'] = '';
- }
-if ($_SESSION['info'] == _FOLDER_ADDED) {
-    $_SESSION['info'] = '';
-    echo "<script>var select = parent.document.getElementById('folder');"
-    ."if('".$_SESSION['m_admin']['folder']['folder_parent']."' != 0){
-            var folderName = '       ".$_SESSION['m_admin']['folder']['folder_name']."';
-        } else {
-            var folderName = '".$_SESSION['m_admin']['folder']['folder_name']."';
-        }
-        "
-    ."var newOption = new Option (folderName, '".$_SESSION['m_admin']['folder']['folders_system_id']."');"
-    ."newOption.setAttribute('parent','".$_SESSION['m_admin']['folder']['folder_parent']."');"
-    .'var oSelect = select.options;'
-    ."if('".$_SESSION['m_admin']['folder']['folder_parent']."' != 0){
-            for(var i = 0; i < oSelect.length; i++) {
-                if(oSelect[i].value === '".$_SESSION['m_admin']['folder']['folder_parent']."') {
-                    var index = i+1;
-                    break;
-                }
-            }
-            select.options.add (newOption, index);
-        } else {
-            select.options.add (newOption);
-        }
-        "
-    ."select.value = '".$_SESSION['m_admin']['folder']['folders_system_id']."';
-    ";
-    echo "parent.triggerChosen();";
-    unset($_SESSION['m_admin']);
-    echo "new Effect.BlindUp(parent.document.getElementById('create_folder_div'));";
-    echo '</script>';
-}
-$db = new Database();
-
-$stmt = $db->query('SELECT foldertype_id, foldertype_label FROM '.
-    $_SESSION['tablename']['fold_foldertypes'].' order by foldertype_label');
-
-$foldertypes = array();
-while ($res = $stmt->fetchObject()) {
-    array_push(
-        $foldertypes,
-        array(
-            'id' => $res->foldertype_id,
-            'label' => $res->foldertype_label,
-        )
-    );
-}
-$init = false;
-?>
-<div id="inner_content" style="padding:0px;">
-    <div class="block">
-        <form name="create_folder" id="create_folder" method="post" class="forms"
-              action="<?php echo $_SESSION['config']['businessappurl']; ?>index.php?display=true&module=folder&page=manage_create_folder&iframe=true" >
-            <input type="hidden" name="display"  value="true" />
-            <input type="hidden" name="module"  value="folder" />
-            <input type="hidden" name="page"  value="manage_create_folder" />
-            <p>
-                <label for="foldertype"><?php echo _FOLDERTYPE; ?> :</label>
-                <select name="foldertype" id="foldertype"
-                        onchange="get_folder_index('<?php echo $_SESSION['config']['businessappurl'].'index.php?display=true'.'&module=folder&page=create_folder_get_folder_index'; ?>'
-                            , this.options[this.options.selectedIndex].value, 'folder_indexes');">
-                    <option value=""><?php echo _CHOOSE_FOLDERTYPE; ?></option>
-                    <?php
-                    for ($i = 0; $i < count($foldertypes); ++$i ) {
-                        ?>
-                        <option value="<?php functions::xecho($foldertypes[$i]['id']); ?>"
-                            <?php
-                            if (isset($_SESSION['m_admin']['folder']['foldertype_id'])
-                            && $_SESSION['m_admin']['folder']['foldertype_id'] == $foldertypes[$i]['id']) {
-                                echo 'selected="selected"';
-                            } elseif ($i == 0) {
-                                $init = true;
-                                echo 'selected="selected"';
-                            } ?>
-                        >
-                            <?php functions::xecho($foldertypes[$i]['label']); ?>
-                        </option>
-                    <?php
-                    } ?>
-                </select> <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <p>
-                <label for="folder_id"><?php echo _FOLDERID_LONG; ?></label>
-                <input name="folder_id" id="folder_id"
-                       value="<?php if (isset($_SESSION['m_admin']['folder']['folder_id'])) {
-                        functions::xecho($_SESSION['m_admin']['folder']['folder_id']);
-                    }?>" />
-                <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <p>
-                <label for="folder_name"><?php echo _FOLDERNAME; ?></label>
-                <input name="folder_name" id="folder_name"
-                       value="<?php if (isset($_SESSION['m_admin']['folder']['folder_name'])) {
-                        functions::xecho($_SESSION['m_admin']['folder']['folder_name']);
-                    } ?>" />
-                <i class="red_asterisk fa fa-asterisk mCyellow"></i>
-            </p>
-            <div id="folder_indexes"></div>
-            <div id="folder_dest_div">
-                <p>
-                    <label for="folder_dest"><?php echo _FOLDER_DESTINATION_QUESTION; ?></label>
-                    <input name="folder_dest" id="folder_dest" type="checkbox" style="margin-left: -0.1%"/>
-                </p>
-            </div>
-            <p class="buttons" style="text-align:center;">
-                <input type="submit" name="validate" id="validate" value="<?php echo _VALIDATE; ?>" class="button"/>
-                <input type="button" name="cancel" id="cancel" value="<?php echo _CANCEL; ?>"
-                       class="button" onclick="new Effect.BlindUp(parent.document.getElementById('show_tab'));return false;" />
-            </p>
-        </form>
-    </div>
-    <style type="text/css">p{padding: 5px;}</style>
-    <?php
-    if ((isset($_SESSION['m_admin']['folder']['foldertype_id'])
-            && !empty($_SESSION['m_admin']['folder']['foldertype_id'])) || $init) {
-        ?>
-        <script type="text/javascript">
-            var ft_list = $('foldertype');
-            if (ft_list) {
-                get_folder_index('<?php echo $_SESSION['config']['businessappurl'].'index.php?display=true'.'&module=folder&page=create_folder_get_folder_index'; ?>'
-                    , ft_list.options[ft_list.options.selectedIndex].value, 'folder_indexes');
-            }
-        </script>
-    <?php }
-    if(!empty($_GET['show_iframe']) && $_GET['show_iframe']=='false'){
-    ?>
-        <script>
-            new Effect.BlindUp(parent.document.getElementById('show_tab'));
-        </script>
-    <?php
-    }
-    ?>
-
-</div>
diff --git a/modules/folder/create_folder_get_folder_index.php b/modules/folder/create_folder_get_folder_index.php
deleted file mode 100755
index 438f2a2ddbf..00000000000
--- a/modules/folder/create_folder_get_folder_index.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/*
-*    Copyright 2008,2009 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 : create_folder_get_folder_index.php
-*
-* Ajax script used to get folder index during folder creation
-*
-* @package  Folder
-* @version 1.0
-* @since 06/2007
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-require_once 'modules/folder/class/class_admin_foldertypes.php';
-
-$core = new core_tools();
-//here we loading the lang vars
-$core->load_lang();
-$foldertype = new foldertype();
-$content = '';
-
-if (! isset($_REQUEST['foldertype_id']) || empty($_REQUEST['foldertype_id'])) {
-	echo _FOLDERTYPE.' '._IS_EMPTY;
-	exit();
-}
-
-$indexes = $foldertype->get_indexes($_REQUEST['foldertype_id']);
-$mandatory = $foldertype->get_mandatory_indexes($_REQUEST['foldertype_id']);
-
-if (count($indexes) > 0) {
-	foreach (array_keys($indexes) as $key) {
-		$content .= '<p>';
-		$content .= '<label for="' . $key . '">	' . $indexes[$key]['label']
-		         . ' :</label>';
-		if ($indexes[$key]['type_field'] == 'input') {
-			if ($indexes[$key]['type'] == 'date') {
-				$content .= '<input name="' . $key . '" type="text" id="' . $key
-				         . '" value="';
-				if (! empty($_SESSION['m_admin']['folder']['indexes'][$key])) {
-					$content .= $_SESSION['m_admin']['folder']['indexes'][$key];
-				} else if ($indexes[$key]['default_value'] <> false) {
-					$content .= $foldertype->format_date_db(
-					    $indexes[$key]['default_value'], true
-					);
-				}
-				$content .= '" onclick="showCalender(this);"/>';
-			} else {
-				$content .= '<input name="' . $key . '" type="text" id="' . $key
-				         . '" value="';
-				if (! empty($_SESSION['m_admin']['folder']['indexes'][$key])) {
-					$content .= $_SESSION['m_admin']['folder']['indexes'][$key];
-				} else if ($indexes[$key]['default_value'] <> false) {
-					$content .= $indexes[$key]['default_value'];
-				}
-				$content .= '"  />';
-			}
-		} else {
-			$content .= '<select name="' . $key . '" id="' . $key . '" >';
-			$content .= '<option value="">' . _CHOOSE . '...</option>';
-			for ($i = 0; $i < count($indexes[$key]['values']); $i ++) {
-			    $content .= '<option value="'
-			             . $indexes[$key]['values'][$i]['id'] . '"';
-				if (isset($_SESSION['m_admin']['folder']['indexes'][$key])
-				    && $indexes[$key]['values'][$i]['id'] == $_SESSION['m_admin']['folder']['indexes'][$key]
-				) {
-					$content .= ' selected="selected"';
-				} else if ($indexes[$key]['default_value'] <> false
-				    && $indexes[$key]['values'][$i]['id'] == $indexes[$key]['default_value']
-				    && empty($_SESSION['m_admin']['folder']['indexes'][$key])
-				) {
-					$content .= ' selected="selected"';
-				}
-				$content .= ' >' . $indexes[$key]['values'][$i]['label']
-				         . '</option>';
-			}
-			$content .= '</select>';
-		}
-
-		if (in_array($key, $mandatory)) {
-			$content .= ' <span class="red_asterisk"><i class="fa fa-star"></i></span>';
-		}
-		$content .= '</p>';
-	}
-}
-
-$db = new Database();
-
-if (isset($_SESSION['user']['entities'][0])) {
-	$finalDest = [];
-	foreach ($_SESSION['user']['entities'] as $tmp) {
-		$finalDest[] = $tmp['ENTITY_ID'];
-	}
-	$stmt = $db->query(
-		"SELECT folders_system_id, folder_id, folder_name FROM "
-		. $_SESSION['tablename']['fold_folders']
-		. " WHERE folder_level = 1 and status <> 'DEL' and (destination in (?) OR destination is null)", [$finalDest]
-	);
-} else {
-	$stmt = $db->query(
-		"SELECT folders_system_id, folder_id, folder_name FROM "
-		. $_SESSION['tablename']['fold_folders']
-		. " WHERE folder_level = 1 and status <> 'DEL' "
-	);
-}
-
-$folders = array();
-while ($res = $stmt->fetchObject()) {
-	array_push(
-	    $folders,
-	    [
-	    	'SYS_ID' => $res->folders_system_id,
-	    	'ID' => $res->folder_id,
-	    	'NAME' => $res->folder_name
-	    ]
-	);
-}
-include_once 'modules/folder/create_folder_get_folder_index_comp.php';
-
-echo $content;
-
diff --git a/modules/folder/create_folder_get_folder_index_comp.php b/modules/folder/create_folder_get_folder_index_comp.php
deleted file mode 100755
index 1bb2f41b5a8..00000000000
--- a/modules/folder/create_folder_get_folder_index_comp.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-if (count($folders) > 0) {
-	$content .= '<p>';
-		$content .= '<label for="folder_parent">'._CHOOSE_PARENT_FOLDER.' :</label>';
-		$content .= '<select name="folder_parent" id="folder_parent" onchange="checkSubFolder(this[this.selectedIndex].value)">';
-			$content .= '<option value=""></option>';
-			for($i=0; $i< count($folders);$i++)
-			{
-				$content .= '<option value="'.$folders[$i]['SYS_ID'].'">'.$folders[$i]['ID'].' - '.$folders[$i]['NAME'].'</option>';
-			}
-		$content .= '</select>';
-		$content .= ' <i class= fa fa-help" title="'._FOLDER_PARENT_DESC.'"/></i>';
-	$content .= '</p>';
-}
diff --git a/modules/folder/css/module.css b/modules/folder/css/module.css
deleted file mode 100755
index 842e301c093..00000000000
--- a/modules/folder/css/module.css
+++ /dev/null
@@ -1,138 +0,0 @@
-/* menu */
-
-#menunav li#folder_search span span {
-	background-image: url(static.php?module=folder&filename=folder_search.gif);
-	text-align:left;
-}
-#menunav li#folder_search.on span span {
-	background-image: url(static.php?module=folder&filename=folder_search_on.gif);
-	text-align:left;
-}
-
-td#folder_search {
-  background: url(static.php?module=folder&filename=folder_search.gif) no-repeat;
-}
-/*#menunav li#salary_sheet span span {
-	background-image: url(static.php?module=folder&filename=salary_sheet.gif);
-}
-#menunav li#salary_sheet.on span span {
-	background-image: url(static.php?module=folder&filename=salary_sheet_on.gif);
-}*/
-#menunav li#folder_out span span {
-	background-image: url(static.php?module=folder&filename=folder_out.gif);
-}
-#menunav li#folder_out.on span span {
-	background-image: url(static.php?module=folder&filename=folder_out_on.gif);
-}
-td#folder_out {
-  background: url(static.php?module=folder&filename=folder_out.gif) no-repeat;
-}
-#menunav li#create_folder span span {
-	background-image: url(static.php?module=folder&filename=create_folder_off.gif);
-}
-#menunav li#create_folder.on span span {
-	background-image: url(static.php?module=folder&filename=create_folder_on.gif);
-}
-td#create_folder {
-  background: url(static.php?module=folder&filename=create_folder_off.gif) no-repeat;
-}
-/* admin modules board */
-#fold_admin_foldertypes {
-	background:  url(static.php?module=folder&filename=manage_foldertypes.gif) no-repeat 2px top;
-}
-
-.create_folder {
-	background:  url(static.php?module=folder&filename=manage_foldertypes.gif) no-repeat 2px top;
-	width: 315px;
-	min-height: 110px;
-	float: left;
-	padding-top: 0px;
-	padding-right: 18px;
-	padding-bottom: 0px;
-	padding-left: 0px;
-	margin: 0px 0px 15px;
-	position: relative;
-	display: block;
-}
-
-/* Others */
-#select_new_folder
-{
- width: 95%;
-}
-
-#choose_doctypes .multiple_list
-{
-	width: 300px;
-	height:180px;
-}
-
-.select_folder
-{
-	color:#00CCFF;
-}
-
-.folder_forms input, .folder_forms select
-{
-	width: 140px;
-}
-
-.folder_forms .medium
-{
-	width: 90px;
-}
-
-.fold_addforms{
-	width: 280px;
-}
-.fold_addforms input{
-	width: 120px;
-}
-input.button {
-width:auto;
-}
-
-.folder-tab{
-    background: #F2F2F2;
-    border: 1px solid #666;
-    border-bottom: 0;
-    cursor: pointer;
-    display: inline;
-    float: right;
-    margin: 2px 0 0 -1px;
-    padding: 2px 5px;
-    position: relative;
-    font-size: 14px;
-}
-
-.folder-tab-open {
-    background: #fff;
-    margin-top: 0;
-    margin-bottom: -3px;
-    padding-bottom: 5px;
-    position: relative;
-    z-index: 1;
-}
-
-.panel-folder {
-    background: #135F7F;
-    border: 1px solid #000;
-    display: inline-block;
-    height: 650px;
-    min-width: 995px;
-    margin: 0 auto 1em;
-    padding: 5px 0 0 5px;
-    display: block;
-}
-
-.frame-targ {
-    background: #fff;
-    border-top: 1px solid #666;
-    clear: both;
-    margin: 0 0 0 -5px;
-    overflow: auto;
-    padding: 5px;
-    height: 92%;
-    width: auto;
-}
-
diff --git a/modules/folder/documents_list_in_details.php b/modules/folder/documents_list_in_details.php
deleted file mode 100755
index be88e23d99a..00000000000
--- a/modules/folder/documents_list_in_details.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/*
-*
-*    Copyright 2008,2012 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/>.
-*/
-
-/**
-* @brief    Displays documents list in details folder tree
-*
-* @file     list_doc.php
-* @author   Yves Christian Kpakpo <dev@maarch.org>
-* @date     $date$
-* @version  $Revision$
-* @ingroup  folder
-*/
-
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php";
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_security.php";
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_manage_status.php";
-require_once "apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR
-            ."class".DIRECTORY_SEPARATOR."class_lists.php";
-            
-$security   = new security();
-$core_tools = new core_tools();
-$request    = new request();
-$status_obj = new manage_status();
-$list       = new lists();
-
-if(isset($_REQUEST['listid']) && $_REQUEST['listid'] <> "") {
-
-    //Table or view
-        $view = $security->retrieve_view_from_coll_id($_SESSION['current_foldertype_coll_id'] );
-        $select = array();
-        $select[$view]= array();
-
-    //Fields
-        array_push($select[$view],"res_id", "status", "type_label", "category_id", "subject", "creation_date");
-
-    //Where clause
-        $where_tab = array();
-        //From tree
-        $where_tab[] = 'res_id in (?)';
-        $arrayPDO = array($_REQUEST['listid']);
-        //From security
-        foreach (array_keys($_SESSION['user']['security']) as $collId) {
-            if($collId == $_SESSION['current_foldertype_coll_id']) {
-                $where_tab[] = '(' . $_SESSION['user']['security'][$collId]['DOC']['where'] . ')';
-                break;
-            }
-        }
-        //Build where
-        $where = implode(' and ', $where_tab);
-
-        //Order
-        $order = $order_field = '';
-        $order = $list->getOrder();
-        $order_field = $list->getOrderField();
-        if (!empty($order_field) && !empty($order)) 
-            $orderstr = "order by ".$order_field." ".$order;
-        else  {
-            $list->setOrder();
-            $list->setOrderField('creation_date');
-            $orderstr = "order by creation_date desc";
-        }
-        
-    //Query    
-        $tab=$request->PDOselect($select,$where, $arrayPDO, $orderstr,$_SESSION['config']['databasetype'],"default", false, "", "", "", true);
-        // $request->show();
-        
-    //Result Array
-        for ($i=0;$i<count($tab);$i++)
-        {
-            for ($j=0;$j<count($tab[$i]);$j++)
-            {
-                foreach(array_keys($tab[$i][$j]) as $value)
-                {
-                    if($tab[$i][$j][$value]=="res_id")
-                    {
-                        $tab[$i][$j]["res_id"]=$tab[$i][$j]['value'];
-                        $tab[$i][$j]["label"]=_GED_NUM;
-                        $tab[$i][$j]["size"]="1";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=true;
-                        $tab[$i][$j]["order"]='res_id';
-                        $_SESSION['mlb_search_current_res_id'] = $tab[$i][$j]['value'];
-                    }
-                    if($tab[$i][$j][$value]=="status")
-                    {
-                        $res_status = $status_obj->get_status_data($tab[$i][$j]['value'],$extension_icon);
-                        $statusCmp = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['value'] = "<img src = '".$res_status['IMG_SRC']."' alt = '".$res_status['LABEL']."' title = '".$res_status['LABEL']."'>";
-                        $tab[$i][$j]["label"]=_STATUS;
-                        $tab[$i][$j]["size"]="4";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=true;
-                        $tab[$i][$j]["order"]='status';
-                    }             
-                    if($tab[$i][$j][$value]=="subject")
-                    {
-                        $tab[$i][$j]["value"] = $request->cut_string($request->show_string($tab[$i][$j]["value"]), 250);
-                        $tab[$i][$j]["label"]=_SUBJECT;
-                        $tab[$i][$j]["size"]="12";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=true;
-                        $tab[$i][$j]["order"]='subject';
-                    }
-                    if($tab[$i][$j][$value]=="category_id")
-                    {
-                        $_SESSION['mlb_search_current_category_id'] = $tab[$i][$j]["value"];
-                        $tab[$i][$j]["value"] = $_SESSION['mail_categories'][$tab[$i][$j]["value"]];
-                        $tab[$i][$j]["label"]=_CATEGORY;
-                        $tab[$i][$j]["size"]="10";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=false;
-                        $tab[$i][$j]["order"]='category_id';
-                    }
-                    if($tab[$i][$j][$value]=="type_label")
-                    {
-                        $tab[$i][$j]["value"] = $request->show_string($tab[$i][$j]["value"]);
-                        $tab[$i][$j]["label"]=_TYPE;
-                        $tab[$i][$j]["size"]="10";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=false;
-                        $tab[$i][$j]["order"]='type_label';
-                    }
-                    if($tab[$i][$j][$value]=="creation_date")
-                    {
-                        $tab[$i][$j]["value"]=$core_tools->format_date_db($tab[$i][$j]["value"], false);
-                        $tab[$i][$j]["label"]=_CREATION_DATE;
-                        $tab[$i][$j]["size"]="10";
-                        $tab[$i][$j]["label_align"]="left";
-                        $tab[$i][$j]["align"]="left";
-                        $tab[$i][$j]["valign"]="bottom";
-                        $tab[$i][$j]["show"]=true;
-                        $tab[$i][$j]["order"]='creation_date';
-                    }
-                }
-            }
-        }
-        
-    //List
-        $listKey = 'res_id';                                                                //Clé de la liste
-        $paramsTab = array();                                                               //Initialiser le tableau de paramètres
-        $paramsTab['bool_sortColumn'] = true;                                               //Affichage Tri
-        $paramsTab['pageTitle'] = count($tab).' '._FOUND_DOC;                               //Titre de la page
-        $paramsTab['bool_bigPageTitle'] = false;                                            //Affichage du titre en grand
-        $paramsTab['bool_showIconDocument'] = true;                                         //Affichage de l'icone du document
-        $paramsTab['bool_showIconDetails'] = true;                                          //Affichage de l'icone de la page de details
-        $details_page = $security->get_script_from_coll($_SESSION['current_foldertype_coll_id'], 'script_details');
-        $paramsTab['viewDetailsLink'] = 'index.php?page=' . str_replace(".php", '', $details_page) 
-            . '&dir=indexing_searching';       //Link to the details page
-        $paramsTab['urlParameters'] = 'listid='.$_REQUEST['listid'].'&display=true';        //Parametres d'url supplementaires
-        // $paramsTab['listHeight'] = '200px';                                                 //Hauteur de la liste
-        $paramsTab['bool_showSmallToolbar'] = true;                                         //Mini barre d'outils
-        $paramsTab['linesToShow'] = 15;                                                     //Nombre de ligne a afficher
-        $paramsTab['listCss'] = 'listingsmall';
-        
-        //Output
-        $status = 0;
-        $content = $list->showList($tab, $paramsTab, $listKey);
-        // $debug = $list->debug();
-       
- }
- 
- echo "{status : " . $status . ", content : '" . addslashes($debug.$content) . "', error : '" . addslashes($error) . "'}";
-?>
diff --git a/modules/folder/filling_res.php b/modules/folder/filling_res.php
deleted file mode 100755
index f7d2eca2fef..00000000000
--- a/modules/folder/filling_res.php
+++ /dev/null
@@ -1,250 +0,0 @@
-<?php
-/**
-* File : filling_res.php
-*
-* Frame to show the indexed files in a folder (show_folder.php)
-*
-* @package  Maarch PeopleBox 1.0
-* @version 2.0
-* @since 06/2006
-* @license GPL
-* @author  Lo�c Vinet  <dev@maarch.org>
-* @author  Laurent Giovannoni  <dev@maarch.org>
-*/
-
-require_once "core/class/class_request.php";
-require_once "core/class/class_security.php";
-require_once "modules/folder/class/class_modules_tools.php";
-require_once "apps/" . $_SESSION['config']['app_id'] 
-	. "/class/class_list_show.php";
-
-$core = new core_tools();
-$core->load_lang();
-$security = new security();
-$func = new functions();
-$tableName = $security->retrieve_table_from_coll(
-	$_SESSION['current_foldertype_coll_id']
-);
-$view = $security->retrieve_view_from_coll_id(
-	$_SESSION['current_foldertype_coll_id']
-);
-
-$core->load_html();
-//here we building the header
-$core->load_header('', true, false);
-?>
-<body id="filling_res_frame">
-<h2><?php echo _ARCHIVED_DOC;?></h2><br/>
-
-<?php
-$_SESSION['array_struct_final'] = array();
-$db = new Database();
-
-$arrayStruct = array();
-
-$list = new list_show();
-foreach (array_keys($_SESSION['user']['security']) as $collId) {
-    if ($collId == $_SESSION['current_foldertype_coll_id']) {
-		$collIdTest = $collId;
-		$whereClause = $_SESSION['user']['security'][$collId]['DOC']['where'];
-		break;
-	}
-}
-
-if (empty($collIdTest)) {
-	echo _NO_COLLECTION_ACCESS_FOR_THIS_USER;
-} else {
-	if ($whereClause <> "") {
-		$whereClause = " and (".$whereClause.")";
-	}
-	$stmt = $db->query(
-		"SELECT DISTINCT doctypes_first_level_id, doctypes_first_level_label, "
-		. "doctype_first_level_style, doctypes_second_level_id, "
-		. "doctypes_second_level_label, doctype_second_level_style, type_id, "
-		. "type_label, res_id, subject FROM  " . $view
-		. " WHERE folders_system_id = '" . $_SESSION['current_folder_id']
-		. "' and type_id <> 0 and doctypes_first_level_id <> 0 "
-		. "and doctypes_second_level_id <> 0 and status<>'DEL' " . $whereClause
-		. " order by doctypes_first_level_label, doctypes_second_level_label, "
-		. "type_label, res_id "
-	);
-
-	$countDoc = 0;
-	while ($res = $stmt->fetchObject()) {
-	    if (isset($res->doctype_first_level_style)) {
-	        $level1Style = $func->show_string($res->doctype_first_level_style);
-	    } else {
-	        $level1Style = 'default_style';
-	    }
-	    if (isset($res->doctype_second_level_style)) {
-	        $level2Style = $func->show_string($res->doctype_second_level_style);
-	    } else {
-	        $level2Style = 'default_style';
-	    }
-	    if (! isset($arrayStruct['level1'][$res->doctypes_first_level_id])) {
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id] = array(
-	    		'label' => $func->show_string($res->doctypes_first_level_label),
-	    		'style' => $level1Style,
-	    		'level2' => array(),
-	    	);
-	    }
-	    if (!isset(
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id]
-	    )
-	    ) {
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id] = array(
-	    		'label' => $func->show_string($res->doctypes_second_level_label),
-	    		'style' => $level2Style,
-	    		'level3' => array(),
-	    	);
-	    }
-		if (!isset(
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id]['level3'][$res->type_id]
-	    )
-	    ) {
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id]['level3'][$res->type_id] = array(
-	    		'label' => $func->show_string($res->type_label),
-	    		'level4' => array(),
-	    	);
-	    }
-		if (!isset(
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id]['level3'][$res->type_id]['level4'][$res->res_id]
-	    )
-	    ) {
-	    	$arrayStruct['level1'][$res->doctypes_first_level_id]['level2'][$res->doctypes_second_level_id]['level3'][$res->type_id]['level4'][$res->res_id] = array(
-	    		'id' => $func->show_string($res->res_id),
-	    		'label' => $func->show_string($res->subject)
-	    	);
-	    }
-		$countDoc++;
-	}
-	if ($countDoc > 0) {
-		$_SESSION['where_list_doc'] = "";
-		?>
-		<script type="text/javascript">
-			function view_doc(id)
-			{
-				var eleframe1 = window.top.document.getElementById('view_doc');
-				eleframe1.src = '<?php echo $_SESSION['config']['businessappurl'];?>index.php?display=true&module=folder&page=list_doc&listid='+id;
-				eleframe1.width = '100%'; 
-			}
-		</script>
-		<div align="left">
-			<?php
-			
-			foreach (array_keys($arrayStruct['level1']) as $level1) {
-				$res_id_list = "";
-				foreach (array_keys(
-					$arrayStruct['level1'][$level1]['level2']
-				) as $level2
-				) {
-					if (isset(
-						$arrayStruct['level1'][$level1]['level2'][$level2]['level3']
-					)
-					) {
-						foreach (array_keys(
-							$arrayStruct['level1'][$level1]['level2'][$level2]['level3']
-							) as $level3
-						) {
-							foreach (array_keys(
-								$arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4']
-							) as $level4
-							) {
-								$res_id_list .= $arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4'][$level4]['id'].",";
-
-							}
-						}
-					}
-				}
-				?>
-				<div onclick="change2(<?php functions::xecho($level1);?>)" id="h2<?php functions::xecho($level1);?>" class="categorie">
-					<?php
-					echo "<a href=javascript:view_doc('" . $res_id_list . "');>"
-					?><img src="<?php
-					echo $_SESSION['config']['businessappurl']
-					?>static.php?filename=folderopen.gif" alt="" />&nbsp;<b class="<?php
-					echo $arrayStruct['level1'][$level1]['style'];
-					?>"><?php functions::xecho($arrayStruct['level1'][$level1]['label']);?></b></a>
-					<span class="lb1-details">&nbsp;</span>
-				</div>
-				<br>
-				<div class="desc" id="desc<?php functions::xecho($level1);?>" >
-					<div class="ref-unit">
-						<?php
-						$res_id_list = "";
-						foreach (array_keys($arrayStruct['level1'][$level1]['level2']) as $level2)
-						{
-							$res_id_list = "";
-							if (isset($arrayStruct['level1'][$level1]['level2'][$level2]['level3'])) {
-								foreach(array_keys($arrayStruct['level1'][$level1]['level2'][$level2]['level3']) as $level3)
-								{
-									foreach(array_keys($arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4']) as $level4)
-									{
-										$res_id_list .= $arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4'][$level4]['id'].",";
-
-									}
-								}
-							}
-							?>
-							<div onclick="change2(<?php functions::xecho($level2);?>)" id="h2<?php functions::xecho($level2);?>" class="categorie">
-								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php
-								echo "<a href=javascript:view_doc('".$res_id_list."');>"
-								?><img src="<?php
-								echo $_SESSION['config']['businessappurl'];
-								?>static.php?filename=folderopen.gif" alt="" />&nbsp;<b class="<?php
-								if (isset($arrayStruct['level1'][$level1]['level2'][$level2]['style'])) {
-								    echo $arrayStruct['level1'][$level1]['level2'][$level2]['style'];
-								} else {
-								    echo 'default_style';
-								}
-								?>"><?php functions::xecho($arrayStruct['level1'][$level1]['level2'][$level2]['label']);?></b></a>
-								<span class="lb1-details">&nbsp;</span>
-							</div>
-							<br>
-							<div class="desc" id="desc<?php functions::xecho($level2);?>" >
-								<div class="ref-unit">
-									<?php
-									$res_id_list = "";
-									//if (isset($arrayStruct['level1'][$level1]['level2'][$level2]['level3'])) {
-										foreach(array_keys($arrayStruct['level1'][$level1]['level2'][$level2]['level3']) as $level3)
-										{
-											$res_id_list = "";
-											foreach(array_keys($arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4']) as $level4)
-											{
-												$res_id_list = $arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4'][$level4]['id'].",";
-												echo 	"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-													<a href=javascript:view_doc('".$res_id_list."');><img src='".$_SESSION['config']['businessappurl']
-                                                    ."static.php?module=folder&filename=page.gif' alt='' />"
-                                                    .$arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['label']
-                                                    ." - ".$arrayStruct['level1'][$level1]['level2'][$level2]['level3'][$level3]['level4'][$level4]['label']
-                                                    ."</a><br>";
-											}
-											?>
-											</div>
-										</div>
-										<?php
-										}
-									
-									?>
-								</div>
-							</div>
-							<?php
-						}
-						?>
-					</div>
-				</div>
-				<?php
-			}
-			?>
-		</div>
-	<?php
-	}
-	else
-	{
-		echo _FOLDERHASNODOC.".<br>";
-	}
-}
-$core->load_js();
-?>
-</body>
-</html>
diff --git a/modules/folder/folder_freeze.php b/modules/folder/folder_freeze.php
deleted file mode 100755
index fbf97c44bb9..00000000000
--- a/modules/folder/folder_freeze.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-if (isset($_SESSION['folder'])
-    && ($_SESSION['folder']['is_frozen'] == 'N' || $_SESSION['folder']['is_frozen'] == 'Y')
-) {
-    if ($_SESSION['folder']['is_frozen'] == 'N') {
-        ?>
-        <input type="hidden" name="is_frozen" id="is_frozen" value="Y" />
-        <input type="submit" name="freezeFolder" id="freezeFolder" class="button" value="<?php
-        echo _FREEZE_FOLDER;
-        ?>"  onclick="return(confirm('<?php
-        echo _REALLY_FREEZE_THIS_FOLDER . '?\n\r\n\r';
-        ?>'));" />
-        <?php
-    } else {
-        ?>
-        <input type="hidden" name="is_frozen" id="is_frozen" value="N" />
-        <input type="submit" name="unfreezeFolder" id="unfreezeFolder" class="button" value="<?php
-        echo _UNFREEZE_FOLDER;
-        ?>" />
-        <?php
-    }
-}
\ No newline at end of file
diff --git a/modules/folder/folder_history.php b/modules/folder/folder_history.php
deleted file mode 100755
index 2dc1b372bdf..00000000000
--- a/modules/folder/folder_history.php
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/*
-*
-*    Copyright 2008,2012 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/>.
-*/
-
-/**
-* @brief    Displays folder history
-*
-* @file     folder_history.php
-* @author   Yves Christian Kpakpo <dev@maarch.org>
-* @date     $date$
-* @version  $Revision$
-* @ingroup  folder
-*/
-
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php";
-require_once "apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR
-            ."class".DIRECTORY_SEPARATOR."class_lists.php";
-            
-$core_tools = new core_tools();
-$db    = new Database();
-$list       = new lists();
-
-if(isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
-    $id = $_REQUEST['id'];
-} else {
-    echo '<span class="error">'._ID.' '._IS_EMPTY.'</span>';
-    exit();
-}
-
- if (isset($_REQUEST['load'])) {
-    //
-    $core_tools->load_lang();
-    $core_tools->load_html();
-    $core_tools->load_header('', true, false);
-
-    ?><body><?php
-    echo '<h2>' . _HISTORY . '</h2>';
-
-    $core_tools->load_js();
-
-    //Load list
-    if (isset($_SESSION['current_folder_id']) 
-        && ! empty($_SESSION['current_folder_id'])
-    ) {
-        $target = $_SESSION['config']['businessappurl'].'index.php?module=folder&page=folder_history&id='.$id;
-        $listContent = $list->loadList($target);
-        echo $listContent;
-    }
-    ?>
-    </body>
-    </html>
-   <?php
-} else {
-    //Order
-            $order = $order_field = '';
-            $order = $list->getOrder();
-            $order_field = $list->getOrderField();
-            if (!empty($order_field) && !empty($order)) 
-                $orderstr = "order by ".$order_field." ".$order;
-            else  {
-                $list->setOrder();
-                $list->setOrderField('event_date');
-                $orderstr = "order by event_date desc";
-            }
-            
-    //From filters
-        $where = "";
-        $filterClause = $list->getFilters(); 
-        if (!empty($filterClause)) $where = ' and '.$filterClause;//Filter clause
-        
-        //Query
-            $stmt = $db->query("SELECT h.event_date, ".$_SESSION['tablename']['users'].".user_id, "
-                .$_SESSION['tablename']['users'].".firstname, ".$_SESSION['tablename']['users']
-                .".lastname, h.info FROM "
-                .$_SESSION['tablename']['history']." h, ".$_SESSION['tablename']['users']
-                ." WHERE h.table_name = ? and h.record_id = ? and h.user_id = "
-                .$_SESSION['tablename']['users'].".user_id".$where." ".$orderstr,
-                array($_SESSION['tablename']['fold_folders'], $id));
-            // $request->show();
-            
-            $tab=array();
-            while($line = $stmt->fetch(PDO::FETCH_ASSOC))
-            {
-                $temp= array();
-                foreach (array_keys($line) as $resval)
-                {
-                    if (!is_int($resval))
-                    {
-                        array_push($temp,array('column'=>$resval,'value'=>$line[$resval]));
-                    }
-                }
-                array_push($tab, $temp);
-            }
-
-        //Result Array
-            for ($i=0;$i<count($tab);$i++)
-            {
-                for ($j=0;$j<count($tab[$i]);$j++)
-                {
-                    foreach(array_keys($tab[$i][$j]) as $value)
-                    {
-                        if($tab[$i][$j][$value]=="id")
-                        {
-                            $tab[$i][$j]["id"]=$tab[$i][$j]['value'];
-                            $tab[$i][$j]["label"]=_ID;
-                            $tab[$i][$j]["size"]="1";
-                            $tab[$i][$j]["label_align"]="left";
-                            $tab[$i][$j]["align"]="left";
-                            $tab[$i][$j]["valign"]="bottom";
-                            $tab[$i][$j]["show"]=true;
-                            $tab[$i][$j]["order"]='id';
-                        }
-                        if($tab[$i][$j][$value]=="event_date")
-                        {
-                            $tab[$i][$j]["value"]=functions::dateformat($tab[$i][$j]["value"]);
-                            $tab[$i][$j]["label"]=_DATE;
-                            $tab[$i][$j]["size"]="15";
-                            $tab[$i][$j]["label_align"]="left";
-                            $tab[$i][$j]["align"]="left";
-                            $tab[$i][$j]["valign"]="bottom";
-                            $tab[$i][$j]["show"]=true;
-                            $tab[$i][$j]["order"]='event_date';
-                        }
-                        if($tab[$i][$j][$value]=="firstname")
-                        {
-                            $firstname =  functions::show_string($tab[$i][$j]["value"]);
-                        }
-                        if($tab[$i][$j][$value]=="lastname")
-                        {
-                            $tab[$i][$j]["value"] = functions::show_string($tab[$i][$j]["value"]). ' ' .$firstname ;
-                            $tab[$i][$j]["label"]=_USER;
-                            $tab[$i][$j]["size"]="15";
-                            $tab[$i][$j]["label_align"]="left";
-                            $tab[$i][$j]["align"]="left";
-                            $tab[$i][$j]["valign"]="bottom";
-                            $tab[$i][$j]["show"]=true;
-                            $tab[$i][$j]["order"]='lastname';
-                        }
-                        if($tab[$i][$j][$value]=="info")
-                        {
-                            $tab[$i][$j]["value"] = functions::show_string($tab[$i][$j]["value"]);
-                            $tab[$i][$j]["label"]=_EVENT;
-                            $tab[$i][$j]["size"]="30";
-                            $tab[$i][$j]["label_align"]="left";
-                            $tab[$i][$j]["align"]="left";
-                            $tab[$i][$j]["valign"]="bottom";
-                            $tab[$i][$j]["show"]=true;
-                            $tab[$i][$j]["order"]='info';
-                        }
-                    }
-                }
-            }
-
-        //List
-            $listKey = 'id';                                                                    //Clé de la liste
-            $paramsTab = array();                                                               //Initialiser le tableau de paramètres
-            $paramsTab['bool_sortColumn'] = true;                                               //Affichage Tri
-            $paramsTab['pageTitle'] ='';                                                        //Titre de la page
-            $paramsTab['bool_bigPageTitle'] = false;                                            //Affichage du titre en grand
-            $paramsTab['urlParameters'] = 'id='.$_REQUEST['id'].'&display=true';                //Parametres d'url supplementaires
-            $paramsTab['filters'] = array('user', 'history_action', 'history_date');     //Filtres    
-            $paramsTab['listHeight'] = '100%';                                                 //Hauteur de la liste
-            // $paramsTab['bool_showSmallToolbar'] = true;                                         //Mini barre d'outils
-            $paramsTab['linesToShow'] = 15;                                                     //Nombre de ligne a afficher
-            
-            //Output
-            $status = 0;
-            $content = $list->showList($tab, $paramsTab, $listKey);
-            // $debug = $list->debug();
-
-    echo "{status : " . $status . ", content : '" . addslashes($debug.$content) . "', error : '" . addslashes($error) . "'}";
-}
\ No newline at end of file
diff --git a/modules/folder/folder_tables.php b/modules/folder/folder_tables.php
deleted file mode 100755
index 85ced4b01d8..00000000000
--- a/modules/folder/folder_tables.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/*
-*    Copyright 2008 - 2011 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/>.
-*/
-
-/**
-* @brief Entities tables declarations
-*
-*
-* @file
-* @author  Claire Figueras  <dev@maarch.org>
-* @date $date$
-* @version $Revision$
-* @ingroup folder
-*/
-
-if (! defined('FOLD_FOLDERS_TABLE')) {
-    define('FOLD_FOLDERS_TABLE', 'folders');
-}
-if (! defined('FOLD_FOLDERTYPES_TABLE')) {
-    define('FOLD_FOLDERTYPES_TABLE', 'foldertypes');
-}
-if (! defined('FOLD_FOLDERTYPES_DOCTYPES_TABLE')) {
-    define('FOLD_FOLDERTYPES_DOCTYPES_TABLE', 'foldertypes_doctypes');
-}
-if (! defined('FOLD_FOLDERTYPES_DOCTYPES_LEVEL1_TABLE')) {
-    define('FOLD_FOLDERTYPES_DOCTYPES_LEVEL1_TABLE', 'foldertypes_doctypes_level1');
-}
-if (! defined('FOLD_FOLDERTYPES_INDEXES_TABLE')) {
-    define('FOLD_FOLDERTYPES_INDEXES_TABLE', 'foldertypes_indexes');
-}
diff --git a/modules/folder/folder_view_stats.php b/modules/folder/folder_view_stats.php
deleted file mode 100755
index 24ae30fe37b..00000000000
--- a/modules/folder/folder_view_stats.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-$core_tools = new core_tools();
-$core_tools->load_lang();
-$core_tools->test_service('reports', 'reports');
-$content = '';
-$content .='<div id="params">';
-	$content .='<form id="folderviewform" name="folderviewform" method="get" action="">';
-		$content .='<table width="95%"  border="0" align="center">';
-			$content .='<tr>';
-				$content .='<td rowspan="4" width="25"><!--IMAGE--></td>';
-				$content .='<td align="left"><input type="radio" id="foldertype" name="type_choice" checked="checked" class="checked" value="byFoldertype" /><label for="foldertype">'._TITLE_STATS_CHOICE_FOLDER_TYPE.'</label></td>';
-				$content .='<td rowspan="4" align="right" valign="middle"><input type="button" onclick="valid_viewfolder( \''.$_SESSION['config']['businessappurl'].'index.php?display=true&module=folder&page=get_folder_view_stats_val\');" class="button" name="Submit1" value="'._VALIDATE.'" /></td>';
-			$content .='</tr>';
-			$content .='<tr>';
-				$content .='<td align="left"><input type="radio" id="usergroup" name="type_choice" value="byGroup" /><label for="usergroup">'._TITLE_STATS_CHOICE_GROUP.'</label></td>';
-			$content .='</tr>';
-			$content .='<tr>';
-				$content .='<td align="left"><input type="radio" id="user" name="type_choice" value="byUser" /><label for="user">'._TITLE_STATS_CHOICE_USER.'</label> ';
-					$content .='<input type="text" name="user_id" id="user_id" value="" />&nbsp;<em><label for="user_id"><a href="javascript://" onclick="window.open(\''.$_SESSION['config']['businessappurl'].'index.php?display=true&module=folder&page=select_user_report\',\'select_user\',\'width=800,height=700,resizable=yes\');" >'._CHOOSE_USER2.'</a></label></em></td>';
-			$content .='</tr>';
-			$content .='<tr>';
-				$content .='<td align="left"><input type="radio" id="period" name="type_choice" value="byPeriod" /><label for="period">'._TITLE_STATS_CHOICE_PERIOD.'.&nbsp;</label>'._SINCE.'&nbsp;:&nbsp;<input name="datestart" type="text"  id="datestart" onclick="showCalender(this);" />&nbsp;'._FOR.'&nbsp;:&nbsp;<input name="datefin" type="text"  id="datefin" onclick="showCalender(this);" /></td>';
-			$content .='</tr>';
-		$content .='</table>';
-	$content .='</form>';
-$content .='</div>';
-$content .='<div id="result_folderviewstat"></div>';
-$js ='valid_viewfolder(\''.$_SESSION['config']['businessappurl'].'index.php?display=true&module=folder&page=get_folder_view_stats_val\');';
-
-echo "{content : '".addslashes($content)."', exec_js : '".addslashes($js)."'}";
-exit();
diff --git a/modules/folder/folders_list_by_id.php b/modules/folder/folders_list_by_id.php
deleted file mode 100755
index 1c54a10822e..00000000000
--- a/modules/folder/folders_list_by_id.php
+++ /dev/null
@@ -1,66 +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 : folders_list_by_id.php
-*
-* List of folders for autocompletion
-*
-* @package  Maarch Framework 3.0
-* @version 3
-* @since 10/2005
-* @license GPL
-* @author Laurent Giovannoni <dev@maarch.org>
-* @author Claire Figueras <dev@maarch.org>
-*/
-
-require_once "core/class/class_request.php";
-$db = new Database();
-
-//requete permettant de rechercher sur les dossiers qui ne sont pas en status del
-$stmt = $db->query(
-    "SELECT folder_id FROM " . $_SESSION['tablename']['fold_folders']
-    . " WHERE status != 'DEL' and lower(folder_id) like lower(?) order by folder_id",
-    array($_REQUEST['Input'] . '%')
-);
-
-$folders = array();
-while ($line = $stmt->fetchObject()) {
-    array_push($folders, $line->folder_id);
-}
-
-echo "<ul>";
-$authViewList = 0;
-foreach ($folders as $folder) {
-    if ($authViewList >= 10) {
-        $flagAuthView = true;
-    }
-    if (stripos($folder, $_REQUEST['Input']) === 0) {
-        echo "<li>" . $folder . "</li>";
-        if (isset($flagAuthView) && $flagAuthView) {
-            echo "<li>...</li>";
-            break;
-        }
-        $authViewList ++;
-    }
-}
-echo "</ul>";
diff --git a/modules/folder/folders_list_by_name.php b/modules/folder/folders_list_by_name.php
deleted file mode 100755
index b595033c9dd..00000000000
--- a/modules/folder/folders_list_by_name.php
+++ /dev/null
@@ -1,65 +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 : folders_list_by_name.php
-*
-* List of folders for autocompletion
-*
-* @package  Maarch Framework 3.0
-* @version 3
-* @since 10/2005
-* @license GPL
-* @author Laurent Giovannoni <dev@maarch.org>
-* @author Claire Figueras <dev@maarch.org>
-*/
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-$db = new Database();
-
-$stmt = $db->query("SELECT folder_id, folder_name, folders_system_id FROM ".$_SESSION['tablename']['fold_folders']." WHERE lower(folder_name) like lower(?) order by folder_name", array($_REQUEST['folder'].'%'));
-
-$folders = array();
-while($line = $stmt->fetchobject())
-{
-	array_push($folders, $line->folder_name." (".$line->folder_id.")");
-}
-echo "<ul>\n";
-$authViewList = 0;
-foreach($folders as $folder)
-{
-	if($authViewList >= 10)
-	{
-		$flagAuthView = true;
-	}
-    if(stripos($folder, $_REQUEST['folder']) === 0)
-    {
-        echo "<li>".$folder."</li>\n";
-		if($flagAuthView)
-		{
-			echo "<li>...</li>\n";
-			break;
-		}
-		$authViewList++;
-    }
-}
-echo "</ul>";
diff --git a/modules/folder/folders_list_search_adv.php b/modules/folder/folders_list_search_adv.php
deleted file mode 100755
index 63c10d06435..00000000000
--- a/modules/folder/folders_list_search_adv.php
+++ /dev/null
@@ -1,216 +0,0 @@
-<?php
-
-require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_core_tools.php';
-require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_request.php';
-require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_manage_status.php';
-require_once 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR
-            .'class'.DIRECTORY_SEPARATOR.'class_lists.php';
-
-$theCore = new core_tools();
-$theCore->test_service('folder_search', 'folder');
-
-$status_obj = new manage_status();
-$request = new request();
-$func = new functions();
-$list = new lists();
-
-$_SESSION['error_page'] = '';
-
-if ($_GET['lines'] != null) {
-    $_SESSION['save_list']['lines'] = $_GET['lines'];
-}
-if ($_GET['order'] != null) {
-    $_SESSION['save_list']['order'] = $_GET['order'];
-}
-if ($_GET['order_field'] != null) {
-    $_SESSION['save_list']['order_field'] = $_GET['order_field'];
-}
-
-//Table or view
-    $view = $_SESSION['view']['view_folders'];
-    $select[$view] = array();
-
-//Fields
-    array_push($select[$view],'folders_system_id', 'status',
-            'foldertype_label', 'custom_t2', 'folder_id',
-            'folder_name', 'folders_system_id as count_document', 'creation_date');
-
-//Where
-    $where_tab = array();
-    $arrayPDO = array();
-
-    //From search
-    if (!empty($_SESSION['searching']['where_request'])) {
-        $where_tab[] = $_SESSION['searching']['where_request'].'(1=1)';
-        $arrayPDO = array_merge($arrayPDO, $_SESSION['searching']['where_request_parameters']);
-    }
-    //Add on
-    $where_tab[] = "status <> 'DEL' ";
-    //Build where
-    $where = implode(' and ', $where_tab);
-
-//Order
-    $order = $order_field = '';
-    $order = $list->getOrder();
-    $order_field = $list->getOrderField();
-    if (!empty($order_field) && !empty($order)) {
-        $orderstr = 'order by '.$order_field.' '.$order;
-    } else {
-        $list->setOrder('asc');
-        $list->setOrderField('folder_name');
-        $orderstr = 'order by folder_name asc';
-    }
-
-    if (isset($_REQUEST['start'])) {
-        $start = $_REQUEST['start'];
-        $_SESSION['save_list']['start'] = $start;
-    } else if (empty($_SESSION['save_list']['start']) && !isset($_REQUEST['start'])){
-        $start = $list->getStart();
-        $_SESSION['save_list']['start'] = $start;
-    }
-
-//Query
-    $tab = $request->PDOselect($select, $where, $arrayPDO, $orderstr, $_SESSION['config']['databasetype'], "default", false, "", "", "", true, false, false, $_SESSION['save_list']['start']);
-    // $request->show();
-//Result Array
-    if (!empty($tab)) {
-        for ($i = 0; $i < count($tab); ++$i) {
-            for ($j = 0; $j < count($tab[$i]); ++$j) {
-                foreach (array_keys($tab[$i][$j]) as $value) {
-                    if ($tab[$i][$j][$value] == 'folders_system_id') {
-                        $tab[$i][$j]['folders_system_id'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['label'] = '';
-                        $tab[$i][$j]['size'] = '4';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'center';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = false;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'folders_system_id';
-                    }
-                    if ($tab[$i][$j][$value] == 'status') {
-                        $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon);
-                        $statusCmp = $tab[$i][$j]['value'];
-                        if (!isset($res_status['IMG_SRC']) || empty($res_status['IMG_SRC'])) {
-                            $tab[$i][$j]['value'] = "<i class = 'fm fm-letter-status-new fm-3x' alt = '".$res_status['LABEL']."' title = '".$res_status['LABEL']."'></i>";
-                        } else {
-                            $tab[$i][$j]['value'] = "<i class = 'fm ".$res_status['IMG_SRC']." fm-3x' alt = '".$res_status['LABEL']."' title = '".$res_status['LABEL']."'></i>";
-                        }
-                        $tab[$i][$j]['label'] = _STATUS;
-                        $tab[$i][$j]['size'] = '4';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'left';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = true;
-                        $tab[$i][$j]['order'] = 'status';
-                    }
-                    if ($tab[$i][$j][$value] == 'foldertype_label') {
-                        $tab[$i][$j]['label'] = _FOLDERTYPE;
-                        $tab[$i][$j]['size'] = '10';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'left';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = true;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'foldertype_label';
-                    }
-                    if ($tab[$i][$j][$value] == 'custom_t2') {
-                        $tab[$i][$j]['label'] = _FOLDERTYPE;
-                        $tab[$i][$j]['size'] = '5';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'left';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = false;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'custom_t2';
-                    }
-                    if ($tab[$i][$j][$value] == 'folder_id') {
-                        $tab[$i][$j]['label'] = _FOLDERID;
-                        $tab[$i][$j]['size'] = '10';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'left';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = true;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'folder_id';
-                    }
-                    if ($tab[$i][$j][$value] == 'folder_name') {
-                        $tab[$i][$j]['label'] = _FOLDERNAME;
-                        $tab[$i][$j]['size'] = '20';
-                        $tab[$i][$j]['label_align'] = 'left';
-                        $tab[$i][$j]['align'] = 'left';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = true;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'folder_name';
-                    }
-                    if ($tab[$i][$j][$value] == 'count_document') {
-                        $tab[$i][$j]['label'] = _NB_DOCS_IN_FOLDER;
-                        $tab[$i][$j]['value'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['size'] = '5';
-                        $tab[$i][$j]['label_align'] = 'right';
-                        $tab[$i][$j]['align'] = 'right';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = false;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = false;
-                    }
-                    if ($tab[$i][$j][$value] == 'creation_date') {
-                        $tab[$i][$j]['label'] = _FOLDERDATE;
-                        $tab[$i][$j]['value'] = $func->format_date($tab[$i][$j]['value']);
-                        $tab[$i][$j]['size'] = '5';
-                        $tab[$i][$j]['label_align'] = 'right';
-                        $tab[$i][$j]['align'] = 'right';
-                        $tab[$i][$j]['valign'] = 'bottom';
-                        $tab[$i][$j]['show'] = true;
-                        $tab[$i][$j]['value_export'] = $tab[$i][$j]['value'];
-                        $tab[$i][$j]['order'] = 'creation_date';
-                    }
-                }
-            }
-        }
-
-        //Initialiser le tableau de param�tres
-        $paramsTab = array();
-        $paramsTab['bool_modeReturn'] = false;                                          //Desactivation du mode return (vs echo)
-        $paramsTab['pageTitle'] = _RESULTS.' : '.$_SESSION['save_list']['full_count'].' '._FOUND_FOLDER;        //Titre de la page
-        $paramsTab['bool_sortColumn'] = true;                                           //Affichage Tri
-        $paramsTab['pagePicto'] = 'search';                                      //Image de la page
-        $paramsTab['tools'] = array();                                                  //Icones dans la barre d'outils
-        $paramsTab['start'] = $_SESSION['save_list']['start'];
-        $export = array(
-            'script' => "window.open('".$_SESSION['config']['businessappurl']."index.php?display=true&page=export', '_blank');",
-            'icon' => 'cloud-download-alt',
-            'tooltip' => _EXPORT_LIST,
-            'disabledRules' => count($tab).' == 0',
-            );
-        // array_push($paramsTab['tools'],$export);
-
-        //Action icons array
-        $paramsTab['actionIcons'] = array();
-        $details = array(
-                'script' => "window.top.location='".$_SESSION['config']['businessappurl']
-                                ."index.php?page=show_folder&module=folder&id=@@folders_system_id@@'",
-                'icon' => 'info-circle',
-                'tooltip' => _DETAILS,
-                );
-        array_push($paramsTab['actionIcons'], $details);
-
-        //Afficher la liste
-        echo '<br/>';
-        $list->showList($tab, $paramsTab, $listKey);
-    } else {
-        $func->echo_error(_ADV_SEARCH_FOLDER_TITLE, _NO_RESULTS, 'title', '');
-    }
-
-?>
-
-<script type="text/javascript">
-    $j('#container').attr('style', 'width: 90%; min-width: 1000px;');
-    $j('#content').attr('style', 'width: auto; min-width: 1000px;');
-
-    if ($j('#inner_content')) {
-        $j('#inner_content').attr('style', 'width: auto; min-width: 1000px;');
-    }
-    $j('table.listing').attr('style', 'width: 100%; min-width: 900px;');
-</script>
\ No newline at end of file
diff --git a/modules/folder/foldertype_add.php b/modules/folder/foldertype_add.php
deleted file mode 100755
index 074cca6a715..00000000000
--- a/modules/folder/foldertype_add.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-$admin = new core_tools();
-$admin->test_admin('admin_foldertypes', 'folder');
- /****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true") {
-    $init = true;
-}
-$level = "";
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2 
-	|| $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 
-	|| $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$pagePath = $_SESSION['config']['businessappurl'].'index.php?page=foldertype_add&module=folder';
-$pageLabel = _ADDITION;
-$pageId = "foldertype_add";
-$admin->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level);
-/***********************************************************/
-require_once "modules/folder/class/class_admin_foldertypes.php";
-$func = new functions();
-
-$ft = new foldertype();
-
-$ft->formfoldertype("add");
-
diff --git a/modules/folder/foldertype_add_db.php b/modules/folder/foldertype_add_db.php
deleted file mode 100755
index 81242615cd9..00000000000
--- a/modules/folder/foldertype_add_db.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_admin_foldertypes.php");
-
-$core_tools = new core_tools();
-
-$core_tools->load_lang();
-$core_tools->test_admin('admin_foldertypes', 'folder');
-$ft = new foldertype();
-
-$ft->addupfoldertype("add");
-?>
diff --git a/modules/folder/foldertype_del.php b/modules/folder/foldertype_del.php
deleted file mode 100755
index ebc085e928a..00000000000
--- a/modules/folder/foldertype_del.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_admin_foldertypes.php");
-
-$func = new functions();
-$core_tools = new core_tools();
-
-$core_tools->load_lang();
-$core_tools->test_admin('admin_foldertypes', 'folder');
-if(isset($_GET['id']))
-{
-	$s_id = addslashes($func->wash($_GET['id'], "alphanum", _THE_ID));
-}
-else
-{
-	$s_id = "";
-}
-
-$ft = new foldertype();
-$ft->adminfoldertype($s_id,"del");
-?>
diff --git a/modules/folder/foldertype_list_by_name.php b/modules/folder/foldertype_list_by_name.php
deleted file mode 100755
index 55e2a901abb..00000000000
--- a/modules/folder/foldertype_list_by_name.php
+++ /dev/null
@@ -1,65 +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 : foldertype_list_by_name.php
-*
-* List of foldertype for autocompletion
-*
-* @package  Maarch Framework 3.0
-* @version 3
-* @since 10/2005
-* @license GPL
-* @author Laurent Giovannoni <dev@maarch.org>
-*/
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-$db = new Database();
-
-$stmt = $db->query("SELECT foldertype_label as tag FROM ".$_SESSION['tablename']['fold_foldertypes']." WHERE lower(foldertype_label) like lower(?) order by foldertype_label", array($_REQUEST['what'].'%'));
-
-$listArray = array();
-while($line = $stmt->fetchObject())
-{
-	array_push($listArray, $line->tag);
-}
-echo "<ul>\n";
-$authViewList = 0;
-
-foreach($listArray as $what)
-{
-	if($authViewList >= 10)
-	{
-		$flagAuthView = true;
-	}
-    if(stripos($what, $_REQUEST['what']) === 0)
-    {
-        echo "<li>".$what."</li>\n";
-		if($flagAuthView)
-		{
-			echo "<li>...</li>\n";
-			break;
-		}
-		$authViewList++;
-    }
-}
-echo "</ul>";
diff --git a/modules/folder/foldertype_up.php b/modules/folder/foldertype_up.php
deleted file mode 100755
index b15ed413ce0..00000000000
--- a/modules/folder/foldertype_up.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-$admin = new core_tools();
-
-$admin->test_admin('admin_foldertypes', 'folder');
- /****************Management of the location bar  ************/
-$init = false;
-if(isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true")
-{
-    $init = true;
-}
-$level = "";
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1))
-{
-    $level = $_REQUEST['level'];
-}
-$page_path = $_SESSION['config']['businessappurl'].'index.php?page=foldertype_up&module=folder';
-$page_label = _MODIFICATION;
-$page_id = "foldertype_up";
-$admin->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
-/***********************************************************/
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_admin_foldertypes.php");
-
-$func = new functions();
-
-if(isset($_GET['id']))
-{
-    $id = addslashes($func->wash($_GET['id'], "alphanum", _THE_ID));
-}
-else
-{
-    $id = "";
-}
-
-
-$ft = new foldertype();
-
-$ft->formfoldertype("up",$id);
-?>
diff --git a/modules/folder/foldertype_up_db.php b/modules/folder/foldertype_up_db.php
deleted file mode 100755
index 16e638d9c88..00000000000
--- a/modules/folder/foldertype_up_db.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_admin_foldertypes.php");
-
-$core_tools = new core_tools();
-
-$core_tools->load_lang();
-$core_tools->test_admin('admin_foldertypes', 'folder');
-$ft = new foldertype();
-
-$ft->addupfoldertype("up");
-?>
diff --git a/modules/folder/foldertypes.php b/modules/folder/foldertypes.php
deleted file mode 100755
index 11c1643beb1..00000000000
--- a/modules/folder/foldertypes.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-
-$_SESSION['m_admin'] = array();
-$admin = new core_tools();
-$admin->test_admin('admin_foldertypes', 'folder');
-/****************Management of the location bar  ************/
-$init = false;
-if(isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true")
-{
-    $init = true;
-}
-$level = "";
-
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2 || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4 || $_REQUEST['level'] == 1))
-{
-    $level = $_REQUEST['level'];
-}
-$page_path = $_SESSION['config']['businessappurl'].'index.php?page=foldertypes&module=folder';
-$page_label = _FOLDERTYPES_LIST;
-$page_id = "foldertypes";
-$admin->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
-/***********************************************************/
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_list_show.php");
-$func = new functions();
-$select[$_SESSION['tablename']['fold_foldertypes']] = array();
-array_push($select[$_SESSION['tablename']['fold_foldertypes']],"foldertype_id","foldertype_label" );
-$what = "";
-$where ="";
-$arrayPDO = array();
-if(isset($_REQUEST['what']) && !empty($_REQUEST['what']))
-{
-    $what = $_REQUEST['what'];
-    $where = "lower(foldertype_label) like lower(?) ";
-    $arrayPDO = array_merge($arrayPDO, array($what.'%'));
-}
-$list = new list_show();
-$order = 'asc';
-if(isset($_REQUEST['order']) && !empty($_REQUEST['order']))
-{
-    $order = trim($_REQUEST['order']);
-}
-$field = 'foldertype_label';
-if(isset($_REQUEST['order_field']) && !empty($_REQUEST['order_field']))
-{
-    $field = trim($_REQUEST['order_field']);
-}
-
-$orderstr = $list->define_order($order, $field);
-
-if (isset($_REQUEST['start']) && !empty($_REQUEST['start'])) {
-    $parameters .= '&start='.$_REQUEST['start'];
-} else {
-    $_REQUEST['start'] = 0;
-}
-
-$request= new request;
-$tab = $request->PDOselect($select, $where, $arrayPDO, $orderstr, $_SESSION['config']['databasetype'], $limit, false, '', '', '', true, false, false, $_REQUEST['start']);
-
-for($i=0;$i<count($tab);$i++)
-{
-    for ($j=0;$j<count($tab[$i]);$j++)
-    {
-        foreach(array_keys($tab[$i][$j]) as $value)
-        {
-
-            if($tab[$i][$j][$value]=="foldertype_id")
-            {
-                $tab[$i][$j]["foldertype_id"]=$tab[$i][$j]['value'];
-                $tab[$i][$j]["label"]= _ID;
-                $tab[$i][$j]["size"]="20";
-                $tab[$i][$j]["label_align"]="left";
-                $tab[$i][$j]["align"]="left";
-                $tab[$i][$j]["valign"]="bottom";
-                $tab[$i][$j]["show"]=true;
-                $tab[$i][$j]["order"]='foldertype_id';
-            }
-            if($tab[$i][$j][$value]=="foldertype_label")
-            {
-                $tab[$i][$j]["value"]=$request->show_string($tab[$i][$j]['value']);
-                $tab[$i][$j]["foldertype_label"]=$tab[$i][$j]['value'];
-                $tab[$i][$j]["label"]=_DESC;
-                $tab[$i][$j]["size"]="55";
-                $tab[$i][$j]["label_align"]="left";
-                $tab[$i][$j]["align"]="left";
-                $tab[$i][$j]["valign"]="bottom";
-                $tab[$i][$j]["show"]=true;
-                $tab[$i][$j]["order"]='foldertype_label';
-            }
-        }
-    }
-}
-$page_name = "foldertypes";
-$page_name_up = "foldertype_up";
-$page_name_del = "foldertype_del";
-$page_name_val= "";
-$page_name_ban = "";
-$page_name_add = "foldertype_add";
-$label_add = _FOLDERTYPE_ADDITION;
-
-$_SESSION['m_admin']['init'] = true;
-$_SESSION['m_admin']['foldertype']['foldertypeId'] = "";
-$_SESSION['m_admin']['foldertype']['desc'] = "";
-$_SESSION['m_admin']['foldertype']['comment'] = "";
-$_SESSION['m_admin']['foldertype']['doctypes'] = array();
-$_SESSION['m_admin']['load_doctypes'] = true;
-$title = _FOLDERTYPES_LIST." : ".$_SESSION['save_list']['full_count']." "._TYPES;
-$autoCompletionArray = array();
-$autoCompletionArray["list_script_url"] = $_SESSION['config']['businessappurl']."index.php?display=true&module=folder&page=foldertype_list_by_name";
-$autoCompletionArray["number_to_begin"] = 1;
-
-$list->admin_list($tab, $_SESSION['save_list']['full_count'], $title, 'foldertype_id','foldertypes','folder','foldertype_id', true, $page_name_up, $page_name_val, $page_name_ban, $page_name_del, $page_name_add, $label_add, false, false, _ALL_FOLDERTYPES, _FOLDERTYPE, 'briefcase', true, true, false, true, "", true, $autoCompletionArray);
-?>
diff --git a/modules/folder/get_folder_search_index.php b/modules/folder/get_folder_search_index.php
deleted file mode 100755
index 65a26b28efa..00000000000
--- a/modules/folder/get_folder_search_index.php
+++ /dev/null
@@ -1,171 +0,0 @@
-<?php
-/*
-*    Copyright 2008,2009 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/>.
-*/
-
-require('modules'.DIRECTORY_SEPARATOR.'folder'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR."class_admin_foldertypes.php");
-
-$core_tools = new core_tools();
-//here we loading the lang vars
-$core_tools->load_lang();
-$foldertype = new foldertype();
-$content = '';
-
-if(!isset($_REQUEST['foldertype_id']) || empty($_REQUEST['foldertype_id']))
-{
-	echo _FOLDERTYPE.' '._IS_EMPTY;
-	exit();
-}
-
-$indexes = $foldertype->get_indexes($_REQUEST['foldertype_id']);
-$mandatory = $foldertype->get_mandatory_indexes($_REQUEST['foldertype_id']);
-if(count($indexes) > 0)
-{
-	$content .= '<table border="0" border="0" cellpadding="3" width="100%">';
-	$i=0;
-	foreach(array_keys($indexes) as $key)
-	{
-		if($indexes[$key]['type_field'] == 'input')
-		{
-			if($indexes[$key]['type'] == 'string')
-			{
-				if($i%2 != 1 || $i==0) // pair
-				{
-					$content .= '<tr >';
-				}
-
-				$content .= '<td width="25%" align="right"><label for="'.$key.'">'.$indexes[$key]['label'].' :</label></td>';
-				$content .= '<td  width="24%">';
-					$content .= '<input type="text" name="'.$key.'" id="'.$key.'" ';
-					if(isset($_SESSION['folder_search'][$key]) && !empty($_SESSION['folder_search'][$key]))
-					{
-						$content .= 'value="'.$_SESSION['folder_search'][$key].'" ';
-					}
-					$content .= ' />';
-				$content .= '</td>';
-				$content .= '<td width="2%">&nbsp;</td>';
-				if($i%2 == 1 && $i!=0) // impair
-				{
-					$content .=  '</tr>';
-				}
-				else
-				{
-					if($i+1 == count($indexes))
-					{
-						$content .= '<td  colspan="2">&nbsp;</td></tr>';
-					}
-				}
-				$i++;
-			}
-			else
-			{
-				if($i%2 != 1 || $i==0) // pair
-				{
-					$content .= '<tr >';
-				}
-				else
-				{
-						$content .= '<td  colspan="2">&nbsp;</td>';
-					$content .= '</tr>';
-					$content .= '<tr>';
-					$i++;
-				}
-				if($indexes[$key]['type'] == 'date')
-				{
-						$content .= '<td width="25%" align="right"><label for="'.$key.'_start">'.$indexes[$key]['label'].' '._SINCE.':</label></td>';
-						$content .= '<td  width="24%">';
-							$content .= '<input type="text" name="'.$key.'_start" id="'.$key.'_start" ';
-							if(isset($_SESSION['folder_search'][$key.'_start']) && !empty($_SESSION['folder_search'][$key.'_start']))
-							{
-								$content .= 'value="'.$_SESSION['folder_search'][$key.'_start'].'" ';
-							}
-							$content .= 'onclick="showCalender(this);" />';
-						$content .= '</td>';
-						$content .= '<td width="2%">&nbsp;</td>';
-						$content .= '<td width="25%" align="right"><label for="'.$key.'_end">'.$indexes[$key]['label'].' '._FOR.' :</label></td>';
-						$content .= '<td  width="24%">';
-							$content .= '<input type="text" name="'.$key.'_end" id="'.$key.'_end" ';
-							if(isset($_SESSION['folder_search'][$key.'_end']) && !empty($_SESSION['folder_search'][$key.'_end']))
-							{
-								$content .= 'value="'.$_SESSION['folder_search'][$key.'_end'].'" ';
-							}
-							$content .= 'onclick="showCalender(this);" />';
-						$content .= '</td>';
-					$content .= '</tr>';
-				}
-				else
-				{
-					$content .= '<td width="25%" align="right"><label for="'.$key.'_min">'.$indexes[$key]['label'].' '._MIN.':</label></td>';
-						$content .= '<td  width="24%">';
-							$content .= '<input type="text" name="'.$key.'_min" id="'.$key.'_min" ';
-							if(isset($_SESSION['folder_search'][$key.'_min']) && !empty($_SESSION['folder_search'][$key.'_min']))
-							{
-								$content .= 'value="'.$_SESSION['folder_search'][$key.'_min'].'" ';
-							}
-							$content .= ' />';
-						$content .= '</td>';
-						$content .= '<td width="2%">&nbsp;</td>';
-						$content .= '<td width="25%" align="right"><label for="'.$key.'_max">'.$indexes[$key]['label'].' '._MAX.' :</label></td>';
-						$content .= '<td  width="24%">';
-							$content .= '<input type="text" name="'.$key.'_max" id="'.$key.'_max" ';
-							if(isset($_SESSION['folder_search'][$key.'_max']) && !empty($_SESSION['folder_search'][$key.'_max']))
-							{
-								$content .= 'value="'.$_SESSION['folder_search'][$key.'_max'].'" ';
-							}
-							$content .= ' />';
-						$content .= '</td>';
-					$content .= '</tr>';
-				}
-			}
-		}
-		else
-		{
-			if($i%2 != 1 || $i==0) // pair
-			{
-				$content .= '<tr >';
-			}
-
-			$content .= '<td width="25%" align="right"><label for="'.$key.'">'.$indexes[$key]['label'].' :</label></td>';
-			$content .= '<td  width="24%">';
-				$content .= '<select  name="'.$key.'" id="'.$key.'">';
-					$content .= '<option value="">'._CHOOSE.'...</option>';
-					for($j=0; $j<count($indexes[$key]['values']);$j++)
-					{
-						$content .= '<option value="'.$indexes[$key]['values'][$j]['id'].'">'.$indexes[$key]['values'][$j]['label'].'</option>';
-					}
-				$content .='</select>';
-			$content .= '</td>';
-			//$content .= '<td width="2%">&nbsp;</td>';
-			if($i%2 == 1 && $i!=0) // impair
-			{
-				$content .=  '</tr>';
-			}
-			else
-			{
-				if($i+1 == count($indexes))
-				{
-					$content .= '<td  colspan="2">&nbsp;</td></tr>';
-				}
-			}
-			$i++;
-		}
-	}
-}
-echo $content;
-
-
diff --git a/modules/folder/get_folder_view_stats_val.php b/modules/folder/get_folder_view_stats_val.php
deleted file mode 100755
index 0c69bde5438..00000000000
--- a/modules/folder/get_folder_view_stats_val.php
+++ /dev/null
@@ -1,301 +0,0 @@
-<?php
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_list_show.php");
-$core_tools = new core_tools();
-$core_tools->load_lang();
-$db = new Database();
-$req = new request();
-$list = new list_show();
-if(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'foldertype')
-{
-	$stmt = $db->query("SELECT DISTINCT record_id FROM ".$_SESSION['tablename']['history']." WHERE event_type = 'VIEW' AND table_name = ? ", array($_SESSION['tablename']['fold_folders']));
-	if($stmt->rowCount() > 0)
-	{
-		$where = ' f.folders_system_id in (';
-			$arrayPDO = array();
-		while($res = $stmt->fetchObject())
-		{
-            if(!empty($res->record_id)) {
-                $where .= '?,';
-                $arrayPDO = array_merge($arrayPDO, array($res->record_id));
-            }
-		}
-		$where = preg_replace('/,$/', ')', $where);
-		$stmt = $db->query("SELECT ft.foldertype_id, ft.foldertype_label, count(f.folders_system_id) as nbr 
-							FROM  ".$_SESSION['tablename']['fold_folders']." f,  ".$_SESSION['tablename']['fold_foldertypes']." ft 
-							WHERE f.foldertype_id = ft.foldertype_id and ".$where." group by ft.foldertype_label, ft.foldertype_id", $arrayPDO);
-	}
-	$tab=array();
-	while($line = $stmt->fetch(PDO::FETCH_ASSOC))
-	{
-		$temp= array();
-		foreach (array_keys($line) as $resval)
-		{
-			if (!is_int($resval))
-			{
-				array_push($temp,array('column'=>$resval,'value'=>$line[$resval]));
-			}
-		}
-		array_push($tab,$temp);
-	}
-	if (count($tab) > 0)
-	{
-		for ($i=0;$i<count($tab);$i++)
-		{
-			for ($j=0;$j<count($tab[$i]);$j++)
-			{
-				foreach(array_keys($tab[$i][$j]) as $value)
-				{
-					if($tab[$i][$j][$value] == "foldertype_id")
-					{
-						$tab[$i][$j]["label"]=strtoupper(_ID);
-						$tab[$i][$j]["size"]="10";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="center";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-					//	$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-
-					if($tab[$i][$j][$value]=="foldertype_label"){
-						$tab[$i][$j]["label"]=strtoupper(_FOLDERTYPE);
-						$tab[$i][$j]["size"]="50";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="left";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-					//	$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-
-					if($tab[$i][$j][$value]=="nbr"){
-						$tab[$i][$j]["label"]=strtoupper(_NB_FOLDERS);
-						$tab[$i][$j]["size"]="20";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="center";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-					//	$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-				}
-			}
-		}
-		$title = _NB_VIEWED_FOLDERS.' '._TITLE_STATS_CHOICE_FOLDER_TYPE;
-		?>
-		<div align="center"><?php $list->list_simple($tab, $i, $title, 'foldertype_id', 'istats_result', false, '', 'listing spec', '', 400, 500);?></div>
-		<?php
-	}
-} // FIN 
-elseif(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'usergroup')
-{
-	$stmt = $db->query("SELECT g.group_id AS id, g.group_desc AS label, (SELECT COUNT(DISTINCT h.record_id) 
-						FROM ".$_SESSION['tablename']['history']." h INNER JOIN ".$_SESSION['tablename']['usergroup_content']." u ON h.user_id = u.user_id 
-						WHERE h.event_type = 'VIEW' AND h.table_name = ? AND u.group_id = g.group_id ) AS nbr 
-						FROM ".$_SESSION['tablename']['usergroups']." g", array($_SESSION['tablename']['fold_folders']));
-
-	$tab=array();
-	while($line = $stmt->fetch(PDO::FETCH_ASSOC))
-	{
-		$temp= array();
-
-		foreach (array_keys($line) as $resval)
-		{
-			if (!is_int($resval))
-			{
-				array_push($temp,array('column'=>$resval,'value'=>$line[$resval]));
-			}
-		}
-		array_push($tab,$temp);
-	}
-
-	if (count($tab) > 0)
-	{
-		for ($i=0;$i<count($tab);$i++)
-		{
-			for ($j=0;$j<count($tab[$i]);$j++)
-			{
-				foreach(array_keys($tab[$i][$j]) as $value)
-				{
-					if($tab[$i][$j][$value] == "id")
-					{
-						$tab[$i][$j]["label"]=strtoupper(_ID);
-						$tab[$i][$j]["size"]="15";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="center";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-						//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-					if($tab[$i][$j][$value]=="label")
-					{
-						$tab[$i][$j]["label"]=strtoupper(_GROUP);
-						$tab[$i][$j]["size"]="60";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="left";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-					//	$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-
-					if($tab[$i][$j][$value]=="nbr")
-					{
-						$tab[$i][$j]["label"]=strtoupper(_NB_FOLDERS);
-						$tab[$i][$j]["size"]="20";
-						$tab[$i][$j]["label_align"]="left";
-						$tab[$i][$j]["align"]="center";
-						$tab[$i][$j]["valign"]="bottom";
-						$tab[$i][$j]["show"]=true;
-						//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-					}
-				}
-			}
-		}
-		$title = _FOLDER_VIEW_STAT.' '._TITLE_STATS_CHOICE_GROUP;
-		?>
-		<div align="center"><?php $list->list_simple($tab, $i, $title, 'id', 'istats_result', false, '', 'listing spec', '', 400, 500, '', false);?></div>
-		<?php
-	}
-
-}// FIN elseif(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'usergroup')
-elseif(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'user')
-{
-	$whereUser = "AND u.user_id = ''";
-	if(isset($_REQUEST['user']) && $_REQUEST['user'] != '')
-	{
-		$stmt = $db->query("SELECT user_id FROM ".$_SESSION['tablename']['users']." WHERE user_id = ?", array($_REQUEST['user']));
-		if($stmt->rowCount() == 0)
-		{
-			?>
-			<div class="error"><?php echo _USER.' '._UNKNOWN;?></div>
-			<?php
-		}
-		else
-		{
-			$whereUser = "AND u.user_id = :User";
-			$arrayPDO = array(":foldFolder" => $_SESSION['tablename']['fold_folders'], ":User" => $_REQUEST['user']);
-			$stmt = $db->query("SELECT u.user_id, u.lastname ,u.firstname, (SELECT COUNT(DISTINCT h.record_id) 
-								FROM ".$_SESSION['tablename']['history']." h INNER JOIN ".$_SESSION['tablename']['users']." u ON h.user_id = u.user_id 
-								WHERE h.event_type = 'VIEW' AND h.table_name = :foldFolder ".$whereUser.") AS nbr 
-								FROM ".$_SESSION['tablename']['users']." u WHERE u.status != 'SPD' ".$whereUser, $arrayPDO);
-
-			$tab=array();
-			while($line = $stmt->fetch(PDO::FETCH_ASSOC))
-			{
-				$temp= array();
-				foreach (array_keys($line) as $resval)
-				{
-					if (!is_int($resval))
-					{
-						array_push($temp,array('column'=>$resval,'value'=>$line[$resval]));
-					}
-				}
-				array_push($tab,$temp);
-			}
-
-			if (count($tab) > 0)
-			{
-				for ($i=0;$i<count($tab);$i++)
-				{
-					for ($j=0;$j<count($tab[$i]);$j++)
-					{
-						foreach(array_keys($tab[$i][$j]) as $value)
-						{
-							if($tab[$i][$j][$value] == "user_id")
-							{
-								$tab[$i][$j]["label"]=strtoupper(_ID);
-								$tab[$i][$j]["size"]="15";
-								$tab[$i][$j]["label_align"]="left";
-								$tab[$i][$j]["align"]="center";
-								$tab[$i][$j]["valign"]="bottom";
-								$tab[$i][$j]["show"]=true;
-								//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-							}
-
-							if($tab[$i][$j][$value]=="firstname")
-							{
-								$tab[$i][$j]["label"]=_FIRSTNAME_UPPERCASE;
-								$tab[$i][$j]["size"]="20";
-								$tab[$i][$j]["label_align"]="left";
-								$tab[$i][$j]["align"]="left";
-								$tab[$i][$j]["valign"]="bottom";
-								$tab[$i][$j]["show"]=true;
-
-								//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-							}
-							if($tab[$i][$j][$value]=="lastname")
-							{
-								$tab[$i][$j]["label"]=strtoupper(_LASTNAME);
-								$tab[$i][$j]["size"]="20";
-								$tab[$i][$j]["label_align"]="left";
-								$tab[$i][$j]["align"]="left";
-								$tab[$i][$j]["valign"]="bottom";
-								$tab[$i][$j]["show"]=true;
-								//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-							}
-
-							if($tab[$i][$j][$value]=="nbr")
-							{
-								$tab[$i][$j]["label"]=strtoupper(_NB_FOLDERS);
-								$tab[$i][$j]["size"]="20";
-								$tab[$i][$j]["label_align"]="left";
-								$tab[$i][$j]["align"]="center";
-								$tab[$i][$j]["valign"]="bottom";
-								$tab[$i][$j]["show"]=true;
-								//$tab[$i][$j]["value_export"] = $tab[$i][$j]['value'];
-							}
-						}
-					}
-				}
-			}
-			$title = _FOLDER_VIEW_STAT.' '._TITLE_STATS_CHOICE_USER2.' "'.$_REQUEST['user'].'" : '.$line['nbr'];
-			?>
-			<div align="center"><?php $list->list_simple($tab, $i, $title, 'id', 'istats_result', false, '', 'listing spec', '', 400, 500, '', false);?></div>
-			<?php
-		}
-	}
-	else
-	{
-		?>
-			<div class="error"><?php echo _USER.' '._IS_EMPTY;?></div>
-		<?php
-	}
-} //FIN elseif(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'user')
-elseif(isset($_REQUEST['type_report']) && $_REQUEST['type_report'] == 'period')
-{
-	$requestdate = '';
-	$periodTitle = '';
-	$periodTitle2 = '';
-	$arrayPDO = array();
-	if(isset($_REQUEST['date_start']) && $_REQUEST['date_start'] <> ''){
-		$requestdate  .= " AND ".$req->extract_date('event_date')." > :dateStart";
-		$arrayPDO = array_merge($arrayPDO, array(":dateStart" => functions::format_date_db($_REQUEST['date_start'])));
-		$periodTitle.= _TITLE_STATS_DU.' '.$_REQUEST['date_start'].' ';
-		$periodTitle2.= strtolower(_SINCE).' '.$_REQUEST['date_start'].' ';
-	}
-
-	if(isset($_REQUEST['date_fin']) && $_REQUEST['date_fin'] <> ''){
-		$requestdate  .= " AND ".$req->extract_date('event_date')." < :dateFin";
-		$arrayPDO = array_merge($arrayPDO, array(":dateFin" => functions::format_date_db($_REQUEST['date_start'])));
-		$periodTitle.= _TITLE_STATS_DU.' '.$_REQUEST['date_fin'].' ';
-		$periodTitle2.= strtolower(_FOR).' '.$_REQUEST['date_fin'].' ';
-	}
-
-	$arrayPDO = array_merge($arrayPDO, array(":foldFolder" => $_SESSION['tablename']['fold_folders']));
-	$stmt = $db->query("SELECT COUNT(DISTINCT record_id) AS nbr 
-						FROM ".$_SESSION['tablename']['history']." 
-						WHERE event_type = 'VIEW' AND table_name = :foldFolder ".$requestdate, $arrayPDO );
-
-	$line = $stmt->fetch(PDO::FETCH_ASSOC);
-
-	if($line['nbr'] > 0)
-	{
-		$title = _NB_VIEWED_FOLDERS.' '.$periodTitle2.' : '.$line['nbr'];
-	}
-	else
-	{
-		$title = _TITLE_STATS_NO_FOLDERS_VIEW.'<br/>'.$periodTitle;
-	}
-
-	echo '<br/><h2>'.$title.'</h2>';
-}
-
diff --git a/modules/folder/get_foldertypes.php b/modules/folder/get_foldertypes.php
deleted file mode 100755
index aaf3be2cf45..00000000000
--- a/modules/folder/get_foldertypes.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/*
-*    Copyright 2008,2009 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/>.
-*/
-
-$core_tools = new core_tools();
-$core_tools->load_lang();
-
-$content = '';
-if(!isset($_REQUEST['coll_id']) || empty($_REQUEST['coll_id']))
-{
-	echo _COLLECTION.' '._IS_EMPTY;
-	exit();
-}
-
-$db = new Database();
-
-$stmt = $db->query("SELECT foldertype_id,foldertype_label FROM ".$_SESSION['tablename']['fold_foldertypes'] 
-	. " WHERE coll_id = ? order by foldertype_label ASC", array($_REQUEST['coll_id']));
-
-$content = '<option value="">'._CHOOSE_FOLDERTYPE.'</option>';
-while($res = $stmt->fetchObject())
-{var_dump($res);
-	$content .= '<option value="'.$res->foldertype_id
-		.'">'.$res->foldertype_label.'</option>';
-}
-
-echo $content;
-
diff --git a/modules/folder/js/functions.js b/modules/folder/js/functions.js
deleted file mode 100755
index e2b90fc8eae..00000000000
--- a/modules/folder/js/functions.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * Fill the Folder field in indexing page (basing on the subfolder field value)
- *
- * @param path_to_script String Path to the Ajax script
- **/
-
-function valid_viewfolder(url)
-{
-	var type_choice = '';
-	var user_id = '';
-	var datestart = '';
-	var datefin = '';
-	var error = '';
-	var foldertype_item = $('foldertype');
-	var usergroup_item = $('usergroup');
-	var user_item = $('user');
-	var period_item = $('period');
-	if( foldertype_item && foldertype_item.checked)
-	{
-		type_choice = 'foldertype';
-	}
-	else if( usergroup_item && usergroup_item.checked)
-	{
-		type_choice = 'usergroup';
-	}
-	else if(user_item && user_item.checked)
-	{
-		type_choice = 'user';
-		var user_id_item = $('user_id');
-		if(user_id_item)
-		{
-			user_id = user_id_item.value;
-		}
-		if(user_id == '')
-		{
-			error = 'empty_user_id';
-		}
-	}
-	else if(period_item && period_item.checked)
-	{
-		type_choice = 'period';
-		var datestart_item = $('datestart');
-		if(datestart_item)
-		{
-			datestart = datestart_item.value;
-		}
-		var datefin_item = $('datefin');
-		if(datefin_item)
-		{
-			datefin = datefin_item.value;
-		}
-	} else {
-		error = 'empty_type_choice';
-	}
-
-	if(type_choice  != '' && url && error == '' )
-	{
-		$j.ajax({
-			url: url,
-			type: 'POST',
-			data: {
-				type_report : type_choice,
-				user : user_id,
-				date_start : datestart,
-				date_fin : datefin
-			},
-			success: function (answer) {
-				var div_to_fill = $j('#result_folderviewstat');
-				div_to_fill.html(answer);
-			},
-			error: function (error) {
-				alert(error);
-
-			}
-		});
-	}
-}
-
-/**
- * Gets the indexes for a given folder type and fills a div with it
- *
- * @param url String Url to the Ajax script
- * @param foldertype String Folder type identifier
- **/
-function get_folder_index(url, foldertype, id_div)
-{
-	if(url && foldertype) {		
-		$j.ajax({
-			url: url,
-			type: 'POST',
-			data: { 
-				foldertype_id : foldertype
-			},
-			success: function (answer) {
-				var div_to_fill = $j('#'+id_div);
-				if(div_to_fill) {						
-					div_to_fill.html ( answer);
-				}
-			},
-			error: function (error) {
-				alert(error);
-			}
-  		});
-
-	}
-}
-
-function search_change_coll(url, id_coll)
-{
-    if(url && id_coll)
-    {
-        var search_div = $j('#folder_search_div');
-        if(search_div)
-        {
-            search_div.css("display","block");
-        }
-
-        var indexes_div = $j('#opt_indexes');
-        if(indexes_div);
-        {
-            indexes_div.html('');
-        }
-    
-        $j.ajax({
-			url: url,
-			type: 'POST',
-			data: {
-				coll_id : id_coll
-			},
-			success: function (answer) {
-				var select_item = $j('#foldertype_id');
-				if(select_item) {
-					select_item.html(answer);
-				}
-			},
-			error: function (error) {
-				alert(error);
-			}
-
-    	});
-
-    }
-}
-
-
-
-function get_ft_opt_index(url)
-{
-	if(url) {		 
-		$j.ajax({
-			url: url,
-			type: 'POST',
-			data: {},
-			success: function (answer) {
-				var div_to_fill = $j('#opt_index');
-				if(div_to_fill) {
-					div_to_fill.html(answer);
-				}
-
-			},
-			error: function (error) {
-				alert(error);
-			}
-
-		});
-
-
-    }
-}
-
-function checkSubFolder(folderId)
-{
-	if (folderId == "") {
-		$j('#folder_dest_div').css("display","");
-	} else {
-		$j('#folder_dest_div').css("display","none");
-	}
-
-}
-
-
-function tabClick (TabId){
-        
-    var AllTab = $j(".folder-tab");        
-    AllTab.removeClass("folder-tab-open")        
-    var doc = $j("#"+TabId);        
-    doc.addClass("folder-tab-open");
-
-    $j(".frame-targ").css('display','none');
-    $j('#frame-'+TabId).css('display','block');
-
-}
-
-function triggerChosen(){
-	$j('#folder').trigger('chosen:updated');
-}
\ No newline at end of file
diff --git a/modules/folder/lang/en.php b/modules/folder/lang/en.php
deleted file mode 100755
index 61b7fd28acd..00000000000
--- a/modules/folder/lang/en.php
+++ /dev/null
@@ -1,478 +0,0 @@
-<?php
-/*
- *
- *    Copyright 2008,2009 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/>.
- */
-
-/*********************** SERVICES ***********************************/
-if (!defined("_ADMIN_FOLDERTYPES")) {
-    define("_ADMIN_FOLDERTYPES", "Types of folders");
-}
-if (!defined("_ATTACH_DOC_TO_FOLDER")) {
-    define("_ATTACH_DOC_TO_FOLDER", "Attach a mail to a folder");
-}
-if (!defined("_ADMIN_FOLDERTYPES_DESC")) {
-    define("_ADMIN_FOLDERTYPES_DESC", "Administrate folder's types. For each type, define the linked qualifiers and the mandatory folder's types for the folder completeness.");
-}
-
-/*********************** Menu ***********************************/
-if (!defined("_FOLDER_SEARCH")) {
-    define("_FOLDER_SEARCH", "Search a folder");
-}
-if (!defined("_SALARY_SHEET")) {
-    define("_SALARY_SHEET", "Folder card");
-}
-if (!defined("_FOLDER_OUT")) {
-    define("_FOLDER_OUT", "Removed from the archives");
-}
-
-//////////////Research folder
-if (!defined("_SELECT_FOLDER_TITLE")) {
-    define("_SELECT_FOLDER_TITLE", "Folder selection");
-}
-if (!defined("_FOLDER_NUM")) {
-    define("_FOLDER_NUM", "Folder number");
-}
-if (!defined("_COMPLETE")) {
-    define("_COMPLETE", "Complete");
-}
-if (!defined("_INCOMPLETE")) {
-    define("_INCOMPLETE", "Incomplete");
-}
-if (!defined("_FOUND_FOLDER")) {
-    define("_FOUND_FOLDER", "Found folders");
-}
-if (!defined("_CHOOSE")) {
-    define("_CHOOSE", "Choose");
-}
-if (!defined("_ADV_SEARCH_FOLDER_TITLE")) {
-    define("_ADV_SEARCH_FOLDER_TITLE", "Folder search");
-}
-if (!defined("_SEARCH_ADV_FOLDER")) {
-    define("_SEARCH_ADV_FOLDER", "Folder search");
-}
-if (!defined("_NEW_SEARCH")) {
-    define("_NEW_SEARCH", "Delete the criterion");
-}
-if (!defined("_SELECT_FOLDER")) {
-    define("_SELECT_FOLDER", "Folder selection");
-}
-if (!defined("_CREATE_FOLDER")) {
-    define("_CREATE_FOLDER", "Create a folder");
-}
-if (!defined("_CREATE_FOLDER2")) {
-    define("_CREATE_FOLDER2", "Create a folder");
-}
-if (!defined("_FOLDER")) {
-    define("_FOLDER", "Folder");
-}
-if (!defined("_MODIFY_FOLDER")) {
-    define("_MODIFY_FOLDER", "Modify folder's index");
-}
-if (!defined("_FOLDERID")) {
-    define("_FOLDERID", "Folder's number");
-}
-if (!defined("_FOLDERSYSTEMID")) {
-    define("_FOLDERSYSTEMID", "Maarch's system number");
-}
-if (!defined("_FOLDERID_LONG")) {
-    define("_FOLDERID_LONG", "Folder's ID");
-}
-if (!defined("_FOLDER_DESTINATION_QUESTION")) {
-    define("_FOLDER_DESTINATION_QUESTION", "Do you want to make this folder only accessible to your department ?");
-}
-if (!defined("_FOLDER_DESTINATION_SHORT")) {
-    define("_FOLDER_DESTINATION_SHORT", "Department folder");
-}
-if (!defined("_FOLDERNAME")) {
-    define("_FOLDERNAME", "Folder's name");
-}
-if (!defined("_FOLDERDATE")) {
-    define("_FOLDERDATE", "Date of creation");
-}
-if (!defined("_FOLDERDATE_START")) {
-    define("_FOLDERDATE_START", "Beginning date of creation ");
-}
-if (!defined("_FOLDERDATE_END")) {
-    define("_FOLDERDATE_END", "Ending date of creation ");
-}
-if (!defined("_FOLDERHASNODOC")) {
-    define("_FOLDERHASNODOC", "No attachment for this folder");
-}
-if (!defined("_OTHER_INFOS")) {
-    define("_OTHER_INFOS", "Other information : folder's history and missing files for the completeness");
-}
-if (!defined("_SEARCH_FOLDER")) {
-    define("_SEARCH_FOLDER", "Folder search");
-}
-if (!defined("_SELECTED_FOLDER")) {
-    define("_SELECTED_FOLDER", "Selected folder");
-}
-if (!defined("_FOUND_FOLDERS")) {
-    define("_FOUND_FOLDERS", "Found folders");
-}
-if (!defined("_FOLDERTYPE_LABEL")) {
-    define("_FOLDERTYPE_LABEL", "Folder wording");
-}
-if (!defined("_INFOS_FOLDERS")) {
-    define("_INFOS_FOLDERS", "Folder's information");
-}
-if (!defined("_CHOOSE_FOLDER")) {
-    define("_CHOOSE_FOLDER", "Choose a folder");
-}
-if (!defined("_ON_FOLDER_NUM")) {
-    define("_ON_FOLDER_NUM", "On the folder number");
-}
-
-//////////////create_folder.php
-if (!defined("_CREATE_THE_FOLDER")) {
-    define("_CREATE_THE_FOLDER", "Create the folder");
-}
-if (!defined("_THE_FOLDER")) {
-    define("_THE_FOLDER", "The folder");
-}
-if (!defined("_NEW_EMPLOYEES_LIST")) {
-    define("_NEW_EMPLOYEES_LIST", "List of the new collaborators");
-}
-if (!defined("_FOLDERS_LIST")) {
-    define("_FOLDERS_LIST", "folders' list");
-}
-if (!defined("_FOLDERS")) {
-    define("_FOLDERS", "Folders");
-}
-if (!defined("_FOLDERS_COMMENT")) {
-    define("_FOLDERS_COMMENT", "Folders");
-}
-if (!defined("_CHOOSE2")) {
-    define("_CHOOSE2", "Choose");
-}
-if (!defined("_IS_MANDATORY")) {
-    define("_IS_MANDATORY", "Is mandatory");
-}
-if (!defined("_FOLDER_CREATION")) {
-    define("_FOLDER_CREATION", "Folder's creation");
-}
-
-///////////////delete_popup.php
-if (!defined("_DEL_FOLDER_NUM")) {
-    define("_DEL_FOLDER_NUM", "Deletion of the folder number");
-}
-if (!defined("_DEL_FOLDER")) {
-    define("_DEL_FOLDER", "Delete the folder");
-}
-
-//Step in add_batch.php for physical_archive
-if (!defined("_STEP_ONE")) {
-    define("_STEP_ONE", "1 - Choose a folder");
-}
-
-/////////create folder
-if (!defined("_CHOOSE_SOCIETY")) {
-    define("_CHOOSE_SOCIETY", "Choose a company");
-}
-if (!defined("_THE_SOCIETY")) {
-    define("_THE_SOCIETY", "The company ");
-}
-if (!defined("_MISSING_DOC")) {
-    define("_MISSING_DOC", "Missing attachment(s)");
-}
-if (!defined("_MISSING_DOC2")) {
-    define("_MISSING_DOC2", "Missing attachment(s)");
-}
-if (!defined("_PLEASE_SELECT_FOLDER")) {
-    define("_PLEASE_SELECT_FOLDER", "You have to select a folder");
-}
-if (!defined("_FOLDER_HISTORY")) {
-    define("_FOLDER_HISTORY", "Folder's history");
-}
-if (!defined("_CHOOSE_FOLDERTYPE")) {
-    define("_CHOOSE_FOLDERTYPE", "Choose a type of folder");
-}
-if (!defined("_BROWSE_BY_FOLDER")) {
-    define("_BROWSE_BY_FOLDER", "Folder search");
-}
-if (!defined("_CHAR_ERROR")) {
-    define("_CHAR_ERROR", "The ID cannot contain the following characters : ", "");
-}
-
-/*************************** Folder types management *****************/
-if (!defined("_FOLDERTYPE_ADDITION")) {
-    define("_FOLDERTYPE_ADDITION", "Add a type of folder");
-}
-if (!defined("_FOLDERTYPE_MODIFICATION")) {
-    define("_FOLDERTYPE_MODIFICATION", "Modification of the folder's type");
-}
-if (!defined("_FOLDERTYPES_LIST")) {
-    define("_FOLDERTYPES_LIST", "Folder types list");
-}
-if (!defined("_TYPES")) {
-    define("_TYPES", "type(s)");
-}
-if (!defined("_ALL_FOLDERTYPES")) {
-    define("_ALL_FOLDERTYPES", "All of the types");
-}
-if (!defined("_FOLDERTYPE")) {
-    define("_FOLDERTYPE", "Folder type");
-}
-if (!defined("_FOLDERTYPE_MISSING")) {
-    define("_FOLDERTYPE_MISSING", "Missing folder type");
-}
-
-/************************** employees file ***************************/
-if (!defined("_ARCHIVED_DOC")) {
-    define("_ARCHIVED_DOC", "*Archived files");
-}
-if (!defined("_SEND_RELANCE_MAIL")) {
-    define("_SEND_RELANCE_MAIL", "Send reminder mail");
-}
-if (!defined("_DIRECTION_DEP")) {
-    define("_DIRECTION_DEP", "Department / direction");
-}
-if (!defined("_DEP_AGENCY")) {
-    define("_DEP_AGENCY", "Agency/ department");
-}
-if (!defined("_DELETE_FOLDER")) {
-    define("_DELETE_FOLDER", "Delete a folder");
-}
-if (!defined("_DELETE_FOLDER_NOTES1")) {
-    define("_DELETE_FOLDER_NOTES1", "The folder deletion is irreversible, its files are saved but they're not available to consultation.");
-}
-if (!defined("_REALLY_DELETE_FOLDER")) {
-    define("_REALLY_DELETE_FOLDER", "Do you want to remove the folder ?");
-}
-if (!defined("_DELETE_FOLDER_NOTES2")) {
-    define("_DELETE_FOLDER_NOTES2", "To definitely remove the folder, enter EFFACER / ERASE (in capital letters) on the box below");
-}
-if (!defined("_DELETE_FOLDER_NOTES3")) {
-    define("_DELETE_FOLDER_NOTES3", "The folder will be erased after validation.");
-}
-if (!defined("_DELETE_FOLDER_NOTES4")) {
-    define("_DELETE_FOLDER_NOTES4", "The folder can not be deleted because of a wrong confirmation");
-}
-if (!defined("_DELETE_FOLDER_NOTES5")) {
-    define("_DELETE_FOLDER_NOTES5", "The folder is now deleted from the database.");
-}
-if (!defined("_FOLDER_INDEX_MODIF")) {
-    define("_FOLDER_INDEX_MODIF", "Folder's index modification");
-}
-if (!defined("_FOLDERS_OUT")) {
-    define("_FOLDERS_OUT", "Folders removed from the archives");
-}
-
-///////////////// Class_admin_foldertype
-//CUSTOM
-if (!defined("_MANDATORY_DOCTYPES_COMP")) {
-    define("_MANDATORY_DOCTYPES_COMP", "The folder's types are mandatory for the folder completeness");
-}
-if (!defined("_FOLDER_ID")) {
-    define("_FOLDER_ID", "Folder's ID");
-}
-if (!defined("_INDEX_FOR_FOLDERTYPES")) {
-    define("_INDEX_FOR_FOLDERTYPES", "Possible index for the folder types");
-}
-if (!defined("_SELECTED_DOCTYPES")) {
-    define("_SELECTED_DOCTYPES", "Selected folder types");
-}
-if (!defined("_SHOW_FOLDER")) {
-    define("_SHOW_FOLDER", "Folder form");
-}
-if (!defined("_FOLDERTYPE_UPDATE")) {
-    define("_FOLDERTYPE_UPDATE", "Modified folder type");
-}
-if (!defined("_FOLDER_ATTACH")) {
-    define("_FOLDER_ATTACH", "Linked to a folder");
-}
-if (!defined("_INCOMPATIBILITY_MARKET_PROJECT")) {
-    define("_INCOMPATIBILITY_MARKET_PROJECT", "Incompatibility between the folder and the sub-folder");
-}
-if (!defined("_FOLDER_VIEW_STAT")) {
-    define("_FOLDER_VIEW_STAT", "Number of read folders");
-}
-if (!defined("_FOLDER_VIEW_STAT_DESC")) {
-    define("_FOLDER_VIEW_STAT_DESC", "Number of read folders");
-}
-if (!defined("_FOLDER_HISTORY_STAT")) {
-    define("_FOLDER_HISTORY_STAT", "History of a folder");
-}
-if (!defined("_FOLDER_HISTORY_STAT_DESC")) {
-    define("_FOLDER_HISTORY_STAT_DESC", "History of a folder");
-}
-if (!defined("_VIEW_FOLDER")) {
-    define("_VIEW_FOLDER", "Folder view");
-}
-
-////////// Reports label
-if (!defined("_TITLE_STATS_CHOICE_FOLDER_TYPE")) {
-    define("_TITLE_STATS_CHOICE_FOLDER_TYPE", "By folder type");
-}
-if (!defined("_TITLE_STATS_CHOICE_GROUP")) {
-    define("_TITLE_STATS_CHOICE_GROUP", "By users' group");
-}
-if (!defined("_TITLE_STATS_CHOICE_USER")) {
-    define("_TITLE_STATS_CHOICE_USER", "For one user");
-}
-if (!defined("_TITLE_STATS_CHOICE_USER2")) {
-    define("_TITLE_STATS_CHOICE_USER2", "by the user");
-}
-if (!defined("_TITLE_STATS_NO_FOLDERS_VIEW")) {
-    define("_TITLE_STATS_NO_FOLDERS_VIEW", "No read folders fo this period");
-}
-if (!defined("_STATS_ERROR_CHOSE_USER")) {
-    define("_STATS_ERROR_CHOSE_USER", "You have to choose an existing user.");
-}
-if (!defined("_NB_FOLDERS")) {
-    define("_NB_FOLDERS", "Number of folders");
-}
-if (!defined("_NB_VIEWED_FOLDERS")) {
-    define("_NB_VIEWED_FOLDERS", "Number of read folders");
-}
-if (!defined("_TITLE_STATS_CHOICE_ACTION")) {
-    define("_TITLE_STATS_CHOICE_ACTION", "By type of action");
-}
-if (!defined("_ACTION_TYPE")) {
-    define("_ACTION_TYPE", "Action type");
-}
-if (!defined("_NO_STRUCTURE_ATTACHED2")) {
-    define("_NO_STRUCTURE_ATTACHED2", "There is no document type attached to any document folder");
-}
-if (!defined("_FOLDER_ADDED")) {
-    define("_FOLDER_ADDED", "New created folder");
-}
-if (!defined("_FOLDER_DETAILLED_PROPERTIES")) {
-    define("_FOLDER_DETAILLED_PROPERTIES", "Folder information");
-}
-if (!defined("_FOLDER_PROPERTIES")) {
-    define("_FOLDER_PROPERTIES", "Folder properties");
-}
-if (!defined("_SYSTEM_ID")) {
-    define("_SYSTEM_ID", "System ID ");
-}
-if (!defined("_MODIFICATION_DATE")) {
-    define("_MODIFICATION_DATE", "Modification date");
-}
-if (!defined("_UPDATE_FOLDER")) {
-    define("_UPDATE_FOLDER", "Modify information");
-}
-if (!defined("_FOLDER_INDEX_UPDATED")) {
-    define("_FOLDER_INDEX_UPDATED", "Modified folder's Index");
-}
-if (!defined("_FOLDER_UPDATED")) {
-    define("_FOLDER_UPDATED", "Folder's update done");
-}
-if (!defined("_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED")) {
-    define("_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED", "All the mails from this folder and all the sub folders will also be erased !");
-}
-if (!defined("_STRING")) {
-    define("_STRING", "Characters chain");
-}
-if (!defined("_INTEGER")) {
-    define("_INTEGER", "Entire");
-}
-if (!defined("_FLOAT")) {
-    define("_FLOAT", "Floating");
-}
-if (!defined("_DATE")) {
-    define("_DATE", "Date");
-}
-if (!defined("_MAX")) {
-    define("_MAX", "maximum");
-}
-if (!defined("_MIN")) {
-    define("_MIN", "minimum");
-}
-if (!defined("_FOLDER_OR_SUBFOLDER")) {
-    define("_FOLDER_OR_SUBFOLDER", "Folder/sub folder");
-}
-if (!defined("_ERROR_COMPATIBILITY_FOLDER")) {
-    define("_ERROR_COMPATIBILITY_FOLDER", "Compatibility issue between the folder and the folder type");
-}
-if (!defined("_ADDED_TO_FOLDER")) {
-    define("_ADDED_TO_FOLDER", " Add to the folder");
-}
-if (!defined("_DELETED_FROM_FOLDER")) {
-    define("_DELETED_FROM_FOLDER", " Erased from the folder");
-}
-if (!defined("_CHOOSE_PARENT_FOLDER")) {
-    define("_CHOOSE_PARENT_FOLDER", "Associate this folder to an existing one");
-}
-if (!defined("_FOLDER_PARENT")) {
-    define("_FOLDER_PARENT", "Relative folder");
-}
-if (!defined("_FOLDER_PARENT_DESC")) {
-    define("_FOLDER_PARENT_DESC", "you can choose to create a sub folder related to a folder with the same type. There is only two levels : folder and subfolder.");
-}
-if (!defined("_THIS_FOLDER")) {
-    define("_THIS_FOLDER", "This folder");
-}
-if (!defined("_ALL_FOLDERS")) {
-    define("_ALL_FOLDERS", "All folders");
-}
-if (!defined("_FOLDER_DELETED")) {
-    define("_FOLDER_DELETED", "Erased folder");
-}
-if (!defined("_FREEZE_FOLDER_SERVICE")) {
-    define("_FREEZE_FOLDER_SERVICE", "Freeze and unfreeze folders");
-}
-if (!defined("_FREEZE_FOLDER")) {
-    define("_FREEZE_FOLDER", "Freeze the folder");
-}
-if (!defined("_UNFREEZE_FOLDER")) {
-    define("_UNFREEZE_FOLDER", "Unfreeze the folder");
-}
-if (!defined("_CLOSE_FOLDER")) {
-    define("_CLOSE_FOLDER", "Close the folder");
-}
-if (!defined("_FOLDER_CLOSED")) {
-    define("_FOLDER_CLOSED", "Closed folder");
-}
-if (!defined("_FROZEN_FOLDER")) {
-    define("_FROZEN_FOLDER", "Folder frost");
-}
-if (!defined("_UNFROZEN_FOLDER")) {
-    define("_UNFROZEN_FOLDER", "Folder thaw");
-}
-if (!defined("_REALLY_FREEZE_THIS_FOLDER")) {
-    define("_REALLY_FREEZE_THIS_FOLDER", "Are you sure to frost this folder");
-}
-if (!defined("_REALLY_CLOSE_THIS_FOLDER")) {
-    define("_REALLY_CLOSE_THIS_FOLDER", "Are you sure to want to enclose this folder?");
-}
-if (!defined("_SUBFOLDER")) {
-    define("_SUBFOLDER", "Sub folder");
-}
-if (!defined("_VIEW_FOLDER_TREE")) {
-    define("_VIEW_FOLDER_TREE", "Read a folder");
-}
-if (!defined("_SEARCH_FOLDER_TREE")) {
-    define("_SEARCH_FOLDER_TREE", "Search folders");
-}
-if (!defined("_NB_DOCS_IN_FOLDER")) {
-    define("_NB_DOCS_IN_FOLDER", "Files number");
-}
-if (!defined("_REDIRECT_ALL_DOCUMENTS_IN_FOLDER")) {
-    define("_REDIRECT_ALL_DOCUMENTS_IN_FOLDER", "Redirect all folder's mails");
-}
-if (!defined("_CHOOSE_ONE_FOLDER")) {
-    define("_CHOOSE_ONE_FOLDER", "Choose one folder at least");
-}
-if (!defined("_MUST_CHOOSE_DEP_OR_USER")) {
-    define("_MUST_CHOOSE_DEP_OR_USER", "You have to select a department or an user!");
-}
-if (!defined('_LABEL')) {
-    define("_LABEL", "Wording");
-}
diff --git a/modules/folder/lang/fr.php b/modules/folder/lang/fr.php
deleted file mode 100755
index f8c0d12c496..00000000000
--- a/modules/folder/lang/fr.php
+++ /dev/null
@@ -1,482 +0,0 @@
-<?php
-/*
- *
- *    Copyright 2008,2009 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/>.
- */
-
-/*********************** SERVICES ***********************************/
-if (!defined("_ADMIN_FOLDERTYPES")) {
-    define("_ADMIN_FOLDERTYPES", "Types de dossier");
-}
-if (!defined("_ATTACH_DOC_TO_FOLDER")) {
-    define("_ATTACH_DOC_TO_FOLDER", "Rattacher un courrier à un dossier");
-}
-if (!defined("_ADMIN_FOLDERTYPES_DESC")) {
-    define("_ADMIN_FOLDERTYPES_DESC", "Administrer les types de dossier. Définir pour chaque type les qualificateurs liés et les types de document obligatoires pour la complétude du dossier.");
-}
-
-/*********************** Menu ***********************************/
-if (!defined("_FOLDER_SEARCH")) {
-    define("_FOLDER_SEARCH", "Rechercher un dossier");
-}
-if (!defined("_SALARY_SHEET")) {
-    define("_SALARY_SHEET", "Fiche dossier");
-}
-if (!defined("_FOLDER_OUT")) {
-    define("_FOLDER_OUT", "Désarchivage");
-}
-
-//////////////Recherche dossier
-if (!defined("_SELECT_FOLDER_TITLE")) {
-    define("_SELECT_FOLDER_TITLE", "Sélection du dossier");
-}
-if (!defined("_FOLDER_NUM")) {
-    define("_FOLDER_NUM", "N° Dossier");
-}
-if (!defined("_COMPLETE")) {
-    define("_COMPLETE", "Complet");
-}
-if (!defined("_INCOMPLETE")) {
-    define("_INCOMPLETE", "Incomplet");
-}
-if (!defined("_FOUND_FOLDER")) {
-    define("_FOUND_FOLDER", "dossier(s) trouvé(s)");
-}
-if (!defined("_CHOOSE")) {
-    define("_CHOOSE", "Choisir");
-}
-if (!defined("_ADV_SEARCH_FOLDER_TITLE")) {
-    define("_ADV_SEARCH_FOLDER_TITLE", "Recherche de dossier");
-}
-if (!defined("_SEARCH_ADV_FOLDER")) {
-    define("_SEARCH_ADV_FOLDER", "Recherche de dossier");
-}
-if (!defined("_NEW_SEARCH")) {
-    define("_NEW_SEARCH", "Effacer les critères");
-}
-if (!defined("_SELECT_FOLDER")) {
-    define("_SELECT_FOLDER", "Sélection Dossier");
-}
-if (!defined("_CREATE_FOLDER")) {
-    define("_CREATE_FOLDER", "Créer un dossier");
-}
-if (!defined("_CREATE_FOLDER2")) {
-    define("_CREATE_FOLDER2", "Créer Dossier");
-}
-if (!defined("_FOLDER")) {
-    define("_FOLDER", "Dossier");
-}
-if (!defined("_MODIFY_FOLDER")) {
-    define("_MODIFY_FOLDER", "Modifier les index d'un dossier");
-}
-if (!defined("_FOLDERID")) {
-    define("_FOLDERID", "Numéro du Dossier");
-}
-if (!defined("_FOLDERSYSTEMID")) {
-    define("_FOLDERSYSTEMID", "Numéro système Maarch");
-}
-if (!defined("_FOLDERID_LONG")) {
-    define("_FOLDERID_LONG", "Identifiant du dossier");
-}
-if (!defined("_FOLDER_DESTINATION_QUESTION")) {
-    define("_FOLDER_DESTINATION_QUESTION", "Rendre ce dossier uniquement accessible à votre entité ?");
-}
-if (!defined("_FOLDER_DESTINATION_SHORT")) {
-    define("_FOLDER_DESTINATION_SHORT", "Dossier de service");
-}
-if (!defined("_FOLDERNAME")) {
-    define("_FOLDERNAME", "Nom du Dossier");
-}
-if (!defined("_FOLDERDATE")) {
-    define("_FOLDERDATE", "Date de création");
-}
-if (!defined("_FOLDERDATE_START")) {
-    define("_FOLDERDATE_START", "Date de création début ");
-}
-if (!defined("_FOLDERDATE_END")) {
-    define("_FOLDERDATE_END", "Date de création fin ");
-}
-if (!defined("_FOLDERHASNODOC")) {
-    define("_FOLDERHASNODOC", "Aucune pièce pour ce dossier");
-}
-if (!defined("_OTHER_INFOS")) {
-    define("_OTHER_INFOS", "Autres informations : historique du dossier et pièces manquantes pour la complétude");
-}
-if (!defined("_SEARCH_FOLDER")) {
-    define("_SEARCH_FOLDER", "Recherche dossier");
-}
-if (!defined("_SELECTED_FOLDER")) {
-    define("_SELECTED_FOLDER", "Dossier sélectionné");
-}
-if (!defined("_FOUND_FOLDERS")) {
-    define("_FOUND_FOLDERS", "Dossiers trouvés");
-}
-if (!defined("_FOLDERTYPE_LABEL")) {
-    define("_FOLDERTYPE_LABEL", "Libellé dossier");
-}
-if (!defined("_INFOS_FOLDERS")) {
-    define("_INFOS_FOLDERS", "Infos dossier");
-}
-if (!defined("_CHOOSE_FOLDER")) {
-    define("_CHOOSE_FOLDER", "Choisissez un dossier");
-}
-if (!defined("_ON_FOLDER_NUM")) {
-    define("_ON_FOLDER_NUM", " sur le dossier n°");
-}
-
-//////////////create_folder.php
-if (!defined("_CREATE_THE_FOLDER")) {
-    define("_CREATE_THE_FOLDER", "Créer le dossier");
-}
-if (!defined("_THE_FOLDER")) {
-    define("_THE_FOLDER", "Le dossier");
-}
-if (!defined("_NEW_EMPLOYEES_LIST")) {
-    define("_NEW_EMPLOYEES_LIST", "Liste des nouveaux collaborateurs");
-}
-if (!defined("_FOLDERS_LIST")) {
-    define("_FOLDERS_LIST", "Liste de dossiers");
-}
-if (!defined("_FOLDERS")) {
-    define("_FOLDERS", "dossiers");
-}
-if (!defined("_FOLDERS_COMMENT")) {
-    define("_FOLDERS_COMMENT", "Dossiers");
-}
-if (!defined("_CHOOSE2")) {
-    define("_CHOOSE2", "Choisissez");
-}
-if (!defined("_IS_MANDATORY")) {
-    define("_IS_MANDATORY", "est obligatoire");
-}
-if (!defined("_FOLDER_CREATION")) {
-    define("_FOLDER_CREATION", "Création du dossier");
-}
-
-///////////////delete_popup.php
-if (!defined("_DEL_FOLDER_NUM")) {
-    define("_DEL_FOLDER_NUM", "Suppression du dossier n°");
-}
-if (!defined("_DEL_FOLDER")) {
-    define("_DEL_FOLDER", "Supprimer le dossier");
-}
-
-//Step in add_batch.php for physical_archive
-if (!defined("_STEP_ONE")) {
-    define("_STEP_ONE", "1 - Choisissez un dossier");
-}
-
-/////////create folder
-if (!defined("_CHOOSE_SOCIETY")) {
-    define("_CHOOSE_SOCIETY", "Choisissez une société");
-}
-if (!defined("_THE_SOCIETY")) {
-    define("_THE_SOCIETY", "La société ");
-}
-if (!defined("_MISSING_DOC")) {
-    define("_MISSING_DOC", "Pièces manquantes");
-}
-if (!defined("_MISSING_DOC2")) {
-    define("_MISSING_DOC2", "Pièce(s) manquante(s)");
-}
-if (!defined("_PLEASE_SELECT_FOLDER")) {
-    define("_PLEASE_SELECT_FOLDER", "Vous devez sélectionner un dossier");
-}
-if (!defined("_FOLDER_HISTORY")) {
-    define("_FOLDER_HISTORY", "Historique dossier");
-}
-if (!defined("_CHOOSE_FOLDERTYPE")) {
-    define("_CHOOSE_FOLDERTYPE", "Choisissez un type de dossier");
-}
-if (!defined("_BROWSE_BY_FOLDER")) {
-    define("_BROWSE_BY_FOLDER", "Recherche Dossier");
-}
-if (!defined("_CHAR_ERROR")) {
-    define("_CHAR_ERROR", "L'identifiant ne peut pas contenir les caractères suivants : ", "");
-}
-
-/*************************** Foldertypes management *****************/
-if (!defined("_FOLDERTYPE_ADDITION")) {
-    define("_FOLDERTYPE_ADDITION", "Ajout type de dossier");
-}
-if (!defined("_FOLDERTYPE_MODIFICATION")) {
-    define("_FOLDERTYPE_MODIFICATION", "Modification du type de dossier");
-}
-if (!defined("_FOLDERTYPES_LIST")) {
-    define("_FOLDERTYPES_LIST", "Liste des types de dossier");
-}
-if (!defined("_TYPES")) {
-    define("_TYPES", "type(s)");
-}
-if (!defined("_ALL_FOLDERTYPES")) {
-    define("_ALL_FOLDERTYPES", "Tous les types");
-}
-if (!defined("_FOLDERTYPE")) {
-    define("_FOLDERTYPE", "Type de dossier");
-}
-if (!defined("_FOLDERTYPE_MISSING")) {
-    define("_FOLDERTYPE_MISSING", "Type de dossier manquant");
-}
-
-/************************** Fiche salarie ***************************/
-
-if (!defined("_ARCHIVED_DOC")) {
-    define("_ARCHIVED_DOC", "Pièces archivées");
-}
-if (!defined("_SEND_RELANCE_MAIL")) {
-    define("_SEND_RELANCE_MAIL", "Envoyer un mail de relance");
-}
-if (!defined("_DIRECTION_DEP")) {
-    define("_DIRECTION_DEP", "Direction/Dpt");
-}
-if (!defined("_DEP_AGENCY")) {
-    define("_DEP_AGENCY", "Service/agence");
-}
-if (!defined("_DELETE_FOLDER")) {
-    define("_DELETE_FOLDER", "Supprimer un dossier");
-}
-if (!defined("_DELETE_FOLDER_NOTES1")) {
-    define("_DELETE_FOLDER_NOTES1", "La suppression de dossier est irréversible, les pièces de ce dernier seront conservées mais ne seront plus accessibles en consultation.");
-}
-if (!defined("_REALLY_DELETE_FOLDER")) {
-    define("_REALLY_DELETE_FOLDER", "Voulez vous supprimer le dossier ?");
-}
-if (!defined("_DELETE_FOLDER_NOTES2")) {
-    define("_DELETE_FOLDER_NOTES2", "Pour supprimer définitivement le dossier, saisissez EFFACER (en lettres majuscules) dans la case ci-dessous.");
-}
-if (!defined("_DELETE_FOLDER_NOTES3")) {
-    define("_DELETE_FOLDER_NOTES3", "Le dossier sera effacé après cette validation.");
-}
-if (!defined("_DELETE_FOLDER_NOTES4")) {
-    define("_DELETE_FOLDER_NOTES4", "Le dossier ne peut être supprimé car la confirmation est erronée");
-}
-if (!defined("_DELETE_FOLDER_NOTES5")) {
-    define("_DELETE_FOLDER_NOTES5", "Le dossier est désormais supprimé de la base de données.");
-}
-if (!defined("_FOLDER_INDEX_MODIF")) {
-    define("_FOLDER_INDEX_MODIF", "Modification des index du dossier");
-}
-if (!defined("_FOLDERS_OUT")) {
-    define("_FOLDERS_OUT", "Dossiers désarchivés");
-}
-
-///////////////// Class_admin_foldertype
-//CUSTOM
-if (!defined("_MANDATORY_DOCTYPES_COMP")) {
-    define("_MANDATORY_DOCTYPES_COMP", "Types de document obligatoire pour la complétude du dossier");
-}
-if (!defined("_FOLDER_ID")) {
-    define("_FOLDER_ID", "Identifiant dossier");
-}
-if (!defined("_INDEX_FOR_FOLDERTYPES")) {
-    define("_INDEX_FOR_FOLDERTYPES", "Index possibles pour les types de dossier");
-}
-if (!defined("_SELECTED_DOCTYPES")) {
-    define("_SELECTED_DOCTYPES", "Types de document selectionnés");
-}
-if (!defined("_SHOW_FOLDER")) {
-    define("_SHOW_FOLDER", "Fiche dossier");
-}
-if (!defined("_FOLDERTYPE_UPDATE")) {
-    define("_FOLDERTYPE_UPDATE", "Type de dossier modifié");
-}
-if (!defined("_FOLDER_ATTACH")) {
-    define("_FOLDER_ATTACH", "Rattachement à un dossier");
-}
-if (!defined("_INCOMPATIBILITY_MARKET_PROJECT")) {
-    define("_INCOMPATIBILITY_MARKET_PROJECT", "Incompatibilité entre le Dossier et le Sous-dossier");
-}
-if (!defined("_FOLDER_VIEW_STAT")) {
-    define("_FOLDER_VIEW_STAT", "Nombre de dossiers consultés");
-}
-if (!defined("_FOLDER_VIEW_STAT_DESC")) {
-    define("_FOLDER_VIEW_STAT_DESC", "Nombre de dossiers consultés");
-}
-if (!defined("_FOLDER_HISTORY_STAT")) {
-    define("_FOLDER_HISTORY_STAT", "Historique d'un dossier");
-}
-if (!defined("_FOLDER_HISTORY_STAT_DESC")) {
-    define("_FOLDER_HISTORY_STAT_DESC", "Historique d'un dossier");
-}
-if (!defined("_VIEW_FOLDER")) {
-    define("_VIEW_FOLDER", "Visualisation du dossier");
-}
-
-////////// Reports label
-if (!defined("_TITLE_STATS_CHOICE_FOLDER_TYPE")) {
-    define("_TITLE_STATS_CHOICE_FOLDER_TYPE", "Par type de dossier");
-}
-if (!defined("_TITLE_STATS_CHOICE_GROUP")) {
-    define("_TITLE_STATS_CHOICE_GROUP", "Par groupe d'utilisateurs");
-}
-if (!defined("_TITLE_STATS_CHOICE_USER")) {
-    define("_TITLE_STATS_CHOICE_USER", "Pour un utilisateur");
-}
-if (!defined("_TITLE_STATS_CHOICE_USER2")) {
-    define("_TITLE_STATS_CHOICE_USER2", "par l'utilisateur");
-}
-if (!defined("_TITLE_STATS_NO_FOLDERS_VIEW")) {
-    define("_TITLE_STATS_NO_FOLDERS_VIEW", "Aucun dossier consulté pour la période");
-}
-if (!defined("_STATS_ERROR_CHOSE_USER")) {
-    define("_STATS_ERROR_CHOSE_USER", "Il faut choisir un utilisateur existant.");
-}
-if (!defined("_NB_FOLDERS")) {
-    define("_NB_FOLDERS", "Nombre de dossiers");
-}
-if (!defined("_NB_VIEWED_FOLDERS")) {
-    define("_NB_VIEWED_FOLDERS", "Nombre de dossiers consultés");
-}
-if (!defined("_TITLE_STATS_CHOICE_ACTION")) {
-    define("_TITLE_STATS_CHOICE_ACTION", "par type d'action");
-}
-if (!defined("_ACTION_TYPE")) {
-    define("_ACTION_TYPE", "Type d'action");
-}
-if (!defined("_NO_STRUCTURE_ATTACHED2")) {
-    define("_NO_STRUCTURE_ATTACHED2", "Ce type de dossier n'est attaché à aucune chemise");
-}
-if (!defined("_FOLDER_ADDED")) {
-    define("_FOLDER_ADDED", "Nouveau dossier créé");
-}
-if (!defined("_FOLDER_DETAILLED_PROPERTIES")) {
-    define("_FOLDER_DETAILLED_PROPERTIES", "Informations sur le dossier");
-}
-if (!defined("_FOLDER_PROPERTIES")) {
-    define("_FOLDER_PROPERTIES", "Propriétés du dossier");
-}
-if (!defined("_SYSTEM_ID")) {
-    define("_SYSTEM_ID", "ID Système");
-}
-if (!defined("_MODIFICATION_DATE")) {
-    define("_MODIFICATION_DATE", "Date de modification");
-}
-if (!defined("_UPDATE_FOLDER")) {
-    define("_UPDATE_FOLDER", "Modifier des informations");
-}
-if (!defined("_FOLDER_INDEX_UPDATED")) {
-    define("_FOLDER_INDEX_UPDATED", "Index du dossier modifiés");
-}
-if (!defined("_FOLDER_UPDATED")) {
-    define("_FOLDER_UPDATED", "Mise à jour du dossier effectuée");
-}
-if (!defined("_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED")) {
-    define("_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED", "tous les courriers de ce dossier, ainsi que tous les sous-dossiers seront également supprimés !");
-}
-if (!defined("_NOT_THE_OWNER_OF_THIS_FOLDER")) {
-    define("_NOT_THE_OWNER_OF_THIS_FOLDER", "Vous devez être le propriétaire du dossier. Pour supprimer, veuillez consulter l administrateur ou demander à l utilisateur ");
-}
-if (!defined("_STRING")) {
-    define("_STRING", "Chaine de caractères");
-}
-if (!defined("_INTEGER")) {
-    define("_INTEGER", "Entier");
-}
-if (!defined("_FLOAT")) {
-    define("_FLOAT", "Flottant");
-}
-if (!defined("_DATE")) {
-    define("_DATE", "Date");
-}
-if (!defined("_MAX")) {
-    define("_MAX", "maximum");
-}
-if (!defined("_MIN")) {
-    define("_MIN", "minimum");
-}
-if (!defined("_FOLDER_OR_SUBFOLDER")) {
-    define("_FOLDER_OR_SUBFOLDER", "Dossier/Sous-dossier");
-}
-if (!defined("_ERROR_COMPATIBILITY_FOLDER")) {
-    define("_ERROR_COMPATIBILITY_FOLDER", "Problème de compatibilité entre le dossier et le type de document");
-}
-if (!defined("_ADDED_TO_FOLDER")) {
-    define("_ADDED_TO_FOLDER", " ajouté au dossier");
-}
-if (!defined("_DELETED_FROM_FOLDER")) {
-    define("_DELETED_FROM_FOLDER", " supprimé du dossier");
-}
-if (!defined("_CHOOSE_PARENT_FOLDER")) {
-    define("_CHOOSE_PARENT_FOLDER", "Associer ce dossier à un dossier existant");
-}
-if (!defined("_FOLDER_PARENT")) {
-    define("_FOLDER_PARENT", "Dossier parent");
-}
-if (!defined("_FOLDER_PARENT_DESC")) {
-    define("_FOLDER_PARENT_DESC", "Vous pouvez choisir de créer un sous-dossier en le rattachant à un dossier du même type. Il y a seulement 2 niveaux : dossier et sous-dossier.");
-}
-if (!defined("_THIS_FOLDER")) {
-    define("_THIS_FOLDER", "ce dossier");
-}
-if (!defined("_ALL_FOLDERS")) {
-    define("_ALL_FOLDERS", "Tous les dossiers");
-}
-if (!defined("_FOLDER_DELETED")) {
-    define("_FOLDER_DELETED", "Dossier supprimé");
-}
-if (!defined("_FREEZE_FOLDER_SERVICE")) {
-    define("_FREEZE_FOLDER_SERVICE", "Gel et dégel des dossiers");
-}
-if (!defined("_FREEZE_FOLDER")) {
-    define("_FREEZE_FOLDER", "Geler le dossier");
-}
-if (!defined("_UNFREEZE_FOLDER")) {
-    define("_UNFREEZE_FOLDER", "Dégeler le dossier");
-}
-if (!defined("_CLOSE_FOLDER")) {
-    define("_CLOSE_FOLDER", "Clôturer le dossier");
-}
-if (!defined("_FOLDER_CLOSED")) {
-    define("_FOLDER_CLOSED", "Dossier cloturé");
-}
-if (!defined("_FROZEN_FOLDER")) {
-    define("_FROZEN_FOLDER", "Gel du dossier");
-}
-if (!defined("_UNFROZEN_FOLDER")) {
-    define("_UNFROZEN_FOLDER", "Dégel du dossier");
-}
-if (!defined("_REALLY_FREEZE_THIS_FOLDER")) {
-    define("_REALLY_FREEZE_THIS_FOLDER", "Voulez-vous vraiment geler ce dossier");
-}
-if (!defined("_REALLY_CLOSE_THIS_FOLDER")) {
-    define("_REALLY_CLOSE_THIS_FOLDER", "Voulez-vous vraiment cloturer ce dossier");
-}
-if (!defined("_SUBFOLDER")) {
-    define("_SUBFOLDER", "Sous-dossier");
-}
-if (!defined("_VIEW_FOLDER_TREE")) {
-    define("_VIEW_FOLDER_TREE", "Consulter un dossier");
-}
-if (!defined("_SEARCH_FOLDER_TREE")) {
-    define("_SEARCH_FOLDER_TREE", "Recherche Dossiers");
-}
-if (!defined("_NB_DOCS_IN_FOLDER")) {
-    define("_NB_DOCS_IN_FOLDER", "Nombre de courriers");
-}
-if (!defined("_REDIRECT_ALL_DOCUMENTS_IN_FOLDER")) {
-    define("_REDIRECT_ALL_DOCUMENTS_IN_FOLDER", "Rediriger tous les courriers du dossier");
-}
-if (!defined("_CHOOSE_ONE_FOLDER")) {
-    define("_CHOOSE_ONE_FOLDER", "Choisissez au moins un dossier");
-}
-if (!defined("_MUST_CHOOSE_DEP_OR_USER")) {
-    define("_MUST_CHOOSE_DEP_OR_USER", "Vous devez sélectionner une entité ou un utilisateur!");
-}
-if (!defined('_LABEL')) {
-    define("_LABEL", "libellé");
-}
diff --git a/modules/folder/lang/nl.php b/modules/folder/lang/nl.php
deleted file mode 100755
index 761d9a08909..00000000000
--- a/modules/folder/lang/nl.php
+++ /dev/null
@@ -1,458 +0,0 @@
-<?php
-/**
- * Copyright Maarch since 2008 under licence GPLv3.
- * See LICENCE.txt file at the root folder for more details.
- * This file is part of Maarch software.
- */
-
-/*********************** SERVICES ***********************************/
-if (!defined('_ADMIN_FOLDERTYPES')) {
-    define('_ADMIN_FOLDERTYPES', 'Maptypes');
-}
-if (!defined('_ATTACH_DOC_TO_FOLDER')) {
-    define('_ATTACH_DOC_TO_FOLDER', 'Een brief aan een map koppelen');
-}
-if (!defined('_ADMIN_FOLDERTYPES_DESC')) {
-    define('_ADMIN_FOLDERTYPES_DESC', 'De maptypes beheren. Voor elk type de gekoppelde kwalificatoren en de verplichte documenttypes bepalen voor de volledigheid van de map.');
-}
-if (!defined('_FOLDER_SEARCH')) {
-    define('_FOLDER_SEARCH', 'Een dossier zoeken');
-}
-if (!defined('_SALARY_SHEET')) {
-    define('_SALARY_SHEET', 'Dossierfiche');
-}
-if (!defined('_FOLDER_OUT')) {
-    define('_FOLDER_OUT', 'Ontarchivering');
-}
-if (!defined('_SELECT_FOLDER_TITLE')) {
-    define('_SELECT_FOLDER_TITLE', 'Selectie van de map');
-}
-if (!defined('_FOLDER_NUM')) {
-    define('_FOLDER_NUM', 'Mapnr.');
-}
-if (!defined('_COMPLETE')) {
-    define('_COMPLETE', 'Volledig');
-}
-if (!defined('_INCOMPLETE')) {
-    define('_INCOMPLETE', 'Onvolledig');
-}
-if (!defined('_FOUND_FOLDER')) {
-    define('_FOUND_FOLDER', 'map(pen) gevonden');
-}
-if (!defined('_CHOOSE')) {
-    define('_CHOOSE', 'Kiezen');
-}
-if (!defined('_ADV_SEARCH_FOLDER_TITLE')) {
-    define('_ADV_SEARCH_FOLDER_TITLE', 'Een map zoeken');
-}
-if (!defined('_SEARCH_ADV_FOLDER')) {
-    define('_SEARCH_ADV_FOLDER', 'Een map zoeken');
-}
-if (!defined('_NEW_SEARCH')) {
-    define('_NEW_SEARCH', 'De criteria verwijderen');
-}
-if (!defined('_SELECT_FOLDER')) {
-    define('_SELECT_FOLDER', 'Selectie van de Map');
-}
-if (!defined('_CREATE_FOLDER')) {
-    define('_CREATE_FOLDER', 'Een map aanmaken');
-}
-if (!defined('_CREATE_FOLDER2')) {
-    define('_CREATE_FOLDER2', 'Map aanmaken');
-}
-if (!defined('_FOLDER')) {
-    define('_FOLDER', 'Map');
-}
-if (!defined('_MODIFY_FOLDER')) {
-    define('_MODIFY_FOLDER', 'De indexen van een map wijzigen');
-}
-if (!defined('_FOLDERID')) {
-    define('_FOLDERID', 'Mapnummer');
-}
-if (!defined('_FOLDERSYSTEMID')) {
-    define('_FOLDERSYSTEMID', 'Systeemnummer Maarch Courrier');
-}
-if (!defined('_FOLDERID_LONG')) {
-    define('_FOLDERID_LONG', 'Gebruikersnaam van de map');
-}
-if (!defined('_FOLDER_DESTINATION_QUESTION')) {
-    define('_FOLDER_DESTINATION_QUESTION', 'Deze map enkel toegankelijk maken tot uw dienst?');
-}
-if (!defined('_FOLDER_DESTINATION_SHORT')) {
-    define('_FOLDER_DESTINATION_SHORT', 'Dienstmap');
-}
-if (!defined('_FOLDERNAME')) {
-    define('_FOLDERNAME', 'Mapnaam');
-}
-if (!defined('_FOLDERDATE')) {
-    define('_FOLDERDATE', 'Aanmaakdatum');
-}
-if (!defined('_FOLDERDATE_START')) {
-    define('_FOLDERDATE_START', 'Begin aanmaakdatum');
-}
-if (!defined('_FOLDERDATE_END')) {
-    define('_FOLDERDATE_END', 'Einde aanmaakdatum');
-}
-if (!defined('_FOLDERHASNODOC')) {
-    define('_FOLDERHASNODOC', 'Geen stuk voor deze map');
-}
-if (!defined('_OTHER_INFOS')) {
-    define('_OTHER_INFOS', 'Andere informatie: historiek van de map en ontbrekende stukken voor de volledigheid');
-}
-if (!defined('_SEARCH_FOLDER')) {
-    define('_SEARCH_FOLDER', 'Map zoeken');
-}
-if (!defined('_SELECTED_FOLDER')) {
-    define('_SELECTED_FOLDER', 'Geselecteerde map');
-}
-if (!defined('_FOUND_FOLDERS')) {
-    define('_FOUND_FOLDERS', 'Gevonden mappen');
-}
-if (!defined('_FOLDERTYPE_LABEL')) {
-    define('_FOLDERTYPE_LABEL', 'Mapomschrijving');
-}
-if (!defined('_INFOS_FOLDERS')) {
-    define('_INFOS_FOLDERS', 'Informatie mappen');
-}
-if (!defined('_CHOOSE_FOLDER')) {
-    define('_CHOOSE_FOLDER', 'Een map kiezen');
-}
-if (!defined('_ON_FOLDER_NUM')) {
-    define('_ON_FOLDER_NUM', 'voor map nr.');
-}
-if (!defined('_CREATE_THE_FOLDER')) {
-    define('_CREATE_THE_FOLDER', 'de map aanmaken');
-}
-if (!defined('_NEW_EMPLOYEES_LIST')) {
-    define('_NEW_EMPLOYEES_LIST', 'Lijst van de nieuwe medewerkers');
-}
-if (!defined('_FOLDERS_LIST')) {
-    define('_FOLDERS_LIST', 'Lijst van de mappen');
-}
-if (!defined('_FOLDERS')) {
-    define('_FOLDERS', 'Mappen');
-}
-if (!defined('_FOLDERS_COMMENT')) {
-    define('_FOLDERS_COMMENT', 'Mappen');
-}
-if (!defined('_CHOOSE2')) {
-    define('_CHOOSE2', 'Kies');
-}
-if (!defined('_IS_MANDATORY')) {
-    define('_IS_MANDATORY', 'is verplicht');
-}
-if (!defined('_FOLDER_CREATION')) {
-    define('_FOLDER_CREATION', 'Map aanmaken');
-}
-if (!defined('_DEL_FOLDER_NUM')) {
-    define('_DEL_FOLDER_NUM', 'Verwijdering van de map nr.');
-}
-if (!defined('_DEL_FOLDER')) {
-    define('_DEL_FOLDER', 'Map verwijderen');
-}
-if (!defined('_STEP_ONE')) {
-    define('_STEP_ONE', '1. - Een map kiezen');
-}
-if (!defined('_CHOOSE_SOCIETY')) {
-    define('_CHOOSE_SOCIETY', 'Kies een vennootschap ');
-}
-if (!defined('_THE_SOCIETY')) {
-    define('_THE_SOCIETY', 'De vennootschap');
-}
-if (!defined('_MISSING_DOC')) {
-    define('_MISSING_DOC', 'Ontbrekende stukken');
-}
-if (!defined('_MISSING_DOC2')) {
-    define('_MISSING_DOC2', 'Ontbrekend(e) stuk(ken)');
-}
-if (!defined('_PLEASE_SELECT_FOLDER')) {
-    define('_PLEASE_SELECT_FOLDER', 'U moet een map selecteren');
-}
-if (!defined('_FOLDER_HISTORY')) {
-    define('_FOLDER_HISTORY', 'Historiek map');
-}
-if (!defined('_CHOOSE_FOLDERTYPE')) {
-    define('_CHOOSE_FOLDERTYPE', 'Kies een type map');
-}
-if (!defined('_BROWSE_BY_FOLDER')) {
-    define('_BROWSE_BY_FOLDER', 'Map zoeken');
-}
-if (!defined('_CHAR_ERROR')) {
-    define('_CHAR_ERROR', 'Volgende tekens mogen niet in een gebruikersnaam worden gebruikt:');
-}
-if (!defined('_FOLDERTYPE_ADDITION')) {
-    define('_FOLDERTYPE_ADDITION', 'Toevoeging maptype');
-}
-if (!defined('_FOLDERTYPE_MODIFICATION')) {
-    define('_FOLDERTYPE_MODIFICATION', 'Wijziging van het maptype');
-}
-if (!defined('_FOLDERTYPES_LIST')) {
-    define('_FOLDERTYPES_LIST', 'Lijst van de maptypes');
-}
-if (!defined('_TYPES')) {
-    define('_TYPES', 'type(s)');
-}
-if (!defined('_ALL_FOLDERTYPES')) {
-    define('_ALL_FOLDERTYPES', 'Alle types');
-}
-if (!defined('_FOLDERTYPE')) {
-    define('_FOLDERTYPE', 'Maptype');
-}
-if (!defined('_FOLDERTYPE_MISSING')) {
-    define('_FOLDERTYPE_MISSING', 'Ontbrekend maptype');
-}
-if (!defined('_ARCHIVED_DOC')) {
-    define('_ARCHIVED_DOC', 'Gearchiveerde stukken');
-}
-if (!defined('_SEND_RELANCE_MAIL')) {
-    define('_SEND_RELANCE_MAIL', 'Een herinneringsmail verzenden');
-}
-if (!defined('_DIRECTION_DEP')) {
-    define('_DIRECTION_DEP', 'Directie/Dpt');
-}
-if (!defined('_DEP_AGENCY')) {
-    define('_DEP_AGENCY', 'Dienst/agentschap');
-}
-if (!defined('_DELETE_FOLDER')) {
-    define('_DELETE_FOLDER', 'Een map verwijderen');
-}
-if (!defined('_DELETE_FOLDER_NOTES1')) {
-    define('_DELETE_FOLDER_NOTES1', 'De verwijdering van de map is onomkeerbaar de stukken van deze laatste zullen bewaard worden maar niet meer voor raadpleging toegankelijk zijn.');
-}
-if (!defined('_REALLY_DELETE_FOLDER')) {
-    define('_REALLY_DELETE_FOLDER', 'Wilt u de map verwijderen?');
-}
-if (!defined('_DELETE_FOLDER_NOTES2')) {
-    define('_DELETE_FOLDER_NOTES2', 'Om de map definitief te verwijderen, kies WISSEN (in hoofdletters) in het vakje hieronder.');
-}
-if (!defined('_DELETE_FOLDER_NOTES3')) {
-    define('_DELETE_FOLDER_NOTES3', 'De map zal na deze bevestiging verwijderd worden.');
-}
-if (!defined('_DELETE_FOLDER_NOTES4')) {
-    define('_DELETE_FOLDER_NOTES4', 'De map kan niet verwijderd worden omdat de bevestiging fout is');
-}
-if (!defined('_DELETE_FOLDER_NOTES5')) {
-    define('_DELETE_FOLDER_NOTES5', 'De map is nu uit de database verwijderd.');
-}
-if (!defined('_FOLDER_INDEX_MODIF')) {
-    define('_FOLDER_INDEX_MODIF', 'Wijziging van de indexen van de map');
-}
-if (!defined('_FOLDERS_OUT')) {
-    define('_FOLDERS_OUT', 'Mappen uit het archief verwijderd');
-}
-if (!defined('_MANDATORY_DOCTYPES_COMP')) {
-    define('_MANDATORY_DOCTYPES_COMP', 'Documenttypes verplicht voor de volledigheid van de map');
-}
-if (!defined('_FOLDER_ID')) {
-    define('_FOLDER_ID', 'Gebruikersnaam map');
-}
-if (!defined('_INDEX_FOR_FOLDERTYPES')) {
-    define('_INDEX_FOR_FOLDERTYPES', 'Mogelijke indexen voor de maptypes');
-}
-if (!defined('_SELECTED_DOCTYPES')) {
-    define('_SELECTED_DOCTYPES', 'Geselecteerde documenttypes');
-}
-if (!defined('_SHOW_FOLDER')) {
-    define('_SHOW_FOLDER', 'Dossierfiche');
-}
-if (!defined('_FOLDERTYPE_UPDATE')) {
-    define('_FOLDERTYPE_UPDATE', 'Gewijzigd maptype');
-}
-if (!defined('_FOLDER_ATTACH')) {
-    define('_FOLDER_ATTACH', 'Koppeling aan een map');
-}
-if (!defined('_INCOMPATIBILITY_MARKET_PROJECT')) {
-    define('_INCOMPATIBILITY_MARKET_PROJECT', 'Map en submap niet compatibel');
-}
-if (!defined('_FOLDER_VIEW_STAT')) {
-    define('_FOLDER_VIEW_STAT', 'Aantal geraadpleegde mappen');
-}
-if (!defined('_FOLDER_VIEW_STAT_DESC')) {
-    define('_FOLDER_VIEW_STAT_DESC', 'Aantal geraadpleegde mappen');
-}
-if (!defined('_FOLDER_HISTORY_STAT')) {
-    define('_FOLDER_HISTORY_STAT', 'Historiek van een map');
-}
-if (!defined('_FOLDER_HISTORY_STAT_DESC')) {
-    define('_FOLDER_HISTORY_STAT_DESC', 'Historiek van een map');
-}
-if (!defined('_VIEW_FOLDER')) {
-    define('_VIEW_FOLDER', 'Weergave van een map');
-}
-if (!defined('_TITLE_STATS_CHOICE_FOLDER_TYPE')) {
-    define('_TITLE_STATS_CHOICE_FOLDER_TYPE', 'Per maptype');
-}
-if (!defined('_TITLE_STATS_CHOICE_GROUP')) {
-    define('_TITLE_STATS_CHOICE_GROUP', 'Per gebruikersgroep');
-}
-if (!defined('_TITLE_STATS_CHOICE_USER')) {
-    define('_TITLE_STATS_CHOICE_USER', 'Voor een gebruiker');
-}
-if (!defined('_TITLE_STATS_CHOICE_USER2')) {
-    define('_TITLE_STATS_CHOICE_USER2', 'door de gebruiker');
-}
-if (!defined('_TITLE_STATS_NO_FOLDERS_VIEW')) {
-    define('_TITLE_STATS_NO_FOLDERS_VIEW', 'Geen map geraadpleegd voor de periode');
-}
-if (!defined('_STATS_ERROR_CHOSE_USER')) {
-    define('_STATS_ERROR_CHOSE_USER', 'U moet een bestaande gebruiker kiezen.');
-}
-if (!defined('_NB_FOLDERS')) {
-    define('_NB_FOLDERS', 'Aantal mappen');
-}
-if (!defined('_NB_VIEWED_FOLDERS')) {
-    define('_NB_VIEWED_FOLDERS', 'Aantal geraadpleegde mappen');
-}
-if (!defined('_TITLE_STATS_CHOICE_ACTION')) {
-    define('_TITLE_STATS_CHOICE_ACTION', 'per actietype');
-}
-if (!defined('_ACTION_TYPE')) {
-    define('_ACTION_TYPE', 'Actietype');
-}
-if (!defined('_NO_STRUCTURE_ATTACHED2')) {
-    define('_NO_STRUCTURE_ATTACHED2', 'Dit maptype is aan geen enkele map gekoppeld.');
-}
-if (!defined('_FOLDER_ADDED')) {
-    define('_FOLDER_ADDED', 'Nieuwe map aangemaakt');
-}
-if (!defined('_FOLDER_DETAILLED_PROPERTIES')) {
-    define('_FOLDER_DETAILLED_PROPERTIES', 'Informatie over de map');
-}
-if (!defined('_FOLDER_PROPERTIES')) {
-    define('_FOLDER_PROPERTIES', 'Mapeigenschappen');
-}
-if (!defined('_SYSTEM_ID')) {
-    define('_SYSTEM_ID', 'ID Systeem');
-}
-if (!defined('_MODIFICATION_DATE')) {
-    define('_MODIFICATION_DATE', 'Datum wijziging');
-}
-if (!defined('_UPDATE_FOLDER')) {
-    define('_UPDATE_FOLDER', 'Informatie wijzigen');
-}
-if (!defined('_FOLDER_INDEX_UPDATED')) {
-    define('_FOLDER_INDEX_UPDATED', 'Gewijzigde mapindexen');
-}
-if (!defined('_FOLDER_UPDATED')) {
-    define('_FOLDER_UPDATED', 'Update van map uitgevoerd');
-}
-if (!defined('_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED')) {
-    define('_ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED', 'alle brieven van deze map en alle submappen zullen eveneens verwijderd worden!');
-}
-if (!defined('_NOT_THE_OWNER_OF_THIS_FOLDER')) {
-    define('_NOT_THE_OWNER_OF_THIS_FOLDER', 'U moet de eigenaar van de map zijn. Om te verwijderen, gelieve de administrator te raadplegen of aan de gebruiker te vragen');
-}
-if (!defined('_STRING')) {
-    define('_STRING', 'Karakterreeks');
-}
-if (!defined('_INTEGER')) {
-    define('_INTEGER', 'Geheel');
-}
-if (!defined('_FLOAT')) {
-    define('_FLOAT', 'Zwevend');
-}
-if (!defined('_DATE')) {
-    define('_DATE', 'Datum');
-}
-if (!defined('_MAX')) {
-    define('_MAX', 'maximum');
-}
-if (!defined('_MIN')) {
-    define('_MIN', 'minimum');
-}
-if (!defined('_FOLDER_OR_SUBFOLDER')) {
-    define('_FOLDER_OR_SUBFOLDER', 'Mappen / Submap');
-}
-if (!defined('_ERROR_COMPATIBILITY_FOLDER')) {
-    define('_ERROR_COMPATIBILITY_FOLDER', 'Compatibiliteitsprobleem tussen de map en het maptype');
-}
-if (!defined('_ADDED_TO_FOLDER')) {
-    define('_ADDED_TO_FOLDER', 'aan de map toegevoegd');
-}
-if (!defined('_DELETED_FROM_FOLDER')) {
-    define('_DELETED_FROM_FOLDER', 'van de map verwijderd');
-}
-if (!defined('_CHOOSE_PARENT_FOLDER')) {
-    define('_CHOOSE_PARENT_FOLDER', 'Deze map aan een bestaande map koppelen');
-}
-if (!defined('_FOLDER_PARENT')) {
-    define('_FOLDER_PARENT', 'Bovenliggende map');
-}
-if (!defined('_FOLDER_PARENT_DESC')) {
-    define('_FOLDER_PARENT_DESC', 'U kunt ervoor opteren om een submap aan te maken door deze aan een map van hetzelfde type te koppelen. Er bestaan maar 2 niveaus: map en submap.');
-}
-if (!defined('_THIS_FOLDER')) {
-    define('_THIS_FOLDER', 'Deze map');
-}
-if (!defined('_ALL_FOLDERS')) {
-    define('_ALL_FOLDERS', 'Alle mappen');
-}
-if (!defined('_FOLDER_DELETED')) {
-    define('_FOLDER_DELETED', 'Map verwijderd');
-}
-if (!defined('_FREEZE_FOLDER_SERVICE')) {
-    define('_FREEZE_FOLDER_SERVICE', 'Blokkeren en deblokkeren van de mappen');
-}
-if (!defined('_FREEZE_FOLDER')) {
-    define('_FREEZE_FOLDER', 'De map blokkeren');
-}
-if (!defined('_UNFREEZE_FOLDER')) {
-    define('_UNFREEZE_FOLDER', 'De map deblokkeren');
-}
-if (!defined('_CLOSE_FOLDER')) {
-    define('_CLOSE_FOLDER', 'De map afsluiten');
-}
-if (!defined('_FOLDER_CLOSED')) {
-    define('_FOLDER_CLOSED', 'Map afgesloten');
-}
-if (!defined('_FROZEN_FOLDER')) {
-    define('_FROZEN_FOLDER', 'Map blokkeren');
-}
-if (!defined('_UNFROZEN_FOLDER')) {
-    define('_UNFROZEN_FOLDER', 'Map deblokkeren');
-}
-if (!defined('_REALLY_FREEZE_THIS_FOLDER')) {
-    define('_REALLY_FREEZE_THIS_FOLDER', 'Wilt u deze map echt blokkeren');
-}
-if (!defined('_REALLY_CLOSE_THIS_FOLDER')) {
-    define('_REALLY_CLOSE_THIS_FOLDER', 'Wilt u deze map echt afsluiten');
-}
-if (!defined('_SUBFOLDER')) {
-    define('_SUBFOLDER', 'Submap');
-}
-if (!defined('_VIEW_FOLDER_TREE')) {
-    define('_VIEW_FOLDER_TREE', 'Een map raadplegen');
-}
-if (!defined('_SEARCH_FOLDER_TREE')) {
-    define('_SEARCH_FOLDER_TREE', 'Mappen zoeken');
-}
-if (!defined('_NB_DOCS_IN_FOLDER')) {
-    define('_NB_DOCS_IN_FOLDER', 'Aantal brieven');
-}
-if (!defined('_IS_FOLDER_BASKET')) {
-    define('_IS_FOLDER_BASKET', 'Mapbakje');
-}
-if (!defined('_IS_FOLDER_STATUS')) {
-    define('_IS_FOLDER_STATUS', 'Mapstatus');
-}
-if (!defined('_IS_FOLDER_ACTION')) {
-    define('_IS_FOLDER_ACTION', 'Mapactie');
-}
-if (!defined('_IS_FOLDER_ACTION_DESC')) {
-    define('_IS_FOLDER_ACTION_DESC', 'Om deze actie in een mapbakje te gebruiken');
-}
-if (!defined('_REDIRECT_ALL_DOCUMENTS_IN_FOLDER')) {
-    define('_REDIRECT_ALL_DOCUMENTS_IN_FOLDER', 'Alle brieven van de map omleiden');
-}
-if (!defined('_CHOOSE_ONE_FOLDER')) {
-    define('_CHOOSE_ONE_FOLDER', 'Kies minstens een map');
-}
-if (!defined('_MUST_CHOOSE_DEP_OR_USER')) {
-    define('_MUST_CHOOSE_DEP_OR_USER', 'U moet een dienst of een gebruiker selecteren!');
-}
-if (!defined('_LABEL')) {
-    define('_LABEL', 'omschrijving');
-}
-if (!defined('_THE_FOLDER')) {
-    define('_THE_FOLDER', 'De map');
-}
diff --git a/modules/folder/list_doc.php b/modules/folder/list_doc.php
deleted file mode 100755
index 3331bdf0025..00000000000
--- a/modules/folder/list_doc.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/*
-*
-*    Copyright 2008,2012 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/>.
-*/
-
-/**
-* @brief    Displays documents list in details folder tree
-*
-* @file     list_doc.php
-* @author   Yves Christian Kpakpo <dev@maarch.org>
-* @date     $date$
-* @version  $Revision$
-* @ingroup  folder
-*/
-
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php";
-require_once "apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR
-            ."class".DIRECTORY_SEPARATOR."class_lists.php";
-            
-$core_tools = new core_tools();
-$request    = new request();
-$list       = new lists();
-
-$core_tools->load_lang();
-$core_tools->load_html();
-$core_tools->load_header('', true, false);
-
-?><body><?php
-
-$core_tools->load_js();
-
-//Init
-$list_id = "";
-if(isset($_REQUEST['listid']) && $_REQUEST['listid'] <> "") {
-
-	$list_id = substr($_REQUEST['listid'], 0, strlen($_REQUEST['listid'])-1);
-} elseif(isset($_SESSION['where_list_doc']) && $_SESSION['where_list_doc'] <> "") {
-
-	$list_id = $_SESSION['where_list_doc'];
-}
-
-//Load list
-if (!empty($list_id)) {
-
-    $target = $_SESSION['config']['businessappurl'].'index.php?module=folder&page=documents_list_in_details&listid='.$list_id;
-    $listContent = $list->loadList($target);
-    echo $listContent;
-}
- 
-//Reset 
-$_SESSION['where_list_doc'] = "";
-?>
-</body>
-</html>
\ No newline at end of file
diff --git a/modules/folder/manage_create_folder.php b/modules/folder/manage_create_folder.php
deleted file mode 100755
index 4d73217d39f..00000000000
--- a/modules/folder/manage_create_folder.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-require_once "core/class/class_request.php";
-require_once "modules/folder/class/class_modules_tools.php";
-$core = new core_tools();
-
-$core->load_lang();
-$core->test_admin('create_folder', 'folder');
-$folder = new folder();
-$folder->create_folder($_GET['iframe']);
diff --git a/modules/folder/missing_res.php b/modules/folder/missing_res.php
deleted file mode 100755
index 6259dc2fa4b..00000000000
--- a/modules/folder/missing_res.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-/**
-* File : missing_res.php
-*
-* Frame to show a the missing doc of a folder
-*
-* @package  Maarch PeopleBox 1.0
-* @version 1.0
-* @since 10/2006
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-$core_tools = new core_tools();
-$core_tools->load_lang();
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php");
-$table ="";
-if(isset($_SESSION['collection_choice']) && !empty($_SESSION['collection_choice']))
-{
-	$table = $_SESSION['collection_choice'];
-}
-else
-{
-	$table = $_SESSION['collections'][0]['table'];
-}
-$missing_res = array();
-
-if(isset($_SESSION['current_folder_id']) && !empty($_SESSION['current_folder_id']))
-{
-	$folder = new folder();
-	$folder->load_folder($_SESSION['current_folder_id'], $_SESSION['tablename']['fold_folders']);
-	$foldertype_id = $folder->get_field('foldertype_id');
-	$missing_res = $folder->missing_res($table, $_SESSION['tablename']['fold_foldertypes_doctypes'], $_SESSION['tablename']['doctypes'], $_SESSION['current_folder_id'], $foldertype_id);
-}
-$core_tools->load_html();
-//here we building the header
-$core_tools->load_header('', true, false);
-?>
-<body id="missing_iframe">
-<?php
-if(count($missing_res) < 1 && isset($_SESSION['current_folder_id'])&& !empty($_SESSION['current_folder_id']))
-{
-	echo _FOLDER.' '.strtolower(_COMPLETE);
-}
-else if (count($missing_res) < 1 && !isset($_SESSION['current_folder_id']) )
-{
-	echo _PLEASE_SELECT_FOLDER.".";
-}
-else
-{
-	?>
-		<table width="95%" class="listing" border="0" cellspacing="0">
-        	<thead>
-            	<tr>
-                	<th width="30%"><?php echo _ID;?></th>
-                    <th><?php echo _DESC;?></th>
-                </tr>
-            </thead>
-            <tbody>
-			<?php
-				$color = "";
-				for($cpt_missing_res=0; $cpt_missing_res < count($missing_res); $cpt_missing_res++)
-				{
-					if($color == ' class="col"')
-					{
-						$color = '';
-					}
-					else
-					{
-						$color = ' class="col"';
-					}
-					?>
-					<tr <?php echo $color;?>>
-                   		 <td>
-							<?php functions::xecho($missing_res[$cpt_missing_res]['ID']);?>
-						</td>
-						<td>
-							<?php functions::xecho($missing_res[$cpt_missing_res]['LABEL']);?>
-						</td>
-					</tr>
-					<?php
-				}
-			?>
-            </tbody>
-		</table>
-	<?php
-}
-$core_tools->load_js();
-?>
-</body>
-</html>
diff --git a/modules/folder/res_select_folder.php b/modules/folder/res_select_folder.php
deleted file mode 100755
index ebf38f9e343..00000000000
--- a/modules/folder/res_select_folder.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
-* File : res_select_folder.php
-*
-* Result of a form
-*
-* @package  Maarch PeopleBox 1.0
-* @version 2.0
-* @since 06/2006
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-$core_tools = new core_tools();
-$core_tools->load_lang();
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php");
-
- if(!isset($_REQUEST['field']) || empty($_REQUEST['field']))
- {
- 	header("location: ".$_SESSION['config']['businessappurl']."index.php?display=true&module=folder&page=result_folder");
- 	exit;
- }
- else
- {
- 	$folder = new folder();
- 	$folder->load_folder(trim($_REQUEST['field']), $_SESSION['tablename']['fold_folders']);
- 	$_SESSION['current_folder_id'] = $folder->get_field('folders_system_id');
- 	$folder->modify_default_folder_in_db($_SESSION['current_folder_id'], $_SESSION['user']['UserId'], $_SESSION['tablename']['users']);
-
-	 ?>
-
- 	<script type="text/javascript">
-		//window.alert(window.top.location);
-		if(window.top.name == 'CreateFolder')
-		{
-
-			window.top.opener.top.opener.location.reload();window.top.opener.close();window.top.close();
-		}
-		else // opener = index_file
-		{
-
-			<?php
-
-			if($_SESSION['physical_archive_origin'] == 'true')
-			{
-				
-				?>
-
-				var eleframe1 = window.top.document.getElementById('myframe');
-				eleframe1.src = '<?php echo $_SESSION['config']['businessappurl']?>index.php?display=true&module=physical_archive&page=select_types_for_pa';
-
-				<?php
-			}
-			elseif($_SESSION['origin'] <> 'store_file')
-			{
-			?>
-				var eleframe1 = window.top.frames['index'].document.getElementById('myframe');
-				eleframe1.src = '<?php echo $_SESSION['config']['businessappurl']?>index.php?display=true&module=physical_archive&page=select_type';
-				
-			<?php
-			}
-			else
-			{
-			?>
-				window.top.location.reload();
-			<?php
-			}
-			?>
-		}
- 	</script>
- 	<?php
- }
-?>
diff --git a/modules/folder/result_folder.php b/modules/folder/result_folder.php
deleted file mode 100755
index c46be8c6396..00000000000
--- a/modules/folder/result_folder.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-/**
-* File : result_folder.php
-*
-* Frame : show the folders corresponding to the search (folder select in indexing process)
-*
-* @package  Maarch PeopleBox 1.0
-* @version 1.0
-* @since 10/2006
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-$core_tools = new core_tools();
-$core_tools->load_lang();
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php");
-require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_list_show.php");
-$func = new functions();
-$core_tools->test_service('folder_search', 'folder');
-$core_tools->load_html();
-//here we building the header
-$core_tools->load_header('', true, false);
-?>
-<body>
-<?php
-//if(isset($_SESSION['folderSystemId'])and !empty($_SESSION['folderSystemId']))
-if(isset($_SESSION['stringSearch'])and !empty($_SESSION['stringSearch']))
-{
-	$select[$_SESSION['tablename']['fold_folders']]= array();
-	array_push($select[$_SESSION['tablename']['fold_folders']],"folders_system_id","folder_id","folder_name","subject","folder_level");
-	$select[$_SESSION['tablename']['fold_foldertypes']]= array();
-	array_push($select[$_SESSION['tablename']['fold_foldertypes']],"foldertype_label");
-
-	$where = " ".$_SESSION['tablename']['fold_folders'].".foldertype_id = ".$_SESSION['tablename']['fold_foldertypes'].".foldertype_id ";
-	$where .= " and (lower(folder_id) like lower(:stringSearch) or lower(folder_name) like lower(:stringSearch) or lower(subject) like lower(:stringSearch)) and status <> 'DEL'";
-	$arrayPDO = array(":stringSearch" => '%'.$_SESSION['stringSearch'].'%');
-
-	$request= new request;
-	$tab=$request->PDOselect($select, $where, $arrayPDO, " order by folder_name ",$_SESSION['config']['databasetype']);
-	//$request->show();
-	$folder_tmp = new folder();
-	for ($i=0;$i<count($tab);$i++)
-	{
-		for ($j=0;$j<count($tab[$i]);$j++)
-		{
-			foreach(array_keys($tab[$i][$j]) as $value)
-			{
-				if($tab[$i][$j][$value]=="folders_system_id")
-				{
-					$tab[$i][$j]["folders_system_id"]=$tab[$i][$j]['value'];
-					$tab[$i][$j]["label"]=_GED_NUM;
-					$tab[$i][$j]["size"]="2";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=false;
-				}
-				if($tab[$i][$j][$value]=="folder_level")
-				{
-					$tab[$i][$j]["label"]=_PROJECT." / "._MARKET;
-					if($tab[$i][$j]["value"] == 1)
-					{
-						$tab[$i][$j]["value"] = _PROJECT;
-					}
-					elseif($tab[$i][$j]["value"] == 2)
-					{
-						$tab[$i][$j]["value"] = _MARKET;
-					}
-					$tab[$i][$j]["size"]="50";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-				}
-				if($tab[$i][$j][$value]=="folder_name")
-				{
-					$tab[$i][$j]["value"]=$request->show_string($tab[$i][$j]["value"]);
-					$tab[$i][$j]["label"]=_LASTNAME;
-					$tab[$i][$j]["size"]="50";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-				}
-				if($tab[$i][$j][$value]=="subject")
-				{
-					$tab[$i][$j]["value"]=$request->show_string($tab[$i][$j]["value"]);
-					$tab[$i][$j]["label"]=_LABEL;
-					$tab[$i][$j]["size"]="50";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-				}
-			}
-		}
-	}
-	for ($i=0;$i<count($tab);$i++)
-	{
-		for ($j=0;$j<count($tab[$i]);$j++)
-		{
-			foreach(array_keys($tab[$i][$j]) as $value)
-			{
-				if($value == 'column' and $tab[$i][$j][$value]=="folders_system_id")
-				{
-					$tmp = array();
-					$id = $tab[$i][$j]['value'];
-
-					$folder_tmp->load_folder($id,$_SESSION['tablename']['fold_folders']);
-					array_push($tab[$i], $tmp);
-				}
-			}
-		}
-	}
-
-	//$request->show_array($tab);
-	$list=new list_show();
-	$ind = count($tab);
-	$list->list_doc($tab,$ind,_SEARCH_RESULTS." : ".$ind." "._FOUND_FOLDERS,"folders_system_id","result_folder&module=folder","folders_system_id","folder_detail",false,true,"get",$_SESSION['config']['businessappurl']."index.php?display=true&module=folder&page=res_select_folder",_CHOOSE, false, false, true, false, false, false,  false, false, '', '', false, '', '', 'listing spec', '', false, false, array(), '<input type="hidden" name="display" value="true"/><input type="hidden" name="module" value="folder" /><input type="hidden" name="page" value="res_select_folder" />');
-}
-$core_tools->load_js();
-?>
-</body>
-</html>
diff --git a/modules/folder/search_adv_folder.php b/modules/folder/search_adv_folder.php
deleted file mode 100755
index 57cfa51c59d..00000000000
--- a/modules/folder/search_adv_folder.php
+++ /dev/null
@@ -1,262 +0,0 @@
-<?php
-/**
-* Copyright Maarch since 2008 under licence GPLv3.
-* See LICENCE.txt file at the root folder for more details.
-* This file is part of Maarch software.
-*
-*/
-
-/**
- * @brief    Advanced search form for folders
- *
- * @file     search_adv_folder.php
- *
- * @author   Yves Christian Kpakpo <dev@maarch.org>
- * @date     $date$
- *
- * @version  $Revision$
- * @ingroup  folder
- */
-require_once 'core'.DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR.'class_request.php';
-$core = new core_tools();
-$core->test_user();
-$core->test_service('folder_search', 'folder');
-
-/****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == 'true') {
-    $init = true;
-}
-$level = '';
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2
-    || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4
-    || $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$pagePath = $_SESSION['config']['businessappurl']
-    .'index.php?page=search_adv_folder&module=folder';
-$pageLabel = _SEARCH_ADV_FOLDER;
-$pageId = 'search_folder_adv';
-$core->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level);
-/***********************************************************/
-
-$foldertypes = array();
-$chooseColl = true;
-$db = new Database();
-
-if (count($_SESSION['user']['collections']) == 1) {
-    $chooseColl = false;
-
-    $stmt = $db->query(
-        'SELECT foldertype_id, foldertype_label FROM '
-        .$_SESSION['tablename']['fold_foldertypes'].' WHERE coll_id = ? order by foldertype_label',
-        array($_SESSION['user']['collections'][0])
-    );
-    while ($res = $stmt->fetchObject()) {
-        array_push(
-            $foldertypes,
-            array(
-                'id' => $res->foldertype_id,
-                'label' => $res->foldertype_label,
-            )
-        );
-    }
-}
-
-if (isset($_REQUEST['erase']) && $_REQUEST['erase'] == 'true') {
-    $_SESSION['folder_search'] = array();
-}
-?>
-<div id="inner_content">
-
-    <h1><i class="fa fa-search fa-2x" title="" /></i>
-        <?php echo _ADV_SEARCH_FOLDER_TITLE; ?>
-    </h1>
-
-    <form name="search_folder_frm" id="search_folder_frm" method="post" action="<?php echo $_SESSION['config']['businessappurl']
-            .'index.php?page=search_adv_folder_result&module=folder'; ?>"
-        class="forms2">
-        <input type="hidden" name="module" value="folder" />
-        <input type="hidden" name="page" value="search_adv_folder_result" />
-
-        <table align="center" border="0" width="100%">
-            <tr>
-                <td><a href="javascript://" onclick="javascript:window.top.location.href='<?php echo $_SESSION['config']['businessappurl']
-            .'index.php?page=search_adv_folder&module=folder&reinit=true&erase=true'; ?>';">
-                        <i class="fa fa-sync fa-4x" title="<?php echo _CLEAR_SEARCH; ?>"></i>
-                </td>
-                <td align="right">
-                    <span style="display:none;">
-                        <input name="imageField" type="submit" value="" onclick="$('search_folder_frm').form.submit();" />
-                    </span>
-                    <a href="#" onclick="$('search_folder_frm').submit();">
-                        <i class="fa fa-search fa-4x" title="<?php echo _SEARCH; ?>"></i>
-                    </a>
-                </td>
-            </tr>
-        </table>
-
-        <?php
-if ($chooseColl) {
-                ?>
-        <div class="block">
-            <h2>
-                <?php echo _COLLECTION; ?>
-            </h2>
-            <table width="100%" border="0" cellpadding="3">
-                <tr>
-                    <td width="70%">
-                        <label for="coll_id">
-                            <?php echo _COLLECTION; ?> :</label>
-                        <select name="coll_id" id="coll_id" onchange="search_change_coll('<?php echo $_SESSION['config']['businessappurl']
-                    .'index.php?display=true'
-                    .'&module=folder&page=get_foldertypes'; ?>', 
-                    this.options[this.options.selectedIndex].value)">
-                            <option value="">
-                                <?php echo _CHOOSE_COLLECTION; ?>
-                            </option>
-                            <?php
-                    foreach (array_keys($_SESSION['user']['security']) as $coll) {
-                        ?>
-                            <option value="<?php functions::xecho($coll); ?>">
-                                <?php
-                        functions::xecho($_SESSION['user']['security'][$coll]['DOC']['label_coll']); ?>
-                            </option>
-                            <?php
-                    } ?>
-                        </select>
-                    </td>
-                    <td><em>
-                            <?php echo _MUST_CHOOSE_COLLECTION_FIRST; ?></em></td>
-                    <td>&nbsp;</td>
-                </tr>
-            </table>
-        </div>
-        <div class="block_end">&nbsp;</div> <br />
-        <?php
-            } else {
-                ?>
-        <input type="hidden" name="coll_id" id="coll_id" value="<?php
-            if (isset($_SESSION['user']['security'][0]['coll_id'])) {
-                functions::xecho($_SESSION['user']['security'][0]['coll_id']);
-            } ?>" />
-        <?php
-            }
-?>
-
-        <div id="folder_search_div" style="display:<?php if ($chooseColl) {
-    echo 'none';
-} else {
-    echo 'block';
-}?>">
-            <div class="block">
-                <h2>
-                    <?php echo _INFOS_FOLDERS; ?>
-                </h2>
-                <br />
-                <table width="100%" border="0" cellpadding="3">
-                    <tr>
-                        <td width="25%" align="right"><label for="foldertype_id">
-                                <?php echo _FOLDERTYPE; ?> :</label></td>
-                        <td width="24%">
-                            <select name="foldertype_id" id="foldertype_id" onchange="
-                        get_folder_index('<?php echo $_SESSION['config']['businessappurl']
-                        .'index.php?display=true'
-                        .'&module=folder&page=get_folder_search_index'; ?>', 
-                        this.options[this.options.selectedIndex].value, 'opt_indexes')">
-                                <option value="">
-                                    <?php echo _CHOOSE_FOLDERTYPE; ?>
-                                </option>
-                                <?php
-                        for ($i = 0; $i < count($foldertypes); ++$i) {
-                            ?>
-                                <option value="<?php functions::xecho($foldertypes[$i]['id']); ?>"
-                                    <?php if (isset($_SESSION['folder_search']['foldertype_id'])
-                                    && $foldertypes[$i]['id']==$_SESSION['folder_search']['foldertype_id']) {
-                                echo
-                                    'selected="selected"' ;
-                            } ?>>
-                                    <?php functions::xecho($foldertypes[$i]['label']); ?>
-                                </option>
-                                <?php
-                        }
-                        ?>
-                            </select>
-                        </td>
-                        <td width="2%">&nbsp;</td>
-                        <td width="25%" align="right"><label for="folder_id">
-                                <?php echo _FOLDERID; ?> :</label></td>
-                        <td width="24%">
-                            <input type="text" name="folder_id" id="folder_id" value="<?php
-                        if (isset($_SESSION['folder_search']['folder_id'])) {
-                            functions::xecho($_SESSION['folder_search']['folder_id']);
-                        }
-                        ?>" />
-                            <div id="foldersListById" class="autocomplete"></div>
-                            <script type="text/javascript">
-                                initList('folder_id',
-                                    'foldersListById',
-                                    '<?php echo $_SESSION['
-                                    config ']['
-                                    businessappurl ']; ?>index.php?display=true&module=folder&page=folders_list_by_id',
-                                    'Input', '2');
-                            </script>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td width="25%" align="right">
-                            <label for="creation_date_start">
-                                <?php echo _CREATION_DATE.' '._START; ?> :<label>
-                        </td>
-                        <td width="24%">
-                            <input name="creation_date_start" type="text" id="creation_date_start" value="<?php
-                    if (isset($_SESSION['folder_search']['creation_date_start'])) {
-                        functions::xecho($_SESSION['folder_search']['creation_date_start']);
-                    }
-                    ?>"
-                                onclick='showCalender(this)' />
-                        </td>
-                        <td width="2%">&nbsp;</td>
-                        <td width="25%" align="right">
-                            <label for="creation_date_end">
-                                <?php echo _CREATION_DATE.' '._END; ?>:<label>
-                        </td>
-                        <td width="24%">
-                            <input name="creation_date_end" type="text" id="creation_date_end" value="<?php
-                    if (isset($_SESSION['folder_search']['creation_date_end'])) {
-                        functions::xecho($_SESSION['folder_search']['creation_date_end']);
-                    }
-                    ?>"
-                                onclick='showCalender(this)' />
-                        </td>
-                    </tr>
-                    <tr>
-                        <td width="25%" align="right"><label for="folder_name">
-                                <?php echo _FOLDERNAME; ?> :<label></td>
-                        <td colspan="3">
-                            <input name="folder_name" type="text" id="folder_name" value="<?php
-                    if (isset($_SESSION['folder_search']['folder_name'])) {
-                        functions::xecho($_SESSION['folder_search']['folder_name']);
-                    }
-                    ?>" />
-                        </td>
-                    </tr>
-                </table>
-                <br />
-                <div id="opt_indexes"></div>
-            </div>
-            <div class="block_end"></div>
-    </form>
-
-    <?php unset($_SESSION['folder_search']);?>
-
-    <script type="text/javascript">
-    var foldertypes = $('foldertype_id');
-    if(foldertypes)
-    {
-        get_folder_index('<?php echo $_SESSION['config']['businessappurl'];?>index.php?display=true&module=folder&page=get_folder_search_index', foldertypes.options[foldertypes.options.selectedIndex].value, 'opt_indexes');
-    }
-    </script>
-</div>
-</div>
\ No newline at end of file
diff --git a/modules/folder/search_adv_folder_result.php b/modules/folder/search_adv_folder_result.php
deleted file mode 100755
index 098421b1f47..00000000000
--- a/modules/folder/search_adv_folder_result.php
+++ /dev/null
@@ -1,253 +0,0 @@
-<?php
-
-require_once "core" . DIRECTORY_SEPARATOR 
-    . "class" . DIRECTORY_SEPARATOR . "class_request.php";
-require_once "modules" . DIRECTORY_SEPARATOR . "folder" 
-    . DIRECTORY_SEPARATOR . "class" . DIRECTORY_SEPARATOR 
-    . "class_admin_foldertypes.php";
-require_once "core" . DIRECTORY_SEPARATOR . "class"
-    . DIRECTORY_SEPARATOR . "class_manage_status.php";
-require_once "apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id']
-    .DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR
-    ."class_lists.php";
-
-$core       = new core_tools();
-$func       = new functions();
-$req        = new request();
-$foldertype = new foldertype();
-$status_obj = new manage_status();
-$list       = new lists();
-
-$core->load_lang();
-
-$core->test_service('folder_search', 'folder');
-/****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true") {
-    $init = true;
-}
-$level = "";
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2
-    || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4
-    || $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$page_path = $_SESSION['config']['businessappurl'].'index.php?page=search_adv_folder_result&module=folder';
-$page_label = _RESULTS;
-$page_id = "folder_search_adv_result";
-$core->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
-/***********************************************************/
-
-$view = $_SESSION['view']['view_folders'];
-
-$where_request = "";
-$date_pattern = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/";
-$arrayPDO = array();
-
-//Foldertype
-    if(isset($_REQUEST['foldertype_id']) && !empty($_REQUEST['foldertype_id']))
-    {
-        $_SESSION['folder_search']['foldertype_id'] = trim($_REQUEST['foldertype_id']);
-        $where_request .= " ".$view.".foldertype_id = :foldertypeid and ";
-        $arrayPDO = array_merge($arrayPDO, array(":foldertypeid" => $_SESSION['folder_search']['foldertype_id']));
-    }
-    else
-    {
-        if(!empty($_SESSION['folder_search']['foldertype_id'])){
-            $where_request .= " ".$view.".foldertype_id = :foldertypeid and ";
-            $arrayPDO = array_merge($arrayPDO, array(":foldertypeid" => $_SESSION['folder_search']['foldertype_id']));
-        }else{
-            $_SESSION['folder_search']['foldertype_id'] = "";
-        }
-    }
-    
-//Foldername
-    if(isset($_REQUEST['folder_name']) && !empty($_REQUEST['folder_name']))
-    {
-        $_SESSION['folder_search']['folder_name'] = trim($_REQUEST['folder_name']);
-        if($_SESSION['config']['databasetype'] == "POSTGRESQL")
-        {
-            $where_request .= " ".$view.".folder_name ilike :foldername and ";
-            $arrayPDO = array_merge($arrayPDO, array(":foldername" => "%".$_SESSION['folder_search']['folder_name']."%"));
-        }
-        else
-        {
-            $where_request .= " ".$view.".folder_name like :foldername and ";
-            $arrayPDO = array_merge($arrayPDO, array(":foldername" => "%".$_SESSION['folder_search']['folder_name']."%"));
-        }
-    }
-    else
-    {
-        if(!empty($_SESSION['folder_search']['folder_name'])){
-            if($_SESSION['config']['databasetype'] == "POSTGRESQL")
-            {
-                $where_request .= " ".$view.".folder_name ilike :foldername and ";
-                $arrayPDO = array_merge($arrayPDO, array(":foldername" => "%".$_SESSION['folder_search']['folder_name']."%"));
-            }
-            else
-            {
-                $where_request .= " ".$view.".folder_name like :foldername and ";
-                $arrayPDO = array_merge($arrayPDO, array(":foldername" => "%".$_SESSION['folder_search']['folder_name']."%"));
-            }
-        }else{
-            $_SESSION['folder_search']['folder_name'] = "";
-        }
-    }
-    
-//Folder id
-    if(isset($_REQUEST['folder_id']) && !empty($_REQUEST['folder_id']))
-    {
-        $_SESSION['folder_search']['folder_id'] = trim($_REQUEST['folder_id']);
-        if($_SESSION['config']['databasetype'] == "POSTGRESQL")
-        {
-            $where_request .= " ".$view.".folder_id ilike :folderid and ";
-            $arrayPDO = array_merge($arrayPDO, array(":folderid" => "%".$_SESSION['folder_search']['folder_id']."%"));
-        }
-        else
-        {
-            $where_request .= " ".$view.".folder_id like :folderid and ";
-            $arrayPDO = array_merge($arrayPDO, array(":folderid" => "%".$_SESSION['folder_search']['folder_id']."%"));
-        }
-    }
-    else
-    {
-        if(!empty($_SESSION['folder_search']['folder_id'])){
-            
-            if($_SESSION['config']['databasetype'] == "POSTGRESQL")
-            {
-                $where_request .= " ".$view.".folder_id ilike :folderid and ";
-                $arrayPDO = array_merge($arrayPDO, array(":folderid" => "%".$_SESSION['folder_search']['folder_id']."%"));
-            }
-            else
-            {
-                $where_request .= " ".$view.".folder_id like :folderid and ";
-                $arrayPDO = array_merge($arrayPDO, array(":folderid" => "%".$_SESSION['folder_search']['folder_id']."%"));
-            }    
-        }else{
-            $_SESSION['folder_search']['folder_id'] = "";
-        }
-    }
-
-//Creation date
-    //$_SESSION['folder_search']['creation_date_start'] = '';
-    if(!empty($_REQUEST['creation_date_start']) && isset($_REQUEST['creation_date_start']))
-    {
-        if( preg_match($date_pattern,$_REQUEST['creation_date_start'])==false )
-        {
-            $_SESSION['error'] = _WRONG_DATE_FORMAT;
-
-        }
-        else
-        {
-            $_SESSION['folder_search']['creation_date_start'] = $func->format_date_db($_REQUEST['creation_date_start']);
-            $where_request .= " (".$req->extract_date($view.'.creation_date')." >= :creationdatestart) and ";
-            $arrayPDO = array_merge($arrayPDO, array(":creationdatestart" => $_SESSION['folder_search']['creation_date_start']));
-        }
-    }else{
-        if(!empty($_SESSION['folder_search']['creation_date_start'])){
-            $where_request .= " (".$req->extract_date($view.'.creation_date')." >= :creationdatestart) and ";
-            $arrayPDO = array_merge($arrayPDO, array(":creationdatestart" => $_SESSION['folder_search']['creation_date_start']));
-        }
-    }
-
-
-    //$_SESSION['folder_search']['creation_date_end'] ='';
-    if(!empty($_REQUEST['creation_date_end']) && isset($_REQUEST['creation_date_end']))
-    {
-        if( preg_match($date_pattern,$_REQUEST['creation_date_end'])==false )
-        {
-            $_SESSION['error'] = _WRONG_DATE_FORMAT;
-        }
-        else
-        {
-            $_SESSION['folder_search']['creation_date_end'] = $func->format_date_db($_REQUEST['creation_date_end']);
-            $where_request .= " (".$req->extract_date($view.'.creation_date')." <= :creationdateend) and ";
-            $arrayPDO = array_merge($arrayPDO, array(":creationdateend" => $_SESSION['folder_search']['creation_date_end']));
-        }
-    }else{
-        if(!empty($_SESSION['folder_search']['creation_date_end'])){
-            $where_request .= " (".$req->extract_date($view.'.creation_date')." <= :creationdateend) and ";
-            $arrayPDO = array_merge($arrayPDO, array(":creationdateend" => $_SESSION['folder_search']['creation_date_end']));
-        }
-    }
-
-    if (isset($_SESSION['user']['entities']['0'])) {
-        $finalDest = [];
-        foreach ($_SESSION['user']['entities'] as $tmp) {
-            $finalDest[] = $tmp['ENTITY_ID'];
-        }
-        $where_request .= " (destination in (:finaldest) OR destination is null) and";
-        $arrayPDO = array_merge($arrayPDO, [":finaldest" => $finalDest]);
-    }
-
-//Optional indexes
-    if(isset($_SESSION['folder_search']['foldertype_id']) && !empty($_SESSION['folder_search']['foldertype_id']))
-    {
-        $indexes = $foldertype->get_indexes($_SESSION['folder_search']['foldertype_id']) ;
-        foreach(array_keys($indexes) as $key)
-        {
-            if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key]))
-            {
-                $_SESSION['folder_search'][$key] = $_REQUEST[$key];
-                $where_request .= $foldertype->search_checks($indexes, $key, $_REQUEST[$key], 'view_folders');
-            }
-            elseif(isset($_REQUEST[$key.'_from']) && !empty($_REQUEST[$key.'_from']))
-            {
-                $_SESSION['folder_search'][$key.'_from'] = $_REQUEST[$key.'_from'];
-                $where_request .= $foldertype->search_checks($indexes, $key.'_from', $_REQUEST[$key.'_from'], 'view_folders');
-            }
-            elseif( isset($_REQUEST[$key.'_to']) && !empty($_REQUEST[$key.'_to']))
-            {
-                $_SESSION['folder_search'][$key.'_to'] = $_REQUEST[$key.'_to'];
-                $where_request .= $foldertype->search_checks($indexes, $key.'_to', $_REQUEST[$key.'_to'], 'view_folders');
-            }
-            elseif( isset($_REQUEST[$key.'_max'])  && !empty($_REQUEST[$key.'_max']))
-            {
-                $_SESSION['folder_search'][$key.'_max'] = $_REQUEST[$key.'_max'];
-                $where_request .= $foldertype->search_checks($indexes, $key.'_max', $_REQUEST[$key.'_max'], 'view_folders');
-            }
-            elseif(isset($_REQUEST[$key.'_min']) && !empty($_REQUEST[$key.'_min']))
-            {
-                $_SESSION['folder_search'][$key.'_min'] = $_REQUEST[$key.'_min'];
-                $where_request .= $foldertype->search_checks($indexes, $key.'_min', $_REQUEST[$key.'_min'], 'view_folders');
-            }
-        }
-    }
-    
-if($_SESSION['save_list']['fromDetail'] == "true") {
-        $urlParameters .= '&start='.$_SESSION['save_list']['start'];
-        $urlParameters .= '&lines='.$_SESSION['save_list']['lines'];
-        $urlParameters .= '&order='.$_SESSION['save_list']['order'];
-        $urlParameters .= '&order_field='.$_SESSION['save_list']['order_field'];
-        // if ($_SESSION['save_list']['template'] <> "") {
-        //     $urlParameters .= '&template='.$_SESSION['save_list']['template'];
-        // }
-        $_SESSION['save_list']['fromDetail'] = "false";
-        $_SESSION['save_list']['url'] = $urlParameters;
-    }
-    $_SESSION['save_list']['start'] = 0;
-    $_SESSION['save_list']['lines'] = "";
-    $_SESSION['save_list']['order'] = "";
-    $_SESSION['save_list']['order_field'] = "";
-    //$_SESSION['save_list']['template'] = "";    
-
-if(!empty($_SESSION['error']))
-{
-    $func->echo_error(_ADV_SEARCH_FOLDER_TITLE, "<br /><div class=\"error\">"._MUST_CORRECT_ERRORS." : <br /><br /><strong>"
-        .$_SESSION['error']."<br /><a href=\"".$_SESSION['config']['businessappurl']
-        ."index.php?page=search_adv_folder&module=folder\">"._CLICK_HERE_TO_CORRECT
-        ."</a></strong></div>", 'title', $_SESSION['config']['businessappurl']
-        ."static.php?module=folder&filename=picto_search_b.gif");
-}
-else
-{   
-    $_SESSION['searching']['where_request'] = $where_request;
-    $_SESSION['searching']['where_request_parameters'] = $arrayPDO;
-
-    //List
-    $target = $_SESSION['config']['businessappurl'].'index.php?module=folder&page=folders_list_search_adv'.$urlParameters;
-    $listContent = $list->loadList($target, true, 'divList', 'false');
-    echo $listContent;
-}
-?>
diff --git a/modules/folder/search_folder_tree.php b/modules/folder/search_folder_tree.php
deleted file mode 100755
index 88ed717809b..00000000000
--- a/modules/folder/search_folder_tree.php
+++ /dev/null
@@ -1,443 +0,0 @@
-<?php
-
-/**
-* Copyright Maarch since 2008 under licence GPLv3.
-* See LICENCE.txt file at the root folder for more details.
-* This file is part of Maarch software.
-*
-*/
-/**
-* File : search_customer.php.
-*
-* Advanced search form
-*
-* @version 2.1
-*
-* @since 10/2005
-*
-* @license GPL
-* @author Loïc Vinet  <dev@maarch.org>
-* @author Claire Figueras  <dev@maarch.org>
-*/
-require_once 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id']
-    .DIRECTORY_SEPARATOR.'class'.DIRECTORY_SEPARATOR
-    .'class_business_app_tools.php';
-
-$appTools = new business_app_tools();
-$core = new core_tools();
-
-$core->test_user();
-$core->load_lang();
-$core->test_service('view_folder_tree', 'folder');
-$_SESSION['indexation'] = false;
-
-$_SESSION['category_id_session'] = '';
-
-//Definition de la collection
-$_SESSION['collection_id_choice'] = $_SESSION['user']['collections'][0];
-if ($_SESSION['user']['collections'][1] == 'letterbox_coll') {
-    $_SESSION['collection_id_choice'] = 'letterbox_coll';
-}
-/****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == 'true') {
-    $init = true;
-}
-$level = '';
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2
-    || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4
-    || $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$pagePath = $_SESSION['config']['businessappurl']
-           .'index.php?page=search_folder_tree&module=folder';
-$pageLabel = _VIEW_FOLDER_TREE;
-$pageId = 'search_folder_tree';
-$core->manage_location_bar(
-    $pagePath,
-    $pageLabel,
-    $pageId,
-    $init,
-    $level
-);
-/***********************************************************/
-
-$_SESSION['origin'] = 'search_folder_tree';
-?>
-
-<h1><i class="fa fa-search fa-2x"></i>
-    <?php echo _VIEW_FOLDER_TREE; ?>
-</h1>
-<div id="inner_content" align="center">
-    <div class="block">
-        <h2>
-            <form method="post" name="form_search_folder" id="form_search_folder" action="#">
-                <table width="100%" border="0">
-                    <tr>
-                        <td align="right">
-                            <label for="folder" style="color:white;">
-                                <?php echo _FOLDER; ?> :</label>
-                        </td>
-                        <td class="indexing_field">
-                            <div class="typeahead__container">
-                                <div class="typeahead__field">
-                                    <span class="typeahead__query">
-                                        <input type="text" class="folderTest" name="folder[query]" id="folder" size="45"
-                                            autocomplete="off" type="search" onKeyPress="if(event.keyCode == 13) submitForm();" />
-                                    </span>
-                                </div>
-                            </div>
-                        </td>
-                        <td>
-                            <input id="tree_send" type="button" value="<?php echo _SEARCH; ?>"
-                                onclick="javascript:submitForm();" class="button">
-                        </td>
-                        <td width="50%">
-                            <div style="font-size: 8px;margin-top: -11px;">
-                                <br>
-                                <a href="javascript://" onClick="window.top.location.href='<?php
-                                    echo $_SESSION['config']['businessappurl'];
-                                    ?>index.php?page=search_folder_tree&module=folder&erase=true';">
-                                    <i class="fa fa-sync fa-4x" style="color: #ffffff;" title="<?php echo _NEW_SEARCH; ?>"></i>
-                                </a>
-                            </div>
-                        </td>
-                    </tr>
-                </table>
-            </form>
-        </h2>
-        <table width="100%" height="100%" cellspacing="5" style="border:1px solid #999999;">
-            <tr>
-                <td width="55%" height="720px" style="vertical-align: top; text-align: left;border-right:1px solid #999999;">
-                    <div id="loading" style="display:none;"><i class="fa fa-spinner fa-2x"></i></div>
-                    <div id="myTree" style="height: 100%;overflow: auto;">&nbsp;</div>
-                </td>
-                <td width="45%" style="vertical-align: top;background: url(static.php?filename=logo_maarch_only.svg) center center no-repeat;background-size: 90%;">
-                    <div id="docView"></div>
-                </td>
-            </tr>
-        </table>
-    </div>
-</div>
-<script type="text/javascript">
-    loadTypeahead('.folderTest', 'desc', true,
-        'index.php?display=true&module=folder&page=autocomplete_folders&mode=folder');
-
-    function submitForm() {
-        var folder = $('folder').value;
-        if ($('myTree')) {
-            $('myTree').innerHTML = "";
-        }
-        // Get tree parameters from an ajax script (get_tree_info.php)
-        new Ajax.Request('index.php?display=true&module=folder&page=get_tree_info&display=true', {
-            method: 'post',
-            parameters: {
-                tree_id: 'myTree',
-                project: folder
-            },
-            onSuccess: function(response) {
-                eval('params=' + response.responseText + ';');
-            },
-            onLoading: function(answer) {
-                //show loading
-                $('loading').style.display = 'block';
-            },
-            onComplete: function(response) {
-                $('loading').style.display = 'none';
-                $('myTree').innerHTML = response.responseText;
-
-                /*   if(more_params['onComplete_callback'])
-                   {
-                       eval(more_params['onComplete_callback']);
-                   }*/
-            }
-        });
-    }
-
-    function get_folders(folders_system_id) {
-
-        if ($('' + folders_system_id).hasClassName('mt_fopened')) {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folders_system_id: folders_system_id,
-                    FOLDER_TREE_RESET: true
-                },
-                onSuccess: function(answer) {
-                    folders = JSON.parse(answer.responseText);
-
-                    for (var i = 0; i <= folders.length; i++) {
-                        level = folders[i].folder_level * 10;
-
-                        $('' + folders_system_id).innerHTML = '<span onclick="get_folders(' + folders[i].folders_system_id +
-                            ')">' + folders[i].nom_folder + '</span><b>(' + folders[i].nb_subfolder +
-                            ' <?php echo _MARKET; ?>, <span onclick="get_folder_docs(' +
-                            folders[i].folders_system_id + ')">' + folders[i].nb_doc +
-                            ' document(s)</span>)</b>';
-                        $('' + folders_system_id).addClassName('mt_fclosed');
-                        $('' + folders_system_id).removeClassName('mt_fopened');
-                        $('' + folders_system_id).removeClassName('link_open');
-                        $('' + folders_system_id).style.listStyleImage =
-                            'url(static.php?filename=folder.gif)';
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-
-        } else {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folders_system_id: folders_system_id,
-                    FOLDER_TREE: true
-                },
-                onSuccess: function(answer) {
-                    folders = JSON.parse(answer.responseText);
-
-                    for (var i = 0; i <= folders.length; i++) {
-                        level = folders[i].folder_level * 10;
-                        var style = 'style="margin-left:' + level + 'px;"';
-                        $('' + folders_system_id).innerHTML += '<li ' + style + ' class="folder" id="' +
-                            folders[i].folders_system_id + '"><span onclick="get_folders(' + folders[i].folders_system_id +
-                            ')" class="folder">' + folders[i].nom_folder + '</span><b>(' + folders[i].nb_subfolder +
-                            ' <?php echo _MARKET; ?>, <span onclick="get_folder_docs(' +
-                            folders[i].folders_system_id + ')">' + folders[i].nb_doc +
-                            ' document(s)</span>)</b></li>';
-
-                        $('' + folders_system_id).addClassName('mt_fopened');
-                        $('' + folders_system_id).removeClassName('mt_fclosed');
-                        $('' + folders_system_id).addClassName('link_open');
-                        $('' + folders_system_id).style.listStyleImage =
-                            'url(static.php?filename=folderopen.gif)';
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-        }
-
-    }
-
-    function get_autofolders(folder_level) {
-
-        if ($('autofolders').hasClassName('mt_fopened')) {
-            $('autofolders').innerHTML = "<span onclick='get_autofolders(" + folder_level +
-                ")'>Plan de classement dynamique</span>";
-            $('autofolders').addClassName('mt_fclosed');
-            $('autofolders').style.listStyleImage = 'url(static.php?filename=folder.gif)';
-            $('autofolders').removeClassName('link_open');
-            $('autofolders').removeClassName('mt_fopened');
-            $('autofolders').src = 'static.php?filename=folder.gif';
-
-        } else {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folder_level: folder_level,
-                    AUTOFOLDERS_TREE: true
-                },
-                onSuccess: function(answer) {
-                    autofolders = JSON.parse(answer.responseText);
-
-                    for (var i = 0; i <= autofolders.length; i++) {
-                        var style = 'style="margin-left:20px;"';
-
-                        $('autofolders').innerHTML += '<li ' + style + ' class="folder" id="' + autofolders[
-                                i].id[0] + '"><span onclick="get_autofolder_folders(\'' + autofolders[i].id[
-                                0] + '\',' + autofolders[i].tree_level + ',\'' + autofolders[i].id[0] +
-                            '\',\'' + autofolders[i].id[0] + '\',\'' + autofolders[i].desc[0] + '\')">' +
-                            autofolders[i].desc[0] + '</span></li>';
-
-                        $('autofolders').addClassName('mt_fopened');
-                        $('autofolders').style.listStyleImage = 'url(static.php?filename=folderopen.gif)';
-                        $('autofolders').addClassName('link_open');
-                        $('autofolders').removeClassName('mt_fclosed');
-
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-        }
-    }
-
-    function get_autofolder_folders(id, folder_level, id_folder, path_folder, desc_tree) {
-        if ($('' + id_folder).hasClassName('mt_fopened')) {
-
-            var options = '\'' + id + '\',\'' + folder_level + '\',\'' + id_folder + '\',\'' + path_folder + '\',\'' +
-                desc_tree + '\'';
-            $('' + id_folder).innerHTML = '<span onclick="get_autofolder_folders(' + options + ')">' + desc_tree +
-                '</span>';
-            $('' + id_folder).addClassName('mt_fclosed');
-            $('' + id_folder).style.listStyleImage = 'url(static.php?filename=folder.gif)';
-            $('' + id_folder).removeClassName('link_open');
-            $('' + id_folder).removeClassName('mt_fopened');
-
-        } else {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folder_level: folder_level,
-                    id: id,
-                    path_folder: path_folder,
-                    id_folder: id_folder,
-                    AUTOFOLDER_FOLDERS: true
-                },
-                onSuccess: function(answer) {
-                    folders = JSON.parse(answer.responseText);
-                    for (var i = 0; i <= folders.length; i++) {
-
-                        if (folders[i].folder_level == 2) {
-                            var style = 'style="margin-left:30px;"';
-                        } else {
-                            var folder_level = folders[i].folder_level + 1;
-                            level = folder_level * 7;
-                            var style = 'style="margin-left:' + level + 'px;"';
-                        }
-                        var new_path_folder = path_folder + ';' + folders[i].libelle;
-                        if (folders[i].check_docs == true) {
-                            var onclick = 'onclick="get_autofolder_folder_docs(\'' + id + '\',' + folders[i]
-                                .folder_level + ',\'' + folders[i].libelle + '\',\'' + new_path_folder +
-                                '\',\'' + folders[i].libelle + '\')"';
-                        } else {
-                            var onclick = 'onclick="get_autofolder_folders(\'' + id + '\',' + folders[i].folder_level +
-                                ',\'' + folders[i].libelle + '\',\'' + new_path_folder + '\',\'' + folders[
-                                    i].libelle + '\')"';
-                        }
-                        $('' + id_folder).innerHTML += '<li ' + style + ' class="folder" id="' + folders[i]
-                            .libelle + '"><span ' + onclick + '>' + folders[i].libelle + '</span></li>';
-
-                        $('' + id_folder).addClassName('mt_fopened');
-                        $('' + id_folder).style.listStyleImage = 'url(static.php?filename=folderopen.gif)';
-                        $('' + id_folder).addClassName('link_open');
-                        $('' + id_folder).removeClassName('mt_fclosed');
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-        }
-    }
-
-    function get_autofolder_folder_docs(id, folder_level, id_folder, path_folder) {
-        if ($('' + id_folder).hasClassName('mt_fopened')) {
-            var options = '\'' + id + '\',\'' + folder_level + '\',\'' + id_folder + '\',\'' + path_folder + '\',\'' +
-                id_folder + '\'';
-            $('' + id_folder).innerHTML = '<span onclick="get_autofolder_folder_docs(' + options + ')">' + id_folder +
-                '</span>';
-            $('' + id_folder).addClassName('mt_fclosed');
-            $('' + id_folder).style.listStyleImage = 'url(static.php?filename=folder.gif)';
-            $('' + id_folder).removeClassName('link_open');
-            $('' + id_folder).removeClassName('mt_fopened');
-
-        } else {
-
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folder_level: folder_level,
-                    id: id,
-                    id_folder: id_folder,
-                    path_folder: path_folder,
-                    AUTOFOLDER_FOLDER_DOCS: true
-                },
-                onSuccess: function(answer) {
-                    docs = JSON.parse(answer.responseText);
-                    for (var i = 0; i <= docs.length; i++) {
-
-                        var style = 'style="margin-left:35px;"';
-
-                        $('' + id_folder).addClassName('mt_fopened');
-                        $('' + id_folder).style.listStyleImage = 'url(static.php?filename=folderopen.gif)';
-                        $('' + id_folder).addClassName('link_open');
-                        $('' + id_folder).removeClassName('mt_fclosed');
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-        }
-    }
-
-    function get_folder_docs(folders_system_id) {
-        if ($('' + folders_system_id).hasClassName('mt_fopened')) {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folders_system_id: folders_system_id,
-                    FOLDER_TREE_RESET: true
-                },
-                onSuccess: function(answer) {
-                    folders = JSON.parse(answer.responseText);
-
-                    for (var i = 0; i <= folders.length; i++) {
-                        level = folders[i].folder_level * 10;
-                        $('' + folders_system_id).innerHTML = '<span onclick="get_folders(' + folders[i].folders_system_id +
-                            ')">' + folders[i].nom_folder + '</span><b>(' + folders[i].nb_subfolder +
-                            ' <?php echo _MARKET; ?>, <span onclick="get_folder_docs(' +
-                            folders[i].folders_system_id + ')">' + folders[i].nb_doc +
-                            ' document(s)</span>)</b>';
-                        $('' + folders_system_id).addClassName('mt_fclosed');
-                        $('' + folders_system_id).removeClassName('mt_fopened');
-                        $('' + folders_system_id).removeClassName('link_open');
-                        $('' + folders_system_id).style.listStyleImage =
-                            'url(static.php?filename=folder.gif)';
-                    };
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-
-        } else {
-            new Ajax.Request('index.php?page=ajax_get_folder&module=folder&display=true', {
-                method: 'post',
-                parameters: {
-                    folders_system_id: folders_system_id,
-                    FOLDER_TREE_DOCS: true
-                },
-                onSuccess: function(answer) {
-                    docs = JSON.parse(answer.responseText);
-
-                    if (docs != '') {
-                        for (var subarray in docs) {
-                            $('' + folders_system_id).innerHTML +=
-                                '<ul class="doc" style="margin-top:10px;margin-left:30px;"><li><b>' +
-                                subarray + '</b></li>';
-                            for (var mail in docs[subarray]) {
-                                $('' + folders_system_id).innerHTML +=
-                                    '<li style="margin-bottom:10px;margin-top:10px;margin-left:50px;"><b>' +
-                                    mail + '</b></li>';
-                                for (var i = 0; i < docs[subarray][mail].length; i++) {
-                                    $('' + folders_system_id).addClassName('mt_fopened');
-                                    $('' + folders_system_id).removeClassName('mt_fclosed');
-                                    $('' + folders_system_id).addClassName('link_open');
-                                    $('' + folders_system_id).style.listStyleImage =
-                                        'url(static.php?filename=folderopen.gif)';
-                                }
-                            }
-                            $('' + folders_system_id).innerHTML += '</ul>';
-                        }
-                    }
-
-                },
-                onFailure: function() {
-                    $('' + folders_system_id).innerHTML += '<div class="error">_SERVER_ERROR</div>';
-                }
-            });
-        }
-    }
-</script>
diff --git a/modules/folder/select_folder.php b/modules/folder/select_folder.php
deleted file mode 100755
index 0295d7c3f4c..00000000000
--- a/modules/folder/select_folder.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/**
-* File : select_folder.php
-*
-* Form to choose a folder (used in indexing process)
-*
-* @package  Maarch PeopleBox 1.0
-* @version 2.1
-* @since 06/2006
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-
-
-require_once("core/class/class_request.php");
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-
-$core_tools = new core_tools();
-
-$core_tools->test_service('physical_archive', 'physical_archive');
-$core_tools->test_user();
-$core_tools->load_lang();
-$func = new functions();
-$_SESSION['origin_folder'] = "select_folder";
-$_SESSION['select_folder'] = true;
-$_SESSION['res_folder'] = "";
-$_SESSION['search_res_folder'] = "";
-$_SESSION['folderSystemId'] = "";
-$_SESSION['stringSearch'] = "";
-//if(!empty($_REQUEST['project']) && empty($_REQUEST['market']))
-if(!empty($_REQUEST['project']))
-{
-	$_SESSION['stringSearch'] = $_REQUEST['project'];
-	/*if(substr($_REQUEST['project'], strlen($_REQUEST['project']) -1, strlen($_REQUEST['project'])) == ")")
-	{
-		$_SESSION['folderSystemId'] = str_replace(')', '', substr($_REQUEST['project'], strrpos($_REQUEST['project'],'(')+1));
-	}*/
-}
-/*
-if(!empty($_REQUEST['market']))
-{
-	if(substr($_REQUEST['market'], strlen($_REQUEST['market']) -1, strlen($_REQUEST['market'])) == ")")
-	{
-		$_SESSION['folderSystemId'] = str_replace(')', '', substr($_REQUEST['market'], strrpos($_REQUEST['market'],'(')+1));
-	}
-}
-*/
-if(isset($_REQUEST['matricule'])and !empty($_REQUEST['matricule']))
-{
-	$_SESSION['res_folder'] = "matricule";
-	$_SESSION['search_res_folder'] =$_REQUEST['matricule'];
-}
-elseif( isset($_REQUEST['nom']) and !empty($_REQUEST['nom']))
-{
-	$_SESSION['res_folder'] = "nom";
-	$_SESSION['search_res_folder'] = $_REQUEST['nom'];
-}
-
-$core_tools->load_html();
-//here we building the header
-$core_tools->load_header(_SELECT_FOLDER_TITLE, true, false);
-$time = $core_tools->get_session_time_expire();
-if($_SESSION['origin'] == "qualify")
-{
-	$tab = array();
-	$select = array();
-	$col ="";
-	if(isset($_SESSION['collection_choice']) && !empty($_SESSION['collection_choice']))
-	{
-		$col = $_SESSION['collection_choice'];
-	}
-	else
-	{
-		$col = $_SESSION['collections'][0]['table'];
-	}
-	if($_SESSION['current_folder_id'] <> "")
-	{
-		$select[$col] = array();
-		array_push($select[$col],"folders_system_id");
-		$where = "res_id = ? ".$_SESSION['res_id_to_qualify'];
-		$arrayPDO = array($_SESSION['res_id_to_qualify']);
-		$request = new request();
-		$tab = $request->PDOselect($select, $where, $arrayPDO, "", $_SESSION['config']['databasetype']);
-		//print_r($tab);
-		for ($i=0;$i<count($tab);$i++)
-		{
-			for ($j=0;$j<count($tab[$i]);$j++)
-			{
-				foreach(array_keys($tab[$i][$j]) as $value)
-				{
-					if($tab[$i][$j][$value]=="folders_system_id")
-					{
-						$_SESSION['current_folder_id']= $tab[$i][$j]['value'];
-					}
-				}
-			}
-		}
-	}
-}
-//echo "<br/>folder ".$_SESSION['current_folder_id'];
-require_once("modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_modules_tools.php");
-$folder = new folder();
-if($_SESSION['current_folder_id'] <> "" && $folder->is_folder_exists($_SESSION['current_folder_id']))
-{
-	$folder->load_folder($_SESSION['current_folder_id'], $_SESSION['tablename']['fold_folders']);
-	$folder_data = $folder->get_folder_info();
-	//$func->show_array($folder_data);
-}
-
-?>
-<body  onload="setTimeout(window.close, <?php echo $time;?>*60*1000);">
-<br/>
-<br/>
-
-<div class="block">
-	<form name="frm1" class="physicalform" action="<?php echo  $_SESSION['config']['businessappurl'].'index.php?display=true&module=indexing_searching&page=file_index';?>">
-	
-		<b><?php echo _SELECTED_FOLDER;?></b>
-		<br/>
-		<br/>
-		<p>
-			<label><?php echo _FOLDERTYPE;?> :</label>
-			<input type="text" value="<?php functions::xecho($folder_data['foldertype_label']);?>" name="foldertype" readonly="readonly" class="readonly"/>
-		</p>
-		<p>
-			<label><?php echo _FOLDERID;?> :</label>
-			<input type="text" value="<?php functions::xecho($folder_data['folder_name']);?>" name="nom_view" readonly="readonly" class="readonly "/>
-		</p>
-		<p>
-			<label><?php echo _FOLDERNAME;?> :</label>
-			<input type="text" value="<?php functions::xecho($folder_data['subject']);?>" name="nom_view" readonly="readonly" class="readonly "/>
-		</p>
-
-	</form>
-</div>
-<div class="block_end">&nbsp;</div>
-<div class="blank_space">&nbsp;</div>
-<?php
-if($_SESSION['origin'] <> "qualify")
-{
-?>
-   <!-- <hr class="select_folder" />-->
-   <div class="block">
-    <b><?php echo _SEARCH_FOLDER;?></b>
-    <br/>
-    <br/>
-	
-    <form name="select_folder" method="get" action="<?php echo $_SESSION['config']['businessappurl'].'index.php';?>" class="physicalform">
-    <input type="hidden" name="display" value="true"/>
-	<input type="hidden" name="module" value="folder"/>
-	<input type="hidden" name="page" value="select_folder"/>
-	    <p>
-            <label><?php echo _PROJECT." / "._MARKET;?> :</label>
-            <input type="text" name="project" id="project"/>
-			<!--<div id="show_project" class="autocomplete"></div>-->
-        </p>
-        <!--<p>
-            <label><?php echo _MARKET;?> :</label>
-			<input type="text" name="market" id="market"/>
-			<div id="show_market" class="autocomplete"></div>
-        </p>-->
-		<p>
-			<label>&nbsp;</label>
-			<input type="submit" name="submit2" value="<?php echo _SEARCH_FOLDER;?>" class="button"/>
-		</p>
-    </form>
-	</div><div class="block_end">&nbsp;</div>
-    <?php
-    //if(isset($_SESSION['folderSystemId'])and !empty($_SESSION['folderSystemId']))
-    if(isset($_SESSION['stringSearch'])and !empty($_SESSION['stringSearch']))
-    {
-		?>
-		<div align="center">
-			<iframe name="result_folder" src="<?php echo$_SESSION['config']['businessappurl'].'index.php?display=true&module=folder&page=result_folder';?>" frameborder="0" width="98%" height="1000" scrolling="no"></iframe>
-		</div>
-		<?php
-    }
-    else
-    {
-		?>
-        <!--<div align="center"><input type="button" name="cancel" value="<?php echo _CLOSE_WINDOW;?>" onclick="self.close();" class="button" /></div>   -->
-		<?php
-    }
-    ?>  <?php
-}
-$core_tools->load_js();
-?>
-</body>
-</html>
diff --git a/modules/folder/select_user_report.php b/modules/folder/select_user_report.php
deleted file mode 100755
index e2758df859f..00000000000
--- a/modules/folder/select_user_report.php
+++ /dev/null
@@ -1,149 +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/>.
-*/
-
-$core_tools = new core_tools();
-$core_tools->test_user();
-$core_tools->load_lang();
-
-require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php");
-require_once("apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_list_show.php");
-$func = new functions();
-
-$what = "all";
-$where = "";
-$arrayPDO = array();
-$_SESSION['chosen_user'] = '';
-if(isset($_GET['what']) && !empty($_GET['what']))
-{
-	if($_GET['what'] == "all")
-	{
-		$what = "all";
-
-	}
-	else
-	{
-		$what = $func->wash($_GET['what'], "no", "", "no");
-		$where = " lower(".$_SESSION['tablename']['users'].".lastname) like lower(?) ";
-		$arrayPDO = array_merge($arrayPDO, array($what.'%'));
-	}
-}
-
-	$select[$_SESSION['tablename']['users']] = array();
-	array_push($select[$_SESSION['tablename']['users']],"user_id","lastname","firstname" );
-
-	$req = new request();
-
-	$list=new list_show();
-	$order = 'asc';
-	if(isset($_REQUEST['order']) && !empty($_REQUEST['order']))
-	{
-		$order = trim($_REQUEST['order']);
-	}
-	$field = 'lastname';
-	if(isset($_REQUEST['order_field']) && !empty($_REQUEST['order_field']))
-	{
-		$field = trim($_REQUEST['order_field']);
-	}
-
-	$orderstr = $list->define_order($order, $field);
-
-	$tab = $req->PDOselect($select, $where, $arrayPDO, $orderstr, $_SESSION['config']['databasetype'], $limit="500",false);
-
-for ($i=0;$i<count($tab);$i++)
-{
-		for ($j=0;$j<count($tab[$i]);$j++)
-		{
-			foreach(array_keys($tab[$i][$j]) as $value)
-			{
-
-
-				if($tab[$i][$j][$value]== "user_id" )
-				{
-					$tab[$i][$j]["user_id"]= $tab[$i][$j]['value'];
-					$tab[$i][$j]["label"]= _ID;
-					$tab[$i][$j]["size"]="30";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-					$tab[$i][$j]["order"]='user_id';
-				}
-
-				if($tab[$i][$j][$value]=='lastname')
-				{
-					$tab[$i][$j]['value']= $req->show_string($tab[$i][$j]['value']);
-					$tab[$i][$j]['lastname']= $tab[$i][$j]['value'];
-					$tab[$i][$j]["label"]=_LASTNAME;
-					$tab[$i][$j]["size"]="30";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-					$tab[$i][$j]["order"]='lastname';
-				}
-				if($tab[$i][$j][$value]=="firstname")
-				{
-					$tab[$i][$j]['value']= $req->show_string($tab[$i][$j]['value']);
-					$tab[$i][$j]["info"]= $tab[$i][$j]['value'];
-					$tab[$i][$j]["label"]=_FIRSTNAME;
-					$tab[$i][$j]["size"]="30";
-					$tab[$i][$j]["label_align"]="left";
-					$tab[$i][$j]["align"]="left";
-					$tab[$i][$j]["valign"]="bottom";
-					$tab[$i][$j]["show"]=true;
-					$tab[$i][$j]["order"]='firstname';
-				}
-			}
-		}
-	}
-
-	if(isset($_REQUEST['field']) && !empty($_REQUEST['field']))
-	{
-		//$_SESSION['chosen_user'] = $_REQUEST['field'];
-		?>
-			<script type="text/javascript">
-				var item = window.opener.$('user_id');
-				if(item)
-				{
-					item.value = '<?php functions::xecho($_REQUEST['field']);?>';
-					self.close();
-				}
-			</script>
-			<?php
-		exit();
-	}
-
-//here we loading the html
-$core_tools->load_html();
-//here we building the header
-$core_tools->load_header(_CHOOSE_USER2, true, false);
-$time = $core_tools->get_session_time_expire();
-?>
-<body onload="javascript:setTimeout(window.close, <?php echo $time;?>*60*1000);">
-
-<?php
-$nb = count($tab);
-
-$list->list_doc($tab, $nb, _USERS_LIST,'user_id',$name = "select_user_report",'user_id','',false,true,'get',$_SESSION['config']['businessappurl'].'index.php?display=true&module=folder&page=select_user_report',_CHOOSE_USER2, false, true, true,false, true, true,  true, false, '', '',  true, _ALL_USERS,_USER, 'listing spec', '', false, false, array(), '<input type="hidden" name="display" value="true"/><input type="hidden" name="module" value="folder" /><input type="hidden" name="page" value="select_user_report" />');
-$core_tools->load_js();
-?>
-</body>
-</html>
diff --git a/modules/folder/show_folder.php b/modules/folder/show_folder.php
deleted file mode 100755
index 14e7437bbda..00000000000
--- a/modules/folder/show_folder.php
+++ /dev/null
@@ -1,468 +0,0 @@
-<?php
-/**
-* File : show_folder.php
-*
-* Show the details of a folder
-*
-* @package  Maarch v3
-* @version 1.0
-* @since 10/2006
-* @license GPL
-* @author  Claire Figueras  <dev@maarch.org>
-*/
-
-$core = new core_tools();
-if (!$core->is_module_loaded("folder")) {
-    echo "Folder module missing !<br/>Please install this module.";
-    exit();
-}
-
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_request.php";
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_security.php";
-require_once "modules".DIRECTORY_SEPARATOR."folder".DIRECTORY_SEPARATOR
-    ."class".DIRECTORY_SEPARATOR."class_modules_tools.php";
-require_once "apps".DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR
-            ."class".DIRECTORY_SEPARATOR."class_lists.php";
-require_once "core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_history.php";
-
-$folderObject   = new folder();
-$request        = new request;
-$func           = new functions();
-$hist           = new history();
-$sec            = new security();
-$db             = new Database();
-
-if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
-    $s_id = addslashes($func->wash($_REQUEST['id'], 'num', _THE_FOLDER));
-}
-
-$stmt = $db->query("SELECT folder_id FROM folders WHERE folders_system_id= ?", array($s_id));
-$res_folder_id = $stmt->fetchObject();
-$folder_id = $res_folder_id->folder_id;
-
-if(isset($folder_id) && !empty($folder_id)) {
-    $folder_id = $func->wash($folder_id, 'no', _FOLDERID_LONG);
-}
-
-/****************Management of the location bar  ************/
-$init = false;
-if (isset($_REQUEST['reinit']) && $_REQUEST['reinit'] == "true") {
-    $init = true;
-}
-$level = "";
-if (isset($_REQUEST['level']) && ($_REQUEST['level'] == 2
-    || $_REQUEST['level'] == 3 || $_REQUEST['level'] == 4
-    || $_REQUEST['level'] == 1)
-) {
-    $level = $_REQUEST['level'];
-}
-$pagePath = $_SESSION['config']['businessappurl']
-	. 'index.php?page=show_folder&module=folder&folder_id=' . $s_id;
-$pageLabel = _SHOW_FOLDER;
-$pageId = "fold_show_folder";
-$core->manage_location_bar($pagePath, $pageLabel, $pageId, $init, $level);
-/***********************************************************/
-
-$status = '';
-$_SESSION['current_foldertype'] = '';
-$_SESSION['origin'] = "show_folder";
-$datePattern = "/^[0-3][0-9]-[0-1][0-9]-[1-2][0-9][0-9][0-9]$/";
-
-$view = '';
-$updateRight = $core->test_service('modify_folder', 'folder', false);
-$deleteRight = $core->test_service('delete_folder', 'folder', false);
-
-//update folder index
-if (isset($_POST['update_folder'])) {
-    $folderObject->update_folder($_REQUEST, $s_id);
-}
-//delete the folder
-if (isset($_POST['delete_folder'])) {
-    $folderObject->delete_folder($s_id, $_REQUEST['foldertype_id']);
-    ?>
-        <script type="text/javascript">window.top.location.href='<?php  
-    echo $_SESSION['config']['businessappurl']
-    	. 'index.php?page=search_adv_folder&module=folder';
-    ?>';</script>
-    <?php
-    exit();
-}
-
-?>
-
-<div id="details_div" style="display:none;">
-
-    <h1 class="titdetail">
-        <i class="fa fa-info-circle fa-2x"></i> <?php
-            echo _DETAILS . " : " . _FOLDER . ' "';
-            ?><?php
-            functions::xecho($folder_id) . '"';
-            ?> 
-    </h1>
-    <div id="inner_content" class="clearfix">
-
-    <?php
-    $_SESSION['save_list']['fromDetail'] = "true";
-    if (empty($_SESSION['error'])) {
-
-    	$folderObject->load_folder(
-    		$s_id, $_SESSION['tablename']['fold_folders']
-    	);
-        $status = $folderObject->get_field('status');
-        $_SESSION['current_foldertype_coll_id'] = $folderObject->get_field('coll_id');
-        $view = $sec->retrieve_view_from_coll_id($_SESSION['current_foldertype_coll_id']);
-
-        if ($status == 'DEL' || $status == 'FOLDDEL') {
-        	echo _NO_FOLDER_FOUND.".";
-        } else {
-        	$folderArray = array();
-            $folderArray = $folderObject->get_folder_info();
-            $_SESSION['current_folder_id'] = $folderArray['system_id'];
-            $id = $_SESSION['current_folder_id'];
-            $folderObject->modify_default_folder_in_db(
-            	$_SESSION['current_folder_id'], $_SESSION['user']['UserId'], 
-            	$_SESSION['tablename']['users']
-            );
-
-            if ($_SESSION['history']['folderview'] == true) {
-            	$hist->add(
-            		$_SESSION['tablename']['fold_folders'], $id , "VIEW",'folderview',
-            		_VIEW_FOLDER . " " . strtolower(_NUM)
-            		. $folderArray['folder_id'], 
-            		$_SESSION['config']['databasetype'], 'folder'
-            	);
-            }
-        }
-    }
-        ?>
-        	<div class="block">
-            	<!-- <h4><a href="#" onclick="history.back();return false;" class="back"><?php echo _BACK;?></a></h4> -->
-                <a href="<?php echo $_SESSION['config']['businessappurl'] 
-            .'index.php?page=search_adv_folder_result&module=folder';?>" class="back"><i class="fa fa-backward fa-2x" title="<?php echo _BACK;?>"></i></a>
-        	</div>
-        <br/>
-        <div class="panel-folder">
-            <div id="index-folder" onclick="tabClick('index-folder')" class="folder-tab folder-tab-open"><?php echo _FOLDER_DETAILLED_PROPERTIES;?></div>
-            <?php
-            if (trim($_SESSION['current_folder_id']) <> '' && ! empty($view)) {
-                $select2 = array();
-                $select2[$view] = array();
-                $tab2 = array();
-                array_push($select2[$view], "res_id", "type_label");
-                $tab2 = $request->PDOselect(
-                    $select2, "folders_system_id = ? and status <> 'DEL'", array($_SESSION['current_folder_id']), " order by type_label ",
-                    $_SESSION['config']['databasetype'], "500", false
-                );
-                for ($i = 0; $i < count($tab2); $i ++) {
-                    for ($j = 0; $j < count($tab2[$i]); $j ++) {
-                        foreach (array_keys($tab2[$i][$j]) as $value) {
-                            if ($tab2[$i][$j][$value] == 'res_id') {
-                                $tab2[$i][$j]['res_id'] = $tab2[$i][$j]['value'];
-                                $tab2[$i][$j]["label"] = _GED_NUM;
-                                $tab2[$i][$j]["size"] = "10";
-                                $tab2[$i][$j]["label_align"] = "left";
-                                $tab2[$i][$j]["align"] = "right";
-                                $tab2[$i][$j]["valign"] = "bottom";
-                                $tab2[$i][$j]["show"] = false;
-                            }
-                            if ($tab2[$i][$j][$value] == "type_label") {
-                                $tab2[$i][$j]["value"] = $request->show_string(
-                                    $tab2[$i][$j]["value"]
-                                );
-                                $tab2[$i][$j]["label"] = _TYPE;
-                                $tab2[$i][$j]["size"] = "40";
-                                $tab2[$i][$j]["label_align"] = "left";
-                                $tab2[$i][$j]["align"] = "left";
-                                $tab2[$i][$j]["valign"] = "bottom";
-                                $tab2[$i][$j]["show"] = true;
-                            }
-                        }
-                    }
-                }
-            }
-            if (count($tab2) > 0 ) $nbr_docs = ' ('.count($tab2).')';  else $nbr_docs = '';
-            ?>
-            <div id="archived-doc" onclick="tabClick('archived-doc')" class="folder-tab"><?php echo _ARCHIVED_DOC.$nbr_docs;?></div>
-            <?php
-                if($core->is_module_loaded('notes'))
-                {
-                    require_once "modules" . DIRECTORY_SEPARATOR . "notes" . DIRECTORY_SEPARATOR
-                        . "class" . DIRECTORY_SEPARATOR
-                        . "class_modules_tools.php";
-                    $notes_tools    = new notes();
-                    
-                    //Count notes
-                    $nbr_notes = $notes_tools->countUserNotes($_SESSION['current_folder_id'], 'folder');
-                    if ($nbr_notes > 0 ) $nbr_notes = ' ('.$nbr_notes.')';  else $nbr_notes = '';
-                    //Notes iframe
-                    ?>
-                    <div id="notes" onclick="tabClick('notes')" class="folder-tab"><?php echo _NOTES.$nbr_notes;?></div>
-                    <?php
-                }
-            ?> 
-            <div id="folder-history" onclick="tabClick('folder-history')" class="folder-tab"><?php echo _FOLDER_HISTORY;?></div>
-            <div id="frame-index-folder" class="frame-targ">
-            <form method="post" name="index_folder" id="index_folder" action="index.php?page=show_folder&module=folder&id=<?php functions::xecho($_SESSION['current_folder_id']) ?>">
-                <h2><span class="date"><b><?php echo _FOLDER_DETAILLED_PROPERTIES;?></b></span></h2>
-                <br/>
-                <table cellpadding="2" cellspacing="2" border="0" class="block forms details" width="100%">
-                    <tr>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _FOLDERID_LONG;?> :</th>
-                        <td ><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['folder_id'] );?>" size="40" id="folder_id" name="folder_id" /></td>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _FOLDERNAME;?> :</th>
-                        <?php if ($updateRight) { ?>
-                            <td><input type="text" value="<?php functions::xecho($folderArray['folder_name']);?>" id="folder_name" name="folder_name" /></td>
-                        <?php } else { ?>
-                            <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['folder_name']);?>" id="folder_name" name="folder_name" /></td>
-                        <?php } ?>
-                    </tr>
-                    <tr>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _FOLDERTYPE;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['foldertype_label']);?>" id="foldertype"  name="foldertype" />
-                        <input type="hidden" name="foldertype_id" id="foldertype_id" value="<?php functions::xecho($folderArray['foldertype_id']);?>" />
-                        </td>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _STATUS;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['status']);?>" id="status" name="status" /></td>
-                    </tr>
-                    <?php if (isset($_SESSION['user']['primaryentity']['id'])) { ?>
-                    <tr>
-                        <th align="left" class="picto">&nbsp;</th>
-                        <th><?php echo _FOLDER_DESTINATION_SHORT;?> :</th>
-                        <td><input name="folder_dest" id="folder_dest" type="checkbox" style="margin-left: -0.5%" <?php if ($folderArray['destination']) {?> checked <?php }?>/></td>
-                    </tr>
-                    <?php } ?>
-                </table>
-                <?php 
-            if (count($folderArray['index']) > 0) {
-            ?>
-    		    <br/>
-                <h2>
-                	<span class="date">
-                		<b><?php echo _OPT_INDEXES;?></b>
-                    </span>
-                </h2>
-                <br/>
-                <table cellpadding="2" cellspacing="2" border="0" class="block forms details" width="100%">
-                    <?php
-                            $i=0;
-                            foreach(array_keys($folderArray['index']) as $key)
-                            {
-                                if($i%2 != 1 || $i==0) // pair
-                                {
-                                    ?>
-                                    <tr class="col">
-                                    <?php
-                                }?>
-                                <th align="left" class="picto" >
-                                    <?php
-                                    if(isset($indexes[$key]['img']))
-                                    {
-                                        ?>
-                                        <img alt="<?php functions::xecho($folderArray['index'][$key]['label']);?>" title="<?php functions::xecho($folderArray['index'][$key]['label']);?>" src="<?php functions::xecho($folderArray['index'][$key]['img']);?>"  /></a>
-                                        <?php
-                                    }
-                                    ?>&nbsp;
-                                </th>
-                                <th align="left" >
-                                    <?php functions::xecho($folderArray['index'][$key]['label']);?> :
-                                </th>
-                                <td>
-                                    <?php
-                                    if($updateRight)
-                                    {
-                                        $value = '';
-                                        if(!empty($folderArray['index'][$key]['show_value']))
-                                        {
-                                            $value = $folderArray['index'][$key]['show_value'];
-                                        }
-                                        if($folderArray['index'][$key]['type_field'] == 'input')
-                                        {
-                                            if($folderArray['index'][$key]['type'] == 'date')
-                                            {
-                                                ?>
-                                                <input type="text" name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" value="<?php functions::xecho($value);?>" size="40"  title="<?php functions::xecho($value);?>" alt="<?php functions::xecho($value);?>" onclick="showCalender(this);" />
-                                                <?php
-                                            }
-                                            else
-                                            {
-                                                ?>
-                                                <input type="text" name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" value="<?php functions::xecho($value);?>" size="40"  title="<?php functions::xecho($value);?>" alt="<?php functions::xecho($value);?>" />
-                                                <?php
-                                            }
-                                        }
-                                        else
-                                        {
-                                            ?>
-                                            <select name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" >
-                                                <option value=""><?php echo _CHOOSE;?>...</option>
-                                                <?php foreach($folderArray['index'][$key]['values'] as $folderOptIndexValue)
-                                                {?>
-                                                    <option value="<?php functions::xecho($folderOptIndexValue['id']);?>" <?php if($folderOptIndexValue['id'] == $folderArray['index'][$key]['value'] || $folderOptIndexValue['id'] == $value){ echo 'selected="selected"';}?>><?php functions::xecho($folderOptIndexValue['label']);?></option>
-                                                    <?php
-                                                }?>
-                                            </select>
-                                                <?php
-                                        }
-
-                                    }
-                                    else
-                                    {
-                                    ?>
-                                        <input type="text" name="<?php functions::xecho($key);?>" id="<?php functions::xecho($key);?>" value="<?php functions::xecho($folderArray['index'][$key]['show_value']);?>" size="40"  title="<?php functions::xecho($folderArray['index'][$key]['show_value']);?>" alt="<?php functions::xecho($folderArray['index'][$key]['show_value']);?>" readonly="readonly" class="readonly" />
-                                        <?php
-                                    }
-                                    if($folderArray['index'][$key]['mandatory'] == 'Y'){?>
-                                        <span class="red_asterisk" id="indexes_mandatory" style="display:inline;vertical-align:text-top"><i class="fa fa-star"></i></span>
-                                    <?php 
-                                    }
-                                ?>
-                                </td>
-                                <?php
-                                if($i%2 == 1 && $i!=0) // impair
-                                {?>
-                                    </tr>
-                                    <?php
-                                }
-                                else
-                                {
-                                    if($i+1 == count($folderArray['index']))
-                                    {
-                                        echo '<td  colspan="2">&nbsp;</td></tr>';
-                                    }
-                                }
-                                $i++;
-                        }
-                ?></table><?php
-} 
-?>
-                <br/>
-                <h2>
-                    <span class="date"><b><?php echo _FOLDER_PROPERTIES;?></b></span>
-                </h2>
-                <br/>
-                <table cellpadding="2" cellspacing="2" border="0" class="block forms details" width="100%">
-                    <tr>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _TYPIST;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['typist']);?>" name="typîst" id="typist" /></td>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _CREATION_DATE;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['creation_date']);?>" id="creation_date" name="creation_date"  /></td>
-                    </tr>
-                    <tr>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _SYSTEM_ID;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['system_id']);?>" name="system_id" id="system_id" /></td>
-                        <th align="left" class="picto" >&nbsp;</th>
-                        <th ><?php echo _MODIFICATION_DATE;?> :</th>
-                        <td><input type="text" class="readonly" readonly="readonly" value="<?php functions::xecho($folderArray['last_modified_date']);?>" id="modification_date" name="modification_date"  /></td>
-                    </tr>
-                </table>
-                <br/>
-                <p class="buttons" align="center">
-                    <?php if($updateRight > 0)
-                    {
-                        ?><input type="submit" class="button" name="update_folder" id="update_folder" value="<?php echo _UPDATE_FOLDER;?>" /><?php
-                    }?>
-                    <?php if($deleteRight)
-                        {
-                    //Vérifie si l'utilisateur est propriétaire du dossier. Si il n'est pas le propriétaire, il ne pourra pas le supprimer. 
-                    $stmt = $db->query("SELECT typist FROM folders WHERE folders_system_id= ?", array($s_id));
-                    $typist = $stmt->fetchObject();
-                    $typist = $typist->typist;
-
-                    if($typist == $_SESSION['user']['UserId'] or $_SESSION['user']['UserId'] == 'superadmin'){
-
-                            ?>
-                        <input type="submit" class="button"  value="<?php echo _DELETE_FOLDER;?>" name="delete_folder" onclick="return(confirm('<?php echo _REALLY_DELETE.' '._THIS_FOLDER.'?\n\r\n\r'._WARNING.' '._ALL_DOCS_AND_SUFOLDERS_WILL_BE_DELETED;?>'));" />
-                        <?php
-                            }else{
-
-                                ?>
-                        <input type="submit" class="button" onclick="alert('<?php echo _WARNING.'\n\r\n\r'._NOT_THE_OWNER_OF_THIS_FOLDER.$typist;?>')";  value="<?php echo _DELETE_FOLDER;?>" />
-                        <?php
-
-
-                            }
-                         } ?>
-                </p>
-                </form>
-            </div>
-            <div id="frame-archived-doc" class="frame-targ">
-                <table width="100%" border="0">
-                    <tr>
-                        <td width="50%"valign="top">
-                            <div align="left">
-                <?php
-                if (count($tab2) > 0 ) {
-                
-                    $_SESSION['FILLING_RES']['PARAM']['RESULT'] = array();
-                    $_SESSION['FILLING_RES']['PARAM']['RESULT'] = $tab2;
-                    $_SESSION['FILLING_RES']['PARAM']['NB_TOTAL'] = count($tab2);
-                    $_SESSION['FILLING_RES']['PARAM']['TITLE'] =  count($tab2) . " " . _FOUND_DOC;
-                    $_SESSION['FILLING_RES']['PARAM']['WHAT'] = 'res_id';
-                    $_SESSION['FILLING_RES']['PARAM']['NAME'] = "filling_res";
-                    $_SESSION['FILLING_RES']['PARAM']['KEY'] = 'res_id';
-                    $details_page = $sec->get_script_from_coll($_SESSION['current_foldertype_coll_id'], 'script_details');
-                    $_SESSION['FILLING_RES']['PARAM']['DETAIL_DESTINATION'] = $details_page."";
-                    $_SESSION['FILLING_RES']['PARAM']['BOOL_VIEW_DOCUMENT'] = true;
-                    $_SESSION['FILLING_RES']['PARAM']['BOOL_RADIO_FORM'] = false;
-                    $_SESSION['FILLING_RES']['PARAM']['METHOD'] = "";
-                    $_SESSION['FILLING_RES']['PARAM']['ACTION'] = "";
-                    $_SESSION['FILLING_RES']['PARAM']['BUTTON_LABEL'] = "";
-                    $_SESSION['FILLING_RES']['PARAM']['BOOL_DETAIL'] = true;
-                    $_SESSION['FILLING_RES']['PARAM']['BOOL_ORDER'] = false;
-                    $_SESSION['FILLING_RES']['PARAM']['BOOL_FRAME'] = true;
-                
-                    ?>
-                    <iframe name="filling_res" id="filling_res" src="<?php  
-                    echo $_SESSION['config']['businessappurl']
-                        . "index.php?display=true&module=folder&page=filling_res";
-                        ?>" frameborder="0" scrolling="auto" width="100%" height="580px"></iframe>
-                    <?php
-                }
-                else
-                {
-                    echo "&nbsp;";
-                }
-                ?>
-                        </div>
-                    </td>
-                    <td valign="top" style="border-left: 1px solid #CCCCCC;">
-                        <iframe name="view_doc" id="view_doc" src="<?php echo $_SESSION['config']['businessappurl']
-                            ."index.php?display=true&module=folder&page=list_doc";
-                            ?>" frameborder="0" scrolling="auto" width="550px" height="580px"></iframe>
-                    </td>
-                </tr>
-            </table>
-            </div>
-            <div id="frame-notes" class="frame-targ">
-                    <h2><?php echo _NOTES;?></h2>
-                    <iframe name="notes_folder" id="notes_folder" src="<?php
-                        echo $_SESSION['config']['businessappurl'];
-                        ?>index.php?display=true&module=notes&page=notes&identifier=<?php 
-                        echo $_SESSION['current_folder_id'];?>&origin=folder&load&size=full" 
-                        frameborder="0" scrolling="no" width="100%" height="560px"></iframe>
-            </div>
-             <div id="frame-folder-history" class="frame-targ">
-                <iframe name="history_folder" id="history_folder" src="<?php
-                    echo $_SESSION['config']['businessappurl'];
-                    ?>index.php?display=true&module=folder&page=folder_history&load&size=full&id=<?php 
-                    echo $_SESSION['current_folder_id'];?>" frameborder="0" scrolling="no" width="100%" height="590px"></iframe>
-            </div> 
-        </div>
-    </div>
-</div>
-
-<script type="text/javascript">
-    var item  = $('details_div');
-    if(item)
-    {
-        item.style.display='block';
-    }
-    $j('#index-folder').click();  
-</script>
diff --git a/modules/folder/xml/IVS/data_types.xml b/modules/folder/xml/IVS/data_types.xml
deleted file mode 100755
index 710b3b56651..00000000000
--- a/modules/folder/xml/IVS/data_types.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<dataTypes>
-
-</dataTypes>
\ No newline at end of file
diff --git a/modules/folder/xml/IVS/requests_definitions.xml b/modules/folder/xml/IVS/requests_definitions.xml
deleted file mode 100755
index ed2f5ec2c5f..00000000000
--- a/modules/folder/xml/IVS/requests_definitions.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<requestDefinitions>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_ajax_get_folder" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="ajax_get_folder"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_ajax_get_project" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="ajax_get_project"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_autocomplete_folders" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="autocomplete_folders"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_choose_doctypes" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="choose_doctypes"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_create_folder_get_folder_index" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="create_folder_get_folder_index"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_documents_list_in_details" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="documents_list_in_details"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_documents_list_in_folder" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="documents_list_in_folder"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_folder_history" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="folder_history"/>
-    </requestDefinition>fo_folders_list_by_id
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_folders_list_by_id" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="folders_list_by_id"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_folders_list_by_name" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="folders_list_by_name"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_add" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_add"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_form" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_add_db"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_del" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_del"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_list_by_name" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_list_by_name"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertypes" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertypes"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_up" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_up"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_foldertype_form" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="foldertype_up_db"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_get_folder_search_index" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="get_folder_search_index"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_get_foldertypes" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="get_foldertypes"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_get_folder_view_stats_val" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="get_folder_view_stats_val"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_get_tree_info" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="get_tree_info"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_list_doc" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="list_doc"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_manage_create_folder" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="manage_create_folder"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_search_adv_folder_result" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="search_adv_folder_result"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_select_user_report" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="select_user_report"/>
-    </requestDefinition>
-    <requestDefinition method="GET" path="/apps/maarch_entreprise/index.php" validationRule="fo_show_folder" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="show_folder"/>
-    </requestDefinition>
-    <requestDefinition method="POST" path="/apps/maarch_entreprise/index.php" validationRule="fo_show_folder" >
-      <parameter name="module" value="folder"/>
-      <parameter name="page" value="show_folder"/>
-    </requestDefinition>
-
-
-</requestDefinitions>
\ No newline at end of file
diff --git a/modules/folder/xml/IVS/validation_rules.xml b/modules/folder/xml/IVS/validation_rules.xml
deleted file mode 100755
index 4bbad47e4c9..00000000000
--- a/modules/folder/xml/IVS/validation_rules.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<validationRules>
-    <validationRule name="fo_ajax_get_folder" extends="standardForm" mode="error">
-      <parameter name="id_subfolder" type="integer" />
-      <parameter name="folders_system_id" type="integer" />
-      <parameter name="FOLDER_TREE" type="boolean" />
-      <parameter name="FOLDER_TREE_DOCS" type="boolean" />
-      <parameter name="FOLDER_TREE_RESET" type="boolean" />
-      <parameter name="AUTOFOLDERS_TREE" type="boolean" />
-      <parameter name="AUTOFOLDER_FOLDERS" type="boolean" />
-      <parameter name="AUTOFOLDER_FOLDER_DOCS" type="boolean" />
-      <parameter name="path_folder" type="string" />
-      <parameter name="folder_level" type="string" />
-      <parameter name="id" type="identifier" />
-    </validationRule>
-    <validationRule name="fo_ajax_get_project" extends="standardForm" mode="error">
-      <parameter name="id_market" type="integer" />
-    </validationRule>
-    <validationRule name="fo_autocomplete_folders" extends="standardForm" mode="error">
-      <parameter name="Input" type="string" />
-      <parameter name="mode" type="identifier" />
-    </validationRule>
-    <validationRule name="fo_choose_doctypes" extends="standardForm" mode="error">
-      <parameter name="doctypes" type="string" />
-      <parameter name="doctypeslist" type="string" />
-    </validationRule>
-    <validationRule name="fo_create_folder_get_folder_index" extends="standardForm" mode="error">
-      <parameter name="foldertype_id" type="integer" />
-    </validationRule>
-    <validationRule name="fo_documents_list_in_details" extends="standardForm" mode="error">
-      <parameter name="listid" type="integer" />
-      <parameter name="url" type="url" />
-    </validationRule>
-    <validationRule name="fo_documents_list_in_folder" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-      <parameter name="coll_id" type="collection_list" />
-    </validationRule>
-      <validationRule name="fo_folder_history" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-      <parameter name="size" type="string" />
-      <parameter name="load" type="string" />
-    </validationRule>
-    <validationRule name="fo_folders_list_by_id" extends="standardForm" mode="error">
-      <parameter name="Input" type="string" />
-    </validationRule>
-    <validationRule name="fo_folders_list_by_name" extends="standardForm" mode="error">
-      <parameter name="folder" type="string" />
-    </validationRule>
-    <validationRule name="fo_foldertype_add" extends="standardForm" mode="error" />
-    <validationRule name="fo_foldertype_form" extends="standardForm" mode="error">
-      <parameter name="id" type="identifier" />
-      <parameter name="foldertypeId" type="identifier" />
-      <parameter name="collection" type="collection_list" />
-      <parameter name="collection_show" type="string" />
-      <parameter name="comment" type="string" />
-      <parameter name="desc" type="string" />
-      <parameter name="fields" type="identifier" />
-      <parameter name="mandatory_fields" type="identifier" />
-      <parameter name="Submit" type="string" />
-    </validationRule>
-    <validationRule name="fo_foldertype_del" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-    </validationRule>
-    <validationRule name="fo_foldertype_list_by_name" extends="standardForm" mode="error" />
-    <validationRule name="fo_foldertypes" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-    </validationRule>
-    <validationRule name="fo_foldertype_up" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-    </validationRule>
-    <validationRule name="fo_get_folder_search_index" extends="standardForm" mode="error">
-      <parameter name="foldertype_id" type="integer" />
-    </validationRule>
-    <validationRule name="fo_get_foldertypes" extends="standardForm" mode="error">
-      <parameter name="coll_id" type="collection_list" />
-    </validationRule>
-    <validationRule name="fo_get_folder_view_stats_val" extends="standardForm" mode="error">
-      <parameter name="type_report" type="identifier" />
-      <parameter name="user" type="login" />
-      <parameter name="date_start" type="datefr" />
-      <parameter name="date_fin" type="datefr" />
-    </validationRule>
-    <validationRule name="fo_get_tree_info" extends="standardForm" mode="error">
-      <parameter name="tree_id" type="identifier" />
-      <parameter name="project" type="string" />
-    </validationRule>
-    <validationRule name="fo_list_doc" extends="standardForm" mode="error">
-      <parameter name="listid" type="string" />
-    </validationRule>
-    <validationRule name="fo_manage_create_folder" extends="standardForm" mode="error">
-      <parameter name="folder_id" type="string" />
-      <parameter name="folder_name" type="string" />
-      <parameter name="folder_parent" type="integer" />
-      <parameter name="foldertype" type="integer" />
-      <parameter name="custom_*" type="string" />
-      <parameter name="folder_dest" type="bool" />
-      <parameter name="validate" type="string" />
-      <parameter name="iframe" type="bool" />
-    </validationRule>
-    <validationRule name="fo_search_adv_folder_result" extends="standardForm" mode="error">
-      <parameter name="coll_id" type="collection_list" />
-      <parameter name="creation_date_start" type="datefr" />
-      <parameter name="creation_date_end" type="datefr" />
-      <parameter name="custom_*" type="string" />
-      <parameter name="folder_id" type="string" />
-      <parameter name="folder_name" type="string" />
-      <parameter name="foldertype_id" type="integer" />
-      <parameter name="imageField" type="string" />
-    </validationRule>
-    <validationRule name="fo_select_user_report" extends="standardForm" mode="error">
-      <parameter name="field" type="string" />
-    </validationRule>
-    <validationRule name="fo_show_folder" extends="standardForm" mode="error">
-      <parameter name="id" type="integer" />
-      <parameter name="system_id" type="integer" />
-      <parameter name="typîst" type="login" />
-      <parameter name="status" type="identifier" />
-      <parameter name="folder_id" type="string" />
-      <parameter name="folder_name" type="string" />
-      <parameter name="folder_parent" type="integer" />
-      <parameter name="foldertype_id" type="integer" />
-      <parameter name="foldertype" type="string" />
-      <parameter name="folder_dest" type="bool" />
-      <parameter name="custom_*" type="string" />
-      <parameter name="creation_date" type="datefr" />
-      <parameter name="modification_date" type="datefr" />
-      <parameter name="update_folder" type="string" />
-      <parameter name="delete_folder" type="string" />
-    </validationRule>
-</validationRules>
\ No newline at end of file
diff --git a/modules/folder/xml/config.xml b/modules/folder/xml/config.xml
deleted file mode 100755
index 78f79f2cc0b..00000000000
--- a/modules/folder/xml/config.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-	<CONFIG>
-		<name>folder</name>
-		<comment>_FOLDERS_COMMENT</comment>
-		<file_prefix>fold</file_prefix>
-		<loaded>true</loaded>
-	</CONFIG>
-	<TABLENAME>
-		<fold_folders>folders</fold_folders>
-		<fold_foldertypes>foldertypes</fold_foldertypes>
-		<fold_foldertypes_doctypes>foldertypes_doctypes</fold_foldertypes_doctypes>
-		<fold_foldertypes_indexes>foldertypes_indexes</fold_foldertypes_indexes>
-		<fold_foldertypes_doctypes_level1>foldertypes_doctypes_level1</fold_foldertypes_doctypes_level1>
-	</TABLENAME>
-    <VIEW>
-        <view_folders>view_folders</view_folders>
-    </VIEW>
-	<HISTORY>
-		<folderdel>true</folderdel>
-		<folderadd>true</folderadd>
-		<folderup>true</folderup>
-		<folderview>true</folderview>
-		<foldertypeadd>true</foldertypeadd>
-		<foldertypeup>true</foldertypeup>
-		<foldertypedel>true</foldertypedel>
-	</HISTORY>
-	<KEYWORDS>
-		<id>FOUT</id>
-		<label>_FOLDER_OUT</label>
-	</KEYWORDS>
-	<!--<KEYWORDS>
-		<id>VIEW</id>
-		<label>_VIEW</label>
-	</KEYWORDS>-->
-</root>
diff --git a/modules/folder/xml/folder_index.xml b/modules/folder/xml/folder_index.xml
deleted file mode 100755
index d09dafa6e85..00000000000
--- a/modules/folder/xml/folder_index.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- You can use all fields in the folder table excepts these :
-  * folders_system_id
-  * folder_id
-  * foldertype_id
-  * parent_id
-  * typist
-  * status
-  * folder_level
-  * creation_date
-  * folder_out_id
-  * is_complete
-  * is_folder_out
-  * last_modified_date
--->
-<ROOT>
-	<INDEX>
-		<column>custom_t2</column>
-		<label>_STRING</label>
-		<type>string</type>
-		<img>default_string.gif</img>
-		<default_value>test</default_value>
-	</INDEX>
-	<INDEX>
-		<column>custom_t3</column>
-		<label>Couleur</label>
-		<type>string</type>
-		<img>default_string.gif</img>
-		<values_list> <!-- If id are numpbers, always start with 1, never with 0 -->
-			<value>
-				<id>1</id>
-				<label>Bleu</label>
-			</value>
-			<value>
-				<id>2</id>
-				<label>Blanc</label>
-			</value>
-			<value>
-				<id>3</id>
-				<label>Rouge</label>
-			</value>
-		</values_list>
-		<default_value>1</default_value>
-	</INDEX>
-	<INDEX>
-		<column>custom_d1</column>
-		<label>_DATE</label>
-		<type>date</type>
-		<img>default_date.gif</img>
-	</INDEX>
-	<INDEX>
-		<column>custom_n1</column>
-		<label>_INTEGER</label>
-		<type>integer</type>
-		<img>default_number.gif</img>
-	</INDEX>
-	<INDEX>
-		<column>custom_f1</column>
-		<label>_FLOAT</label>
-		<type>float</type>
-		<img>default_number.gif</img>
-	</INDEX>
-
-</ROOT>
\ No newline at end of file
diff --git a/modules/folder/xml/menu.xml b/modules/folder/xml/menu.xml
deleted file mode 100755
index 1ac1451fca2..00000000000
--- a/modules/folder/xml/menu.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-	<MENU>
-		<id>create_folder</id>
-		<libconst>_CREATE_FOLDER</libconst>
-		<url>index.php?page=create_folder_form&amp;module=folder</url>
-		<style>fa fa-folder-open</style>
-	</MENU>
-	<MENU>
-		<id>folder_search</id>
-		<libconst>_FOLDER_SEARCH</libconst>
-		<url>index.php?page=search_adv_folder&amp;module=folder</url>
-		<style>fa fa-folder</style>
-	</MENU>
-	<MENU>
-		<id>view_folder_tree</id>
-		<libconst>_VIEW_FOLDER_TREE</libconst>
-		<url>index.php?page=search_folder_tree&amp;module=folder</url>
-		<style>fa fa-code-branch</style>
-	</MENU>
-</root>
\ No newline at end of file
diff --git a/modules/folder/xml/services.xml b/modules/folder/xml/services.xml
deleted file mode 100755
index 06ba39de238..00000000000
--- a/modules/folder/xml/services.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-    <SERVICE>
-        <id>folder_search</id> <!-- if servicetype = menu, this id must be equal to the id of the menu item -->
-        <name>_FOLDER_SEARCH</name>
-        <comment>_FOLDER_SEARCH</comment>
-        <servicepage>index.php?page=search_adv_folder&amp;module=folder</servicepage>
-        <servicetype>menu</servicetype>
-        <system_service>false</system_service>
-        <enabled>true</enabled>
-        <style>fa fa-folder</style>
-        <angular>false</angular>
-    </SERVICE>
-    <SERVICE>
-        <id>view_folder_tree</id>
-        <name>_VIEW_FOLDER_TREE</name>
-        <comment>_VIEW_FOLDER_TREE</comment>
-        <servicepage>index.php?page=search_folder_tree&amp;module=folder</servicepage>
-        <servicetype>menu</servicetype>
-        <system_service>false</system_service>
-        <enabled>true</enabled>
-        <style>fa fa-code-branch</style>
-        <angular>false</angular>
-    </SERVICE>
-    <SERVICE>
-        <id>select_folder</id>
-        <name>_SELECT_FOLDER</name>
-        <comment>_SELECT_FOLDER</comment>
-        <servicepage>select_folder</servicepage>
-        <servicetype>use</servicetype>
-        <system_service>true</system_service>
-        <enabled>true</enabled>
-        <WHEREAMIUSED>
-            <page>add_batch.php</page>
-            <nature>tab</nature>
-            <tab_label>_STEP_ONE</tab_label>
-            <tab_order>1</tab_order>
-        </WHEREAMIUSED>
-    </SERVICE>
- <!-- <SERVICE>
-   <id>show_missing_doc_in_folder</id>
-   <name>_MISSING_DOC</name>
-   <comment>_MISSING_DOC</comment>
-   <servicepage>missing_res.php</servicepage>
-   <servicetype>use</servicetype>
-    <system_service>true</system_service>
-   <enabled>true</enabled>
-    <WHEREAMIUSED>
-     <page>index.php?page=show_folder</page>
-     <nature>include</nature>
-   </WHEREAMIUSED>
- </SERVICE>-->
-  <SERVICE>
-   <id>show_history_folder</id>
-   <name>_FOLDER_HISTORY</name>
-   <comment>_FOLDER_HISTORY</comment>
-   <servicepage>folder_history.php</servicepage>
-   <servicetype>use</servicetype>
-    <system_service>true</system_service>
-   <enabled>true</enabled>
-   <WHEREAMIUSED>
-     <page>index.php?page=show_folder</page>
-     <nature>include</nature>
-   </WHEREAMIUSED>
- </SERVICE>
-  <SERVICE>
-   <id>modify_folder</id>
-   <name>_MODIFY_FOLDER</name>
-   <comment>_MODIFY_FOLDER</comment>
-   <servicepage>none</servicepage>
-   <servicetype>use</servicetype>
-    <system_service>false</system_service>
-   <enabled>true</enabled>
-  </SERVICE>
-  <SERVICE>
-   <id>associate_folder</id>
-   <name>_ATTACH_DOC_TO_FOLDER</name>
-   <comment>_ATTACH_DOC_TO_FOLDER</comment>
-   <servicepage>none</servicepage>
-   <servicetype>use</servicetype>
-    <system_service>false</system_service>
-   <enabled>true</enabled>
-  </SERVICE>
-  <SERVICE>
-   <id>delete_folder</id>
-   <name>_DELETE_FOLDER</name>
-   <comment>_DELETE_FOLDER</comment>
-   <servicepage>none</servicepage>
-   <servicetype>use</servicetype>
-    <system_service>false</system_service>
-   <enabled>true</enabled>
-  </SERVICE>
-  <SERVICE>
-   <id>admin_foldertypes</id>
-   <name>_FOLDERTYPES</name>
-   <comment>_ADMIN_FOLDERTYPES_DESC</comment>
-   <servicepage>index.php?page=foldertypes&amp;module=folder</servicepage>
-   <servicetype>admin</servicetype>
-   <category>classement</category>
-    <system_service>false</system_service>
-   <style>fa fa-briefcase</style>
-   <enabled>true</enabled>
- </SERVICE>
-    <SERVICE>
-        <id>create_folder</id>
-        <name>_CREATE_FOLDER</name>
-        <comment>_CREATE_FOLDER</comment>
-        <servicepage>index.php?page=create_folder_form&amp;module=folder</servicepage>
-        <servicetype>menu</servicetype>
-        <system_service>false</system_service>
-        <enabled>true</enabled>
-        <style>fa fa-folder-open</style>
-        <angular>false</angular>
-    </SERVICE>
- <SERVICE>
-   <id>folder_freeze</id>
-   <name>_FREEZE_FOLDER</name>
-   <comment>_FREEZE_FOLDER</comment>
-   <servicepage>folder_freeze.php</servicepage>
-   <servicetype>use</servicetype>
-   <system_service>false</system_service>
-   <enabled>true</enabled>
-   <WHEREAMIUSED>
-     <page>show_folder</page>
-     <nature>include</nature>
-   </WHEREAMIUSED>
- </SERVICE>
- <SERVICE>
-   <id>close_folder</id>
-   <name>_CLOSE_FOLDER</name>
-   <comment>_CLOSE_FOLDER</comment>
-   <servicepage>close_folder.php</servicepage>
-   <servicetype>use</servicetype>
-   <system_service>false</system_service>
-   <enabled>true</enabled>
-   <WHEREAMIUSED>
-     <page>show_folder</page>
-     <nature>include</nature>
-   </WHEREAMIUSED>
- </SERVICE>
-</root>
diff --git a/modules/notes/notes.php b/modules/notes/notes.php
index 4724a28958d..e0556d9f9fd 100755
--- a/modules/notes/notes.php
+++ b/modules/notes/notes.php
@@ -47,7 +47,7 @@ if (isset($_REQUEST['origin']) && !empty($_REQUEST['origin'])) {
     $origin = $_REQUEST['origin'];
 }
 
-if (empty($origin) || $origin != 'folder') {
+if (empty($origin)) {
     $user = \User\models\UserModel::getByLogin(['login' => $_SESSION['user']['UserId'], 'select' => ['id']]);
     $right = \Resource\controllers\ResController::hasRightByResId(['resId' => [$identifier], 'userId' => $user['id']]);
     if (!$right) {
@@ -130,11 +130,7 @@ if (isset($_REQUEST['load'])) {
         $where_tab[] = "type = ?";
         $where_tab[] = "notes.id in (select notes.id from notes left join note_entities on notes.id = note_entities.note_id where item_id IS NULL OR item_id = '".$_SESSION['user']['primaryentity']['id']."' or notes.user_id = '".$_SESSION['user']['UserId']."')";
         $arrayPDO = array($identifier);
-        if (empty($origin) || $origin != 'folder') {
-            $arrayPDO[] = 'resource';
-        } else {
-            $arrayPDO[] = 'folder';
-        }
+        $arrayPDO[] = 'resource';
 
         //Build where
         $where = implode(' and ', $where_tab);
diff --git a/modules/notes/notes_ajax_content.php b/modules/notes/notes_ajax_content.php
index 6f5be2aa78c..faf3d0084bd 100755
--- a/modules/notes/notes_ajax_content.php
+++ b/modules/notes/notes_ajax_content.php
@@ -113,14 +113,6 @@ if (isset($_REQUEST['origin']) && !empty($_REQUEST['origin'])) {
         $list_origin = "loadList('".$_SESSION['config']['businessappurl']
                 ."index.php?display=true&module=notes&page=notes&identifier="
                 .$identifier."&origin=document".$parameters."', 'divList', true);";
-    } elseif ($_REQUEST['origin'] == "folder") {
-        
-        //From folders
-        $collId = 'folders';
-        $table = $_SESSION['tablename']['fold_folders'];
-        $list_origin = "loadList('".$_SESSION['config']['businessappurl']
-                    ."index.php?display=true&module=notes&page=notes&identifier="
-                    .$identifier."&origin=folder".$parameters."', 'divList', true);";
     }
 }
 
@@ -242,14 +234,9 @@ switch ($mode) {
                 
                 //Add notes
                 $notes = $_REQUEST['notes'];
-
                 $userId = $_SESSION['user']['UserId'];
+                $type = 'resource';
 
-                if (empty($_REQUEST['origin']) || $_REQUEST['origin'] != 'folder') {
-                    $type = 'resource';
-                } else {
-                    $type = 'folder';
-                }
                 $db->query(
                     "INSERT INTO " . NOTES_TABLE . "(identifier, note_text, creation_date, user_id, type) VALUES (?, ?, CURRENT_TIMESTAMP, ?, ?)",
                     array($identifier, $notes, $userId, $type)
diff --git a/modules/sendmail/sendmail_ajax_content.php b/modules/sendmail/sendmail_ajax_content.php
index bb9d677ba72..a44df7ce276 100755
--- a/modules/sendmail/sendmail_ajax_content.php
+++ b/modules/sendmail/sendmail_ajax_content.php
@@ -137,14 +137,6 @@ if (isset($_REQUEST['origin']) && !empty($_REQUEST['origin'])) {
         $list_origin = "window.parent.loadList('".$_SESSION['config']['businessappurl']
                 ."index.php?display=true&module=sendmail&page=sendmail&identifier="
                 .$identifier."&origin=document".$parameters."', 'divList', true);";
-    } elseif ($_REQUEST['origin'] == "folder") {
-        
-        //From folders
-        $collId = 'folders';
-        $table = $_SESSION['tablename']['fold_folders'];
-        $list_origin = "window.parent.loadList('".$_SESSION['config']['businessappurl']
-                    ."index.php?display=true&module=sendmail&page=sendmail&identifier="
-                    .$identifier."&origin=folder".$parameters."', 'divList', true);";
     }
 }
 
diff --git a/sql/index_creation.sql b/sql/index_creation.sql
index 322795fdd48..54249c28703 100755
--- a/sql/index_creation.sql
+++ b/sql/index_creation.sql
@@ -2,7 +2,6 @@
 CREATE INDEX type_id_idx ON res_letterbox (type_id);
 CREATE INDEX typist_idx ON res_letterbox (typist);
 CREATE INDEX doc_date_idx ON res_letterbox (doc_date);
-CREATE INDEX folders_system_id_idx ON res_letterbox (folders_system_id);
 CREATE INDEX status_idx ON res_letterbox (status);
 CREATE INDEX destination_idx ON res_letterbox (destination);
 CREATE INDEX dest_user_idx ON res_letterbox (dest_user);
@@ -61,15 +60,6 @@ CREATE INDEX entity_label_idx ON entities (entity_label);
 CREATE INDEX entity_id_idx ON entities (entity_id);
 CREATE INDEX entity_folder_import_idx ON entities (folder_import);
 
--- folders
-CREATE INDEX folders_system_id_folders_idx ON folders (folders_system_id);
-CREATE INDEX parent_id_folders_idx ON folders (parent_id);
-CREATE INDEX folder_name_idx ON folders (folder_name);
-CREATE INDEX subject_idx ON folders (subject);
-
--- foldertypes
-CREATE INDEX foldertype_id_foldertypes_idx ON foldertypes (foldertype_id);
-
 -- groupbasket_redirect
 CREATE INDEX groupbasket_redirect_group_id_idx ON groupbasket_redirect (group_id);
 CREATE INDEX groupbasket_redirect_basket_id_idx ON groupbasket_redirect (basket_id);
diff --git a/sql/reinit_sequences.sql b/sql/reinit_sequences.sql
index f076759b599..90ad0bef875 100755
--- a/sql/reinit_sequences.sql
+++ b/sql/reinit_sequences.sql
@@ -4,8 +4,6 @@ Select setval('res_id_mlb_seq', (select max(res_id)+1 from res_letterbox), false
 Select setval('user_signatures_seq', (select max(id)+1 from user_signatures), false);
 Select setval('templates_seq', (select max(template_id)+1 from templates), false);
 Select setval('tag_id_seq', (select max(tag_id)+1 from tags), false);
-Select setval('folders_system_id_seq', (select max(folders_system_id)+1 from folders), false);
-Select setval('foldertype_id_id_seq', (select max(foldertype_id)+1 from foldertypes), false);
 Select setval('groupbasket_status_system_id_seq', (select max(system_id)+1 from groupbasket_status), false);
 Select setval('groupbasket_redirect_system_id_seq', (select max(system_id)+1 from groupbasket_redirect), false);
 Select setval('actions_id_seq', (select max(id)+1 from actions), false);
diff --git a/sql/sample.sql b/sql/sample.sql
index aa05f14b4b3..e1c44a73fb4 100644
--- a/sql/sample.sql
+++ b/sql/sample.sql
@@ -2,53 +2,53 @@
 TRUNCATE TABLE res_letterbox;
 ALTER SEQUENCE res_id_mlb_seq restart WITH 1;
 -- to sign documents
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (1, NULL, 'Demande de dérogation carte scolaire', '', 305, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_derogation.pdf', '', '0', 24942, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'bbain');
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (2, NULL, 'Demande de travaux route 66', '', 918, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'sva_route_66.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (3, NULL, 'Plainte voisin chien bruyant', '', 503, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'svr_route_chien_bruyant.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud');
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (4, NULL, 'Invitation pour échanges journées des sports', '', 110, 'pdf', 'bbain', NOW(), NOW(), NULL, NULL, 'with_empty_file', NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'empty.pdf', '', '0', 111108, 'ATT_MP', 'PJS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'PJS', 'bbain');
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (5, NULL, 'Demande de place en creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta');
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (6, NULL, 'Relance place en creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'relance_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (1, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'bbain');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (2, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (3, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (4, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'PJS', 'bbain');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (5, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (6, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta');
 -- to annotate documents
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (7, NULL, 'Pétition pour la survie du square Carré', '', 201, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'petition_square_carre.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 7);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (8, NULL, 'Félicitations élections', '', 205, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'felicitations.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 8);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (9, NULL, 'Demande place creche', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'formulaire_place_creche.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta', 9);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (10, NULL, 'Demande subvention jokkolabs', '', 406, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_subvention.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 10);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (11, NULL, 'Facture Maarch', '', 407, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'facture.pdf', '', '0', 24877, 'ATT_MP', 'FIN', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'sstar', 11);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (12, NULL, 'Demande état civil', '', 602, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'etat_civil.pdf', '', '0', 24877, 'ATT_MP', 'DGS', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 12);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (13, NULL, 'Arret maladie vide', '', 701, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'arret_maladie.pdf', '', '0', 24877, 'ATT_MP', 'DRH', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ppruvost', 13);
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
-VALUES (14, NULL, 'Inscription école', '', 307, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'inscription_ecole.pdf', '', '0', 24877, 'ATT_MP', 'PE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta', 14);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (7, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 7);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (8, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 8);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (9, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta', 9);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (10, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 10);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (11, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'sstar', 11);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (12, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'rrenaud', 12);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (13, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ppruvost', 13);
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user, external_signatory_book_id)
+VALUES (14, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ssaporta', 14);
 -- to qualify document
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (15, NULL, 'Demande intervention à qualifier', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'INIT', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (15, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
 -- to validate document
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (16, NULL, 'Demande intervention à valider', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'VAL', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (16, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
 -- to process document ccharles
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (17, NULL, 'Demande intervention à traiter', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (17, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
 -- to process document nnataly
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (18, NULL, 'Demande intervention à envoyer au parapheur', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'NEW', 'PSO', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'nnataly');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (18, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'nnataly');
 -- to paraph document ppetit
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (19, NULL, 'Demande intervention à signer', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'ATT_MP', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (19, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
 -- to archive document ggrand
-INSERT INTO res_letterbox (res_id, title, subject, description, type_id, format, typist, creation_date, modification_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, work_batch, origin, priority, policy_id, cycle_id, is_multi_docservers, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
-VALUES (20, NULL, 'Demande intervention à archiver', '', 505, 'pdf', 'bblier', NOW(), NOW(), NULL, NULL, NULL, NULL, CURRENT_DATE, 'FASTHD_MAN', NULL, 'tests#', 'demande_intervention.pdf', '', '0', 24877, 'END', 'PTE', NULL, NULL, NULL, 'poiuytre1357nbvc', NULL, NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
+INSERT INTO res_letterbox (res_id, title, 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, custom_t1, custom_n1, custom_f1, custom_d1, custom_t2, custom_n2, custom_f2, custom_d2, custom_t3, custom_n3, custom_f3, custom_d3, custom_t4, custom_n4, custom_f4, custom_d4, custom_t5, custom_n5, custom_f5, custom_d5, custom_t6, custom_d6, custom_t7, custom_d7, custom_t8, custom_d8, custom_t9, custom_d9, custom_t10, custom_d10, custom_t11, custom_t12, custom_t13, custom_t14, custom_t15, reference_number, tablename, initiator, dest_user)
+VALUES (20, NULL, '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', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', 'res_letterbox', 'COU', 'ccharles');
 
 Select setval('res_id_mlb_seq', (select max(res_id)+1 from res_letterbox), false);
 
@@ -148,24 +148,24 @@ Select setval('adr_letterbox_id_seq', (select max(id)+1 from adr_letterbox), fal
 
 TRUNCATE TABLE res_attachments;
 ALTER SEQUENCE res_attachment_res_id_seq restart WITH 1;
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (1, 'ar_derogation', NULL, NULL, 0, 'pdf', 'bbain', NOW(), NULL, 'MAARCH/2019D/1', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'ar_derogation.pdf', ' ', '0', 41682, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 1, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 1}');
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (2, 'ar_sva', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/2', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'ar_sva.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 2, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 2}');
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (3, 'ar_svr', NULL, NULL, 0, 'pdf', 'rrenaud', NOW(), NULL, 'MAARCH/2019D/3', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'ar_svr.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 3, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 3}');
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (4, 'invitation', NULL, NULL, 0, 'pdf', 'bbain', '2019-03-20 17:54:00.954235', NULL, 'MAARCH/2019D/4', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'invitation.pdf', ' ', '0', 47379, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 4, 'outgoing_mail', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 4}');
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (5, 'rep_creche', NULL, NULL, 0, 'pdf', 'ssaporta', NOW(), NULL, 'MAARCH/2019D/5', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'rep_creche.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 5, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 5}');
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
-VALUES (6, 'rep_standard', NULL, NULL, 0, 'pdf', 'ssaporta', NOW(), NULL, 'MAARCH/2019D/6', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'rep_standard.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 6, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 6}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (1, 'ar_derogation', NULL, NULL, 0, 'pdf', 'bbain', NOW(), NULL, 'MAARCH/2019D/1', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'ar_derogation.pdf', ' ', '0', 41682, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 1, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 1}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (2, 'ar_sva', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/2', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'ar_sva.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 2, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 2}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (3, 'ar_svr', NULL, NULL, 0, 'pdf', 'rrenaud', NOW(), NULL, 'MAARCH/2019D/3', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'ar_svr.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 3, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 3}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (4, 'invitation', NULL, NULL, 0, 'pdf', 'bbain', '2019-03-20 17:54:00.954235', NULL, 'MAARCH/2019D/4', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'invitation.pdf', ' ', '0', 47379, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 4, 'outgoing_mail', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 4}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (5, 'rep_creche', NULL, NULL, 0, 'pdf', 'ssaporta', NOW(), NULL, 'MAARCH/2019D/5', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'rep_creche.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 5, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 5}');
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id, external_id)
+VALUES (6, 'rep_standard', NULL, NULL, 0, 'pdf', 'ssaporta', NOW(), NULL, 'MAARCH/2019D/6', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'rep_standard.pdf', ' ', '0', 44907, 'FRZ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 6, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL, '{"signatureBookId": 6}');
 -- to process documents nnataly
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id)
-VALUES (7, 'rep_standard', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/7', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'rep_standard_demande_intervention.pdf', ' ', '0', 44907, 'A_TRA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 18, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL);
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id)
+VALUES (7, 'rep_standard', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/7', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'rep_standard_demande_intervention.pdf', ' ', '0', 44907, 'A_TRA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 18, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL);
 -- to paraph documents ppetit
-INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, folders_system_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id)
-VALUES (8, 'rep_standard', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/8', NULL, 1, NULL, 'FASTHD_MAN', NULL, 'tests#', 'rep_standard_demande_intervention.pdf', ' ', '0', 44907, 'A_TRA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 19, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL);
+INSERT INTO res_attachments (res_id, title, subject, description, type_id, format, typist, creation_date, author, identifier, source, relation, doc_date, docserver_id, path, filename, offset_doc, fingerprint, filesize, status, destination, validation_date, effective_date, work_batch, origin, priority, initiator, dest_user, coll_id, res_id_master, attachment_type, dest_contact_id, dest_address_id, updated_by, is_multicontacts, is_multi_docservers, tnl_path, tnl_filename, fulltext_result, in_signature_book, signatory_user_serial_id)
+VALUES (8, 'rep_standard', NULL, NULL, 0, 'pdf', 'ccharles', NOW(), NULL, 'MAARCH/2019D/8', NULL, 1, NULL, 'FASTHD_MAN', 'tests#', 'rep_standard_demande_intervention.pdf', ' ', '0', 44907, 'A_TRA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'letterbox_coll', 19, 'response_project', 4, 6, NULL, NULL, 'N', NULL, NULL, NULL, true, NULL);
 
 Select setval('res_attachment_res_id_seq', (select max(res_id)+1 from res_attachments), false);
 
diff --git a/src/core/lang/lang-en.php b/src/core/lang/lang-en.php
index 0972d096181..61f86c5543e 100755
--- a/src/core/lang/lang-en.php
+++ b/src/core/lang/lang-en.php
@@ -148,7 +148,6 @@ define('_DOCUMENTS_LIST_WITH_ATTACHMENTS', 'List with filters and responses');
 define('_DOCUMENTS_LIST_WITH_AVIS', 'List of mails with recommendation');
 define('_DOCUMENTS_LIST_COPIES', 'List of copies');
 define('_DOCUMENTS_LIST_WITH_SIGNATORY', 'Mails list with signatory');
-define('_FOLDERS_LIST', 'folders list');
 
 // ADMINISTRATION
 define('_USERS', 'Users');
@@ -229,7 +228,6 @@ define('_PRINT_DOC_DETAILS_FROM_SEARCH', 'Print the liaison sheets from the sear
 define('_ATTACHMENTS_COMMENT', 'Attachments management');
 define('_BASKETS_COMMENT', 'Baskets');
 define('_ENTITIES_COMMENT', 'Departments');
-define('_FOLDERS_COMMENT', 'Folders');
 define('_NOTES_COMMENT', 'Notes');
 define('_NOTIFICATIONS_COMMENT', 'Notifications');
 define('_TEMPLATES_COMMENT', 'Templates');
@@ -248,7 +246,6 @@ define('_VIEW_BASKETS', 'My baskets');
 define('_PRINT_SEPS', 'Limiters printing');
 define('_CREATE_FOLDER', 'Create a folder');
 define('_FOLDER_SEARCH', 'Search a folder');
-define('_VIEW_FOLDER_TREE', 'Read a folder');
 define('_SAVE_NUMERIC_PACKAGE', 'Save numeric package');
 define("_SELECT_FOLDER", "Folder selection");
 define("_FOLDER_HISTORY", "Folder's history");
diff --git a/src/core/lang/lang-fr.php b/src/core/lang/lang-fr.php
index a1ca36bc9f4..cb20bf486c6 100755
--- a/src/core/lang/lang-fr.php
+++ b/src/core/lang/lang-fr.php
@@ -148,7 +148,6 @@ define('_DOCUMENTS_LIST_WITH_ATTACHMENTS', 'Liste avec filtres et réponses');
 define('_DOCUMENTS_LIST_WITH_AVIS', 'Liste des courriers avec avis');
 define('_DOCUMENTS_LIST_COPIES', 'Liste des copies');
 define('_DOCUMENTS_LIST_WITH_SIGNATORY', 'Liste des courriers avec signataire');
-define('_FOLDERS_LIST', 'Liste de dossiers');
 
 // ADMINISTRATION
 define('_USERS', 'Utilisateurs');
@@ -229,7 +228,6 @@ define('_PRINT_DOC_DETAILS_FROM_SEARCH', 'Imprimer les fiches de liaison depuis
 define('_ATTACHMENTS_COMMENT', 'Gestion des pièces jointes');
 define('_BASKETS_COMMENT', 'Bannettes');
 define('_ENTITIES_COMMENT', 'Entités');
-define('_FOLDERS_COMMENT', 'Dossiers');
 define('_NOTES_COMMENT', 'Annotations');
 define('_NOTIFICATIONS_COMMENT', 'Notifications');
 define('_TEMPLATES_COMMENT', 'Modèles de document');
@@ -248,7 +246,6 @@ define('_VIEW_BASKETS', 'Mes bannettes');
 define('_PRINT_SEPS', 'Impression des séparateurs');
 define('_CREATE_FOLDER', 'Créer un dossier');
 define('_FOLDER_SEARCH', 'Rechercher un dossier');
-define('_VIEW_FOLDER_TREE', 'Consulter un dossier');
 define('_SAVE_NUMERIC_PACKAGE', 'Enregistrer un pli numérique');
 define("_SELECT_FOLDER", "Sélection Dossier");
 define("_FOLDER_HISTORY", "Historique dossier");
diff --git a/src/core/lang/lang-nl.php b/src/core/lang/lang-nl.php
index 461ce5d4e45..ed44faa1002 100755
--- a/src/core/lang/lang-nl.php
+++ b/src/core/lang/lang-nl.php
@@ -147,7 +147,6 @@ define('_DOCUMENTS_LIST_WITH_ATTACHMENTS', 'Lijst met filters en antwoorden');
 define('_DOCUMENTS_LIST_WITH_AVIS', 'Lijst van de documenten met berichten');
 define('_DOCUMENTS_LIST_COPIES', 'Lijst van de kopieën');
 define('_DOCUMENTS_LIST_WITH_SIGNATORY', 'Lijst van de documenten met ondertekenaar');
-define('_FOLDERS_LIST', 'Lijst van de mappen');
 
 // ADMINISTRATION
 define('_USERS', 'Gebruikers');
@@ -228,7 +227,6 @@ define('_PRINT_DOC_DETAILS_FROM_SEARCH', 'De verbindingsfiche vanuit de zoekopdr
 define('_ATTACHMENTS_COMMENT', 'Beheer van de bijlagen');
 define('_BASKETS_COMMENT', 'Bakjes');
 define('_ENTITIES_COMMENT', 'Eenheden');
-define('_FOLDERS_COMMENT', 'Mappen');
 define('_NOTES_COMMENT', 'Opmerkingen');
 define('_NOTIFICATIONS_COMMENT', 'Meldingen');
 define('_TEMPLATES_COMMENT', 'Documentmodellen');
@@ -247,7 +245,6 @@ define('_VIEW_BASKETS', 'Mijn bakjes');
 define('_PRINT_SEPS', 'Afdrukken van de separatoren');
 define('_CREATE_FOLDER', 'Een map aanmaken');
 define('_FOLDER_SEARCH', 'Een map zoeken');
-define('_VIEW_FOLDER_TREE', 'Een map raadplegen');
 define('_SAVE_NUMERIC_PACKAGE', 'Een digitale brief bewaren');
 define('_SELECT_FOLDER', 'Selectie van de Map');
 define('_FOLDER_HISTORY', 'Historiek map');
diff --git a/src/frontend/app/administration/report/reports-administration.component.html b/src/frontend/app/administration/report/reports-administration.component.html
index bcfab1f4cee..7e2f750b6b6 100755
--- a/src/frontend/app/administration/report/reports-administration.component.html
+++ b/src/frontend/app/administration/report/reports-administration.component.html
@@ -20,7 +20,7 @@
                         </div>
                         <form>
                             <mat-list *ngIf="reports.length > 0 && !loadingOptions">
-                                {{lang.folders}}
+                                <!--{{lang.folders}}
                                 <mat-divider></mat-divider>
                                 <span *ngFor="let report of reports;let i = index">
                                     <mat-list-item *ngIf="report.module == 'folder'">
@@ -29,7 +29,7 @@
                                             {{report.label}}
                                         </mat-checkbox>
                                     </mat-list-item>
-                                </span>
+                                </span>-->
 
                                 {{lang.entities}}
                                 <mat-divider></mat-divider>
@@ -63,4 +63,4 @@
             position='end' [opened]="appService.getViewMode() ? false : false">
         </mat-sidenav>
     </mat-sidenav-container>
-</div>
\ No newline at end of file
+</div>
-- 
GitLab