mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-12 12:03:03 +01:00
Compare commits
4 Commits
revert-368
...
phpstan-ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b08b93a10a | ||
|
|
ca52029551 | ||
|
|
9fa9d395dc | ||
|
|
cf621642fb |
@@ -10071,7 +10071,7 @@ parameters:
|
||||
-
|
||||
message: '#^If condition is always true\.$#'
|
||||
identifier: if.alwaysTrue
|
||||
count: 12
|
||||
count: 10
|
||||
path: ../../../htdocs/imports/import.php
|
||||
|
||||
-
|
||||
|
||||
@@ -202,6 +202,7 @@ if ($reshook < 0) {
|
||||
$result = restrictedArea($user, 'agenda', $object, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id');
|
||||
|
||||
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || ((empty($object->id) || $object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create'));
|
||||
$usercandelete = $user->hasRight('agenda', 'allactions', 'delete') || (($object->authorid === $user->id || $object->userownerid === $user->id) && $user->hasRight('agenda', 'myactions', 'delete'));
|
||||
|
||||
|
||||
/*
|
||||
@@ -1206,22 +1207,19 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
||||
}
|
||||
|
||||
// Delete event
|
||||
if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes' && $usercancreate) {
|
||||
if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes' && $usercandelete) {
|
||||
$object->fetch($id);
|
||||
$object->fetch_optionals();
|
||||
$object->fetch_userassigned();
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
if ($user->hasRight('agenda', 'myactions', 'delete')
|
||||
|| $user->hasRight('agenda', 'allactions', 'delete')) {
|
||||
$result = $object->delete($user);
|
||||
$result = $object->delete($user);
|
||||
|
||||
if ($result >= 0) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
if ($result >= 0) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2977,8 +2975,7 @@ if ($id > 0 && $action != 'create') {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ToClone").'</a></div>';
|
||||
}
|
||||
|
||||
if ($user->hasRight('agenda', 'allactions', 'delete') ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'delete'))) {
|
||||
if ($usercandelete) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Delete").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Delete").'</a></div>';
|
||||
|
||||
@@ -286,7 +286,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = price2num(GETPOSTINT("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
if (empty($dto)) {
|
||||
$dto = 0;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = GETPOSTINT("dto_".$reg[1].'_'.$reg[2]);
|
||||
$dto = GETPOSTFLOAT("dto_".$reg[1].'_'.$reg[2]);
|
||||
if (!empty($dto)) {
|
||||
$unit_price = price2num((float) GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU');
|
||||
}
|
||||
@@ -374,7 +374,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = GETPOSTINT("dto_".$reg[1].'_'.$reg[2]);
|
||||
$dto = GETPOSTFLOAT("dto_".$reg[1].'_'.$reg[2]);
|
||||
//update supplier price
|
||||
if (GETPOSTISSET($saveprice)) {
|
||||
// TODO Use class
|
||||
|
||||
@@ -265,7 +265,7 @@ if ($action == 'updatelines' && $permissiontoreceive) {
|
||||
|
||||
if (!$error && getDolGlobalString('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT')) {
|
||||
if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
|
||||
$dto = price2num(GETPOSTINT("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2]), '');
|
||||
if (empty($dto)) {
|
||||
$dto = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user