Removed unused constants & functions and added new comment insert error message

This commit is contained in:
Marcos García de La Fuente 2014-01-05 20:28:32 +01:00
parent b68f5b6251
commit ef44db8bd8
5 changed files with 4 additions and 35 deletions

View File

@ -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

View File

@ -130,7 +130,7 @@ if (GETPOST('ajoutcomment'))
if (! $resql)
{
$err |= COMMENT_INSERT_FAILED;
setEventMessage($langs->trans('ErrorInsertingComment'), 'errors');
}
}
}

View File

@ -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;
?>

View File

@ -546,7 +546,7 @@ if ($ligneamodifier < 0 && (! isset($_SESSION['nom'])))
if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst')))
{
print '<input type="checkbox" name="choix'.$i.'" value="1"';
if (isset($_POST['choix'.$i]) && $_POST['choix'.$i] == '1' && is_error(NAME_EMPTY) )
if (isset($_POST['choix'.$i]) && $_POST['choix'.$i] == '1')
{
print ' checked="checked"';
}

View File

@ -899,7 +899,7 @@ if (empty($testligneamodifier))
if (empty($listofanswers[$i]['format']) || ! in_array($listofanswers[$i]['format'],array('yesno','foragainst')))
{
print '<input type="checkbox" name="choix'.$i.'" value="1"';
if ( isset($_POST['choix'.$i]) && $_POST['choix'.$i] == '1' && is_error(NAME_EMPTY) )
if ( isset($_POST['choix'.$i]) && $_POST['choix'.$i] == '1' )
{
print ' checked="checked"';
}