Merge branch 'develop' into fix-dolresource-phpstan-lvl3
# Conflicts: # htdocs/resource/card.php
This commit is contained in:
commit
8fbeb2deac
118 changed files with 1274 additions and 624 deletions
|
|
@ -15,7 +15,6 @@ repos:
|
|||
- id: trailing-whitespace
|
||||
exclude_types: [markdown]
|
||||
- id: end-of-file-fixer
|
||||
types: [yaml]
|
||||
- id: check-merge-conflict
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-shebang-scripts-are-executable
|
||||
|
|
@ -77,7 +76,7 @@ repos:
|
|||
- css
|
||||
- yaml
|
||||
|
||||
# Check format of yam files
|
||||
# Check format of yaml files
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
rev: v1.32.0
|
||||
hooks:
|
||||
|
|
|
|||
20
ChangeLog
20
ChangeLog
|
|
@ -3,6 +3,26 @@ English Dolibarr ChangeLog
|
|||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.0 compared to 18.0.0 *****
|
||||
|
||||
For users:
|
||||
----------
|
||||
NEW: Compatibility with PHP 8.3
|
||||
...
|
||||
|
||||
For developers or integrators:
|
||||
------------------------------
|
||||
...
|
||||
|
||||
WARNING:
|
||||
--------
|
||||
|
||||
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
|
||||
* Some API HTTP return code were moved from 401 to 403 to better follow REST specification.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.0 compared to 18.0.0 *****
|
||||
|
||||
For users:
|
||||
|
|
|
|||
14
SECURITY.md
14
SECURITY.md
|
|
@ -48,12 +48,16 @@ Reports are processed around once a month.
|
|||
|
||||
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":
|
||||
|
||||
* The version to analyze must be the last version available in the "develop" branch or in the last stable "vX.Y" released version. Reports on vulnerabilities already fixed (so already reported) in the develop branch will not be validated.
|
||||
* The version to analyze must be the last version available in the "develop" branch. Reports on vulnerabilities already fixed (so already reported) in the develop branch will not be validated.
|
||||
* $dolibarr_main_prod must be set to 1 in conf.php
|
||||
* $dolibarr_nocsrfcheck must be kept to the value 0 in conf.php (this is the default value)
|
||||
* $dolibarr_main_force_https must be set to something else than 0.
|
||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3 in the backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default). CSRF attacks are accepted but
|
||||
double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3.
|
||||
* Some constant must be set in the backoffice menu Home - Setup - Other
|
||||
- MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3
|
||||
- MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1
|
||||
- MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1
|
||||
- MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 1
|
||||
CSRF attacks and HTML injections are accepted but double check this setup that is experimental setup that already fix a lot of case and soon enabled by default.
|
||||
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles in "experimental", "development" or external modules are not valid vulnerabilities).
|
||||
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
||||
* The web server setup must be done so that only the documents directory is in write mode. The root directory called htdocs must be read-only.
|
||||
|
|
@ -87,12 +91,10 @@ Scope is the web application (backoffice) and the APIs.
|
|||
* Logout and other instances of low-severity Cross-Site Request Forgery
|
||||
* Reports from automated web vulnerability scanners (Acunetix, Vega, etc.) that have not been validated
|
||||
* Reports on features on modules flagged as "deprecated", "experimental" or "development" if the module needs to be enabled for that (this is not the case on production).
|
||||
* Software or libraries versions or private IP disclosure when logged-in user is admin
|
||||
* Stack traces or path disclosure when logged-in user is admin
|
||||
* Software or libraries versions, private IP disclosure, Stack traces or path disclosure when logged-in user is admin.
|
||||
* Any vulnerabilities due to a configuration different than the one defined in chapter "Scope for qualified vulnerabilities".
|
||||
* Vulnerabilities affecting outdated browsers or platforms, or vulnerabilities inside browsers themself.
|
||||
* Brute force attacks on login page, password forgotten page or any public pages (/public/*) are not qualified if the recommended fail2ban rules were not installed.
|
||||
* SSL/TLS best practices
|
||||
* Denial of Service attacks
|
||||
* Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC)
|
||||
* Physical or social engineering attempts or issues that require physical access to a victim’s computer/device
|
||||
|
|
|
|||
10
dev/setup/README.md
Normal file
10
dev/setup/README.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Setting up for Dolibarr development
|
||||
|
||||
Check out the
|
||||
[online documentation](https://wiki.dolibarr.org/index.php?title=Environment_and_development_tools)
|
||||
for recommendations (to be updated).
|
||||
|
||||
If anything, install `pre-commit` - it will help run the tools to format and
|
||||
make some basic verifications on your submission before committing and pushing
|
||||
to github for a PR. See [a quick start guide](./pre-commit/README.md) in this
|
||||
Dolibarr repository.
|
||||
85
dev/setup/pre-commit/README.md
Normal file
85
dev/setup/pre-commit/README.md
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
## 'pre-commit' ("replaces" precommit)
|
||||
|
||||
### Introduction
|
||||
|
||||
[`pre-commit`](https://pre-commit.org) is a framework for managing and
|
||||
maintaining multi-language pre-commit hooks.
|
||||
|
||||
"pre-commit hooks" integrate with `git` and are run when you perform a
|
||||
`git commit` for instance.
|
||||
|
||||
Historically there was `precommit` for Dolibarr which you can find in this
|
||||
directory. That script runs `phplint`, `phpcs` and `phpcbf` upon commit.
|
||||
|
||||
`pre-commit` is not specific to Dolibarr and is deployed on many projects -
|
||||
mostly Python projects, but it is applicable to most (or *all*) code and
|
||||
documentation development.
|
||||
|
||||
You can find documentation at https://pre-commit.com/ .
|
||||
|
||||
Now you can use `pre-commit` which uses the configuration found at the root of
|
||||
the project: `pre-commit-config.yaml`.
|
||||
|
||||
### How to
|
||||
|
||||
1. Install `pre-commit`.\
|
||||
If you do not have python installed, install
|
||||
[python](https://www.python.org) first.\
|
||||
If you do not have
|
||||
[`pip`](https://pypi.org/project/pip), install that as well.\\
|
||||
|
||||
Then you can install pre-commit: `python -m pip install pre-commit`.
|
||||
|
||||
1. In you local git clone of the project, run `pre-commit install`. That will
|
||||
add the hooks.
|
||||
|
||||
### Tips
|
||||
|
||||
After installing `pre-commit` onto your local git clone, pre-commit will run
|
||||
on every commit.
|
||||
|
||||
When it finds some issue, the git commit will be aborted, so you can fix it,
|
||||
or verify it.
|
||||
|
||||
The tools run by `pre-commit` may modify your code: format PHP code
|
||||
(`phpcbf`), fix line endings, end of files, etc.
|
||||
|
||||
They may also alert about potential issues: syntax errors, spelling errors,
|
||||
code quality, an execute bit that was (not) set in the git repository, etc.
|
||||
|
||||
One way to use it is this:
|
||||
|
||||
```bash
|
||||
cd PROJECT_DIR
|
||||
pre-commit install # Only needed once
|
||||
# Repeat until success.
|
||||
git commit -a -m "My message"
|
||||
# `pre-commit` is run and reports
|
||||
# Check the results, make fixes, and re-commit (=repeat above line).
|
||||
```
|
||||
|
||||
In some cases you may want to commit despite the changes.\
|
||||
You can just add
|
||||
`--no-verify` to your git command:
|
||||
|
||||
```bash
|
||||
git commit -a -m "My message" --no-verify
|
||||
```
|
||||
|
||||
If you want to skip certain checks for whatever reason, you can set the SKIP
|
||||
environment variable:
|
||||
|
||||
```bash
|
||||
SKIP=no-commit-to-branch git commit -a -m "My message"
|
||||
|
||||
or
|
||||
|
||||
export SKIP=no-commit-to-branch # In your .bashrc or session.
|
||||
```
|
||||
|
||||
There is much more you can do with pre-commit, check out its
|
||||
[documentation](https://pre-commit.com).
|
||||
|
||||
Now your commit is less likely to fail in the Continuous Intagration (CI) run
|
||||
on github.\
|
||||
CI also runs pre-commit to help maintain code quality.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@netlogic.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
|
||||
|
|
@ -109,7 +109,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||
$object->date_start = $date_start;
|
||||
$object->date_end = $date_end;
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->status = GETPOST('status', 'int');
|
||||
$object->status = GETPOSTINT('status');
|
||||
$object->datec = dol_now();
|
||||
|
||||
if (empty($object->date_start) && empty($object->date_end)) {
|
||||
|
|
@ -152,7 +152,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||
$object->date_start = GETPOST("fiscalyear") ? $date_start : '';
|
||||
$object->date_end = GETPOST("fiscalyearend") ? $date_end : '';
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->status = GETPOST('status', 'int');
|
||||
$object->status = GETPOSTINT('status');
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
|
|
|
|||
|
|
@ -663,7 +663,7 @@ if ($action == 'create') {
|
|||
if (!empty($object->linesmvt[0])) {
|
||||
$tmpline = $object->linesmvt[0];
|
||||
if (!empty($tmpline->numero_compte)) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($db);
|
||||
$object->linesmvt[] = $line;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1087,7 +1087,7 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|||
print "</tr>\n";
|
||||
|
||||
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($db);
|
||||
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,7 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|||
print "</tr>\n";
|
||||
|
||||
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($db);
|
||||
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
|
|
@ -986,7 +987,7 @@ class BookKeeping extends CommonObject
|
|||
|
||||
$i = 0;
|
||||
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($this->db);
|
||||
|
||||
$line->id = $obj->rowid;
|
||||
|
||||
|
|
@ -1140,7 +1141,7 @@ class BookKeeping extends CommonObject
|
|||
|
||||
$i = 0;
|
||||
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($this->db);
|
||||
|
||||
$line->id = $obj->rowid;
|
||||
|
||||
|
|
@ -1275,7 +1276,7 @@ class BookKeeping extends CommonObject
|
|||
|
||||
$i = 0;
|
||||
while (($obj = $this->db->fetch_object($resql)) && (empty($limit) || $i < min($limit, $num))) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($this->db);
|
||||
|
||||
$line->numero_compte = $obj->numero_compte;
|
||||
//$line->label_compte = $obj->label_compte;
|
||||
|
|
@ -1881,7 +1882,7 @@ class BookKeeping extends CommonObject
|
|||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
while ($obj = $this->db->fetch_object($result)) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($this->db);
|
||||
|
||||
$line->id = $obj->rowid;
|
||||
|
||||
|
|
@ -1951,7 +1952,7 @@ class BookKeeping extends CommonObject
|
|||
|
||||
$num = $this->db->num_rows($resql);
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$line = new BookKeepingLine();
|
||||
$line = new BookKeepingLine($this->db);
|
||||
|
||||
$line->id = $obj->rowid;
|
||||
|
||||
|
|
@ -2976,7 +2977,7 @@ class BookKeeping extends CommonObject
|
|||
/**
|
||||
* Class BookKeepingLine
|
||||
*/
|
||||
class BookKeepingLine
|
||||
class BookKeepingLine extends CommonObjectLine
|
||||
{
|
||||
/**
|
||||
* @var int ID
|
||||
|
|
|
|||
|
|
@ -307,8 +307,8 @@ if (empty($reshook)) {
|
|||
$object->address = trim(GETPOST("address", 'alphanohtml'));
|
||||
$object->zip = trim(GETPOST("zipcode", 'alphanohtml'));
|
||||
$object->town = trim(GETPOST("town", 'alphanohtml'));
|
||||
$object->state_id = GETPOST("state_id", 'int');
|
||||
$object->country_id = GETPOST("country_id", 'int');
|
||||
$object->state_id = GETPOSTINT("state_id");
|
||||
$object->country_id = GETPOSTINT("country_id");
|
||||
|
||||
$object->phone = trim(GETPOST("phone", 'alpha'));
|
||||
$object->phone_perso = trim(GETPOST("phone_perso", 'alpha'));
|
||||
|
|
@ -334,9 +334,9 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Get status and public property
|
||||
$object->statut = GETPOST("statut", 'alpha');
|
||||
$object->status = GETPOST("statut", 'alpha');
|
||||
$object->public = GETPOST("public", 'alpha');
|
||||
$object->statut = GETPOSTINT("statut");
|
||||
$object->status = GETPOSTINT("statut");
|
||||
$object->public = GETPOSTINT("public");
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
|
|
|
|||
|
|
@ -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-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@netlogic.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>
|
||||
|
|
@ -1121,7 +1121,7 @@ class Adherent extends CommonObject
|
|||
* @param int $isencrypted 0 ou 1 if the password needs to be encrypted in the DB (default: 0)
|
||||
* @param int $notrigger 1=Does not raise the triggers
|
||||
* @param int $nosyncuser Do not synchronize linked user
|
||||
* @return string If OK return clear password, 0 if no change, < 0 if error
|
||||
* @return string|int Clear password if change ok, 0 if no change, <0 if error
|
||||
*/
|
||||
public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
|
||||
{
|
||||
|
|
@ -2461,15 +2461,13 @@ class Adherent extends CommonObject
|
|||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators this->nb in state board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ $socid = GETPOST('socid', 'int');
|
|||
|
||||
$search_filter = GETPOST("search_filter", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'intcomma'); // statut
|
||||
$search_datec_start = dol_mktime(0, 0, 0, GETPOST('search_datec_start_month', 'int'), GETPOST('search_datec_start_day', 'int'), GETPOST('search_datec_start_year', 'int'));
|
||||
$search_datec_end = dol_mktime(23, 59, 59, GETPOST('search_datec_end_month', 'int'), GETPOST('search_datec_end_day', 'int'), GETPOST('search_datec_end_year', 'int'));
|
||||
$search_datem_start = dol_mktime(0, 0, 0, GETPOST('search_datem_start_month', 'int'), GETPOST('search_datem_start_day', 'int'), GETPOST('search_datem_start_year', 'int'));
|
||||
$search_datem_end = dol_mktime(23, 59, 59, GETPOST('search_datem_end_month', 'int'), GETPOST('search_datem_end_day', 'int'), GETPOST('search_datem_end_year', 'int'));
|
||||
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
if ($filter) {
|
||||
|
|
@ -258,6 +262,10 @@ if (empty($reshook)) {
|
|||
$catid = "";
|
||||
$search_all = "";
|
||||
$toselect = array();
|
||||
$search_datec_start = '';
|
||||
$search_datec_end = '';
|
||||
$search_datem_start = '';
|
||||
$search_datem_end = '';
|
||||
$search_array_options = array();
|
||||
}
|
||||
|
||||
|
|
@ -513,6 +521,18 @@ if ($search_country) {
|
|||
if ($search_import_key) {
|
||||
$sql .= natural_search("d.import_key", $search_import_key);
|
||||
}
|
||||
if ($search_datec_start) {
|
||||
$sql .= " AND d.datec >= '".$db->idate($search_datec_start)."'";
|
||||
}
|
||||
if ($search_datec_end) {
|
||||
$sql .= " AND d.datec <= '".$db->idate($search_datec_end)."'";
|
||||
}
|
||||
if ($search_datem_start) {
|
||||
$sql .= " AND d.tms >= '".$db->idate($search_datem_start)."'";
|
||||
}
|
||||
if ($search_datem_end) {
|
||||
$sql .= " AND d.tms <= '".$db->idate($search_datem_end)."'";
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
|
|
@ -659,6 +679,12 @@ if ($search_import_key != '') {
|
|||
if ($search_type > 0) {
|
||||
$param .= "&search_type=".urlencode($search_type);
|
||||
}
|
||||
if ($search_datec_start) {
|
||||
$param .= '&search_datec_start_day='.dol_print_date($search_datec_start, '%d').'&search_datec_start_month='.dol_print_date($search_datec_start, '%m').'&search_datec_start_year='.dol_print_date($search_datec_start, '%Y');
|
||||
}
|
||||
if ($search_datem_end) {
|
||||
$param .= '&search_datem_end_day='.dol_print_date($search_datem_end, '%d').'&search_datem_end_month='.dol_print_date($search_datem_end, '%m').'&search_datem_end_year='.dol_print_date($search_datem_end, '%Y');
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
|
@ -914,6 +940,12 @@ print $hookmanager->resPrint;
|
|||
// Date creation
|
||||
if (!empty($arrayfields['d.datec']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<div class="nowrapfordate">';
|
||||
print $form->selectDate($search_datec_start ? $search_datec_start : -1, 'search_datec_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrapfordate">';
|
||||
print $form->selectDate($search_datec_end ? $search_datec_end : -1, 'search_datec_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
@ -926,6 +958,12 @@ if (!empty($arrayfields['d.birth']['checked'])) {
|
|||
// Date modification
|
||||
if (!empty($arrayfields['d.tms']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<div class="nowrapfordate">';
|
||||
print $form->selectDate($search_datem_start ? $search_datem_start : -1, 'search_datem_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrapfordate">';
|
||||
print $form->selectDate($search_datem_end ? $search_datem_end : -1, 'search_datem_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ if (empty($conf->use_javascript_ajax)) {
|
|||
} else {
|
||||
print '<td width="60" class="right">';
|
||||
$arrval = array(
|
||||
'0'=>$langs->trans("No"),
|
||||
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
|
||||
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
|
||||
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
|
||||
$langs->trans("No"),
|
||||
$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
|
||||
$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
|
||||
$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
|
||||
);
|
||||
print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT", $arrval, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
|
||||
print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalInt('RESOURCE_USE_SEARCH_TO_SELECT'));
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button small" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @return array [List of ordering methods]
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 503 Error retrieving list of ordering methods
|
||||
*/
|
||||
public function getOrderingMethods($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -81,7 +83,7 @@ class Setup extends DolibarrApi
|
|||
$errormessage = '';
|
||||
$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
|
||||
if ($errormessage) {
|
||||
throw new RestException(503, 'Error when validating parameter sqlfilters -> '.$errormessage);
|
||||
throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +108,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -125,7 +127,9 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/ordering_origins
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 503 Error retrieving list of ordering origins
|
||||
*/
|
||||
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -168,7 +172,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -188,7 +192,9 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @return array [List of payment types]
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 503 Error retrieving list of payment types
|
||||
*/
|
||||
public function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -232,7 +238,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -253,7 +259,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/regions
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error retrieving list of regions
|
||||
*/
|
||||
public function getListOfRegions($sortfield = "code_region", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $filter = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -316,7 +323,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/regions/{id}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Region not found
|
||||
* @throws RestException 503 Error retrieving region
|
||||
*/
|
||||
public function getRegionByID($id)
|
||||
{
|
||||
|
|
@ -331,7 +339,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/regions/byCode/{code}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Region not found
|
||||
* @throws RestException 503 Error when retrieving region
|
||||
*/
|
||||
public function getRegionByCode($code)
|
||||
{
|
||||
|
|
@ -357,7 +366,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/states
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error retrieving list of states
|
||||
*/
|
||||
public function getListOfStates($sortfield = "code_departement", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $filter = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -422,7 +432,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/states/{id}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 State not found
|
||||
* @throws RestException 503 Error retrieving state
|
||||
*/
|
||||
public function getStateByID($id)
|
||||
{
|
||||
|
|
@ -437,7 +448,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/states/byCode/{code}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 State not found
|
||||
* @throws RestException 503 Error retrieving state
|
||||
*/
|
||||
public function getStateByCode($code)
|
||||
{
|
||||
|
|
@ -463,7 +475,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/countries
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error retrieving list of countries
|
||||
*/
|
||||
public function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -527,7 +540,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/countries/{id}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Country not found
|
||||
* @throws RestException 503 Error retrieving country
|
||||
*/
|
||||
public function getCountryByID($id, $lang = '')
|
||||
{
|
||||
|
|
@ -543,7 +557,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/countries/byCode/{code}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Country not found
|
||||
* @throws RestException 503 Error retrieving country
|
||||
*/
|
||||
public function getCountryByCode($code, $lang = '')
|
||||
{
|
||||
|
|
@ -559,7 +574,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/countries/byISO/{iso}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Country not found
|
||||
* @throws RestException 503 Error retrieving country
|
||||
*/
|
||||
public function getCountryByISO($iso, $lang = '')
|
||||
{
|
||||
|
|
@ -654,7 +670,9 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @return array [List of availability]
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 503 Error when retrieving list of availabilities
|
||||
*/
|
||||
public function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -697,7 +715,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -766,7 +784,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/event_types
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of events types
|
||||
*/
|
||||
public function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -832,7 +851,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/expensereport_types
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of expense report types
|
||||
*/
|
||||
public function getListOfExpenseReportsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -897,7 +917,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/contact_types
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of contacts types
|
||||
*/
|
||||
public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -965,7 +986,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/civilities
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of civilities
|
||||
*/
|
||||
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1029,7 +1051,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/currencies
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of currencies
|
||||
*/
|
||||
public function getListOfCurrencies($multicurrency = 0, $sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1098,7 +1121,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET extrafields
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of extra fields
|
||||
*/
|
||||
public function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1175,7 +1199,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/towns
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of towns
|
||||
*/
|
||||
public function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1240,7 +1265,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @return array List of payment terms
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of payments terms
|
||||
*/
|
||||
public function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1284,7 +1310,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $this->db->fetch_object($result);
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -1303,7 +1329,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @return array List of shipping methods
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of shipping modes
|
||||
*/
|
||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1345,7 +1372,7 @@ class Setup extends DolibarrApi
|
|||
$list[] = $method;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
throw new RestException(503, $this->db->lasterror());
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -1364,7 +1391,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/units
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of measuring units
|
||||
*/
|
||||
public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1423,7 +1451,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/legal_form
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of legal form
|
||||
*/
|
||||
public function getListOfLegalForm($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $country = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1484,7 +1513,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/staff
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of staff
|
||||
*/
|
||||
public function getListOfStaff($sortfield = "id", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1542,7 +1572,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/socialnetworks
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of social networks
|
||||
*/
|
||||
public function getListOfsocialNetworks($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1608,7 +1639,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/ticket_categories
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of tickets categories
|
||||
*/
|
||||
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1670,7 +1702,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/ticket_severities
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of tickets severities
|
||||
*/
|
||||
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1732,7 +1765,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/ticket_types
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad value for sqlfilters
|
||||
* @throws RestException 503 Error when retrieving list of tickets types
|
||||
*/
|
||||
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1795,7 +1829,7 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET dictionary/incoterms
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 503 Error when retrieving list of incoterms types
|
||||
*/
|
||||
public function getListOfIncoterms($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
|
|
@ -1905,7 +1939,7 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET /establishments
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 503 Error when retrieving list of establishments
|
||||
*/
|
||||
public function getEstablishments()
|
||||
{
|
||||
|
|
@ -1943,7 +1977,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET establishments/{id}
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 404 Establishment not found
|
||||
* @throws RestException 503 Error when retrieving establishment
|
||||
*/
|
||||
public function getEtablishmentByID($id)
|
||||
{
|
||||
|
|
@ -1969,8 +2004,8 @@ class Setup extends DolibarrApi
|
|||
*
|
||||
* @url GET conf/{constantname}
|
||||
*
|
||||
* @throws RestException 400 Error Bad or unknown value for constantname
|
||||
* @throws RestException 403 Forbidden
|
||||
* @throws RestException 404 Error Bad or unknown value for constantname
|
||||
*/
|
||||
public function getConf($constantname)
|
||||
{
|
||||
|
|
@ -1982,7 +2017,7 @@ class Setup extends DolibarrApi
|
|||
}
|
||||
|
||||
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
|
||||
throw new RestException(404, 'Error Bad or unknown value for constantname');
|
||||
throw new RestException(400, 'Error Bad or unknown value for constantname');
|
||||
}
|
||||
if (isASecretKey($constantname)) {
|
||||
throw new RestException(403, 'Forbidden. This parameter can not be read with APIs');
|
||||
|
|
@ -2002,7 +2037,6 @@ class Setup extends DolibarrApi
|
|||
* @throws RestException 403 Forbidden
|
||||
* @throws RestException 404 Signature file not found
|
||||
* @throws RestException 500 Technical error
|
||||
* @throws RestException 503 Forbidden
|
||||
*/
|
||||
public function getCheckIntegrity($target)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -411,19 +411,19 @@ Luracast\Restler\Defaults::$returnResponse = $usecompression;
|
|||
|
||||
// Call API (we suppose we found it).
|
||||
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
|
||||
$result = $api->r->handle();
|
||||
$responsedata = $api->r->handle();
|
||||
|
||||
if (Luracast\Restler\Defaults::$returnResponse) {
|
||||
// We try to compress the data received data
|
||||
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'br') !== false && function_exists('brotli_compress') && defined('BROTLI_TEXT')) {
|
||||
header('Content-Encoding: br');
|
||||
$result = brotli_compress($result, 11, constant('BROTLI_TEXT'));
|
||||
$result = brotli_compress($responsedata, 11, constant('BROTLI_TEXT'));
|
||||
} elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'bz') !== false && function_exists('bzcompress')) {
|
||||
header('Content-Encoding: bz');
|
||||
$result = bzcompress($result, 9);
|
||||
$result = bzcompress($responsedata, 9);
|
||||
} elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && function_exists('gzencode')) {
|
||||
header('Content-Encoding: gzip');
|
||||
$result = gzencode($result, 9);
|
||||
$result = gzencode($responsedata, 9);
|
||||
} else {
|
||||
header('Content-Encoding: text/html');
|
||||
print "No compression method found. Try to disable compression by adding API_DISABLE_COMPRESSION=1";
|
||||
|
|
@ -434,4 +434,20 @@ if (Luracast\Restler\Defaults::$returnResponse) {
|
|||
echo $result;
|
||||
}
|
||||
|
||||
// Call API termination method
|
||||
$apiMethodInfo = &$api->r->apiMethodInfo;
|
||||
$terminateCall = '_terminate_' . $apiMethodInfo->methodName . '_' . $api->r->responseFormat->getExtension();
|
||||
if (method_exists($apiMethodInfo->className, $terminateCall)) {
|
||||
// Now flush output buffers so that response data is sent to the client even if we still have action to do in a termination method.
|
||||
ob_end_flush();
|
||||
|
||||
// If you're using PHP-FPM, this function will allow you to send the response and then continue processing
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
fastcgi_finish_request();
|
||||
}
|
||||
|
||||
// Call a termination method. Warning: This method can do I/O, sync but must not make output.
|
||||
call_user_func(array(Luracast\Restler\Scope::get($apiMethodInfo->className), $terminateCall), $responsedata);
|
||||
}
|
||||
|
||||
//session_destroy();
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ class Boms extends DolibarrApi
|
|||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}
|
||||
* @throws RestException
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
|
|
@ -95,7 +97,9 @@ class Boms extends DolibarrApi
|
|||
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 400 Bad sqlfilters
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 503 Error retrieving list of boms
|
||||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
|
||||
{
|
||||
|
|
@ -176,6 +180,9 @@ class Boms extends DolibarrApi
|
|||
*
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of bom
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 500 Error retrieving list of boms
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
|
|
@ -210,6 +217,10 @@ class Boms extends DolibarrApi
|
|||
* @param array $request_data Datas
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
* @throws RestException 500 Error updating bom
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
|
|
@ -253,6 +264,10 @@ class Boms extends DolibarrApi
|
|||
*
|
||||
* @param int $id BOM ID
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
* @throws RestException 500 Error deleting bom
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
|
|
@ -288,6 +303,9 @@ class Boms extends DolibarrApi
|
|||
* @url GET {id}/lines
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
*/
|
||||
public function getLines($id)
|
||||
{
|
||||
|
|
@ -320,6 +338,10 @@ class Boms extends DolibarrApi
|
|||
* @url POST {id}/lines
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
* @throws RestException 500 Error adding bom line
|
||||
*/
|
||||
public function postLine($id, $request_data = null)
|
||||
{
|
||||
|
|
@ -353,7 +375,7 @@ class Boms extends DolibarrApi
|
|||
if ($updateRes > 0) {
|
||||
return $updateRes;
|
||||
} else {
|
||||
throw new RestException(400, $this->bom->error);
|
||||
throw new RestException(500, $this->bom->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -367,6 +389,9 @@ class Boms extends DolibarrApi
|
|||
* @url PUT {id}/lines/{lineid}
|
||||
*
|
||||
* @return object|bool
|
||||
*
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
*/
|
||||
public function putLine($id, $lineid, $request_data = null)
|
||||
{
|
||||
|
|
@ -415,9 +440,9 @@ class Boms extends DolibarrApi
|
|||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 401 Access denied
|
||||
* @throws RestException 404 BOM not found
|
||||
* @throws RestException 500 Error deleting bom line
|
||||
*/
|
||||
public function deleteLine($id, $lineid)
|
||||
{
|
||||
|
|
@ -450,7 +475,7 @@ class Boms extends DolibarrApi
|
|||
if ($updateRes > 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(405, $this->bom->error);
|
||||
throw new RestException(500, $this->bom->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,6 +220,11 @@ class Categorie extends CommonObject
|
|||
*/
|
||||
public $color;
|
||||
|
||||
/**
|
||||
* @var int Position
|
||||
*/
|
||||
public $position;
|
||||
|
||||
/**
|
||||
* @var int Visible
|
||||
*/
|
||||
|
|
@ -352,7 +357,7 @@ class Categorie extends CommonObject
|
|||
$type = $this->MAP_ID[$type];
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext";
|
||||
$sql = "SELECT rowid, fk_parent, entity, label, description, color, position, fk_soc, visible, type, ref_ext";
|
||||
$sql .= ", date_creation, tms, fk_user_creat, fk_user_modif";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||
if ($id) {
|
||||
|
|
@ -378,6 +383,7 @@ class Categorie extends CommonObject
|
|||
$this->label = $res['label'];
|
||||
$this->description = $res['description'];
|
||||
$this->color = $res['color'];
|
||||
$this->position = $res['position'];
|
||||
$this->socid = (int) $res['fk_soc'];
|
||||
$this->visible = (int) $res['visible'];
|
||||
$this->type = (int) $res['type'];
|
||||
|
|
@ -440,6 +446,7 @@ class Categorie extends CommonObject
|
|||
$this->label = trim($this->label);
|
||||
$this->description = trim($this->description);
|
||||
$this->color = trim($this->color);
|
||||
$this->position = trim($this->position);
|
||||
$this->import_key = trim($this->import_key);
|
||||
$this->ref_ext = trim($this->ref_ext);
|
||||
if (empty($this->visible)) {
|
||||
|
|
@ -461,6 +468,7 @@ class Categorie extends CommonObject
|
|||
$sql .= " label,";
|
||||
$sql .= " description,";
|
||||
$sql .= " color,";
|
||||
$sql .= " position,";
|
||||
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
|
||||
$sql .= "fk_soc,";
|
||||
}
|
||||
|
|
@ -476,6 +484,7 @@ class Categorie extends CommonObject
|
|||
$sql .= "'".$this->db->escape($this->label)."', ";
|
||||
$sql .= "'".$this->db->escape($this->description)."', ";
|
||||
$sql .= "'".$this->db->escape($this->color)."', ";
|
||||
$sql .= (int) $this->position.",";
|
||||
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
|
||||
$sql .= ($this->socid > 0 ? $this->socid : 'null').", ";
|
||||
}
|
||||
|
|
@ -566,6 +575,7 @@ class Categorie extends CommonObject
|
|||
$sql .= " description = '".$this->db->escape($this->description)."',";
|
||||
$sql .= " ref_ext = '".$this->db->escape($this->ref_ext)."',";
|
||||
$sql .= " color = '".$this->db->escape($this->color)."'";
|
||||
$sql .= ", position = ".(int) $this->position;
|
||||
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
|
||||
$sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : 'null');
|
||||
}
|
||||
|
|
@ -1028,6 +1038,7 @@ class Categorie extends CommonObject
|
|||
$categories[$i]['label'] = $category_static->label;
|
||||
$categories[$i]['description'] = $category_static->description;
|
||||
$categories[$i]['color'] = $category_static->color;
|
||||
$categories[$i]['position'] = $category_static->position;
|
||||
$categories[$i]['socid'] = $category_static->socid;
|
||||
$categories[$i]['ref_ext'] = $category_static->ref_ext;
|
||||
$categories[$i]['visible'] = $category_static->visible;
|
||||
|
|
@ -1163,7 +1174,7 @@ class Categorie extends CommonObject
|
|||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// Init $this->cats array
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.position, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS')) {
|
||||
$sql .= ", t.label as label_trans, t.description as description_trans";
|
||||
}
|
||||
|
|
@ -1185,6 +1196,7 @@ class Categorie extends CommonObject
|
|||
$this->cats[$obj->rowid]['label'] = !empty($obj->label_trans) ? $obj->label_trans : $obj->label;
|
||||
$this->cats[$obj->rowid]['description'] = !empty($obj->description_trans) ? $obj->description_trans : $obj->description;
|
||||
$this->cats[$obj->rowid]['color'] = $obj->color;
|
||||
$this->cats[$obj->rowid]['position'] = $obj->position;
|
||||
$this->cats[$obj->rowid]['visible'] = $obj->visible;
|
||||
$this->cats[$obj->rowid]['ref_ext'] = $obj->ref_ext;
|
||||
$this->cats[$obj->rowid]['picto'] = 'category';
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ $socid = (int) GETPOST('socid', 'int');
|
|||
$label = (string) GETPOST('label', 'alphanohtml');
|
||||
$description = (string) GETPOST('description', 'restricthtml');
|
||||
$color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml'));
|
||||
$position = (int) GETPOST('position', 'int');
|
||||
$visible = (int) GETPOST('visible', 'int');
|
||||
$parent = (int) GETPOST('parent', 'int');
|
||||
|
||||
|
|
@ -80,7 +81,7 @@ $error = 0;
|
|||
/*
|
||||
* Actions
|
||||
*/
|
||||
$parameters = array('id' => $id, 'ref' => $ref, 'cancel'=> $cancel, 'backtopage' => $backtopage, 'socid' => $socid, 'label' => $label, 'description' => $description, 'color' => $color, 'visible' => $visible, 'parent' => $parent);
|
||||
$parameters = array('id' => $id, 'ref' => $ref, 'cancel'=> $cancel, 'backtopage' => $backtopage, 'socid' => $socid, 'label' => $label, 'description' => $description, 'color' => $color, 'position' => $position, 'visible' => $visible, 'parent' => $parent);
|
||||
// Note that $action and $object may be modified by some hooks
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
|
|
@ -105,6 +106,7 @@ if (empty($reshook)) {
|
|||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
$object->color = $color;
|
||||
$object->position = $position;
|
||||
$object->socid = ($socid > 0 ? $socid : 0);
|
||||
$object->visible = $visible;
|
||||
$object->fk_parent = $parent != -1 ? $parent : 0;
|
||||
|
|
@ -186,6 +188,12 @@ print '<td>';
|
|||
print $formother->selectColor($object->color, 'color');
|
||||
print '</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>';
|
||||
print $langs->trans("Position").'</td>';
|
||||
print '<td><input type="text" size="25" id="position" name ="position" value="'.$object->position.'" />';
|
||||
print '</tr>';
|
||||
|
||||
// Parent category
|
||||
print '<tr><td>'.$langs->trans("In").'</td><td>';
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
|
|
|
|||
|
|
@ -301,6 +301,12 @@ print $langs->trans("Color").'</td><td>';
|
|||
print $formother->showColor($object->color);
|
||||
print '</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td class="titlefield notopnoleft">';
|
||||
print $langs->trans("Position").'</td><td>';
|
||||
print $object->position;
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -3685,15 +3685,13 @@ class Propal extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 if ko, >0 if ok
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -4062,15 +4062,13 @@ class Commande extends CommonOrder
|
|||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -1346,16 +1346,14 @@ class Account extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @param int $filteraccountid To get info for a particular account id
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board($filteraccountid = 0)
|
||||
public function loadStateBoard($filteraccountid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if ($user->socid) {
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ $toselect = GETPOST('toselect', 'array');
|
|||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$id = (GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int'));
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id'));
|
||||
$lineid = GETPOSTINT('lineid');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
|
|
@ -67,13 +67,13 @@ $objecttype = 'facture_rec';
|
|||
if ($action == "create" || $action == "add") {
|
||||
$objecttype = '';
|
||||
}
|
||||
$projectid = GETPOST('projectid', 'int');
|
||||
$projectid = GETPOSTINT('projectid');
|
||||
|
||||
$year_date_when = GETPOST('year_date_when');
|
||||
$month_date_when = GETPOST('month_date_when');
|
||||
$selectedLines = GETPOST('toselect', 'array');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -181,16 +181,16 @@ if (empty($reshook)) {
|
|||
$error++;
|
||||
}
|
||||
|
||||
$frequency = GETPOST('frequency', 'int');
|
||||
$reyear = GETPOST('reyear', 'int');
|
||||
$remonth = GETPOST('remonth', 'int');
|
||||
$reday = GETPOST('reday', 'int');
|
||||
$rehour = GETPOST('rehour', 'int');
|
||||
$remin = GETPOST('remin', 'int');
|
||||
$nb_gen_max = GETPOST('nb_gen_max', 'int');
|
||||
$frequency = GETPOSTINT('frequency');
|
||||
$reyear = GETPOSTINT('reyear');
|
||||
$remonth = GETPOSTINT('remonth');
|
||||
$reday = GETPOSTINT('reday');
|
||||
$rehour = GETPOSTINT('rehour');
|
||||
$remin = GETPOSTINT('remin');
|
||||
$nb_gen_max = GETPOSTINT('nb_gen_max');
|
||||
//if (empty($nb_gen_max)) $nb_gen_max =0;
|
||||
|
||||
if (GETPOST('frequency', 'int')) {
|
||||
if (GETPOSTINT('frequency')) {
|
||||
if (empty($reyear) || empty($remonth) || empty($reday)) {
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
|
||||
$action = "create";
|
||||
|
|
@ -204,21 +204,21 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$object->subtype = GETPOST('subtype');
|
||||
$object->subtype = GETPOSTINT('subtype');
|
||||
$object->title = GETPOST('title', 'alphanohtml');
|
||||
$object->note_private = GETPOST('note_private', 'restricthtml');
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->model_pdf = GETPOST('modelpdf', 'alphanohtml');
|
||||
$object->usenewprice = GETPOST('usenewprice', 'alphanohtml');
|
||||
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
|
||||
$object->mode_reglement_id = GETPOSTINT('mode_reglement_id');
|
||||
$object->cond_reglement_id = GETPOSTINT('cond_reglement_id');
|
||||
|
||||
$object->frequency = $frequency;
|
||||
$object->unit_frequency = GETPOST('unit_frequency', 'alpha');
|
||||
$object->nb_gen_max = $nb_gen_max;
|
||||
$object->auto_validate = GETPOST('auto_validate', 'int');
|
||||
$object->generate_pdf = GETPOST('generate_pdf', 'int');
|
||||
$object->auto_validate = GETPOSTINT('auto_validate');
|
||||
$object->generate_pdf = GETPOSTINT('generate_pdf');
|
||||
$object->fk_project = $projectid;
|
||||
|
||||
$date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear);
|
||||
|
|
@ -230,9 +230,9 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Get first contract linked to invoice used to generate template (facid is id of source invoice)
|
||||
if (GETPOST('facid', 'int') > 0) {
|
||||
if (GETPOSTINT('facid') > 0) {
|
||||
$srcObject = new Facture($db);
|
||||
$srcObject->fetch(GETPOST('facid', 'int'));
|
||||
$srcObject->fetch(GETPOSTINT('facid'));
|
||||
|
||||
$srcObject->fetchObjectLinked();
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ if (empty($reshook)) {
|
|||
$db->begin();
|
||||
|
||||
$oldinvoice = new Facture($db);
|
||||
$oldinvoice->fetch(GETPOST('facid', 'int'));
|
||||
$oldinvoice->fetch(GETPOSTINT('facid'));
|
||||
|
||||
$onlylines = GETPOST('toselect', 'array');
|
||||
|
||||
|
|
@ -292,15 +292,15 @@ if (empty($reshook)) {
|
|||
if ($action == 'setconditions' && $user->hasRight('facture', 'creer')) {
|
||||
// Set condition
|
||||
$object->context['actionmsg'] = $langs->trans("FieldXModified", $langs->transnoentitiesnoconv("PaymentTerm"));
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
|
||||
$result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'));
|
||||
} elseif ($action == 'setmode' && $user->hasRight('facture', 'creer')) {
|
||||
// Set mode
|
||||
$object->context['actionmsg'] = $langs->trans("FieldXModified", $langs->transnoentitiesnoconv("PaymentMode"));
|
||||
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
|
||||
$result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id'));
|
||||
} elseif ($action == 'classin' && $user->hasRight('facture', 'creer')) {
|
||||
// Set project
|
||||
$object->context['actionmsg'] = $langs->trans("FieldXModified", $langs->transnoentitiesnoconv("Project"));
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
$object->setProject(GETPOSTINT('projectid'));
|
||||
} elseif ($action == 'setref' && $user->hasRight('facture', 'creer')) {
|
||||
// Set bank account
|
||||
$object->context['actionmsg'] = $langs->trans("FieldXModifiedFromYToZ", $langs->transnoentitiesnoconv("Title"), $object->title, $ref);
|
||||
|
|
|
|||
|
|
@ -5152,15 +5152,13 @@ class Facture extends CommonInvoice
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -524,16 +524,14 @@ class RemiseCheque extends CommonObject
|
|||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators this->nb for the state board
|
||||
*
|
||||
* @param string $type Type of payment mode deposit ('CHQ', 'TRA', ...)
|
||||
* @return int Return integer <0 if ko, >0 if ok
|
||||
*/
|
||||
public function load_state_board($type = 'CHQ')
|
||||
public function loadStateBoard($type = 'CHQ')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
if ($user->socid) {
|
||||
|
|
|
|||
|
|
@ -215,12 +215,12 @@ if (isModEnabled('accounting')) {
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModePayment");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,12 +189,12 @@ if (isModEnabled('accounting')) {
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModeDebt");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta1" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta1"> '.$langs->trans("CalcModePayment");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
$calcmode .= '</label>';
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br><input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeDebt");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("AnnualByAccountInputOutputMode");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month") > 0 ? '&month='.GETPOST("month") : '').'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
$builddate = dol_now();
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
|
||||
$description .= $langs->trans("RulesCAIn");
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
$builddate = dol_now();
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
|
||||
$description = $langs->trans("RulesCAIn");
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
$description = $langs->trans("RulesCAIn");
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByThirdParties");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
$description = $langs->trans("RulesCAIn");
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEINGCOLLECTED")
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPINGCOLLECTED"'.($modecompta == 'BOOKKEEPINGCOLLECTED' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}*/
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModePayment");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEPINGCOLLECTED")
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPINGCOLLECTED"'.($modecompta == 'BOOKKEEPINGCOLLECTED' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}*/
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="RECETTES-DEPENSES"'.($modecompta == 'RECETTES-DEPENSES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModePayment");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ if ($modecompta == "RECETTES-DEPENSES" || $modecompta == "BOOKKEEPINGCOLLECTED")
|
|||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta3" value="BOOKKEEPING"'.($modecompta == 'BOOKKEEPING' ? ' checked="checked"' : '').'><label for="modecompta3"> '.$langs->trans("CalcModeBookkeeping").'</label>';
|
||||
$calcmode .= '<br>';
|
||||
}
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<input type="radio" name="modecompta" id="modecompta2" value="CREANCES-DETTES"'.($modecompta == 'CREANCES-DETTES' ? ' checked="checked"' : '').'><label for="modecompta2"> '.$langs->trans("CalcModePayment");
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("CalcModeNoBookKeeping").')</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
$builddate = dol_now();
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
$description = $langs->trans("RulesPurchaseTurnoverIn");
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
} elseif ($modecompta == "RECETTES-DEPENSES") {
|
||||
$name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByThirdParties");
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode = $langs->trans("CalcModePayment");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||
$description = $langs->trans("RulesPurchaseTurnoverIn");
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
|
|
|||
|
|
@ -397,15 +397,13 @@ class Contact extends CommonObject
|
|||
}*/
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators into this->nb for board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $hookmanager;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -2374,15 +2374,13 @@ class Contrat extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for state board
|
||||
*
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||
$roworder = GETPOST('roworder', 'alpha', 3);
|
||||
$table_element_line = GETPOST('table_element_line', 'aZ09', 3);
|
||||
$fk_element = GETPOST('fk_element', 'aZ09', 3);
|
||||
$element_id = GETPOST('element_id', 'int', 3);
|
||||
$element_id = GETPOSTINT('element_id', 3);
|
||||
|
||||
dol_syslog("AjaxRow roworder=".$roworder." table_element_line=".$table_element_line." fk_element=".$fk_element." element_id=".$element_id, LOG_DEBUG);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2015-2024 Frederic France <frederic.france@netlogic.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
|
||||
|
|
@ -253,7 +253,13 @@ class box_dolibarr_state_board extends ModeleBoxes
|
|||
include_once $includes[$val]; // Loading a class cost around 1Mb
|
||||
|
||||
$board = new $class($this->db);
|
||||
$board->load_state_board();
|
||||
if (method_exists($board, 'load_state_board')) {
|
||||
$board->load_state_board();
|
||||
} elseif (method_exists($board, 'loadStateBoard')) {
|
||||
$board->loadStateBoard();
|
||||
} else {
|
||||
$board = -1;
|
||||
}
|
||||
$boardloaded[$class] = $board;
|
||||
} else {
|
||||
$board = $boardloaded[$classkeyforcache];
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Grégory Blémand <gregory.blemand@atm-consulting.fr>
|
||||
|
|
@ -8876,7 +8876,7 @@ abstract class CommonObject
|
|||
/**
|
||||
* Returns the rights used for this class
|
||||
*
|
||||
* @return stdClass Object of permission for the module
|
||||
* @return int|stdClass Object of permission for the module
|
||||
*/
|
||||
public function getRights()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1120,9 +1120,10 @@ class ExtraFields
|
|||
} else {
|
||||
$checked = ' value="1" ';
|
||||
}
|
||||
$out = '<input type="checkbox" class="flat valignmiddle'.($morecss ? ' '.$morecss : '').' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
|
||||
$out = '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1.
|
||||
$out .= '<input type="checkbox" class="flat valignmiddle'.($morecss ? ' '.$morecss : '').' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
|
||||
} else {
|
||||
$out .= $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
|
||||
$out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1);
|
||||
}
|
||||
} elseif ($type == 'price') {
|
||||
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
|
||||
|
|
@ -2352,7 +2353,9 @@ class ExtraFields
|
|||
$value_key = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
}
|
||||
} elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) {
|
||||
if (!GETPOST($keysuffix."options_".$key.$keyprefix)) {
|
||||
// We test on a hidden field named "..._multiselect" that is always set to 1 if param is in form so
|
||||
// when nothing is provided we can make a difference between noparam in the form and param was set to nothing.
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix.'_multiselect')) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
|
|
@ -2360,7 +2363,7 @@ class ExtraFields
|
|||
$value_arr = (array) $value_arr;
|
||||
$value_key = implode(',', $value_arr);
|
||||
} elseif (in_array($key_type, array('price', 'double', 'int'))) {
|
||||
if (!GETPOST($keysuffix."options_".$key.$keyprefix)) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
|
|
@ -2370,14 +2373,16 @@ class ExtraFields
|
|||
$value_key = $value_arr;
|
||||
}
|
||||
} elseif (in_array($key_type, array('boolean'))) {
|
||||
if (!GETPOST($keysuffix."options_".$key.$keyprefix)) {
|
||||
// We test on a hidden field named "..._boolean" that is always set to 1 if param is in form so
|
||||
// when nothing is provided we can make a difference between noparam in the form and param was set to nothing.
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix."_boolean")) {
|
||||
$value_key = '';
|
||||
} else {
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
$value_key = $value_arr;
|
||||
}
|
||||
} elseif (in_array($key_type, array('html'))) {
|
||||
if (!GETPOST($keysuffix."options_".$key.$keyprefix)) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
$value_key = dol_htmlcleanlastbr(GETPOST($keysuffix."options_".$key.$keyprefix, 'restricthtml'));
|
||||
|
|
|
|||
|
|
@ -6526,14 +6526,31 @@ class Form
|
|||
}
|
||||
if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) {
|
||||
// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries
|
||||
// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country
|
||||
$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC');
|
||||
if (isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) {
|
||||
// We also add the buyer country code
|
||||
if (is_numeric($type)) {
|
||||
if ($type == 1) { // We know product is a service
|
||||
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
|
||||
switch ($selectVatComboMode) {
|
||||
case '1':
|
||||
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
|
||||
break;
|
||||
case '2':
|
||||
$code_country = "'" . $societe_acheteuse->country_code . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} elseif (!$idprod) { // We don't know type of product
|
||||
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
|
||||
switch ($selectVatComboMode) {
|
||||
case '1':
|
||||
$code_country .= ",'" . $societe_acheteuse->country_code . "'";
|
||||
break;
|
||||
case '2':
|
||||
$code_country = "'" . $societe_acheteuse->country_code . "'";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$prodstatic = new Product($this->db);
|
||||
$prodstatic->fetch($idprod);
|
||||
|
|
@ -6546,6 +6563,7 @@ class Form
|
|||
|
||||
// Now we load the list of VAT
|
||||
$this->load_cache_vatrates($code_country); // If no vat defined, return -1 with message into this->error
|
||||
|
||||
// Keep only the VAT qualified for $type_vat
|
||||
$arrayofvatrates = array();
|
||||
foreach ($this->cache_vatrates as $cachevalue) {
|
||||
|
|
@ -8512,10 +8530,6 @@ class Form
|
|||
$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
|
@ -8778,10 +8792,16 @@ class Form
|
|||
}
|
||||
|
||||
$useenhancedmultiselect = 0;
|
||||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) {
|
||||
$useenhancedmultiselect = 1;
|
||||
if (!empty($conf->use_javascript_ajax) && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
|
||||
if ($addjscombo) {
|
||||
$useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0.
|
||||
}
|
||||
}
|
||||
|
||||
// We need a hidden field because when using the multiselect, if we unselect all, there is no
|
||||
// variable submitted at all, so no way to make a difference between variable not submitted and variable
|
||||
// submitted to nothing.
|
||||
$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">';
|
||||
// Output select component
|
||||
$out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n";
|
||||
if (is_array($array) && !empty($array)) {
|
||||
|
|
@ -9054,11 +9074,11 @@ class Form
|
|||
/**
|
||||
* Show linked object block.
|
||||
*
|
||||
* @param CommonObject $object Object we want to show links to
|
||||
* @param string $morehtmlright More html to show on right of title
|
||||
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
|
||||
* @param string $title Title
|
||||
* @return int Return integer <0 if KO, >=0 if OK
|
||||
* @param CommonObject $object Object we want to show links to
|
||||
* @param string $morehtmlright More html to show on right of title
|
||||
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
|
||||
* @param string $title Title
|
||||
* @return int Return integer <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = array(), $title = 'RelatedObjects')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1200,12 +1200,14 @@ class FormMail extends Form
|
|||
|
||||
/**
|
||||
* get html For WithCCC
|
||||
* This information is show when MAIN_EMAIL_USECCC is set.
|
||||
*
|
||||
* @return string html
|
||||
*/
|
||||
public function getHtmlForWithCcc()
|
||||
{
|
||||
global $conf, $langs, $form;
|
||||
global $langs, $form;
|
||||
|
||||
$out = '<tr><td>';
|
||||
$out .= $form->textwithpicto($langs->trans("MailCCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
$out .= '</td><td>';
|
||||
|
|
@ -1261,9 +1263,15 @@ class FormMail extends Form
|
|||
if (getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO') && !empty($this->param['models']) && $this->param['models'] == 'invoice_supplier_send') {
|
||||
$showinfobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO');
|
||||
}
|
||||
if (getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') && !empty($this->param['models']) && $this->param['models'] == 'project') {
|
||||
if (getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO') && !empty($this->param['models']) && $this->param['models'] == 'project') { // don't know why there is not '_send' at end of this models name.
|
||||
$showinfobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_PROJECT_TO');
|
||||
}
|
||||
if (getDolGlobalString('MAIN_MAIL_AUTOCOPY_SHIPMENT_TO') && !empty($this->param['models']) && $this->param['models'] == 'shipping_send') {
|
||||
$showinfobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_SHIPMENT_TO');
|
||||
}
|
||||
if (getDolGlobalString('MAIN_MAIL_AUTOCOPY_RECEPTION_TO') && !empty($this->param['models']) && $this->param['models'] == 'reception_send') {
|
||||
$showinfobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_RECEPTION_TO');
|
||||
}
|
||||
if ($showinfobcc) {
|
||||
$out .= ' + '.$showinfobcc;
|
||||
}
|
||||
|
|
@ -1278,7 +1286,8 @@ class FormMail extends Form
|
|||
*/
|
||||
public function getHtmlForWithErrorsTo()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
//if (! $this->errorstomail) $this->errorstomail=$this->frommail;
|
||||
$errorstomail = getDolGlobalString('MAIN_MAIL_ERRORS_TO', (!empty($this->errorstomail) ? $this->errorstomail : ''));
|
||||
if ($this->witherrorstoreadonly) {
|
||||
|
|
@ -1301,7 +1310,8 @@ class FormMail extends Form
|
|||
*/
|
||||
public function getHtmlForDeliveryreceipt()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$out = '<tr><td><label for="deliveryreceipt">'.$langs->trans("DeliveryReceipt").'</label></td><td>';
|
||||
|
||||
if (!empty($this->withdeliveryreceiptreadonly)) {
|
||||
|
|
@ -1339,7 +1349,7 @@ class FormMail extends Form
|
|||
*/
|
||||
public function getHtmlForTopic($arraydefaultmessage, $helpforsubstitution)
|
||||
{
|
||||
global $conf, $langs, $form;
|
||||
global $langs, $form;
|
||||
|
||||
$defaulttopic = GETPOST('subject', 'restricthtml');
|
||||
|
||||
|
|
@ -1393,15 +1403,15 @@ class FormMail extends Form
|
|||
$('#generate_button').click(function() {
|
||||
var instructions = $('#ai_instructions').val();
|
||||
var token = $('#csrf_token').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '".$baseUrl."ai/lib/generate_content.lib.php',
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
data: JSON.stringify({
|
||||
'token': token,
|
||||
'instructions': instructions,
|
||||
'instructions': instructions,
|
||||
}),
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
|
|
|
|||
|
|
@ -887,6 +887,11 @@ class FormSetupItem
|
|||
$selected = (empty($this->fieldValue) ? '' : $this->fieldValue);
|
||||
$out.= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1);
|
||||
}
|
||||
} elseif ($this->type == 'selectBankAccount') {
|
||||
if (isModEnabled("bank")) {
|
||||
$selected = (empty($this->fieldValue) ? '' : $this->fieldValue);
|
||||
$out.= $this->form->select_comptes($selected, $this->confKey, 0, '', 0, '', 0, '', 1);
|
||||
}
|
||||
} else {
|
||||
$out.= $this->generateInputFieldText();
|
||||
}
|
||||
|
|
@ -1175,6 +1180,16 @@ class FormSetupItem
|
|||
} elseif ($resprod < 0) {
|
||||
$this->setErrors($product->errors);
|
||||
}
|
||||
} elseif ($this->type == 'selectBankAccount') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$bankaccount = new Account($this->db);
|
||||
$resbank = $bankaccount->fetch($this->fieldValue);
|
||||
if ($resbank > 0) {
|
||||
$out.= $bankaccount->label;
|
||||
} elseif ($resbank < 0) {
|
||||
$this->setErrors($bankaccount->errors);
|
||||
}
|
||||
} else {
|
||||
$out.= $this->fieldValue;
|
||||
}
|
||||
|
|
@ -1427,4 +1442,15 @@ class FormSetupItem
|
|||
$this->type = 'selectUser';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type of input as a simple title. No data to store
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setAsSelectBankAccount()
|
||||
{
|
||||
$this->type = 'selectBankAccount';
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1270,7 +1270,11 @@ class mysqliDoli extends mysqli
|
|||
public function __construct($host, $user, $pass, $name, $port = 0, $socket = "")
|
||||
{
|
||||
$flags = 0;
|
||||
parent::init();
|
||||
if (PHP_VERSION_ID >= 80100) {
|
||||
parent::__construct();
|
||||
} else {
|
||||
parent::init();
|
||||
}
|
||||
if (strpos($host, 'ssl://') === 0) {
|
||||
$host = substr($host, 6);
|
||||
parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);
|
||||
|
|
|
|||
|
|
@ -1339,17 +1339,17 @@ jQuery(document).ready(function() {
|
|||
});
|
||||
|
||||
|
||||
<?php
|
||||
if (!getDolGlobalString('MAIN_DISABLE_SELECT2_FOCUS_PROTECTION') && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
|
||||
?>
|
||||
/*
|
||||
* Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
|
||||
* Hacky fix for a bug in select2 with jQuery 3.6.4's new nested-focus "protection"
|
||||
* This fix needs to click a second time when clicking into a combo with ajax (see Test4d and Test5a in test_forms.php
|
||||
* see: https://github.com/select2/select2/issues/5993
|
||||
* see: https://github.com/jquery/jquery/issues/4382
|
||||
*
|
||||
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
|
||||
*/
|
||||
|
||||
<?php
|
||||
if (!getDolGlobalString('MAIN_DISABLE_SELECT2_FOCUS_PROTECTION') && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
|
||||
?>
|
||||
$(document).on('select2:open', (e) => {
|
||||
console.log("Execute the focus (click on combo or use space when on component");
|
||||
const target = $(e.target);
|
||||
|
|
|
|||
|
|
@ -234,6 +234,25 @@ function isModEnabled($module)
|
|||
//return !empty($conf->$module->enabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* isDolTms check if a timestamp is valid.
|
||||
*
|
||||
* @param int|string|null $timestamp timestamp to check
|
||||
* @return bool
|
||||
*/
|
||||
function isDolTms($timestamp)
|
||||
{
|
||||
if ($timestamp === '') {
|
||||
dol_syslog('Using empty string for a timestamp is deprecated, prefer use of null when calling page '.$_SERVER["PHP_SELF"], LOG_NOTICE);
|
||||
return false;
|
||||
}
|
||||
if (is_null($timestamp) || !is_numeric($timestamp)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a DoliDB instance (database handler).
|
||||
*
|
||||
|
|
@ -2781,7 +2800,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
|||
function dol_strftime($fmt, $ts = false, $is_gmt = false)
|
||||
{
|
||||
if ((abs($ts) <= 0x7FFFFFFF)) { // check if number in 32-bit signed range
|
||||
return ($is_gmt) ? @gmstrftime($fmt, $ts) : @strftime($fmt, $ts);
|
||||
return ($is_gmt) ? @gmstrftime($fmt, $ts) : @dol_print_date($ts, $fmt);
|
||||
} else {
|
||||
return 'Error date into a not supported range';
|
||||
}
|
||||
|
|
@ -6724,7 +6743,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
|||
$found = 1;
|
||||
}
|
||||
} else {
|
||||
// TODO Read default product vat according to product and another countrycode.
|
||||
// TODO Read default product vat according to product and an other countrycode.
|
||||
// Vat for couple anothercountrycode/product is data that is not managed and store yet, so we will fallback on next rule.
|
||||
}
|
||||
}
|
||||
|
|
@ -11878,6 +11897,9 @@ function getElementProperties($element_type)
|
|||
$module = 'societe';
|
||||
$subelement = 'contact';
|
||||
$table_element = 'socpeople';
|
||||
} elseif ($element_type == 'inventory') {
|
||||
$module = 'product';
|
||||
$classpath = 'product/inventory/class';
|
||||
} elseif ($element_type == 'stock') {
|
||||
$classpath = 'product/stock/class';
|
||||
$classfile = 'entrepot';
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
|||
|
||||
if (!is_object($objsoc)) {
|
||||
$valueforccc = $objsoc;
|
||||
} elseif ($table == "commande_fournisseur" || $table == "facture_fourn") {
|
||||
} elseif ($table == "commande_fournisseur" || $table == "facture_fourn" || $table == "paiementfourn") {
|
||||
$valueforccc = dol_string_unaccent($objsoc->code_fournisseur);
|
||||
} else {
|
||||
$valueforccc = dol_string_unaccent($objsoc->code_client);
|
||||
|
|
@ -1612,7 +1612,7 @@ function hexbin($hexa)
|
|||
*/
|
||||
function numero_semaine($time)
|
||||
{
|
||||
$stime = strftime('%Y-%m-%d', $time);
|
||||
$stime = dol_print_date($time, '%Y-%m-%d');
|
||||
|
||||
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/i', $stime, $reg)) {
|
||||
// Date est au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ function dol_setshmop($memoryid, $data, $expire)
|
|||
* Read a memory area shared by all users, all sessions on server
|
||||
*
|
||||
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
|
||||
* @return int Return integer <0 if KO, data if OK, Null if no cache enabled or not found
|
||||
* @return int|null Return integer <0 if KO, data if OK, null if no cache enabled or not found
|
||||
*/
|
||||
function dol_getshmop($memoryid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
|
|||
* @param int $usecontact Use contact instead of company
|
||||
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
|
||||
* @param Object $object Object we want to build document for
|
||||
* @return string String with full address
|
||||
* @return string|int String with full address or -1 if KO
|
||||
*/
|
||||
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1211,7 +1211,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
* @param Translate $langs Object langs
|
||||
* @param DoliDB $db Object db
|
||||
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
|
||||
* @param Contact $objcon Filter on object contact to filter events on a contact
|
||||
* @param Contact|null $objcon Filter on object contact to filter events on a contact
|
||||
* @param int $noprint Return string but does not output it
|
||||
* @param string|string[] $actioncode Filter on actioncode
|
||||
* @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
|
||||
|
|
@ -1221,7 +1221,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
* @param string $module You can add module name here if elementtype in table llx_actioncomm is objectkey@module
|
||||
* @return string|void Return html part or void if noprint is 1
|
||||
*/
|
||||
function show_actions_done_user($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
|
||||
function show_actions_done_user($conf, $langs, $db, $filterobj, $objcon = null, $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC', $module = '')
|
||||
{
|
||||
global $user, $conf, $hookmanager;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
|
|||
-- Sub-Menus
|
||||
|
||||
-- Home - Dashboard
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__, '<span class="fas fa-chart-bar fa-fw paddingright pictofixedwidth"></span>');
|
||||
|
||||
-- Home - Setup
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin' , __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?mainmenu=home&leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', '$user->admin' , __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?mainmenu=home&leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__, '<span class="fas fa-tools fa-fw paddingright pictofixedwidth" style=""></span>');
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/company.php?mainmenu=home&leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/ihm.php?mainmenu=home&leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '' , 100__+MAX_llx_menu__, '/admin/translation.php?mainmenu=home&leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
|
||||
|
|
@ -52,7 +52,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?mainmenu=home&leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 14, __ENTITY__);
|
||||
|
||||
-- Home - Admin tools
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?mainmenu=home&leftmenu=admintools', 'AdminTools', 0, 'admin', '', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?mainmenu=home&leftmenu=admintools', 'AdminTools', 0, 'admin', '', '', 2, 2, __ENTITY__, '<span class="fas fa-server fa-fw paddingright pictofixedwidth"></span>');
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 202__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/system/modules.php?mainmenu=home&leftmenu=admintools', 'Modules', 2, 'admin', '', '', 2, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 203__+MAX_llx_menu__, 'home', '', 201__+MAX_llx_menu__, '/admin/triggers.php?mainmenu=home&leftmenu=admintools', 'Triggers', 2, 'admin', '', '', 2, 3, __ENTITY__);
|
||||
|
|
@ -75,7 +75,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 15, __ENTITY__);
|
||||
|
||||
-- Home - Menu users and groups
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?mainmenu=home&leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?mainmenu=home&leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__, '<span class="fas fa-user infobox-adherent fa-fw paddingright pictofixedwidth"></span>');
|
||||
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?mainmenu=home&leftmenu=users', 'Users', 1, 'users', '$user->hasRight("user","user","lire") || $user->admin', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?mainmenu=home&leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->hasRight("user","user","creer") || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__);
|
||||
|
|
@ -87,7 +87,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?mainmenu=home&leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->hasRight("user","user","creer")) || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__);
|
||||
|
||||
-- Third parties
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 0, __ENTITY__, '<span class="fas fa-building fa-fw pictofixedwidth" style="color: #6c6aa8;"></span>');
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->hasRight("societe","lire") && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
|
||||
|
|
@ -98,7 +98,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__);
|
||||
|
||||
-- Third parties - Contacts
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 1, __ENTITY__, '<span class="fas fa-address-book fa-fw paddingright pictofixedwidth" style="color: #6c6aa8;"></span>');
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'List', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 1, __ENTITY__);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ class mod_facture_terre extends ModeleNumRefFactures
|
|||
return $ref;
|
||||
} elseif ($mode == 'next') {
|
||||
$date = $invoice->date; // This is invoice date (not creation date)
|
||||
$yymm = strftime("%y%m", $date);
|
||||
$yymm = dol_print_date($date, "%y%m");
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.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
|
||||
|
|
@ -503,7 +504,7 @@ class modFacture extends DolibarrModules
|
|||
's.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
's.tva_intra'=>'VATIntra',
|
||||
't.libelle'=>"ThirdPartyType", // 'ce.code'=>"Staff", "cfj.libelle"=>"JuridicalStatus",
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
|
|
@ -546,7 +547,7 @@ class modFacture extends DolibarrModules
|
|||
's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
't.libelle'=>"Text", // 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text",
|
||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
|
||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
|
||||
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
|
||||
'none.rest'=>"NumericCompute",
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text",
|
||||
|
|
@ -630,7 +631,7 @@ class modFacture extends DolibarrModules
|
|||
's.phone'=>'Phone',
|
||||
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.fk_facture_source'=>'SourceInvoiceId',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total_ht'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment',
|
||||
'none.rest'=>'Rest',
|
||||
|
|
@ -655,7 +656,7 @@ class modFacture extends DolibarrModules
|
|||
$this->export_TypeFields_array[$r] = array(
|
||||
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.fk_facture_source'=>'Numeric', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
|
||||
'none.rest'=>'NumericCompute',
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class modResource extends DolibarrModules
|
|||
// List of modules id that must be enabled if this module is enabled
|
||||
$this->depends = array();
|
||||
// List of modules id to disable if this one is disabled
|
||||
$this->requiredby = array('modPlace');
|
||||
$this->requiredby = array('');
|
||||
// Minimum version of PHP required by module
|
||||
$this->phpmin = array(7, 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class modStockTransfer extends DolibarrModules
|
|||
// Used only if file README.md and README-LL.md not found.
|
||||
$this->descriptionlong = "Advanced management of stock transfer orders with generation of stock transfer sheets";
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||
$this->version = 'dolibarr';
|
||||
$this->version = 'experimental';
|
||||
// Url to the file with your last numberversion of this module
|
||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class mod_mo_standard extends ModeleNumRefMos
|
|||
|
||||
//$date=time();
|
||||
$date = $object->date_creation;
|
||||
$yymm = strftime("%y%m", $date);
|
||||
$yymm = dol_print_date($date, "%y%m");
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class mod_lot_standard extends ModeleNumRefBatch
|
|||
|
||||
//$date=time();
|
||||
$date = dol_now();
|
||||
$yymm = strftime("%y%m", $date);
|
||||
$yymm = dol_print_date($date, "%y%m");
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
$num = $max + 1;
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class mod_sn_standard extends ModeleNumRefBatch
|
|||
|
||||
//$date=time();
|
||||
$date = dol_now();
|
||||
$yymm = strftime("%y%m", $date);
|
||||
$yymm = dol_print_date($date, "%y%m");
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
$num = $max + 1;
|
||||
|
|
|
|||
|
|
@ -1602,7 +1602,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
|||
),
|
||||
'border-left' => true, // add left line separator
|
||||
);
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
$this->cols['unit']['status'] = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -138,32 +138,32 @@ if ($action == 'presend') {
|
|||
}
|
||||
if ($object->element == 'salary' && getDolGlobalString('INVOICE_EMAIL_SENDER')) {
|
||||
$formmail->frommail = getDolGlobalString('SINVOICE_EMAIL_SENDER');
|
||||
$formmail->fromname = (getDolGlobalString('INVOICE_EMAIL_SENDER_NAME') ? $conf->global->INVOICE_EMAIL_SENDER_NAME : '');
|
||||
$formmail->fromname = getDolGlobalString('INVOICE_EMAIL_SENDER_NAME', '');
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'facture' && getDolGlobalString('INVOICE_EMAIL_SENDER')) {
|
||||
$formmail->frommail = getDolGlobalString('INVOICE_EMAIL_SENDER');
|
||||
$formmail->fromname = (getDolGlobalString('INVOICE_EMAIL_SENDER_NAME') ? $conf->global->INVOICE_EMAIL_SENDER_NAME : '');
|
||||
$formmail->fromname = getDolGlobalString('INVOICE_EMAIL_SENDER_NAME', '');
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'shipping' && getDolGlobalString('SHIPPING_EMAIL_SENDER')) {
|
||||
$formmail->frommail = getDolGlobalString('SHIPPING_EMAIL_SENDER');
|
||||
$formmail->fromname = (getDolGlobalString('SHIPPING_EMAIL_SENDER_NAME') ? $conf->global->SHIPPING_EMAIL_SENDER_NAME : '');
|
||||
$formmail->fromname = getDolGlobalString('SHIPPING_EMAIL_SENDER_NAME', '');
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'commande' && getDolGlobalString('COMMANDE_EMAIL_SENDER')) {
|
||||
$formmail->frommail = getDolGlobalString('COMMANDE_EMAIL_SENDER');
|
||||
$formmail->fromname = (getDolGlobalString('COMMANDE_EMAIL_SENDER_NAME') ? $conf->global->COMMANDE_EMAIL_SENDER_NAME : '');
|
||||
$formmail->fromname = getDolGlobalString('COMMANDE_EMAIL_SENDER_NAME', '');
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'order_supplier' && getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER')) {
|
||||
$formmail->frommail = getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER');
|
||||
$formmail->fromname = (getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER_NAME') ? $conf->global->ORDER_SUPPLIER_EMAIL_SENDER_NAME : '');
|
||||
$formmail->fromname = getDolGlobalString('ORDER_SUPPLIER_EMAIL_SENDER_NAME', '');
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
if ($object->element === 'recruitmentcandidature') {
|
||||
$formmail->frommail = (getDolGlobalString('RECRUITMENT_EMAIL_SENDER') ? $conf->global->RECRUITMENT_EMAIL_SENDER : $recruitermail);
|
||||
$formmail->fromname = (getDolGlobalString('RECRUITMENT_EMAIL_SENDER_NAME') ? $conf->global->RECRUITMENT_EMAIL_SENDER_NAME : (!empty($recruitername) ? $recruitername : ''));
|
||||
$formmail->frommail = getDolGlobalString('RECRUITMENT_EMAIL_SENDER', (!empty($recruitermail) ? $recruitermail : ''));
|
||||
$formmail->fromname = getDolGlobalString('RECRUITMENT_EMAIL_SENDER_NAME', (!empty($recruitername) ? $recruitername : ''));
|
||||
$formmail->fromtype = 'special';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ class Cronjob extends CommonObject
|
|||
const STATUS_DISABLED = 0;
|
||||
const STATUS_ENABLED = 1;
|
||||
const STATUS_ARCHIVED = 2;
|
||||
const MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD = 65535;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -1323,13 +1324,13 @@ class Cronjob extends CommonObject
|
|||
dol_syslog(get_class($this)."::run_jobs END result=".$result." error=".$errmsg, LOG_ERR);
|
||||
|
||||
$this->error = $errmsg;
|
||||
$this->lastoutput = (!empty($object->output) ? $object->output."\n" : "").$errmsg;
|
||||
$this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1);
|
||||
$this->lastresult = is_numeric($result) ? $result : -1;
|
||||
$retval = $this->lastresult;
|
||||
$error++;
|
||||
} else {
|
||||
dol_syslog(get_class($this)."::run_jobs END");
|
||||
$this->lastoutput = (!empty($object->output) ? $object->output : "");
|
||||
$this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1);
|
||||
$this->lastresult = var_export($result, true);
|
||||
$retval = $this->lastresult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,6 +324,30 @@ if (empty($reshook)) {
|
|||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
if ($action == 'update_extras') {
|
||||
$object->fetch($id);
|
||||
|
||||
$object->oldcopy = dol_clone($object);
|
||||
|
||||
// Fill array 'array_options' with data from update form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
|
||||
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->insertExtraFields('DON_MODIFY');
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to build doc
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
|
|
|||
|
|
@ -877,15 +877,13 @@ class Don extends CommonObject
|
|||
return $result;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->nb = array();
|
||||
|
||||
$sql = "SELECT count(d.rowid) as nb";
|
||||
|
|
|
|||
|
|
@ -204,9 +204,9 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permissiontoadd) {
|
|||
|
||||
// Fetch was already done
|
||||
$ecmdir->label = dol_sanitizeFileName(GETPOST("label"));
|
||||
$fk_parent = GETPOST("catParent", 'int');
|
||||
if ($fk_parent == "-1") {
|
||||
$ecmdir->fk_parent = "0";
|
||||
$fk_parent = GETPOSTINT("catParent");
|
||||
if ($fk_parent == -1) {
|
||||
$ecmdir->fk_parent = 0;
|
||||
} else {
|
||||
$ecmdir->fk_parent = $fk_parent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -874,6 +874,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
$triggersendname = 'SHIPPING_SENTBYMAIL';
|
||||
$paramname = 'id';
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_SHIPMENT_TO';
|
||||
$mode = 'emailfromshipment';
|
||||
$trackid = 'shi'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ if (empty($reshook)) {
|
|||
$object->date_debut = $date_start;
|
||||
$object->date_fin = $date_end;
|
||||
|
||||
$object->fk_user_author = GETPOST('fk_user_author', 'int');
|
||||
$object->fk_user_author = GETPOSTINT('fk_user_author');
|
||||
if (!($object->fk_user_author > 0)) {
|
||||
$object->fk_user_author = $user->id;
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ if (empty($reshook)) {
|
|||
|
||||
$object->status = 1;
|
||||
$object->fk_c_paiement = GETPOST('fk_c_paiement', 'int');
|
||||
$object->fk_user_validator = GETPOST('fk_user_validator', 'int');
|
||||
$object->fk_user_validator = GETPOSTINT('fk_user_validator');
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->note_private = GETPOST('note_private', 'restricthtml');
|
||||
// Fill array 'array_options' with data from add form
|
||||
|
|
@ -333,7 +333,7 @@ if (empty($reshook)) {
|
|||
$object->date_fin = $date_end;
|
||||
|
||||
if ($object->status < 3) {
|
||||
$object->fk_user_validator = GETPOST('fk_user_validator', 'int');
|
||||
$object->fk_user_validator = GETPOSTINT('fk_user_validator');
|
||||
}
|
||||
|
||||
$object->fk_c_paiement = GETPOST('fk_c_paiement', 'int');
|
||||
|
|
|
|||
|
|
@ -2337,10 +2337,13 @@ class ExpenseReport extends CommonObject
|
|||
*/
|
||||
public function periode_existe($fuser, $date_debut, $date_fin)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// phpcs:enable
|
||||
$sql = "SELECT rowid, date_debut, date_fin";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE fk_user_author = ".((int) $fuser->id);
|
||||
$sql .= " WHERE entity = ".((int) $conf->entity); // not shared, only for the current entity
|
||||
$sql .= " AND fk_user_author = ".((int) $fuser->id);
|
||||
|
||||
dol_syslog(get_class($this)."::periode_existe sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
|
@ -2479,15 +2482,13 @@ class ExpenseReport extends CommonObject
|
|||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -207,15 +207,13 @@ class Fichinter extends CommonObject
|
|||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators into this->nb for board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -61,12 +61,17 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @param int $id ID of supplier invoice
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -74,10 +79,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$this->invoice->fetchObjectLinked();
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
}
|
||||
|
|
@ -101,10 +102,8 @@ class SupplierInvoices extends DolibarrApi
|
|||
*/
|
||||
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '')
|
||||
{
|
||||
global $db;
|
||||
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
$obj_ret = array();
|
||||
|
|
@ -196,13 +195,13 @@ class SupplierInvoices extends DolibarrApi
|
|||
*
|
||||
* @return int ID of supplier invoice
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401, "Insuffisant rights");
|
||||
throw new RestException(403, "Insuffisant rights");
|
||||
}
|
||||
// Check mandatory fields
|
||||
$result = $this->_validate($request_data);
|
||||
|
|
@ -234,13 +233,17 @@ class SupplierInvoices extends DolibarrApi
|
|||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -248,10 +251,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
|
|
@ -279,24 +278,23 @@ class SupplierInvoices extends DolibarrApi
|
|||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "supprimer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, 'Error when deleting invoice');
|
||||
}
|
||||
|
|
@ -321,7 +319,7 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @return array
|
||||
*
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
* @throws RestException 405
|
||||
* @throws RestException 500 System error
|
||||
|
|
@ -329,17 +327,18 @@ class SupplierInvoices extends DolibarrApi
|
|||
public function validate($id, $idwarehouse = 0, $notrigger = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(304, 'Error nothing done. The invoice is already validated');
|
||||
|
|
@ -365,21 +364,21 @@ class SupplierInvoices extends DolibarrApi
|
|||
*
|
||||
* @return array
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
* @throws RestException 405
|
||||
*/
|
||||
public function getPayments($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
if (empty($id)) {
|
||||
throw new RestException(400, 'Invoice ID is mandatory');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -413,23 +412,27 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @url POST {id}/payments
|
||||
*
|
||||
* @return int Payment ID
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function addPayment($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '', $amount = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (empty($id)) {
|
||||
throw new RestException(400, 'Invoice ID is mandatory');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if (isModEnabled("banque")) {
|
||||
|
|
@ -442,12 +445,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(400, 'Payment mode ID is mandatory');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if (null !== $amount && $amount > 0) {
|
||||
// We use the amount given in parameter
|
||||
$paymentamount = $amount;
|
||||
|
|
@ -508,11 +505,17 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @url GET {id}/lines
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function getLines($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -520,9 +523,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$this->invoice->fetch_lines();
|
||||
$result = array();
|
||||
foreach ($this->invoice->lines as $line) {
|
||||
|
|
@ -544,11 +544,18 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @url POST {id}/lines
|
||||
*
|
||||
* @return int|bool
|
||||
*
|
||||
* @throws RestException 403
|
||||
* @throws RestException 404
|
||||
*/
|
||||
public function postLine($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -556,10 +563,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->description = sanitizeVal($request_data->description, 'restricthtml');
|
||||
|
|
@ -608,14 +611,18 @@ class SupplierInvoices extends DolibarrApi
|
|||
*
|
||||
* @return object
|
||||
*
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 304 Error
|
||||
*/
|
||||
public function putLine($id, $lineid, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -623,10 +630,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->description = sanitizeVal($request_data->description, 'restricthtml');
|
||||
|
|
@ -675,14 +678,21 @@ class SupplierInvoices extends DolibarrApi
|
|||
* @return array
|
||||
*
|
||||
* @throws RestException 400 Bad parameters
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 405 Error
|
||||
*/
|
||||
public function deleteLine($id, $lineid)
|
||||
{
|
||||
if (empty($lineid)) {
|
||||
throw new RestException(400, 'Line ID is mandatory');
|
||||
}
|
||||
|
||||
if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "creer")) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
|
|
@ -690,14 +700,6 @@ class SupplierInvoices extends DolibarrApi
|
|||
throw new RestException(404, 'Supplier invoice not found');
|
||||
}
|
||||
|
||||
if (empty($lineid)) {
|
||||
throw new RestException(400, 'Line ID is mandatory');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
|
||||
throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// TODO Check the lineid $lineid is a line of object
|
||||
|
||||
$updateRes = $this->invoice->deleteline($lineid);
|
||||
|
|
|
|||
|
|
@ -94,15 +94,13 @@ class Fournisseur extends Societe
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load statistics indicators
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user, $hookmanager;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -3097,15 +3097,13 @@ class CommandeFournisseur extends CommonOrder
|
|||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load the indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -3086,15 +3086,13 @@ class FactureFournisseur extends CommonInvoice
|
|||
$this->total_ttc = $xnbp * 119.6;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -259,7 +259,9 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
|||
}
|
||||
|
||||
// We ask to move a qty
|
||||
if (GETPOST($qty) != 0) {
|
||||
$qtytomove = (float) price2num(GETPOST($qty, 'alphanohtml'));
|
||||
$puformove = (float) price2num(GETPOST($pu, 'alphanohtml'));
|
||||
if ($qtytomove != 0) {
|
||||
if (!(GETPOST($ent, 'int') > 0)) {
|
||||
dol_syslog('No dispatch for line '.$key.' as no warehouse was chosen.');
|
||||
$text = $langs->transnoentities('Warehouse').', '.$langs->transnoentities('Line').' '.($numline);
|
||||
|
|
@ -268,7 +270,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
$result = $object->dispatchProduct($user, GETPOSTINT($prod), $qtytomove, GETPOSTINT($ent), $puformove, GETPOST('comment'), '', '', '', GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
@ -327,7 +329,9 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
|||
}
|
||||
|
||||
// We ask to move a qty
|
||||
if (GETPOST($qty) > 0) {
|
||||
$qtytomove = (float) price2num(GETPOST($qty, 'alphanohtml'));
|
||||
$puformove = (float) price2num(GETPOST($pu, 'alphanohtml'));
|
||||
if ($qtytomove > 0) {
|
||||
$productId = GETPOSTINT($prod);
|
||||
|
||||
if (!(GETPOST($ent, 'int') > 0)) {
|
||||
|
|
@ -345,7 +349,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->dispatchProduct($user, $productId, GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), $dDLUO, $dDLC, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
$result = $object->dispatchProduct($user, $productId, $qtytomove, GETPOSTINT($ent), $puformove, GETPOST('comment'), $dDLUO, $dDLC, GETPOST($lot, 'alpha'), GETPOST($fk_commandefourndet, 'int'), $notrigger);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -2362,15 +2362,13 @@ class Holiday extends CommonObject
|
|||
$this->statut = Holiday::STATUS_VALIDATED;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load this->nb for dashboard
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
$object->town = GETPOST('town', 'alpha');
|
||||
$object->country_id = GETPOST("country_id", 'int');
|
||||
$object->status = GETPOST('status', 'int');
|
||||
$object->country_id = GETPOSTINT("country_id");
|
||||
$object->status = GETPOSTINT('status');
|
||||
$object->fk_user_author = $user->id;
|
||||
$object->datec = dol_now();
|
||||
$object->entity = GETPOST('entity', 'int') > 0 ? GETPOST('entity', 'int') : $conf->entity;
|
||||
|
|
@ -133,9 +133,9 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||
$object->address = GETPOST('address', 'alpha');
|
||||
$object->zip = GETPOST('zipcode', 'alpha');
|
||||
$object->town = GETPOST('town', 'alpha');
|
||||
$object->country_id = GETPOST('country_id', 'int');
|
||||
$object->country_id = GETPOSTINT('country_id');
|
||||
$object->fk_user_mod = $user->id;
|
||||
$object->status = GETPOST('status', 'int');
|
||||
$object->status = GETPOSTINT('status');
|
||||
$object->entity = GETPOST('entity', 'int') > 0 ? GETPOST('entity', 'int') : $conf->entity;
|
||||
|
||||
$result = $object->update($user);
|
||||
|
|
|
|||
|
|
@ -159,6 +159,8 @@ ALTER TABLE llx_user_extrafields ADD UNIQUE INDEX uk_user_extrafields (fk_object
|
|||
ALTER TABLE llx_usergroup_extrafields DROP INDEX idx_usergroup_extrafields;
|
||||
ALTER TABLE llx_usergroup_extrafields ADD UNIQUE INDEX uk_usergroup_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_website ADD COLUMN name_template varchar(255) NULL;
|
||||
|
||||
UPDATE llx_categorie SET date_creation = tms, tms = tms WHERE date_creation IS NULL AND tms IS NOT NULL;
|
||||
|
||||
ALTER TABLE llx_product_price ADD COLUMN price_label varchar(255) AFTER fk_user_author;
|
||||
|
|
@ -204,4 +206,3 @@ ALTER TABLE llx_c_tva ADD COLUMN type_vat smallint NOT NULL DEFAULT 0 AFTER fk_p
|
|||
ALTER TABLE llx_categorie ADD COLUMN position integer DEFAULT 0 AFTER color;
|
||||
|
||||
ALTER TABLE llx_product DROP COLUMN onportal;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,5 +41,6 @@ CREATE TABLE llx_website
|
|||
pageviews_month BIGINT UNSIGNED DEFAULT 0, -- increased by 1 at each page access, saved into pageviews_previous_month when on different month than lastaccess
|
||||
pageviews_total BIGINT UNSIGNED DEFAULT 0, -- increased by 1 at each page access, no reset
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
import_key varchar(14) -- import key
|
||||
import_key varchar(14), -- import key
|
||||
name_template varchar(255) NULL --name of template imported
|
||||
) ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -354,6 +354,7 @@ HelpAbandonOther=This amount has been abandoned since it was an error (wrong cus
|
|||
IdSocialContribution=Social/fiscal tax payment id
|
||||
PaymentId=Payment id
|
||||
PaymentRef=Payment ref.
|
||||
SourceInvoiceId=Source invoice id
|
||||
InvoiceId=Invoice id
|
||||
InvoiceRef=Invoice ref.
|
||||
InvoiceDateCreation=Invoice creation date
|
||||
|
|
|
|||
|
|
@ -103,3 +103,4 @@ WebsitePagesCategoriesArea=Page-Container Categories
|
|||
KnowledgemanagementsCategoriesArea=KM article Categories
|
||||
UseOrOperatorForCategories=Use 'OR' operator for categories
|
||||
AddObjectIntoCategory=Assign to the category
|
||||
Position=Position
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ CalcModeVATDebt=Mode <b>%sVAT on commitment accounting%s</b>.
|
|||
CalcModeVATEngagement=Mode <b>%sVAT on incomes-expenses%s</b>.
|
||||
CalcModeDebt=Analysis of known recorded documents
|
||||
CalcModeEngagement=Analysis of known recorded payments
|
||||
CalcModePayment=Analysis of known recorded payments
|
||||
CalcModeBookkeeping=Analysis of data journalized in Bookkeeping Ledger table.
|
||||
CalcModeNoBookKeeping=Even if they are not yet accounted in Ledger
|
||||
CalcModeLT1= Mode <b>%sRE on customer invoices - suppliers invoices%s</b>
|
||||
|
|
|
|||
|
|
@ -537,7 +537,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
|
||||
$sensitiveget = false;
|
||||
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
||||
// All GET actions (except the listed exception) and mass actions are processed as sensitive.
|
||||
// All GET actions (except the listed exception that are post actions) and mass actions are processed as sensitive.
|
||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude some action that are legitimate
|
||||
$sensitiveget = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,13 +66,16 @@ class MyModuleApi extends DolibarrApi
|
|||
*
|
||||
* @url GET myobjects/{id}
|
||||
*
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->read) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $id, 'mymodule_myobject')) {
|
||||
throw new RestException(403, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->myobject->fetch($id);
|
||||
|
|
@ -80,10 +83,6 @@ class MyModuleApi extends DolibarrApi
|
|||
throw new RestException(404, 'MyObject not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $this->myobject->id, 'mymodule_myobject')) {
|
||||
throw new RestException(401, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->myobject);
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +100,8 @@ class MyModuleApi extends DolibarrApi
|
|||
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of order objects
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 503 System error
|
||||
*
|
||||
* @url GET /myobjects/
|
||||
*/
|
||||
|
|
@ -111,7 +111,7 @@ class MyModuleApi extends DolibarrApi
|
|||
$tmpobject = new MyObject($this->db);
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->read) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : 0;
|
||||
|
|
@ -186,16 +186,17 @@ class MyModuleApi extends DolibarrApi
|
|||
* Create myobject object
|
||||
*
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of myobject
|
||||
* @return int ID of myobject
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url POST myobjects/
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
// Check mandatory fields
|
||||
|
|
@ -227,14 +228,19 @@ class MyModuleApi extends DolibarrApi
|
|||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url PUT myobjects/{id}
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->write) {
|
||||
throw new RestException(401);
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $id, 'mymodule_myobject')) {
|
||||
throw new RestException(403, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->myobject->fetch($id);
|
||||
|
|
@ -242,10 +248,6 @@ class MyModuleApi extends DolibarrApi
|
|||
throw new RestException(404, 'MyObject not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $this->myobject->id, 'mymodule_myobject')) {
|
||||
throw new RestException(401, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
foreach ($request_data as $field => $value) {
|
||||
if ($field == 'id') {
|
||||
continue;
|
||||
|
|
@ -275,24 +277,27 @@ class MyModuleApi extends DolibarrApi
|
|||
* @param int $id MyObject ID
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
* @throws RestException 409 Nothing to do
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url DELETE myobjects/{id}
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->mymodule->myobject->delete) {
|
||||
throw new RestException(401);
|
||||
if (!DolibarrApiAccess::$user->hasRight('mymodule', 'myobject', 'delete')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $id, 'mymodule_myobject')) {
|
||||
throw new RestException(403, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->myobject->fetch($id);
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'MyObject not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('myobject', $this->myobject->id, 'mymodule_myobject')) {
|
||||
throw new RestException(401, 'Access to instance id='.$this->myobject->id.' of object not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if ($this->myobject->delete(DolibarrApiAccess::$user) == 0) {
|
||||
throw new RestException(409, 'Error when deleting MyObject : '.$this->myobject->error);
|
||||
} elseif ($this->myobject->delete(DolibarrApiAccess::$user) < 0) {
|
||||
|
|
@ -348,40 +353,6 @@ class MyModuleApi extends DolibarrApi
|
|||
unset($object->rowid);
|
||||
unset($object->canvas);
|
||||
|
||||
/*unset($object->name);
|
||||
unset($object->lastname);
|
||||
unset($object->firstname);
|
||||
unset($object->civility_id);
|
||||
unset($object->statut);
|
||||
unset($object->state);
|
||||
unset($object->state_id);
|
||||
unset($object->state_code);
|
||||
unset($object->region);
|
||||
unset($object->region_code);
|
||||
unset($object->country);
|
||||
unset($object->country_id);
|
||||
unset($object->country_code);
|
||||
unset($object->barcode_type);
|
||||
unset($object->barcode_type_code);
|
||||
unset($object->barcode_type_label);
|
||||
unset($object->barcode_type_coder);
|
||||
unset($object->total_ht);
|
||||
unset($object->total_tva);
|
||||
unset($object->total_localtax1);
|
||||
unset($object->total_localtax2);
|
||||
unset($object->total_ttc);
|
||||
unset($object->fk_account);
|
||||
unset($object->comments);
|
||||
unset($object->note);
|
||||
unset($object->mode_reglement_id);
|
||||
unset($object->cond_reglement_id);
|
||||
unset($object->cond_reglement);
|
||||
unset($object->shipping_method_id);
|
||||
unset($object->fk_incoterms);
|
||||
unset($object->label_incoterms);
|
||||
unset($object->location_incoterms);
|
||||
*/
|
||||
|
||||
// If object has lines, remove $db property
|
||||
if (isset($object->lines) && is_array($object->lines) && count($object->lines) > 0) {
|
||||
$nboflines = count($object->lines);
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
|
||||
-- BEGIN MODULEBUILDER INDEXES
|
||||
ALTER TABLE llx_mymodule_myobject_extrafields ADD INDEX idx_myobject_fk_object(fk_object);
|
||||
ALTER TABLE llx_mymodule_myobject_extrafields ADD UNIQUE INDEX uk_myobject_fk_object(fk_object);
|
||||
-- END MODULEBUILDER INDEXES
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ if (empty($reshook)) {
|
|||
$moline->fk_default_workstation = $tmpproduct->fk_default_workstation;
|
||||
}
|
||||
$moline->disable_stock_change = ($tmpproduct->type == Product::TYPE_SERVICE ? 1 : 0);
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
$moline->fk_unit = $tmpproduct->fk_unit;
|
||||
}
|
||||
}
|
||||
|
|
@ -840,7 +840,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right">' . $langs->trans("Unit") . '</td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -911,7 +911,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '</td>';
|
||||
// Qty
|
||||
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -1029,7 +1029,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<input class="width40" name="qty_lineProduce" value="'. $line->qty.'">';
|
||||
print '</td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right nowraponall">';
|
||||
print measuringUnitString($line->fk_unit, '', '', 1);
|
||||
print '</td>';
|
||||
|
|
@ -1107,7 +1107,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print price2num($line->qty, 'MS');
|
||||
print '</td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right nowraponall">';
|
||||
print measuringUnitString($line->fk_unit, '', '', 1);
|
||||
print '</td>';
|
||||
|
|
@ -1323,7 +1323,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '></td>';
|
||||
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
|
|
@ -1449,7 +1449,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td class="right">'.$langs->trans("Qty").'</td>';
|
||||
/// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right">'.$langs->trans("Unit").'</td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -1502,7 +1502,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td class="right"><input type="text" name="qtytoadd" value="1" class="width50 right"></td>';
|
||||
//Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -1569,7 +1569,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td class="right">'.$line->qty.'</td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right">'.measuringUnitString($line->fk_unit, '', '', 1).'</td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -1668,7 +1668,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td></td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Cost price
|
||||
|
|
@ -1721,7 +1721,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Qty
|
||||
print '<td class="right"><input type="text" class="width50 right" id="qtytoproduce-'.$line->id.'-'.$i.'" name="qtytoproduce-'.$line->id.'-'.$i.'" value="'.$preselected.'"></td>';
|
||||
//Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="right"></td>';
|
||||
}
|
||||
// Cost
|
||||
|
|
|
|||
|
|
@ -3889,8 +3889,8 @@ class Product extends CommonObject
|
|||
}
|
||||
|
||||
if (empty($year)) {
|
||||
$year = strftime('%Y', time());
|
||||
$month = strftime('%m', time());
|
||||
$year = dol_print_date(time(), '%Y');
|
||||
$month = dol_print_date(time(), '%m');
|
||||
} elseif ($year == -1) {
|
||||
$year = '';
|
||||
$month = 12; // We imagine we are at end of year, so we get last 12 month before, so all correct year.
|
||||
|
|
@ -6123,15 +6123,13 @@ class Product extends CommonObject
|
|||
$this->imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators this->nb for the dashboard
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $hookmanager;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -477,14 +477,13 @@ class Productbatch extends CommonObject
|
|||
}
|
||||
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock AS ps ON (ps.rowid = fk_product_stock)';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'stock_mouvement AS sm ON (sm.batch = t.batch AND ps.fk_entrepot=sm.fk_entrepot)';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'stock_mouvement AS sm ON (sm.batch = t.batch AND ps.fk_entrepot=sm.fk_entrepot AND sm.type_mouvement IN (0,3))';
|
||||
}
|
||||
$sql .= " WHERE fk_product_stock=".((int) $fk_product_stock);
|
||||
if ($with_qty) {
|
||||
$sql .= " AND t.qty <> 0";
|
||||
}
|
||||
if (getDolGlobalString('SHIPPING_DISPLAY_STOCK_ENTRY_DATE')) {
|
||||
$sql .= ' AND sm.type_mouvement IN (0,3)';
|
||||
$sql .= ' GROUP BY t.rowid, t.tms, t.fk_product_stock,t.sellby,t.eatby , t.batch,t.qty,t.import_key';
|
||||
if ($fk_product > 0) {
|
||||
$sql .= ', pl.rowid, pl.eatby, pl.sellby';
|
||||
|
|
|
|||
|
|
@ -1146,8 +1146,8 @@ if ($resql) {
|
|||
$productidselected = $key;
|
||||
$productlabelselected = $val;
|
||||
}
|
||||
$datebefore = dol_get_first_day($year ? $year : strftime("%Y", time()), $month ? $month : 1, true);
|
||||
$dateafter = dol_get_last_day($year ? $year : strftime("%Y", time()), $month ? $month : 12, true);
|
||||
$datebefore = dol_get_first_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 1, true);
|
||||
$dateafter = dol_get_last_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 12, true);
|
||||
$balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore);
|
||||
$balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter);
|
||||
|
||||
|
|
|
|||
|
|
@ -1641,8 +1641,8 @@ if (count($arrayofuniqueproduct) == 1 && !empty($year) && is_numeric($year)) {
|
|||
$productidselected = $key;
|
||||
$productlabelselected = $val;
|
||||
}
|
||||
$datebefore = dol_get_first_day($year ? $year : strftime("%Y", time()), $month ? $month : 1, true);
|
||||
$dateafter = dol_get_last_day($year ? $year : strftime("%Y", time()), $month ? $month : 12, true);
|
||||
$datebefore = dol_get_first_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 1, true);
|
||||
$dateafter = dol_get_last_day($year ? $year : dol_print_date(time(), "%Y"), $month ? $month : 12, true);
|
||||
$balancebefore = $movement->calculateBalanceForProductBefore($productidselected, $datebefore);
|
||||
$balanceafter = $movement->calculateBalanceForProductBefore($productidselected, $dateafter);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$stocklimit = GETPOST('seuil_stock_alerte');
|
||||
$stocklimit = (float) GETPOST('seuil_stock_alerte');
|
||||
$desiredstock = GETPOST('desiredstock');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$fieldid = isset($_GET["ref"]) ? 'ref' : 'rowid';
|
||||
|
|
@ -153,7 +153,7 @@ if ($reshook < 0) {
|
|||
if ($action == 'setcost_price') {
|
||||
if ($id) {
|
||||
$result = $object->fetch($id);
|
||||
$object->cost_price = price2num($cost_price);
|
||||
$object->cost_price = (float) price2num($cost_price);
|
||||
$result = $object->update($object->id, $user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
|
|
@ -190,7 +190,7 @@ if ($action == 'addlimitstockwarehouse' && $user->hasRight('produit', 'creer'))
|
|||
}
|
||||
} else {
|
||||
// Create
|
||||
$pse->fk_entrepot = GETPOST('fk_entrepot', 'int');
|
||||
$pse->fk_entrepot = GETPOSTINT('fk_entrepot');
|
||||
$pse->fk_product = $id;
|
||||
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$pse->desiredstock = GETPOST('desiredstock');
|
||||
|
|
|
|||
|
|
@ -773,7 +773,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print getTitleFieldOfList($langs->trans('Unit'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans('AverageUnitPricePMPShort'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
|
||||
|
|
@ -846,7 +846,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<td class="center">'.$line->qty.'</td>';
|
||||
}
|
||||
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
print '<td class="linecoluseunit nowrap left">';
|
||||
$label = $productstatic->getLabelOfUnit('short');
|
||||
if ($label !== '') {
|
||||
|
|
@ -968,7 +968,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<td class="center"><input type="text" class="flat maxwidth50" name="qty" '.(!empty($error) ? 'value="'.$qty.'"' : '').'></td>';
|
||||
// PMP
|
||||
print '<td></td>';
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
||||
// Unité
|
||||
print '<td></td>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ if (getDolGlobalString('PROJECT_TASK_TIME_YEAR')) {
|
|||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<br><table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now).'</td>';
|
||||
print '<td>'.$langs->trans("ActivityOnProjectThisYear").': '.dol_print_date($now, "%Y").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Time").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
|
@ -340,7 +340,7 @@ if (getDolGlobalString('PROJECT_TASK_TIME_YEAR')) {
|
|||
$sql .= " AND tt.fk_element = t.rowid";
|
||||
$sql .= " AND tt.elementtype = 'task'";
|
||||
$sql .= " AND tt.fk_user = ".((int) $user->id);
|
||||
$sql .= " AND YEAR(element_date) = '".strftime("%Y", $now)."'";
|
||||
$sql .= " AND YEAR(element_date) = '".dol_print_date($now, "%Y")."'";
|
||||
$sql .= " AND p.rowid in (".$db->sanitize($projectsListId).")";
|
||||
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public";
|
||||
|
||||
|
|
|
|||
|
|
@ -849,9 +849,9 @@ class Project extends CommonObject
|
|||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")";
|
||||
}
|
||||
|
||||
if ($date_start > 0 && $type == 'loan') {
|
||||
if (isDolTms($date_start) && $type == 'loan') {
|
||||
$sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)";
|
||||
} elseif ($date_start > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
} elseif (isDolTms($date_start) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if (empty($datefieldname) && !empty($this->table_element_date)) {
|
||||
$datefieldname = $this->table_element_date;
|
||||
}
|
||||
|
|
@ -861,9 +861,9 @@ class Project extends CommonObject
|
|||
$sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)";
|
||||
}
|
||||
|
||||
if ($date_end > 0 && $type == 'loan') {
|
||||
if (isDolTms($date_end) && $type == 'loan') {
|
||||
$sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)";
|
||||
} elseif ($date_end > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
} elseif (isDolTms($date_end) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if (empty($datefieldname) && !empty($this->table_element_date)) {
|
||||
$datefieldname = $this->table_element_date;
|
||||
}
|
||||
|
|
@ -2293,15 +2293,13 @@ class Project extends CommonObject
|
|||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators this->nb for the state board
|
||||
*
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$this->nb = array();
|
||||
|
|
|
|||
|
|
@ -2337,15 +2337,13 @@ class Task extends CommonObjectLine
|
|||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load indicators this->nb for state board
|
||||
*
|
||||
* @return int Return integer <0 if ko, >0 if ok
|
||||
*/
|
||||
public function load_state_board()
|
||||
public function loadStateBoard()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user;
|
||||
|
||||
$mine = 0;
|
||||
|
|
|
|||
|
|
@ -173,6 +173,9 @@ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a ded
|
|||
}
|
||||
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
|
||||
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1);
|
||||
if (!getDolGlobalInt('PROJECT_HIDE_TASKS') && getDolGlobalInt('PROJECT_BILL_TIME_SPENT') && !$projectstatic->usage_bill_time ) {
|
||||
$projectstatic->usage_bill_time=1;
|
||||
}
|
||||
if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
$arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1);
|
||||
}
|
||||
|
|
@ -2282,7 +2285,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
$userstatic->photo = $task_time->photo;
|
||||
$userstatic->statut = $task_time->user_status;
|
||||
$userstatic->status = $task_time->user_status;
|
||||
print $userstatic->getNomUrl(-1);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -2564,7 +2567,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
$userstatic->photo = $task_time->photo;
|
||||
$userstatic->statut = $task_time->user_status;
|
||||
$userstatic->status = $task_time->user_status;
|
||||
print $userstatic->getNomUrl(-1);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -2720,7 +2723,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$userstatic->lastname = $task_time->lastname;
|
||||
$userstatic->firstname = $task_time->firstname;
|
||||
$userstatic->photo = $task_time->photo;
|
||||
$userstatic->statut = $task_time->user_status;
|
||||
$userstatic->status = $task_time->user_status;
|
||||
print $userstatic->getNomUrl(-1);
|
||||
}
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -565,6 +565,18 @@ if ($ispaymentok) {
|
|||
if ($paymentmethod == 'stripe') {
|
||||
$accountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('accountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$accountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($accountid < 0) {
|
||||
$error++;
|
||||
$errmsg = 'Setup of bank account to use for payment is not correctly done for payment method '.$paymentmethod;
|
||||
|
|
@ -903,6 +915,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
|
@ -1020,6 +1043,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
|
@ -1146,6 +1180,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(DonationPayment)';
|
||||
$result = $paiement->addPaymentToBank($user, 'payment_donation', $label, $bankaccountid, '', '');
|
||||
|
|
@ -1265,6 +1310,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
|
@ -1484,6 +1540,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
|
@ -1684,6 +1751,17 @@ if ($ispaymentok) {
|
|||
$bankaccountid = getDolGlobalString('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS');
|
||||
}
|
||||
|
||||
//Get bank account for a specific paymentmedthod
|
||||
$parameters = [
|
||||
'paymentmethod' => $paymentmethod,
|
||||
];
|
||||
$reshook = $hookmanager->executeHooks('getBankAccountPaymentMethod', $parameters, $object, $action);
|
||||
if ($reshook >= 0) {
|
||||
if (isset($hookmanager->resArray['bankaccountid'])) {
|
||||
dol_syslog('bankaccountid overwrite by hook return with value='.$hookmanager->resArray['bankaccountid'], LOG_DEBUG, 0, '_payment');
|
||||
$bankaccountid = $hookmanager->resArray['bankaccountid'];
|
||||
}
|
||||
}
|
||||
if ($bankaccountid > 0) {
|
||||
$label = '(CustomerInvoicePayment)';
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
|
|
|||
|
|
@ -733,6 +733,7 @@ if (empty($reshook)) {
|
|||
$triggersendname = 'RECEPTION_SENTBYMAIL';
|
||||
$paramname = 'id';
|
||||
$mode = 'emailfromreception';
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_RECEPTION_TO';
|
||||
$trackid = 'rec'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ if ($action == 'updatelines' && $permissiontoreceive) {
|
|||
} else {
|
||||
$qtystart = $supplierorderdispatch->qty;
|
||||
$supplierorderdispatch->qty = GETPOST($qty);
|
||||
$supplierorderdispatch->fk_entrepot = GETPOST($ent, 'int');
|
||||
$supplierorderdispatch->fk_entrepot = GETPOSTINT($ent);
|
||||
if ($modebatch == "batch") {
|
||||
$supplierorderdispatch->eatby = $dDLUO;
|
||||
$supplierorderdispatch->sellby = $dDLC;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue