Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
This commit is contained in:
commit
688311c761
@ -1695,7 +1695,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
|
if (($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
|
||||||
{
|
{
|
||||||
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||||
{
|
{
|
||||||
@ -2155,7 +2155,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not ''
|
if ((empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
|
||||||
{
|
{
|
||||||
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -484,9 +484,9 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
|
|||||||
{
|
{
|
||||||
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||||
$sql.= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
$sql.= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||||
$sql.= " AND (ug.fk_user = dbt.rowid";
|
$sql.= " AND ((ug.fk_user = dbt.rowid";
|
||||||
$sql.= " AND ug.entity IN (".getEntity('user')."))";
|
$sql.= " AND ug.entity IN (".getEntity('usergroup')."))";
|
||||||
$sql.= " OR dbt.entity = 0"; // Show always superadmin
|
$sql.= " OR dbt.entity = 0)"; // Show always superadmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -196,7 +196,7 @@ if (constant('DOL_DATA_ROOT') === null) {
|
|||||||
}
|
}
|
||||||
if (@file_exists($lockfile))
|
if (@file_exists($lockfile))
|
||||||
{
|
{
|
||||||
if (! is_object($langs))
|
if (! isset($langs) || ! is_object($langs))
|
||||||
{
|
{
|
||||||
$langs = new Translate('..', $conf);
|
$langs = new Translate('..', $conf);
|
||||||
$langs->setDefaultLang('auto');
|
$langs->setDefaultLang('auto');
|
||||||
|
|||||||
@ -84,9 +84,11 @@ $socid=0;
|
|||||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||||
$feature2='user';
|
$feature2='user';
|
||||||
if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card
|
if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card
|
||||||
if (!$canreaduser) {
|
|
||||||
|
if (! $canreaduser) {
|
||||||
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->id <> $id && ! $canreaduser) accessforbidden();
|
if ($user->id <> $id && ! $canreaduser) accessforbidden();
|
||||||
|
|
||||||
// Load translation files required by page
|
// Load translation files required by page
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user