diff --git a/apps/maarch_entreprise/actions/index_mlb.php b/apps/maarch_entreprise/actions/index_mlb.php
index 02bea2963d56272ae233c5a1e761f36e2e0701d8..59d7f7411f586f5688ec05fe06e2548329c51ce2 100755
--- a/apps/maarch_entreprise/actions/index_mlb.php
+++ b/apps/maarch_entreprise/actions/index_mlb.php
@@ -441,7 +441,7 @@ function get_form_txt($values, $pathManageAction, $actionId, $table, $module, $c
             .'\');">';
     $frmStr .= '<option value="">'._CHOOSE_PRIORITY.'</option>';
     for ($i = 0; $i < count($_SESSION['mail_priorities']); ++$i) {
-        $frmStr .= '<option value="'.functions::xssafe($i).'" ';
+        $frmStr .= '<option value="'.functions::xssafe($_SESSION['mail_priorities_id'][$i]).'" ';
         if ($_SESSION['default_mail_priority'] == $i) {
             $frmStr .= 'selected="selected"';
         }
diff --git a/apps/maarch_entreprise/actions/validate_mail.php b/apps/maarch_entreprise/actions/validate_mail.php
index 60ed9dba38fe4559f110bcd86b3189edc38f98a0..d1b01bb66b07870e14cc78a2fee64f1e9c2688ff 100755
--- a/apps/maarch_entreprise/actions/validate_mail.php
+++ b/apps/maarch_entreprise/actions/validate_mail.php
@@ -505,7 +505,7 @@ function get_form_txt($values, $path_manage_action, $id_action, $table, $module,
                       .'\');">';
     $frm_str .= '<option value="">'._CHOOSE_PRIORITY.'</option>';
     for ($i = 0; $i < count($_SESSION['mail_priorities']); ++$i) {
-        $frm_str .= '<option value="'.functions::xssafe($i).'" ';
+        $frm_str .= '<option value="'.functions::xssafe($_SESSION['mail_priorities_id'][$i]).'" ';
         if (isset($data['type_id']) && $data['priority'] == $i) {
             $frm_str .= 'selected="selected"';
         } elseif ($data['priority'] == '' && $_SESSION['default_mail_priority'] == $i) {
diff --git a/apps/maarch_entreprise/admin/priorities/admin_priorities.php b/apps/maarch_entreprise/admin/priorities/admin_priorities.php
deleted file mode 100755
index 0bb778ced6a4852d3818716cfbef7552bfecf418..0000000000000000000000000000000000000000
--- a/apps/maarch_entreprise/admin/priorities/admin_priorities.php
+++ /dev/null
@@ -1,115 +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/>.
-*
-*   @author <dev@maarch.org>
-*/
-
-$admin = new core_tools();
-$admin->test_admin('admin_priorities', 'apps');
-$_SESSION['m_admin']= array();
-/****************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=admin_priorities&admin=priorities';
-$page_label = _ADMIN_PRIORITIES;
-$page_id = "admin_priorities";
-$admin->manage_location_bar($page_path, $page_label, $page_id, $init, $level);
-/***********************************************************/
-?>
-<h1><i class="fa fa-hdd-o fa-2x"></i> <?php echo _ADMIN_PRIORITIES;?></h1>
-<div id="inner_content" class="clearfix" align="center">
-    <div class="block" style="width: 90%">
-        <h2><?php echo 'Paramètrage des priorités';?></h2>
-        <form id="prioritiesForm" name="prioritiesForm" method="post"
-              action="<?php echo $_SESSION['config']['businessappurl'] . 'index.php?page=priorityManager&admin=priorities&mode=update'; ?>">
-            <table width="45%" class="prioritiesTable" id="prioritiesTable">
-                <tr>
-                   <th width="33%" align="left">
-                       <?php echo _PRIORITY_TITLE ;?>
-                   </th>
-                    <th width="33%" align="left">
-                        <?php echo _PRIORITY_DAYS ;?>
-                    </th>
-                    <th width="33%" align="left">
-                        <?php echo "Méthode de calcul" ;?>
-                    </th>
-                </tr>
-                <?php
-                for ($i = 0; $_SESSION['mail_priorities'][$i]; $i++) {
-                    $wdays = ($_SESSION['mail_priorities_wdays'][$i] == 'true' ? '' : 'selected');
-                    echo "<tr><td align='left'><input name='label_{$i}' id='label_{$i}' placeholder='Priority label' size='18' value='{$_SESSION['mail_priorities'][$i]}'><input type='color' name='color_{$i}' id='color_{$i}' value='".$_SESSION['mail_priorities_color'][$i]."' style='background:none;border:none;width:45px;'/></td>";
-                    if ($_SESSION['mail_priorities_attribute'][$i] == 'false') {
-                        echo "<td align='left'><input name='priority_{$i}' id='priority_{$i}' size='6' value='*'>";
-                    } else {
-                        echo "<td align='left'><input name='priority_{$i}' id='priority_{$i}' size='6' value='{$_SESSION['mail_priorities_attribute'][$i]}'>";
-                    }
-                    echo "</td><td align='left' data-index='{$i}'><select name='working_{$i}' id='working_{$i}'><option value='true'>" . _WORKING_DAYS . "</option><option value='false' {$wdays}>" . _CALENDAR_DAYS . "</option></select>";
-                    echo "&nbsp; &nbsp; <i title='Supprimer la priorité' style='cursor: pointer' class='fa fa-trash fa-lg' onclick='deletePriority(this.parentNode)'></i></td></tr>";
-                }
-                ?>
-                <tr style="display: none" id="priorityAddField">
-                    <td align="left">
-                        <input name='label_new0' id='label_new0' placeholder='Nom priorité' size='18'> <input name='color_new0' id='color_new0' type='color' style='background:none;border:none;width:45px;'>
-                    </td>
-                    <td align="left">
-                        <input name='priority_new0' id='priority_new0' size='6' value='*'>
-                    </td>
-                    <td align='left'>
-                        <select name='working_new0' id='working_new0'>
-                            <option value='true'><?php echo _WORKING_DAYS ;?></option>
-                            <option value='false'><?php echo _CALENDAR_DAYS ;?></option>
-                        </select>
-                    </td>
-                </tr>
-                <tr id="priorityAddButton">
-                    <td colspan="1" align="left">
-                        <i title="Ajouter une priorié" style="cursor: pointer" class="fa fa-plus fa-2x" onclick="addNewRowPriority(this.parentNode.parentNode)"></i>
-                        &nbsp;
-                        <i id="minusButton" title="Enlever une priorié" style="cursor: pointer;display: none" class="fa fa-minus fa-2x" onclick="delNewRowPriority(this.parentNode.parentNode)"></i>
-                    </td>
-<!--                    <td id="minusButton" colspan="2" align="" style="display: none">-->
-<!--                        <i title="Enlever une priorié" style="cursor: pointer" class="fa fa-minus fa-2x" onclick="delNewRowPriority(this.parentNode.parentNode)"></i>-->
-<!--                    </td>-->
-                </tr>
-                <tr>
-                    <td style="padding-bottom: 6%" colspan="3" align="center">
-                        <em>Pour utiliser le délai de traitement lié au type de document, veuillez taper *</em>
-                    </td>
-                </tr>
-                <tr class="buttons">
-                    <td colspan="3" align="center">
-                        <input class="button" type="submit" value="Valider">
-                        <input class="button" type="button" value="<?php echo _CANCEL;?>"
-                               onclick="javascript:window.location.href='<?php echo $_SESSION['config']['businessappurl']; ?>index.php?page=admin&reinit=true';">
-                    </td>
-                </tr>
-
-            </table>
-        </form>
-    </div>
-</div>
diff --git a/apps/maarch_entreprise/admin/priorities/class_priorities.php b/apps/maarch_entreprise/admin/priorities/class_priorities.php
deleted file mode 100755
index 7bec423de6ff2ca787e6f55b5d29998a9723b38a..0000000000000000000000000000000000000000
--- a/apps/maarch_entreprise/admin/priorities/class_priorities.php
+++ /dev/null
@@ -1,26 +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/>.
-*/
-
-require_once 'apps/maarch_entreprise/admin/priorities/class_priorities_Abstract.php';
-
-class Priorities extends PrioritiesAbstract
-{
-    // custom
-}
\ No newline at end of file
diff --git a/apps/maarch_entreprise/admin/priorities/class_priorities_Abstract.php b/apps/maarch_entreprise/admin/priorities/class_priorities_Abstract.php
deleted file mode 100755
index e9e911f47fd40128eec0c608ed3d4f779f481d4c..0000000000000000000000000000000000000000
--- a/apps/maarch_entreprise/admin/priorities/class_priorities_Abstract.php
+++ /dev/null
@@ -1,166 +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/>.
-*/
-
-abstract class PrioritiesAbstract extends Database
-{
-
-    protected function  getXMLPath() {
-        if (file_exists(
-            $_SESSION['config']['corepath'] . 'custom' . DIRECTORY_SEPARATOR
-            . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR
-            . 'apps'.DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
-            . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR
-            . 'entreprise.xml')
-        ) {
-            $path = $_SESSION['config']['corepath'] . 'custom'
-                . DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']
-                . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR
-                . $_SESSION['config']['app_id'] . DIRECTORY_SEPARATOR . 'xml'
-                . DIRECTORY_SEPARATOR . 'entreprise.xml';
-        } else {
-            $path = 'apps' . DIRECTORY_SEPARATOR . $_SESSION['config']['app_id']
-                . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR
-                . 'entreprise.xml';
-        }
-
-        return $path;
-    }
-
-    protected function  setXML($priorities) {
-        $path = $this->getXMLPath();
-
-        $xmlfile = simplexml_load_file($path);
-        $mailPriorities = $xmlfile->priorities;
-        for ($i = 0; $priorities[$i]; $i++) {
-            if (empty($priorities[$i]['add'])) {
-                $mailPriorities->priority[$i] = $priorities[$i]['label'];
-                if ($priorities[$i]['number'] === '*')
-                    $mailPriorities->priority[$i]['with_delay'] = 'false';
-                else
-                    $mailPriorities->priority[$i]['with_delay'] = $priorities[$i]['number'];
-                $mailPriorities->priority[$i]['working_days'] = $priorities[$i]['wdays'];
-                $mailPriorities->priority[$i]['color'] = $priorities[$i]['color'];
-            } else {
-                $newPriority = $mailPriorities->addChild('priority', $priorities[$i]['label']);
-                if ($priorities[$i]['number'] === '*')
-                    $newPriority->addAttribute('with_delay', 'false');
-                else
-                    $newPriority->addAttribute('with_delay', $priorities[$i]['number']);
-                $newPriority->addAttribute('working_days', $priorities[$i]['wdays']);
-                $newPriority->addAttribute('color', $priorities[$i]['color']);
-            }
-        }
-
-        $res = $xmlfile->asXML();
-        $fp = @fopen($path, "w+");
-        if ($fp) {
-            fwrite($fp,$res);
-        }
-    }
-
-    protected function  updateSession() {
-        $_SESSION['mail_priorities']            = [];
-        $_SESSION['mail_priorities_id']         = [];
-        $_SESSION['mail_priorities_attribute']  = [];
-        $_SESSION['mail_priorities_wdays']      = [];
-        $_SESSION['mail_priorities_color']      = [];
-        $_SESSION['default_mail_priority']      = 0;
-
-        $priorities = \Priority\models\PriorityModel::get();
-        $i = 0;
-        foreach ($priorities as $priority) {
-            $_SESSION['mail_priorities'][$i] = $priority['label'];
-            $_SESSION['mail_priorities_id'][$i] = $priority['id'];
-            $_SESSION['mail_priorities_attribute'][$i] = ($priority['delays'] == null ? 'false' : $priority['delays']);
-            $_SESSION['mail_priorities_wdays'][$i] = ($priority['working_days'] ? 'true' : 'false');
-            $_SESSION['mail_priorities_color'][$i] = $priority['color'];
-            if ($priority['default_priority']) {
-                $_SESSION['default_mail_priority'] = $i;
-            }
-            $i++;
-        }
-    }
-
-    protected function  checkPriorities($array) {
-        if (empty($array))
-            return false;
-        foreach ($array as $value) {
-            if (empty($value['label']) || empty($value['number']) || empty($value['wdays'])) {
-                return false;
-            } elseif ($value['wdays'] != 'true' && $value['wdays'] != 'false') {
-                return false;
-            } elseif ($value['number'] === '*') {
-            } elseif (!ctype_digit($value['number'])) {
-                return false;
-            } elseif ((int)$value['number'] < 0) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public function updatePriorities() {
-        $priorities = [];
-       
-        for ($i = 0; isset($_REQUEST[('label_' . $i)]) && isset($_REQUEST[('priority_' . $i)]) && isset($_REQUEST[('working_' . $i)]) && isset($_REQUEST[('color_' . $i)]); $i++) {
-            $priorities[] = ['label' => $_REQUEST[('label_' . $i)], 'number' => $_REQUEST[('priority_' . $i)], 'wdays' => $_REQUEST[('working_' . $i)], 'color' => $_REQUEST[('color_' . $i)]];
-        }
-        for ($i = 0; !empty($_REQUEST[('label_new' . $i)]) && !empty($_REQUEST[('priority_new' . $i)]) && !empty($_REQUEST[('working_new' . $i)]) && !empty($_REQUEST[('color_new' . $i)]); $i++) {
-            $priorities[] = ['add' => 'add', 'label' => $_REQUEST[('label_new' . $i)], 'number' => $_REQUEST[('priority_new' . $i)], 'wdays' => $_REQUEST[('working_new' . $i)], 'color' => $_REQUEST[('color_new' . $i)]];
-        }
-        if ($this->checkPriorities($priorities)) {
-            $this->setXML($priorities);
-            $this->updateSession();
-            $_SESSION['info'] = _PRIORITIES_UPDATED;
-        } else {
-            $_SESSION['error'] = _PRIORITIES_ERROR;
-        }
-    }
-
-    public function deletePriority() {
-        if (isset($_REQUEST['indexToDelete']) && ctype_digit($_REQUEST['indexToDelete'])) {
-            $indexToDelete = (int) $_REQUEST['indexToDelete'];
-
-            $db = new Database();
-
-            $stmt = $db->query("SELECT priority FROM res_letterbox WHERE priority = ? ",
-                [$indexToDelete]
-            );
-
-            if ($stmt->rowCount() == 0) {
-                $path = $this->getXMLPath();
-
-                $xmlfile = simplexml_load_file($path);
-                $mailPriorities = $xmlfile->priorities;
-                unset($mailPriorities->priority[$indexToDelete]);
-                $res = $xmlfile->asXML();
-                $fp = @fopen($path, "w+");
-                if ($fp) {
-                    fwrite($fp,$res);
-                }
-                $this->updateSession();
-            } else {
-                $_SESSION['error'] = _PRIORITIES_ERROR_TAKEN;
-            }
-
-        }
-
-    }
-}
\ No newline at end of file
diff --git a/apps/maarch_entreprise/admin/priorities/priorityManager.php b/apps/maarch_entreprise/admin/priorities/priorityManager.php
deleted file mode 100755
index 07241a8d50199ed0c1313d60f8c91ddd258dd535..0000000000000000000000000000000000000000
--- a/apps/maarch_entreprise/admin/priorities/priorityManager.php
+++ /dev/null
@@ -1,43 +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/>.
-*/
-
-require_once 'apps/'. $_SESSION['config']['app_id'] .'/admin/priorities/class_priorities.php';
-
-
-$core_tools = new core_tools();
-$core_tools->test_admin('admin_priorities', 'apps');
-
-if (isset($_REQUEST['mode']) && !empty($_REQUEST['mode'])) {
-    $mode = $_REQUEST['mode'];
-    $priority = new Priorities();
-    if ($mode === 'update') {
-        $priority->updatePriorities();
-    } elseif ($mode === 'delete') {
-        $priority->deletePriority();
-    }
-}
-?>
-    <script type="text/javascript" >
-        window.location.href='<?php echo $_SESSION['config']['businessappurl']; ?>index.php?page=admin_priorities&admin=priorities';
-    </script>
-
-<?php
-exit;
\ No newline at end of file
diff --git a/apps/maarch_entreprise/definition_mail_categories.php b/apps/maarch_entreprise/definition_mail_categories.php
index 2457f4ca4344d603f725fbe3a680129b0cb2328a..df829050a7816c926ced23b96c8eac9c04899304 100644
--- a/apps/maarch_entreprise/definition_mail_categories.php
+++ b/apps/maarch_entreprise/definition_mail_categories.php
@@ -78,8 +78,8 @@ $_ENV['categories']['incoming'] = array();
 $_ENV['categories']['incoming']['img_cat'] = '<i class="fa fa-arrow-right fa-2x"></i>';
 $_ENV['categories']['incoming']['other_cases'] = array();
 $_ENV['categories']['incoming']['priority'] = array(
-    'type_form' => 'integer',
-    'type_field' => 'integer',
+    'type_form' => 'string',
+    'type_field' => 'string',
     'mandatory' => false,
     'label' => _PRIORITY,
     'table' => 'res',
@@ -943,10 +943,10 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
                             }
                         } elseif ($field == 'priority') {
                             foreach (array_keys($_SESSION['mail_priorities']) as $prio) {
-                                array_push($data[$field]['select'], array(
-                                                'ID' => $prio,
-                                                'LABEL' => $_SESSION['mail_priorities'][$prio],
-                                            ));
+                                $data[$field]['select'][] = [
+                                    'ID'    => $_SESSION['mail_priorities_id'][$prio],
+                                    'LABEL' => $_SESSION['mail_priorities'][$prio],
+                                ];
                             }
                         }
                     }
@@ -1106,7 +1106,12 @@ function get_general_data($coll_id, $res_id, $mode, $params = array())
             }
             // special cases :
             if ($arr[$i] == 'priority') {
-                $data[$arr[$i]]['show_value'] = $_SESSION['mail_priorities'][$line->{$arr[$i]}];
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $line->priority) {
+                        $fakeId = $key;
+                    }
+                }
+                $data[$arr[$i]]['show_value'] = $_SESSION['mail_priorities'][$fakeId];
             } elseif ($arr[$i] == 'destination') {
                 $stmt2 = $db->query('SELECT entity_label FROM '.$_SESSION['tablename']['ent_entities'].' WHERE entity_id = ?', array($line->{$arr[$i]}));
                 if ($stmt2->rowCount() == 1) {
diff --git a/apps/maarch_entreprise/documents_list_copies.php b/apps/maarch_entreprise/documents_list_copies.php
index a488aa5dbe471eedbb3a607b8d6b0b8b038cd0de..822f1f688f5420e7faa75cddbb13f6e393a19abc 100755
--- a/apps/maarch_entreprise/documents_list_copies.php
+++ b/apps/maarch_entreprise/documents_list_copies.php
@@ -306,8 +306,13 @@ for ($i=0;$i<count($tab);$i++) {
                 $tab[$i][$j]["order"]='category_id';
             }
             if ($tab[$i][$j][$value]=="priority") {
-
-                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][$j]["value"]) {
+                        $fakeId = $key;
+                    }
+                }
+                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                 $tab[$i][$j]["label"]=_PRIORITY;
                 $tab[$i][$j]["size"]="10";
                 $tab[$i][$j]["label_align"]="left";
@@ -433,13 +438,13 @@ for ($i=0;$i<count($tab);$i++) {
             }
             if ($tab[$i][$j][$value]=="status") {   
                 //couleurs des priorités
-                if ($tab[$i][8]["value"]=='0') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else if ($tab[$i][8]["value"]=='1') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][8]["value"]) {
+                        $fakeId = $key;
+                    }
                 }
