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

This commit is contained in:
John BOTELLA 2021-11-01 10:08:37 +01:00
commit c28e9f5f7c
356 changed files with 4274 additions and 2773 deletions

View File

@ -11,6 +11,7 @@ For users:
NEW: Online proposal signature NEW: Online proposal signature
NEW: Can define some max limit on expense report (per period, per type or expense, ...) NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
NEW: Add option to disable globaly some notifications emails.
NEW: #18326 Workflow: Close order on shipment closing. NEW: #18326 Workflow: Close order on shipment closing.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference. NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
NEW: #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment NEW: #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment

View File

@ -8,12 +8,10 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## 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> [![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](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

View File

@ -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
@ -196,7 +196,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- 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> [![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](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)]

View File

@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier'; - protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono'; + protected $default_monospaced_font = 'freemono';
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
of the function, replace:
$roman = '';
with:
$roman = '';
if ($number >= 4000) {
// do not represent numbers above 4000 in Roman numerals
return strval($number);
}

View File

@ -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);

View File

@ -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';

View File

@ -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');
} }

View File

@ -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');
} }

View File

@ -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>';

View File

@ -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>&nbsp;</td>'; print '<td>&nbsp;</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>&nbsp;</td>'; print '<td>&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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>&nbsp;</td>'; print '</td><td>&nbsp;</td>';
print '<td class="right">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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">&nbsp;</td>'; print '<td class="right">&nbsp;</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>";

View File

@ -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) {

View File

@ -829,27 +829,38 @@ if ($action == 'edit') {
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') {
if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) { if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) {
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com' // List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD); $text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
} else { } else {
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'. // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) { if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add in SPF if we use the mail method // List of IP show as record to add in SPF if we use the mail method
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); $text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
} }
} }
} else { } else {
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) { if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]' // List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
// TODO Add a key to allow to show the IP/name of server detected dynamically // TODO Add a key to allow to show the IP/name of server detected dynamically
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); $text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
} }
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server. if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com' // List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$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')) {
$domain = array_pop(explode('@', $companyemail));
$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);
} }

View File

@ -97,6 +97,10 @@ if ($action == 'setvalue' && $user->admin) {
$error++; $error++;
} }
$result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
if ($result < 0) {
$error++;
}
if (!$error) { if (!$error) {
$db->commit(); $db->commit();
@ -199,6 +203,29 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
print '<td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER);
}
print '</td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
print '<td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX);
}
print '</td>';
print '</tr>';
print '</table>'; print '</table>';
print $form->buttonsSaveCancel("Save", ''); print $form->buttonsSaveCancel("Save", '');

View File

@ -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"));

View File

@ -1,28 +0,0 @@
<?php
require '../../main.inc.php';
$action = GETPOST('action', 'alphanohtml');
$select_product_val = GETPOST('select_product_val', 'int');
$current_bom_id = GETPOST('current_bom_id', 'int');
global $db;
switch ($action) {
case 'select_BOM':
//Selection of nomenclatures corresponding to the selected product
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product, p.label AS product_label FROM '.MAIN_DB_PREFIX.'bom_bom AS b ';
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'product AS p ON b.fk_product=p.rowid';
$sql.= ' WHERE fk_product='.(int) $select_product_val.' AND b.rowid<>'. (int) $current_bom_id;
$resql = $db->query($sql);
if ($resql && $db->num_rows($resql) > 0) {
$options = array();
$cpt=0;
while ($obj = $db->fetch_object($resql)) {
$options[$obj->rowid] = $obj->ref.' - '.$obj->label;
$cpt++;
}
print json_encode($options);
}
break;
}

View File

