From 99ece9926750d83dca12a51ecb93d4d2d1bc879d Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Sun, 7 Oct 2018 19:48:20 +0200
Subject: [PATCH] change sql queries into PDOselect in fileplan res positions

---
 modules/fileplan/positions_documents_list.php | 539 +++++++++---------
 1 file changed, 264 insertions(+), 275 deletions(-)

diff --git a/modules/fileplan/positions_documents_list.php b/modules/fileplan/positions_documents_list.php
index a2c41c1905f..83d4d9abe06 100755
--- a/modules/fileplan/positions_documents_list.php
+++ b/modules/fileplan/positions_documents_list.php
@@ -1,50 +1,29 @@
 <?php
-/*
-*
-*    Copyright 2013 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/>.
+/**
+* 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   positions_documents_list
+* @author  dev <dev@maarch.org>
+* @ingroup fileplan
 */
 
-/**
- * @brief    Displays documents list in fileplan tree
- *
- * @file     positions_documents_list.php
- *
- * @author   Yves Christian Kpakpo <dev@maarch.org>
- * @date     $date$
- *
- * @version  $Revision$
- * @ingroup  fileplan
- */
-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';
-require_once 'modules'.DIRECTORY_SEPARATOR.'fileplan'.DIRECTORY_SEPARATOR
-    .'class'.DIRECTORY_SEPARATOR
-    .'class_modules_tools.php';
+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';
+require_once 'modules' . DIRECTORY_SEPARATOR . 'fileplan' . DIRECTORY_SEPARATOR
+    . 'class' . DIRECTORY_SEPARATOR
+    . 'class_modules_tools.php';
 
 $security = new security();
 $core_tools = new core_tools();
-$db = new Database();
 $status_obj = new manage_status();
 $list = new lists();
 $fileplan = new fileplan();
+$request = new request();
 
 $status = 0;
 $change_fileplan = false;
@@ -64,12 +43,11 @@ if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
         $change_fileplan = $fileplan->userCanChangeFileplan($fileplan_id);
 
         //URL extra Parameters
-        $parameters = '&id='.$_REQUEST['id'];
+        $parameters = '&id=' . $_REQUEST['id'];
         $start = $list->getStart();
         if (!empty($order_field) && !empty($order)) {
-            $parameters .= '&order='.$order.'&order_field='.$order_field;
+            $parameters .= '&order=' . $order . '&order_field=' . $order_field;
         }
-        $parameters .= '&start='.$start;
         
 
         //Order
@@ -77,267 +55,278 @@ if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
         $order = $list->getOrder();
         $order_field = $list->getOrderField();
         if (!empty($order_field) && !empty($order)) {
-            $orderstr = 'order by '.$order_field.' '.$order;
+            $orderstr = 'order by ' . $order_field . ' ' . $order;
         } else {
             $list->setOrder();
-            $list->setOrderField('coll_id');
-            $orderstr = 'order by coll_id desc';
+            $list->setOrderField('alt_identifier');
+            $orderstr = 'order by alt_identifier desc';
         }
-        //Query
-        $securityClause = $_SESSION['user']['security']['letterbox_coll']['DOC']['where'];
 
-        $stmt = $db->query(
-                    'SELECT fp.res_id, fp.coll_id, fp.fileplan_id, fp.position_id FROM '
-                    .FILEPLAN_RES_POSITIONS_TABLE.' fp, res_letterbox rl'
-                    .' WHERE fp.res_id = rl.res_id'
-                    .' AND fp.fileplan_id = ?'
-                    .' AND fp.position_id = ?'
-                    .' AND ('.$securityClause.')'
-                    .' '.$orderstr, array($fileplan_id, $position_id));
+        if (isset($_REQUEST['start']) && !empty($_REQUEST['start'])) {
+            $parameters .= '&start=' . $_REQUEST['start'];
+            $start = $_REQUEST['start'];
+        } else {
+            $start = $list->getStart();
+            $parameters .= '&start=' . $start;
+        }
 
-        $description = $fileplan->getPositionPath($fileplan_id, $position_id, true);
+        //select
+        $select['fp_res_fileplan_positions'] = array();
+        $select['res_view_letterbox'] = array();
 
-        $resId_array = array();
+        array_push(
+            $select['fp_res_fileplan_positions'],
+            'coll_id',
+            'coll_id as coll_label',
+            'res_id',
+            'fileplan_id',
+            'position_id'
+        );
 
-        if ($stmt->rowCount() > 0) {
-            //Build list array
-            $tab = array();
-            while ($line = $stmt->fetchObject()) {
-                //Get view fort ressource collection
-                $view = $security->retrieve_view_from_coll_id($line->coll_id);
+        array_push(
+            $select['res_view_letterbox'],
+            'res_id as right_doc',
+            'res_id as page_details',
+            'res_id as list_id',
+            'alt_identifier',
+            'status',
+            'type_label',
+            'category_id',
+            'subject',
+            'creation_date'
+        );
 
-                //Query
-                $stmt2 = $db->query(
-                    'SELECT res_id, alt_identifier, res_id as right_doc, status, type_label,'
-                    .' category_id, subject, creation_date FROM '
-                    .$view.' WHERE res_id = ?', array($line->res_id));
+        $whereTab = [];
 
-                $res = $stmt2->fetch(PDO::FETCH_ASSOC);
-                $temp = array();
-                //Create list ID
-                array_push($temp, array('column' => 'list_id', 'value' => $line->coll_id.'@@'.$line->res_id));
-                //Keep collection ID & LABEL
-                array_push($temp, array('column' => 'coll_id', 'value' => $line->coll_id));
-                array_push($temp, array('column' => 'coll_label', 'value' => $security->get_script_from_coll($line->coll_id, 'label')));
+        //SECURITY CLAUSE
+        $whereTab[] = "fp_res_fileplan_positions.fileplan_id = ? AND fp_res_fileplan_positions.position_id = ?";
 
-                //Get the details page (from colletion)
-                $coll_script_details = $security->get_script_from_coll($line->coll_id, 'script_details');
-                $coll_script_details = substr($coll_script_details, 0, strlen($coll_script_details) - 4);
-                array_push($temp, array('column' => 'page_details', 'value' => $coll_script_details));
+        //Build Where
+        $where = implode(' AND ', $whereTab);
 
-                //Get the columns
-                foreach (array_keys($res) as $resval) {
-                    if (!is_int($resval)) {
-                        array_push($temp, array('column' => $resval, 'value' => $res[$resval]));
-                    }
-                }
-                //put in array
-                array_push($tab, $temp);
-            }
+        $arrayPDO = [$fileplan_id, $position_id];
 
-            //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] == 'list_id') {
-                            $tab[$i][$j]['list_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'] = false;
-                            $tab[$i][$j]['order'] = false;
-                        }
-                        if ($tab[$i][$j][$value] == 'res_id') {
-                            $display = false;
-                            $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';
-                            if (_ID_TO_DISPLAY == 'res_id') {
-                                $display = true;
-                            }
-                            $tab[$i][$j]['show'] = $display;
-                            $tab[$i][$j]['order'] = 'res_id';
-                        }
-                        if ($tab[$i][$j][$value] == 'alt_identifier') {
-                            $display = false;
-                            $tab[$i][$j]['label'] = _CHRONO_NUMBER;
-                            $tab[$i][$j]['size'] = '1';
-                            $tab[$i][$j]['label_align'] = 'left';
-                            $tab[$i][$j]['align'] = 'left';
-                            $tab[$i][$j]['valign'] = 'bottom';
-                            if (_ID_TO_DISPLAY == 'chrono_number') {
-                                $display = true;
-                            }
-                            $tab[$i][$j]['show'] = $display;
-                            $tab[$i][$j]['order'] = 'alt_identier';
-                        }
-                        if ($tab[$i][$j][$value] == 'coll_id') {
-                            $coll_id = $tab[$i][$j]['value']; //Keep collection ID
-                            $tab[$i][$j]['label'] = _COLLECTION;
-                            $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'] = false;
-                            $tab[$i][$j]['order'] = 'coll_id';
-                        }
-                        if ($tab[$i][$j][$value] == 'coll_label') {
-                            $tab[$i][$j]['label'] = _COLLECTION;
-                            $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'] = false;
-                            $tab[$i][$j]['order'] = 'coll_label';
-                        }
-                        if ($tab[$i][$j][$value] == 'page_details') {
-                            $tab[$i][$j]['label'] = _DETAILS;
-                            $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'] = false;
-                            $tab[$i][$j]['order'] = false;
-                        }
-                        if ($tab[$i][$j][$value] == 'right_doc') {
-                            $tab[$i][$j]['value'] = ($security->test_right_doc($coll_id, $tab[$i][$j]['value']) === true) ? 'true' : 'false';
-                            $tab[$i][$j]['label'] = _RIGHT;
-                            $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'] = false;
-                            $tab[$i][$j]['order'] = false;
-                        }
+        $tab = $request->PDOselect(
+            $select,
+            $where,
+            $arrayPDO,
+            $orderstr,
+            $_SESSION['config']['databasetype'],
+            'default',
+            true,
+            'fp_res_fileplan_positions',
+            'res_view_letterbox',
+            'res_id',
+            true,
+            false,
+            false,
+            $start
+        );
 
