From ceb6ae3bca451d0a0d059af75140a93193fdfff3 Mon Sep 17 00:00:00 2001
From: Olivier PEREZ <olivier@olivierperez.fr>
Date: Wed, 17 Dec 2014 13:52:52 +0100
Subject: [PATCH] Remove old code + Add doc

---
 app/classes/Framadate/Utils.php | 36 +++++++++------------------------
 studs.php                       |  2 --
 2 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php
index 047e2e1e..cb8a0783 100644
--- a/app/classes/Framadate/Utils.php
+++ b/app/classes/Framadate/Utils.php
@@ -82,17 +82,6 @@ class Utils
 
     }
 
-    public static function check_table_sondage()
-    {
-        global $connect;
-
-        if (in_array('sondage', $connect->MetaTables('TABLES'))) {
-            return true;
-        }
-
-        return false;
-    }
-
     /**
      * Check if an email address is valid using PHP filters
      *
@@ -157,22 +146,6 @@ class Utils
         mail($to, $subject, $body, $headers, $param);
     }
 
-    /**
-     * Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau
-     * @deprecated
-     * @param   string  $name       La clé à tester
-     * @param   array   $tableau    Le tableau où rechercher la clé ($_POST par défaut)
-     * @return  bool                Vrai si la clé existe et renvoie une valeur non vide
-     */
-    /*public static function issetAndNoEmpty($name, $tableau = null)
-    {
-        if (is_null($tableau)) {
-           $tableau = $_POST;
-        }
-
-        return isset($tableau[$name]) && ! empty($tableau[$name]);
-    }*/
-
     /**
      * Fonction permettant de générer les URL pour les sondage
      * @param   string    $id     L'identifiant du sondage
@@ -200,6 +173,7 @@ class Utils
 
     /**
      * Completly delete data about the given poll
+     * TODO Move this function to FramaDB
      */
     public static function removeSondage($poll_id)
     {
@@ -219,6 +193,10 @@ class Utils
 
     }
 
+    /**
+     * Clean old poll (end_date < now).
+     * TODO Move this function to FramaDB
+     */
     public static function cleaningOldPolls($log_txt) {
         global $connect;
 
@@ -234,6 +212,10 @@ class Utils
         $connect->commit();
     }
 
+    /**
+     * This method pretty prints an object to the page framed by pre tags.
+     * @param Object $object The object to print.
+     */
     public static function debug($object)
     {
         echo '<pre>';
diff --git a/studs.php b/studs.php
index 400cd7a6..3fba002e 100644
--- a/studs.php
+++ b/studs.php
@@ -148,6 +148,4 @@ $smarty->assign('comments', $comments);
 $smarty->assign('editingVoteId', $editingVoteId);
 $smarty->assign('message', $message);
 
-//Utils::debug(computeBestMoments($votes));exit;
-
 $smarty->display('studs.tpl');
-- 
GitLab