2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-03-05 17:23:46 +01:00
16 changed files with 238 additions and 49 deletions

36
.github/workflows/cache-clean-pr.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
---
name: Cleanup caches of a closed branch
# See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
on:
pull_request:
types: [closed]
workflow_dispatch:
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -85,17 +85,11 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
// Clean code
// To manage zero or not at the end of the accounting account
if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
$account_number = $account_number;
} else {
if (!getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
$account_number = clean_account($account_number);
}
if (GETPOSTINT('account_parent') <= 0) {
$account_parent = 0;
} else {
$account_parent = GETPOSTINT('account_parent');
}
$account_parent = (GETPOSTINT('account_parent') > 0) ? GETPOSTINT('account_parent') : 0;
$object->fk_pcg_version = $obj->pcg_version;
$object->pcg_type = GETPOST('pcg_type', 'alpha');
@@ -148,17 +142,11 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
// Clean code
// To manage zero or not at the end of the accounting account
if (getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
$account_number = $account_number;
} else {
if (!getDolGlobalString('ACCOUNTING_MANAGE_ZERO')) {
$account_number = clean_account($account_number);
}
if (GETPOSTINT('account_parent') <= 0) {
$account_parent = 0;
} else {
$account_parent = GETPOSTINT('account_parent');
}
$account_parent = (GETPOSTINT('account_parent') > 0) ? GETPOSTINT('account_parent') : 0;
$object->fk_pcg_version = $obj->pcg_version;
$object->pcg_type = GETPOST('pcg_type', 'alpha');

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
@@ -74,7 +74,9 @@ class Adherent extends CommonObject
*/
public $picto = 'member';
/**
* @var string[] array of messages
*/
public $mesgs;
/**
@@ -217,6 +219,9 @@ class Adherent extends CommonObject
*/
public $gender;
/**
* @var int|string date of birth
*/
public $birth;
/**
@@ -249,22 +254,49 @@ class Adherent extends CommonObject
// Fields loaded by fetch_subscriptions() from member table
/**
* @var int|string date
*/
public $first_subscription_date;
/**
* @var int|string date
*/
public $first_subscription_date_start;
/**
* @var int|string date
*/
public $first_subscription_date_end;
/**
* @var int|string date
*/
public $first_subscription_amount;
/**
* @var int|string date
*/
public $last_subscription_date;
/**
* @var int|string date
*/
public $last_subscription_date_start;
/**
* @var int|string date
*/
public $last_subscription_date_end;
/**
* @var int|string date
*/
public $last_subscription_amount;
/**
* @var array
*/
public $subscriptions = array();
/**

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -38,13 +38,39 @@ class ICal
*/
public $file;
// Text in file
/**
* @var string Text in file
*/
public $file_text;
public $cal; // Array to save iCalendar parse data
public $event_count; // Number of Events
public $todo_count; // Number of Todos
public $freebusy_count; // Number of Freebusy
public $last_key; //Help variable save last key (multiline string)
/**
* @var array Array to save iCalendar parse data
*/
public $cal;
/**
* @var int Number of Events
*/
public $event_count;
/**
* @var int Number of Todos
*/
public $todo_count;
/**
* @var int Number of Freebusy
*/
public $freebusy_count;
/**
* @var string Help variable save last key (multiline string)
*/
public $last_key;
/**
* @var string error message
*/
public $error;

View File

@@ -233,7 +233,7 @@ if (empty($reshook)) {
$line->fetch_product();
}
if (is_object($line->product) && $line->product->id > 0) {
if (empty($line->product->tosell)) {
if (empty($line->product->status)) {
$warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref);
}
}

View File

@@ -203,7 +203,7 @@ if (empty($reshook)) {
$line->fetch_product();
}
if (is_object($line->product) && $line->product->id > 0) {
if (empty($line->product->tosell)) {
if (empty($line->product->status)) {
$warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref);
}
}

View File

@@ -234,7 +234,7 @@ if (empty($reshook)) {
$line->fetch_product();
}
if (is_object($line->product) && $line->product->id > 0) {
if (empty($line->product->tosell)) {
if (empty($line->product->status)) {
$warningMsgLineList[$line->id] = $langs->trans('WarningLineProductNotToSell', $line->product->ref);
}
}

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -184,7 +185,7 @@ class FormAdmin
* @param string $htmlname Name of html select
* @param array $dirmenuarray Array of directories to scan
* @param string $moreattrib More attributes on html select tag
* @return integer|null
* @return integer|void
*/
public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '')
{

View File

@@ -9288,7 +9288,7 @@ function setEventMessage($mesgs, $style = 'mesgs', $noduplicate = 0)
* Set event messages in dol_events session object. Will be output by calling dol_htmloutput_events.
* Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.
*
* @param string $mesg Message string
* @param string|null $mesg Message string
* @param array|null $mesgs Message array
* @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors')
* @param string $messagekey A key to be used to allow the feature "Never show this message again"

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -335,7 +335,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
/**
* @var string[] List of module class names that must be enabled if this module is enabled. e.g.: array('modAnotherModule', 'FR'=>'modYetAnotherModule')
* @var array List of module class names that must be enabled if this module is enabled. e.g.: array('modAnotherModule', 'FR'=>'modYetAnotherModule')
* Another example : array('always'=>array("modBanque", "modFacture", "modProduct", "modCategorie"), 'FR'=>array('modBlockedLog'));
* @see $requiredby
*/
public $depends;

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016-2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -165,8 +165,15 @@ class ProductFournisseur extends Product
*/
public $fk_supplier_price_expression;
public $supplier_reputation; // reputation of supplier
public $reputations = array(); // list of available supplier reputations
/**
* @var string reputation of supplier
*/
public $supplier_reputation;
/**
* @var string[] list of available supplier reputations
*/
public $reputations = array();
// Multicurreny
public $fourn_multicurrency_id;

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2020 Ahmad Jamaly Rabib <rabib@metroworks.co.jp>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -49,28 +49,99 @@ class Import
*/
public $errno;
/**
* @var array
*/
public $array_import_module;
/**
* @var array
*/
public $array_import_perms;
/**
* @var array
*/
public $array_import_icon;
/**
* @var array
*/
public $array_import_code;
/**
* @var array
*/
public $array_import_label;
/**
* @var array
*/
public $array_import_tables;
/**
* @var array
*/
public $array_import_tables_creator;
/**
* @var array
*/
public $array_import_fields;
/**
* @var array
*/
public $array_import_fieldshidden;
/**
* @var array
*/
public $array_import_entities;
/**
* @var array
*/
public $array_import_regex;
/**
* @var array
*/
public $array_import_updatekeys;
/**
* @var array
*/
public $array_import_preselected_updatekeys;
/**
* @var array
*/
public $array_import_examplevalues;
/**
* @var array
*/
public $array_import_convertvalue;
/**
* @var array
*/
public $array_import_run_sql_after;
// To store import templates
public $id;
public $hexa; // List of fields in the export profile
public $datatoimport;
public $model_name; // Name of export profile
/**
* @var string Name of export profile
*/
public $model_name;
/**
* @var int ID
*/
public $fk_user;

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2019-2020 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -55,8 +55,10 @@ class IntracommReport extends CommonObject
public $picto = 'intracommreport';
public $label; // ref ???
/**
* @var string ref ???
*/
public $label;
public $period;
@@ -67,7 +69,14 @@ class IntracommReport extends CommonObject
*/
public $declaration_number;
/**
* @var string
*/
public $exporttype; // deb or des
/**
* @var string
*/
public $type_declaration; // 'introduction' or 'expedition'
public $numero_declaration;

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -54,9 +54,24 @@ class MailmanSpip
*/
public $errors = array();
/**
* @var array
*/
public $mladded_ok;
/**
* @var array
*/
public $mladded_ko;
/**
* @var array
*/
public $mlremoved_ok;
/**
* @var array
*/
public $mlremoved_ko;

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@@ -148,7 +148,7 @@ class modMyModule extends DolibarrModules
$this->langfiles = array("mymodule@mymodule");
// Prerequisites
$this->phpmin = array(7, 0); // Minimum version of PHP required by module
$this->phpmin = array(7, 1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
$this->need_javascript_ajax = 0;
@@ -179,9 +179,12 @@ class modMyModule extends DolibarrModules
// Array to add new pages in new tabs
$this->tabs = array();
// Example:
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'read'):/mymodule/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'read'):/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
// To add a new tab identified by code tabname1
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'read'):/mymodule/mynewtab1.php?id=__ID__');
// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'read'):/mymodule/mynewtab2.php?id=__ID__',
// To remove an existing tab identified by code tabname
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove');
//
// Where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)

View File

@@ -922,7 +922,7 @@ class Reception extends CommonObject
$this->ref = trim($this->ref);
}
if (isset($this->entity)) {
$this->entity = trim($this->entity);
$this->entity = (int) $this->entity;
}
if (isset($this->ref_supplier)) {
$this->ref_supplier = trim($this->ref_supplier);
@@ -931,10 +931,10 @@ class Reception extends CommonObject
$this->socid = trim($this->socid);
}
if (isset($this->fk_user_author)) {
$this->fk_user_author = trim($this->fk_user_author);
$this->fk_user_author = (int) $this->fk_user_author;
}
if (isset($this->fk_user_valid)) {
$this->fk_user_valid = trim($this->fk_user_valid);
$this->fk_user_valid = (int) $this->fk_user_valid;
}
if (isset($this->shipping_method_id)) {
$this->shipping_method_id = (int) $this->shipping_method_id;