Merge pull request #36546 from defrance/patch-835467

Update holiday api methods from setValidate/setApproved to validate/a…
This commit is contained in:
Laurent Destailleur 2025-12-05 12:09:23 +01:00 committed by GitHub
commit 7f6737845e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@
* Copyright (C) 2020-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -365,7 +366,7 @@ class Holidays extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->holiday->setValidate(DolibarrApiAccess::$user, $notrigger);
$result = $this->holiday->validate(DolibarrApiAccess::$user, $notrigger);
if ($result == 0) {
throw new RestException(304, 'Error nothing done. May be object is already validated');
}
@ -410,7 +411,7 @@ class Holidays extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$result = $this->holiday->setApproved(DolibarrApiAccess::$user, $notrigger);
$result = $this->holiday->approve(DolibarrApiAccess::$user, $notrigger);
if ($result == 0) {
throw new RestException(304, 'Error nothing done. May be object is already approved');
}