Compare commits

...

16 Commits

Author SHA1 Message Date
Laurent Destailleur
764bb3791b Fix CI 2025-12-04 21:51:03 +01:00
Laurent Destailleur
47799b88cf Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-12-04 18:40:23 +01:00
Laurent Destailleur
78ca968db6 Merge pull request #36517 from atm-florianm/SEC/commented-out-restrictedArea
SEC: FIX #36430 permissions not checked on other tabs of HRM evaluation card
2025-12-04 18:37:46 +01:00
Laurent Destailleur
aa8fac1deb Merge pull request #36429 from atm-adrien/FIX/MulticompanyStockCompatibility
FIX : Implementation of multi-company compatibility with inventory/warehouse management
2025-12-04 10:42:35 +01:00
Eric - CAP-REL
2ebdcfda5c Merge pull request #35788 from Easya-Solutions/18_allow_credit_invoice_on_situation
FIX : remove useless condition to create credit on situation invoice …
2025-12-04 09:56:30 +01:00
Eric - CAP-REL
70431043af Merge pull request #36398 from Easya-Solutions/18.0_fix-invoice-card-variables
FIX undefined variables on create invoice from shipment card (backport from v20)
2025-12-04 09:30:56 +01:00
lvessiller-opendsi
ad37ece7bc Merge pull request #36494 from atm-florianm/FIX/155/date/minute-second-vs-min-sec
FIX 18.0: `GETPOSTDATE()` and `buildParamDate()` assumed wrong HTTP param names
2025-12-04 09:27:44 +01:00
atm-florian
a1476fd221 SEC: permissions not checked on other tabs of HRM evaluation card 2025-12-03 17:11:14 +01:00
atm-florian
0e1c580f11 FIX 18.0: GETPOSTDATE and buildParamDate assumed HTTP param names 'minute' and 'second' instead of 'min' and 'sec' 2025-12-01 13:47:50 +01:00
Laurent Destailleur
4223ff08ce Merge pull request #36491 from Easya-Solutions/18.0_fix-update-extras
FIX not remove value of others extra-fields on update extras action
2025-12-01 13:10:08 +01:00
VESSILLER
d16f8b68db FIX not remove value of others extra-fields on update extras action 2025-12-01 11:14:16 +01:00
Laurent Destailleur
d8891130f5 Merge pull request #36463 from vold-lu/18.0
NEW: Automatically release docker image for each GitHub release
2025-11-28 18:13:47 +01:00
Aloïs Micard
b2f9de7489 Add new workflow to trigger Docker build 2025-11-28 17:27:32 +01:00
Adrien Raze
c1c2358e75 FIX : Implementation of multi-company compatibility with inventory/warehouse management 2025-11-26 12:30:22 +01:00
VESSILLER
1cd3ca3222 FIX undefined variables on create invoice from shipment card (backport from v20) 2025-11-24 10:30:08 +01:00
tnegre
8ddf9f6075 FIX : remove useless condition to create credit on situation invoice (#35786) 2025-10-16 11:57:49 +02:00
12 changed files with 58 additions and 35 deletions

24
.github/workflows/ci-on-release.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: "CI-RELEASE"
on:
release:
types: [published]
jobs:
trigger-docker:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.RELEASE_DOCKER_ID }}
private-key: ${{ secrets.RELEASE_DOCKER_SECRET }}
- uses: peter-evans/repository-dispatch@v4
with:
token: ${{ steps.generate-token.outputs.token }}
repository: Dolibarr/dolibarr-docker
event-type: new-release
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'

View File