@ -243,6 +243,7 @@ if (empty($reshook)) {
} }
/* /*
* View * View
*/ */
@ -573,38 +574,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '</table>'; print '</table>';
} }
?>
<script>
let select_product_val;
let current_bom_id = <?php echo $object->id?>;
//On change on the bom select
$('#idprod').on('change', function () {
select_product_val = $('#idprod').select2().val();
//Ajax to set all options without reloading the page
$.ajax({
url: 'script/interface.php'
, method: 'POST'
, dataType: 'text'
, data: {
action: 'select_BOM'
, select_product_val: select_product_val
, current_bom_id: current_bom_id
}
}).done(function (data) {
//To remove all options of the bom select on change
$('#bom_select').get(0).length = 0;
//To set options for the bom select on change
let options = JSON.parse(data)
for (let key in options) {
let opt = new Option(options[key], key);
$('#bom_select').append(opt)
}
})
})
</script>
<?php
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";
@ -612,9 +581,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(document).ready(function() { $(document).ready(function() {
// When clicking on collapse
$(".collapse_bom").click(function() { $(".collapse_bom").click(function() {
console.log("We click on collapse");
var id_bom_line = $(this).attr('id').replace('collapse-', ''); var id_bom_line = $(this).attr('id').replace('collapse-', '');
if($(this).text().indexOf('+') > 0) { if($(this).text().indexOf('+') > 0) {
$('[parentid="'+ id_bom_line +'"]').show(); $('[parentid="'+ id_bom_line +'"]').show();
@ -630,12 +599,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// To Show all the sub bom lines // To Show all the sub bom lines
$("#show_all").click(function() { $("#show_all").click(function() {
console.log("We click on show all");
$("[class^=sub_bom_lines]").show(); $("[class^=sub_bom_lines]").show();
$("[class^=collapse_bom]").html('(-)&nbsp;'); $("[class^=collapse_bom]").html('(-)&nbsp;');
return false; return false;
}); });
// To Hide all the sub bom lines // To Hide all the sub bom lines
$("#hide_all").click(function() { $("#hide_all").click(function() {
console.log("We click on hide all");
$("[class^=sub_bom_lines]").hide(); $("[class^=sub_bom_lines]").hide();
$("[class^=collapse_bom]").html('(+)&nbsp;'); $("[class^=collapse_bom]").html('(+)&nbsp;');
return false; return false;

View File

@ -61,8 +61,6 @@ if ($nolinesbefore) {
print '<td class="linecoldescription minwidth500imp">'; print '<td class="linecoldescription minwidth500imp">';
print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans('AddNewLine').'</span>'; print '<div id="add"></div><span class="hideonsmartphone">'.$langs->trans('AddNewLine').'</span>';
print '</td>'; print '</td>';
// Linked BOM
print '<td class="linecolBOM">'.$langs->trans('BOM').'</td>';
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>'; print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
if (!empty($conf->global->PRODUCT_USE_UNITS)) { if (!empty($conf->global->PRODUCT_USE_UNITS)) {
print '<td class="linecoluseunit left">'; print '<td class="linecoluseunit left">';
@ -90,15 +88,14 @@ print '<td class="bordertop nobottom linecoldescription minwidth500imp">';
// Predefined product/service // Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
if ($forceall >= 0 && $freelines) { if (!empty($conf->global->BOM_SUB_BOM)) {
echo '<br>'; print $langs->trans("Product");
} }
echo '<span class="prod_entry_mode_predef">'; echo '<span class="prod_entry_mode_predef">';
$filtertype = ''; $filtertype = 0;
if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) { if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) {
$filtertype = '1'; $filtertype = -1;
} }
$statustoshow = -1; $statustoshow = -1;
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
// hide products in closed warehouse, but show products for internal transfer // hide products in closed warehouse, but show products for internal transfer
@ -109,11 +106,14 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
echo '</span>'; echo '</span>';
} }
$coldisplay++; if (!empty($conf->global->BOM_SUB_BOM)) {
print '<td class="bordertop nobottom linecolbom">'; print '<br>'.$langs->trans("or").' '.$langs->trans("BOM");
// TODO Add component to select a BOM
print '<select id="bom_select" name="bom_select"><options value="-1"></options></select>'; print '<select id="bom_select" name="bom_select"><options value="-1"></options></select>';
}
print '</td>'; print '</td>';
$coldisplay++; $coldisplay++;
print '<td class="bordertop nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(GETPOSTISSET("qty") ? GETPOST("qty", 'alpha', 2) : 1).'">'; print '<td class="bordertop nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="'.(GETPOSTISSET("qty") ? GETPOST("qty", 'alpha', 2) : 1).'">';
print '</td>'; print '</td>';
@ -134,7 +134,7 @@ print '</td>';
$coldisplay++; $coldisplay++;
print '<td class="bordertop nobottom nowrap linecollost right">'; print '<td class="bordertop nobottom nowrap linecollost right">';
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.(GETPOSTISSET("efficiency") ?GETPOST("efficiency", 'alpha') : 1).'">'; print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.((GETPOSTISSET("efficiency") && $action == 'addline') ?GETPOST("efficiency", 'alpha') : 1).'">';
print '</td>'; print '</td>';
$coldisplay++; $coldisplay++;

View File

@ -97,8 +97,6 @@ print '</td>';
*/ */
$coldisplay++; $coldisplay++;
// For BOM
print '<td></td>';
print '<td class="nobottom linecolqty right">'; print '<td class="nobottom linecolqty right">';
if (($line->info_bits & 2) != 2) { if (($line->info_bits & 2) != 2) {
@ -126,7 +124,7 @@ print '</td>';
$coldisplay++; $coldisplay++;
print '<td class="nobottom nowrap linecollost right">'; print '<td class="nobottom nowrap linecollost right">';
print '<input type="text" size="1" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>'; print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>';
$coldisplay++; $coldisplay++;
print '<td class="nobottom nowrap linecolcostprice right">'; print '<td class="nobottom nowrap linecolcostprice right">';
@ -135,9 +133,8 @@ print '</td>';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">'; print '<td class="nobottom linecoledit center valignmiddle" colspan="'.$colspan.'">';
$coldisplay += $colspan; $coldisplay += $colspan;
print '<input type="submit" class="button buttongen marginbottomonly button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button buttongen margintoponly marginbottomonly button-save" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
print '<br>'; print '<input type="submit" class="button buttongen margintoponly marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
print '<input type="submit" class="button buttongen marginbottomonly button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -39,23 +39,25 @@ if (empty($object) || !is_object($object)) {
exit; exit;
} }
print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n"; print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
// Title line // Title line
print "<thead>\n"; print "<thead>\n";
print '<tr class="liste_titre nodrag nodrop">'; print '<tr class="liste_titre nodrag nodrop">';
print '<a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
// Adds a line numbering column // Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
print '<td class="linecolnum center">&nbsp;</td>'; print '<td class="linecolnum center">&nbsp;</td>';
} }
// Description // Product or sub-bom
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>'; print '<td class="linecoldescription">'.$langs->trans('Description');
if (!empty($conf->global->BOM_SUB_BOM)) {
// Linked BOM print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<td class="linecolBOM">'.$langs->trans('BOM').'</td>'; print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}
print '</td>';
// Qty // Qty
print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).'</td>'; print '<td class="linecolqty right">'.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).'</td>';

View File

@ -82,19 +82,14 @@ $tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product); $tmpproduct->fetch($line->fk_product);
$tmpbom = new BOM($object->db); $tmpbom = new BOM($object->db);
$res = $tmpbom->fetch($line->fk_bom_child); $res = $tmpbom->fetch($line->fk_bom_child);
if (!empty($tmpbom->id)) { if ($tmpbom->id > 0) {
print $tmpbom->getNomUrl(1);
print '<a class="collapse_bom" id="collapse-'.$line->id.'" href="#">' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . '&nbsp;</a>'; print '<a class="collapse_bom" id="collapse-'.$line->id.'" href="#">' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . '&nbsp;</a>';
} } else {
print $tmpproduct->getNomUrl(1); print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label; print ' - '.$tmpproduct->label;
print '</td>';
// To show BOM links in the list
if ($res > 0) {
print '<td id="bom_id">'.$tmpbom->getNomUrl(1).'</td>';
} else {
print '<td id="bom_id">&nbsp;</td>';
} }
print '</td>';
print '<td class="linecolqty nowrap right">'; print '<td class="linecolqty nowrap right">';
$coldisplay++; $coldisplay++;

View File

@ -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

View File

@ -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);
/* /*

View File

@ -244,7 +244,6 @@ class Categorie extends CommonObject
* @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_ACTIONCOMM
* @see Categorie::TYPE_WEBSITE_PAGE * @see Categorie::TYPE_WEBSITE_PAGE
* @see Categorie::TYPE_TICKET * @see Categorie::TYPE_TICKET
*/ */
public $type; public $type;
@ -1977,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 "";

View File

@ -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

View File

@ -972,7 +972,7 @@ if ($action == 'create') {
print '<input type="hidden" name="donotclearsession" value="1">'; print '<input type="hidden" name="donotclearsession" value="1">';
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="'.dol_getIdFromCode($db, 'AC_OTH', 'c_actioncomm').'">'; print '<input type="hidden" name="actioncode" value="'.dol_getIdFromCode($db, 'AC_OTH', 'c_actioncomm').'">';
@ -1909,9 +1909,7 @@ if ($id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref;
$morehtmlref .= '</a>';
if ($proj->title) { if ($proj->title) {
$morehtmlref .= ' - '.$proj->title; $morehtmlref .= ' - '.$proj->title;
} }
@ -2212,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">';

View File

@ -166,9 +166,7 @@ if ($object->id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref;
$morehtmlref .= '</a>';
if ($proj->title) { if ($proj->title) {
$morehtmlref .= ' - '.$proj->title; $morehtmlref .= ' - '.$proj->title;
} }
@ -201,9 +199,9 @@ if ($object->id > 0) {
// Date start // Date start
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
if (!$object->fulldayevent) { if (!$object->fulldayevent) {
print dol_print_date($object->datep, 'dayhour'); print dol_print_date($object->datep, 'dayhour', 'tzuser');
} else { } else {
print dol_print_date($object->datep, 'day'); print dol_print_date($object->datep, 'day', 'tzuser');
} }
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) { if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) {
print img_warning($langs->trans("Late")); print img_warning($langs->trans("Late"));
@ -214,9 +212,9 @@ if ($object->id > 0) {
// Date end // Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (!$object->fulldayevent) { if (!$object->fulldayevent) {
print dol_print_date($object->datef, 'dayhour'); print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else { } else {
print dol_print_date($object->datef, 'day'); print dol_print_date($object->datef, 'day', 'tzuser');
} }
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) { if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late")); print img_warning($langs->trans("Late"));

View File

@ -93,9 +93,7 @@ if (!empty($conf->projet->enabled)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref;
$morehtmlref .= '</a>';
if ($proj->title) { if ($proj->title) {
$morehtmlref .= ' - '.$proj->title; $morehtmlref .= ' - '.$proj->title;
} }

View File

@ -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';

View File

@ -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";

View File

@ -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";
@ -802,7 +801,7 @@ $currentdaytoshow = $firstdaytoshow;
echo '<div class="div-table-responsive">'; echo '<div class="div-table-responsive">';
while ($currentdaytoshow < $lastdaytoshow) { while ($currentdaytoshow < $lastdaytoshow) {
echo '<table width="100%" class="noborder nocellnopadd cal_month">'; echo '<table class="centpercent noborder nocellnopadd cal_month">';
echo '<tr class="liste_titre">'; echo '<tr class="liste_titre">';
echo '<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">'; echo '<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">';
@ -829,7 +828,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
// Filter on days // Filter on days
print img_picto('', 'clock', 'class="fawidth30 inline-block paddingleft"'); print img_picto('', 'clock', 'class="fawidth30 inline-block paddingleft"');
print '<span class="hideonsmartphone" title="'.$langs->trans("VisibleDaysRange").'">'.$langs->trans("DaysOfWeek").'</span>'; print '<span class="hideonsmartphone" title="'.$langs->trans("VisibleDaysRange").'">'.$langs->trans("DaysOfWeek").'</span>';
print "\n".'<div class="ui-grid-a inline-block"><div class="ui-block-a">'; print "\n".'<div class="ui-grid-a inline-block"><div class="ui-block-a nowraponall">';
print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">'; print '<input type="number" class="short" name="begin_d" value="'.$begin_d.'" min="1" max="7">';
if (empty($conf->dol_use_jmobile)) { if (empty($conf->dol_use_jmobile)) {
print ' - '; print ' - ';

View File

@ -2014,14 +2014,14 @@ 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,9 +2041,10 @@ 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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ': '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -166,9 +166,10 @@ if ($object->id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -159,9 +159,10 @@ if ($object->id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -106,9 +106,10 @@ if (!empty($conf->projet->enabled)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -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)) {

View File

@ -130,9 +130,10 @@ if ($object->id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -2075,9 +2075,10 @@ if ($action == 'create' && $usercancreate) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -161,9 +161,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -153,9 +153,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -106,9 +106,10 @@ if (!empty($conf->projet->enabled)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -125,9 +125,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -120,6 +120,8 @@ if (GETPOST("rel") == 'prev') {
$found = true; $found = true;
} }
$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions

View File

@ -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'];

View File

@ -74,6 +74,8 @@ if ($id > 0 || !empty($ref)) {
$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', ''); $result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions

View File

@ -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>";
} }

View File

@ -69,6 +69,9 @@ $object->fetch($id, $ref);
$upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id); $upload_dir = $conf->bank->dir_output.'/'.dol_sanitizeFileName($object->id);
$modulepart = 'banque'; $modulepart = 'banque';
$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions

View File

@ -42,12 +42,6 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'deplacement', $id, '');
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@ -74,6 +68,14 @@ $object->fetch($id, $ref);
$upload_dir = $conf->deplacement->dir_output.'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->deplacement->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'trip'; $modulepart = 'trip';
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'deplacement', $id, '');
$permissiontoadd = $user->rights->deplacement->creer; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions

View File

@ -1218,9 +1218,10 @@ 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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -2846,6 +2846,7 @@ if (empty($reshook)) {
* View * View
*/ */
$form = new Form($db); $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
@ -3818,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
*/ */
@ -4093,6 +4102,8 @@ if ($action == 'create') {
$i++; $i++;
$close[$i]['code'] = 'badcustomer'; $close[$i]['code'] = 'badcustomer';
$i++; $i++;
$close[$i]['code'] = 'bankcharge';
$i++;
$close[$i]['code'] = 'other'; $close[$i]['code'] = 'other';
$i++; $i++;
// Help // Help
@ -4101,6 +4112,8 @@ if ($action == 'create') {
$i++; $i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc"); $close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
$i++; $i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBankChargeDesc");
$i++;
$close[$i]['label'] = $langs->trans("Other"); $close[$i]['label'] = $langs->trans("Other");
$i++; $i++;
// Texte // Texte
@ -4109,6 +4122,8 @@ if ($action == 'create') {
$i++; $i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1); $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
$i++; $i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBankCharge", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1); $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1);
$i++; $i++;
// arrayreasons[code]=reason // arrayreasons[code]=reason
@ -4243,9 +4258,10 @@ 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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice
$hookmanager->initHooks(array('invoicedao')); $hookmanager->initHooks(array('invoicedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint; if ($reshook > 0) {
else $result .= $hookmanager->resPrint; $result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result; return $result;
} }

View File

@ -100,6 +100,14 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
* View * View
*/ */
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses'); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl); llxHeader('', $title, $helpurl);
@ -160,9 +168,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -92,6 +92,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
* View * View
*/ */
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; $help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
@ -153,9 +161,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -62,6 +62,14 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
* View * View
*/ */
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$form = new Form($db); $form = new Form($db);
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info'); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
@ -112,9 +120,10 @@ if (!empty($conf->projet->enabled)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -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);
} }

View File

@ -77,6 +77,14 @@ if (empty($reshook)) {
* View * View
*/ */
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes'); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl); llxHeader('', $title, $helpurl);
@ -129,9 +137,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -371,9 +371,10 @@ if ($object->id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -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 {

View File

@ -514,9 +514,10 @@ if ($id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -78,6 +78,8 @@ if ($user->socid) {
} }
$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges'); $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges');
$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions
@ -125,9 +127,10 @@ if ($object->id) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -94,9 +94,10 @@ if (!empty($conf->projet->enabled)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -79,6 +79,8 @@ if ($user->socid) {
} }
$result = restrictedArea($user, 'tax', '', 'tva', 'charges'); $result = restrictedArea($user, 'tax', '', 'tva', 'charges');
$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions
@ -86,7 +88,7 @@ $result = restrictedArea($user, 'tax', '', 'tva', 'charges');
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
if ($action == 'setlib' && $user->rights->tax->charges->creer) { if ($action == 'setlib' && $permissiontoadd) {
$object->fetch($id); $object->fetch($id);
$result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
if ($result < 0) { if ($result < 0) {

View File

@ -818,7 +818,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
print '<tr>'; print '<tr>';
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>'; print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
print '<td>'.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)).'</td>'; print '<td>';
print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
print '</td>';
print '</tr>'; print '</tr>';
} }
@ -1095,8 +1097,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
print '<tr>'; print '<tr>';
print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>'; print '<td class="noemail"><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
print '<td>';
$useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)); $useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
print '<td>'.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty).'</td>'; print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty);
print '</td>';
print '</tr>'; print '</tr>';
} }
@ -1323,7 +1327,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>'; print '<tr><td>'.$langs->trans("No_Email").'</td><td>';
if ($object->email) {
print yn($object->no_email);
} else {
print '<span class="opacitymedium">'.$langs->trans("EMailNotDefined").'</span>';
}
print '</td></tr>';
} }
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>'; print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>';

View File

@ -49,12 +49,6 @@ if (!empty($canvas)) {
$objcanvas->getCanvas('contact', 'contactcard', $canvas); $objcanvas->getCanvas('contact', 'contactcard', $canvas);
} }
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
// Get parameters // Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
@ -91,6 +85,15 @@ $modulepart = 'contact';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contactdocument')); $hookmanager->initHooks(array('contactdocument'));
// Security check
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions
*/ */

View File

@ -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');
} }

View File

@ -204,6 +204,12 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
$arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1); $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1);
} }
$arrayfields['unsubscribed'] = array(
'label'=>'No_Email',
'checked'=>0,
'enabled'=>(!empty($conf->mailing->enabled)),
'position'=>41);
if (!empty($conf->socialnetworks->enabled)) { if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
@ -355,7 +361,7 @@ if ($resql) {
} }
$sql = "SELECT s.rowid as socid, s.nom as name,"; $sql = "SELECT s.rowid as socid, s.nom as name,";
$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.no_email,"; $sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,";
$sql .= " p.socialnetworks, p.photo,"; $sql .= " p.socialnetworks, p.photo,";
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; $sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,"; $sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,";
@ -366,6 +372,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
} }
} }
if (!empty($conf->mailing->enabled)) {
$sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed";
}
// Add fields from hooks // Add fields from hooks
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@ -499,8 +508,11 @@ if (strlen($search_town)) {
if (count($search_roles) > 0) { if (count($search_roles) > 0) {
$sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
} }
if ($search_no_email != '' && $search_no_email >= 0) { if ($search_no_email != -1 && $search_no_email > 0) {
$sql .= " AND p.no_email = ".((int) $search_no_email); $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0";
}
if ($search_no_email != -1 && $search_no_email == 0) {
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
} }
if ($search_status != '' && $search_status >= 0) { if ($search_status != '' && $search_status >= 0) {
$sql .= " AND p.statut = ".((int) $search_status); $sql .= " AND p.statut = ".((int) $search_status);
@ -568,75 +580,75 @@ llxHeader('', $title, $help_url);
$param = ''; $param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&amp;contextpage='.$contextpage; $param .= '&contextpage='.urlencode($contextpage);
} }
if ($limit > 0 && $limit != $conf->liste_limit) { if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&amp;limit='.$limit; $param .= '&limit='.((int) $limit);
} }
$param .= '&amp;begin='.urlencode($begin).'&amp;userid='.urlencode($userid).'&amp;contactname='.urlencode($sall); $param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param .= '&amp;type='.urlencode($type).'&amp;view='.urlencode($view); $param .= '&type='.urlencode($type).'&view='.urlencode($view);
if (!empty($search_categ) && $search_categ != '-1') { if (!empty($search_categ) && $search_categ != '-1') {
$param .= '&amp;search_categ='.urlencode($search_categ); $param .= '&search_categ='.urlencode($search_categ);
} }
if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
$param .= '&amp;search_categ_thirdparty='.urlencode($search_categ_thirdparty); $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
} }
if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
$param .= '&amp;search_categ_supplier='.urlencode($search_categ_supplier); $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
} }
if ($sall != '') { if ($sall != '') {
$param .= '&amp;sall='.urlencode($sall); $param .= '&sall='.urlencode($sall);
} }
if ($search_id > 0) { if ($search_id > 0) {
$param .= "&amp;search_id=".urlencode($search_id); $param .= "&search_id=".urlencode($search_id);
} }
if ($search_lastname != '') { if ($search_lastname != '') {
$param .= '&amp;search_lastname='.urlencode($search_lastname); $param .= '&search_lastname='.urlencode($search_lastname);
} }
if ($search_firstname != '') { if ($search_firstname != '') {
$param .= '&amp;search_firstname='.urlencode($search_firstname); $param .= '&search_firstname='.urlencode($search_firstname);
} }
if ($search_societe != '') { if ($search_societe != '') {
$param .= '&amp;search_societe='.urlencode($search_societe); $param .= '&search_societe='.urlencode($search_societe);
} }
if ($search_address != '') { if ($search_address != '') {
$param .= '&amp;search_address='.urlencode($search_address); $param .= '&search_address='.urlencode($search_address);
} }
if ($search_zip != '') { if ($search_zip != '') {
$param .= '&amp;search_zip='.urlencode($search_zip); $param .= '&search_zip='.urlencode($search_zip);
} }
if ($search_town != '') { if ($search_town != '') {
$param .= '&amp;search_town='.urlencode($search_town); $param .= '&search_town='.urlencode($search_town);
} }
if ($search_country != '') { if ($search_country != '') {
$param .= "&search_country=".urlencode($search_country); $param .= "&search_country=".urlencode($search_country);
} }
if ($search_poste != '') { if ($search_poste != '') {
$param .= '&amp;search_poste='.urlencode($search_poste); $param .= '&search_poste='.urlencode($search_poste);
} }
if ($search_phone_pro != '') { if ($search_phone_pro != '') {
$param .= '&amp;search_phone_pro='.urlencode($search_phone_pro); $param .= '&search_phone_pro='.urlencode($search_phone_pro);
} }
if ($search_phone_perso != '') { if ($search_phone_perso != '') {
$param .= '&amp;search_phone_perso='.urlencode($search_phone_perso); $param .= '&search_phone_perso='.urlencode($search_phone_perso);
} }
if ($search_phone_mobile != '') { if ($search_phone_mobile != '') {
$param .= '&amp;search_phone_mobile='.urlencode($search_phone_mobile); $param .= '&search_phone_mobile='.urlencode($search_phone_mobile);
} }
if ($search_fax != '') { if ($search_fax != '') {
$param .= '&amp;search_fax='.urlencode($search_fax); $param .= '&search_fax='.urlencode($search_fax);
} }
if ($search_email != '') { if ($search_email != '') {
$param .= '&amp;search_email='.urlencode($search_email); $param .= '&search_email='.urlencode($search_email);
} }
if ($search_no_email != '') { if ($search_no_email != '') {
$param .= '&amp;search_no_email='.urlencode($search_no_email); $param .= '&search_no_email='.urlencode($search_no_email);
} }
if ($search_status != '') { if ($search_status != '') {
$param .= '&amp;search_status='.urlencode($search_status); $param .= '&search_status='.urlencode($search_status);
} }
if ($search_priv == '0' || $search_priv == '1') { if ($search_priv == '0' || $search_priv == '1') {
$param .= "&amp;search_priv=".urlencode($search_priv); $param .= "&search_priv=".urlencode($search_priv);
} }
if ($search_stcomm != '') { if ($search_stcomm != '') {
$param .= '&search_stcomm='.urlencode($search_stcomm); $param .= '&search_stcomm='.urlencode($search_stcomm);
@ -843,7 +855,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
print '<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).'">'; print '<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['p.no_email']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
print '</td>'; print '</td>';
@ -965,8 +977,8 @@ if (!empty($arrayfields['p.fax']['checked'])) {
if (!empty($arrayfields['p.email']['checked'])) { if (!empty($arrayfields['p.email']['checked'])) {
print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
} }
if (!empty($arrayfields['p.no_email']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) {
print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
} }
if (!empty($conf->socialnetworks->enabled)) { if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
@ -1019,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);
@ -1155,8 +1168,14 @@ while ($i < min($num, $limit)) {
} }
} }
// No EMail // No EMail
if (!empty($arrayfields['p.no_email']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) {
print '<td class="center">'.yn($obj->no_email).'</td>'; print '<td class="center">';
if (empty($obj->email)) {
//print '<span class="opacitymedium">'.$langs->trans("NoEmail").'</span>';
} else {
print yn(($obj->unsubscribed > 0) ? 1 : 0);
}
print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }

View File

@ -194,9 +194,10 @@ if ($id > 0) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -1335,9 +1335,10 @@ 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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -1730,23 +1730,23 @@ class Contrat extends CommonObject
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description = '".$this->db->escape($desc)."'"; $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description = '".$this->db->escape($desc)."'";
$sql .= ",price_ht='".price2num($price)."'"; $sql .= ",price_ht = ".((float) price2num($price));
$sql .= ",subprice='".price2num($subprice)."'"; $sql .= ",subprice = ".((float) price2num($subprice));
$sql .= ",remise='".price2num($remise)."'"; $sql .= ",remise = ".((float) price2num($remise));
$sql .= ",remise_percent='".price2num($remise_percent)."'"; $sql .= ",remise_percent = ".((float) price2num($remise_percent));
$sql .= ",qty='".$qty."'"; $sql .= ",qty = ".((float) $qty);
$sql .= ",tva_tx='".price2num($tvatx)."'"; $sql .= ",tva_tx = ".((float) price2num($tvatx));
$sql .= ",localtax1_tx='".price2num($localtax1tx)."'"; $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx));
$sql .= ",localtax2_tx='".price2num($localtax2tx)."'"; $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx));
$sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'"; $sql .= ",localtax1_type='".$this->db->escape($localtax1_type);
$sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'"; $sql .= ",localtax2_type='".$this->db->escape($localtax2_type);
$sql .= ", total_ht='".price2num($total_ht)."'"; $sql .= ", total_ht = ".((float) price2num($total_ht));
$sql .= ", total_tva='".price2num($total_tva)."'"; $sql .= ", total_tva = ".((float) price2num($total_tva));
$sql .= ", total_localtax1='".price2num($total_localtax1)."'"; $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1));
$sql .= ", total_localtax2='".price2num($total_localtax2)."'"; $sql .= ", total_localtax2 = ".((float) price2num($total_localtax2));
$sql .= ", total_ttc='".price2num($total_ttc)."'"; $sql .= ", total_ttc = ".((float) price2num($total_ttc));
$sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null"); $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null");
$sql .= ", buy_price_ht='".price2num($pa_ht)."'"; $sql .= ", buy_price_ht = ".((float) price2num($pa_ht));
if ($date_start > 0) { if ($date_start > 0) {
$sql .= ",date_ouverture_prevue = '".$this->db->idate($date_start)."'"; $sql .= ",date_ouverture_prevue = '".$this->db->idate($date_start)."'";
} else { } else {
@ -1767,18 +1767,15 @@ class Contrat extends CommonObject
} else { } else {
$sql .= ",date_cloture = null"; $sql .= ",date_cloture = null";
} }
$sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); $sql .= ", fk_unit = ".($fk_unit > 0 ? ((int) $fk_unit) : "null");
$sql .= " WHERE rowid = ".((int) $rowid); $sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(get_class($this)."::updateline", LOG_DEBUG); dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) { if ($result) {
$result = $this->update_statut($user);
if ($result >= 0) {
if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used
$contractline = new ContratLigne($this->db); $contractline = new ContratLigne($this->db);
$contractline->fetch($rowid); $contractline->fetch($rowid);
$contractline->fetch_optionals();
// We replace values in $contractline->array_options only for entries defined into $array_options // We replace values in $contractline->array_options only for entries defined into $array_options
foreach ($array_options as $key => $value) { foreach ($array_options as $key => $value) {
@ -1804,11 +1801,6 @@ class Contrat extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
} else {
$this->db->rollback();
dol_syslog(get_class($this)."::updateline Erreur -2");
return -2;
}
} else { } else {
$this->db->rollback(); $this->db->rollback();
$this->error = $this->db->error(); $this->error = $this->db->error();

View File

@ -177,9 +177,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -84,6 +84,8 @@ $modulepart = 'contract';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard', 'globalcard')); $hookmanager->initHooks(array('contractcard', 'globalcard'));
$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
/* /*
* Actions * Actions
@ -165,9 +167,10 @@ if ($object->id) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -134,9 +134,10 @@ if ($id > 0 || !empty($ref)) {
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 .= '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$object->fk_project.'" title="'.$langs->trans('ShowProject').'">'; $morehtmlref .= ' : '.$proj->getNomUrl(1);
$morehtmlref .= $proj->ref; if ($proj->title) {
$morehtmlref .= '</a>'; $morehtmlref .= ' - '.$proj->title;
}
} else { } else {
$morehtmlref .= ''; $morehtmlref .= '';
} }

View File

@ -36,8 +36,19 @@ if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) {
die; die;
} }
if ((GETPOST('sendit', 'alpha')
|| GETPOST('linkit', 'restricthtml')
|| ($action == 'confirm_deletefile' && $confirm == 'yes')
|| ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
|| ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
dol_syslog('The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.');
print 'The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.';
die;
}
// Submit file/link // Submit file/link
if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
if (!empty($_FILES)) { if (!empty($_FILES)) {
if (is_array($_FILES['userfile']['tmp_name'])) { if (is_array($_FILES['userfile']['tmp_name'])) {
$userfiles = $_FILES['userfile']['tmp_name']; $userfiles = $_FILES['userfile']['tmp_name'];
@ -75,7 +86,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
} }
} }
} }
} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { } elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
$link = GETPOST('link', 'alpha'); $link = GETPOST('link', 'alpha');
if ($link) { if ($link) {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') {
@ -87,7 +98,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
// Delete file/link // Delete file/link
if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) { if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissiontoadd)) {
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) { if (GETPOST('section', 'alpha')) {
// For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
@ -158,7 +169,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
exit; exit;
} }
} }
} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { } elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$langs->load('link'); $langs->load('link');
$link = new Link($db); $link = new Link($db);
@ -176,7 +187,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
} else { } else {
//error fetching //error fetching
} }
} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { } elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && !empty($permissiontoadd)) {
// For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
if (!empty($upload_dir)) { if (!empty($upload_dir)) {
$filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents $filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents

View File

@ -205,12 +205,14 @@ if ($type == 'directory') {
'product', 'product',
'tax', 'tax',
'project', 'project',
'project_task',
'fichinter', 'fichinter',
'user', 'user',
'expensereport', 'expensereport',
'holiday', 'holiday',
'recruitment-recruitmentcandidature', 'recruitment-recruitmentcandidature',
'banque', 'banque',
'chequereceipt',
'mrp-mo' 'mrp-mo'
); );
@ -243,6 +245,8 @@ if ($type == 'directory') {
$upload_dir = $conf->tax->dir_output; $upload_dir = $conf->tax->dir_output;
} elseif ($module == 'project') { } elseif ($module == 'project') {
$upload_dir = $conf->projet->dir_output; $upload_dir = $conf->projet->dir_output;
} elseif ($module == 'project_task') {
$upload_dir = $conf->projet->dir_output;
} elseif ($module == 'fichinter') { } elseif ($module == 'fichinter') {
$upload_dir = $conf->ficheinter->dir_output; $upload_dir = $conf->ficheinter->dir_output;
} elseif ($module == 'user') { } elseif ($module == 'user') {
@ -255,8 +259,10 @@ if ($type == 'directory') {
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature'; $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
} elseif ($module == 'banque') { } elseif ($module == 'banque') {
$upload_dir = $conf->bank->dir_output; $upload_dir = $conf->bank->dir_output;
} elseif ($module == 'chequereceipt') {
$upload_dir = $conf->bank->dir_output.'/checkdeposits';
} elseif ($module == 'mrp-mo') { } elseif ($module == 'mrp-mo') {
$upload_dir = $conf->mrp->dir_output.'/mo'; $upload_dir = $conf->mrp->dir_output;
} else { } else {
$parameters = array('modulepart'=>$module); $parameters = array('modulepart'=>$module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);

View File

@ -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;

View File

@ -0,0 +1,140 @@
<?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/core/bookmarks_page.php
* \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('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';
if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
}
$langs->loadLangs(array("bookmarks"));
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
/*
* View
*/
$title = $langs->trans("Bookmarks");
// URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests
$head = '<!-- Bookmarks access -->'."\n";
$arrayofjs = array();
$arrayofcss = array();
top_htmlhead($head, $title, 0, 0, $arrayofjs, $arrayofcss);
print '<body>'."\n";
print '<div>';
//print '<br>';
// Instantiate hooks of thirdparty module
$hookmanager->initHooks(array('bookmarks'));
// Define $bookmarks
$bookmarkList = '';
$searchForm = '';
if (empty($conf->bookmarks->enabled)) {
$langs->load("admin");
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).'</span>';
$bookmarkList .= '<br><br>';
} else {
// Menu with list of bookmarks
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
$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">';
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
$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>';
$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
$parameters = array('bookmarks'=>$bookmarkList);
$reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
$bookmarkList .= $hookmanager->resPrint;
} else {
$bookmarkList = $hookmanager->resPrint;
}
print "\n";
print "<!-- Begin Bookmarks 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 $bookmarkList;
print '</div>'."\n";
print '</div></div>';
print "\n<!-- End SearchForm -->\n";
print '</div>';
print '</body></html>'."\n";
$db->close();

View File

@ -94,7 +94,7 @@ class box_project extends ModeleBoxes
// Get list of project id allowed to user (in a string list separated by coma) // Get list of project id allowed to user (in a string list separated by coma)
$projectsListId = ''; $projectsListId = '';
if (!$user->rights->projet->all->lire) { if (empty($user->rights->projet->all->lire)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
} }
@ -102,7 +102,7 @@ class box_project extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql .= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok $sql .= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok
$sql .= " AND p.fk_statut = 1"; // Only open projects $sql .= " AND p.fk_statut = 1"; // Only open projects
if (!$user->rights->projet->all->lire) { if (empty($user->rights->projet->all->lire)) {
$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
} }

View File

@ -145,7 +145,7 @@ class box_task extends ModeleBoxes
// Get list of project id allowed to user (in a string list separated by coma) // Get list of project id allowed to user (in a string list separated by coma)
$projectsListId = ''; $projectsListId = '';
if (!$user->rights->projet->all->lire) { if (empty($user->rights->projet->all->lire)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
} }
@ -168,7 +168,7 @@ class box_task extends ModeleBoxes
$sql .= " AND p.fk_statut = ".Project::STATUS_VALIDATED; $sql .= " AND p.fk_statut = ".Project::STATUS_VALIDATED;
$sql .= " AND (pt.progress < 100 OR pt.progress IS NULL ) "; // 100% is done and not displayed $sql .= " AND (pt.progress < 100 OR pt.progress IS NULL ) "; // 100% is done and not displayed
$sql .= " AND p.usage_task = 1 "; $sql .= " AND p.usage_task = 1 ";
if (!$user->rights->projet->all->lire) { if (empty($user->rights->projet->all->lire)) {
$sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users
} }

View File

@ -101,7 +101,7 @@ class box_validated_projects extends ModeleBoxes
// Get list of project id allowed to user (in a string list separated by coma) // Get list of project id allowed to user (in a string list separated by coma)
$projectsListId = ''; $projectsListId = '';
if (!$user->rights->projet->all->lire) { if (empty($user->rights->projet->all->lire)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
} }

View File

@ -1851,7 +1851,7 @@ abstract class CommonObject
$result = false; $result = false;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table;
$sql .= " WHERE ".$field." = '".$key."'"; $sql .= " WHERE ".$field." = '".$this->db->escape($key)."'";
if (!empty($element)) { if (!empty($element)) {
$sql .= " AND entity IN (".getEntity($element).")"; $sql .= " AND entity IN (".getEntity($element).")";
} else { } else {

View File

@ -145,8 +145,12 @@ class DefaultValues extends CommonObject
$this->db = $db; $this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; $this->fields['rowid']['visible'] = 0;
}
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
$this->fields['entity']['enabled'] = 0;
}
// Unset fields that are disabled // Unset fields that are disabled
foreach ($this->fields as $key => $val) { foreach ($this->fields as $key => $val) {

View File

@ -193,12 +193,12 @@ class Form
* @param object $object Object * @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter * @param boolean $perm Permission to allow button to edit parameter
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...') * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of numeric value). Use '' to use same than $value
* @param object $extObject External object * @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @param string $moreparam More param to add on the form action href URL * @param string $moreparam More param to add on the form action href URL
* @param int $notabletag Do no output table tags * @param int $notabletag Do no output table tags
* @param string $formatfunc Call a specific function to output field * @param string $formatfunc Call a specific function to output field in view mode (For example: 'dol_print_email')
* @param string $paramid Key of parameter for id ('id', 'socid') * @param string $paramid Key of parameter for id ('id', 'socid')
* @return string HTML edit field * @return string HTML edit field
*/ */
@ -214,7 +214,7 @@ class Form
} }
// When option to edit inline is activated // When option to edit inline is activated
if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
$ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
} else { } else {
$editmode = (GETPOST('action', 'aZ09') == 'edit'.$htmlname); $editmode = (GETPOST('action', 'aZ09') == 'edit'.$htmlname);
@ -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 .= "&nbsp;"; $out .= "&nbsp;";
} }
@ -8679,7 +8678,7 @@ class Form
*/ */
public function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '') public function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '')
{ {
global $langs, $conf, $hookmanager, $extralanguages; global $conf, $langs, $hookmanager, $extralanguages;
$ret = ''; $ret = '';
if (empty($fieldid)) { if (empty($fieldid)) {
@ -8691,7 +8690,7 @@ class Form
// Preparing gender's display if there is one // Preparing gender's display if there is one
$addgendertxt = ''; $addgendertxt = '';
if (!empty($object->gender)) { if (property_exists($object, 'gender') && !empty($object->gender)) {
$addgendertxt = ' '; $addgendertxt = ' ';
switch ($object->gender) { switch ($object->gender) {
case 'man': case 'man':
@ -8705,6 +8704,15 @@ class Form
break; break;
} }
} }
/*
$addadmin = '';
if (property_exists($object, 'admin')) {
if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
$addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
} elseif (!empty($object->admin)) {
$addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
}
}*/
// Add where from hooks // Add where from hooks
if (is_object($hookmanager)) { if (is_object($hookmanager)) {
@ -8837,7 +8845,7 @@ class Form
$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
} }
} elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) { } elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) {
$ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; $ret .= dol_htmlentities($object->getFullName($langs));
} elseif (in_array($object->element, array('action', 'agenda'))) { } elseif (in_array($object->element, array('action', 'agenda'))) {
$ret .= $object->ref.'<br>'.$object->label; $ret .= $object->ref.'<br>'.$object->label;
} elseif (in_array($object->element, array('adherent_type'))) { } elseif (in_array($object->element, array('adherent_type'))) {
@ -9085,7 +9093,7 @@ class Form
} }
$ret .= '<table class="nobordernopadding centpercent">'; $ret .= '<table class="nobordernopadding centpercent">';
if ($object->photo) { if ($object->photo) {
$ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>'; $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>';
} }
$ret .= '<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'></td></tr>'; $ret .= '<tr><td class="tdoverflow"><input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'></td></tr>';
$ret .= '</table>'; $ret .= '</table>';