-                        if ($tab[$i][$j][$value] == 'status') {
-                            $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);
-                            $tab[$i][$j]['value'] = '<i '.$style." class = '".$img_class.' '.$res_status['IMG_SRC'].' '.$img_class."-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'] = true;
-                        }
-                        if ($tab[$i][$j][$value] == 'subject') {
-                            $tab[$i][$j]['value'] = functions::cut_string(functions::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'] = true;
-                        }
-                        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'] = false;
-                        }
-                        if ($tab[$i][$j][$value] == 'type_label') {
-                            $tab[$i][$j]['value'] = functions::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'] = true;
-                            $tab[$i][$j]['order'] = true;
+        $description = $fileplan->getPositionPath($fileplan_id, $position_id, true);
+
+        //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] == 'list_id') {
+                        $tab[$i][$j]['list_id'] = $coll_id . '@@' . $res_id;
+                        $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'] = false;
+                        $tab[$i][$j]['order'] = false;
+                    }
+                    if ($tab[$i][$j][$value] == 'res_id') {
+                        $display = false;
+                        $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';
+                        if (_ID_TO_DISPLAY == 'res_id') {
+                            $display = true;
                         }
-                        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'] = false;
-                            $tab[$i][$j]['order'] = false;
+                        $tab[$i][$j]['show'] = $display;
+                        $tab[$i][$j]['order'] = 'res_id';
+                    }
+                    if ($tab[$i][$j][$value] == 'alt_identifier') {
+                        $display = false;
+                        $tab[$i][$j]['label'] = _CHRONO_NUMBER;
+                        $tab[$i][$j]['size'] = '1';
+                        $tab[$i][$j]['label_align'] = 'left';
+                        $tab[$i][$j]['align'] = 'left';
+                        $tab[$i][$j]['valign'] = 'bottom';
+                        if (_ID_TO_DISPLAY == 'chrono_number') {
+                            $display = true;
                         }
+                        $tab[$i][$j]['show'] = $display;
+                        $tab[$i][$j]['order'] = 'alt_identifier';
+                    }
+                    if ($tab[$i][$j][$value] == 'coll_id') {
+                        $coll_id = $tab[$i][$j]['value']; //Keep collection ID
+                        $tab[$i][$j]['label'] = _COLLECTION;
+                        $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'] = false;
+                        $tab[$i][$j]['order'] = 'coll_id';
+                    }
+                    if ($tab[$i][$j][$value] == 'coll_label') {
+                        $tab[$i][$j]['label'] = _COLLECTION;
+                        $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'] = false;
+                        $tab[$i][$j]['order'] = 'coll_label';
+                    }
+                    if ($tab[$i][$j][$value] == 'page_details') {
+                        $coll_script_details = $security->get_script_from_coll($coll_id, 'script_details');
+                        $coll_script_details = substr($coll_script_details, 0, strlen($coll_script_details) - 4);
+                        $tab[$i][$j]['value'] = $coll_script_details;
+                        $tab[$i][$j]['label'] = _DETAILS;
+                        $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'] = false;
+                        $tab[$i][$j]['order'] = false;
+                    }
+                    if ($tab[$i][$j][$value] == 'right_doc') {
+                        $tab[$i][$j]['value'] = ($security->test_right_doc($coll_id, $tab[$i][$j]['value']) === true) ? 'true' : 'false';
+                        $tab[$i][$j]['label'] = _RIGHT;
+                        $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'] = false;
+                        $tab[$i][$j]['order'] = false;
+                    }
+
+                    if ($tab[$i][$j][$value] == 'status') {
+                        $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);
+                        $tab[$i][$j]['value'] = '<i ' . $style . " class = '" . $img_class . ' ' . $res_status['IMG_SRC'] . ' ' . $img_class . "-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'] = true;
+                    }
+                    if ($tab[$i][$j][$value] == 'subject') {
+                        $tab[$i][$j]['value'] = functions::cut_string(functions::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'] = true;
+                    }
+                    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'] = false;
+                    }
+                    if ($tab[$i][$j][$value] == 'type_label') {
+                        $tab[$i][$j]['value'] = functions::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'] = true;
+                        $tab[$i][$j]['order'] = true;
+                    }
+                    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'] = false;
+                        $tab[$i][$j]['order'] = false;
                     }
                 }
             }
