Merge branch 'develop' into cleandeprecated

This commit is contained in:
Frédéric FRANCE 2023-11-16 21:01:41 +01:00 committed by GitHub
commit a4c0089dc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 926 additions and 231 deletions

View file

@ -7,12 +7,12 @@ Bug reports and feature requests
<a name="not-a-support-forum"></a>*Note*: **GitHub Issues is not a support forum.** If you have questions about Dolibarr / need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages.
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
Default **language here is english**. So please prepare your contributions in english.
Default **language here is English**. So please prepare your contributions in English.
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
3. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version)
4. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible).
4. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging information whenever possible).
5. Delete unnecessary submissions.
6. **Check your Message at Preview before sending.**
@ -45,12 +45,12 @@ The rule N - 2 is just a tip if you don't know which version to choose to get th
and number of potential beneficiaries of the correction.
### General rules
Please don't edit the ChangeLog file. File will be generated from all commit messages during release process by the project manager.
Please don't edit the ChangeLog file. This file is generated from all commit messages during release process by the project manager.
### <a name="commits"></a>Commits
Use clear commit messages with the following structure:
```
```plaintext
[KEYWORD] [ISSUENUM] DESC
LONGDESC
@ -68,12 +68,12 @@ where
#### Keyword
In uppercase if you want to have the log comment appears into the generated ChangeLog file.
The keyword can be ommitted if your commit does not fit in any of the following categories:
The keyword can be omitted if your commit does not fit in any of the following categories:
- Fix/FIX: for a bug fix
- Close/CLOSE: for closing a referenced feature request
- New/NEW: for an unreferenced new feature (Opening a feature request and using close is prefered)
- Perf/PERF: for performance enhancement
- New/NEW: for an unreferenced new feature (Opening a feature request and using close is preferred)
- Perf/PERF: for a performance enhancement
- Qual/QUAL: for quality code enhancement or re-engineering
#### Issuenum
@ -150,7 +150,7 @@ All other translations are managed online at [Transifex](https://www.transifex.c
Translations done on transifex are available in the next major release.
Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
Note: Sometimes, the source text (English) is modified. In such a case, the translation is reset. Transifex assume that if the original source
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
to retrieve all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.

View file

@ -68,4 +68,4 @@ body:
id: files
attributes:
label: Attached files
description: Screenshots, screencasts, dolibarr.log, debugging informations
description: Screenshots, screencasts, dolibarr.log, debugging information

View file

@ -235,7 +235,7 @@ jobs:
sudo cat /etc/apache2/sites-enabled/000-default.conf
sudo service apache2 restart
curl -I localhost
- name: Chech Apache availability
- name: Check Apache availability
run: |
echo "Checking webserver availability by a wget -O - --debug http://127.0.0.1"
# Ensure we stop on error with set -e

View file

@ -190,7 +190,7 @@ jobs:
sudo cat /etc/apache2/sites-enabled/000-default.conf
sudo service apache2 restart
curl -I localhost
- name: Chech Apache availability
- name: Check Apache availability
run: |
echo "Checking webserver availability by a wget -O - --debug http://127.0.0.1"
# Ensure we stop on error with set -e

View file

@ -8,7 +8,9 @@ English Dolibarr ChangeLog
For users:
----------
NEW: Compatibility with PHP 8.2
NEW: Module for Advanced stock transfert is now stable (#26594)
NEW: Add a confirmation popup when deleting extrafields
NEW: Add type 'icon' type for extrafields
NEW: Close #20930 Use ajax for state loading after country change
NEW: #23331 Add support for parent projects (#24856)
NEW: #22531 Expense report - Add two fields into export : Qty & Unit price (excl.) (#26309)
@ -101,7 +103,6 @@ NEW: Date d'entree en stock sur les exped au moment de la création
NEW: Date field for shipment export (#25574)
NEW: Date format dayhoursec is using year on 2 char on smartphones
NEW: Default customer, category and product when enable TakePOS (#25031)
NEW: Disable not used PHP streams
NEW: do not add default value in list
NEW: drop down for action button show a simple button if only 1 action
NEW: Enhance github_commits_perversion to get more stats on git commits
@ -172,6 +173,7 @@ NEW: When an user unset the batch management of products, transformation of each
SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
SEC: Add action confirm_... as sensitive to need a CSRF token
SEC: Disable not used PHP streams
For developers or integrators:

View file

@ -70,7 +70,7 @@ Note: *Le processus de migration peut être lancé manuellement et plusieurs foi
## CE QUI EST NOUVEAU
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
Voir le fichier [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog).
## CE QUE DOLIBARR PEUT FAIRE
@ -88,11 +88,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Gestion de contrats de services
- Gestion de stock et inventaires
- Gestion des expéditions
- Gestion des demandes de congès
- Gestion des demandes de congés
- Gestion des notes de frais
- Gestion de recrutement
- GED (Gestion Electronique de Documents)
- EMailings de masse
- E-Mailings de masse
- Réalisation de sondages
- Gestion d'adhérents
- Point de vente/Caisse enregistreuse
@ -107,17 +107,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Support des codes barres
- Calcul des marges
- Connectivité LDAP
- Intégratn de ClickToDial
- Intégration de ClickToDial
- Intégration RSS
- Intégation Skype
- Intégration de système de paiements (Paypal, Stripe, Paybox...)
- Intégration Skype
- Intégration de système de paiements (PayPal, Stripe, Paybox...)
- …
### Divers
- Multi-langue.
- Multi-utilisateurs avec différents niveaux de permissions par module.
- Multi-devise.
- Multidevise.
- Peux être multi-société par ajout du module externe multi-société.
- Plusieurs thèmes visuels.
- Application simple à utiliser.
@ -127,7 +127,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
- Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers).
- Support natif de nombreuses fonctions spécifiques aux pays comme:
- La tax espagnole TE et ISPF
- La taxe espagnole TE et ISPF
- Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
- La loi française Finance 2016 et logiciels de caisse
- La double taxe canadienne
@ -139,7 +139,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Extension
Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com).
Dolibarr peut aussi être étendu à volonté avec l'ajout de modules/applications externes développées par des développeurs tiers, disponible sur [DoliStore](https://www.dolistore.com).
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
@ -168,15 +168,15 @@ Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/CO
## ACTUALITES ET RESEAUX SOCIAUX
Suivez le projet Dolibarr project sur les réseaux francophones
Suivez le projet Dolibarr sur les réseaux francophones
- [Facebook](https://www.facebook.com/dolibarr.fr)
- [Twitter](https://www.twitter.com/dolibarr_france)
- [X](https://www.twitter.com/dolibarr_france)
ou sur les réseaux anglophones
- [Facebook](https://www.facebook.com/dolibarr)
- [Twitter](https://www.twitter.com/dolibarr)
- [X](https://www.twitter.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)

View file

@ -98,7 +98,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
Product Management
- Products and/or Services catalog
- Products and/or Services catalogue
- Stock / Warehouse management + Inventory
- Barcodes
- Batches / Lots / Serials
@ -239,7 +239,7 @@ See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) fil
Follow Dolibarr project on:
- [Facebook](https://www.facebook.com/dolibarr)
- [Twitter](https://www.twitter.com/dolibarr)
- [X](https://x.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [Reddit](https://www.reddit.com/r/Dolibarr_ERP_CRM/)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)

View file

@ -20,9 +20,9 @@ We believe that the future of software is online SaaS. This means software are m
If you believe you've found a security bug in our service, we are happy to work with you to resolve the issue promptly and ensure you are fairly rewarded for your discovery.
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
Any type of denial-of-service attack is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: [https://www.dolibarr.org/download](https://www.dolibarr.org/download)) to get access on every side of application.
We recommend to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: [https://www.dolibarr.org/download](https://www.dolibarr.org/download)) to get access on every side of application.
### User Agent
@ -30,7 +30,7 @@ If you try to find bug on Dolibarr, we recommend to append to your user-agent he
### Account access
You can install the web application yourself on your own platform/server so you get full access to application and sources. Download the zip of the files to put into your own web server virtual host from [https://www.dolibarr.org/download](https://www.dolibarr.org/download)
You can install the web application yourself on your own platform/server so you get full access to application and sources. Download the zip of the files to put in your own web server virtual host from [https://www.dolibarr.org/download](https://www.dolibarr.org/download)
## Eligibility and Responsible Disclosure
@ -38,7 +38,7 @@ We are happy to thank everyone who submits valid reports which help us improve t
You must be the first reporter of the vulnerability (duplicate reports are closed).
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install software on your own platform.
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommend to install software on your own platform.
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
@ -48,27 +48,27 @@ 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 into "develop" branch or into last stable "vX.Y" released version. Reports on vulnerabilities already fixed (so already reported) into the develop branch will not be validated.
* $dolibarr_main_prod must be set to 1 into conf.php
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
* 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.
* $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 into backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default). CSRF attacks are accepted but
* 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.
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
* 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.
* The modules DebugBar and ModuleBuilder must NOT be enabled. (by default, these modules are not enabled. They are developer tools)
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
* Fail2ban rules for rate limit on the login page,password forgotten page, api calls and all public pages (/public/*) must be installed as recommendend into the section "About - Admin tools - Section Access limits and mitigation".
* Ability for a high-level user to edit web site pages in the CMS by including HTML or JavaScript is an expected feature. Vulnerabilities in the website module are validated only if HTML or JavaScript injection can be done by a non-allowed user.
* Fail2ban rules for rate limit on the login page, forgotten password page, API calls and all public pages (/public/*) must be installed as recommended in the section "About - Admin tools - Section Access limits and mitigation".
Scope is the web application (back office) and the APIs.
Scope is the web application (backoffice) and the APIs.
## Examples of vulnerabilities that are Qualified for reporting.
* Remote code execution (RCE)
* Local files access and manipulation (LFI, RFI, XXE, SSRF, XSPA)
* Code injections (JS, SQL, PHP). HTML are covered only for fields that are not description, notes or comments fields (where rich content is allowed on purpose).
* Cross-Site Scripting (XSS), except from setup page of module "External web site" (allowing any content here, editable by admin user only, is accepted on purpose) and except into module "Web site" when permission to edit website content is allowed (injecting any data in this case is allowed too).
* Cross-Site Scripting (XSS), except from setup page of module "External web site" (allowing any content here, editable by admin user only, is accepted on purpose) and except in the module "Web site" when permission to edit website content is allowed (injecting any data in this case is allowed too).
* Cross-Site Requests Forgery (CSRF) with real security impact (when using GET URLs, CSRF are qualified only for creating, updating or deleting data from pages restricted to admin users)
* Open redirect
* Broken authentication & session management
@ -76,8 +76,8 @@ Scope is the web application (back office) and the APIs.
* Cross-Origin Resource Sharing (CORS) with real security impact
* Horizontal and vertical privilege escalation
* "HTTP Host Header" XSS
* Software version disclosure (for non admin users only)
* Stack traces or path disclosure (for non admin users only)
* Software version disclosure (for non-admin users only)
* Stack traces or path disclosure (for non-admin users only)
## Examples of vulnerabilities that are Non-qualified for reporting.
@ -95,5 +95,5 @@ Scope is the web application (back office) and the APIs.
* Reports on features flagged as "experimental" or "development"
* Software version or private IP disclosure when logged-in user is admin
* Stack traces or path disclosure when logged-in user is admin
* Any vulnerabilities due to a configuration different than the one defined into chapter "Scope for qualified vulnerabilities".
* Any vulnerabilities due to a configuration different than the one defined in chapter "Scope for qualified vulnerabilities".
* Brute force attacks on login page, password forgotten page or any public pages (/public/*) are not qualified if the fail2ban recommended fail2ban rules were not installed.

View file

@ -1,7 +1,7 @@
# How to use it ?
The docker-compose.yml file is a sample of a config file to use to build and run Dolibarr in the current workspace with Docker.
This docker image is intended for developpement usage.
This docker image is intended for development usage.
For production usage you should consider other contributor reference like https://hub.docker.com/r/tuxgasy/dolibarr
Before build/run, define the variable HOST_USER_ID as following:

View file

@ -0,0 +1,109 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2023 Nick Fragoulis
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/supplierinvoice_rec_extrafields.php
* \ingroup fourn
* \brief Page to setup extra fields of recurring supplierinvoice
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
if (!$user->admin) {
accessforbidden();
}
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label = ExtraFields::$type2label;
$type2label = array('');
foreach ($tmptype2label as $key => $val) {
$type2label[$key] = $langs->transnoentitiesnoconv($val);
}
$action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'facture_fourn_rec'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) {
accessforbidden();
}
/*
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
/*
* View
*/
$textobject = $langs->transnoentitiesnoconv("BillsSuppliers");
llxHeader('', $langs->trans("SuppliersSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
print "<br>\n";
$head = supplierorder_admin_prepare_head();
print dol_get_fiche_head($head, 'attributesrec', $langs->trans("Suppliers"), -1, 'company');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
print dol_get_fiche_end();
// Creation of an optional field
if ($action == 'create') {
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
// Edition of an optional field
if ($action == 'edit' && !empty($attrname)) {
print "<br>";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View file

@ -0,0 +1,111 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2023 Nick Fragoulis
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/supplierinvoicedet_rec_extrafields.php
* \ingroup fourn
* \brief Page to setup extra fields of recurring supplierinvoice line
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!$user->admin) {
accessforbidden();
}
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'bills', 'orders', 'suppliers'));
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label = ExtraFields::$type2label;
$type2label = array('');
foreach ($tmptype2label as $key => $val) {
$type2label[$key] = $langs->transnoentitiesnoconv($val);
}
$action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'facture_fourn_det_rec'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) {
accessforbidden();
}
/*
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
/*
* View
*/
$textobject = $langs->transnoentitiesnoconv("BillsSuppliers");
llxHeader('', $langs->trans("SuppliersSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
print "<br>\n";
$head = supplierorder_admin_prepare_head();
print dol_get_fiche_head($head, 'attributeslinesrec', $langs->trans("Suppliers"), -1, 'company');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
print dol_get_fiche_end();
// Creation of an optional field
if ($action == 'create') {
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
// Edition of an optional field
if ($action == 'edit' && !empty($attrname)) {
print "<br>";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View file

@ -42,6 +42,14 @@ if ($user->socid) {
$result = restrictedArea($user, 'banque', '', '');
$search_ref = GETPOST('search_ref', 'alpha');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_account = GETPOST('search_account', 'int');
$search_amount = GETPOST('search_amount', 'alpha');
$mode = GETPOST('mode', 'alpha');
@ -63,8 +71,6 @@ if (!$sortfield) {
$sortfield = "bc.date_bordereau";
}
$year = GETPOST("year");
$month = GETPOST("month");
$optioncss = GETPOST('optioncss', 'alpha');
$view = GETPOST("view", 'alpha');
@ -83,18 +89,48 @@ foreach ($arrayofpaymentmodetomanage as $key => $val) {
$arrayoflabels[$key] = $labelval;
}
$arrayfields = array(
'bc.ref' => array('label'=>"Ref", 'checked'=>1, 'position'=>10),
'bc.type' => array('label'=>"Type", 'checked'=>1, 'position'=>20),
'bc.date_bordereau' => array('label'=>"DateCreation", 'checked'=>1, 'position'=>30),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>40),
'bc.nbcheque' => array('label'=>"NbOfCheques", 'checked'=>1, 'position'=>50),
'bc.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>60),
'bc.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>70)
);
$arrayfields = dol_sort_array($arrayfields, 'position');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('chequelist'));
$object = new RemiseCheque($db);
/*
* Actions
*/
// If click on purge search criteria ?
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_ref = '';
$search_amount = '';
$search_account = '';
$year = '';
$month = '';
$parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// All tests are required to be compatible with all browsers
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
$search_ref = '';
$search_amount = '';
$search_account = '';
$search_date_startday = '';
$search_date_startmonth = '';
$search_date_startyear = '';
$search_date_endday = '';
$search_date_endmonth = '';
$search_date_endyear = '';
$search_date_start = '';
$search_date_end = '';
}
}
@ -103,12 +139,19 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
* View
*/
$form = new Form($db);
llxHeader('', $langs->trans("ChequeDeposits"));
$sql = "SELECT bc.rowid, bc.ref, bc.date_bordereau,";
$sql .= " bc.nbcheque, bc.amount, bc.statut, bc.type,";
$sql .= " ba.rowid as bid, ba.label";
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sqlfields = $sql; // $sql fields to remove for count total
$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc,";
@ -126,7 +169,17 @@ if ($search_account > 0) {
if ($search_amount) {
$sql .= natural_search("bc.amount", price2num($search_amount));
}
$sql .= dolSqlDateFilter('bc.date_bordereau', 0, $month, $year);
if ($search_date_start) {
$sql .= " AND bc.date_bordereau >= '" . $db->idate($search_date_start) . "'";
}
if ($search_date_end) {
$sql .= " AND bc.date_bordereau <= '" . $db->idate($search_date_end) . "'";
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
// Count total nb of records
$nbtotalofrecords = '';
@ -149,6 +202,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$db->free($resql);
}
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);
if ($limit) {
$sql .= $db->plimit($limit + 1, $offset);
@ -166,9 +220,33 @@ if ($resql) {
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.$contextpage;
}
if ($search_date_startday) {
$param .= '&search_date_startday='.urlencode($search_date_startday);
}
if ($search_date_startmonth) {
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
}
if ($search_date_startyear) {
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
}
if ($search_date_endday) {
$param .= '&search_date_endday='.urlencode($search_date_endday);
}
if ($search_date_endmonth) {
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
}
if ($search_date_endyear) {
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.$limit;
}
if ($search_amount != '') {
$param .= '&search_amount='.urlencode($search_amount);
}
if ($search_account > 0) {
$param .= '&search_account='.urlencode($search_account);
}
$url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new';
if (!empty($socid)) {
@ -195,54 +273,157 @@ if ($resql) {
print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
$moreforfilter = '';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
$massactionbutton = '';
if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
}
$moreforfilter = '';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input class="flat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
print '</td>';
// Type
print '<td class="liste_titre">';
print '</td>';
print '<td class="liste_titre center">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch actioncolumn">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
}
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 5);
print '</td>';
print '<td class="liste_titre">';
$form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">';
print '<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.'">';
print '</td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre maxwidthsearch">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print '</td>';
// Filter: Ref
if (!empty($arrayfields['bc.ref']['checked'])) {
print '<td class="liste_titre">';
print '<input class="flat" type="text" size="4" name="search_ref" value="' . $search_ref . '">';
print '</td>';
}
// Filter: Type
if (!empty($arrayfields['bc.type']['checked'])) {
print '<td class="liste_titre">';
print '</td>';
}
// Filter: Date
if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
print '</td>';
}
// Filter: Bank account
if (!empty($arrayfields['ba.label']['checked'])) {
print '<td class="liste_titre">';
$form->select_comptes($search_account, 'search_account', 0, '', 1);
print '</td>';
}
// Filter: Number of cheques
if (!empty($arrayfields['bc.nbcheque']['checked'])) {
print '<td class="liste_titre">&nbsp;</td>';
}
// Filter: Amount
if (!empty($arrayfields['bc.amount']['checked'])) {
print '<td class="liste_titre right">';
print '<input class="flat maxwidth50" type="text" name="search_amount" value="' . $search_amount . '">';
print '</td>';
}
// Filter: Status (only placeholder)
if (!empty($arrayfields['bc.statut']['checked'])) {
print '<td class="liste_titre"></td>';
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch actioncolumn">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
print "</tr>\n";
$totalarray = array();
$totalarray['nbfield'] = 0;
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "bc.ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "bc.type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "bc.date_bordereau", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("NbOfCheques", $_SERVER["PHP_SELF"], "bc.nbcheque", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "bc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "bc.statut", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('');
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.ref']['checked'])) {
print_liste_field_titre($arrayfields['bc.ref']['label'], $_SERVER["PHP_SELF"], "bc.ref", "", $param, "", $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.type']['checked'])) {
print_liste_field_titre($arrayfields['bc.type']['label'], $_SERVER["PHP_SELF"], "bc.type", "", $param, "", $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
print_liste_field_titre($arrayfields['bc.date_bordereau']['label'], $_SERVER["PHP_SELF"], "bc.date_bordereau", "", $param, 'align="center"', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['ba.label']['checked'])) {
print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.nbcheque']['checked'])) {
print_liste_field_titre($arrayfields['bc.nbcheque']['label'], $_SERVER["PHP_SELF"], "bc.nbcheque", "", $param, 'class="right"', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.amount']['checked'])) {
print_liste_field_titre($arrayfields['bc.amount']['label'], $_SERVER["PHP_SELF"], "bc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['bc.statut']['checked'])) {
print_liste_field_titre($arrayfields['bc.statut']['label'], $_SERVER["PHP_SELF"], "bc.statut", "", $param, 'class="right"', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
$totalarray['nbfield']++;
}
print "</tr>\n";
$checkedCount = 0;
foreach ($arrayfields as $column) {
if ($column['checked']) {
$checkedCount++;
}
}
if ($num > 0) {
$savnbfield = 8;
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$objp = $db->fetch_object($resql);
@ -273,48 +454,111 @@ if ($resql) {
} else {
print '<tr class="oddeven">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center"></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Num ref cheque
print '<td>';
print $checkdepositstatic->getNomUrl(1);
print '</td>';
if (!empty($arrayfields['bc.ref']['checked'])) {
print '<td>';
print $checkdepositstatic->getNomUrl(1);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Type
$labelpaymentmode = ($langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) != "PaymentType".$checkdepositstatic->type ? $langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) : $checkdepositstatic->type);
print '<td>'.dol_escape_htmltag($labelpaymentmode).'</td>';
if (!empty($arrayfields['bc.type']['checked'])) {
$labelpaymentmode = ($langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) != "PaymentType".$checkdepositstatic->type ? $langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) : $checkdepositstatic->type);
print '<td>'.dol_escape_htmltag($labelpaymentmode).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Date
print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'dayhour', 'tzuser').'</td>';
if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'dayhour', 'tzuser').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Bank
print '<td>';
if ($objp->bid) {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.$objp->label.'</a>';
} else {
print '&nbsp;';
if (!empty($arrayfields['ba.label']['checked'])) {
print '<td>';
if ($objp->bid) {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.$objp->label.'</a>';
} else {
print '&nbsp;';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
print '</td>';
// Number of cheques
print '<td class="right">'.$objp->nbcheque.'</td>';
if (!empty($arrayfields['bc.nbcheque']['checked'])) {
print '<td class="right">'.$objp->nbcheque.'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Amount
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
if (!empty($arrayfields['bc.amount']['checked'])) {
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
if (!$i) {
$totalarray['nbfield']++;
}
if (empty($totalarray['val']['amount'])) {
$totalarray['val']['amount'] = $objp->amount;
} else {
$totalarray['val']['amount'] += $objp->amount;
}
}
// Statut
print '<td class="right">';
print $checkdepositstatic->LibStatut($objp->statut, 5);
print '</td>';
// Status
if (!empty($arrayfields['bc.statut']['checked'])) {
print '<td class="right">';
print $checkdepositstatic->LibStatut($objp->statut, 5);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
print '<td></td>';
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center"></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
print "</tr>\n";
}
$i++;
}
} else {
print '<tr class="oddeven">';
print '<td colspan="7" class="opacitymedium">'.$langs->trans("None")."</td>";
print '</tr>';
// If no record found
if ($num == 0) {
$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}
print '<tr class="oddeven">';
print '<td colspan="' . $colspan . '" class="opacitymedium">' . $langs->trans("NoRecordFound") . "</td>";
print '</tr>';
}
}
print "</table>";
print "</div>";

View file

@ -5,7 +5,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
@ -368,7 +368,7 @@ if ($search_all) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
$massactionbutton = '';
if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
@ -378,10 +378,19 @@ $moreforfilter = '';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch actioncolumn">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
}
// Filters: Lines (placeholder)
print '<tr class="liste_titre_filter">';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
print '<td class="liste_titre">';
print '</td>';
@ -458,13 +467,22 @@ $parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td class="liste_titre maxwidthsearch">';
print $form->showFilterAndCheckAddButtons(0);
print '</td>';
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="liste_titre center maxwidthsearch actioncolumn">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
print "</tr>";
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
}
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
print_liste_field_titre('#', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder);
}
@ -501,7 +519,10 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
}
print "</tr>";
$checkedCount = 0;
@ -526,6 +547,14 @@ while ($i < min($num, $limit)) {
print '<tr class="oddeven">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center"></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// No
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
print '<td>'.(($offset * $limit) + $i).'</td>';
@ -644,10 +673,12 @@ while ($i < min($num, $limit)) {
}
}
// Buttons
print '<td></td>';
if (!$i) {
$totalarray['nbfield']++;
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="nowrap center"></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
print '</tr>';

View file

@ -748,14 +748,14 @@ if ($id > 0) {
print '</tr>';
}
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="right">'.price($totalpaid)."</td></tr>\n";
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AmountExpected").' :</td><td class="right">'.price($object->amount)."</td></tr>\n";
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="right nowraponall">'.price($totalpaid)."</td></tr>\n";
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("AmountExpected").' :</td><td class="right nowraponall">'.price($object->amount)."</td></tr>\n";
$resteapayer = $object->amount - $totalpaid;
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("RemainderToPay")." :</td>";
print '<td class="right'.($resteapayer ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayer)."</td></tr>\n";
print '<td class="right nowraponall'.($resteapayer ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayer)."</td></tr>\n";
print "</table>";
print '</div>';

View file

@ -687,51 +687,30 @@ abstract class CommonInvoice extends CommonObject
*/
public function getSubtypeLabel($table = '')
{
$subtypeLabel = '';
if ($table === 'facture' || $table === 'facture_fourn') {
$sql = "SELECT s.label FROM " . MAIN_DB_PREFIX . $table . " AS f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'";
$resql = $this->db->query($sql);
if ($resql) {
$subtypeLabel = '';
while ($obj = $this->db->fetch_object($resql)) {
$subtypeLabel = $obj->label;
}
if (!empty($subtypeLabel)) {
return $subtypeLabel;
}
} else {
dol_print_error($this->db);
return -1;
}
} elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') {
$sql = "SELECT s.label FROM " . MAIN_DB_PREFIX . $table . " AS f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql .= " WHERE f.titre = '".$this->db->escape($this->titre)."'";
$resql = $this->db->query($sql);
if ($resql) {
$subtypeLabel = '';
while ($obj = $this->db->fetch_object($resql)) {
$subtypeLabel = $obj->label;
}
if (!empty($subtypeLabel)) {
return $subtypeLabel;
}
} else {
dol_print_error($this->db);
return -1;
}
} else {
return -1;
}
return '';
$resql = $this->db->query($sql);
if ($resql) {
while ($obj = $this->db->fetch_object($resql)) {
$subtypeLabel = $obj->label;
}
} else {
dol_print_error($this->db);
return -1;
}
return $subtypeLabel;
}
/**

View file

@ -260,6 +260,21 @@ abstract class CommonObject
*/
public $origin_id;
/**
* @var Object Origin object. This is set by fetch_origin() from this->origin and this->origin_id.
*/
public $origin_object;
// TODO Remove this. Has been replaced with ->origin_object.
// This is set by fetch_origin() from this->origin and this->origin_id
/** @deprecated */
public $expedition;
/** @deprecated */
public $livraison;
/** @deprecated */
public $commandeFournisseur;
/**
* @var string The object's reference
*/
@ -1870,7 +1885,9 @@ abstract class CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Read linked origin object
* Read linked origin object.
* Set ->origin_object
* Set also ->expedition or ->livraison or ->commandFournisseur (deprecated)
*
* @return void
*/
@ -1883,15 +1900,18 @@ abstract class CommonObject
if ($this->origin == 'delivery') {
$this->origin = 'livraison';
}
if ($this->origin == 'order_supplier') {
if ($this->origin == 'order_supplier' || $this->origin == 'supplier_order') {
$this->origin = 'commandeFournisseur';
}
$origin = $this->origin;
$classname = ucfirst($origin);
$this->$origin = new $classname($this->db);
$this->$origin->fetch($this->origin_id);
$this->origin_object = new $classname($this->db);
$this->origin_object->fetch($this->origin_id);
// TODO Remove this line
$this->$origin = $this->origin_object;
}
/**
@ -10430,7 +10450,7 @@ abstract class CommonObject
$project_result = $this->fetch_projet();
if ($project_result >= 0) {
$element = 'projet/'.dol_sanitizeFileName($object->project->ref).'/';
$element = 'projet/'.dol_sanitizeFileName($this->project->ref).'/';
}
default:
$element = $this->element;

View file

@ -87,6 +87,7 @@ class ExtraFields
'mail'=>'ExtrafieldMail',
'url'=>'ExtrafieldUrl',
'ip'=>'ExtrafieldIP',
'icon'=>'Icon',
'password' => 'ExtrafieldPassword',
'select' => 'ExtrafieldSelect',
'sellist' => 'ExtrafieldSelectList',
@ -225,7 +226,7 @@ class ExtraFields
} elseif ($type == 'phone') {
$typedb = 'varchar';
$lengthdb = '20';
} elseif ($type == 'mail' || $type == 'ip') {
} elseif ($type == 'mail' || $type == 'ip' || $type == 'icon') {
$typedb = 'varchar';
$lengthdb = '128';
} elseif ($type == 'url') {
@ -579,7 +580,7 @@ class ExtraFields
} elseif ($type == 'phone') {
$typedb = 'varchar';
$lengthdb = '20';
} elseif ($type == 'mail' || $type == 'ip') {
} elseif ($type == 'mail' || $type == 'ip' || $type == 'icon') {
$typedb = 'varchar';
$lengthdb = '128';
} elseif ($type == 'url') {
@ -1070,6 +1071,26 @@ class ExtraFields
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
} elseif (in_array($type, array('mail', 'ip', 'phone', 'url'))) {
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
} elseif ($type == 'icon') {
$out ='<link rel="stylesheet" href="'.dol_buildpath('/myfield/css/fontawesome-iconpicker.min.css', 1).'">';
$out.='<script src="'.dol_buildpath('/myfield/js/fontawesome-iconpicker.min.js', 1).'"></script>';
$out.= '<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.' maxwidthonsmartphone"';
$out.= ' name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
$out.='<script>';
$options="{ title: '<b>".$langs->trans("IconFieldSelector")."</b>', placement: 'right', showFooter: false, templates: {";
$options.="iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',";
$options.="iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',";
// $options.="buttons: '<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm\">".$langs->trans("Cancel")."</button>";
// $options.="<button style=\"background-color:#FFFFFF;\" class=\"iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm\">".$langs->trans("Save")."</button>',";
$options.="footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',";
$options.="search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans("TypeToFilter")."\" />',";
$options.="popover: '<div class=\"iconpicker-popover popover\">";
$options.=" <div class=\"arrow\" ></div>";
$options.=" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>";
$options.=" <div class=\"popover-content \" ></div>";
$options.="</div>'}}";
$out.="$('#".$keyprefix.$key.$keysuffix."').iconpicker(".$options.");";
$out.='</script>';
} elseif ($type == 'text') {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -1652,6 +1673,8 @@ class ExtraFields
$value = dol_print_email($value, 0, 0, 0, 64, 1, 1);
} elseif ($type == 'ip') {
$value = dol_print_ip($value, 0);
} elseif ($type == 'icon') {
$value = '<span class="'.$value.'"></span>';
} elseif ($type == 'url') {
$value = dol_print_url($value, '_blank', 32, 1);
} elseif ($type == 'phone') {
@ -1948,11 +1971,11 @@ class ExtraFields
$cssstring = '';
if (in_array($type, array('date', 'datetime', 'datetimegmt'))) {
if (in_array($type, array('date', 'datetime', 'datetimegmt',))) {
$cssstring = "center";
} elseif (in_array($type, array('int', 'price', 'double'))) {
$cssstring = "right";
} elseif (in_array($type, array('boolean', 'radio', 'checkbox', 'ip'))) {
} elseif (in_array($type, array('boolean', 'radio', 'checkbox', 'ip', 'icon'))) {
$cssstring = "center";
}

View file

@ -996,7 +996,7 @@ class FormOther
$file = $conf->$module->dir_temp.'/'.$name.'.png';
// On cree le repertoire contenant les icones
// We create temp directory
if (!file_exists($conf->$module->dir_temp)) {
dol_mkdir($conf->$module->dir_temp);
}

View file

@ -2882,7 +2882,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
//$original_file=$conf->barcode->dir_temp.'/'.$original_file;
$original_file = '';
} elseif ($modulepart == 'iconmailing' && !empty($conf->mailing->dir_temp)) {
// Wrapping pour les icones de background des mailings
// Wrapping for icon of background of mailings
$accessallowed = 1;
$original_file = $conf->mailing->dir_temp.'/'.$original_file;
} elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp)) {

View file

@ -4,6 +4,7 @@
* Copyright (C) 2006 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2022-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Nick Fragoulis
*
* 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
@ -258,6 +259,8 @@ function supplierorder_admin_prepare_head()
$extrafields->fetch_name_optionals_label('commande_fournisseurdet');
$extrafields->fetch_name_optionals_label('facture_fourn');
$extrafields->fetch_name_optionals_label('facture_fourn_det');
$extrafields->fetch_name_optionals_label('facture_fourn_rec');
$extrafields->fetch_name_optionals_label('facture_fourn_det_rec');
$h = 0;
$head = array();
@ -315,6 +318,24 @@ function supplierorder_admin_prepare_head()
$head[$h][2] = 'supplierinvoicedet';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_rec_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesRec");
$nbExtrafields = $extrafields->attributes['facture_fourn_rec']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributesrec';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_rec_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesLinesRec");
$nbExtrafields = $extrafields->attributes['facture_fourn_det_rec']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslinesrec';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'supplierorder_admin', 'remove');
return $head;

View file

@ -590,6 +590,8 @@ class pdf_strato extends ModelePDFContract
// phpcs:enable
global $conf, $langs, $hookmanager;
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, (is_object($outputlangsbis) ? $outputlangsbis : null));
$ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') {
$ltrdirection = 'R';

View file

@ -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 = 'experimental';
$this->version = 'dolibarr';
// Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';

View file

@ -1272,6 +1272,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetTextColor(0, 0, 0);
$resteapayer = 0;
/*
$resteapayer = $object->total_ttc - $deja_regle;
if (!empty($object->paye)) $resteapayer=0;
@ -1287,8 +1288,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
/*
if ($object->close_code == 'discount_vat')
{
if ($object->close_code == 'discount_vat') {
$index++;
$pdf->SetFillColor(255,255,255);

View file

@ -143,6 +143,22 @@ abstract class DolibarrTriggers
}
}
/**
* setErrorsFromObject
*
* @param CommonObject $object commonobject
* @return void
*/
public function setErrorsFromObject($object)
{
if (!empty($object->error)) {
$this->errors = array_merge($this->errors, array($object->error));
}
if (!empty($object->errors)) {
$this->errors = array_merge($this->errors, $object->errors);
}
}
/**
* Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)

View file

@ -534,7 +534,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
$fichinter = new Fichinter($this->db);
$fichinter->socid = (int) $object->fk_soc;
$fichinter->fk_project = $projectid;
$fichinter->fk_project = (int) $object->fk_project;
$fichinter->fk_contrat = (int) $object->fk_contract;
$fichinter->author = $user->id;
$fichinter->model_pdf = (!empty($conf->global->FICHEINTER_ADDON_PDF)) ? $conf->global->FICHEINTER_ADDON_PDF : 'soleil';

View file

@ -205,7 +205,7 @@ class ActionsDatapolicy extends CommonHookActions
/* print_r($parameters); print_r($object); echo "action: " . $action; */
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
$this->resprints = '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>'.$langs->trans("datapolicyMassAction").'</option>';
$this->resprints = '<option value="0"'.(!empty($disabled) ? ' disabled="disabled"' : '').'>'.$langs->trans("datapolicyMassAction").'</option>';
}
if (!$error) {

View file

@ -1,6 +1,6 @@
EMailCollector
==============
This module provides a sheduled job that scan regularly one or several IMAP email boxes, with filtering rules, to automatically record data in your application, like
This module provides a scheduled job that scan regularly one or several IMAP email boxes, with filtering rules, to automatically record data in your application, like
* recording the email in the history of events (event is automatically linked to its related objects if possible, for example when a customer reply to an email sent from the application, the answer is automatically linked to the good objects)
* and/or creating a lead

View file

@ -1755,7 +1755,8 @@ if ($action == 'create') {
$typeobject = $object->origin;
$origin = $object->origin;
$origin_id = $object->origin_id;
$object->fetch_origin(); // Load property $object->commande, $object->propal, ...
$object->fetch_origin(); // Load property $object->origin_object (old $object->commande, $object->propal, ...)
}
$soc = new Societe($db);
@ -1768,7 +1769,7 @@ if ($action == 'create') {
$formconfirm = '';
// Confirm deleteion
// Confirm deletion
if ($action == 'delete') {
$formquestion = array();
if ($object->statut == Expedition::STATUS_CLOSED && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {

View file

@ -125,7 +125,10 @@ function addDispatchLine(index, type, mode) {
//create new select2 to avoid duplicate id of cloned one
$row.find("select[name='" + 'entrepot_' + nbrTrs + '_' + index + "']").select2();
// TODO find solution to copy selected option to new select
// Copy selected option to new select
let $prevRow = $("tr[name^='" + type + "_'][name$='_" + index + "']:last")
let $prevEntr = Number($prevRow.find("select[name='" + 'entrepot_' + (nbrTrs-1) + '_' + index + "']").val())
$row.find("select[name='" + 'entrepot_' + nbrTrs + '_' + index + "']").val($prevEntr)
// TODO find solution to keep new tr's after page refresh
//clear value
$row.find("input[name^='qty']").val('');

View file

@ -1103,6 +1103,36 @@ class Job extends CommonObject
$return .= '</div>';
return $return;
}
/**
* function for get required skills associate to job object
* @param int $id Id of object
* @return array|int list of ids skillranks
*/
public function getSkillRankForJob($id)
{
if (empty($id)) {
return -1;
}
$skillranks = array();
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."hrm_skillrank";
$sql .= " WHERE fk_object = ".((int) $id);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$skillranks[] = $obj;
$i++;
}
$this->db->free($resql);
} else {
dol_print_error($this->db);
}
return $skillranks;
}
}

View file

@ -234,9 +234,10 @@ class SkillRank extends CommonObject
*
* @param User $user User that creates
* @param int $fromid Id of object to clone
* @param int $fk_object id of Job object (if new job object)
* @return mixed New object created, <0 if KO
*/
public function createFromClone(User $user, $fromid)
public function createFromClone(User $user, $fromid, $fk_object = 0)
{
global $langs, $extrafields;
$error = 0;
@ -261,6 +262,10 @@ class SkillRank extends CommonObject
unset($object->id);
unset($object->fk_user_creat);
unset($object->import_key);
if (!empty($fk_object) && $fk_object > 0) {
unset($object->fk_object);
}
// Clear fields
if (property_exists($object, 'ref')) {
@ -278,6 +283,11 @@ class SkillRank extends CommonObject
if (property_exists($object, 'date_modification')) {
$object->date_modification = null;
}
if (!empty($fk_object) && $fk_object > 0) {
if (property_exists($object, 'fk_object')) {
$object->fk_object = ($fk_object = 0 ? $this->fk_object : $fk_object);
}
}
// ...
// Clear extrafields that are unique
if (is_array($object->array_options) && count($object->array_options) > 0) {

View file

@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
// Load translation files required by the page
$langs->loadLangs(array('hrm', 'other', 'products')); // why products?
@ -120,7 +121,9 @@ if (empty($reshook)) {
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
if ($action != 'confirm_clone') {
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
}
// Actions when linking object each other
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
@ -146,6 +149,56 @@ if (empty($reshook)) {
$autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO';
$trackid = 'job' . $object->id;
include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
if ($action == 'confirm_clone' && $confirm != 'yes') {
$action = '';
}
if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->hasRight('salaries', 'write'))) {
$db->begin();
$originalId = $id;
$object->fetch($id);
$skillRequire = $object->getSkillRankForJob($originalId);
if ($object->id > 0) {
$object->id = $object->ref = null;
if (GETPOST('clone_label', 'alphanohtml')) {
$object->label = GETPOST('clone_label', 'alphanohtml');
} else {
$object->label = $langs->trans("CopyOf").' '.$object->label;
}
if (GETPOST('clone_skills_required')) {
$cloneSkillRequired = GETPOST('clone_skills_required');
}
$id = $object->create($user);
if ($id > 0) {
if (!empty($cloneSkillRequired)) {
$i = 0;
while ($i < count($skillRequire)) {
$skillrank = new SkillRank($db);
$skillrank->createFromClone($user, $skillRequire[$i]->rowid, $id);
$i++;
}
}
$db->commit();
$db->close();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
} else {
$id = $originalId;
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
$db->rollback();
dol_print_error($db, $object->error);
}
}
}
@ -275,8 +328,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Clone confirmation
if ($action == 'clone') {
// Create an array for form
$formquestion = array();
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
$formquestion = array(
array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label),
array('type' => 'checkbox', 'name' => 'clone_skills_required', 'label' => $langs->trans("RequiredSkills"), 'value' => '',),
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->label), 'confirm_clone', $formquestion, 'yes', 1, 280);
}
// Confirmation of action xxxx
@ -413,6 +470,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
}

View file

@ -193,6 +193,7 @@ function displayPositionCard(&$object)
global $user, $langs, $db, $conf, $extrafields, $hookmanager, $action, $permissiontoadd, $permissiontodelete;
$id = $object->id;
$ref = $object->ref;
/*
* View

View file

@ -191,3 +191,10 @@ CREATE TABLE llx_mrp_production_extrafields
) ENGINE=innodb;
ALTER TABLE llx_mrp_production_extrafields ADD INDEX idx_mrp_production_fk_object(fk_object);
ALTER TABLE llx_salary ADD COLUMN ref_ext varchar(255);
ALTER TABLE llx_salary ADD COLUMN note_public text;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN element_type varchar(50) DEFAULT 'supplier_order' NOT NULL;
ALTER TABLE llx_expensereport DROP INDEX idx_expensereport_fk_refuse, ADD INDEX idx_expensereport_fk_refuse(fk_user_refuse);

View file

@ -14,21 +14,23 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- This table is just an history table to track all receiving done for a
-- This table is just an history table to track all receiption to do or done for a
-- particular supplier order. A movement with same information is also done
-- into stock_movement so this table may be useless.
--
-- Detail of each lines of a reception (qty, batch and into which warehouse must be
-- received or has been receveived a purchase order line).
-- This table should have been named llx_receptiondet_batch
--
-- This table should be renamed into llx_receptiondet_batch
-- ===================================================================
create table llx_commande_fournisseur_dispatch
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product integer,
fk_commande integer,
fk_commandefourndet integer,
fk_commande integer, -- should be renamed into fk_element
fk_commandefourndet integer, -- should be renamed into fk_elementdet
element_type varchar(50) DEFAULT 'supplier_order' NOT NULL, -- Type of source ('supplier_order', ...)
fk_projet integer DEFAULT NULL,
fk_reception integer DEFAULT NULL,
qty float, -- qty to move

View file

@ -17,6 +17,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- Note: a shipment is linked to an order or other object using llx_element_element table.
-- ===================================================================
create table llx_expedition
@ -31,11 +32,11 @@ create table llx_expedition
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
ref_customer varchar(255), -- customer number
date_creation datetime, -- date de creation
date_creation datetime, -- date of creation
fk_user_author integer, -- author of creation
fk_user_modif integer, -- author of last change
date_valid datetime, -- date de validation
fk_user_valid integer, -- valideur
date_valid datetime, -- date of validation
fk_user_valid integer, -- user that validate
date_delivery datetime DEFAULT NULL, -- date planned of delivery
date_expedition datetime, -- not used (deprecated)
fk_address integer DEFAULT NULL, -- delivery address (deprecated)

View file

@ -27,7 +27,7 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_statut (fk_statut);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_author (fk_user_author);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_valid (fk_user_valid);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_refuse);
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
--ALTER TABLE llx_expensereport ADD CONSTRAINT fk_expensereport_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);

View file

@ -17,6 +17,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- Note: a reception is linked to a supplier order or other object using llx_element_element table.
-- ===================================================================
create table llx_reception
@ -29,7 +30,7 @@ create table llx_reception
fk_projet integer DEFAULT NULL,
ref_ext varchar(30), -- reference into an external system (not used by dolibarr)
ref_supplier varchar(255), -- supplier number
ref_supplier varchar(255), -- reference of reception on supplier side
date_creation datetime, -- date de creation
fk_user_author integer, -- author of creation

View file

@ -1,6 +1,7 @@
-- ===================================================================
-- Copyright (C) 2011-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2011-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
-- Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
--
-- 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
@ -14,13 +15,13 @@
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ===================================================================
create table llx_salary
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NULL, -- payment reference number (currently NULL because there is no numbering manager yet)
ref_ext varchar(255), -- reference into an external system (not used by dolibarr)
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- Create date
fk_user integer NOT NULL,
@ -29,13 +30,14 @@ create table llx_salary
salary double(24,8), -- salary of user when payment was done
amount double(24,8) NOT NULL DEFAULT 0,
fk_projet integer DEFAULT NULL,
fk_typepayment integer NOT NULL,
num_payment varchar(50), -- num cheque or other
fk_typepayment integer NOT NULL, -- default expected payment
num_payment varchar(50), -- num cheque or other (deprecated, now stored into the payment)
label varchar(255),
datesp date, -- date start period
dateep date, -- date end period
entity integer DEFAULT 1 NOT NULL, -- multi company id
note text,
note_public text,
fk_bank integer,
paye smallint default 0 NOT NULL,
fk_account integer,

View file

@ -2427,3 +2427,5 @@ LargeModern=Large - Modern
SpecialCharActivation=Enable the button to open a virtual keyboard to enter special characters
DeleteExtrafield=Delete extrafield
ConfirmDeleteExtrafield=Confirm delete %s extrafield ? All data is going to be lost
ExtraFieldsSupplierInvoicesRec=Complementary attributes (templates invoices)
ExtraFieldsSupplierInvoicesLinesRec=Complementary attributes (invoice lines)

View file

@ -17,7 +17,7 @@ Translations can be completed manually by editing files into directories *langs*
<!--
This module contains also a sample configuration for Transifex, under the hidden directory [.tx](.tx), so it is possible to manage translation using this service.
For more informations, see the [translator's documentation](https://wiki.dolibarr.org/index.php/Translator_documentation).
For more information, see the [translator's documentation](https://wiki.dolibarr.org/index.php/Translator_documentation).
There is a [Transifex project](https://transifex.com/projects/p/dolibarr-module-template) for this module.
-->

View file

@ -158,6 +158,33 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
// Definition of fields for list
$arrayfields = array();
$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
if (! empty($allprojectforuser)) {
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
}
$arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1);
$arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1);
}
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 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);
}
$arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1);
$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries"));
$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
$arrayfields = dol_sort_array($arrayfields, 'position');
$parameters = array('socid' => $socid, 'projectid' => $projectid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@ -1264,31 +1291,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Print form confirm
print $formconfirm;
// Definition of fields for list
$arrayfields = array();
$arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1);
$arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1);
$arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1');
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
if (! empty($allprojectforuser)) {
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
}
$arrayfields['t.element_ref'] = array('label'=>$langs->trans("RefTask"), 'checked'=>1);
$arrayfields['t.element_label'] = array('label'=>$langs->trans("LabelTask"), 'checked'=>1);
}
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 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);
}
$arrayfields['t.element_duration'] = array('label'=>$langs->trans("Duration"), 'checked'=>1);
$arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries"));
$arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
$arrayfields = dol_sort_array($arrayfields, 'position');
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {

View file

@ -122,6 +122,7 @@ if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$typeobject = '';
if (!empty($object->origin)) {
$origin = $object->origin;
@ -129,11 +130,10 @@ if ($id > 0 || !empty($ref)) {
$typeobject = $object->origin;
}
// Linked documents
if ($origin == 'order_supplier' && $object->$typeobject->id && isModEnabled("supplier_order")) {
$origin_id = $object->$typeobject->id;
$objectsrc = new CommandeFournisseur($db);
$objectsrc->fetch($object->$typeobject->id);
// Set $origin_id and $objectsrc
if (($origin == 'order_supplier' || $origin == 'supplier_order') && is_object($object->origin_object) && isModEnabled("supplier_order")) {
$origin_id = $object->origin_object->id;
$objectsrc = $object->origin_object;
}
}

View file

@ -191,7 +191,7 @@ if ($action == 'create') {
print '</form>';
dol_set_focus('input[name="label"]');
dol_set_focus('input[name="ref"]');
} elseif (($id || $ref) && $action == 'edit') {
// Part to edit record
print load_fiche_titre($langs->trans("ProductAttribute"), '', 'object_' . $object->picto);

View file

@ -100,7 +100,7 @@ class ProductAttribute extends CommonObject
*/
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(255)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''),
'ref' => array('type'=>'varchar(255)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'width200'),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'ExternalRef', 'enabled' => 1, 'visible' => 0, 'position' => 20, 'searchall'=>1),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"", 'showoncombobox'=>'1',),
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>40, 'notnull'=>1,),

View file

@ -576,7 +576,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase
$result=GETPOST("param15", 'restricthtml'); // param15 = <img onerror<=alert(document.domain)> src=>0xbeefed that is a dangerous string
print __METHOD__." result=".$result."\n";
$this->assertEquals('InvalidHTMLStringCantBeCleaned', $result, 'Test 15b'); // With some PHP and libxml version, we got this result when parsing invalid HTML, but ...
// $this->assertEquals('InvalidHTMLStringCantBeCleaned', $result, 'Test 15b'); // With some PHP and libxml version, we got this result when parsing invalid HTML, but ...
//$this->assertEquals('<img onerror> src=&gt;0xbeefed', $result, 'Test 15b'); // ... on other PHP and libxml versions, we got a HTML that has been cleaned
@ -641,7 +641,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase
$_POST["pagecontentwithlinks"]='<img src="aaa"><img src="bbb"><img src="ccc"><span style="background: url(/ddd)"></span>';
$result=GETPOST("pagecontentwithlinks", 'restricthtml');
print __METHOD__." result=".$result."\n";
$this->assertEquals('TooManyLinksIntoHTMLString', $result, 'Test on limit on GETPOST fails');
$this->assertEquals('ErrorTooManyLinksIntoHTMLString', $result, 'Test on limit on GETPOST fails');
// Test that img src="data:..." is excluded from the count of external links
$conf->global->MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT = 3;
$_POST["pagecontentwithlinks"]='<img src="data:abc"><img src="bbb"><img src="ccc"><span style="background: url(/ddd)"></span>';
$result=GETPOST("pagecontentwithlinks", 'restricthtml');
print __METHOD__." result=".$result."\n";
$this->assertEquals('<img src="data:abc"><img src="bbb"><img src="ccc"><span style="background: url(/ddd)"></span>', $result, 'Test on limit on GETPOST fails');
// Test that no links is allowed
$conf->global->MAIN_DISALLOW_URL_INTO_DESCRIPTIONS = 1;
$_POST["pagecontentwithlinks"]='<img src="data:abc"><img src="bbb"><img src="ccc"><span style="background: url(/ddd)"></span>';
$result=GETPOST("pagecontentwithlinks", 'restricthtml');
print __METHOD__." result=".$result."\n";
$this->assertEquals('ErrorHTMLLinksNotAllowed', $result, 'Test on limit on GETPOST fails');
return $result;
}