View File

@ -1678,6 +1678,9 @@ class FormFile
} elseif ($modulepart == 'project') { } elseif ($modulepart == 'project') {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$object_instance = new Project($this->db); $object_instance = new Project($this->db);
} elseif ($modulepart == 'project_task') {
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$object_instance = new Task($this->db);
} elseif ($modulepart == 'fichinter') { } elseif ($modulepart == 'fichinter') {
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$object_instance = new Fichinter($this->db); $object_instance = new Fichinter($this->db);
@ -1696,6 +1699,9 @@ class FormFile
} elseif ($modulepart == 'banque') { } elseif ($modulepart == 'banque') {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$object_instance = new Account($this->db); $object_instance = new Account($this->db);
} elseif ($modulepart == 'chequereceipt') {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
$object_instance = new RemiseCheque($this->db);
} elseif ($modulepart == 'mrp-mo') { } elseif ($modulepart == 'mrp-mo') {
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
$object_instance = new Mo($this->db); $object_instance = new Mo($this->db);
@ -1750,14 +1756,19 @@ class FormFile
$id = (isset($reg[1]) ? $reg[1] : ''); $id = (isset($reg[1]) ? $reg[1] : '');
} elseif ($modulepart == 'invoice_supplier') { } elseif ($modulepart == 'invoice_supplier') {
preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg);
$ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) { $ref = (isset($reg[1]) ? $reg[1] : '');
if (is_numeric($ref)) {
$id = $ref; $id = $ref;
$ref = ''; $ref = '';
} }
} elseif ($modulepart == 'user' || $modulepart == 'holiday') { } elseif ($modulepart == 'user') {
// $ref may be also id with old supplier invoices // $ref may be also id with old supplier invoices
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
$id = (isset($reg[1]) ? $reg[1] : ''); $id = (isset($reg[1]) ? $reg[1] : '');
} elseif ($modulepart == 'project_task') {
// $ref of task is the sub-directory of the project
$reg = explode("/", $relativefile);
$ref = (isset($reg[1]) ? $reg[1] : '');
} elseif (in_array($modulepart, array( } elseif (in_array($modulepart, array(
'invoice', 'invoice',
'propal', 'propal',
@ -1767,11 +1778,14 @@ class FormFile
'contract', 'contract',
'product', 'product',
'project', 'project',
'project_task',
'fichinter', 'fichinter',
'expensereport', 'expensereport',
'recruitment-recruitmentcandidature', 'recruitment-recruitmentcandidature',
'mrp-mo', 'mrp-mo',
'banque'))) { 'banque',
'chequereceipt',
'holiday'))) {
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
$ref = (isset($reg[1]) ? $reg[1] : ''); $ref = (isset($reg[1]) ? $reg[1] : '');
} else { } else {

View File

@ -691,9 +691,9 @@ class FormMail extends Form
$out .= '<tr><td class="minwidth200">'; $out .= '<tr><td class="minwidth200">';
$out .= $langs->trans("GroupEmails"); $out .= $langs->trans("GroupEmails");
$out .= '</td><td>'; $out .= '</td><td>';
$out .= ' <input type="checkbox" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> '; $out .= ' <input type="checkbox" id="oneemailperrecipient" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
$out .= $langs->trans("OneEmailPerRecipient"); $out .= '<label for="oneemailperrecipient">'.$langs->trans("OneEmailPerRecipient").'</label>';
$out .= '<span class="hideonsmartphone">'; $out .= '<span class="hideonsmartphone opacitymedium">';
$out .= ' - '; $out .= ' - ';
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail"); $out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
$out .= '</span>'; $out .= '</span>';
@ -773,12 +773,11 @@ class FormMail extends Form
if (!empty($this->withmaindocfile)) { if (!empty($this->withmaindocfile)) {
if ($this->withmaindocfile == 1) { if ($this->withmaindocfile == 1) {
$out .= '<input type="checkbox" name="addmaindocfile" value="1" />'; $out .= '<input type="checkbox" id="addmaindocfile" name="addmaindocfile" value="1" />';
} elseif ($this->withmaindocfile == -1) {
$out .= '<input type="checkbox" id="addmaindocfile" name="addmaindocfile" value="1" checked="checked" />';
} }
if ($this->withmaindocfile == -1) { $out .= ' <label for="addmaindocfile">'.$langs->trans("JoinMainDoc").'.</label><br>';
$out .= '<input type="checkbox" name="addmaindocfile" value="1" checked="checked" />';
}
$out .= ' '.$langs->trans("JoinMainDoc").'.<br>';
} }
if (is_numeric($this->withfile)) { if (is_numeric($this->withfile)) {

View File

@ -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;
} }

View File

@ -104,6 +104,7 @@ class FormPropal
print '<option value="-1">&nbsp;</option>'; print '<option value="-1">&nbsp;</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') {

View File

@ -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();

View File

@ -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
@ -288,16 +291,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);
} }
$this->connectedServer = $host;
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 +354,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 +421,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) {

View File

@ -108,10 +108,26 @@ class Notify
*/ */
public function confirmMessage($action, $socid, $object) public function confirmMessage($action, $socid, $object)
{ {
global $langs; global $conf, $langs;
$langs->load("mails"); $langs->load("mails");
$listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0); $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0);
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER)) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'touser') {
unset($listofnotiftodo[$val['email']]);
//$listofnotiftodo = array_merge($listofnotiftodo);
}
}
}
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX)) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'tofixedemail') {
unset($listofnotiftodo[$val['email']]);
//$listofnotiftodo = array_merge($listofnotiftodo);
}
}
}
$texte = ''; $texte = '';
$nb = -1; $nb = -1;