+        }
 
             //List
-                $listKey = 'list_id';                                                               //Cl� de la liste
-                $paramsTab = array();                                                               //Initialiser le tableau de param�tres
-                $paramsTab['bool_sortColumn'] = true;                                               //Affichage Tri
-                $paramsTab['pageTitle'] = '<h2 style="margin-left:0px;">'.$description.':</h2><br/> '
-                    .count($tab).' '._FOUND_DOC.'<br/>';     										//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
-                $paramsTab['urlParameters'] = 'id='.$_REQUEST['id'].'&display=true';                //Parametres d'url supplementaires
-                $paramsTab['listHeight'] = '380px';                                                 //Hauteur de la liste
-                $paramsTab['start'] = 0;
-                $paramsTab['bool_changeLinesToShow'] = false;                                       //Modifier le nombre de ligne a afficher
-                $paramsTab['listCss'] = 'listingsmall';                                             //CSS
-                $paramsTab['divListId'] = 'list_doc';                                               //Id du Div de retour ajax
-                $paramsTab['bool_checkBox'] = true;                                                 //Case a cocher
-                $paramsTab['bool_standaloneForm'] = true;                                           //Formulaire  
-                                                        
-                $paramsTab['disabledRules'] = "@@right_doc@@ == 'false' || "
-                    .(int) $change_fileplan.' == 0';                           						//Veroullage de ligne(heckbox ou radio button)
+        $listKey = 'list_id';                                                               //Cle de la liste
+        $paramsTab = array();                                                               //Initialiser le tableau de param�tres
+        $paramsTab['bool_sortColumn'] = true;                                               //Affichage Tri
+        $paramsTab['pageTitle'] = '<h2 style="margin-left:0px;">' . $description . ':</h2><br/> '
+            . $_SESSION['save_list']['full_count'] . ' ' . _FOUND_DOC . '<br/>';     		//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['start'] = $start;
+        $paramsTab['bool_changeLinesToShow'] = false;                                       //Modifier le nombre de ligne a afficher
+        $paramsTab['listCss'] = 'listingsmall';                                             //CSS
+        $paramsTab['divListId'] = 'list_doc';                                               //Id du Div de retour ajax
+        $paramsTab['bool_checkBox'] = false;                                                 //Case a cocher
+        $paramsTab['bool_standaloneForm'] = true;                                           //Formulaire  
+
+        $paramsTab['disabledRules'] = "@@right_doc@@ == 'false' || "
+            . (int)$change_fileplan . ' == 0';                           						//Veroullage de ligne(heckbox ou radio button)
 
