Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
e36d2b5398
16
README-FR.md
16
README-FR.md
@ -8,12 +8,10 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## LICENCE
|
## LICENCE
|
||||||
|
|
||||||
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
|
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
|
||||||
|
|
||||||
|
|
||||||
## INSTALLER DOLIBARR
|
## INSTALLER DOLIBARR
|
||||||
|
|
||||||
### Configuration simple
|
### Configuration simple
|
||||||
@ -54,7 +52,6 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg
|
|||||||
|
|
||||||
- Suivez les instructions de l'installateur
|
- Suivez les instructions de l'installateur
|
||||||
|
|
||||||
|
|
||||||
## METTRE A JOUR DOLIBARR
|
## METTRE A JOUR DOLIBARR
|
||||||
|
|
||||||
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||||
@ -65,14 +62,12 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
|||||||
- Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire).
|
- Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire).
|
||||||
Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
|
||||||
|
|
||||||
*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
Note: *Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||||
|
|
||||||
|
|
||||||
## CE QUI EST NOUVEAU
|
## CE QUI EST NOUVEAU
|
||||||
|
|
||||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||||
|
|
||||||
|
|
||||||
## CE QUE DOLIBARR PEUT FAIRE
|
## CE QUE DOLIBARR PEUT FAIRE
|
||||||
|
|
||||||
### Modules principaux (tous optionnels)
|
### Modules principaux (tous optionnels)
|
||||||
@ -122,7 +117,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Peux être multi-société par ajout du module externe multi-société.
|
- Peux être multi-société par ajout du module externe multi-société.
|
||||||
- Plusieurs thèmes visuels.
|
- Plusieurs thèmes visuels.
|
||||||
- Application simple à utiliser.
|
- Application simple à utiliser.
|
||||||
- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis).
|
- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur [https://wiki.dolibarr.org/index.php/Prérequis](https://wiki.dolibarr.org/index.php/Prérequis)).
|
||||||
- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP.
|
- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP.
|
||||||
- APIs.
|
- APIs.
|
||||||
- Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
- Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
|
||||||
@ -142,7 +137,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
|
|
||||||
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 module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com).
|
||||||
|
|
||||||
|
|
||||||
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
||||||
|
|
||||||
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
||||||
@ -152,18 +146,15 @@ Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
|||||||
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
||||||
- Dolibarr ne fait pas le café (pas encore).
|
- Dolibarr ne fait pas le café (pas encore).
|
||||||
|
|
||||||
|
|
||||||
## DOCUMENTATION
|
## DOCUMENTATION
|
||||||
|
|
||||||
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
|
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
|
||||||
## CONTRIBUER
|
## CONTRIBUER
|
||||||
|
|
||||||
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
|
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
|
||||||
|
|
||||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
[](https://github.com/Dolibarr/dolibarr/graphs/contributors)
|
||||||
|
|
||||||
|
|
||||||
## CREDITS
|
## CREDITS
|
||||||
|
|
||||||
@ -171,7 +162,6 @@ Dolibarr est le résultat du travail de nombreux contributeurs depuis des année
|
|||||||
|
|
||||||
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
|
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
|
||||||
|
|
||||||
|
|
||||||
## ACTUALITES ET RESEAUX SOCIAUX
|
## ACTUALITES ET RESEAUX SOCIAUX
|
||||||
|
|
||||||
Suivez le projet Dolibarr project sur les réseaux francophones
|
Suivez le projet Dolibarr project sur les réseaux francophones
|
||||||
|
|||||||
29
README.md
29
README.md
@ -43,7 +43,7 @@ You can use a web server and a supported database (MariaDB, MySQL or PostgreSQL)
|
|||||||
|
|
||||||
On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
||||||
|
|
||||||
#### Generic install steps:
|
#### Generic install steps
|
||||||
|
|
||||||
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
|
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
|
||||||
|
|
||||||
@ -71,11 +71,9 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||||||
|
|
||||||
- Follow the installer instructions
|
- Follow the installer instructions
|
||||||
|
|
||||||
|
|
||||||
### Saas/Cloud setup
|
### Saas/Cloud setup
|
||||||
|
|
||||||
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
|
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See [https://saas.dolibarr.org](https://saas.dolibarr.org)). However, this third solution is not free.
|
||||||
|
|
||||||
|
|
||||||
## UPGRADING
|
## UPGRADING
|
||||||
|
|
||||||
@ -87,12 +85,10 @@ Dolibarr supports upgrading, usually without the need for any (commercial) suppo
|
|||||||
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
|
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
|
||||||
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
||||||
|
|
||||||
|
|
||||||
## WHAT'S NEW
|
## WHAT'S NEW
|
||||||
|
|
||||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||||
|
|
||||||
|
|
||||||
## FEATURES
|
## FEATURES
|
||||||
|
|
||||||
### Main application/modules (all optional)
|
### Main application/modules (all optional)
|
||||||
@ -101,6 +97,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Members/Membership/Foundation management
|
- Members/Membership/Foundation management
|
||||||
|
|
||||||
Product Management
|
Product Management
|
||||||
|
|
||||||
- Products and/or Services catalog
|
- Products and/or Services catalog
|
||||||
- Stock / Warehouse management + Inventory
|
- Stock / Warehouse management + Inventory
|
||||||
- Barcodes
|
- Barcodes
|
||||||
@ -110,6 +107,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Manufacturing Orders
|
- Manufacturing Orders
|
||||||
|
|
||||||
Customer/Sales Management
|
Customer/Sales Management
|
||||||
|
|
||||||
- Customers/Prospects + Contacts management
|
- Customers/Prospects + Contacts management
|
||||||
- Opportunities or Leads management
|
- Opportunities or Leads management
|
||||||
- Commercial proposals management
|
- Commercial proposals management
|
||||||
@ -122,6 +120,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Point of Sale (POS)
|
- Point of Sale (POS)
|
||||||
|
|
||||||
Supplier/Purchase Management
|
Supplier/Purchase Management
|
||||||
|
|
||||||
- Suppliers/Vendors + Contacts
|
- Suppliers/Vendors + Contacts
|
||||||
- Supplier (price) requests
|
- Supplier (price) requests
|
||||||
- Purchase Orders management
|
- Purchase Orders management
|
||||||
@ -130,6 +129,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- INCOTERMS
|
- INCOTERMS
|
||||||
|
|
||||||
Finance / Accounting
|
Finance / Accounting
|
||||||
|
|
||||||
- Invoices / Payments
|
- Invoices / Payments
|
||||||
- Bank accounts management
|
- Bank accounts management
|
||||||
- Direct debit orders management (European SEPA)
|
- Direct debit orders management (European SEPA)
|
||||||
@ -140,18 +140,19 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Reports
|
- Reports
|
||||||
|
|
||||||
Collaboration
|
Collaboration
|
||||||
|
|
||||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||||
- Projects & Tasks management
|
- Projects & Tasks management
|
||||||
- Ticket System
|
- Ticket System
|
||||||
- Surveys
|
- Surveys
|
||||||
|
|
||||||
HR
|
HR
|
||||||
|
|
||||||
- Employee's leave requests management
|
- Employee's leave requests management
|
||||||
- Expense reports
|
- Expense reports
|
||||||
- Recruitment management
|
- Recruitment management
|
||||||
- Timesheets
|
- Timesheets
|
||||||
|
|
||||||
|
|
||||||
### Other application/modules
|
### Other application/modules
|
||||||
|
|
||||||
- Electronic Document Management (EDM)
|
- Electronic Document Management (EDM)
|
||||||
@ -171,7 +172,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
|
|
||||||
(around 100 modules available by default, 1000+ on the addon market place)
|
(around 100 modules available by default, 1000+ on the addon market place)
|
||||||
|
|
||||||
|
|
||||||
### Other general features
|
### Other general features
|
||||||
|
|
||||||
- Localization in most major languages
|
- Localization in most major languages
|
||||||
@ -190,13 +190,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Canadian double taxes (federal/province) and other countries using cumulative VAT
|
- Canadian double taxes (federal/province) and other countries using cumulative VAT
|
||||||
- Tunisian tax stamp
|
- Tunisian tax stamp
|
||||||
- Argentina invoice numbering using A,B,C...
|
- Argentina invoice numbering using A,B,C...
|
||||||
- Compatible with [European directives] (https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
- Compatible with [European directives](https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||||
- Compatible with European GDPR rules
|
- Compatible with European GDPR rules
|
||||||
- ...
|
- ...
|
||||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
|
|
||||||
### System Environment / Requirements
|
### System Environment / Requirements
|
||||||
|
|
||||||
- PHP
|
- PHP
|
||||||
@ -205,12 +204,10 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
|
|
||||||
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
|
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
|
||||||
|
|
||||||
|
|
||||||
### Extending
|
### Extending
|
||||||
|
|
||||||
Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com).
|
Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com).
|
||||||
|
|
||||||
|
|
||||||
## WHAT DOLIBARR CAN'T DO YET
|
## WHAT DOLIBARR CAN'T DO YET
|
||||||
|
|
||||||
These are features that Dolibarr does **not** yet fully support:
|
These are features that Dolibarr does **not** yet fully support:
|
||||||
@ -220,12 +217,10 @@ These are features that Dolibarr does **not** yet fully support:
|
|||||||
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
|
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
|
||||||
- Dolibarr can't do coffee (yet)
|
- Dolibarr can't do coffee (yet)
|
||||||
|
|
||||||
|
|
||||||
## DOCUMENTATION
|
## DOCUMENTATION
|
||||||
|
|
||||||
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
|
||||||
## CONTRIBUTING
|
## CONTRIBUTING
|
||||||
|
|
||||||
This project exists thanks to all the people who contribute.
|
This project exists thanks to all the people who contribute.
|
||||||
@ -233,8 +228,7 @@ Please read the instructions how to contribute (report a bug/error, a feature re
|
|||||||
|
|
||||||
A view on Contributors:
|
A view on Contributors:
|
||||||
|
|
||||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
[](https://github.com/Dolibarr/dolibarr/graphs/contributors)
|
||||||
|
|
||||||
|
|
||||||
## CREDITS
|
## CREDITS
|
||||||
|
|
||||||
@ -242,7 +236,6 @@ Dolibarr is the work of many contributors over the years and uses some fine PHP
|
|||||||
|
|
||||||
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
||||||
|
|
||||||
|
|
||||||
## NEWS AND SOCIAL NETWORKS
|
## NEWS AND SOCIAL NETWORKS
|
||||||
|
|
||||||
Follow Dolibarr project on:
|
Follow Dolibarr project on:
|
||||||
@ -253,8 +246,6 @@ Follow Dolibarr project on:
|
|||||||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|
||||||
|
|
||||||
### Sponsors
|
### Sponsors
|
||||||
|
|
||||||
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,7 @@ if ($action == 'update') {
|
|||||||
$nb_exists = $db->num_rows($resql_exists);
|
$nb_exists = $db->num_rows($resql_exists);
|
||||||
if ($nb_exists <= 0) {
|
if ($nb_exists <= 0) {
|
||||||
// insert
|
// insert
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
|
||||||
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
|
||||||
} else {
|
} else {
|
||||||
$obj_exists = $db->fetch_object($resql_exists);
|
$obj_exists = $db->fetch_object($resql_exists);
|
||||||
|
|||||||
@ -87,11 +87,11 @@ class AccountancyExport
|
|||||||
*
|
*
|
||||||
* @param DoliDb $db Database handler
|
* @param DoliDb $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct(DoliDB &$db)
|
public function __construct(DoliDB $db)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db = &$db;
|
$this->db = $db;
|
||||||
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||||
$this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : ($conf->global->ACCOUNTING_EXPORT_ENDLINE == 1 ? "\n" : "\r\n");
|
$this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE) ? "\n" : ($conf->global->ACCOUNTING_EXPORT_ENDLINE == 1 ? "\n" : "\r\n");
|
||||||
}
|
}
|
||||||
@ -928,17 +928,18 @@ class AccountancyExport
|
|||||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||||
|
|
||||||
|
$refInvoice = '';
|
||||||
if ($line->doc_type == 'customer_invoice') {
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
// Customer invoice
|
// Customer invoice
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($this->db);
|
||||||
$invoice->fetch($line->fk_doc);
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
$refInvoice = $invoice->ref;
|
$refInvoice = $invoice->ref;
|
||||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
// Supplier invoice
|
// Supplier invoice
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
$invoice = new FactureFournisseur($db);
|
$invoice = new FactureFournisseur($this->db);
|
||||||
$invoice->fetch($line->fk_doc);
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
$refInvoice = $invoice->ref_supplier;
|
$refInvoice = $invoice->ref_supplier;
|
||||||
@ -1054,17 +1055,18 @@ class AccountancyExport
|
|||||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||||
|
|
||||||
|
$refInvoice = '';
|
||||||
if ($line->doc_type == 'customer_invoice') {
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
// Customer invoice
|
// Customer invoice
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($this->db);
|
||||||
$invoice->fetch($line->fk_doc);
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
$refInvoice = $invoice->ref;
|
$refInvoice = $invoice->ref;
|
||||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
// Supplier invoice
|
// Supplier invoice
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
$invoice = new FactureFournisseur($db);
|
$invoice = new FactureFournisseur($this->db);
|
||||||
$invoice->fetch($line->fk_doc);
|
$invoice->fetch($line->fk_doc);
|
||||||
|
|
||||||
$refInvoice = $invoice->ref_supplier;
|
$refInvoice = $invoice->ref_supplier;
|
||||||
|
|||||||
@ -184,6 +184,8 @@ if ($action == 'validatehistory') {
|
|||||||
} else {
|
} else {
|
||||||
$num_lines = $db->num_rows($result);
|
$num_lines = $db->num_rows($result);
|
||||||
|
|
||||||
|
$facture_static = new Facture($db);
|
||||||
|
|
||||||
$isSellerInEEC = isInEEC($mysoc);
|
$isSellerInEEC = isInEEC($mysoc);
|
||||||
|
|
||||||
$thirdpartystatic = new Societe($db);
|
$thirdpartystatic = new Societe($db);
|
||||||
@ -266,6 +268,18 @@ if ($action == 'validatehistory') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manage Deposit
|
||||||
|
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
|
||||||
|
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
|
||||||
|
$accountdeposittoventilated = new AccountingAccount($db);
|
||||||
|
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||||
|
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||||
|
$objp->code_sell_p = '';
|
||||||
|
$objp->code_sell_t = '';
|
||||||
|
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($objp->aarowid_suggest > 0) {
|
if ($objp->aarowid_suggest > 0) {
|
||||||
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||||
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
|
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
|
||||||
|
|||||||
@ -413,6 +413,9 @@ if ($result) {
|
|||||||
if ($search_ref) {
|
if ($search_ref) {
|
||||||
$param .= '&search_ref='.urlencode($search_ref);
|
$param .= '&search_ref='.urlencode($search_ref);
|
||||||
}
|
}
|
||||||
|
if ($search_label) {
|
||||||
|
$param .= '&search_label='.urlencode($search_label);
|
||||||
|
}
|
||||||
if ($search_desc) {
|
if ($search_desc) {
|
||||||
$param .= '&search_desc='.urlencode($search_desc);
|
$param .= '&search_desc='.urlencode($search_desc);
|
||||||
}
|
}
|
||||||
@ -491,7 +494,7 @@ if ($result) {
|
|||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||||
@ -539,7 +542,7 @@ if ($result) {
|
|||||||
$thirdpartystatic->email = $objp->email;
|
$thirdpartystatic->email = $objp->email;
|
||||||
$thirdpartystatic->country_code = $objp->country_code;
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||||
$thirdpartystatic->code_compta = $objp->company_code_sell;
|
$thirdpartystatic->code_compta_company = $objp->company_code_sell;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
@ -558,7 +561,7 @@ if ($result) {
|
|||||||
$facture_static->ref = $objp->ref;
|
$facture_static->ref = $objp->ref;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->facid;
|
||||||
$facture_static->type = $objp->ftype;
|
$facture_static->type = $objp->ftype;
|
||||||
$facture_static->date = $objp->datef;
|
$facture_static->date = $db->jdate($objp->datef);
|
||||||
|
|
||||||
$facture_static_det->id = $objp->rowid;
|
$facture_static_det->id = $objp->rowid;
|
||||||
$facture_static_det->total_ht = $objp->total_ht;
|
$facture_static_det->total_ht = $objp->total_ht;
|
||||||
@ -589,7 +592,28 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
//var_dump($return);
|
//var_dump($return);
|
||||||
|
|
||||||
if (!empty($code_sell_p)) {
|
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||||
|
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||||
|
if (!empty($objp->company_code_sell)) {
|
||||||
|
$objp->code_sell_t = $objp->company_code_sell;
|
||||||
|
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||||
|
$suggestedaccountingaccountfor = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Manage Deposit
|
||||||
|
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
|
||||||
|
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
|
||||||
|
$accountdeposittoventilated = new AccountingAccount($db);
|
||||||
|
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
|
||||||
|
$objp->code_sell_l = $accountdeposittoventilated->ref;
|
||||||
|
$objp->code_sell_p = '';
|
||||||
|
$objp->code_sell_t = '';
|
||||||
|
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($objp->code_sell_p)) {
|
||||||
// Value was defined previously
|
// Value was defined previously
|
||||||
} else {
|
} else {
|
||||||
$code_sell_p_notset = 'color:orange';
|
$code_sell_p_notset = 'color:orange';
|
||||||
@ -613,7 +637,7 @@ if ($result) {
|
|||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
print '<td class="nowraponall">'.$facture_static->getNomUrl(1).'</td>';
|
print '<td class="nowraponall">'.$facture_static->getNomUrl(1).'</td>';
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($facture_static->date), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($facture_static->date, 'day').'</td>';
|
||||||
|
|
||||||
// Ref Product
|
// Ref Product
|
||||||
print '<td class="tdoverflowmax150">';
|
print '<td class="tdoverflowmax150">';
|
||||||
@ -707,7 +731,7 @@ if ($result) {
|
|||||||
|
|
||||||
// Column with checkbox
|
// Column with checkbox
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if (!empty($suggestedid) && $suggestedaccountingaccountfor<>'') {
|
if (!empty($suggestedid) && $suggestedaccountingaccountfor <> '') {
|
||||||
$ischecked=1;
|
$ischecked=1;
|
||||||
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
} elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') {
|
||||||
$ischecked = 0;
|
$ischecked = 0;
|
||||||
|
|||||||
@ -291,7 +291,7 @@ if (strlen(trim($search_ref))) {
|
|||||||
$sql .= natural_search("p.ref", $search_ref);
|
$sql .= natural_search("p.ref", $search_ref);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) {
|
if (strlen(trim($search_label))) {
|
||||||
$sql .= natural_search("f.libelle", $search_label);
|
$sql .= natural_search(array("p.label", "f.libelle"), $search_label);
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_desc))) {
|
if (strlen(trim($search_desc))) {
|
||||||
$sql .= natural_search("l.description", $search_desc);
|
$sql .= natural_search("l.description", $search_desc);
|
||||||
@ -546,7 +546,7 @@ if ($result) {
|
|||||||
$thirdpartystatic->email = $objp->email;
|
$thirdpartystatic->email = $objp->email;
|
||||||
$thirdpartystatic->country_code = $objp->country_code;
|
$thirdpartystatic->country_code = $objp->country_code;
|
||||||
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
$thirdpartystatic->tva_intra = $objp->tva_intra;
|
||||||
$thirdpartystatic->code_compta_fournisseur = $objp->company_code_buy;
|
$thirdpartystatic->code_compta_company = $objp->company_code_buy;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
@ -566,10 +566,11 @@ if ($result) {
|
|||||||
$facturefourn_static->id = $objp->facid;
|
$facturefourn_static->id = $objp->facid;
|
||||||
$facturefourn_static->type = $objp->ftype;
|
$facturefourn_static->type = $objp->ftype;
|
||||||
$facturefourn_static->label = $objp->invoice_label;
|
$facturefourn_static->label = $objp->invoice_label;
|
||||||
|
$facturefourn_static->date = $db->jdate($objp->datef);
|
||||||
|
|
||||||
$facturefourn_static_det->id = $objp->rowid;
|
$facturefourn_static_det->id = $objp->rowid;
|
||||||
$facturefourn_static_det->total_ht = $objp->total_ht;
|
$facturefourn_static_det->total_ht = $objp->total_ht;
|
||||||
$facturefourn_static_det->tva_tx_line = $objp->tva_tx_line;
|
$facturefourn_static_det->tva_tx = $objp->tva_tx_line;
|
||||||
$facturefourn_static_det->vat_src_code = $objp->vat_src_code;
|
$facturefourn_static_det->vat_src_code = $objp->vat_src_code;
|
||||||
$facturefourn_static_det->product_type = $objp->type_l;
|
$facturefourn_static_det->product_type = $objp->type_l;
|
||||||
$facturefourn_static_det->desc = $objp->description;
|
$facturefourn_static_det->desc = $objp->description;
|
||||||
@ -608,6 +609,9 @@ if ($result) {
|
|||||||
if (empty($code_buy_l) && empty($code_buy_p)) {
|
if (empty($code_buy_l) && empty($code_buy_p)) {
|
||||||
$code_buy_p_notset = 'color:red';
|
$code_buy_p_notset = 'color:red';
|
||||||
}
|
}
|
||||||
|
/*if ($suggestedaccountingaccountfor == 'eecwithoutvatnumber' && empty($code_sell_p_notset)) {
|
||||||
|
$code_sell_p_notset = 'color:orange';
|
||||||
|
}*/
|
||||||
|
|
||||||
// $code_buy_l is now default code of product/service
|
// $code_buy_l is now default code of product/service
|
||||||
// $code_buy_p is now code of product/service
|
// $code_buy_p is now code of product/service
|
||||||
@ -626,15 +630,15 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($facturefourn_static_det->datef), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($facturefourn_static->date, 'day').'</td>';
|
||||||
|
|
||||||
// Ref Product
|
// Ref Product
|
||||||
print '<td class="tdoverflowmax150">';
|
print '<td class="tdoverflowmax150">';
|
||||||
if ($product_static->id > 0) {
|
if ($product_static->id > 0) {
|
||||||
print $product_static->getNomUrl(1);
|
print $product_static->getNomUrl(1);
|
||||||
}
|
}
|
||||||
if ($product_static->product_label) {
|
if ($product_static->label) {
|
||||||
print '<br><span class="opacitymedium small">'.$product_static->product_label.'</span>';
|
print '<br><span class="opacitymedium small">'.$product_static->label.'</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -650,11 +654,12 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Vat rate
|
// Vat rate
|
||||||
|
$code_vat_differ='';
|
||||||
if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||||
}
|
}
|
||||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||||
print vatrate($facturefourn_static_det->tva_tx_line.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : ''));
|
print vatrate($facturefourn_static_det->tva_tx.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : ''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
@ -671,7 +676,7 @@ if ($result) {
|
|||||||
|
|
||||||
// Found accounts
|
// Found accounts
|
||||||
print '<td class="small">';
|
print '<td class="small">';
|
||||||
$s = '1. '.(($facturefourn_static_det->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
$s = '1. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
|
||||||
$shelp = '';
|
$shelp = '';
|
||||||
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
|
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
|
||||||
$shelp .= $langs->trans("SaleEEC");
|
$shelp .= $langs->trans("SaleEEC");
|
||||||
|
|||||||
@ -1788,13 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
print '<table class="border tableforfield tableforfield centpercent">';
|
print '<table class="border tableforfield tableforfield centpercent">';
|
||||||
|
|
||||||
// Birth Date
|
// Tags / Categories
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
|
||||||
|
|
||||||
// Public
|
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Birth Date
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||||
|
|
||||||
|
// Public
|
||||||
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ class AdherentType extends CommonObject
|
|||||||
public $subscription;
|
public $subscription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var float amount for subscription
|
* @var float|string Amount for subscription (null or '' means not defined)
|
||||||
*/
|
*/
|
||||||
public $amount;
|
public $amount;
|
||||||
|
|
||||||
|
|||||||
@ -209,7 +209,6 @@ if ($result > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
$ldap->close();
|
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -314,7 +314,7 @@ if (!empty($search_categ) || !empty($catid)) {
|
|||||||
}
|
}
|
||||||
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
|
||||||
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
||||||
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
|
||||||
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||||
$sql .= " d.note_private, d.note_public,";
|
$sql .= " d.note_private, d.note_public,";
|
||||||
$sql .= " s.nom,";
|
$sql .= " s.nom,";
|
||||||
|
|||||||
@ -195,9 +195,7 @@ foreach ($data as $val) {
|
|||||||
}
|
}
|
||||||
print '<tr class="oddeven" height="24">';
|
print '<tr class="oddeven" height="24">';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
//print '<a href="month.php?year='.$year.'">';
|
print '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php?date_select='.((int) $year).'">'.$year.'</a>';
|
||||||
print $year;
|
|
||||||
//print '</a>';
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right">'.$val['nb'].'</td>';
|
print '<td class="right">'.$val['nb'].'</td>';
|
||||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||||
|
|||||||
@ -170,7 +170,6 @@ if ($result > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
$ldap->close();
|
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -275,8 +275,7 @@ print '<br><br>';
|
|||||||
/*
|
/*
|
||||||
* Document templates generators
|
* Document templates generators
|
||||||
*/
|
*/
|
||||||
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
|
||||||
//{
|
|
||||||
print load_fiche_titre($langs->trans("BankAccountModelModule"), '', '');
|
print load_fiche_titre($langs->trans("BankAccountModelModule"), '', '');
|
||||||
|
|
||||||
// Load array def with activated templates
|
// Load array def with activated templates
|
||||||
@ -466,8 +465,7 @@ print '<br><br>';
|
|||||||
/*
|
/*
|
||||||
* Document templates generators
|
* Document templates generators
|
||||||
*/
|
*/
|
||||||
//if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
|
||||||
//{
|
|
||||||
print load_fiche_titre($langs->trans("Other"), '', '');
|
print load_fiche_titre($langs->trans("Other"), '', '');
|
||||||
|
|
||||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||||
|
|||||||
@ -176,6 +176,71 @@ foreach ($dirbarcode as $reldir) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Select barcode numbering module
|
||||||
|
if ($conf->product->enabled) {
|
||||||
|
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Example").'</td>';
|
||||||
|
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
|
||||||
|
|
||||||
|
foreach ($dirbarcodenum as $dirroot) {
|
||||||
|
$dir = dol_buildpath($dirroot, 0);
|
||||||
|
|
||||||
|
$handle = @opendir($dir);
|
||||||
|
if (is_resource($handle)) {
|
||||||
|
while (($file = readdir($handle)) !== false) {
|
||||||
|
if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
|
||||||
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
|
try {
|
||||||
|
dol_include_once($dirroot.$file.'.php');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
dol_syslog($e->getMessage(), LOG_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
|
$modBarCode = new $file();
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
|
||||||
|
print $modBarCode->info($langs);
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
|
||||||
|
|
||||||
|
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
||||||
|
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&value='.urlencode($file).'">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&value='.urlencode($file).'">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '<td class="center">';
|
||||||
|
$s = $modBarCode->getToolTip($langs, null, -1);
|
||||||
|
print $form->textwithpicto('', $s, 1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CHOIX ENCODAGE
|
* CHOIX ENCODAGE
|
||||||
*/
|
*/
|
||||||
@ -189,6 +254,7 @@ if (empty($conf->use_javascript_ajax)) {
|
|||||||
print '<input type="hidden" name="action" value="updateengine">';
|
print '<input type="hidden" name="action" value="updateengine">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
@ -211,8 +277,9 @@ if ($resql) {
|
|||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven">';
|
||||||
print $obj->label;
|
print '<td width="100">';
|
||||||
|
print dol_escape_htmltag($obj->label);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||||
//print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.<br>";
|
//print "L'EAN se compose de 8 caracteres, 7 chiffres plus une cle de controle.<br>";
|
||||||
@ -270,6 +337,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
if (empty($conf->use_javascript_ajax)) {
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
print $form->buttonsSaveCancel("Save", '');
|
print $form->buttonsSaveCancel("Save", '');
|
||||||
@ -287,6 +355,7 @@ print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||||
@ -304,7 +373,9 @@ if (!isset($_SERVER['WINDIR'])) {
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
|
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).'</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module products
|
// Module products
|
||||||
@ -313,7 +384,9 @@ if (!empty($conf->product->enabled)) {
|
|||||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||||
print '<td width="60" class="right">';
|
print '<td width="60" class="right">';
|
||||||
print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
|
print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module thirdparty
|
// Module thirdparty
|
||||||
@ -322,10 +395,14 @@ if (!empty($conf->societe->enabled)) {
|
|||||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||||
print '<td width="60" class="right">';
|
print '<td width="60" class="right">';
|
||||||
print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
|
print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="submit_GENBARCODE_BARCODETYPE_THIRDPARTY" value="'.$langs->trans("Modify").'">';
|
||||||
print "</div>";
|
print "</div>";
|
||||||
@ -334,71 +411,6 @@ print '</form>';
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Select barcode numbering module
|
|
||||||
if ($conf->product->enabled) {
|
|
||||||
print load_fiche_titre($langs->trans("BarCodeNumberManager")." (".$langs->trans("Product").")", '', '');
|
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
|
||||||
print '<td>'.$langs->trans("Description").'</td>';
|
|
||||||
print '<td>'.$langs->trans("Example").'</td>';
|
|
||||||
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
|
|
||||||
print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
$dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
|
|
||||||
|
|
||||||
foreach ($dirbarcodenum as $dirroot) {
|
|
||||||
$dir = dol_buildpath($dirroot, 0);
|
|
||||||
|
|
||||||
$handle = @opendir($dir);
|
|
||||||
if (is_resource($handle)) {
|
|
||||||
while (($file = readdir($handle)) !== false) {
|
|
||||||
if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
|
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
|
||||||
|
|
||||||
try {
|
|
||||||
dol_include_once($dirroot.$file.'.php');
|
|
||||||
} catch (Exception $e) {
|
|
||||||
dol_syslog($e->getMessage(), LOG_ERR);
|
|
||||||
}
|
|
||||||
|
|
||||||
$modBarCode = new $file();
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td>'.(isset($modBarCode->name) ? $modBarCode->name : $modBarCode->nom)."</td><td>\n";
|
|
||||||
print $modBarCode->info($langs);
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
|
|
||||||
|
|
||||||
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM) && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
|
|
||||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&token='.newToken().'&value='.urlencode($file).'">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a></td>';
|
|
||||||
} else {
|
|
||||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&token='.newToken().'&value='.urlencode($file).'">';
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
print '</a></td>';
|
|
||||||
}
|
|
||||||
print '<td class="center">';
|
|
||||||
$s = $modBarCode->getToolTip($langs, null, -1);
|
|
||||||
print $form->textwithpicto('', $s, 1);
|
|
||||||
print '</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</table>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
//print '</form>';
|
|
||||||
|
|
||||||
print "<br>";
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -350,17 +350,15 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) {
|
|||||||
$disabled = ' disabled="disabled"';
|
$disabled = ' disabled="disabled"';
|
||||||
}
|
}
|
||||||
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
|
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
|
||||||
print "</td>\n";
|
print '</td>'."\n";
|
||||||
print '</tr>';
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$result=$object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity)));
|
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity)));
|
||||||
|
|
||||||
if (!is_array($result) && $result<0) {
|
if (!is_array($result) && $result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} elseif (count($result)>0) {
|
} elseif (is_array($result) && count($result) > 0) {
|
||||||
foreach ($result as $key=>$defaultvalue) {
|
foreach ($result as $key => $defaultvalue) {
|
||||||
print "\n";
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Page
|
// Page
|
||||||
@ -378,11 +376,6 @@ if (!is_array($result) && $result<0) {
|
|||||||
// Value
|
// Value
|
||||||
if ($mode != 'focus' && $mode != 'mandatory') {
|
if ($mode != 'focus' && $mode != 'mandatory') {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
|
||||||
print '<input type="hidden" name="const['.$i.'][lang]" value="'.$obj->lang.'">';
|
|
||||||
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->transkey.'">';
|
|
||||||
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.dol_escape_htmltag($obj->transvalue).'">';
|
|
||||||
*/
|
|
||||||
if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print dol_escape_htmltag($defaultvalue->value);
|
if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print dol_escape_htmltag($defaultvalue->value);
|
||||||
else print '<input type="text" name="value" value="'.dol_escape_htmltag($defaultvalue->value).'">';
|
else print '<input type="text" name="value" value="'.dol_escape_htmltag($defaultvalue->value).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -405,8 +398,6 @@ if (!is_array($result) && $result<0) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "\n";
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -509,8 +509,8 @@ $tabcond[30] = !empty($conf->label->enabled);
|
|||||||
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
|
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
|
||||||
$tabcond[33] = !empty($conf->hrm->enabled);
|
$tabcond[33] = !empty($conf->hrm->enabled);
|
||||||
$tabcond[34] = !empty($conf->hrm->enabled);
|
$tabcond[34] = !empty($conf->hrm->enabled);
|
||||||
$tabcond[35] = !empty($conf->expensereport->enabled);
|
$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
|
||||||
$tabcond[36] = !empty($conf->expensereport->enabled);
|
$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
|
||||||
$tabcond[37] = !empty($conf->product->enabled);
|
$tabcond[37] = !empty($conf->product->enabled);
|
||||||
$tabcond[38] = !empty($conf->socialnetworks->enabled);
|
$tabcond[38] = !empty($conf->socialnetworks->enabled);
|
||||||
$tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
|
$tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
|
||||||
@ -2107,7 +2107,7 @@ if ($id) {
|
|||||||
if ($iserasable) {
|
if ($iserasable) {
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
|
print '<a class="reposition" href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -79,6 +79,7 @@ if ($action == 'update') {
|
|||||||
if (!empty($max_rank)) {
|
if (!empty($max_rank)) {
|
||||||
$static_skill = new Skill($db);
|
$static_skill = new Skill($db);
|
||||||
$TAllSkills = $static_skill->fetchAll();
|
$TAllSkills = $static_skill->fetchAll();
|
||||||
|
if (is_array($TAllSkills)) {
|
||||||
foreach ($TAllSkills as &$skill) {
|
foreach ($TAllSkills as &$skill) {
|
||||||
if (empty($skill->lines)) $skill->fetchLines();
|
if (empty($skill->lines)) $skill->fetchLines();
|
||||||
if (count($skill->lines) < $conf->global->HRM_MAXRANK) {
|
if (count($skill->lines) < $conf->global->HRM_MAXRANK) {
|
||||||
@ -86,6 +87,7 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} elseif ($action == 'updateMask') {
|
} elseif ($action == 'updateMask') {
|
||||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||||
$maskorder = GETPOST('maskorder', 'alpha');
|
$maskorder = GETPOST('maskorder', 'alpha');
|
||||||
|
|||||||
@ -290,24 +290,24 @@ if (function_exists("ldap_connect")) {
|
|||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestConnect").'</a><br><br>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestConnect").'</a><br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'test') {
|
if ($action == 'test') {
|
||||||
$ldap = new Ldap(); // Les parametres sont passes et recuperes via $conf
|
$ldap = new Ldap(); // Les parametres sont passes et recuperes via $conf
|
||||||
|
|
||||||
$result = $ldap->connect_bind();
|
$result = $ldap->connect_bind();
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
// Test ldap connect and bind
|
// Test ldap connect and bind
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<span class="ok">'.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
print '<span class="ok">'.$langs->trans("LDAPTCPConnectOK", $ldap->connectedServer, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
|
if (!empty($conf->global->LDAP_ADMIN_DN) && !empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||||
if ($result == 2) {
|
if ($result == 2) {
|
||||||
print img_picto('', 'info').' ';
|
print img_picto('', 'info').' ';
|
||||||
print '<span class="ok">'.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
print '<span class="ok">'.$langs->trans("LDAPBindOK", $ldap->connectedServer, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<span class="error">'.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
print '<span class="error">'.$langs->trans("LDAPBindKO", $ldap->connectedServer, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans("Error").' '.$ldap->error;
|
print $langs->trans("Error").' '.$ldap->error;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -330,10 +330,10 @@ if (function_exists("ldap_connect")) {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$unbind = $ldap->unbind();
|
$ldap->unbind();
|
||||||
} else {
|
} else {
|
||||||
print img_picto('', 'error').' ';
|
print img_picto('', 'error').' ';
|
||||||
print '<span class="error">'.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).'</span>';
|
print '<span class="error">'.$langs->trans("LDAPTCPConnectKO", $ldap->connectedServer, $conf->global->LDAP_SERVER_PORT).'</span>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans("Error").' '.$ldap->error;
|
print $langs->trans("Error").' '.$ldap->error;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -192,7 +192,7 @@ print "</tr>\n";
|
|||||||
// DN Pour les utilisateurs
|
// DN Pour les utilisateurs
|
||||||
print '<!-- LDAP_USER_DN -->';
|
print '<!-- LDAP_USER_DN -->';
|
||||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
|
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
|
||||||
print '<input size="48" type="text" name="user" value="'.$conf->global->LDAP_USER_DN.'">';
|
print '<input size="48" type="text" name="user" value="'.getDolGlobalString('LDAP_USER_DN').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -200,7 +200,7 @@ print '</tr>';
|
|||||||
// List of object class used to define attributes in structure
|
// List of object class used to define attributes in structure
|
||||||
print '<!-- LDAP_USER_OBJECT_CLASS -->';
|
print '<!-- LDAP_USER_OBJECT_CLASS -->';
|
||||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
|
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
|
||||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_USER_OBJECT_CLASS.'">';
|
print '<input size="48" type="text" name="objectclass" value="'.getDolGlobalString('LDAP_USER_OBJECT_CLASS').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPUserObjectClassListExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPUserObjectClassListExample").'</td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -208,7 +208,7 @@ print '</tr>';
|
|||||||
// Filter, used to filter search
|
// Filter, used to filter search
|
||||||
print '<!-- LDAP_FILTER_CONNECTION -->';
|
print '<!-- LDAP_FILTER_CONNECTION -->';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
||||||
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
|
print '<input size="48" type="text" name="filterconnection" value="'.getDolGlobalString('LDAP_FILTER_CONNECTION').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -225,168 +225,168 @@ print "</tr>\n";
|
|||||||
|
|
||||||
// Common name
|
// Common name
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFullname").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFullname").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldfullname" value="'.$conf->global->LDAP_FIELD_FULLNAME.'">';
|
print '<input size="25" type="text" name="fieldfullname" value="'.getDolGlobalString('LDAP_FIELD_FULLNAME').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldFullnameExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldFullnameExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FULLNAME"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FULLNAME) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FULLNAME"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_FULLNAME') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldName").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldName").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_FIELD_NAME.'">';
|
print '<input size="25" type="text" name="fieldname" value="'.getDolGlobalString('LDAP_FIELD_NAME').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_NAME"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_NAME) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_NAME"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_NAME') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Firstname
|
// Firstname
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFirstName").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFirstName").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldfirstname" value="'.$conf->global->LDAP_FIELD_FIRSTNAME.'">';
|
print '<input size="25" type="text" name="fieldfirstname" value="'.getDolGlobalString('LDAP_FIELD_FIRSTNAME').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldFirstNameExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldFirstNameExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FIRSTNAME"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FIRSTNAME) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FIRSTNAME"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_FIRSTNAME') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Login unix
|
// Login unix
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldLoginUnix").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldLoginUnix").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldlogin" value="'.$conf->global->LDAP_FIELD_LOGIN.'">';
|
print '<input size="25" type="text" name="fieldlogin" value="'.getDolGlobalString('LDAP_FIELD_LOGIN').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldLoginExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldLoginExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_LOGIN"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_LOGIN"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_LOGIN') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Login samba
|
// Login samba
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldLoginSamba").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldLoginSamba").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldloginsamba" value="'.$conf->global->LDAP_FIELD_LOGIN_SAMBA.'">';
|
print '<input size="25" type="text" name="fieldloginsamba" value="'.getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldLoginSambaExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldLoginSambaExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_LOGIN_SAMBA"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN_SAMBA) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_LOGIN_SAMBA"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Password not crypted
|
// Password not crypted
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldpassword" value="'.$conf->global->LDAP_FIELD_PASSWORD.'">';
|
print '<input size="25" type="text" name="fieldpassword" value="'.getDolGlobalString('LDAP_FIELD_PASSWORD').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Password crypted
|
// Password crypted
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldpasswordcrypted" value="'.$conf->global->LDAP_FIELD_PASSWORD_CRYPTED.'">';
|
print '<input size="25" type="text" name="fieldpasswordcrypted" value="'.getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Mail
|
// Mail
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMail").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMail").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldmail" value="'.$conf->global->LDAP_FIELD_MAIL.'">';
|
print '<input size="25" type="text" name="fieldmail" value="'.getDolGlobalString('LDAP_FIELD_MAIL').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldMailExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldMailExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_MAIL"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_MAIL) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_MAIL"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_MAIL') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Phone
|
// Phone
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPhone").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPhone").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldphone" value="'.$conf->global->LDAP_FIELD_PHONE.'">';
|
print '<input size="25" type="text" name="fieldphone" value="'.getDolGlobalString('LDAP_FIELD_PHONE').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldPhoneExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldPhoneExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_PHONE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_PHONE) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_PHONE"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_PHONE') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Mobile
|
// Mobile
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMobile").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldMobile").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldmobile" value="'.$conf->global->LDAP_FIELD_MOBILE.'">';
|
print '<input size="25" type="text" name="fieldmobile" value="'.getDolGlobalString('LDAP_FIELD_MOBILE').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_MOBILE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_MOBILE) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_MOBILE"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_MOBILE') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldSkype").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldskype" value="'.$conf->global->LDAP_FIELD_SKYPE.'">';
|
print '<input size="25" type="text" name="fieldskype" value="'.getDolGlobalString('LDAP_FIELD_SKYPE').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldSkypeExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_SKYPE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SKYPE) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_SKYPE"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_SKYPE') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Fax
|
// Fax
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFax").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldFax").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldfax" value="'.$conf->global->LDAP_FIELD_FAX.'">';
|
print '<input size="25" type="text" name="fieldfax" value="'.getDolGlobalString('LDAP_FIELD_FAX').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldFaxExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldFaxExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FAX"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FAX) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_FAX"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_FAX') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCompany").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCompany").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldcompany" value="'.$conf->global->LDAP_FIELD_COMPANY.'">';
|
print '<input size="25" type="text" name="fieldcompany" value="'.getDolGlobalString('LDAP_FIELD_COMPANY').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldCompanyExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldCompanyExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldaddress" value="'.$conf->global->LDAP_FIELD_ADDRESS.'">';
|
print '<input size="25" type="text" name="fieldaddress" value="'.getDolGlobalString('LDAP_FIELD_ADDRESS').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// ZIP
|
// ZIP
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_FIELD_ZIP.'">';
|
print '<input size="25" type="text" name="fieldzip" value="'.getDolGlobalString('LDAP_FIELD_ZIP').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// TOWN
|
// TOWN
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_FIELD_TOWN.'">';
|
print '<input size="25" type="text" name="fieldtown" value="'.getDolGlobalString('LDAP_FIELD_TOWN').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// COUNTRY
|
// COUNTRY
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_FIELD_COUNTRY.'">';
|
print '<input size="25" type="text" name="fieldcountry" value="'.getDolGlobalString('LDAP_FIELD_COUNTRY').'">';
|
||||||
print '</td><td> </td>';
|
print '</td><td> </td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTitle").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTitle").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldtitle" value="'.$conf->global->LDAP_FIELD_TITLE.'">';
|
print '<input size="25" type="text" name="fieldtitle" value="'.getDolGlobalString('LDAP_FIELD_TITLE').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldTitleExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldTitleExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("Note").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("Note").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_FIELD_DESCRIPTION.'">';
|
print '<input size="25" type="text" name="fielddescription" value="'.getDolGlobalString('LDAP_FIELD_DESCRIPTION').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Sid
|
// Sid
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldSid").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldSid").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldsid" value="'.$conf->global->LDAP_FIELD_SID.'">';
|
print '<input size="25" type="text" name="fieldsid" value="'.getDolGlobalString('LDAP_FIELD_SID').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldSidExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldSidExample").'</td>';
|
||||||
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_SID"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) ? ' checked' : '')."></td>";
|
print '<td class="right"><input type="radio" name="key" value="LDAP_FIELD_SID"'.(getDolGlobalString('LDAP_KEY_USERS') == getDolGlobalString('LDAP_FIELD_SID') ? ' checked' : '')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Group id
|
// Group id
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupid").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupid").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldgroupid" value="'.$conf->global->LDAP_FIELD_GROUPID.'">';
|
print '<input size="25" type="text" name="fieldgroupid" value="'.getDolGlobalString('LDAP_FIELD_GROUPID').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldGroupidExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldGroupidExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Userid
|
// Userid
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldUserid").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldUserid").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fielduserid" value="'.$conf->global->LDAP_FIELD_USERID.'">';
|
print '<input size="25" type="text" name="fielduserid" value="'.getDolGlobalString('LDAP_FIELD_USERID').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldUseridExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldUseridExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Home Directory
|
// Home Directory
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectory").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectory").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldhomedirectory" value="'.$conf->global->LDAP_FIELD_HOMEDIRECTORY.'">';
|
print '<input size="25" type="text" name="fieldhomedirectory" value="'.getDolGlobalString('LDAP_FIELD_HOMEDIRECTORY').'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldHomedirectoryExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldHomedirectoryExample").'</td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Home Directory Prefix
|
// Home Directory Prefix
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectoryprefix").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldHomedirectoryprefix").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldhomedirectoryprefix" value="'.$conf->global->LDAP_FIELD_HOMEDIRECTORYPREFIX.'">';
|
print '<input size="25" type="text" name="fieldhomedirectoryprefix" value="'.getDolGlobalString('LDAP_FIELD_HOMEDIRECTORYPREFIX').'">';
|
||||||
print '</td><td></td>';
|
print '</td><td></td>';
|
||||||
print '<td class="right"> </td>';
|
print '<td class="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -405,20 +405,20 @@ print '</form>';
|
|||||||
/*
|
/*
|
||||||
* Test de la connexion
|
* Test de la connexion
|
||||||
*/
|
*/
|
||||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
if (getDolGlobalString('LDAP_SYNCHRO_ACTIVE') == 'dolibarr2ldap') {
|
||||||
$butlabel = $langs->trans("LDAPTestSynchroUser");
|
$butlabel = $langs->trans("LDAPTestSynchroUser");
|
||||||
$testlabel = 'testuser';
|
$testlabel = 'testuser';
|
||||||
$key = $conf->global->LDAP_KEY_USERS;
|
$key = getDolGlobalString('LDAP_KEY_USERS');
|
||||||
$dn = $conf->global->LDAP_USER_DN;
|
$dn = getDolGlobalString('LDAP_USER_DN');
|
||||||
$objectclass = $conf->global->LDAP_USER_OBJECT_CLASS;
|
$objectclass = getDolGlobalString('LDAP_USER_OBJECT_CLASS');
|
||||||
|
|
||||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||||
} elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') {
|
} elseif (getDolGlobalString('LDAP_SYNCHRO_ACTIVE') == 'ldap2dolibarr') {
|
||||||
$butlabel = $langs->trans("LDAPTestSearch");
|
$butlabel = $langs->trans("LDAPTestSearch");
|
||||||
$testlabel = 'testsearchuser';
|
$testlabel = 'testsearchuser';
|
||||||
$key = $conf->global->LDAP_KEY_USERS;
|
$key = getDolGlobalString('LDAP_KEY_USERS');
|
||||||
$dn = $conf->global->LDAP_USER_DN;
|
$dn = getDolGlobalString('LDAP_USER_DN');
|
||||||
$objectclass = $conf->global->LDAP_USER_OBJECT_CLASS;
|
$objectclass = getDolGlobalString('LDAP_USER_OBJECT_CLASS');
|
||||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,29 +479,29 @@ if (function_exists("ldap_connect")) {
|
|||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$required_fields = array(
|
$required_fields = array(
|
||||||
$conf->global->LDAP_KEY_USERS,
|
getDolGlobalString('LDAP_KEY_USERS'),
|
||||||
$conf->global->LDAP_FIELD_FULLNAME,
|
getDolGlobalString('LDAP_FIELD_FULLNAME'),
|
||||||
$conf->global->LDAP_FIELD_NAME,
|
getDolGlobalString('LDAP_FIELD_NAME'),
|
||||||
$conf->global->LDAP_FIELD_FIRSTNAME,
|
getDolGlobalString('LDAP_FIELD_FIRSTNAME'),
|
||||||
$conf->global->LDAP_FIELD_LOGIN,
|
getDolGlobalString('LDAP_FIELD_LOGIN'),
|
||||||
$conf->global->LDAP_FIELD_LOGIN_SAMBA,
|
getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'),
|
||||||
$conf->global->LDAP_FIELD_PASSWORD,
|
getDolGlobalString('LDAP_FIELD_PASSWORD'),
|
||||||
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
|
getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED'),
|
||||||
$conf->global->LDAP_FIELD_PHONE,
|
getDolGlobalString('LDAP_FIELD_PHONE'),
|
||||||
$conf->global->LDAP_FIELD_FAX,
|
getDolGlobalString('LDAP_FIELD_FAX'),
|
||||||
$conf->global->LDAP_FIELD_SKYPE,
|
getDolGlobalString('LDAP_FIELD_SKYPE'),
|
||||||
$conf->global->LDAP_FIELD_MOBILE,
|
getDolGlobalString('LDAP_FIELD_MOBILE'),
|
||||||
$conf->global->LDAP_FIELD_MAIL,
|
getDolGlobalString('LDAP_FIELD_MAIL'),
|
||||||
$conf->global->LDAP_FIELD_TITLE,
|
getDolGlobalString('LDAP_FIELD_TITLE'),
|
||||||
$conf->global->LDAP_FIELD_DESCRIPTION,
|
getDolGlobalString('LDAP_FIELD_DESCRIPTION'),
|
||||||
$conf->global->LDAP_FIELD_SID
|
getDolGlobalString('LDAP_FIELD_SID')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
||||||
|
|
||||||
// Get from LDAP database an array of results
|
// Get from LDAP database an array of results
|
||||||
$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, $required_fields, 1);
|
$ldapusers = $ldap->getRecords('*', getDolGlobalString('LDAP_USER_DN'), getDolGlobalString('LDAP_KEY_USERS'), $required_fields, 1);
|
||||||
//$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, '', 1);
|
//$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, '', 1);
|
||||||
|
|
||||||
if (is_array($ldapusers)) {
|
if (is_array($ldapusers)) {
|
||||||
@ -523,8 +523,8 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print "LDAP search for user:<br>\n";
|
print "LDAP search for user:<br>\n";
|
||||||
print "search: *<br>\n";
|
print "search: *<br>\n";
|
||||||
print "userDN: ".$conf->global->LDAP_USER_DN."<br>\n";
|
print "userDN: ".getDolGlobalString('LDAP_USER_DN')."<br>\n";
|
||||||
print "useridentifier: ".$conf->global->LDAP_KEY_USERS."<br>\n";
|
print "useridentifier: ".getDolGlobalString('LDAP_KEY_USERS')."<br>\n";
|
||||||
print "required_fields: ".implode(',', $required_fields)."<br>\n";
|
print "required_fields: ".implode(',', $required_fields)."<br>\n";
|
||||||
print "=> ".count($liste)." records<br>\n";
|
print "=> ".count($liste)." records<br>\n";
|
||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
|
|||||||
@ -237,7 +237,7 @@ if (empty($mysoc->country_code)) {
|
|||||||
|
|
||||||
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
|
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||||
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <>0 OR t.localtax2 <>0)";
|
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <> '0' OR t.localtax2 <> '0')";
|
||||||
$sql .= " ORDER BY t.taux ASC";
|
$sql .= " ORDER BY t.taux ASC";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
@ -848,8 +848,22 @@ if ($action == 'edit') {
|
|||||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
|
||||||
|
$dnsinfo = false;
|
||||||
|
if (!empty($companyemail) && function_exists('dns_get_record')) {
|
||||||
|
$arrayofemailparts = explode('@', $companyemail);
|
||||||
|
if (count($arrayofemailparts) == 2) {
|
||||||
|
$domain = $arrayofemailparts[1];
|
||||||
|
$dnsinfo = dns_get_record($domain, DNS_TXT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||||
|
foreach ($dnsinfo as $info) {
|
||||||
|
if (strpos($info['txt'], 'v=spf') !== false) {
|
||||||
|
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($text) {
|
if ($text) {
|
||||||
print info_admin($text);
|
print info_admin($text);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -542,7 +542,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||||
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
|
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
|
||||||
$array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable"));
|
$array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable"));
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL < 0) {
|
if ($conf->global->MAIN_FEATURES_LEVEL < 0) {
|
||||||
$array_version['deprecated'] = $langs->trans("Deprecated");
|
$array_version['deprecated'] = $langs->trans("Deprecated");
|
||||||
|
|||||||
@ -100,7 +100,7 @@ if (empty($conf->use_javascript_ajax)) {
|
|||||||
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, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<input type="submit" class="button" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button small" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -108,7 +108,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
|
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
|
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
@ -117,7 +117,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
|
print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
|
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
@ -126,7 +126,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
|
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
|
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|||||||
@ -683,6 +683,8 @@ if ($conf->use_javascript_ajax) {
|
|||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
|
print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
|
||||||
}
|
}
|
||||||
|
print "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
|
||||||
@ -693,6 +695,9 @@ if ($conf->use_javascript_ajax) {
|
|||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
|
||||||
}
|
}
|
||||||
|
print "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
@ -702,10 +707,23 @@ if ($conf->use_javascript_ajax) {
|
|||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
|
||||||
}
|
}
|
||||||
print "</td>";
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
/*
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringProject").'</td>';
|
||||||
|
print '<td class="right">';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
*/
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
|
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
|
||||||
|
|||||||
@ -187,8 +187,6 @@ if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//print "conf->global->MAIN_FEATURES_LEVEL = ".$conf->global->MAIN_FEATURES_LEVEL."<br><br>\n";
|
|
||||||
|
|
||||||
// Output mode
|
// Output mode
|
||||||
print load_fiche_titre($langs->trans("SyslogOutput"), '', '');
|
print load_fiche_titre($langs->trans("SyslogOutput"), '', '');
|
||||||
|
|
||||||
@ -207,7 +205,7 @@ foreach ($syslogModules as $moduleName) {
|
|||||||
|
|
||||||
$moduleactive = (int) $module->isActive();
|
$moduleactive = (int) $module->isActive();
|
||||||
//print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."<br>\n";
|
//print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."<br>\n";
|
||||||
if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (($moduleactive == -1) && getDolGlobalInt('MAIN_FEATURES_LEVEL') == 0) {
|
||||||
continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
|
continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -556,7 +556,7 @@ if ($mode == 'searchkey') {
|
|||||||
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
|
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
|
||||||
$transifexlangfile = '$'; // $ means 'All'
|
$transifexlangfile = '$'; // $ means 'All'
|
||||||
//$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key;
|
//$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?key='.$key;
|
||||||
$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key;
|
$transifexurl = 'https://www.transifex.com/dolibarr-association/dolibarr/translate/#'.$langcode.'/'.$transifexlangfile.'?q=key%3A'.$key;
|
||||||
|
|||||||
@ -169,7 +169,11 @@ if ($action == 'create') {
|
|||||||
// Target
|
// Target
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
|
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
|
||||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
$defaulttarget = 1;
|
||||||
|
if ($url && !preg_match('/^http/i', $url)) {
|
||||||
|
$defaulttarget = 0;
|
||||||
|
}
|
||||||
|
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||||
|
|
||||||
// Owner
|
// Owner
|
||||||
|
|||||||
@ -62,9 +62,9 @@ $id = GETPOST("id", 'int');
|
|||||||
|
|
||||||
$object = new Bookmark($db);
|
$object = new Bookmark($db);
|
||||||
|
|
||||||
$permissiontoread = $user->rights->bookmark->lire;
|
$permissiontoread = !empty($user->rights->bookmark->lire);
|
||||||
$permissiontoadd = $user->rights->bookmark->write;
|
$permissiontoadd = !empty($user->rights->bookmark->creer);
|
||||||
$permissiontodelete = $user->rights->bookmark->delete;
|
$permissiontodelete = !empty($user->rights->bookmark->supprimer);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1976,6 +1976,12 @@ class Categorie extends CommonObject
|
|||||||
if ($type == 'bank_account') {
|
if ($type == 'bank_account') {
|
||||||
$type = 'account';
|
$type = 'account';
|
||||||
}
|
}
|
||||||
|
if ($type == 'customer') {
|
||||||
|
$type = 'societe';
|
||||||
|
}
|
||||||
|
if ($type == 'supplier') {
|
||||||
|
$type = 'fournisseur';
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($searchList) && !is_array($searchList)) {
|
if (empty($searchList) && !is_array($searchList)) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@ -795,7 +795,7 @@ if ($type == Categorie::TYPE_CONTACT) {
|
|||||||
$permission = $user->rights->societe->creer;
|
$permission = $user->rights->societe->creer;
|
||||||
|
|
||||||
$contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
$contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||||
if ($contacts < 0) {
|
if (is_numeric($contacts) && $contacts < 0) {
|
||||||
dol_print_error($db, $object->error, $object->errors);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
} else {
|
} else {
|
||||||
// Form to add record into a category
|
// Form to add record into a category
|
||||||
|
|||||||
@ -1474,7 +1474,7 @@ if ($id > 0) {
|
|||||||
print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">';
|
print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">';
|
||||||
print '<input type="hidden" name="page_y" value="">';
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
if ($backtopage) {
|
if ($backtopage) {
|
||||||
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : htmlentities($_SERVER["HTTP_REFERER"])).'">';
|
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : dol_htmlentities($_SERVER["HTTP_REFERER"])).'">';
|
||||||
}
|
}
|
||||||
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||||
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
|
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
|
||||||
@ -2210,7 +2210,7 @@ if ($id > 0) {
|
|||||||
$delallowed = $user->rights->agenda->myactions->create;
|
$delallowed = $user->rights->agenda->myactions->create;
|
||||||
|
|
||||||
|
|
||||||
print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $object->default_lang);
|
print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang());
|
||||||
|
|
||||||
print '</div><div class="fichehalfright">';
|
print '</div><div class="fichehalfright">';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
|
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -629,14 +629,17 @@ print $nav;
|
|||||||
$s = $newtitle;
|
$s = $newtitle;
|
||||||
|
|
||||||
// Calendars from hooks
|
// Calendars from hooks
|
||||||
$parameters = array(); $object = null;
|
$parameters = array();
|
||||||
|
$object = null;
|
||||||
$reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action);
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$s .= $hookmanager->resPrint;
|
$s .= $hookmanager->resPrint;
|
||||||
} elseif ($reshook > 1) {
|
} elseif ($reshook > 1) {
|
||||||
$s = $hookmanager->resPrint;
|
$s = $hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
$viewyear = is_object($object) ? dol_print_date($object->datep, '%Y') : '';
|
||||||
|
$viewmonth = is_object($object) ? dol_print_date($object->datep, '%m') : '';
|
||||||
|
$viewday = is_object($object) ? dol_print_date($object->datep, '%d') : '';
|
||||||
$viewmode = '';
|
$viewmode = '';
|
||||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||||
@ -644,25 +647,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewm
|
|||||||
//$viewmode .= '</span>';
|
//$viewmode .= '</span>';
|
||||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||||
|
|
||||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||||
//$viewmode .= '</span>';
|
//$viewmode .= '</span>';
|
||||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||||
|
|
||||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||||
//$viewmode .= '</span>';
|
//$viewmode .= '</span>';
|
||||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||||
|
|
||||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||||
//$viewmode .= '</span>';
|
//$viewmode .= '</span>';
|
||||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||||
|
|
||||||
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.$viewyear.'&month='.$viewmonth.'&day='.$viewday.$paramnoactionodate.'">';
|
||||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||||
//$viewmode .= '</span>';
|
//$viewmode .= '</span>';
|
||||||
@ -671,7 +674,8 @@ $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsm
|
|||||||
$viewmode .= '<span class="marginrightonly"></span>';
|
$viewmode .= '<span class="marginrightonly"></span>';
|
||||||
|
|
||||||
// Add more views from hooks
|
// Add more views from hooks
|
||||||
$parameters = array(); $object = null;
|
$parameters = array();
|
||||||
|
$object = null;
|
||||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$viewmode .= $hookmanager->resPrint;
|
$viewmode .= $hookmanager->resPrint;
|
||||||
@ -681,7 +685,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
||||||
|
|
||||||
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
|
$newparam = '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
|
||||||
|
|
||||||
//$param='month='.$monthshown.'&year='.$year;
|
//$param='month='.$monthshown.'&year='.$year;
|
||||||
$hourminsec = '100000';
|
$hourminsec = '100000';
|
||||||
|
|||||||
@ -377,7 +377,6 @@ if ($conf->use_javascript_ajax) {
|
|||||||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||||
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
||||||
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
||||||
$s .= 'var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
|
|
||||||
}
|
}
|
||||||
$s .= '});'."\n";
|
$s .= '});'."\n";
|
||||||
$s .= '</script>'."\n";
|
$s .= '</script>'."\n";
|
||||||
|
|||||||
@ -387,7 +387,6 @@ if ($conf->use_javascript_ajax) {
|
|||||||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||||
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
if ($action == "show_week" || $action == "show_month" || empty($action)) {
|
||||||
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
$s .= 'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
|
||||||
$s .= 'var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
|
|
||||||
}
|
}
|
||||||
$s .= '});'."\n";
|
$s .= '});'."\n";
|
||||||
$s .= '</script>'."\n";
|
$s .= '</script>'."\n";
|
||||||
|
|||||||
@ -2014,15 +2014,15 @@ if ($action == 'create') {
|
|||||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
||||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
|
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
$morehtmlref .= '<br><span class="hideonsmartphone">'.$langs->trans('ThirdParty').' : </span>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
||||||
}
|
}
|
||||||
// Project
|
// Project
|
||||||
if (!empty($conf->projet->enabled)) {
|
if (!empty($conf->projet->enabled)) {
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
$morehtmlref .= '<br><span class="paddingrightonly">'.$langs->trans('Project').'</span>';
|
||||||
if (!$usercancreate) {
|
if ($usercancreate) {
|
||||||
if ($action != 'classify') {
|
if ($action != 'classify') {
|
||||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||||
}
|
}
|
||||||
@ -2041,7 +2041,7 @@ if ($action == 'create') {
|
|||||||
if (!empty($object->fk_project)) {
|
if (!empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
$morehtmlref .= ': '.$proj->getNomUrl(1);
|
||||||
if ($proj->title) {
|
if ($proj->title) {
|
||||||
$morehtmlref .= ' - '.$proj->title;
|
$morehtmlref .= ' - '.$proj->title;
|
||||||
}
|
}
|
||||||
@ -2679,7 +2679,7 @@ if ($action == 'create') {
|
|||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
|
||||||
|
|
||||||
// Show online signature link
|
// Show online signature link
|
||||||
$useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok
|
$useonlinesignature = 1; // Replace this with 1 when feature to make online signature is ok
|
||||||
|
|
||||||
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
|
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
|
||||||
print '<br><!-- Link to sign -->';
|
print '<br><!-- Link to sign -->';
|
||||||
|
|||||||
@ -1383,10 +1383,24 @@ if ($resql) {
|
|||||||
if (!empty($arrayfields['sale_representative']['checked'])) {
|
if (!empty($arrayfields['sale_representative']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
$totalarray = array(
|
||||||
|
'nbfield' => 0,
|
||||||
|
'val' => array(
|
||||||
|
'p.total_ht' => 0,
|
||||||
|
'p.total_tva' => 0,
|
||||||
|
'p.total_ttc' => 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array(
|
||||||
|
'arrayfields' => $arrayfields,
|
||||||
|
'param' => $param,
|
||||||
|
'sortfield' => $sortfield,
|
||||||
|
'sortorder' => $sortorder,
|
||||||
|
'totalarray' => &$totalarray,
|
||||||
|
);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (!empty($arrayfields['p.datec']['checked'])) {
|
if (!empty($arrayfields['p.datec']['checked'])) {
|
||||||
@ -1412,12 +1426,6 @@ if ($resql) {
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
|
||||||
$totalarray['nbfield'] = 0;
|
|
||||||
$totalarray['val'] = array();
|
|
||||||
$totalarray['val']['p.total_ht'] = 0;
|
|
||||||
$totalarray['val']['p.total_tva'] = 0;
|
|
||||||
$totalarray['val']['p.total_ttc'] = 0;
|
|
||||||
$typenArray = null;
|
$typenArray = null;
|
||||||
|
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
|
|||||||
@ -1345,10 +1345,25 @@ if ($resql) {
|
|||||||
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$totalarray = array(
|
||||||
|
'nbfield' => 0,
|
||||||
|
'val' => array(
|
||||||
|
'c.total_ht' => 0,
|
||||||
|
'c.total_tva' => 0,
|
||||||
|
'c.total_ttc' => 0,
|
||||||
|
),
|
||||||
|
'pos' => array(),
|
||||||
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array(
|
||||||
|
'arrayfields' => $arrayfields,
|
||||||
|
'param' => $param,
|
||||||
|
'sortfield' => $sortfield,
|
||||||
|
'sortorder' => $sortorder,
|
||||||
|
'totalarray' => &$totalarray,
|
||||||
|
);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (!empty($arrayfields['c.datec']['checked'])) {
|
if (!empty($arrayfields['c.datec']['checked'])) {
|
||||||
@ -1388,7 +1403,6 @@ if ($resql) {
|
|||||||
$generic_product = new Product($db);
|
$generic_product = new Product($db);
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
|
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -64,11 +64,12 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id);
|
$contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id);
|
||||||
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
if ($fielvalue) {
|
if ($fieldvalue) {
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
@ -97,6 +98,8 @@ $search_thirdparty_user = GETPOST("search_thirdparty", 'alpha') ?GETPOST("search
|
|||||||
$search_req_nb = GETPOST("req_nb", 'alpha');
|
$search_req_nb = GETPOST("req_nb", 'alpha');
|
||||||
$search_num_releve = GETPOST("search_num_releve", 'alpha');
|
$search_num_releve = GETPOST("search_num_releve", 'alpha');
|
||||||
$search_conciliated = GETPOST("search_conciliated", 'int');
|
$search_conciliated = GETPOST("search_conciliated", 'int');
|
||||||
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$num_releve = GETPOST("num_releve", "alpha");
|
$num_releve = GETPOST("num_releve", "alpha");
|
||||||
if (empty($dateop)) {
|
if (empty($dateop)) {
|
||||||
$dateop = -1;
|
$dateop = -1;
|
||||||
@ -211,6 +214,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_thirdparty_user = '';
|
$search_thirdparty_user = '';
|
||||||
$search_num_releve = '';
|
$search_num_releve = '';
|
||||||
$search_conciliated = '';
|
$search_conciliated = '';
|
||||||
|
$toselect = '';
|
||||||
|
|
||||||
$search_account = "";
|
$search_account = "";
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
@ -221,14 +225,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$objectclass = 'Account';
|
$objectclass = 'Account';
|
||||||
$objectlabel = 'BankTransaction';
|
$objectlabel = 'BankTransaction';
|
||||||
$permissiontoread = $user->rights->banque->lire;
|
$permissiontoread = !empty($user->rights->banque->lire);
|
||||||
$permissiontodelete = $user->rights->banque->supprimer;
|
$permissiontodelete = !empty($user->rights->banque->modifier);
|
||||||
$uploaddir = $conf->bank->dir_output;
|
$uploaddir = $conf->bank->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conciliation
|
// Conciliation
|
||||||
if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && $user->rights->banque->consolidate
|
if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', 'alpha')) && !empty($user->rights->banque->consolidate)
|
||||||
&& (!GETPOSTISSET('pageplusone') || (GETPOST('pageplusone') == GETPOST('pageplusoneold')))) {
|
&& (!GETPOSTISSET('pageplusone') || (GETPOST('pageplusone') == GETPOST('pageplusoneold')))) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -310,7 +314,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) {
|
if (GETPOST('save') && !$cancel && !empty($user->rights->banque->modifier)) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (price2num(GETPOST("addcredit")) > 0) {
|
if (price2num(GETPOST("addcredit")) > 0) {
|
||||||
@ -370,7 +374,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->modifier) {
|
if ($action == 'confirm_delete' && $confirm == 'yes' && !empty($user->rights->banque->modifier)) {
|
||||||
$accline = new AccountLine($db);
|
$accline = new AccountLine($db);
|
||||||
$result = $accline->fetch(GETPOST("rowid", "int"));
|
$result = $accline->fetch(GETPOST("rowid", "int"));
|
||||||
$result = $accline->delete($user);
|
$result = $accline->delete($user);
|
||||||
@ -484,6 +488,11 @@ if ($optioncss != '') {
|
|||||||
if ($action == 'reconcile') {
|
if ($action == 'reconcile') {
|
||||||
$param .= '&action=reconcile';
|
$param .= '&action=reconcile';
|
||||||
}
|
}
|
||||||
|
$totalarray = array(
|
||||||
|
'nbfield' => 0,
|
||||||
|
'totalcred' => 0,
|
||||||
|
'totaldeb' => 0,
|
||||||
|
);
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
@ -574,7 +583,7 @@ if ($search_bid > 0) {
|
|||||||
}
|
}
|
||||||
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX."bank as b";
|
$sql .= " ".MAIN_DB_PREFIX."bank as b";
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||||
}
|
}
|
||||||
$sql .= " WHERE b.fk_account = ba.rowid";
|
$sql .= " WHERE b.fk_account = ba.rowid";
|
||||||
@ -732,7 +741,7 @@ $resql = $db->query($sql);
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
$arrayofselected = (!empty($toselect) && is_array($toselect)) ? $toselect : array();
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
@ -759,7 +768,9 @@ if ($resql) {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="'.($action ? $action : 'search').'">';
|
print '<input type="hidden" name="action" value="'.($action ? $action : 'search').'">';
|
||||||
|
if (!empty($view)) {
|
||||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||||
|
}
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
@ -833,7 +844,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Form to add a transaction with no invoice
|
// Form to add a transaction with no invoice
|
||||||
if ($user->rights->banque->modifier && $action == 'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
|
if (!empty($user->rights->banque->modifier) && $action == 'addline' && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) {
|
||||||
print load_fiche_titre($langs->trans("AddBankRecordLong"), '', '');
|
print load_fiche_titre($langs->trans("AddBankRecordLong"), '', '');
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -939,6 +950,7 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$morehtml = '';
|
||||||
/*$morehtml = '<div class="inline-block '.(($buttonreconcile || $newcardbutton) ? 'marginrightonly' : '').'">';
|
/*$morehtml = '<div class="inline-block '.(($buttonreconcile || $newcardbutton) ? 'marginrightonly' : '').'">';
|
||||||
$morehtml .= '<label for="pageplusone">'.$langs->trans("Page")."</label> "; // ' Page ';
|
$morehtml .= '<label for="pageplusone">'.$langs->trans("Page")."</label> "; // ' Page ';
|
||||||
$morehtml .= '<input type="text" name="pageplusone" id="pageplusone" class="flat right width25 pageplusone" value="'.($page + 1).'">';
|
$morehtml .= '<input type="text" name="pageplusone" id="pageplusone" class="flat right width25 pageplusone" value="'.($page + 1).'">';
|
||||||
@ -1050,7 +1062,7 @@ if ($resql) {
|
|||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).'" size="2"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="req_nb" value="'.dol_escape_htmltag($search_req_nb).'" size="2"></td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['bu.label']['checked'])) {
|
if (!empty($arrayfields['bu.label']['checked'])) {
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth75" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty_user).'"></td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['ba.ref']['checked'])) {
|
if (!empty($arrayfields['ba.ref']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
@ -1160,7 +1172,6 @@ if ($resql) {
|
|||||||
// Loop on each record
|
// Loop on each record
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
|
|
||||||
$totalarray = array();
|
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$links = $bankaccountstatic->get_url($objp->rowid);
|
$links = $bankaccountstatic->get_url($objp->rowid);
|
||||||
@ -1296,18 +1307,10 @@ if ($resql) {
|
|||||||
$backgroundcolor = "class='oddeven'";
|
$backgroundcolor = "class='oddeven'";
|
||||||
} else {
|
} else {
|
||||||
if ($objp->amount < 0) {
|
if ($objp->amount < 0) {
|
||||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) {
|
$color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR1', 'fca955');
|
||||||
$color = '#fca955';
|
|
||||||
} else {
|
|
||||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
|
|
||||||
}
|
|
||||||
$backgroundcolor = 'style="background: '.$color.';"';
|
$backgroundcolor = 'style="background: '.$color.';"';
|
||||||
} else {
|
} else {
|
||||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
|
$color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR2', '7fdb86');
|
||||||
$color = '#7fdb86';
|
|
||||||
} else {
|
|
||||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
|
|
||||||
}
|
|
||||||
$backgroundcolor = 'style="background: '.$color.';"';
|
$backgroundcolor = 'style="background: '.$color.';"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1333,7 +1336,7 @@ if ($resql) {
|
|||||||
$titletoshow = '';
|
$titletoshow = '';
|
||||||
$reg = array();
|
$reg = array();
|
||||||
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction
|
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthee on tente recherche de traduction
|
||||||
if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) {
|
if (!empty($reg[1]) && $langs->trans($reg[1]) != $reg[1]) {
|
||||||
$labeltoshow = $langs->trans($reg[1]);
|
$labeltoshow = $langs->trans($reg[1]);
|
||||||
} else {
|
} else {
|
||||||
if ($objp->label == '(payment_salary)') {
|
if ($objp->label == '(payment_salary)') {
|
||||||
@ -1357,6 +1360,7 @@ if ($resql) {
|
|||||||
} elseif ($links[$key]['type'] == 'payment') {
|
} elseif ($links[$key]['type'] == 'payment') {
|
||||||
$paymentstatic->id = $links[$key]['url_id'];
|
$paymentstatic->id = $links[$key]['url_id'];
|
||||||
$paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment
|
$paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment
|
||||||
|
$paymentstatic->date = $db->jdate($objp->do);
|
||||||
print ' '.$paymentstatic->getNomUrl(2);
|
print ' '.$paymentstatic->getNomUrl(2);
|
||||||
} elseif ($links[$key]['type'] == 'payment_supplier') {
|
} elseif ($links[$key]['type'] == 'payment_supplier') {
|
||||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||||
|
|||||||
@ -63,6 +63,7 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
$socid = 0;
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
@ -568,6 +569,12 @@ if ($result) {
|
|||||||
// Bank line
|
// Bank line
|
||||||
print '<tr><td class="toptd">'.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).'</td><td>';
|
print '<tr><td class="toptd">'.$form->editfieldkey('RubriquesTransactions', 'custcats', '', $object, 0).'</td><td>';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, null, 'parent', null, null, 1);
|
||||||
|
$arrayselected = array();
|
||||||
|
$c = new Categorie($db);
|
||||||
|
$cats = $c->containing($bankline->id, Categorie::TYPE_BANK_LINE);
|
||||||
|
foreach ($cats as $cat) {
|
||||||
|
$arrayselected[] = $cat->id;
|
||||||
|
}
|
||||||
print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%");
|
print img_picto('', 'category', 'class="paddingright"').$form->multiselectarray('custcats', $cate_arbo, $arrayselected, null, null, null, null, "90%");
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2846,15 +2846,6 @@ if (empty($reshook)) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (empty($object->id)) {
|
|
||||||
llxHeader();
|
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
$langs->load('errors');
|
|
||||||
echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
|
||||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
|
||||||
llxFooter();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
@ -3828,8 +3819,16 @@ if ($action == 'create') {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</form>';
|
print "</form>\n";
|
||||||
} elseif ($id > 0 || !empty($ref)) {
|
} elseif ($id > 0 || !empty($ref)) {
|
||||||
|
if (empty($object->id)) {
|
||||||
|
llxHeader();
|
||||||
|
$langs->load('errors');
|
||||||
|
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||||
|
llxFooter();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show object in view mode
|
* Show object in view mode
|
||||||
*/
|
*/
|
||||||
@ -4092,10 +4091,10 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation du classement paye
|
// Confirmation du classement paye
|
||||||
if ($action == 'paid' && $resteapayer <= 0) {
|
if ($action == 'paid' && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $resteapayer == $object->total_ttc))) {
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
|
||||||
}
|
}
|
||||||
if ($action == 'paid' && $resteapayer > 0) {
|
if ($action == 'paid' && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $resteapayer != $object->total_ttc)) {
|
||||||
$close = array();
|
$close = array();
|
||||||
// Code
|
// Code
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -5451,14 +5450,17 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Classify paid
|
// Classify paid
|
||||||
if (($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)))
|
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $usercanissuepayment && (
|
||||||
|| ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $object->total_ttc > 0 && $resteapayer == 0 && $usercanissuepayment && empty($discount->id))
|
($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && ($resteapayer <= 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer))) ||
|
||||||
|
($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0) ||
|
||||||
|
($object->type == Facture::TYPE_DEPOSIT && $object->total_ttc > 0 && ($resteapayer == 0 || (!empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) && $object->total_ttc == $resteapayer)))
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>';
|
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Classify 'closed not completely paid' (possible if validated and not yet filed paid)
|
// Classify 'closed not completely paid' (possible if validated and not yet filed paid)
|
||||||
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && $usercanissuepayment) {
|
if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $resteapayer > 0 && (empty($conf->global->INVOICE_CAN_ADD_PAYMENT_EVEN_IF_ALREADY_PAID) || $resteapayer != $object->total_ttc) && $usercanissuepayment) {
|
||||||
if ($totalpaye > 0 || $totalcreditnotes > 0) {
|
if ($totalpaye > 0 || $totalcreditnotes > 0) {
|
||||||
// If one payment or one credit note was linked to this invoice
|
// If one payment or one credit note was linked to this invoice
|
||||||
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaidPartially').'</a>';
|
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaidPartially').'</a>';
|
||||||
|
|||||||
@ -102,10 +102,8 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
|
|||||||
|
|
||||||
if (empty($object->id)) {
|
if (empty($object->id)) {
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,10 +94,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
|||||||
|
|
||||||
if (empty($object->id)) {
|
if (empty($object->id)) {
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,10 +64,8 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
|
|||||||
|
|
||||||
if (empty($object->id)) {
|
if (empty($object->id)) {
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -676,12 +676,6 @@ if (strlen(trim($search_country))) {
|
|||||||
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') {
|
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') {
|
||||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
||||||
}
|
}
|
||||||
if ($search_company) {
|
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
|
||||||
}
|
|
||||||
if ($search_company_alias) {
|
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
|
||||||
}
|
|
||||||
if ($search_montant_ht != '') {
|
if ($search_montant_ht != '') {
|
||||||
$sql .= natural_search('f.total_ht', $search_montant_ht, 1);
|
$sql .= natural_search('f.total_ht', $search_montant_ht, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,10 +79,8 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
if (empty($object->id)) {
|
if (empty($object->id)) {
|
||||||
llxHeader();
|
llxHeader();
|
||||||
$head = facture_prepare_head($object);
|
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -388,7 +388,7 @@ if ($action == 'new') {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
$accounts[$obj->bid] = $obj->label;
|
$accounts[$obj->bid] = $obj->label;
|
||||||
$lines[$obj->bid][$i]["date"] = $db->jdate($obj->date);
|
$lines[$obj->bid][$i]["date"] = $db->jdate($obj->datec);
|
||||||
$lines[$obj->bid][$i]["amount"] = $obj->amount;
|
$lines[$obj->bid][$i]["amount"] = $obj->amount;
|
||||||
$lines[$obj->bid][$i]["emetteur"] = $obj->emetteur;
|
$lines[$obj->bid][$i]["emetteur"] = $obj->emetteur;
|
||||||
$lines[$obj->bid][$i]["numero"] = $obj->num_chq;
|
$lines[$obj->bid][$i]["numero"] = $obj->num_chq;
|
||||||
@ -398,6 +398,7 @@ if ($action == 'new') {
|
|||||||
$lines[$obj->bid][$i]["label"] = $obj->transactionlabel;
|
$lines[$obj->bid][$i]["label"] = $obj->transactionlabel;
|
||||||
$lines[$obj->bid][$i]["paymentid"] = $obj->paymentid;
|
$lines[$obj->bid][$i]["paymentid"] = $obj->paymentid;
|
||||||
$lines[$obj->bid][$i]["paymentref"] = $obj->paymentref;
|
$lines[$obj->bid][$i]["paymentref"] = $obj->paymentref;
|
||||||
|
$lines[$obj->bid][$i]["paymentdate"] = $db->jdate($obj->date);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,6 +469,7 @@ if ($action == 'new') {
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$paymentstatic->id = $value["paymentid"];
|
$paymentstatic->id = $value["paymentid"];
|
||||||
$paymentstatic->ref = $value["paymentref"];
|
$paymentstatic->ref = $value["paymentref"];
|
||||||
|
$paymentstatic->date = $value["paymentdate"];
|
||||||
if ($paymentstatic->id) {
|
if ($paymentstatic->id) {
|
||||||
print $paymentstatic->getNomUrl(1);
|
print $paymentstatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -182,7 +182,6 @@ if ($result > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
$ldap->close();
|
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1031,6 +1031,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
while ($i < min($num, $limit)) {
|
while ($i < min($num, $limit)) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
|||||||
@ -492,7 +492,7 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
|||||||
|
|
||||||
$url = DOL_URL_ROOT.'/contrat/card.php?action=create';
|
$url = DOL_URL_ROOT.'/contrat/card.php?action=create';
|
||||||
if (!empty($socid)) {
|
if (!empty($socid)) {
|
||||||
$url .= '&socid='.$socid;
|
$url .= '&socid='.((int) $socid);
|
||||||
}
|
}
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer);
|
$newcardbutton = dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer);
|
||||||
|
|
||||||
@ -600,11 +600,11 @@ if (!empty($arrayfields['s.email']['checked'])) {
|
|||||||
}
|
}
|
||||||
// Town
|
// Town
|
||||||
if (!empty($arrayfields['s.town']['checked'])) {
|
if (!empty($arrayfields['s.town']['checked'])) {
|
||||||
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
|
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
|
||||||
}
|
}
|
||||||
// Zip
|
// Zip
|
||||||
if (!empty($arrayfields['s.zip']['checked'])) {
|
if (!empty($arrayfields['s.zip']['checked'])) {
|
||||||
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
|
print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.dol_escape_htmltag($search_zip).'"></td>';
|
||||||
}
|
}
|
||||||
// State
|
// State
|
||||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||||
@ -795,11 +795,12 @@ while ($i < min($num, $limit)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ref thirdparty
|
||||||
if (!empty($arrayfields['c.ref_customer']['checked'])) {
|
if (!empty($arrayfields['c.ref_customer']['checked'])) {
|
||||||
print '<td>'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';
|
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag(dol_string_nohtmltag($contracttmp->getFormatedCustomerRef($obj->ref_customer))).'">'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['c.ref_supplier']['checked'])) {
|
if (!empty($arrayfields['c.ref_supplier']['checked'])) {
|
||||||
print '<td>'.$obj->ref_supplier.'</td>';
|
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->ref_supplier).'">'.dol_escape_htmltag($obj->ref_supplier).'</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td class="tdoverflowmax150">';
|
print '<td class="tdoverflowmax150">';
|
||||||
@ -810,7 +811,7 @@ while ($i < min($num, $limit)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['s.email']['checked'])) {
|
if (!empty($arrayfields['s.email']['checked'])) {
|
||||||
print '<td>'.$obj->email.'</td>';
|
print '<td>'.dol_print_email($obj->email).'</td>';
|
||||||
}
|
}
|
||||||
// Town
|
// Town
|
||||||
if (!empty($arrayfields['s.town']['checked'])) {
|
if (!empty($arrayfields['s.town']['checked'])) {
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validation of fields values
|
// Validation of fields values
|
||||||
if ($conf->global->MAIN_FEATURE_LEVEL >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) {
|
||||||
if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) {
|
if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) {
|
||||||
if (!$object->validateField($object->fields, $key, $value)) {
|
if (!$object->validateField($object->fields, $key, $value)) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -226,7 +226,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validation of fields values
|
// Validation of fields values
|
||||||
if ($conf->global->MAIN_FEATURE_LEVEL >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 || !empty($conf->global->MAIN_ACTIVATE_VALIDATION_RESULT)) {
|
||||||
if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) {
|
if (!$error && !empty($val['validate']) && is_callable(array($object, 'validateField'))) {
|
||||||
if (!$object->validateField($object->fields, $key, $value)) {
|
if (!$object->validateField($object->fields, $key, $value)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -1556,6 +1556,7 @@ if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm ==
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Approve for leave only
|
||||||
if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $confirm == 'yes')) && $permissiontoapprove) {
|
if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $confirm == 'yes')) && $permissiontoapprove) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
|
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && !empty($user->rights->produit->creer)) {
|
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
|
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/bookmarks_page.php
|
* \file htdocs/core/bookmarks_page.php
|
||||||
* \brief File to return a page with the complete list of bookmarks (all search input fields)
|
* \brief File to return a page with the complete list of bookmarks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
@ -45,7 +45,7 @@ if (GETPOST('lang', 'aZ09')) {
|
|||||||
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->loadLangs(array("bookmarks"));
|
||||||
|
|
||||||
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
||||||
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
||||||
@ -57,7 +57,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
|||||||
|
|
||||||
$title = $langs->trans("Bookmarks");
|
$title = $langs->trans("Bookmarks");
|
||||||
|
|
||||||
// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
|
// URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests
|
||||||
$head = '<!-- Bookmarks access -->'."\n";
|
$head = '<!-- Bookmarks access -->'."\n";
|
||||||
$arrayofjs = array();
|
$arrayofjs = array();
|
||||||
$arrayofcss = array();
|
$arrayofcss = array();
|
||||||
@ -69,8 +69,6 @@ print '<body>'."\n";
|
|||||||
print '<div>';
|
print '<div>';
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
|
|
||||||
$nbofsearch = 0;
|
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
$hookmanager->initHooks(array('bookmarks'));
|
$hookmanager->initHooks(array('bookmarks'));
|
||||||
|
|
||||||
@ -78,17 +76,18 @@ $hookmanager->initHooks(array('bookmarks'));
|
|||||||
$bookmarkList = '';
|
$bookmarkList = '';
|
||||||
$searchForm = '';
|
$searchForm = '';
|
||||||
|
|
||||||
$arrayresult = array();
|
|
||||||
//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
|
||||||
|
|
||||||
|
if (empty($conf->bookmarks->enabled)) {
|
||||||
|
$langs->load("admin");
|
||||||
// Menu with list of bookmarks
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).'</span>';
|
||||||
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
$bookmarkList .= '<br><br>';
|
||||||
$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)";
|
} else {
|
||||||
$sql .= " AND entity IN (".getEntity('bookmarks').")";
|
// Menu with list of bookmarks
|
||||||
$sql .= " ORDER BY position";
|
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
|
||||||
if ($resql = $db->query($sql)) {
|
$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)";
|
||||||
|
$sql .= " AND entity IN (".getEntity('bookmarks').")";
|
||||||
|
$sql .= " ORDER BY position";
|
||||||
|
if ($resql = $db->query($sql)) {
|
||||||
$bookmarkList = '<div id="dropdown-bookmarks-list" class="start">';
|
$bookmarkList = '<div id="dropdown-bookmarks-list" class="start">';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
|
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
|
||||||
@ -97,13 +96,23 @@ if ($resql = $db->query($sql)) {
|
|||||||
$bookmarkList .= '</a>';
|
$bookmarkList .= '</a>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if ($i == 0) {
|
||||||
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("NoBookmarks").'</span>';
|
||||||
|
$bookmarkList .= '<br><br>';
|
||||||
|
|
||||||
|
$newcardbutton = '';
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||||
|
|
||||||
|
$bookmarkList .= '<center>'.$newcardbutton.'</center>';
|
||||||
|
}
|
||||||
$bookmarkList .= '</div>';
|
$bookmarkList .= '</div>';
|
||||||
|
|
||||||
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
|
||||||
} else {
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$searchForm .= '<input name="bookmark" id="top-bookmark-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Bookmarks').'" autocomplete="off" >';
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Execute hook printBookmarks
|
// Execute hook printBookmarks
|
||||||
$parameters = array('bookmarks'=>$bookmarkList);
|
$parameters = array('bookmarks'=>$bookmarkList);
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
$year = dol_print_date($this->db->jdate($objp->dateh), "%Y", 'gmt');
|
$year = dol_print_date($this->db->jdate($objp->dateh), "%Y");
|
||||||
$Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription;
|
$Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription;
|
||||||
$Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1;
|
$Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1;
|
||||||
$tot += $objp->subscription;
|
$tot += $objp->subscription;
|
||||||
|
|||||||
@ -7874,11 +7874,6 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$out .= ($display_type=='card' ? '</td>' : '</div>');
|
$out .= ($display_type=='card' ? '</td>' : '</div>');
|
||||||
|
|
||||||
/*for($ii = 0; $ii < ($colspan - 1); $ii++)
|
|
||||||
{
|
|
||||||
$out .='<td class="'.$this->element.'_extras_'.$key.'"></td>';
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) {
|
if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) {
|
||||||
$out .= ($display_type=='card' ? '</tr>' : '</div>');
|
$out .= ($display_type=='card' ? '</tr>' : '</div>');
|
||||||
} else {
|
} else {
|
||||||
@ -8887,7 +8882,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT ".$objectline->getFieldList('l');
|
$sql = "SELECT ".$objectline->getFieldList('l');
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as l";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$objectline->table_element." as l";
|
||||||
$sql .= " WHERE l.fk_".$this->element." = ".((int) $this->id);
|
$sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id);
|
||||||
if ($morewhere) {
|
if ($morewhere) {
|
||||||
$sql .= $morewhere;
|
$sql .= $morewhere;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,7 +222,7 @@ class FileUpload
|
|||||||
protected function setFileDeleteUrl($file)
|
protected function setFileDeleteUrl($file)
|
||||||
{
|
{
|
||||||
$file->delete_url = $this->options['script_url']
|
$file->delete_url = $this->options['script_url']
|
||||||
.'?file='.rawurlencode($file->name).'&fk_element='.$this->fk_element.'&element='.$this->element;
|
.'?file='.urlencode($file->name).'&fk_element='.urlencode($this->fk_element).'&element='.urlencode($this->element);
|
||||||
$file->delete_type = $this->options['delete_type'];
|
$file->delete_type = $this->options['delete_type'];
|
||||||
if ($file->delete_type !== 'DELETE') {
|
if ($file->delete_type !== 'DELETE') {
|
||||||
$file->delete_url .= '&_method=DELETE';
|
$file->delete_url .= '&_method=DELETE';
|
||||||
|
|||||||
@ -229,7 +229,8 @@ class HookManager
|
|||||||
'showLinkToObjectBlock',
|
'showLinkToObjectBlock',
|
||||||
'setContentSecurityPolicy',
|
'setContentSecurityPolicy',
|
||||||
'setHtmlTitle',
|
'setHtmlTitle',
|
||||||
'completeTabsHead'
|
'completeTabsHead',
|
||||||
|
'formDolBanner'
|
||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
$hooktype = 'addreplace';
|
$hooktype = 'addreplace';
|
||||||
|
|||||||
@ -5088,8 +5088,7 @@ class Form
|
|||||||
if ($selected) {
|
if ($selected) {
|
||||||
$projet = new Project($this->db);
|
$projet = new Project($this->db);
|
||||||
$projet->fetch($selected);
|
$projet->fetch($selected);
|
||||||
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
|
$out .= $projet->getNomUrl(1, '', 1);
|
||||||
$out .= $projet->getNomUrl(0, '', 1);
|
|
||||||
} else {
|
} else {
|
||||||
$out .= " ";
|
$out .= " ";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -304,7 +304,7 @@ class FormAdmin
|
|||||||
if (preg_match('/\.lib/i', $filelib)) {
|
if (preg_match('/\.lib/i', $filelib)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_FEATURES_LEVEL) && in_array($file, $expdevmenu)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') == 0 && in_array($file, $expdevmenu)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1373,7 +1373,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
// Preview link
|
// Preview link
|
||||||
if (!$editline) {
|
if (!$editline) {
|
||||||
print $this->showPreview($file, $modulepart, $filepath, 0, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
|
print $this->showPreview($file, $modulepart, $filepath, 0, 'entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|||||||
@ -514,7 +514,17 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
|
|
||||||
$linkedtothirdparty = false;
|
$linkedtothirdparty = false;
|
||||||
if (!in_array($table_element, array('don', 'expensereport_det', 'expensereport', 'loan', 'stock_mouvement', 'payment_salary', 'payment_various', 'chargesociales', 'entrepot'))) {
|
if (!in_array($table_element, array(
|
||||||
|
'don',
|
||||||
|
'expensereport_det',
|
||||||
|
'expensereport', 'loan',
|
||||||
|
'stock_mouvement',
|
||||||
|
'payment_salary',
|
||||||
|
'payment_various',
|
||||||
|
'salary',
|
||||||
|
'chargesociales',
|
||||||
|
'entrepot')
|
||||||
|
)) {
|
||||||
$linkedtothirdparty = true;
|
$linkedtothirdparty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -104,6 +104,7 @@ class FormPropal
|
|||||||
print '<option value="-1"> </option>';
|
print '<option value="-1"> </option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
foreach ($listofstatus as $key => $obj) {
|
foreach ($listofstatus as $key => $obj) {
|
||||||
if ($excludedraft) {
|
if ($excludedraft) {
|
||||||
if ($obj['code'] == 'Draft' || $obj['code'] == 'PR_DRAFT') {
|
if ($obj['code'] == 'Draft' || $obj['code'] == 'PR_DRAFT') {
|
||||||
|
|||||||
@ -3,10 +3,11 @@
|
|||||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2021 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2021 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
@ -508,12 +509,14 @@ class FormTicket
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($subelement != 'project') {
|
||||||
if (!empty($conf->projet->enabled) && !$this->ispublic) {
|
if (!empty($conf->projet->enabled) && !$this->ispublic) {
|
||||||
$formproject = new FormProjets($this->db);
|
$formproject = new FormProjets($this->db);
|
||||||
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
|
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
|
||||||
print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class InfoBox
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_FEATURES_LEVEL) || $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||||
return array(
|
return array(
|
||||||
0 => 'Home',
|
0 => 'Home',
|
||||||
1 => 'UsersHome',
|
1 => 'UsersHome',
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -48,6 +48,11 @@ class Ldap
|
|||||||
*/
|
*/
|
||||||
public $server = array();
|
public $server = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current connected server
|
||||||
|
*/
|
||||||
|
public $connectedServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base DN (e.g. "dc=foo,dc=com")
|
* Base DN (e.g. "dc=foo,dc=com")
|
||||||
*/
|
*/
|
||||||
@ -132,35 +137,33 @@ class Ldap
|
|||||||
if (!empty($conf->global->LDAP_SERVER_HOST_SLAVE)) {
|
if (!empty($conf->global->LDAP_SERVER_HOST_SLAVE)) {
|
||||||
$this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE;
|
$this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE;
|
||||||
}
|
}
|
||||||
$this->serverPort = $conf->global->LDAP_SERVER_PORT;
|
$this->serverPort = getDolGlobalInt('LDAP_SERVER_PORT', 389);
|
||||||
$this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION;
|
$this->ldapProtocolVersion = getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION');
|
||||||
$this->dn = $conf->global->LDAP_SERVER_DN;
|
$this->dn = getDolGlobalString('LDAP_SERVER_DN');
|
||||||
$this->serverType = $conf->global->LDAP_SERVER_TYPE;
|
$this->serverType = getDolGlobalString('LDAP_SERVER_TYPE');
|
||||||
|
|
||||||
$this->domain = $conf->global->LDAP_SERVER_DN;
|
$this->domain = getDolGlobalString('LDAP_SERVER_DN');
|
||||||
$this->searchUser = $conf->global->LDAP_ADMIN_DN;
|
$this->searchUser = getDolGlobalString('LDAP_ADMIN_DN');
|
||||||
$this->searchPassword = $conf->global->LDAP_ADMIN_PASS;
|
$this->searchPassword = getDolGlobalString('LDAP_ADMIN_PASS');
|
||||||
$this->people = $conf->global->LDAP_USER_DN;
|
$this->people = getDolGlobalString('LDAP_USER_DN');
|
||||||
$this->groups = $conf->global->LDAP_GROUP_DN;
|
$this->groups = getDolGlobalString('LDAP_GROUP_DN');
|
||||||
|
|
||||||
$this->filter = $conf->global->LDAP_FILTER_CONNECTION; // Filter on user
|
$this->filter = getDolGlobalString('LDAP_FILTER_CONNECTION'); // Filter on user
|
||||||
$this->filtergroup = $conf->global->LDAP_GROUP_FILTER; // Filter on groups
|
$this->filtergroup = getDolGlobalString('LDAP_GROUP_FILTER'); // Filter on groups
|
||||||
$this->filtermember = $conf->global->LDAP_MEMBER_FILTER; // Filter on member
|
$this->filtermember = getDolGlobalString('LDAP_MEMBER_FILTER'); // Filter on member
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
$this->attr_login = $conf->global->LDAP_FIELD_LOGIN; //unix
|
$this->attr_login = getDolGlobalString('LDAP_FIELD_LOGIN'); //unix
|
||||||
$this->attr_sambalogin = $conf->global->LDAP_FIELD_LOGIN_SAMBA; //samba, activedirectory
|
$this->attr_sambalogin = getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'); //samba, activedirectory
|
||||||
$this->attr_name = $conf->global->LDAP_FIELD_NAME;
|
$this->attr_name = getDolGlobalString('LDAP_FIELD_NAME');
|
||||||
$this->attr_firstname = $conf->global->LDAP_FIELD_FIRSTNAME;
|
$this->attr_firstname = getDolGlobalString('LDAP_FIELD_FIRSTNAME');
|
||||||
$this->attr_mail = $conf->global->LDAP_FIELD_MAIL;
|
$this->attr_mail = getDolGlobalString('LDAP_FIELD_MAIL');
|
||||||
$this->attr_phone = $conf->global->LDAP_FIELD_PHONE;
|
$this->attr_phone = getDolGlobalString('LDAP_FIELD_PHONE');
|
||||||
$this->attr_skype = $conf->global->LDAP_FIELD_SKYPE;
|
$this->attr_skype = getDolGlobalString('LDAP_FIELD_SKYPE');
|
||||||
$this->attr_fax = $conf->global->LDAP_FIELD_FAX;
|
$this->attr_fax = getDolGlobalString('LDAP_FIELD_FAX');
|
||||||
$this->attr_mobile = $conf->global->LDAP_FIELD_MOBILE;
|
$this->attr_mobile = getDolGlobalString('LDAP_FIELD_MOBILE');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Connection handling methods -------------------------------------------
|
// Connection handling methods -------------------------------------------
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -178,6 +181,8 @@ class Ldap
|
|||||||
|
|
||||||
$connected = 0;
|
$connected = 0;
|
||||||
$this->bind = 0;
|
$this->bind = 0;
|
||||||
|
$this->error = 0;
|
||||||
|
$this->connectedServer = '';
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (count($this->server) == 0 || empty($this->server[0])) {
|
if (count($this->server) == 0 || empty($this->server[0])) {
|
||||||
@ -226,7 +231,7 @@ class Ldap
|
|||||||
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
|
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
|
||||||
$this->error = 'ldap_start_tls Failed to start TLS '.ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = 'ldap_start_tls Failed to start TLS '.ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
$connected = 0;
|
$connected = 0;
|
||||||
$this->close();
|
$this->unbind();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +266,7 @@ class Ldap
|
|||||||
}
|
}
|
||||||
// Try in anonymous
|
// Try in anonymous
|
||||||
if (!$this->bind) {
|
if (!$this->bind) {
|
||||||
dol_syslog(get_class($this)."::connect_bind try bind on ".$host, LOG_DEBUG);
|
dol_syslog(get_class($this)."::connect_bind try bind anonymously on ".$host, LOG_DEBUG);
|
||||||
$result = $this->bind();
|
$result = $this->bind();
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
@ -275,7 +280,9 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$connected) {
|
if (!$connected) {
|
||||||
$this->close();
|
$this->unbind();
|
||||||
|
} else {
|
||||||
|
$this->connectedServer = $host;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,16 +295,18 @@ class Ldap
|
|||||||
$return = -1;
|
$return = -1;
|
||||||
dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING);
|
dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply closes the connection set up earlier.
|
* Simply closes the connection set up earlier. Returns true if OK, false if there was an error.
|
||||||
* Returns true if OK, false if there was an error.
|
* This method seems a duplicate/alias of unbind().
|
||||||
*
|
*
|
||||||
* @return boolean true or false
|
* @return boolean true or false
|
||||||
|
* @deprecated ldap_close is an alias of ldap_unbind
|
||||||
|
* @see unbind()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
@ -349,16 +358,21 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unbind du serveur ldap.
|
* Unbind of LDAP server (close connection).
|
||||||
*
|
*
|
||||||
* @return boolean true or false
|
* @return boolean true or false
|
||||||
|
* @see close()
|
||||||
*/
|
*/
|
||||||
public function unbind()
|
public function unbind()
|
||||||
{
|
{
|
||||||
if (!$this->result = @ldap_unbind($this->connection)) {
|
$this->result = true;
|
||||||
return false;
|
if ($this->connection) {
|
||||||
} else {
|
$this->result = @ldap_unbind($this->connection);
|
||||||
|
}
|
||||||
|
if ($this->result) {
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +425,7 @@ class Ldap
|
|||||||
*/
|
*/
|
||||||
public function add($dn, $info, $user)
|
public function add($dn, $info, $user)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::add dn=".$dn." info=".join(',', $info));
|
dol_syslog(get_class($this)."::add dn=".$dn." info=".json_encode($info));
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (!$this->connection) {
|
if (!$this->connection) {
|
||||||
|
|||||||
@ -464,20 +464,26 @@ class SMTPs
|
|||||||
$host = 'tls://'.$host;
|
$host = 'tls://'.$host;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hosth = $host;
|
$hosth = $host; // so for example 'localhost' or 'smtp-relay.gmail.com'
|
||||||
|
|
||||||
if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
||||||
// If the from to is 'aaa <bbb@ccc.com>', we will keep 'ccc.com'
|
if (!is_numeric($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
||||||
|
// If value of MAIL_SMTP_USE_FROM_FOR_HELO is a string, we use it as domain name
|
||||||
|
$hosth = $conf->global->MAIL_SMTP_USE_FROM_FOR_HELO;
|
||||||
|
} else {
|
||||||
|
// If value of MAIL_SMTP_USE_FROM_FOR_HELO is 1, we use the domain in the from.
|
||||||
|
// So if the from to is 'aaa <bbb@ccc.com>', we will keep 'ccc.com'
|
||||||
$hosth = $this->getFrom('addr');
|
$hosth = $this->getFrom('addr');
|
||||||
$hosth = preg_replace('/^.*</', '', $hosth);
|
$hosth = preg_replace('/^.*</', '', $hosth);
|
||||||
$hosth = preg_replace('/>.*$/', '', $hosth);
|
$hosth = preg_replace('/>.*$/', '', $hosth);
|
||||||
$hosth = preg_replace('/.*@/', '', $hosth);
|
$hosth = preg_replace('/.*@/', '', $hosth);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) {
|
if ($_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) {
|
||||||
if ($usetls) {
|
if ($usetls) {
|
||||||
/*
|
/*
|
||||||
The following dialog illustrates how a client and server can start a TLS STARTTLS session
|
The following dialog illustrates how a client and server can start a TLS STARTTLS session:
|
||||||
S: <waits for connection on TCP port 25>
|
S: <waits for connection on TCP port 25>
|
||||||
C: <opens connection>
|
C: <opens connection>
|
||||||
S: 220 mail.imc.org SMTP service ready
|
S: 220 mail.imc.org SMTP service ready
|
||||||
@ -494,6 +500,39 @@ class SMTPs
|
|||||||
S: 250-server-domain.com
|
S: 250-server-domain.com
|
||||||
S: 250 AUTH LOGIN
|
S: 250 AUTH LOGIN
|
||||||
C: <continues by sending an SMTP command
|
C: <continues by sending an SMTP command
|
||||||
|
|
||||||
|
Another example here:
|
||||||
|
S: 220 smtp.server.com Simple Mail Transfer Service Ready
|
||||||
|
C: EHLO client.example.com
|
||||||
|
S: 250-smtp.server.com Hello client.example.com
|
||||||
|
S: 250-SIZE 1000000
|
||||||
|
S: 250-AUTH LOGIN PLAIN CRAM-MD5
|
||||||
|
S: 250-STARTTLS
|
||||||
|
S: 250 HELP
|
||||||
|
C: STARTTLS
|
||||||
|
S: 220 TLS go ahead
|
||||||
|
C: EHLO client.example.com *
|
||||||
|
S: 250-smtp.server.com Hello client.example.com
|
||||||
|
S: 250-SIZE 1000000
|
||||||
|
S: 250-AUTH LOGIN PLAIN CRAM-MD5
|
||||||
|
S: 250 HELP
|
||||||
|
C: AUTH LOGIN
|
||||||
|
S: 334 VXNlcm5hbWU6
|
||||||
|
C: adlxdkej
|
||||||
|
S: 334 UGFzc3dvcmQ6
|
||||||
|
C: lkujsefxlj
|
||||||
|
S: 235 2.7.0 Authentication successful
|
||||||
|
C: MAIL FROM:<mail@samlogic.com>
|
||||||
|
S: 250 OK
|
||||||
|
C: RCPT TO:<john@mail.com>
|
||||||
|
S: 250 OK
|
||||||
|
C: DATA
|
||||||
|
S: 354 Send message, end with a "." on a line by itself
|
||||||
|
C: <The message data (body text, subject, e-mail header, attachments etc) is sent>
|
||||||
|
S .
|
||||||
|
S: 250 OK, message accepted for delivery: queued as 12345
|
||||||
|
C: QUIT
|
||||||
|
S: 221 Bye
|
||||||
*/
|
*/
|
||||||
if (!$_retVal = $this->socket_send_str('STARTTLS', 220)) {
|
if (!$_retVal = $this->socket_send_str('STARTTLS', 220)) {
|
||||||
$this->_setErr(131, 'STARTTLS connection is not supported.');
|
$this->_setErr(131, 'STARTTLS connection is not supported.');
|
||||||
@ -517,10 +556,10 @@ class SMTPs
|
|||||||
$this->_setErr(132, 'STARTTLS connection failed.');
|
$this->_setErr(132, 'STARTTLS connection failed.');
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
}
|
}
|
||||||
// Most server servers expect a 2nd pass of EHLO after TLS is established to get another time
|
// Most servers expect a 2nd pass of EHLO after TLS is established to get another time
|
||||||
// the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS.
|
// the answer with list of supported AUTH methods. They may differs between non STARTTLS and with STARTTLS.
|
||||||
if (!$_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) {
|
if (! $_retVal = $this->socket_send_str('EHLO '.$hosth, '250')) {
|
||||||
$this->_setErr(126, '"'.$hosth.'" does not support authenticated connections.');
|
$this->_setErr(126, '"'.$hosth.'" does not support authenticated connections. Error after sending EHLO '.$hosth);
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -560,7 +599,7 @@ class SMTPs
|
|||||||
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
$this->_setErr(130, 'Invalid Authentication Credentials.');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->_setErr(126, '"'.$host.'" does not support authenticated connections.');
|
$this->_setErr(126, '"'.$host.'" does not support authenticated connections. Error after sending EHLO '.$hosth);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $_retVal;
|
return $_retVal;
|
||||||
@ -603,12 +642,18 @@ class SMTPs
|
|||||||
$hosth = $host;
|
$hosth = $host;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
if (!empty($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
||||||
|
if (!is_numeric($conf->global->MAIL_SMTP_USE_FROM_FOR_HELO)) {
|
||||||
|
// If value of MAIL_SMTP_USE_FROM_FOR_HELO is a string, we use it as domain name
|
||||||
|
$hosth = $conf->global->MAIL_SMTP_USE_FROM_FOR_HELO;
|
||||||
|
} else {
|
||||||
|
// If value of MAIL_SMTP_USE_FROM_FOR_HELO is 1, we use the domain in the from.
|
||||||
// If the from to is 'aaa <bbb@ccc.com>', we will keep 'ccc.com'
|
// If the from to is 'aaa <bbb@ccc.com>', we will keep 'ccc.com'
|
||||||
$hosth = $this->getFrom('addr');
|
$hosth = $this->getFrom('addr');
|
||||||
$hosth = preg_replace('/^.*</', '', $hosth);
|
$hosth = preg_replace('/^.*</', '', $hosth);
|
||||||
$hosth = preg_replace('/>.*$/', '', $hosth);
|
$hosth = preg_replace('/>.*$/', '', $hosth);
|
||||||
$hosth = preg_replace('/.*@/', '', $hosth);
|
$hosth = preg_replace('/.*@/', '', $hosth);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$_retVal = $this->socket_send_str('HELO '.$hosth, '250');
|
$_retVal = $this->socket_send_str('HELO '.$hosth, '250');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -589,7 +589,7 @@ class Translate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Disabled. There is too many cases where translation of $newstr is not defined is normal (like when output with setEventMessage an already translated string)
|
/* Disabled. There is too many cases where translation of $newstr is not defined is normal (like when output with setEventMessage an already translated string)
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2)
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2)
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__." MAIN_FEATURES_LEVEL=DEVELOP: missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG);
|
dol_syslog(__METHOD__." MAIN_FEATURES_LEVEL=DEVELOP: missing translation for key '".$newstr."' in ".$_SERVER["PHP_SELF"], LOG_DEBUG);
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
@ -319,28 +319,34 @@ abstract class DoliDB implements Database
|
|||||||
* Return first result from query as object
|
* Return first result from query as object
|
||||||
* Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries
|
* Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries
|
||||||
* Dont add LIMIT to your query, it will be added by this method
|
* Dont add LIMIT to your query, it will be added by this method
|
||||||
* @param string $sql the sql query string
|
*
|
||||||
* @return bool| object
|
* @param string $sql The sql query string
|
||||||
* @deprecated
|
* @return bool|int|object False on failure, 0 on empty, object on success
|
||||||
*/
|
*/
|
||||||
public function getRow($sql)
|
public function getRow($sql)
|
||||||
{
|
{
|
||||||
$sql .= ' LIMIT 1;';
|
$sql .= ' LIMIT 1';
|
||||||
|
|
||||||
$res = $this->query($sql);
|
$res = $this->query($sql);
|
||||||
if ($res) {
|
if ($res) {
|
||||||
return $this->fetch_object($res);
|
$obj = $this->fetch_object($res);
|
||||||
|
if ($obj) {
|
||||||
|
return $obj;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return all results from query as an array of objects
|
* Return all results from query as an array of objects
|
||||||
* Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries
|
* Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries
|
||||||
* be carefull with this method use it only with some limit of results to avoid performences loss
|
* be carefull with this method use it only with some limit of results to avoid performences loss.
|
||||||
* @param string $sql the sql query string
|
*
|
||||||
* @return bool| array
|
* @param string $sql The sql query string
|
||||||
|
* @return bool|array Result
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function getRows($sql)
|
public function getRows($sql)
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if ($resql) { // This can fail when class is used on old database (during mig
|
|||||||
case 'sellist':
|
case 'sellist':
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
$tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
$tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
||||||
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
|
if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) {
|
||||||
$tmpkeys = array_keys($tmpparam['options']);
|
$tmpkeys = array_keys($tmpparam['options']);
|
||||||
$tmp = array_shift($tmpkeys);
|
$tmp = array_shift($tmpkeys);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,8 +83,8 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
|||||||
$appli .= " ".DOL_VERSION;
|
$appli .= " ".DOL_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
|
||||||
$appli .= "<br>".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL;
|
$appli .= "<br>".$langs->trans("LevelOfFeature").': '.getDolGlobalInt('MAIN_FEATURES_LEVEL');
|
||||||
}
|
}
|
||||||
|
|
||||||
$logouttext = '';
|
$logouttext = '';
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
|
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -66,7 +67,7 @@ function bank_prepare_head(Account $object)
|
|||||||
$head[$h][2] = 'graph';
|
$head[$h][2] = 'graph';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($object->courant != Account::TYPE_CASH) {
|
if ($object->courant != Account::TYPE_CASH || !empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) {
|
||||||
$nbReceipts = 0;
|
$nbReceipts = 0;
|
||||||
|
|
||||||
// List of all standing receipts
|
// List of all standing receipts
|
||||||
|
|||||||
@ -106,7 +106,11 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
|||||||
*/
|
*/
|
||||||
function getEntity($element, $shared = 1, $currentobject = null)
|
function getEntity($element, $shared = 1, $currentobject = null)
|
||||||
{
|
{
|
||||||
global $conf, $mc, $hookmanager, $object, $action;
|
global $conf, $mc, $hookmanager, $object, $action, $db;
|
||||||
|
|
||||||
|
if (! is_object($hookmanager)) {
|
||||||
|
$hookmanager = new HookManager($db);
|
||||||
|
}
|
||||||
|
|
||||||
// fix different element names (France to English)
|
// fix different element names (France to English)
|
||||||
switch ($element) {
|
switch ($element) {
|
||||||
@ -140,10 +144,10 @@ function getEntity($element, $shared = 1, $currentobject = null)
|
|||||||
$reshook = $hookmanager->executeHooks('hookGetEntity', $parameters, $currentobject, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('hookGetEntity', $parameters, $currentobject, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (is_numeric($reshook)) {
|
if (is_numeric($reshook)) {
|
||||||
if ($reshook == 0 && !empty($hookmanager->resprints)) {
|
if ($reshook == 0 && !empty($hookmanager->resPrint)) {
|
||||||
$out .= ','.$hookmanager->resprints; // add
|
$out .= ','.$hookmanager->resPrint; // add
|
||||||
} elseif ($reshook == 1) {
|
} elseif ($reshook == 1) {
|
||||||
$out = $hookmanager->resprints; // replace
|
$out = $hookmanager->resPrint; // replace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1841,7 +1845,7 @@ function dol_get_fiche_end($notab = 0)
|
|||||||
*/
|
*/
|
||||||
function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '')
|
function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $onlybanner = 0, $morehtmlright = '')
|
||||||
{
|
{
|
||||||
global $conf, $form, $user, $langs;
|
global $conf, $form, $user, $langs, $hookmanager, $action;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -2112,6 +2116,17 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parameters=array('morehtmlref'=>$morehtmlref);
|
||||||
|
$reshook = $hookmanager->executeHooks('formDolBanner', $parameters, $object, $action);
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
} elseif (empty($reshook)) {
|
||||||
|
$morehtmlref .= $hookmanager->resPrint;
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
$morehtmlref = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<div class="'.($onlybanner ? 'arearefnobottom ' : 'arearef ').'heightref valignmiddle centpercent">';
|
print '<div class="'.($onlybanner ? 'arearefnobottom ' : 'arearef ').'heightref valignmiddle centpercent">';
|
||||||
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
|
print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -2289,6 +2304,11 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
// If date undefined or "", we return ""
|
||||||
|
if (dol_strlen($time) == 0) {
|
||||||
|
return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
|
||||||
|
}
|
||||||
|
|
||||||
if ($tzoutput === 'auto') {
|
if ($tzoutput === 'auto') {
|
||||||
$tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey : 'tzserver'));
|
$tzoutput = (empty($conf) ? 'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey : 'tzserver'));
|
||||||
}
|
}
|
||||||
@ -2312,7 +2332,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$user_date_tz = new DateTimeZone($offsettzstring);
|
$user_date_tz = new DateTimeZone($offsettzstring);
|
||||||
$user_dt = new DateTime();
|
$user_dt = new DateTime();
|
||||||
$user_dt->setTimezone($user_date_tz);
|
$user_dt->setTimezone($user_date_tz);
|
||||||
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : $time);
|
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : (int) $time);
|
||||||
$offsettz = $user_dt->getOffset();
|
$offsettz = $user_dt->getOffset();
|
||||||
} else { // old method (The 'tzuser' was processed like the 'tzuserrel')
|
} else { // old method (The 'tzuser' was processed like the 'tzuserrel')
|
||||||
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
||||||
@ -2380,11 +2400,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$format = str_replace('yyyy', 'yy', $format);
|
$format = str_replace('yyyy', 'yy', $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If date undefined or "", we return ""
|
|
||||||
if (dol_strlen($time) == 0) {
|
|
||||||
return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean format
|
// Clean format
|
||||||
if (preg_match('/%b/i', $format)) { // There is some text to translate
|
if (preg_match('/%b/i', $format)) { // There is some text to translate
|
||||||
// We inhibate translation to text made by strftime functions. We will use trans instead later.
|
// We inhibate translation to text made by strftime functions. We will use trans instead later.
|
||||||
@ -2401,7 +2416,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
// Analyze date
|
// Analyze date
|
||||||
$reg = array();
|
$reg = array();
|
||||||
if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) { // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
|
||||||
dol_print_error("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]);
|
dol_print_error('', "Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]);
|
||||||
return '';
|
return '';
|
||||||
} elseif (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) { // Still available to solve problems in extrafields of type date
|
} elseif (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) { // Still available to solve problems in extrafields of type date
|
||||||
// This part of code should not be used anymore.
|
// This part of code should not be used anymore.
|
||||||
@ -3670,9 +3685,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
|
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
|
||||||
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||||
'sign-out'=>'sign-out-alt',
|
'sign-out'=>'sign-out-alt',
|
||||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star',
|
||||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'filter'=>'filter',
|
||||||
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
||||||
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
|
||||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||||
'other'=>'square',
|
'other'=>'square',
|
||||||
@ -3682,7 +3697,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
||||||
'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house',
|
'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house',
|
||||||
'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
|
'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
|
||||||
'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
|
'supplier'=>'building', 'technic'=>'cogs',
|
||||||
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||||
'title_agenda'=>'calendar-alt',
|
'title_agenda'=>'calendar-alt',
|
||||||
'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card',
|
'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card',
|
||||||
@ -4473,7 +4488,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
|
|||||||
$result = ($nodiv ? '' : '<div class="'.$class.' hideonsmartphone'.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
|
$result = ($nodiv ? '' : '<div class="'.$class.' hideonsmartphone'.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
|
||||||
|
|
||||||
if ($textfordropdown) {
|
if ($textfordropdown) {
|
||||||
$tmpresult .= '<span class="'.$class.'text opacitymedium cursorpointer">'.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').'</span>';
|
$tmpresult = '<span class="'.$class.'text opacitymedium cursorpointer">'.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').'</span>';
|
||||||
$tmpresult .= '<script type="text/javascript" language="javascript">
|
$tmpresult .= '<script type="text/javascript" language="javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery(".'.$class.'text").click(function() {
|
jQuery(".'.$class.'text").click(function() {
|
||||||
@ -4496,7 +4511,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss
|
|||||||
* This function must be called when a blocking technical error is encountered.
|
* This function must be called when a blocking technical error is encountered.
|
||||||
* However, one must try to call it only within php pages, classes must return their error through their property "error".
|
* However, one must try to call it only within php pages, classes must return their error through their property "error".
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB|string $db Database handler
|
||||||
* @param string|string[] $error String or array of errors strings to show
|
* @param string|string[] $error String or array of errors strings to show
|
||||||
* @param array $errors Array of errors
|
* @param array $errors Array of errors
|
||||||
* @return void
|
* @return void
|
||||||
@ -4522,7 +4537,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
|||||||
|
|
||||||
if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
if ($_SERVER['DOCUMENT_ROOT']) { // Mode web
|
||||||
$out .= $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
$out .= $langs->trans("DolibarrHasDetectedError").".<br>\n";
|
||||||
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) {
|
||||||
$out .= "You use an experimental or develop level of features, so please do NOT report any bugs or vulnerability, except if problem is confirmed after moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
|
$out .= "You use an experimental or develop level of features, so please do NOT report any bugs or vulnerability, except if problem is confirmed after moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
|
||||||
}
|
}
|
||||||
$out .= $langs->trans("InformationToHelpDiagnose").":<br>\n";
|
$out .= $langs->trans("InformationToHelpDiagnose").":<br>\n";
|
||||||
@ -4530,7 +4545,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
|||||||
$out .= "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(), 'dayhourlog')."<br>\n";
|
$out .= "<b>".$langs->trans("Date").":</b> ".dol_print_date(time(), 'dayhourlog')."<br>\n";
|
||||||
$out .= "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION." - https://www.dolibarr.org<br>\n";
|
$out .= "<b>".$langs->trans("Dolibarr").":</b> ".DOL_VERSION." - https://www.dolibarr.org<br>\n";
|
||||||
if (isset($conf->global->MAIN_FEATURES_LEVEL)) {
|
if (isset($conf->global->MAIN_FEATURES_LEVEL)) {
|
||||||
$out .= "<b>".$langs->trans("LevelOfFeature").":</b> ".dol_htmlentities($conf->global->MAIN_FEATURES_LEVEL, ENT_COMPAT)."<br>\n";
|
$out .= "<b>".$langs->trans("LevelOfFeature").":</b> ".getDolGlobalInt('MAIN_FEATURES_LEVEL')."<br>\n";
|
||||||
}
|
}
|
||||||
if (function_exists("phpversion")) {
|
if (function_exists("phpversion")) {
|
||||||
$out .= "<b>".$langs->trans("PHP").":</b> ".phpversion()."<br>\n";
|
$out .= "<b>".$langs->trans("PHP").":</b> ".phpversion()."<br>\n";
|
||||||
@ -4824,7 +4839,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
|||||||
* Show a title.
|
* Show a title.
|
||||||
*
|
*
|
||||||
* @param string $title Title to show
|
* @param string $title Title to show
|
||||||
* @return string Title to show
|
* @return void
|
||||||
* @deprecated Use load_fiche_titre instead
|
* @deprecated Use load_fiche_titre instead
|
||||||
* @see load_fiche_titre()
|
* @see load_fiche_titre()
|
||||||
*/
|
*/
|
||||||
@ -5191,12 +5206,12 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0)
|
|||||||
*
|
*
|
||||||
* @param float $amount Amount to format
|
* @param float $amount Amount to format
|
||||||
* @param integer $form Type of format, HTML or not (not by default)
|
* @param integer $form Type of format, HTML or not (not by default)
|
||||||
* @param Translate $outlangs Object langs for output
|
* @param Translate|string $outlangs Object langs for output
|
||||||
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
|
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
|
||||||
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
|
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
|
||||||
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||||
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
||||||
* @return string Chaine avec montant formate
|
* @return string String with formated amount
|
||||||
*
|
*
|
||||||
* @see price2num() Revert function of price
|
* @see price2num() Revert function of price
|
||||||
*/
|
*/
|
||||||
@ -5852,7 +5867,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
|||||||
$ret .= ' ('.$obj->default_vat_code.')';
|
$ret .= ' ('.$obj->default_vat_code.')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->free($sql);
|
$db->free($resql);
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -8151,16 +8166,20 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
|
|||||||
return 'Bad string syntax to evaluate: '.$s;
|
return 'Bad string syntax to evaluate: '.$s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We block using of php exec or php file functions
|
// We block use of php exec or php file functions
|
||||||
$forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI(");
|
$forbiddenphpstrings = array('$$');
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask("));
|
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('function(', '$$', 'call_user_func('));
|
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
||||||
$forbiddenphpregex = 'global\s+\$';
|
|
||||||
|
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI");
|
||||||
|
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "unlink", "mkdir", "rmdir", "symlink", "touch", "umask"));
|
||||||
|
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
||||||
|
|
||||||
|
$forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b';
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$oldstringtoclean = $s;
|
$oldstringtoclean = $s;
|
||||||
$s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s);
|
$s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s);
|
||||||
$s = preg_replace('/'.$forbiddenphpregex.'/', '__forbiddenstring__', $s);
|
$s = preg_replace('/'.$forbiddenphpregex.'/i', '__forbiddenstring__', $s);
|
||||||
//$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod(
|
//$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod(
|
||||||
} while ($oldstringtoclean != $s);
|
} while ($oldstringtoclean != $s);
|
||||||
|
|
||||||
@ -8818,7 +8837,7 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
|
|||||||
* Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
|
* Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
|
||||||
*
|
*
|
||||||
* @param string $selector Selector ('#id' or 'input[name="ref"]') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char.
|
* @param string $selector Selector ('#id' or 'input[name="ref"]') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char.
|
||||||
* @return string HTML code to set focus
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dol_set_focus($selector)
|
function dol_set_focus($selector)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -251,7 +251,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
|||||||
dol_syslog("getURLContent request=".$request);
|
dol_syslog("getURLContent request=".$request);
|
||||||
if (!empty($conf->global->MAIN_GETURLCONTENT_OUTPUT_RESPONSE)) {
|
if (!empty($conf->global->MAIN_GETURLCONTENT_OUTPUT_RESPONSE)) {
|
||||||
// This may contains binary data, so we dont output reponse by default.
|
// This may contains binary data, so we dont output reponse by default.
|
||||||
dol_syslog("getURLContent response =".response);
|
dol_syslog("getURLContent response =".$response);
|
||||||
}
|
}
|
||||||
dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it
|
dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2006-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -89,7 +89,6 @@ function ldap_prepare_head()
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show button test LDAP synchro
|
* Show button test LDAP synchro
|
||||||
*
|
*
|
||||||
@ -119,7 +118,6 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
|
|||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a LDAP array into an HTML output array.
|
* Show a LDAP array into an HTML output array.
|
||||||
*
|
*
|
||||||
@ -153,7 +151,7 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
|
|||||||
if ("$key" == "dn") {
|
if ("$key" == "dn") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ("$val" == "objectclass") {
|
if (!is_array($val) && "$val" == "objectclass") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +179,7 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
|
|||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
if ("$val" != $lastkey[$level] && !$subcount) {
|
if (!is_array($val) && "$val" != $lastkey[$level] && !$subcount) {
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/lib/memory.lib.php
|
* \file htdocs/core/lib/modulebuilder.lib.php
|
||||||
* \brief Set of function for memory/cache management
|
* \brief Set of function for modulebuilder management
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -979,6 +979,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
|
|
||||||
$outputlangs->load("dict");
|
$outputlangs->load("dict");
|
||||||
$line = '';
|
$line = '';
|
||||||
|
$reg = array();
|
||||||
|
|
||||||
$dims = $pdf->getPageDimensions();
|
$dims = $pdf->getPageDimensions();
|
||||||
|
|
||||||
@ -1045,7 +1046,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line2 .= ($line2 ? " - " : "").$fromcompany->email;
|
$line2 .= ($line2 ? " - " : "").$fromcompany->email;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($showdetails == 2 || $showdetails == 3 || ($fromcompany->country_code == 'DE')) {
|
if ($showdetails == 2 || $showdetails == 3 || (!empty($fromcompany->country_code) && $fromcompany->country_code == 'DE')) {
|
||||||
// Managers
|
// Managers
|
||||||
if ($fromcompany->managers) {
|
if ($fromcompany->managers) {
|
||||||
$line2 .= ($line2 ? " - " : "").$fromcompany->managers;
|
$line2 .= ($line2 ? " - " : "").$fromcompany->managers;
|
||||||
@ -1054,11 +1055,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
|
|
||||||
// Line 3 of company infos
|
// Line 3 of company infos
|
||||||
// Juridical status
|
// Juridical status
|
||||||
if ($fromcompany->forme_juridique_code) {
|
if (!empty($fromcompany->forme_juridique_code) && $fromcompany->forme_juridique_code) {
|
||||||
$line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
|
$line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
|
||||||
}
|
}
|
||||||
// Capital
|
// Capital
|
||||||
if ($fromcompany->capital) {
|
if (!empty($fromcompany->capital) && $fromcompany->capital) {
|
||||||
$tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string
|
$tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string
|
||||||
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) {
|
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) {
|
||||||
$line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency));
|
$line3 .= ($line3 ? " - " : "").$outputlangs->transnoentities("CapitalOf", price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency));
|
||||||
@ -1067,7 +1068,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Prof Id 1
|
// Prof Id 1
|
||||||
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
|
if (!empty($fromcompany->idprof1) && $fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1075,7 +1076,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line3 .= ($line3 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
|
$line3 .= ($line3 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
|
||||||
}
|
}
|
||||||
// Prof Id 2
|
// Prof Id 2
|
||||||
if ($fromcompany->idprof2) {
|
if (!empty($fromcompany->idprof2) && $fromcompany->idprof2) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1085,7 +1086,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
|
|
||||||
// Line 4 of company infos
|
// Line 4 of company infos
|
||||||
// Prof Id 3
|
// Prof Id 3
|
||||||
if ($fromcompany->idprof3) {
|
if (!empty($fromcompany->idprof3) && $fromcompany->idprof3) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1093,7 +1094,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
|
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
|
||||||
}
|
}
|
||||||
// Prof Id 4
|
// Prof Id 4
|
||||||
if ($fromcompany->idprof4) {
|
if (!empty($fromcompany->idprof4) && $fromcompany->idprof4) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1101,7 +1102,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
|
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
|
||||||
}
|
}
|
||||||
// Prof Id 5
|
// Prof Id 5
|
||||||
if ($fromcompany->idprof5) {
|
if (!empty($fromcompany->idprof5) && $fromcompany->idprof5) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId5", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId5", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1109,7 +1110,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5);
|
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5);
|
||||||
}
|
}
|
||||||
// Prof Id 6
|
// Prof Id 6
|
||||||
if ($fromcompany->idprof6) {
|
if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) {
|
||||||
$field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code);
|
$field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code);
|
||||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||||
$field = $reg[1];
|
$field = $reg[1];
|
||||||
@ -1117,7 +1118,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6);
|
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6);
|
||||||
}
|
}
|
||||||
// IntraCommunautary VAT
|
// IntraCommunautary VAT
|
||||||
if ($fromcompany->tva_intra != '') {
|
if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') {
|
||||||
$line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
|
$line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1273,6 +1274,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos
|
|||||||
|
|
||||||
// Fix bug of some HTML editors that replace links <img src="http://localhostgit/viewimage.php?modulepart=medias&file=image/efd.png" into <img src="http://localhostgit/viewimage.php?modulepart=medias&file=image/efd.png"
|
// Fix bug of some HTML editors that replace links <img src="http://localhostgit/viewimage.php?modulepart=medias&file=image/efd.png" into <img src="http://localhostgit/viewimage.php?modulepart=medias&file=image/efd.png"
|
||||||
// We make the reverse, so PDF generation has the real URL.
|
// We make the reverse, so PDF generation has the real URL.
|
||||||
|
$nbrep = 0;
|
||||||
$labelproductservice = preg_replace('/(<img[^>]*src=")([^"]*)(&)([^"]*")/', '\1\2&\4', $labelproductservice, -1, $nbrep);
|
$labelproductservice = preg_replace('/(<img[^>]*src=")([^"]*)(&)([^"]*")/', '\1\2&\4', $labelproductservice, -1, $nbrep);
|
||||||
|
|
||||||
//var_dump($labelproductservice);exit;
|
//var_dump($labelproductservice);exit;
|
||||||
@ -2214,48 +2216,6 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return total quantity of products and/or services
|
|
||||||
*
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param string $type Type
|
|
||||||
* @param Translate $outputlangs Object langs for output
|
|
||||||
* @return integer
|
|
||||||
* @deprecated Not used by Dolibarr core, so will be removed.
|
|
||||||
*/
|
|
||||||
function pdf_getTotalQty($object, $type, $outputlangs)
|
|
||||||
{
|
|
||||||
global $hookmanager;
|
|
||||||
|
|
||||||
$total = 0;
|
|
||||||
$nblines = count($object->lines);
|
|
||||||
|
|
||||||
// Loop on each lines
|
|
||||||
for ($i = 0; $i < $nblines; $i++) {
|
|
||||||
if ($object->lines[$i]->special_code != 3) {
|
|
||||||
if ($type == 'all') {
|
|
||||||
$total += $object->lines[$i]->qty;
|
|
||||||
} elseif ($type == 9 && is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) {
|
|
||||||
$special_code = $object->lines[$i]->special_code;
|
|
||||||
if (!empty($object->lines[$i]->fk_parent_line)) {
|
|
||||||
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
|
||||||
}
|
|
||||||
$hidedetails = '';
|
|
||||||
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
|
|
||||||
$action = '';
|
|
||||||
$reshook = $hookmanager->executeHooks('pdf_getTotalQty', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
return $hookmanager->resPrint;
|
|
||||||
} elseif ($type == 0 && $object->lines[$i]->product_type == 0) {
|
|
||||||
$total += $object->lines[$i]->qty;
|
|
||||||
} elseif ($type == 1 && $object->lines[$i]->product_type == 1) {
|
|
||||||
$total += $object->lines[$i]->qty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $total;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return linked objects to use for document generation.
|
* Return linked objects to use for document generation.
|
||||||
* Warning: To save space, this function returns only one link per link type (all links are concated on same record string). This function is used by pdf_writeLinkedObjects
|
* Warning: To save space, this function returns only one link per link type (all links are concated on same record string). This function is used by pdf_writeLinkedObjects
|
||||||
|
|||||||
@ -471,14 +471,6 @@ function project_timesheet_prepare_head($mode, $fuser = null)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|
||||||
{
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/projet/activity/perline.php".($param?'?'.$param:'');
|
|
||||||
$head[$h][1] = $langs->trans("InputDetail");
|
|
||||||
$head[$h][2] = 'inputperline';
|
|
||||||
$h++;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet');
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet');
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet', 'remove');
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'project_timesheet', 'remove');
|
||||||
@ -517,7 +509,7 @@ function project_admin_prepare_head()
|
|||||||
$head[$h][2] = 'attributes_task';
|
$head[$h][2] = 'attributes_task';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php';
|
$head[$h][0] = DOL_URL_ROOT.'/projet/admin/website.php';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2008-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -91,7 +91,6 @@ function dol_decode($chain, $key = '1')
|
|||||||
return $chain;
|
return $chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a hash of a string.
|
* Returns a hash of a string.
|
||||||
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (recommanded value is 'password_hash')
|
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (recommanded value is 'password_hash')
|
||||||
@ -123,7 +122,7 @@ function dol_hash($chain, $type = '0')
|
|||||||
} elseif ($type == '3' || $type == 'md5') {
|
} elseif ($type == '3' || $type == 'md5') {
|
||||||
return md5($chain);
|
return md5($chain);
|
||||||
} elseif ($type == '4' || $type == 'md5openldap') {
|
} elseif ($type == '4' || $type == 'md5openldap') {
|
||||||
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
|
return '{md5}'.base64_encode(pack("H*", md5($chain))); // For OpenLdap with md5 (based on an unencrypted password in base)
|
||||||
} elseif ($type == '5' || $type == 'sha256') {
|
} elseif ($type == '5' || $type == 'sha256') {
|
||||||
return hash('sha256', $chain);
|
return hash('sha256', $chain);
|
||||||
} elseif ($type == '6' || $type == 'password_hash') {
|
} elseif ($type == '6' || $type == 'password_hash') {
|
||||||
@ -168,7 +167,6 @@ function dol_verifyHash($chain, $hash, $type = '0')
|
|||||||
return dol_hash($chain, $type) == $hash;
|
return dol_hash($chain, $type) == $hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check permissions of a user to show a page and an object. Check read permission.
|
* Check permissions of a user to show a page and an object. Check read permission.
|
||||||
* If GETPOST('action','aZ09') defined, we also check write and delete permission.
|
* If GETPOST('action','aZ09') defined, we also check write and delete permission.
|
||||||
@ -492,10 +490,14 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
|||||||
if (!$user->rights->fournisseur->commande->supprimer) {
|
if (!$user->rights->fournisseur->commande->supprimer) {
|
||||||
$deleteok = 0;
|
$deleteok = 0;
|
||||||
}
|
}
|
||||||
} elseif ($feature == 'payment_supplier') {
|
} elseif ($feature == 'payment_supplier') { // Permission to delete a payment of an invoice is permission to edit an invoice.
|
||||||
if (!$user->rights->fournisseur->facture->creer) {
|
if (!$user->rights->fournisseur->facture->creer) {
|
||||||
$deleteok = 0;
|
$deleteok = 0;
|
||||||
}
|
}
|
||||||
|
} elseif ($feature == 'payment') { // Permission to delete a payment of an invoice is permission to edit an invoice.
|
||||||
|
if (!$user->rights->facture->creer) {
|
||||||
|
$deleteok = 0;
|
||||||
|
}
|
||||||
} elseif ($feature == 'banque') {
|
} elseif ($feature == 'banque') {
|
||||||
if (empty($user->rights->banque->modifier)) {
|
if (empty($user->rights->banque->modifier)) {
|
||||||
$deleteok = 0;
|
$deleteok = 0;
|
||||||
|
|||||||
@ -120,7 +120,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
if ($ldapdebug) {
|
if ($ldapdebug) {
|
||||||
print "DEBUG: User ".$usertotest." must change password<br>\n";
|
print "DEBUG: User ".$usertotest." must change password<br>\n";
|
||||||
}
|
}
|
||||||
$ldap->close();
|
$ldap->unbind();
|
||||||
sleep(1);
|
sleep(1);
|
||||||
$langs->load('ldap');
|
$langs->load('ldap');
|
||||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
|
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
|
||||||
@ -131,7 +131,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
print "DEBUG: ".$ldap->error."<br>\n";
|
print "DEBUG: ".$ldap->error."<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ldap->close();
|
$ldap->unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forge LDAP user and password to test with them
|
// Forge LDAP user and password to test with them
|
||||||
@ -166,14 +166,14 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
if ($tmpuser->datestartvalidity && $db->jdate($tmpuser->datestartvalidity) >= $now) {
|
if ($tmpuser->datestartvalidity && $db->jdate($tmpuser->datestartvalidity) >= $now) {
|
||||||
$ldap->close();
|
$ldap->unbind();
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'errors'));
|
$langs->loadLangs(array('main', 'errors'));
|
||||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
|
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
|
||||||
return '--bad-login-validity--';
|
return '--bad-login-validity--';
|
||||||
}
|
}
|
||||||
if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <= dol_get_first_hour($now)) {
|
if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <= dol_get_first_hour($now)) {
|
||||||
$ldap->close();
|
$ldap->unbind();
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'errors'));
|
$langs->loadLangs(array('main', 'errors'));
|
||||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
|
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
|
||||||
@ -271,7 +271,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
$_SESSION["dol_loginmesg"] = ($ldap->error ? $ldap->error : $langs->transnoentitiesnoconv("ErrorBadLoginPassword"));
|
$_SESSION["dol_loginmesg"] = ($ldap->error ? $ldap->error : $langs->transnoentitiesnoconv("ErrorBadLoginPassword"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ldap->close();
|
$ldap->unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $login;
|
return $login;
|
||||||
|
|||||||
@ -282,7 +282,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
|
|
||||||
$sepaname = '______________________________________________';
|
$sepaname = '______________________________________________';
|
||||||
if ($thirdparty->id > 0) {
|
if ($thirdparty->id > 0) {
|
||||||
$sepaname = $thirdparty->name.($object->account_owner ? ' ('.$object->account_owner.')' : '');
|
$sepaname = $thirdparty->name.($object->proprio ? ' ('.$object->proprio.')' : '');
|
||||||
}
|
}
|
||||||
$posY = $pdf->GetY();
|
$posY = $pdf->GetY();
|
||||||
$posY += 3;
|
$posY += 3;
|
||||||
|
|||||||
@ -349,7 +349,7 @@ class modAdherent extends DolibarrModules
|
|||||||
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
|
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
|
||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
/* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -13,23 +13,25 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* or see https://www.gnu.org/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* \defgroup HRM Module hrm
|
||||||
* \file htdocs/core/modules/modHRM.class.php
|
* \file htdocs/core/modules/modHRM.class.php
|
||||||
* \ingroup HRM
|
* \ingroup HRM
|
||||||
* \brief Description and activation file for the module HRM
|
* \brief Description and activation file for the module HRM
|
||||||
*/
|
*/
|
||||||
include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php";
|
include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to describe and activate the HRM module
|
* Description and activation class for module HRM
|
||||||
*/
|
*/
|
||||||
class modHRM extends DolibarrModules
|
class modHRM extends DolibarrModules
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor. Define names, constants, directories, boxes, permissions
|
||||||
* Define names, constants, directories, boxes, permissions
|
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
@ -39,34 +41,27 @@ class modHRM extends DolibarrModules
|
|||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
|
// Id for module (must be unique).
|
||||||
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
$this->numero = 4000;
|
$this->numero = 4000;
|
||||||
|
// Key text used to identify module (for permissions, menus, etc...)
|
||||||
$this->rights_class = 'hrm';
|
$this->rights_class = 'hrm';
|
||||||
|
|
||||||
|
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
||||||
|
// It is used to group modules in module setup page
|
||||||
$this->family = "hr";
|
$this->family = "hr";
|
||||||
$this->module_position = '50';
|
$this->module_position = '50';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
// Module description, used if translation string 'ModulehrmDesc' not found (hrm is name of module).
|
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->description = "hrm Description product ";
|
$this->description = "HRM";
|
||||||
// Used only if file README.md and README-LL.md not found.
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||||
$this->descriptionlong = "hrm Description long";
|
$this->version = 'development';
|
||||||
|
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
|
||||||
// Author
|
|
||||||
$this->editor_name = 'Editor name';
|
|
||||||
$this->editor_url = 'https://www.example.com';
|
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
|
||||||
$this->version = '1.0';
|
|
||||||
// Url to the file with your last numberversion of this module
|
|
||||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
|
||||||
|
|
||||||
// Key used in llx_const table to save module status enabled/disabled (where HRMTEST is value of property name of module in uppercase)
|
|
||||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||||
|
|
||||||
// Name of image file used for this module.
|
// Name of image file used for this module.
|
||||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||||
// To use a supported fa-xxx css style of font awesome, use this->picto='xxx'
|
|
||||||
$this->picto = 'hrm';
|
$this->picto = 'hrm';
|
||||||
|
|
||||||
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
|
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
|
||||||
@ -110,32 +105,20 @@ class modHRM extends DolibarrModules
|
|||||||
$this->config_page_url = array("hrm.php");
|
$this->config_page_url = array("hrm.php");
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// A condition to hide module
|
$this->hidden = false; // A condition to hide module
|
||||||
$this->hidden = false;
|
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
|
||||||
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
||||||
$this->depends = array();
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
||||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
|
||||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
$this->need_dolibarr_version = array(11, 0); // Minimum version of Dolibarr required by module
|
||||||
|
|
||||||
// The language file dedicated to your module
|
|
||||||
$this->langfiles = array("hrm");
|
$this->langfiles = array("hrm");
|
||||||
|
|
||||||
// Prerequisites
|
|
||||||
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
|
|
||||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
|
||||||
|
|
||||||
// Messages at activation
|
|
||||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
|
||||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
|
||||||
//$this->automatic_activation = array('FR'=>'HrmTestWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
|
||||||
//$this->always_enabled = true; // If true, can't be disabled
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
// Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0),
|
||||||
// Example: $this->const=array(1 => array('HRMTEST_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1),
|
// 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) );
|
||||||
// 2 => array('HRMTEST_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1)
|
// 2=>array('MAIN_MODULE_MYMODULE_NEEDSMARTY','chaine',1,'Constant to say module need smarty',0)
|
||||||
// );
|
$this->const = array(); // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 0 or 'allentities')
|
||||||
$this->const = array();
|
$r = 0;
|
||||||
|
|
||||||
|
|
||||||
if (!isset($conf->hrm) || !isset($conf->hrm->enabled)) {
|
if (!isset($conf->hrm) || !isset($conf->hrm->enabled)) {
|
||||||
@ -207,67 +190,78 @@ class modHRM extends DolibarrModules
|
|||||||
// ),
|
// ),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Permissions provided by this module
|
|
||||||
$this->rights = array();
|
// Permissions
|
||||||
|
$this->rights = array(); // Permission array used by this module
|
||||||
$r = 0;
|
$r = 0;
|
||||||
// Add here entries to declare new permissions
|
|
||||||
/* BEGIN MODULEBUILDER PERMISSIONS */
|
|
||||||
|
|
||||||
// Skill / Job / Position
|
// Skill / Job / Position
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
$this->rights[$r][0] = 4010; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = $langs->trans('ReadSkillJobPosition'); // Permission label
|
$this->rights[$r][1] = 'Read skill/job/position'; // Permission label
|
||||||
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'all';
|
$this->rights[$r][4] = 'all';
|
||||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read)
|
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read)
|
||||||
$r++;
|
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = $langs->trans('CreateUpdateSkillJobPosition'); // Permission label
|
|
||||||
$this->rights[$r][4] = 'all';
|
|
||||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
|
||||||
$r++;
|
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = $langs->trans('DeleteSkillJobPosition'); // Permission label
|
|
||||||
$this->rights[$r][4] = 'all';
|
|
||||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
//Eval
|
$this->rights[$r][0] = 4011; // Permission id (must not be already used)
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
$this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label
|
||||||
$this->rights[$r][1] = $langs->trans('ReadEval'); // Permission label
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'evaluation';
|
$this->rights[$r][4] = 'all';
|
||||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read)
|
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write)
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = $langs->trans('CreateUpdateEval'); // Permission label
|
$this->rights[$r][0] = 4012; // Permission id (must not be already used)
|
||||||
$this->rights[$r][4] = 'evaluation';
|
$this->rights[$r][1] = 'Delete skill/job/position'; // Permission label
|
||||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
|
$this->rights[$r][4] = 'all';
|
||||||
|
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->all->delete)
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = $langs->trans('ValidateEval'); // Permission label
|
// Evaluation
|
||||||
|
$this->rights[$r][0] = 4020; // Permission id (must not be already used)
|
||||||
|
$this->rights[$r][1] = 'Read evaluations'; // Permission label
|
||||||
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'evaluation';
|
$this->rights[$r][4] = 'evaluation';
|
||||||
$this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->read)
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
|
||||||
$this->rights[$r][1] = $langs->trans('DeleteEval'); // Permission label
|
$this->rights[$r][0] = 4021; // Permission id (must not be already used)
|
||||||
|
$this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label
|
||||||
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][4] = 'evaluation';
|
$this->rights[$r][4] = 'evaluation';
|
||||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write)
|
||||||
|
$r++;
|
||||||
|
|
||||||
|
$this->rights[$r][0] = 4022; // Permission id (must not be already used)
|
||||||
|
$this->rights[$r][1] = 'Validate evaluation'; // Permission label
|
||||||
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
|
$this->rights[$r][4] = 'evaluation_advance';
|
||||||
|
$this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->validate)
|
||||||
|
$r++;
|
||||||
|
|
||||||
|
$this->rights[$r][0] = 4023; // Permission id (must not be already used)
|
||||||
|
$this->rights[$r][1] = 'Delete all evaluations'; // Permission label
|
||||||
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
|
$this->rights[$r][4] = 'evaluation';
|
||||||
|
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete)
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
// Comparison
|
// Comparison
|
||||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
$this->rights[$r][0] = 4030; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = $langs->trans('SeeComparisonMenu'); // Permission label
|
$this->rights[$r][1] = 'See comparison menu'; // Permission label
|
||||||
$this->rights[$r][4] = 'compare';
|
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
$this->rights[$r][4] = 'compare_advance';
|
||||||
|
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
|
||||||
$r++;
|
$r++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called when module is enabled.
|
* Function called when module is enabled.
|
||||||
* The init function add constants, boxes, permissions and menus
|
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||||
* (defined in constructor) into Dolibarr database.
|
|
||||||
* It also creates data directories
|
* It also creates data directories
|
||||||
*
|
*
|
||||||
* @param string $options Enabling module ('', 'noboxes')
|
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes')
|
||||||
* @return int if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -638,7 +638,7 @@ class modProduct extends DolibarrModules
|
|||||||
|
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = array();
|
$import_extrafield_sample = array();
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -296,7 +296,7 @@ class modProjet extends DolibarrModules
|
|||||||
$this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order)
|
$this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order)
|
||||||
$this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation");
|
$this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation");
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -268,7 +268,7 @@ class modResource extends DolibarrModules
|
|||||||
$this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order)
|
$this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order)
|
||||||
$this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation');
|
$this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation');
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -584,7 +584,7 @@ class modService extends DolibarrModules
|
|||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$import_extrafield_sample = array();
|
$import_extrafield_sample = array();
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -496,7 +496,7 @@ class modSociete extends DolibarrModules
|
|||||||
$this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode');
|
$this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode');
|
||||||
}
|
}
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
@ -674,7 +674,7 @@ class modSociete extends DolibarrModules
|
|||||||
's.note_public' => "NotePublic"
|
's.note_public' => "NotePublic"
|
||||||
);
|
);
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on an old database (during a migration for example)
|
if ($resql) { // This can fail when class is used on an old database (during a migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -298,7 +298,7 @@ class modUser extends DolibarrModules
|
|||||||
'u.statut'=>'Status'
|
'u.statut'=>'Status'
|
||||||
);
|
);
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2014-2020 Frederic France <frederic.france@netlogic.fr>
|
* Copyright (C) 2014-2021 Frederic France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -108,10 +108,10 @@ class printing_printipp extends PrintingDriver
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->host = $conf->global->PRINTIPP_HOST;
|
$this->host = getDolGlobalString('PRINTIPP_HOST');
|
||||||
$this->port = $conf->global->PRINTIPP_PORT;
|
$this->port = getDolGlobalString('PRINTIPP_PORT');
|
||||||
$this->user = $conf->global->PRINTIPP_USER;
|
$this->user = getDolGlobalString('PRINTIPP_USER');
|
||||||
$this->password = $conf->global->PRINTIPP_PASSWORD;
|
$this->password = getDolGlobalString('PRINTIPP_PASSWORD');
|
||||||
$this->conf[] = array('varname'=>'PRINTIPP_HOST', 'required'=>1, 'example'=>'localhost', 'type'=>'text');
|
$this->conf[] = array('varname'=>'PRINTIPP_HOST', 'required'=>1, 'example'=>'localhost', 'type'=>'text');
|
||||||
$this->conf[] = array('varname'=>'PRINTIPP_PORT', 'required'=>1, 'example'=>'631', 'type'=>'text');
|
$this->conf[] = array('varname'=>'PRINTIPP_PORT', 'required'=>1, 'example'=>'631', 'type'=>'text');
|
||||||
$this->conf[] = array('varname'=>'PRINTIPP_USER', 'required'=>0, 'example'=>'', 'type'=>'text', 'moreattributes'=>'autocomplete="off"');
|
$this->conf[] = array('varname'=>'PRINTIPP_USER', 'required'=>0, 'example'=>'', 'type'=>'text', 'moreattributes'=>'autocomplete="off"');
|
||||||
@ -159,8 +159,8 @@ class printing_printipp extends PrintingDriver
|
|||||||
$ipp->setCopies($obj->copy);
|
$ipp->setCopies($obj->copy);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) {
|
if (!empty($conf->global->PRINTIPP_URI_DEFAULT)) {
|
||||||
dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT);
|
dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".getDolGlobalString('PRINTIPP_URI_DEFAULT'));
|
||||||
$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
|
$ipp->setPrinterURI(getDolGlobalString('PRINTIPP_URI_DEFAULT'));
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'NoDefaultPrinterDefined';
|
$this->errors[] = 'NoDefaultPrinterDefined';
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -320,6 +320,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
|
|
||||||
foreach ($contact_arrray as $array_key => $contact_id) {
|
foreach ($contact_arrray as $array_key => $contact_id) {
|
||||||
$res_contact = $contactstatic->fetch($contact_id);
|
$res_contact = $contactstatic->fetch($contact_id);
|
||||||
|
if ((int) $res_contact > 0) {
|
||||||
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
|
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
|
||||||
foreach ($tmparray as $key => $val) {
|
foreach ($tmparray as $key => $val) {
|
||||||
try {
|
try {
|
||||||
@ -331,6 +332,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$listlines->merge();
|
$listlines->merge();
|
||||||
|
} else {
|
||||||
|
$this->error = $contactstatic->error;
|
||||||
|
dol_syslog($this->error, LOG_WARNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$odfHandler->mergeSegment($listlines);
|
$odfHandler->mergeSegment($listlines);
|
||||||
} catch (OdfException $e) {
|
} catch (OdfException $e) {
|
||||||
|
|||||||
@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
|||||||
|
|
||||||
// Parametrage du prefix customers
|
// Parametrage du prefix customers
|
||||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):</td>';
|
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):</td>';
|
||||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.$conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER.'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.getDolGlobalString('COMPANY_ELEPHANT_MASK_CUSTOMER').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||||
|
|
||||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"'.$disabled.'></td>';
|
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"'.$disabled.'></td>';
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
|||||||
|
|
||||||
// Parametrage du prefix suppliers
|
// Parametrage du prefix suppliers
|
||||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):</td>';
|
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):</td>';
|
||||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value2" value="'.$conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER.'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value2" value="'.getDolGlobalString('COMPANY_ELEPHANT_MASK_SUPPLIER').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||||
$texte .= '</tr>';
|
$texte .= '</tr>';
|
||||||
|
|
||||||
$texte .= '</table>';
|
$texte .= '</table>';
|
||||||
|
|||||||
@ -104,7 +104,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
|
|||||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskcredit" value="'.$conf->global->SUPPLIER_CREDIT_TULIP_MASK.'">', $tooltip, 1, 1).'</td>';
|
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskcredit" value="'.$conf->global->SUPPLIER_CREDIT_TULIP_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||||
$texte .= '</tr>';
|
$texte .= '</tr>';
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURE_LEVEL >= 2) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||||
// Parametrage du prefix des replacement
|
// Parametrage du prefix des replacement
|
||||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</td>';
|
||||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskreplacement" value="'.$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK.'">', $tooltip, 1, 1).'</td>';
|
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskreplacement" value="'.$conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||||
|
|||||||
147
htdocs/core/multicompany_page.php
Normal file
147
htdocs/core/multicompany_page.php
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This file is a modified version of datepicker.php from phpBSM to fix some
|
||||||
|
* bugs, to add new features and to dramatically increase speed.
|
||||||
|
*
|
||||||
|
* 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/multicompany_page.php
|
||||||
|
* \brief File to return a page with the list of all entities user can switch to
|
||||||
|
*/
|
||||||
|
|
||||||
|
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||||
|
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||||
|
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||||
|
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
|
||||||
|
if (!defined('NOCSRFCHECK')) {
|
||||||
|
define('NOCSRFCHECK', 1);
|
||||||
|
}
|
||||||
|
if (!defined('NOTOKENRENEWAL')) {
|
||||||
|
define('NOTOKENRENEWAL', 1);
|
||||||
|
}
|
||||||
|
//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
|
||||||
|
if (!defined('NOREQUIREMENU')) {
|
||||||
|
define('NOREQUIREMENU', 1);
|
||||||
|
}
|
||||||
|
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||||
|
|
||||||
|
require_once '../main.inc.php';
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$entityid = GETPOST('entity', 'int');
|
||||||
|
$backtourl = GETPOST('backtourl');
|
||||||
|
if (empty($backtourl)) {
|
||||||
|
$backtourl = DOL_URL_ROOT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOST('lang', 'aZ09')) {
|
||||||
|
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
|
||||||
|
}
|
||||||
|
|
||||||
|
$langs->load("main");
|
||||||
|
|
||||||
|
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
|
||||||
|
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GETPOST('acction', 'aZ') == 'switchentity') {
|
||||||
|
if (is_object($mc)) {
|
||||||
|
$mc->switchEntity($entityid);
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Location: ".$backtourl);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$title = $langs->trans("Multicompanies");
|
||||||
|
|
||||||
|
// URL http://mydolibarr/core/multicompany_page?dol_use_jmobile=1 can be used for tests
|
||||||
|
$head = '<!-- Multicompany access -->'."\n";
|
||||||
|
$arrayofjs = array();
|
||||||
|
$arrayofcss = array();
|
||||||
|
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
|
||||||
|
print '<body>'."\n";
|
||||||
|
print '<div>';
|
||||||
|
//print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($conf->multicompany->enabled)) {
|
||||||
|
$langs->load("admin");
|
||||||
|
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).'</span>';
|
||||||
|
$bookmarkList .= '<br><br>';
|
||||||
|
} else {
|
||||||
|
// Instantiate hooks of thirdparty module
|
||||||
|
$hookmanager->initHooks(array('multicompany'));
|
||||||
|
|
||||||
|
// Define $bookmarks
|
||||||
|
$multicompanyList = '';
|
||||||
|
$searchForm = '';
|
||||||
|
|
||||||
|
|
||||||
|
if (is_object($mc)) {
|
||||||
|
$listofentities = $mc->getEntitiesList($user->login, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($listofentities as $entityid => $entitycursor) {
|
||||||
|
$url = DOL_URL_ROOT.'/core/multicompany_page.php?action=switchentity&token='.newToken().'&entity='.((int) $entityid).($backtourl ? '&backtourl='.urlencode($backtourl) : '');
|
||||||
|
$multicompanyList .= '<a class="dropdown-item multicompany-item'.(strpos($url, 'http') === 0 ? ' multicompany-item-external' : '').'" id="multicompany-item-'.$id.'" data-id="'.$id.'" href="'.dol_escape_htmltag($url).'">';
|
||||||
|
$multicompanyList .= dol_escape_htmltag($entitycursor);
|
||||||
|
$multicompanyList .= '</a>';
|
||||||
|
}
|
||||||
|
$multicompanyList .= '</div>';
|
||||||
|
|
||||||
|
$searchForm .= '<input name="bookmark" id="top-multicompany-search-input" class="dropdown-search-input" placeholder="'.$langs->trans('Entity').'" autocomplete="off" >';
|
||||||
|
|
||||||
|
|
||||||
|
// Execute hook printBookmarks
|
||||||
|
$parameters = array('multicompany'=>$multicompanyList);
|
||||||
|
$reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$multicompanyList .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$multicompanyList = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin Multicompany list -->\n";
|
||||||
|
print '<div class="center"><div class="center" style="padding: 6px;">';
|
||||||
|
print '<style>.menu_titre { padding-top: 7px; }</style>';
|
||||||
|
print '<div id="blockvmenusearch" class="tagtable center searchpage">'."\n";
|
||||||
|
print $multicompanyList;
|
||||||
|
print '</div>'."\n";
|
||||||
|
print '</div></div>';
|
||||||
|
print "\n<!-- End SearchForm -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
print '</body></html>'."\n";
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -86,7 +86,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
|
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
|
||||||
}
|
}
|
||||||
//var_dump($val.' '.$key.' '.$value);
|
//var_dump($val.' '.$key.' '.$value);
|
||||||
if ($val['noteditable']) {
|
if (!empty($val['noteditable'])) {
|
||||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||||
} else {
|
} else {
|
||||||
if ($key == 'lang') {
|
if ($key == 'lang') {
|
||||||
|
|||||||
@ -156,7 +156,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
if ($val['type'] == 'text') {
|
if ($val['type'] == 'text') {
|
||||||
print ' wordbreak';
|
print ' wordbreak';
|
||||||
}
|
}
|
||||||
if ($val['cssview']) {
|
if (!empty($val['cssview'])) {
|
||||||
print ' '.$val['cssview'];
|
print ' '.$val['cssview'];
|
||||||
}
|
}
|
||||||
print '">';
|
print '">';
|
||||||
|
|||||||
@ -53,6 +53,9 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
|
if (empty($totalarray)) {
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
}
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -219,18 +219,18 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
|||||||
|
|
||||||
// Convert date into timestamp format
|
// Convert date into timestamp format
|
||||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date'))) {
|
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date'))) {
|
||||||
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
|
$datenotinstring = empty($object->array_options['options_'.$tmpkeyextra]) ? '' : $object->array_options['options_'.$tmpkeyextra];
|
||||||
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
||||||
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
if (!empty($object->array_options['options_'.$tmpkeyextra]) && !is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||||
$datenotinstring = $db->jdate($datenotinstring);
|
$datenotinstring = $db->jdate($datenotinstring);
|
||||||
}
|
}
|
||||||
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
||||||
$value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(12, 0, 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring;
|
$value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(12, 0, 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring;
|
||||||
}
|
}
|
||||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) {
|
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) {
|
||||||
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
|
$datenotinstring = empty($object->array_options['options_'.$tmpkeyextra]) ? '' : $object->array_options['options_'.$tmpkeyextra];
|
||||||
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
||||||
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
if (!empty($object->array_options['options_'.$tmpkeyextra]) && !is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||||
$datenotinstring = $db->jdate($datenotinstring);
|
$datenotinstring = $db->jdate($datenotinstring);
|
||||||
}
|
}
|
||||||
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2018 ATM Consulting <support@atm-consulting.fr>
|
/* Copyright (C) 2018 ATM Consulting <support@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -88,7 +89,7 @@ if ($absolute_discount > 0) {
|
|||||||
// Is there credit notes availables ?
|
// Is there credit notes availables ?
|
||||||
if ($absolute_creditnote > 0) {
|
if ($absolute_creditnote > 0) {
|
||||||
// If validated, we show link "add credit note to payment"
|
// If validated, we show link "add credit note to payment"
|
||||||
if ($cannotApplyDiscount || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
|
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
|
||||||
$translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
|
$translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
|
||||||
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.';
|
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.';
|
||||||
|
|
||||||
|
|||||||
@ -138,6 +138,7 @@ if (in_array($modulepart, array('facture_paiement', 'unpaid'))) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// If we have a hash public (hashp), we guess the original_file.
|
// If we have a hash public (hashp), we guess the original_file.
|
||||||
|
$ecmfile='';
|
||||||
if (!empty($hashp)) {
|
if (!empty($hashp)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
$ecmfile = new EcmFiles($db);
|
$ecmfile = new EcmFiles($db);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user