Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/actions_massactions.inc.php
	htdocs/core/tpl/contacts.tpl.php
This commit is contained in:
Laurent Destailleur 2021-06-15 22:17:53 +02:00
commit 87a19af86d
11 changed files with 20 additions and 16 deletions

View File

@ -39,7 +39,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
<br> <br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> <form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<?php if ($this->control->tpl['company_id']) { ?> <?php if ($this->control->tpl['company_id']) { ?>

View File

@ -39,7 +39,7 @@ echo $this->control->tpl['ajax_selectcountry'];
<br> <br>
<form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id', 'int'); ?>"> <form method="post" name="formsoc" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id', 'int'); ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="id" value="<?php echo GETPOST('id', 'int'); ?>"> <input type="hidden" name="id" value="<?php echo GETPOST('id', 'int'); ?>">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">

View File

@ -1053,9 +1053,9 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { //elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($objecttmp->thirdparty)) { // In massaction $objecttmp->thirdparty can have several values
$newlang = $objecttmp->thirdparty->default_lang; // $newlang = $objecttmp->thirdparty->default_lang;
} //}
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);

View File

@ -138,7 +138,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:con
</script> </script>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<?php print dol_get_fiche_head(); ?> <?php print dol_get_fiche_head(); ?>

View File

@ -100,7 +100,7 @@ if ($permission) {
if (empty($hideaddcontactforuser)) { if (empty($hideaddcontactforuser)) {
?> ?>
<form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> <form class="tagtr impair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" /> <input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" /> <input type="hidden" name="source" value="internal" />
@ -130,7 +130,7 @@ if ($permission) {
?> ?>
<form class="tagtr pair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> <form class="tagtr pair nohover" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" /> <input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" /> <input type="hidden" name="source" value="external" />

View File

@ -91,7 +91,7 @@ $(document).ready(function () {
<div class="login_vertical_align"> <div class="login_vertical_align">
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>"> <form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="buildnewpassword"> <input type="hidden" name="action" value="buildnewpassword">

View File

@ -39,7 +39,7 @@ print dol_get_fiche_head('');
<?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?> <?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<input type="hidden" name="type" value="0"> <input type="hidden" name="type" value="0">
<input type="hidden" name="canvas" value="<?php echo $canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas; ?>">

View File

@ -38,7 +38,7 @@ dol_htmloutput_errors($object->error, $object->errors);
?> ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="id" value="<?php echo $object->id; ?>"> <input type="hidden" name="id" value="<?php echo $object->id; ?>">
<input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>">

View File

@ -39,7 +39,7 @@ print dol_get_fiche_head('');
<?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?> <?php dol_htmloutput_errors($GLOBALS['mesg'], $GLOBALS['mesgs']); ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<input type="hidden" name="type" value="1"> <input type="hidden" name="type" value="1">
<input type="hidden" name="canvas" value="<?php echo $canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $canvas; ?>">

View File

@ -38,7 +38,7 @@ dol_htmloutput_errors($object->error, $object->errors);
?> ?>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>"> <input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" name="id" value="<?php echo $object->id; ?>"> <input type="hidden" name="id" value="<?php echo $object->id; ?>">
<input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>"> <input type="hidden" name="canvas" value="<?php echo $object->canvas; ?>">

View File

@ -1329,10 +1329,14 @@ if ($action == 'create' || $action == 'presend') {
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} } elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$arrayoffamiliestoexclude = array('objectamount'); $arrayoffamiliestoexclude = array('objectamount');
$action = 'add_message'; // action to use to post the message $action = 'add_message'; // action to use to post the message
@ -1341,7 +1345,7 @@ if ($action == 'create' || $action == 'presend') {
// Substitution array // Substitution array
$morehtmlright = ''; $morehtmlright = '';
$help = ""; $help = "";
$substitutionarray = getCommonSubstitutionArray($newlang, 0, $arrayoffamiliestoexclude, $object); $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
if ($object->fk_soc > 0) { if ($object->fk_soc > 0) {
$substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
} }