+                $style="style='color:".$_SESSION['mail_priorities_color'][$fakeId].";'";
                 $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon);
                 $statusCmp = $tab[$i][$j]['value'];
                 $img_class = substr($res_status['IMG_SRC'], 0, 2);
diff --git a/apps/maarch_entreprise/documents_list_with_attachments.php b/apps/maarch_entreprise/documents_list_with_attachments.php
index 617a42a6451ede8ae3006fdc37a23e3f5af62a1d..5efdc2bd574416a664627948468ba3b1b95d9eaf 100755
--- a/apps/maarch_entreprise/documents_list_with_attachments.php
+++ b/apps/maarch_entreprise/documents_list_with_attachments.php
@@ -308,8 +308,13 @@ for ($i=0;$i<$tabI;$i++) {
                 $tab[$i][$j]["order"]='category_id';
             }
             if ($tab[$i][$j][$value]=="priority") {
-
-                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][$j]["value"]) {
+                        $fakeId = $key;
+                    }
+                }
+                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                 $tab[$i][$j]["label"]=_PRIORITY;
                 $tab[$i][$j]["size"]="10";
                 $tab[$i][$j]["label_align"]="left";
@@ -423,13 +428,13 @@ for ($i=0;$i<$tabI;$i++) {
             }
             if ($tab[$i][$j][$value]=="status") {
                 //couleurs des priorités
-                if ($tab[$i][8]["value"]=='0') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else if ($tab[$i][8]["value"]=='1') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][8]["value"]) {
+                        $fakeId = $key;
+                    }
                 }
+                $style="style='color:".$_SESSION['mail_priorities_color'][$fakeId].";'";
                 $res_status = $status_obj->get_status_data($tab[$i][$j]['value'],$extension_icon);
                 $statusCmp = $tab[$i][$j]['value'];
                 $img_class = substr($res_status['IMG_SRC'], 0, 2);
diff --git a/apps/maarch_entreprise/indexing_searching/change_doctype.php b/apps/maarch_entreprise/indexing_searching/change_doctype.php
index ca2fb19c111988d8f8e3f46e312c334f8f219381..9d903edba13c3a9e61aafd1e91499620ed69cbcd 100755
--- a/apps/maarch_entreprise/indexing_searching/change_doctype.php
+++ b/apps/maarch_entreprise/indexing_searching/change_doctype.php
@@ -74,16 +74,16 @@ if (isset($_REQUEST['admission_date'])
     $admissionDate = $_REQUEST['admission_date'];
 }
 
-if (!isset($_REQUEST['priority_id']) || $_REQUEST['priority_id'] == '') {
-    echo "{status : 1, error_txt : '".addslashes(_PRIORITY . ' ' . _IS_EMPTY)."'}";
-    exit();
-} else {
-    $priorityId = $_SESSION['process_mode_priority'][$_SESSION['process_mode']];
-    $_SESSION['process_mode'] = NULL;
-    if ($_SESSION['mail_priorities_attribute'][$priorityId] <> 'false') {
-        $priorityDelay = $_SESSION['mail_priorities_attribute'][$priorityId];
+$priorityId = $_SESSION['process_mode_priority'][$_SESSION['process_mode']];
+$_SESSION['process_mode'] = NULL;
+foreach ($_SESSION['mail_priorities_id'] as $key => $value) {
+    if ($value == $priorityId) {
+        $fakeId = $key;
     }
 }
+if ($_SESSION['mail_priorities_attribute'][$fakeId] <> 'false') {
+    $priorityDelay = $_SESSION['mail_priorities_attribute'][$fakeId];
+}
 
 // Process limit date calcul
 //Bug fix if delay process is disabled in services
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 7e4b782d0a9e25c7ac6ed89163848f849bdee61a..691cb60bec0a6dc8095d045f04c3fc13bf667bbc 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
@@ -603,8 +603,15 @@ if($mode == 'normal') {
 
                 if($tab[$i][$j][$value]=="priority")
                 {
-                    $priority = $tab[$i][$j]["value"];
-                    $tab[$i][$j]["value"]       = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                    $fakeId = null;
+                    foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                        if ($prioValue == $tab[$i][$j]["value"]) {
+                            $fakeId = $key;
+                        }
+                    }
+
+                    $priority = $fakeId;
+                    $tab[$i][$j]["value"]       = $_SESSION['mail_priorities'][$fakeId];
                     $tab[$i][$j]["label"]       = _PRIORITY;
                     $tab[$i][$j]["size"]        = "10";
                     $tab[$i][$j]["label_align"] = "left";
diff --git a/apps/maarch_entreprise/indexing_searching/search_adv.php b/apps/maarch_entreprise/indexing_searching/search_adv.php
index eedfd6963032c6bdc02d052ba4682a93be7a3644..301401db00938a4b404c8596e9d623be5626843b 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv.php
@@ -219,7 +219,7 @@ $param['mail_nature'] = $arr_tmp2;
 $arr_tmp = array();
 foreach(array_keys($_SESSION['mail_priorities']) as $priority)
 {
-    array_push($arr_tmp, array('VALUE' => $priority, 'LABEL' => $_SESSION['mail_priorities'][$priority]));
+    array_push($arr_tmp, array('VALUE' => $_SESSION['mail_priorities_id'][$priority], 'LABEL' => $_SESSION['mail_priorities'][$priority]));
 }
 $arr_tmp2 = array('label' => _PRIORITY, 'type' => 'select_simple', 'param' => array('field_label' => _MAIL_PRIORITY,'default_label' => addslashes(_CHOOSE_PRIORITY), 'options' => $arr_tmp));
 $param['priority'] = $arr_tmp2;
diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
index 71fcee9fe3338a8e3e49067f201dd73dbb5f61cb..abad6c54de0938b87b6fdf6dcb25c977c28cc4b2 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
@@ -192,10 +192,10 @@ if (count($_REQUEST['meta']) > 0) {
                 $where_request .=" and  ";
             } 
             // PRIORITY
-            elseif ($tab_id_fields[$j] == 'priority' && is_numeric($_REQUEST['priority']) && $_REQUEST['priority']>=0)
+            elseif ($tab_id_fields[$j] == 'priority' && isset($_REQUEST['priority']))
             {
                 $json_txt .= " 'priority' : ['".addslashes(trim($_REQUEST['priority']))."'],";
-                $prio = $func->wash($_REQUEST['priority'],"num",_THE_PRIORITY,"no");
+                $prio = $func->wash($_REQUEST['priority'],"alphanum",_THE_PRIORITY,"no");
                 $where_request .= " priority = :priority ";
                 $arrayPDO = array_merge($arrayPDO, array(":priority" => $prio));
 
diff --git a/apps/maarch_entreprise/indexing_searching/update_process_date.php b/apps/maarch_entreprise/indexing_searching/update_process_date.php
index b049db08bad08ef78b2cb18ff74a5982133b2d1e..b8904d53dcb9285ea5e8b6636b5babf1979bce1b 100755
--- a/apps/maarch_entreprise/indexing_searching/update_process_date.php
+++ b/apps/maarch_entreprise/indexing_searching/update_process_date.php
@@ -54,11 +54,16 @@ if (!isset($_REQUEST['priority_id']) || $_REQUEST['priority_id'] == '') {
     exit();
 } else {
     $priorityId = $_REQUEST['priority_id'];
-    if ($_SESSION['mail_priorities_attribute'][$priorityId] <> 'false') {
-        $priorityDelay = $_SESSION['mail_priorities_attribute'][$priorityId];
+    foreach ($_SESSION['mail_priorities_id'] as $key => $value) {
+        if ($value == $priorityId) {
+            $fakeId = $key;
+        }
+    }
+    if ($_SESSION['mail_priorities_attribute'][$fakeId] <> 'false') {
+        $priorityDelay = $_SESSION['mail_priorities_attribute'][$fakeId];
     }
     $wdays = 'workingDay';
-    if (isset($_SESSION['mail_priorities_wdays'][$priorityId]) && $_SESSION['mail_priorities_wdays'][$priorityId] == 'false') {
+    if (isset($_SESSION['mail_priorities_wdays'][$fakeId]) && $_SESSION['mail_priorities_wdays'][$fakeId] == 'false') {
         $wdays = 'calendar';
     }
 }
diff --git a/apps/maarch_entreprise/reports/report_by_period.php b/apps/maarch_entreprise/reports/report_by_period.php
index a14e3bae1115f1d1a6dd2b38fb84fc4098aa5c96..8f02f8f96a943fd307b112fbf9fc26f1406eca9c 100755
--- a/apps/maarch_entreprise/reports/report_by_period.php
+++ b/apps/maarch_entreprise/reports/report_by_period.php
@@ -131,7 +131,7 @@ $content .='<div id="params">';
             foreach(array_keys($_SESSION['mail_priorities']) as $priority)
             {
                 $content.="<option";
-                $content.=" value='".$priority."'>";
+                $content.=" value='".$_SESSION['mail_priorities_id'][$priority]."'>";
                 $content.=$_SESSION['mail_priorities'][$priority]."</option>"; 
             }
             $content.='</select>';
diff --git a/apps/maarch_entreprise/xml/IVS/validation_rules.xml b/apps/maarch_entreprise/xml/IVS/validation_rules.xml
index bb5738f53d87aee110ad97dfd3ef508135e017f5..b564cd586d673b8ed839066ed620b8b933bc8a0c 100755
--- a/apps/maarch_entreprise/xml/IVS/validation_rules.xml
+++ b/apps/maarch_entreprise/xml/IVS/validation_rules.xml
@@ -402,7 +402,7 @@
       <parameter name="type_id" type="integer" />
       <parameter name="admission_date" type="datefr" />
       <parameter name="id_action" type="identifier" />
-      <parameter name="priority_id" type="integer" />
+      <parameter name="priority_id" type="string" />
       <parameter name="dir" type="identifier" />
       <parameter name="res_id" type="identifier" />
       <parameter name="coll_id" type="collection_list" />
@@ -450,7 +450,7 @@
       <parameter name="destinataire_chosen" type="identifier" />
       <parameter name="destinataire_available" type="identifier" />
       <parameter name="project" type="string" />
-      <parameter name="priority" type="integer" />
+      <parameter name="priority" type="string" />
       <parameter name="doc_custom_t1" type="string" />
       <parameter name="doc_custom_t2" type="string" />
       <parameter name="doc_custom_t3" type="string" />
@@ -646,7 +646,7 @@
 
     <validationRule name="update_process_date" extends="standardForm" mode="error">  
       <parameter name="admission_date" type="datefr" />
-      <parameter name="priority_id" type="integer" />
+      <parameter name="priority_id" type="string" />
       <parameter name="type_id" type="integer" />
       <parameter name="dir" type="identifier" />
     </validationRule>
diff --git a/apps/maarch_entreprise/xml/entreprise.xml b/apps/maarch_entreprise/xml/entreprise.xml
index 948681f3dbd02930e71359e99761ede292c71ae4..5a51f544946af1e48c88121209d4c21ed712f590 100755
--- a/apps/maarch_entreprise/xml/entreprise.xml
+++ b/apps/maarch_entreprise/xml/entreprise.xml
@@ -113,19 +113,19 @@
     <process_modes>
         <process_mode>
             <label>NORMAL</label>
-            <process_mode_priority>2</process_mode_priority>
+            <process_mode_priority>poiuytre1357nbvc</process_mode_priority>
         </process_mode>
         <process_mode>
             <label>SVA</label>
-            <process_mode_priority>3</process_mode_priority>
+            <process_mode_priority>poiuytre1313nbvc</process_mode_priority>
         </process_mode>
         <process_mode>
             <label>SVR</label>
-            <process_mode_priority>3</process_mode_priority>
+            <process_mode_priority>poiuytre1313nbvc</process_mode_priority>
         </process_mode>
     </process_modes>
     <priorities>
-        <!-- Tag working_days "true" = Jours ouvrés // "false" = Jours calendaires -->
+        <!-- Ces balises ne sont plus utilisées et seront supprimées dans la prochaine version  -->
         <priority color="#ff0000" with_delay="4" working_days="true">Très urgent</priority> <!-- 0 -->
         <priority color="#ffa500" with_delay="8" working_days="true">Urgent</priority> <!-- 1 -->
         <priority color="#009dc5" with_delay="false" working_days="true">Normal</priority> <!-- 2 -->
diff --git a/core/class/ExportControler.php b/core/class/ExportControler.php
index 35e4dbd3c1050fa290e89f9b06aade4a5edbec20..f05e82c1b8810087ac90d604501805235c80dcd8 100755
--- a/core/class/ExportControler.php
+++ b/core/class/ExportControler.php
@@ -362,7 +362,12 @@ class ExportFunctions
 
             $result = $stmt->fetchObject();
 
-            $link_label = $_SESSION['mail_priorities'][$result->priority];
+            foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                if ($prioValue == $result->priority) {
+                    $fakeId = $key;
+                }
+            }
+            $link_label = $_SESSION['mail_priorities'][$fakeId];
 
             $line_value->get_priority = $link_label;
         }
diff --git a/migration/18.04/migratePriorities.php b/migration/18.04/migratePriorities.php
index a42f30b1cc7c3398d4fd12402940422c789aad67..a42b21078aa1d352b08b0df8e0a2109d33df2ebc 100644
--- a/migration/18.04/migratePriorities.php
+++ b/migration/18.04/migratePriorities.php
@@ -42,7 +42,7 @@ if (file_exists($path)) {
     }
 }
 
-foreach ($priorities as $priority) {
+foreach ($priorities as $key => $priority) {
     if ($priority['default_priority'] == 'true') {
         \Priority\models\PriorityModel::resetDefaultPriority();
     }
@@ -53,4 +53,22 @@ foreach ($priorities as $priority) {
         'where' => ['priority = ?'],
         'data'  => [$priority['id']]
     ]);
+
+    $priorities[$key]['priorityId'] = $id;
+}
+
+$i = 0;
+foreach ($loadedXml->process_modes->process_mode as $processMode) {
+    foreach ($priorities as $priority) {
+        if ($priority['id'] == $processMode->process_mode_priority) {
+            $loadedXml->process_modes->process_mode[$i]->process_mode_priority = $priority['priorityId'];
+        }
+    }
+    ++$i;
+}
+
+$res = $loadedXml->asXML();
+$fp = fopen($path, "w+");
+if ($fp) {
+    fwrite($fp,$res);
 }
diff --git a/modules/avis/documents_list_with_avis.php b/modules/avis/documents_list_with_avis.php
index f2752ee472410b40bc9f147143c1cf1e1e589709..86f89d724b0c1cace6374b9dc36f9c0b4dd6be6a 100755
--- a/modules/avis/documents_list_with_avis.php
+++ b/modules/avis/documents_list_with_avis.php
@@ -308,8 +308,13 @@ for ($i=0;$i<$tabI;$i++) {
                 $tab[$i][$j]["order"]='category_id';
             }
             if ($tab[$i][$j][$value]=="priority") {
-
-                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][$j]["value"]) {
+                        $fakeId = $key;
+                    }
+                }
+                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                 $tab[$i][$j]["label"]=_PRIORITY;
                 $tab[$i][$j]["size"]="10";
                 $tab[$i][$j]["label_align"]="left";
@@ -424,14 +429,13 @@ for ($i=0;$i<$tabI;$i++) {
             }
             if ($tab[$i][$j][$value]=="status") {   
                 //couleurs des priorités
-                if ($tab[$i][8]["value"]=='0') {
-
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else if ($tab[$i][8]["value"]=='1') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][8]["value"]) {
+                        $fakeId = $key;
+                    }
                 }
+                $style="style='color:".$_SESSION['mail_priorities_color'][$fakeId].";'";
                 $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon);
                 $statusCmp = $tab[$i][$j]['value'];
                 $img_class = substr($res_status['IMG_SRC'], 0, 2);
diff --git a/modules/cases/search_adv_for_cases.php b/modules/cases/search_adv_for_cases.php
index 62a82bb4b7b77ec6ef53617fc4dba4308198f3d6..2ce9f03f164968ac9be87eeb1536df99954ee0b0 100755
--- a/modules/cases/search_adv_for_cases.php
+++ b/modules/cases/search_adv_for_cases.php
@@ -236,7 +236,7 @@ foreach (array_keys($_SESSION['mail_priorities']) as $priority)    {
     array_push(
         $arrTmp,
         array(
-        	'VALUE' => $priority,
+        	'VALUE' => $_SESSION['mail_priorities_id'][$priority],
         	'LABEL' => $_SESSION['mail_priorities'][$priority]
         )
     );
diff --git a/modules/entities/entity_late_mail.php b/modules/entities/entity_late_mail.php
index d9158e93d58df635b63b30a9e77bc89625dc3c53..d61bad6cd6e8b1a48b8c2140a2ff7f235d7d2c26 100755
--- a/modules/entities/entity_late_mail.php
+++ b/modules/entities/entity_late_mail.php
@@ -104,7 +104,7 @@ $content .='<div id="params">';
             foreach(array_keys($_SESSION['mail_priorities']) as $priority)
             {
                 $content.="<option";
-                $content.=" value='".$priority."'>";
+                $content.=" value='".$_SESSION['mail_priorities_id'][$priority]."'>";
                 $content.=$_SESSION['mail_priorities'][$priority]."</option>"; 
             }
             $content.='</select>';
diff --git a/modules/entities/entity_process_delay.php b/modules/entities/entity_process_delay.php
index b84e096850f44274c1c4a13d4eeee27d5301aaf9..97dd6ccf1c6bae289019dd72feb8536e752df1bb 100755
--- a/modules/entities/entity_process_delay.php
+++ b/modules/entities/entity_process_delay.php
@@ -105,7 +105,7 @@ $content .='<div id="params">';
             foreach(array_keys($_SESSION['mail_priorities']) as $priority)
             {
                 $content.="<option";
-                $content.=" value='".$priority."'>";
+                $content.=" value='".$_SESSION['mail_priorities_id'][$priority]."'>";
                 $content.=$_SESSION['mail_priorities'][$priority]."</option>"; 
             }
             $content.='</select>';
diff --git a/modules/entities/entity_response_rate_stat.php b/modules/entities/entity_response_rate_stat.php
index ec1dc683f4933bb7be6b7f5dbaa081220e9dd949..aacd3ff989d8b5e93891d9ea81802055525aeee2 100755
--- a/modules/entities/entity_response_rate_stat.php
+++ b/modules/entities/entity_response_rate_stat.php
@@ -105,7 +105,7 @@ $content .='<div id="params">';
             foreach(array_keys($_SESSION['mail_priorities']) as $priority)
             {
                 $content.="<option";
-                $content.=" value='".$priority."'>";
+                $content.=" value='".$_SESSION['mail_priorities_id'][$priority]."'>";
                 $content.=$_SESSION['mail_priorities'][$priority]."</option>"; 
             }
             $content.='</select>';
diff --git a/modules/entities/entity_vol_stat.php b/modules/entities/entity_vol_stat.php
index 8b9a405b8f0162c45360a469214e82d9430b1332..f0ddd091dc0ecb3b2d3f7d216843bfba359d3952 100755
--- a/modules/entities/entity_vol_stat.php
+++ b/modules/entities/entity_vol_stat.php
@@ -116,7 +116,7 @@ $content .='<div id="params">';
             foreach(array_keys($_SESSION['mail_priorities']) as $priority)
             {
                 $content.="<option";
-                $content.=" value='".$priority."'>";
+                $content.=" value='".$_SESSION['mail_priorities_id'][$priority]."'>";
                 $content.=$_SESSION['mail_priorities'][$priority]."</option>"; 
             }
             $content.='</select>';
diff --git a/modules/export_seda/export_seda_list.php b/modules/export_seda/export_seda_list.php
index 401de4ff5806752bd74e3f4ceb751709fd3a37cc..a52d5da15d595a5cab2a78db0c2c49d440d387c6 100644
--- a/modules/export_seda/export_seda_list.php
+++ b/modules/export_seda/export_seda_list.php
@@ -320,8 +320,13 @@ for ($i=0;$i<$tabI;$i++) {
                 $tab[$i][$j]["order"]='category_id';
             }
             if ($tab[$i][$j][$value]=="priority") {
-
-                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][$j]["value"]) {
+                        $fakeId = $key;
+                    }
+                }
+                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                 $tab[$i][$j]["label"]=_PRIORITY;
                 $tab[$i][$j]["size"]="10";
                 $tab[$i][$j]["label_align"]="left";
