Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2a7ce987c3
4 changed files with 12 additions and 10 deletions
|
|
@ -302,7 +302,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart) { // delete
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart) { // @phpstan-ignore-line
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
} else {
|
||||
|
|
@ -323,7 +323,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart)
|
|||
}
|
||||
|
||||
// activate
|
||||
if ($action == 'activate' && $permissiontoeditchart) {
|
||||
if ($action == 'activate' && $permissiontoeditchart) { // @phpstan-ignore-line
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE rowid = ".((int) $rowid);
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
|
|
@ -332,7 +332,7 @@ if ($action == 'activate' && $permissiontoeditchart) {
|
|||
}
|
||||
|
||||
// disable
|
||||
if ($action == $acts[1] && $permissiontoeditchart) {
|
||||
if ($action == $acts[1] && $permissiontoeditchart) { // @phpstan-ignore-line
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE rowid = ".((int) $rowid);
|
||||
$result = $db->query($sql);
|
||||
if (!$result) {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ $usercancreatecontract = $user->hasRight("contrat", "creer");
|
|||
|
||||
// Advanced Permissions
|
||||
$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('facture', 'invoice_advance', 'validate')));
|
||||
$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('facture', 'invoice_advance', 'send')));
|
||||
$usercansend = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercanread) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('facture', 'invoice_advance', 'send')));
|
||||
$usercanreopen = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('facture', 'invoice_advance', 'reopen')));
|
||||
if (getDolGlobalString('INVOICE_DISALLOW_REOPEN')) {
|
||||
$usercanreopen = false;
|
||||
|
|
@ -310,8 +310,7 @@ if (empty($reshook)) {
|
|||
|
||||
$isErasable = $object->is_erasable();
|
||||
|
||||
if (($usercandelete && $isErasable > 0)
|
||||
|| ($usercancreate && $isErasable == 1)) {
|
||||
if (($isErasable > 0) || ($usercancreate && $isErasable == 1)) {
|
||||
$result = $object->delete($user, 0, (int) $idwarehouse);
|
||||
if ($result > 0) {
|
||||
header('Location: '.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1');
|
||||
|
|
|
|||
|
|
@ -207,7 +207,10 @@ class DolEditor
|
|||
|
||||
$fullpage = false;
|
||||
|
||||
$extraAllowedContent = 'a[target];section[contenteditable,id];div{background-color,color,display,float,height,margin,margin-top,margin-bottom,padding,padding-left,padding-right,padding-top,padding-bottom,width,border-top-left-radius,border-top-right-radius,border-bottom-left-radius,border-bottom-right-radius,box-shadow}';
|
||||
$extraAllowedContent = 'a[target];';
|
||||
$extraAllowedContent .= 'section[contenteditable,id];';
|
||||
$extraAllowedContent .= 'div{background-color,color,display,float,height,margin,margin-top,margin-bottom,padding,padding-left,padding-right,padding-top,padding-bottom,width,border-top-left-radius,border-top-right-radius,border-bottom-left-radius,border-bottom-right-radius,box-shadow}';
|
||||
|
||||
if (is_string($restrictContent)) {
|
||||
$extraAllowedContent = $restrictContent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If status is waiting approval and approver is also user
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall)) {
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
$object->date_approval = dol_now();
|
||||
|
|
@ -731,7 +731,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If status pending validation and validator = user
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall) && $permissiontoapprove) {
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && ($user->id == $object->fk_validator || $permissiontoaddall)) {
|
||||
$object->date_refuse = dol_now();
|
||||
$object->fk_user_refuse = $user->id;
|
||||
$object->statut = Holiday::STATUS_REFUSED;
|
||||
|
|
@ -1625,7 +1625,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
}
|
||||
if ($object->status == Holiday::STATUS_APPROVED) { // If validated and approved
|
||||
if ($user->id == $object->fk_validator || $user->id == $object->fk_user_approve || $permissiontoadd || $permissiontoaddall || $permissiontoapprove) {
|
||||
if (($object->date_fin > dol_now()) || $permissiontoapprove || $user->id == $object->fk_user_approve) {
|
||||
if ((($object->date_fin > dol_now()) && $permissiontoapprove) || $user->id == $object->fk_user_approve) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
} else {
|
||||
if ($object->date_fin <= dol_now() && $permissiontoapprove) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue