Fix duplicate translation/encoding on setEventMessage

Conflicts:
	htdocs/ftp/index.php
This commit is contained in:
Laurent Destailleur 2015-09-12 12:52:07 +02:00
parent 1966d75ced
commit a5c6582bc1
9 changed files with 25 additions and 23 deletions

View File

@ -152,7 +152,7 @@ if (empty($reshook))
if (empty($object->ref)) if (empty($object->ref))
{ {
$error++; $error++;
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
} }
if (! $error) if (! $error)
@ -183,7 +183,7 @@ if (empty($reshook))
if ($result > 0) if ($result > 0)
{ {
// Delete OK // Delete OK
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); setEventMessages("RecordDeleted", null, 'mesgs');
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
exit; exit;
} }

View File

@ -407,7 +407,7 @@ if ($action == 'update')
if (! $datef && $percentage == 100) if (! $datef && $percentage == 100)
{ {
$error++; $donotclearsession=1; $error++; $donotclearsession=1;
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),$object->errors,'errors');
$action = 'edit'; $action = 'edit';
} }

View File

@ -4385,15 +4385,17 @@ function dol_htmloutput_events()
/** /**
* Get formated messages to output (Used to show messages on html output). * Get formated messages to output (Used to show messages on html output).
* This include also the translation of the message key.
* *
* @param string $mesgstring Message string * @param string $mesgstring Message string or message key
* @param array $mesgarray Messages array * @param string[] $mesgarray Array of message strings or message keys
* @param string $style Style of message output ('ok' or 'error') * @param string $style Style of message output ('ok' or 'error')
* @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify)
* @return string Return html output * @return string Return html output
* *
* @see dol_print_error * @see dol_print_error
* @see dol_htmloutput_errors * @see dol_htmloutput_errors
* @see setEventMessages
*/ */
function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) function get_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0)
{ {
@ -4478,14 +4480,15 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
/** /**
* Print formated messages to output (Used to show messages on html output). * Print formated messages to output (Used to show messages on html output).
* *
* @param string $mesgstring Message * @param string $mesgstring Message string or message key
* @param array $mesgarray Messages array * @param string[] $mesgarray Array of message strings or message keys
* @param string $style Which style to use ('ok', 'warning', 'error') * @param string $style Which style to use ('ok', 'warning', 'error')
* @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify)
* @return void * @return void
* *
* @see dol_print_error * @see dol_print_error
* @see dol_htmloutput_errors * @see dol_htmloutput_errors
* @see setEventMessages
*/ */
function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0) function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0)
{ {

View File

@ -709,7 +709,7 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 &&
} }
else else
{ {
setEventMessages($langs->transnoentitiesnoconv("NOT_AUTHOR"), '', 'errors'); setEventMessages("NOT_AUTHOR", '', 'errors');
} }
} }

View File

@ -339,8 +339,7 @@ if ($_REQUEST['action'] == 'download')
} }
else else
{ {
//TODO: Translate setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile',$remotefile), null, 'errors');
setEventMessage('Failed to get file '.$remotefile, 'errors');
} }
} }

View File

@ -102,7 +102,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
} }
} }
if (! $error) setEventMessages($langs->trans('UpdateConfCPOK'), '', 'mesgs'); if (! $error) setEventMessages('UpdateConfCPOK', '', 'mesgs');
} }
elseif($action == 'add_event') elseif($action == 'add_event')
{ {
@ -122,7 +122,7 @@ elseif($action == 'add_event')
if ($error) if ($error)
{ {
setEventMessages($langs->trans('ErrorAddEventToUserCP'), '', 'errors'); setEventMessages('ErrorAddEventToUserCP', '', 'errors');
} }
else else
{ {
@ -135,7 +135,7 @@ elseif($action == 'add_event')
$holiday->updateSoldeCP($userCP,$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday);
setEventMessages($langs->trans('AddEventToUserOkCP'), '', 'mesgs'); setEventMessages('AddEventToUserOkCP', '', 'mesgs');
} }
} }

View File

@ -96,12 +96,12 @@ if ($action == 'assign')
} }
else else
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
$error++; $error++;
} }
if (! GETPOST('type')) if (! GETPOST('type'))
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
$error++; $error++;
} }
if (! $error) if (! $error)
@ -126,7 +126,7 @@ if ($action == 'assign')
if (! $error) if (! $error)
{ {
setEventMessages($langs->trans("TaskAssignedToEnterTime"), null); setEventMessages("TaskAssignedToEnterTime", null);
} }
$action=''; $action='';
@ -180,7 +180,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
} }
else else
{ {
setEventMessages($langs->trans("ErrorBadDate"), null, 'errors'); setEventMessages("ErrorBadDate", null, 'errors');
$error++; $error++;
break; break;
} }

View File

@ -108,12 +108,12 @@ if ($action == 'assign')
} }
else else
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
$error++; $error++;
} }
if (! GETPOST('type')) if (! GETPOST('type'))
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
$error++; $error++;
} }
if (! $error) if (! $error)
@ -138,7 +138,7 @@ if ($action == 'assign')
if (! $error) if (! $error)
{ {
setEventMessages($langs->trans("TaskAssignedToEnterTime"), null); setEventMessages("TaskAssignedToEnterTime", null);
} }
$action=''; $action='';

View File

@ -482,7 +482,7 @@ if ($action == 'update' && ! $_POST["cancel"])
{ {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors'); setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
} }
} }
} }