@@ -436,14 +441,13 @@ for ($i=0;$i<$tabI;$i++) {
             }
             if ($tab[$i][$j][$value]=="status") {
                 //couleurs des priorités
-                if ($tab[$i][8]["value"]=='0') {
-
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else if ($tab[$i][8]["value"]=='1') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][8]["value"]) {
+                        $fakeId = $key;
+                    }
                 }
+                $style="style='color:".$_SESSION['mail_priorities_color'][$fakeId].";'";
                 $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon);
                 $statusCmp = $tab[$i][$j]['value'];
                 $img_class = substr($res_status['IMG_SRC'], 0, 2);
diff --git a/modules/folder/documents_list_in_folder.php b/modules/folder/documents_list_in_folder.php
index f5dd72fa0bdf2a6cc986fc90757e8ddde1fb7c65..7d1842aa795d0a736c1d7a18ab7f33170197e81a 100755
--- a/modules/folder/documents_list_in_folder.php
+++ b/modules/folder/documents_list_in_folder.php
@@ -174,7 +174,13 @@ if (isset($_REQUEST['id']) && !empty($_REQUEST['id']))
                 }
                 if($tab[$i][$j][$value]=="priority")
                 {
-                    $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                    $fakeId = null;
+                    foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                        if ($prioValue == $tab[$i][$j]["value"]) {
+                            $fakeId = $key;
+                        }
+                    }
+                    $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                     $tab[$i][$j]["label"]=_PRIORITY;
                     $tab[$i][$j]["size"]="10";
                     $tab[$i][$j]["label_align"]="left";
