Fix duplicate translation/encoding on setEventMessage
This commit is contained in:
parent
24a216b154
commit
c785f8cfb1
@ -149,7 +149,7 @@ if (empty($reshook))
|
||||
if (empty($object->ref))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -180,7 +180,7 @@ if (empty($reshook))
|
||||
if ($result > 0)
|
||||
{
|
||||
// Delete OK
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ if ($action == 'update')
|
||||
if (! $datef && $percentage == 100)
|
||||
{
|
||||
$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';
|
||||
}
|
||||
|
||||
|
||||
@ -4385,15 +4385,17 @@ function dol_htmloutput_events()
|
||||
|
||||
/**
|
||||
* 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 array $mesgarray Messages array
|
||||
* @param string $mesgstring Message string or message key
|
||||
* @param string[] $mesgarray Array of message strings or message keys
|
||||
* @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)
|
||||
* @return string Return html output
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_errors
|
||||
* @see setEventMessages
|
||||
*/
|
||||
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).
|
||||
*
|
||||
* @param string $mesgstring Message
|
||||
* @param array $mesgarray Messages array
|
||||
* @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 string $mesgstring Message string or message key
|
||||
* @param string[] $mesgarray Array of message strings or message keys
|
||||
* @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)
|
||||
* @return void
|
||||
*
|
||||
* @see dol_print_error
|
||||
* @see dol_htmloutput_errors
|
||||
* @see setEventMessages
|
||||
*/
|
||||
function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0)
|
||||
{
|
||||
|
||||
@ -709,7 +709,7 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 &&
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->transnoentitiesnoconv("NOT_AUTHOR"), '', 'errors');
|
||||
setEventMessages("NOT_AUTHOR", '', 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ if ($action == 'download')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('FailedToGetFile',$remotefile), null, 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile',$remotefile), null, 'errors');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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')
|
||||
{
|
||||
@ -122,7 +122,7 @@ elseif($action == 'add_event')
|
||||
|
||||
if ($error)
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorAddEventToUserCP'), '', 'errors');
|
||||
setEventMessages('ErrorAddEventToUserCP', '', 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -135,7 +135,7 @@ elseif($action == 'add_event')
|
||||
|
||||
$holiday->updateSoldeCP($userCP,$new_holiday);
|
||||
|
||||
setEventMessages($langs->trans('AddEventToUserOkCP'), '', 'mesgs');
|
||||
setEventMessages('AddEventToUserOkCP', '', 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -96,12 +96,12 @@ if ($action == 'assign')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! GETPOST('type'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
@ -126,7 +126,7 @@ if ($action == 'assign')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("TaskAssignedToEnterTime"), null);
|
||||
setEventMessages("TaskAssignedToEnterTime", null);
|
||||
}
|
||||
|
||||
$action='';
|
||||
@ -180,7 +180,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorBadDate"), null, 'errors');
|
||||
setEventMessages("ErrorBadDate", null, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -108,12 +108,12 @@ if ($action == 'assign')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! GETPOST('type'))
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), '', 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
@ -138,7 +138,7 @@ if ($action == 'assign')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessages($langs->trans("TaskAssignedToEnterTime"), null);
|
||||
setEventMessages("TaskAssignedToEnterTime", null);
|
||||
}
|
||||
|
||||
$action='';
|
||||
|
||||
@ -482,7 +482,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user