@@ -1710,25 +1710,25 @@ if (empty($reshook)) {
// Date start // Date start
$date_start = false; $date_start = false;
if ($lines[$i]->date_debut_prevue) { if (isset($lines[$i]->date_debut_prevue)) {
$date_start = $lines[$i]->date_debut_prevue; $date_start = $lines[$i]->date_debut_prevue;
} }
if ($lines[$i]->date_debut_reel) { if (isset($lines[$i]->date_debut_reel)) {
$date_start = $lines[$i]->date_debut_reel; $date_start = $lines[$i]->date_debut_reel;
} }
if ($lines[$i]->date_start) { if (isset($lines[$i]->date_start)) {
$date_start = $lines[$i]->date_start; $date_start = $lines[$i]->date_start;
} }
// Date end // Date end
$date_end = false; $date_end = false;
if ($lines[$i]->date_fin_prevue) { if (isset($lines[$i]->date_fin_prevue)) {
$date_end = $lines[$i]->date_fin_prevue; $date_end = $lines[$i]->date_fin_prevue;
} }
if ($lines[$i]->date_fin_reel) { if (isset($lines[$i]->date_fin_reel)) {
$date_end = $lines[$i]->date_fin_reel; $date_end = $lines[$i]->date_fin_reel;
} }
if ($lines[$i]->date_end) { if (isset($lines[$i]->date_end)) {
$date_end = $lines[$i]->date_end; $date_end = $lines[$i]->date_end;
} }
@@ -5796,10 +5796,9 @@ if ($action == 'create') {
} }
} }
// For situation invoice with excess received // For situation invoice
if ($object->statut > Facture::STATUS_DRAFT if ($object->statut > Facture::STATUS_DRAFT
&& $object->type == Facture::TYPE_SITUATION && $object->type == Facture::TYPE_SITUATION
&& ($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits) > 0
&& $usercancreate && $usercancreate
&& !$objectidnext && !$objectidnext
&& $object->is_last_in_cycle() && $object->is_last_in_cycle()

View File

@@ -351,9 +351,11 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !em
if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) {
$object->fetch(GETPOST('id', 'int')); $object->fetch(GETPOST('id', 'int'));
$attribute = GETPOST('attribute', 'aZ09');
$error = 0; $error = 0;
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET'); $ret = $extrafields->setOptionalsFromPost(null, $object, $attribute);
if ($ret < 0) { if ($ret < 0) {
$error++; $error++;
setEventMessages($extrafields->error, $object->errors, 'errors'); setEventMessages($extrafields->error, $object->errors, 'errors');

View File

@@ -12996,8 +12996,8 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto')
{ {
if ($hourTime === 'getpost') { if ($hourTime === 'getpost') {
$hour = GETPOSTINT($prefix . 'hour'); $hour = GETPOSTINT($prefix . 'hour');
$minute = GETPOSTINT($prefix . 'minute'); $minute = GETPOSTINT($prefix . 'min');
$second = GETPOSTINT($prefix . 'second'); $second = GETPOSTINT($prefix . 'sec');
} elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) { } elseif (preg_match('/^(\d\d):(\d\d):(\d\d)$/', $hourTime, $m)) {
$hour = intval($m[1]); $hour = intval($m[1]);
$minute = intval($m[2]); $minute = intval($m[2]);
@@ -13034,8 +13034,8 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto'
if ($hourTime === 'getpost' || ($timestamp !== null && dol_print_date($timestamp, '%H:%M:%S') !== '00:00:00')) { if ($hourTime === 'getpost' || ($timestamp !== null && dol_print_date($timestamp, '%H:%M:%S') !== '00:00:00')) {
$TParam = array_merge($TParam, array( $TParam = array_merge($TParam, array(
$prefix . 'hour' => intval(dol_print_date($timestamp, '%H')), $prefix . 'hour' => intval(dol_print_date($timestamp, '%H')),
$prefix . 'minute' => intval(dol_print_date($timestamp, '%M')), $prefix . 'min' => intval(dol_print_date($timestamp, '%M')),
$prefix . 'second' => intval(dol_print_date($timestamp, '%S')) $prefix . 'sec' => intval(dol_print_date($timestamp, '%S'))
)); ));
} }

View File

@@ -902,14 +902,14 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 0; $checkonentitydone = 0;
// Array to define rules of checks to do // Array to define rules of checks to do
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement'); // Test on entity only (Objects with no link to company) $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement', 'stock'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for object Societe $checksoc = array('societe'); // Test for object Societe
$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...). $checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet', 'project'); // Test for project object $checkproject = array('projet', 'project'); // Test for project object
$checktask = array('projet_task', 'project_task'); // Test for task object $checktask = array('projet_task', 'project_task'); // Test for task object
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user $checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null) $checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
$nocheck = array('barcode', 'stock'); // No test $nocheck = array('barcode'); // No test
//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...). //$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).

View File

@@ -96,8 +96,9 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; //if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (!isModEnabled('hrm')) { if (!isModEnabled('hrm')) {
accessforbidden(); accessforbidden();
} }

View File

@@ -62,10 +62,8 @@ $permission = $user->rights->hrm->evaluation->write;
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; //if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
//if (empty($conf->hrm->enabled)) accessforbidden();
//if (!$permissiontoread) accessforbidden();

View File

@@ -85,10 +85,10 @@ $permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the includ
$permissiontoread = $user->rights->hrm->evaluation->read; $permissiontoread = $user->rights->hrm->evaluation->read;
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; $isdraft = $object->status == Evaluation::STATUS_DRAFT ? 1 : 0;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden(); if (empty($conf->hrm->enabled)) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();

View File

@@ -66,10 +66,10 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the includ
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid; //if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == Evaluation::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
//if (empty($conf->hrm->enabled)) accessforbidden(); if (empty($conf->hrm->enabled)) accessforbidden();
//if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();
/* /*

View File

@@ -42,9 +42,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$result = restrictedArea($user, 'stock', $id); $result = restrictedArea($user, 'stock', $id, 'inventory&stock');
} else { } else {
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); $result = restrictedArea($user, 'stock', $id, 'inventory&stock', 'inventory_advance');
} }
// Initialize technical objects // Initialize technical objects

View File

@@ -59,9 +59,9 @@ $batch = GETPOST('batch', 'alphanohtml');
$totalExpectedValuation = 0; $totalExpectedValuation = 0;
$totalRealValuation = 0; $totalRealValuation = 0;
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$result = restrictedArea($user, 'stock', $id); $result = restrictedArea($user, 'stock', $id, 'inventory&stock');
} else { } else {
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance'); $result = restrictedArea($user, 'stock', $id, 'inventory&stock', 'inventory_advance');
} }
// Initialize technical objects // Initialize technical objects

View File

@@ -70,8 +70,7 @@ if (!$sortorder) {
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
// Security check // Security check
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock'); $result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result = restrictedArea($user, 'stock');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('warehousecard', 'globalcard')); $hookmanager->initHooks(array('warehousecard', 'globalcard'));