@@ -307,10 +313,10 @@ if (isset($_REQUEST['id']) && !empty($_REQUEST['id']))
             }
         }
     }
- //Clé de la liste
+ //Cl� de la liste
 $listKey = 'res_id';
 
-//Initialiser le tableau de paramètres
+//Initialiser le tableau de param�tres
 $paramsTab = array();
 // $paramsTab['bool_sortColumn'] = true;                                               //Affichage Tri
 $paramsTab['bool_bigPageTitle'] = false;                                            //Affichage du titre en grand
@@ -322,7 +328,7 @@ $paramsTab['divListId'] = 'div_sublist_'.$_SESSION['folderId'];
 $paramsTab['listHeight'] = '100%';                                                 //Hauteur de la liste
 $paramsTab['bool_showSmallToolbar'] = true;                                         //
 $paramsTab['linesToShow'] = 10;                                                     //
-// $paramsTab['bool_checkBox'] = true;                                                 //Affichage Case à cocher
+// $paramsTab['bool_checkBox'] = true;                                                 //Affichage Case � cocher
 // $paramsTab['collId'] = $_SESSION['collId'];                                         //ID de la collection
 // $paramsTab['tableName'] = $sec->retrieve_view_from_coll_id($_SESSION['collId']);    //Nom de la table
 // $paramsTab['formId']= 'formSubList';                                                //
diff --git a/modules/visa/documents_list_with_signatory.php b/modules/visa/documents_list_with_signatory.php
index 340df1a77c38126151396d831cf67fa0a59803b1..0cd67199633d184fd29fd595e406dd74d7479f74 100755
--- a/modules/visa/documents_list_with_signatory.php
+++ b/modules/visa/documents_list_with_signatory.php
@@ -321,7 +321,13 @@ for ($i=0;$i<$tabI;$i++) {
             }
             if ($tab[$i][$j][$value]=="priority") {
 
-                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$tab[$i][$j]["value"]];
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][$j]["value"]) {
+                        $fakeId = $key;
+                    }
+                }
+                $tab[$i][$j]["value"] = $_SESSION['mail_priorities'][$fakeId];
                 $tab[$i][$j]["label"]=_PRIORITY;
                 $tab[$i][$j]["size"]="10";
                 $tab[$i][$j]["label_align"]="left";
@@ -432,13 +438,13 @@ for ($i=0;$i<$tabI;$i++) {
             }
             if ($tab[$i][$j][$value]=="status") {   
                 //couleurs des priorités
-                if ($tab[$i][8]["value"]=='0') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else if ($tab[$i][8]["value"]=='1') {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
-                } else {
-                    $style="style='color:".$_SESSION['mail_priorities_color'][$tab[$i][8]["value"]].";'";
+                $fakeId = null;
+                foreach ($_SESSION['mail_priorities_id'] as $key => $prioValue) {
+                    if ($prioValue == $tab[$i][8]["value"]) {
+                        $fakeId = $key;
+                    }
                 }
+                $style="style='color:".$_SESSION['mail_priorities_color'][$fakeId].";'";
                 $res_status = $status_obj->get_status_data($tab[$i][$j]['value'], $extension_icon);
                 $statusCmp = $tab[$i][$j]['value'];
                 $img_class = substr($res_status['IMG_SRC'], 0, 2);
diff --git a/sql/data_fr.sql b/sql/data_fr.sql
index 5018f0506743f90b87721db9f0409c2fa0b432d2..164d80724585319d760e3a0ff4819714376a27e3 100755
--- a/sql/data_fr.sql
+++ b/sql/data_fr.sql
@@ -1697,9 +1697,10 @@ Select setval('templates_seq', (select max(template_id)+1 from templates), false
 
 /* PRIORITIES */
 TRUNCATE TABLE priorities;
-INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('prio11111', 'Normal', '#009dc5', TRUE, null, TRUE);
-INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('prio22222', 'Urgent', '#ffa500', TRUE, 8, FALSE);
-INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('prio33333', 'Très urgent', '#ff0000', TRUE, 4, FALSE);
+INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('poiuytre1357nbvc', 'Normal', '#009dc5', TRUE, null, TRUE);
+INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('poiuytre1379nbvc', 'Urgent', '#ffa500', TRUE, 8, FALSE);
+INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('poiuytre1391nbvc', 'Très urgent', '#ff0000', TRUE, 4, FALSE);
+INSERT INTO priorities (id, label, color, working_days, delays, default_priority) VALUES ('poiuytre1313nbvc', 'SVA/SVR', '#ffa500', TRUE, null, FALSE);
 
 ------------
 --NOTIFICATIONS
diff --git a/sql/structure.sql b/sql/structure.sql
index 023c78fa792a11ae63773973664e72f8c00ee82f..67a45718653a10500f7c30c34052585968fbf927 100755
--- a/sql/structure.sql
+++ b/sql/structure.sql
@@ -1552,7 +1552,7 @@ CREATE TABLE res_letterbox
   work_batch bigint,
   origin character varying(50) DEFAULT NULL::character varying,
   is_ingoing character(1) DEFAULT NULL::bpchar,
-  priority smallint,
+  priority character varying(16),
   arbatch_id bigint DEFAULT NULL,
   policy_id character varying(32) DEFAULT NULL::character varying,
   cycle_id character varying(32) DEFAULT NULL::character varying,