View File

@ -318,14 +318,14 @@ 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|object Result of fetch_object
*/ */
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) {
@ -338,9 +338,10 @@ abstract class DoliDB implements Database
/** /**
* 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)

View File

@ -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);
} }

View File

@ -258,12 +258,12 @@ print '
window.getSelection().removeAllRanges(); window.getSelection().removeAllRanges();
/* Show message */ /* Show message */
var lastchild = this.parentNode.lastChild; var lastchild = this.parentNode.lastChild; /* .parentNode is clipboardCP and last child is clipboardCPText */
var tmp = lastchild.innerHTML var tmp = lastchild.innerHTML
if (succeed) { if (succeed) {
lastchild.innerHTML = \''.dol_escape_js($langs->trans('CopiedToClipboard')).'\'; lastchild.innerHTML = \'<div class="clipboardCPTextDivInside opacitymedium">'.dol_escape_js($langs->trans('CopiedToClipboard')).'</div>\';
} else { } else {
lastchild.innerHTML = \''.dol_escape_js($langs->trans('Error')).'\'; lastchild.innerHTML = \'<div class="clipboardCPTextDivInside opacitymedium">'.dol_escape_js($langs->trans('Error')).'</div>\';
} }
setTimeout(() => { lastchild.innerHTML = tmp; }, 1000); setTimeout(() => { lastchild.innerHTML = tmp; }, 1000);
}); });

