From ef44db8bd86828aa1e6c896ca17afc1aae845c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 5 Jan 2014 20:28:32 +0100 Subject: [PATCH] Removed unused constants & functions and added new comment insert error message --- htdocs/langs/en_US/opensurvey.lang | 1 + htdocs/opensurvey/card.php | 2 +- htdocs/opensurvey/fonctions.php | 32 ------------------------------ htdocs/opensurvey/public/studs.php | 2 +- htdocs/opensurvey/results.php | 2 +- 5 files changed, 4 insertions(+), 35 deletions(-) diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang index 9f9f3fe3abcc6..5c24f982aba67 100644 --- a/htdocs/langs/en_US/opensurvey.lang +++ b/htdocs/langs/en_US/opensurvey.lang @@ -65,4 +65,5 @@ BackToCurrentMonth=Back to current month ErrorOpenSurveyFillFirstSection=You haven't filled the first section of the poll creation ErrorOpenSurveyOneChoice=Enter at least one choice ErrorOpenSurveyDateFormat=Date must be have the format DD/MM/YYYY +ErrorInsertingComment=There was an error while inserting your comment MoreChoices=Enter more choices for the voters \ No newline at end of file diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index c1515267c83c3..83e14232e8fa9 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -130,7 +130,7 @@ if (! $resql) { - $err |= COMMENT_INSERT_FAILED; + setEventMessage($langs->trans('ErrorInsertingComment'), 'errors'); } } } diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index b3aa1c15cfc9c..be7b25005c202 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -144,24 +144,6 @@ function get_server_name() return $url; } - -/** - * is_error - * - * @param unknown_type $cerr error number - * @return boolean Error key found or not - */ -function is_error($cerr) -{ - global $err; - if ( $err == 0 ) { - return false; - } - - return (($err & $cerr) != 0 ); -} - - /** * Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau * @@ -264,18 +246,4 @@ function ajouter_sondage() exit(); } - - -define('COMMENT_EMPTY', 0x0000000001); -define('COMMENT_USER_EMPTY', 0x0000000010); -define('COMMENT_INSERT_FAILED', 0x0000000100); -define('NAME_EMPTY', 0x0000001000); -define('NAME_TAKEN', 0x0000010000); -define('NO_POLL', 0x0000100000); -define('NO_POLL_ID', 0x0001000000); -define('INVALID_EMAIL', 0x0010000000); -define('TITLE_EMPTY', 0x0100000000); -define('INVALID_DATE', 0x1000000000); -$err = 0; - ?> diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index 3a4b92e73375f..2b8e02c31e08d 100644 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -546,7 +546,7 @@ if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst'))) { print '