-            $paramsTab['tools'] = array();                                                      //Icones dans la barre d'outils
-            $positions = array(
-                    'script' => "showFileplanList('".$_SESSION['config']['businessappurl']
-                                            .'index.php?display=true&module=fileplan&page=fileplan_ajax_script'
-                                            .'&mode=setPosition&origin=fileplan&fileplan_id='.$fileplan_id
-                                            .'&actual_position_id='.$position_id.$parameters
-                                            ."', 'formList', '600px', '510px', '"
-                                            ._CHOOSE_ONE_DOC."')",
-                    'icon' => 'bookmark',
-                    'tooltip' => _FILEPLAN,
-                    'disabledRules' => count($tab).' == 0 || '.(int) $change_fileplan.' == 0',
-                );
-            array_push($paramsTab['tools'], $positions);
+        $paramsTab['tools'] = array();                                                      //Icones dans la barre d'outils
+        /*$positions = array(
+            'script' => "showFileplanList('" . $_SESSION['config']['businessappurl']
+                . 'index.php?display=true&module=fileplan&page=fileplan_ajax_script'
+                . '&mode=setPosition&origin=fileplan&fileplan_id=' . $fileplan_id
+                . '&actual_position_id=' . $position_id . $parameters
+                . "', 'formList', '600px', '510px', '"
+                . _CHOOSE_ONE_DOC . "')",
+            'icon' => 'bookmark',
+            'tooltip' => _FILEPLAN,
+            'disabledRules' => count($tab) . ' == 0 || ' . (int)$change_fileplan . ' == 0',
+        );
+        array_push($paramsTab['tools'], $positions);*/
 
             //Action icons array
-            $paramsTab['actionIcons'] = array();
-            $remove = array(
-                        'script' => "execFileplanScript('".$_SESSION['config']['businessappurl']
-                                                .'index.php?display=true&module=fileplan&page=fileplan_ajax_script'
-                                                .'&mode=remove&origin=fileplan&fileplan_id='.$fileplan_id
-                                                .'&actual_position_id='.$position_id.'&res_id=@@res_id@@'
-                                                .'&coll_id=@@coll_id@@'.$parameters."')",
-                        'icon' => 'trash-alt',
-                        'tooltip' => _REMOVED_DOC_FROM_POSITION,
-                        'alertText' => _REALLY_REMOVE_DOC_FROM_POSITION.': '.$description.'?',
+        $paramsTab['actionIcons'] = array();
+        $remove = array(
+            'script' => "execFileplanScript('" . $_SESSION['config']['businessappurl']
+                . 'index.php?display=true&module=fileplan&page=fileplan_ajax_script'
+                . '&mode=remove&origin=fileplan&fileplan_id=' . $fileplan_id
+                . '&actual_position_id=' . $position_id . '&res_id=@@res_id@@'
+                . '&coll_id=@@coll_id@@' . $parameters . "')",
+            'icon' => 'trash-alt',
+            'tooltip' => _REMOVED_DOC_FROM_POSITION,
+            'alertText' => _REALLY_REMOVE_DOC_FROM_POSITION . ': ' . $description . '?',
                         //"disabledRules" => (int)$change_fileplan." == 0"
                         //"disabledRules" => "@@right_doc@@ == 'false'"
-                        );
-            array_push($paramsTab['actionIcons'], $remove);
-            $viewDoc = array(
-                        'script' => "window.top.location='".$_SESSION['config']['businessappurl']
-                                        ."index.php?page=@@page_details@@&dir=indexing_searching&coll_id=@@coll_id@@&id=@@res_id@@'",
-                        'icon' => 'info',
-                        'tooltip' => _DETAILS,
-                        'disabledRules' => "@@right_doc@@ == 'false'",
-                        );
-            array_push($paramsTab['actionIcons'], $viewDoc);
+        );
+        array_push($paramsTab['actionIcons'], $remove);
+        $viewDoc = array(
+            'script' => "window.top.location='" . $_SESSION['config']['businessappurl']
+                . "index.php?page=@@page_details@@&dir=indexing_searching&coll_id=@@coll_id@@&id=@@res_id@@'",
+            'icon' => 'info',
+            'tooltip' => _DETAILS,
+            'disabledRules' => "@@right_doc@@ == 'false'",
+        );
+        array_push($paramsTab['actionIcons'], $viewDoc);
 
             //Output
-            $content = $list->showList($tab, $paramsTab, $listKey);
-            // $debug = $list->debug();
-        } else {
-            $content = '&nbsp;<em>'.$description.': '._NO_DOC_IN_POSITION.'</em>';
-        }
+        $content = $list->showList($tab, $paramsTab, $listKey);
+    } else {
+        $content = '&nbsp;<em>' . $description . ': ' . _NO_DOC_IN_POSITION . '</em>';
     }
 }
 
- echo '{status : '.$status.", content : '".addslashes($debug.$content)."', error : '".addslashes($error)."'}";
+echo '{status : ' . $status . ", content : '" . addslashes($debug . $content) . "', error : '" . addslashes($error) . "'}";
-- 
GitLab