View File

@ -108,6 +108,10 @@ function getEntity($element, $shared = 1, $currentobject = null)
{ {
global $conf, $mc, $hookmanager, $object, $action; global $conf, $mc, $hookmanager, $object, $action;
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) {
case 'contrat': case 'contrat':
@ -2289,6 +2293,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 +2321,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 +2389,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 +2405,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 +3674,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 +3686,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 +4477,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 +4500,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
@ -4824,7 +4828,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 +5195,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 +5856,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);
} }
@ -6677,7 +6681,7 @@ function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0)
* @param bool $double_encode When double_encode is turned off, PHP will not encode existing html entities * @param bool $double_encode When double_encode is turned off, PHP will not encode existing html entities
* @return string $ret Encoded string * @return string $ret Encoded string
*/ */
function dol_htmlentities($string, $flags = null, $encoding = 'UTF-8', $double_encode = false) function dol_htmlentities($string, $flags = ENT_QUOTES|ENT_SUBSTITUTE, $encoding = 'UTF-8', $double_encode = false)
{ {
return htmlentities($string, $flags, $encoding, $double_encode); return htmlentities($string, $flags, $encoding, $double_encode);
} }
@ -8151,16 +8155,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 +8826,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)
{ {
@ -10040,7 +10048,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
} }
$class = 'btnTitle'; $class = 'btnTitle';
if (in_array($iconClass, array('fa fa-plus-circle', 'fa fa-comment-dots'))) { if (in_array($iconClass, array('fa fa-plus-circle', 'fa fa-plus-circle size15x', 'fa fa-comment-dots'))) {
$class .= ' btnTitlePlus'; $class .= ' btnTitlePlus';
} }
$useclassfortooltip = 1; $useclassfortooltip = 1;
@ -10522,9 +10530,9 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex
$tag = 'span'; // Using div does not work when using the js copy code. $tag = 'span'; // Using div does not work when using the js copy code.
if ($texttoshow) { if ($texttoshow) {
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>'; $result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue hidewithsize">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPValueToPrint">'.dol_escape_htmltag($texttoshow, 1, 1).'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
} else { } else {
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>'; $result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><'.$tag.' class="clipboardCPValue">'.dol_escape_htmltag($valuetocopy, 1, 1).'</'.$tag.'><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText"></span></span>';
} }
return $result; return $result;

View File

@ -249,7 +249,10 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
$request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request $request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request
dol_syslog("getURLContent request=".$request); dol_syslog("getURLContent request=".$request);
//dol_syslog("getURLContent response =".response); // This may contains binary data, so we dont output it if (!empty($conf->global->MAIN_GETURLCONTENT_OUTPUT_RESPONSE)) {
// This may contains binary data, so we dont output reponse by default.
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
$rep = array(); $rep = array();

View File

@ -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>';
} }
} }

View File

@ -1045,7 +1045,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 +1054,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 +1067,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 +1075,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 +1085,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 +1093,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 +1101,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 +1109,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 +1117,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);
} }

View File

@ -311,7 +311,7 @@ function project_prepare_head(Project $project, $moreparam = '')
} }
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id; $head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$project->id;
$head[$h][1] .= $langs->trans("Events"); $head[$h][1] = $langs->trans("Events");
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$head[$h][1] .= '/'; $head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda"); $head[$h][1] .= $langs->trans("Agenda");

View File

@ -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.
@ -304,7 +302,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
$nbko++; $nbko++;
} }
} elseif ($feature == 'projet') { } elseif ($feature == 'projet') {
if (!$user->rights->projet->lire && !$user->rights->projet->all->lire) { if (!$user->rights->projet->lire && empty($user->rights->projet->all->lire)) {
$readok = 0; $readok = 0;
$nbko++; $nbko++;
} }
@ -364,7 +362,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
// Check write permission from module (we need to know write permission to create but also to delete drafts record or to upload files) // Check write permission from module (we need to know write permission to create but also to delete drafts record or to upload files)
$createok = 1; $createok = 1;
$nbko = 0; $nbko = 0;
$wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update') || GETPOST('roworder', 'alpha', 2); $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || in_array(GETPOST('action', 'aZ09'), array('create', 'update', 'add_element_resource', 'confirm_delete_linked_resource')) || GETPOST('roworder', 'alpha', 2));
$wemustcheckpermissionfordeletedraft = ((GETPOST("action", "aZ09") == 'confirm_delete' && GETPOST("confirm", "aZ09") == 'yes') || GETPOST("action", "aZ09") == 'delete'); $wemustcheckpermissionfordeletedraft = ((GETPOST("action", "aZ09") == 'confirm_delete' && GETPOST("confirm", "aZ09") == 'yes') || GETPOST("action", "aZ09") == 'delete');
if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) { if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) {
@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1256,7 +1256,9 @@ class pdf_einstein extends ModelePDFCommandes
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
$ltrdirection = 'L'; $ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R'; if ($outputlangs->trans("DIRECTION") == 'rtl') {
$ltrdirection = 'R';
}
// Load traductions files required by page // Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies")); $outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));

Some files were not shown because too many files have changed in this diff Show More