mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge remote-tracking branch 'upstream/develop' into 15a29
This commit is contained in:
commit
dd7ee9e5f4
16
README-FR.md
16
README-FR.md
|
|
@ -8,12 +8,10 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
|
|||
|
||||

|
||||
|
||||
|
||||
## LICENCE
|
||||
|
||||
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
|
||||
|
||||
|
||||
## INSTALLER DOLIBARR
|
||||
|
||||
### 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
|
||||
|
||||
|
||||
## METTRE A JOUR DOLIBARR
|
||||
|
||||
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).
|
||||
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
|
||||
|
||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||
|
||||
|
||||
## CE QUE DOLIBARR PEUT FAIRE
|
||||
|
||||
### 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é.
|
||||
- Plusieurs thèmes visuels.
|
||||
- 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.
|
||||
- APIs.
|
||||
- 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).
|
||||
|
||||
|
||||
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
||||
|
||||
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 ne fait pas le café (pas encore).
|
||||
|
||||
|
||||
## 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).
|
||||
|
||||
|
||||
## CONTRIBUER
|
||||
|
||||
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
|
||||
|
||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
[](https://github.com/Dolibarr/dolibarr/graphs/contributors)
|
||||
|
||||
## CREDITS
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
|
||||
## ACTUALITES ET RESEAUX SOCIAUX
|
||||
|
||||
Suivez le projet Dolibarr project sur les réseaux francophones
|
||||
|
|
|
|||
123
README.md
123
README.md
|
|
@ -43,7 +43,7 @@ You can use a web server and a supported database (MariaDB, MySQL or PostgreSQL)
|
|||
|
||||
On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
||||
|
||||
#### Generic install steps:
|
||||
#### Generic install steps
|
||||
|
||||
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
|
||||
|
||||
|
|
@ -71,86 +71,87 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||
|
||||
- Follow the installer instructions
|
||||
|
||||
|
||||
### 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
|
||||
|
||||
Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
|
||||
|
||||
|
||||
- At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr)
|
||||
- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).
|
||||
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
|
||||
- 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*").
|
||||
|
||||
|
||||
## WHAT'S NEW
|
||||
|
||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||
|
||||
|
||||
## FEATURES
|
||||
|
||||
### Main application/modules (all optional)
|
||||
|
||||
- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
|
||||
- Members/Membership/Foundation management
|
||||
- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
|
||||
- Members/Membership/Foundation management
|
||||
|
||||
Product Management
|
||||
- Products and/or Services catalog
|
||||
- Stock / Warehouse management + Inventory
|
||||
- Barcodes
|
||||
- Batches / Lots / Serials
|
||||
- Product Variants
|
||||
Product Management
|
||||
|
||||
- Products and/or Services catalog
|
||||
- Stock / Warehouse management + Inventory
|
||||
- Barcodes
|
||||
- Batches / Lots / Serials
|
||||
- Product Variants
|
||||
- Bill of Materials (BOM)
|
||||
- Manufacturing Orders
|
||||
- Manufacturing Orders
|
||||
|
||||
Customer/Sales Management
|
||||
- Customers/Prospects + Contacts management
|
||||
- Opportunities or Leads management
|
||||
- Commercial proposals management
|
||||
- Customer Orders management
|
||||
- Contracts/Subscription management
|
||||
- Interventions management
|
||||
- Ticket System
|
||||
- Shipping management
|
||||
- Customer Invoices/Credit notes and payment management
|
||||
- Point of Sale (POS)
|
||||
Customer/Sales Management
|
||||
|
||||
Supplier/Purchase Management
|
||||
- Suppliers/Vendors + Contacts
|
||||
- Supplier (price) requests
|
||||
- Purchase Orders management
|
||||
- Delivery/Receiption
|
||||
- Supplier Invoices/credit notes and payment management
|
||||
- INCOTERMS
|
||||
- Customers/Prospects + Contacts management
|
||||
- Opportunities or Leads management
|
||||
- Commercial proposals management
|
||||
- Customer Orders management
|
||||
- Contracts/Subscription management
|
||||
- Interventions management
|
||||
- Ticket System
|
||||
- Shipping management
|
||||
- Customer Invoices/Credit notes and payment management
|
||||
- Point of Sale (POS)
|
||||
|
||||
Finance / Accounting
|
||||
- Invoices / Payments
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Donations management
|
||||
- Loan management
|
||||
- Margins
|
||||
- Reports
|
||||
Supplier/Purchase Management
|
||||
|
||||
Collaboration
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Suppliers/Vendors + Contacts
|
||||
- Supplier (price) requests
|
||||
- Purchase Orders management
|
||||
- Delivery/Receiption
|
||||
- Supplier Invoices/credit notes and payment management
|
||||
- INCOTERMS
|
||||
|
||||
Finance / Accounting
|
||||
|
||||
- Invoices / Payments
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Donations management
|
||||
- Loan management
|
||||
- Margins
|
||||
- Reports
|
||||
|
||||
Collaboration
|
||||
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Surveys
|
||||
|
||||
HR
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Recruitment management
|
||||
- Timesheets
|
||||
HR
|
||||
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Recruitment management
|
||||
- Timesheets
|
||||
|
||||
### Other application/modules
|
||||
|
||||
|
|
@ -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)
|
||||
|
||||
|
||||
### Other general features
|
||||
|
||||
- Localization in most major languages
|
||||
|
|
@ -190,27 +190,24 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||
- Canadian double taxes (federal/province) and other countries using cumulative VAT
|
||||
- Tunisian tax stamp
|
||||
- Argentina invoice numbering using A,B,C...
|
||||
- Compatible with [European directives] (https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||
- Compatible with [European directives](https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
|
||||
- Compatible with European GDPR rules
|
||||
- ...
|
||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||
- ...
|
||||
|
||||
|
||||
### System Environment / Requirements
|
||||
|
||||
- PHP
|
||||
- MariaDB, MySQL or PostgreSQL
|
||||
- MariaDB, MySQL or PostgreSQL
|
||||
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
|
||||
|
||||
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
|
||||
|
||||
|
||||
### 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).
|
||||
|
||||
|
||||
## WHAT DOLIBARR CAN'T DO YET
|
||||
|
||||
These are features that Dolibarr does **not** yet fully support:
|
||||
|
|
@ -220,21 +217,18 @@ 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.
|
||||
- Dolibarr can't do coffee (yet)
|
||||
|
||||
|
||||
## DOCUMENTATION
|
||||
|
||||
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
||||
|
||||
|
||||
## CONTRIBUTING
|
||||
|
||||
This project exists thanks to all the people who contribute.
|
||||
This project exists thanks to all the people who contribute.
|
||||
Please read the instructions how to contribute (report a bug/error, a feature request, send code ...) [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
|
||||
|
||||
A view on Contributors:
|
||||
|
||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
[](https://github.com/Dolibarr/dolibarr/graphs/contributors)
|
||||
|
||||
## CREDITS
|
||||
|
||||
|
|
@ -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.
|
||||
|
||||
|
||||
## NEWS AND SOCIAL NETWORKS
|
||||
|
||||
Follow Dolibarr project on:
|
||||
|
|
@ -253,8 +246,6 @@ Follow Dolibarr project on:
|
|||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||
|
||||
|
||||
### Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ if ($action == 'update') {
|
|||
$nb_exists = $db->num_rows($resql_exists);
|
||||
if ($nb_exists <= 0) {
|
||||
// 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) . "')";
|
||||
} else {
|
||||
$obj_exists = $db->fetch_object($resql_exists);
|
||||
|
|
|
|||
|
|
@ -1788,13 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
|
||||
print '<table class="border tableforfield tableforfield centpercent">';
|
||||
|
||||
// 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>';
|
||||
|
||||
// Categories
|
||||
// Tags / Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="2">';
|
||||
|
|
@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
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
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,6 @@ if ($result > 0) {
|
|||
}
|
||||
|
||||
$ldap->unbind();
|
||||
$ldap->close();
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ if ($result > 0) {
|
|||
}
|
||||
|
||||
$ldap->unbind();
|
||||
$ldap->close();
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>';
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'test') {
|
||||
if ($action == 'test') {
|
||||
$ldap = new Ldap(); // Les parametres sont passes et recuperes via $conf
|
||||
|
||||
$result = $ldap->connect_bind();
|
||||
if ($result > 0) {
|
||||
// Test ldap connect and bind
|
||||
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>';
|
||||
|
||||
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) {
|
||||
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>';
|
||||
} else {
|
||||
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 $langs->trans("Error").' '.$ldap->error;
|
||||
print '<br>';
|
||||
|
|
@ -330,10 +330,10 @@ if (function_exists("ldap_connect")) {
|
|||
print '<br>';
|
||||
}
|
||||
|
||||
$unbind = $ldap->unbind();
|
||||
$ldap->unbind();
|
||||
} else {
|
||||
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 $langs->trans("Error").' '.$ldap->error;
|
||||
print '<br>';
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ print "</tr>\n";
|
|||
// DN Pour les utilisateurs
|
||||
print '<!-- LDAP_USER_DN -->';
|
||||
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>';
|
||||
print '</tr>';
|
||||
|
|
@ -200,7 +200,7 @@ print '</tr>';
|
|||
// List of object class used to define attributes in structure
|
||||
print '<!-- LDAP_USER_OBJECT_CLASS -->';
|
||||
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>';
|
||||
print '</tr>';
|
||||
|
|
@ -208,7 +208,7 @@ print '</tr>';
|
|||
// Filter, used to filter search
|
||||
print '<!-- LDAP_FILTER_CONNECTION -->';
|
||||
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>';
|
||||
print '</tr>';
|
||||
|
|
@ -225,168 +225,168 @@ print "</tr>\n";
|
|||
|
||||
// Common name
|
||||
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 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>';
|
||||
|
||||
// Name
|
||||
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 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>';
|
||||
|
||||
// Firstname
|
||||
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 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>';
|
||||
|
||||
// Login unix
|
||||
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 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>';
|
||||
|
||||
// Login samba
|
||||
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 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>';
|
||||
|
||||
// Password not crypted
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Password crypted
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Mail
|
||||
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 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>';
|
||||
|
||||
// Phone
|
||||
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 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>';
|
||||
|
||||
// Mobile
|
||||
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 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>';
|
||||
|
||||
// Skype
|
||||
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 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>';
|
||||
|
||||
// Fax
|
||||
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 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>';
|
||||
|
||||
// Company
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Address
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// ZIP
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// TOWN
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// COUNTRY
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_FIELD_COUNTRY.'">';
|
||||
print '<input size="25" type="text" name="fieldcountry" value="'.getDolGlobalString('LDAP_FIELD_COUNTRY').'">';
|
||||
print '</td><td> </td>';
|
||||
print '<td class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Title
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Note
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Sid
|
||||
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 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>';
|
||||
|
||||
// Group id
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Userid
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Home Directory
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Home Directory Prefix
|
||||
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 class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
|
@ -405,20 +405,20 @@ print '</form>';
|
|||
/*
|
||||
* Test de la connexion
|
||||
*/
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
|
||||
if (getDolGlobalString('LDAP_SYNCHRO_ACTIVE') == 'dolibarr2ldap') {
|
||||
$butlabel = $langs->trans("LDAPTestSynchroUser");
|
||||
$testlabel = 'testuser';
|
||||
$key = $conf->global->LDAP_KEY_USERS;
|
||||
$dn = $conf->global->LDAP_USER_DN;
|
||||
$objectclass = $conf->global->LDAP_USER_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_USERS');
|
||||
$dn = getDolGlobalString('LDAP_USER_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_USER_OBJECT_CLASS');
|
||||
|
||||
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");
|
||||
$testlabel = 'testsearchuser';
|
||||
$key = $conf->global->LDAP_KEY_USERS;
|
||||
$dn = $conf->global->LDAP_USER_DN;
|
||||
$objectclass = $conf->global->LDAP_USER_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_USERS');
|
||||
$dn = getDolGlobalString('LDAP_USER_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_USER_OBJECT_CLASS');
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
}
|
||||
|
||||
|
|
@ -479,29 +479,29 @@ if (function_exists("ldap_connect")) {
|
|||
|
||||
if ($result > 0) {
|
||||
$required_fields = array(
|
||||
$conf->global->LDAP_KEY_USERS,
|
||||
$conf->global->LDAP_FIELD_FULLNAME,
|
||||
$conf->global->LDAP_FIELD_NAME,
|
||||
$conf->global->LDAP_FIELD_FIRSTNAME,
|
||||
$conf->global->LDAP_FIELD_LOGIN,
|
||||
$conf->global->LDAP_FIELD_LOGIN_SAMBA,
|
||||
$conf->global->LDAP_FIELD_PASSWORD,
|
||||
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
|
||||
$conf->global->LDAP_FIELD_PHONE,
|
||||
$conf->global->LDAP_FIELD_FAX,
|
||||
$conf->global->LDAP_FIELD_SKYPE,
|
||||
$conf->global->LDAP_FIELD_MOBILE,
|
||||
$conf->global->LDAP_FIELD_MAIL,
|
||||
$conf->global->LDAP_FIELD_TITLE,
|
||||
$conf->global->LDAP_FIELD_DESCRIPTION,
|
||||
$conf->global->LDAP_FIELD_SID
|
||||
getDolGlobalString('LDAP_KEY_USERS'),
|
||||
getDolGlobalString('LDAP_FIELD_FULLNAME'),
|
||||
getDolGlobalString('LDAP_FIELD_NAME'),
|
||||
getDolGlobalString('LDAP_FIELD_FIRSTNAME'),
|
||||
getDolGlobalString('LDAP_FIELD_LOGIN'),
|
||||
getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'),
|
||||
getDolGlobalString('LDAP_FIELD_PASSWORD'),
|
||||
getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED'),
|
||||
getDolGlobalString('LDAP_FIELD_PHONE'),
|
||||
getDolGlobalString('LDAP_FIELD_FAX'),
|
||||
getDolGlobalString('LDAP_FIELD_SKYPE'),
|
||||
getDolGlobalString('LDAP_FIELD_MOBILE'),
|
||||
getDolGlobalString('LDAP_FIELD_MAIL'),
|
||||
getDolGlobalString('LDAP_FIELD_TITLE'),
|
||||
getDolGlobalString('LDAP_FIELD_DESCRIPTION'),
|
||||
getDolGlobalString('LDAP_FIELD_SID')
|
||||
);
|
||||
|
||||
// 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")));
|
||||
|
||||
// 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);
|
||||
|
||||
if (is_array($ldapusers)) {
|
||||
|
|
@ -523,8 +523,8 @@ if (function_exists("ldap_connect")) {
|
|||
print "<br>\n";
|
||||
print "LDAP search for user:<br>\n";
|
||||
print "search: *<br>\n";
|
||||
print "userDN: ".$conf->global->LDAP_USER_DN."<br>\n";
|
||||
print "useridentifier: ".$conf->global->LDAP_KEY_USERS."<br>\n";
|
||||
print "userDN: ".getDolGlobalString('LDAP_USER_DN')."<br>\n";
|
||||
print "useridentifier: ".getDolGlobalString('LDAP_KEY_USERS')."<br>\n";
|
||||
print "required_fields: ".implode(',', $required_fields)."<br>\n";
|
||||
print "=> ".count($liste)." records<br>\n";
|
||||
print "\n<br>";
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ if (empty($mysoc->country_code)) {
|
|||
|
||||
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
|
||||
$sql .= " 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";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
|
|
|||
|
|
@ -848,8 +848,19 @@ if ($action == 'edit') {
|
|||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$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) {
|
||||
print info_admin($text);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -683,6 +683,8 @@ if ($conf->use_javascript_ajax) {
|
|||
$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 "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
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"));
|
||||
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 '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
|
||||
print '<td class="right">';
|
||||
|
|
@ -702,10 +707,23 @@ if ($conf->use_javascript_ajax) {
|
|||
$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 "</td>";
|
||||
print '</td>';
|
||||
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 '<td>';
|
||||
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));
|
||||
|
|
|
|||
|
|
@ -169,7 +169,11 @@ if ($action == 'create') {
|
|||
// Target
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
$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>';
|
||||
|
||||
// Owner
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ $id = GETPOST("id", 'int');
|
|||
|
||||
$object = new Bookmark($db);
|
||||
|
||||
$permissiontoread = $user->rights->bookmark->lire;
|
||||
$permissiontoadd = $user->rights->bookmark->write;
|
||||
$permissiontodelete = $user->rights->bookmark->delete;
|
||||
$permissiontoread = !empty($user->rights->bookmark->lire);
|
||||
$permissiontoadd = !empty($user->rights->bookmark->creer);
|
||||
$permissiontodelete = !empty($user->rights->bookmark->supprimer);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1976,6 +1976,12 @@ class Categorie extends CommonObject
|
|||
if ($type == 'bank_account') {
|
||||
$type = 'account';
|
||||
}
|
||||
if ($type == 'customer') {
|
||||
$type = 'societe';
|
||||
}
|
||||
if ($type == 'supplier') {
|
||||
$type = 'fournisseur';
|
||||
}
|
||||
|
||||
if (empty($searchList) && !is_array($searchList)) {
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -795,7 +795,7 @@ if ($type == Categorie::TYPE_CONTACT) {
|
|||
$permission = $user->rights->societe->creer;
|
||||
|
||||
$contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($contacts < 0) {
|
||||
if (is_numeric($contacts) && $contacts < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
// Form to add record into a category
|
||||
|
|
|
|||
|
|
@ -1474,7 +1474,7 @@ if ($id > 0) {
|
|||
print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
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)) {
|
||||
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
|
||||
|
|
@ -2210,7 +2210,7 @@ if ($id > 0) {
|
|||
$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">';
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* 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>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -629,14 +629,17 @@ print $nav;
|
|||
$s = $newtitle;
|
||||
|
||||
// Calendars from hooks
|
||||
$parameters = array(); $object = null;
|
||||
$parameters = array();
|
||||
$object = null;
|
||||
$reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$s .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$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 .= '<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">';
|
||||
|
|
@ -644,25 +647,25 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewm
|
|||
//$viewmode .= '</span>';
|
||||
$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 .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$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 .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$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 .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$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 .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
|
|
@ -671,7 +674,8 @@ $viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsm
|
|||
$viewmode .= '<span class="marginrightonly"></span>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array(); $object = null;
|
||||
$parameters = array();
|
||||
$object = null;
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$viewmode .= $hookmanager->resPrint;
|
||||
|
|
@ -681,7 +685,7 @@ if (empty($reshook)) {
|
|||
|
||||
$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;
|
||||
$hourminsec = '100000';
|
||||
|
|
|
|||
|
|
@ -377,7 +377,6 @@ if ($conf->use_javascript_ajax) {
|
|||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||
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 .= '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 .= '</script>'."\n";
|
||||
|
|
|
|||
|
|
@ -387,7 +387,6 @@ if ($conf->use_javascript_ajax) {
|
|||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
||||
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 .= '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 .= '</script>'."\n";
|
||||
|
|
|
|||
|
|
@ -1383,10 +1383,24 @@ if ($resql) {
|
|||
if (!empty($arrayfields['sale_representative']['checked'])) {
|
||||
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
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// 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
|
||||
print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['p.datec']['checked'])) {
|
||||
|
|
@ -1412,12 +1426,6 @@ if ($resql) {
|
|||
|
||||
$now = dol_now();
|
||||
$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;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* 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>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -64,11 +64,12 @@ $action = GETPOST('action', 'aZ09');
|
|||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id);
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||
if ($fielvalue) {
|
||||
if ($fieldvalue) {
|
||||
if ($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_num_releve = GETPOST("search_num_releve", 'alpha');
|
||||
$search_conciliated = GETPOST("search_conciliated", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$num_releve = GETPOST("num_releve", "alpha");
|
||||
if (empty($dateop)) {
|
||||
$dateop = -1;
|
||||
|
|
@ -211,6 +214,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
$search_thirdparty_user = '';
|
||||
$search_num_releve = '';
|
||||
$search_conciliated = '';
|
||||
$toselect = '';
|
||||
|
||||
$search_account = "";
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
|
|
@ -221,14 +225,14 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
if (empty($reshook)) {
|
||||
$objectclass = 'Account';
|
||||
$objectlabel = 'BankTransaction';
|
||||
$permissiontoread = $user->rights->banque->lire;
|
||||
$permissiontodelete = $user->rights->banque->supprimer;
|
||||
$permissiontoread = !empty($user->rights->banque->lire);
|
||||
$permissiontodelete = !empty($user->rights->banque->modifier);
|
||||
$uploaddir = $conf->bank->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
// 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')))) {
|
||||
$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;
|
||||
|
||||
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);
|
||||
$result = $accline->fetch(GETPOST("rowid", "int"));
|
||||
$result = $accline->delete($user);
|
||||
|
|
@ -484,6 +488,11 @@ if ($optioncss != '') {
|
|||
if ($action == 'reconcile') {
|
||||
$param .= '&action=reconcile';
|
||||
}
|
||||
$totalarray = array(
|
||||
'nbfield' => 0,
|
||||
'totalcred' => 0,
|
||||
'totaldeb' => 0,
|
||||
);
|
||||
// Add $param from extra fields
|
||||
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 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 .= " WHERE b.fk_account = ba.rowid";
|
||||
|
|
@ -732,7 +741,7 @@ $resql = $db->query($sql);
|
|||
if ($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
|
||||
$arrayofmassactions = array(
|
||||
|
|
@ -759,7 +768,9 @@ if ($resql) {
|
|||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
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="view" value="'.dol_escape_htmltag($view).'">';
|
||||
if (!empty($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="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
|
@ -833,7 +844,7 @@ if ($resql) {
|
|||
}
|
||||
|
||||
// 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 '<table class="noborder centpercent">';
|
||||
|
|
@ -939,6 +950,7 @@ if ($resql) {
|
|||
}
|
||||
}
|
||||
|
||||
$morehtml = '';
|
||||
/*$morehtml = '<div class="inline-block '.(($buttonreconcile || $newcardbutton) ? 'marginrightonly' : '').'">';
|
||||
$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).'">';
|
||||
|
|
@ -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>';
|
||||
}
|
||||
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'])) {
|
||||
print '<td class="liste_titre">';
|
||||
|
|
@ -1160,7 +1172,6 @@ if ($resql) {
|
|||
// Loop on each record
|
||||
$sign = 1;
|
||||
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit)) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$links = $bankaccountstatic->get_url($objp->rowid);
|
||||
|
|
@ -1296,18 +1307,10 @@ if ($resql) {
|
|||
$backgroundcolor = "class='oddeven'";
|
||||
} else {
|
||||
if ($objp->amount < 0) {
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR1)) {
|
||||
$color = '#fca955';
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1;
|
||||
}
|
||||
$color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR1', 'fca955');
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
} else {
|
||||
if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) {
|
||||
$color = '#7fdb86';
|
||||
} else {
|
||||
$color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2;
|
||||
}
|
||||
$color = '#' . getDolGlobalString('BANK_COLORIZE_MOVEMENT_COLOR2', '7fdb86');
|
||||
$backgroundcolor = 'style="background: '.$color.';"';
|
||||
}
|
||||
}
|
||||
|
|
@ -1333,7 +1336,7 @@ if ($resql) {
|
|||
$titletoshow = '';
|
||||
$reg = array();
|
||||
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]);
|
||||
} else {
|
||||
if ($objp->label == '(payment_salary)') {
|
||||
|
|
@ -1357,6 +1360,7 @@ if ($resql) {
|
|||
} elseif ($links[$key]['type'] == 'payment') {
|
||||
$paymentstatic->id = $links[$key]['url_id'];
|
||||
$paymentstatic->ref = $links[$key]['url_id']; // FIXME This is id, not ref of payment
|
||||
$paymentstatic->date = $db->jdate($objp->do);
|
||||
print ' '.$paymentstatic->getNomUrl(2);
|
||||
} elseif ($links[$key]['type'] == 'payment_supplier') {
|
||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||
// Security check
|
||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||
$socid = 0;
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
|
@ -568,6 +569,12 @@ if ($result) {
|
|||
// Bank line
|
||||
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);
|
||||
$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 "</td></tr>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2846,15 +2846,6 @@ if (empty($reshook)) {
|
|||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
|
@ -3828,8 +3819,16 @@ if ($action == 'create') {
|
|||
print '</table>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
print "</form>\n";
|
||||
} 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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -102,10 +102,8 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
|
|||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,10 +94,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
|||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,10 +64,8 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
|
|||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -676,12 +676,6 @@ if (strlen(trim($search_country))) {
|
|||
if ($search_type_thirdparty != '' && $search_type_thirdparty != '-1') {
|
||||
$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 != '') {
|
||||
$sql .= natural_search('f.total_ht', $search_montant_ht, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,10 +79,8 @@ if (empty($reshook)) {
|
|||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$head = facture_prepare_head($object);
|
||||
$langs->load('errors');
|
||||
echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'),
|
||||
'<div class="error">' . $langs->trans("ErrorRecordNotFound") . '</div>';
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2011-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -388,7 +388,7 @@ if ($action == 'new') {
|
|||
$i = 0;
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$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]["emetteur"] = $obj->emetteur;
|
||||
$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]["paymentid"] = $obj->paymentid;
|
||||
$lines[$obj->bid][$i]["paymentref"] = $obj->paymentref;
|
||||
$lines[$obj->bid][$i]["paymentdate"] = $db->jdate($obj->date);
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
|
@ -468,6 +469,7 @@ if ($action == 'new') {
|
|||
print '<td class="center">';
|
||||
$paymentstatic->id = $value["paymentid"];
|
||||
$paymentstatic->ref = $value["paymentref"];
|
||||
$paymentstatic->date = $value["paymentdate"];
|
||||
if ($paymentstatic->id) {
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -182,7 +182,6 @@ if ($result > 0) {
|
|||
}
|
||||
|
||||
$ldap->unbind();
|
||||
$ldap->close();
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1031,6 +1031,7 @@ print "</tr>\n";
|
|||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||
$perm = 1;
|
||||
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
|
||||
$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;
|
||||
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
|
||||
$perm = 1;
|
||||
|
|
|
|||
|
|
@ -514,7 +514,17 @@ class FormProjets
|
|||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class FormPropal
|
|||
print '<option value="-1"> </option>';
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($listofstatus as $key => $obj) {
|
||||
if ($excludedraft) {
|
||||
if ($obj['code'] == 'Draft' || $obj['code'] == 'PR_DRAFT') {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
|
|
@ -508,11 +509,13 @@ class FormTicket
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
if (!empty($conf->projet->enabled) && !$this->ispublic) {
|
||||
$formproject = new FormProjets($this->db);
|
||||
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 '</td></tr>';
|
||||
if ($subelement != 'project') {
|
||||
if (!empty($conf->projet->enabled) && !$this->ispublic) {
|
||||
$formproject = new FormProjets($this->db);
|
||||
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 '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -48,6 +48,11 @@ class Ldap
|
|||
*/
|
||||
public $server = array();
|
||||
|
||||
/**
|
||||
* Current connected server
|
||||
*/
|
||||
public $connectedServer;
|
||||
|
||||
/**
|
||||
* Base DN (e.g. "dc=foo,dc=com")
|
||||
*/
|
||||
|
|
@ -132,35 +137,33 @@ class Ldap
|
|||
if (!empty($conf->global->LDAP_SERVER_HOST_SLAVE)) {
|
||||
$this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE;
|
||||
}
|
||||
$this->serverPort = $conf->global->LDAP_SERVER_PORT;
|
||||
$this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION;
|
||||
$this->dn = $conf->global->LDAP_SERVER_DN;
|
||||
$this->serverType = $conf->global->LDAP_SERVER_TYPE;
|
||||
$this->serverPort = getDolGlobalInt('LDAP_SERVER_PORT', 389);
|
||||
$this->ldapProtocolVersion = getDolGlobalString('LDAP_SERVER_PROTOCOLVERSION');
|
||||
$this->dn = getDolGlobalString('LDAP_SERVER_DN');
|
||||
$this->serverType = getDolGlobalString('LDAP_SERVER_TYPE');
|
||||
|
||||
$this->domain = $conf->global->LDAP_SERVER_DN;
|
||||
$this->searchUser = $conf->global->LDAP_ADMIN_DN;
|
||||
$this->searchPassword = $conf->global->LDAP_ADMIN_PASS;
|
||||
$this->people = $conf->global->LDAP_USER_DN;
|
||||
$this->groups = $conf->global->LDAP_GROUP_DN;
|
||||
$this->domain = getDolGlobalString('LDAP_SERVER_DN');
|
||||
$this->searchUser = getDolGlobalString('LDAP_ADMIN_DN');
|
||||
$this->searchPassword = getDolGlobalString('LDAP_ADMIN_PASS');
|
||||
$this->people = getDolGlobalString('LDAP_USER_DN');
|
||||
$this->groups = getDolGlobalString('LDAP_GROUP_DN');
|
||||
|
||||
$this->filter = $conf->global->LDAP_FILTER_CONNECTION; // Filter on user
|
||||
$this->filtergroup = $conf->global->LDAP_GROUP_FILTER; // Filter on groups
|
||||
$this->filtermember = $conf->global->LDAP_MEMBER_FILTER; // Filter on member
|
||||
$this->filter = getDolGlobalString('LDAP_FILTER_CONNECTION'); // Filter on user
|
||||
$this->filtergroup = getDolGlobalString('LDAP_GROUP_FILTER'); // Filter on groups
|
||||
$this->filtermember = getDolGlobalString('LDAP_MEMBER_FILTER'); // Filter on member
|
||||
|
||||
// Users
|
||||
$this->attr_login = $conf->global->LDAP_FIELD_LOGIN; //unix
|
||||
$this->attr_sambalogin = $conf->global->LDAP_FIELD_LOGIN_SAMBA; //samba, activedirectory
|
||||
$this->attr_name = $conf->global->LDAP_FIELD_NAME;
|
||||
$this->attr_firstname = $conf->global->LDAP_FIELD_FIRSTNAME;
|
||||
$this->attr_mail = $conf->global->LDAP_FIELD_MAIL;
|
||||
$this->attr_phone = $conf->global->LDAP_FIELD_PHONE;
|
||||
$this->attr_skype = $conf->global->LDAP_FIELD_SKYPE;
|
||||
$this->attr_fax = $conf->global->LDAP_FIELD_FAX;
|
||||
$this->attr_mobile = $conf->global->LDAP_FIELD_MOBILE;
|
||||
$this->attr_login = getDolGlobalString('LDAP_FIELD_LOGIN'); //unix
|
||||
$this->attr_sambalogin = getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'); //samba, activedirectory
|
||||
$this->attr_name = getDolGlobalString('LDAP_FIELD_NAME');
|
||||
$this->attr_firstname = getDolGlobalString('LDAP_FIELD_FIRSTNAME');
|
||||
$this->attr_mail = getDolGlobalString('LDAP_FIELD_MAIL');
|
||||
$this->attr_phone = getDolGlobalString('LDAP_FIELD_PHONE');
|
||||
$this->attr_skype = getDolGlobalString('LDAP_FIELD_SKYPE');
|
||||
$this->attr_fax = getDolGlobalString('LDAP_FIELD_FAX');
|
||||
$this->attr_mobile = getDolGlobalString('LDAP_FIELD_MOBILE');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Connection handling methods -------------------------------------------
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
|
@ -288,16 +291,18 @@ class Ldap
|
|||
$return = -1;
|
||||
dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING);
|
||||
}
|
||||
$this->connectedServer = $host;
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Simply closes the connection set up earlier.
|
||||
* Returns true if OK, false if there was an error.
|
||||
* Simply closes the connection set up earlier. Returns true if OK, false if there was an error.
|
||||
* This method seems a duplicate/alias of unbind().
|
||||
*
|
||||
* @return boolean true or false
|
||||
* @deprecated ldap_close is an alias of ldap_unbind
|
||||
* @see unbind()
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
|
@ -349,16 +354,21 @@ class Ldap
|
|||
}
|
||||
|
||||
/**
|
||||
* Unbind du serveur ldap.
|
||||
* Unbind of LDAP server (close connection).
|
||||
*
|
||||
* @return boolean true or false
|
||||
* @see close()
|
||||
*/
|
||||
public function unbind()
|
||||
{
|
||||
if (!$this->result = @ldap_unbind($this->connection)) {
|
||||
return false;
|
||||
} else {
|
||||
$this->result = true;
|
||||
if ($this->connection) {
|
||||
$this->result = @ldap_unbind($this->connection);
|
||||
}
|
||||
if ($this->result) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -411,7 +421,7 @@ class Ldap
|
|||
*/
|
||||
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
|
||||
if (!$this->connection) {
|
||||
|
|
|
|||
|
|
@ -318,14 +318,14 @@ abstract class DoliDB implements Database
|
|||
/**
|
||||
* 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
|
||||
* Dont add LIMIT to your query, it will be added by this method
|
||||
* @param string $sql the sql query string
|
||||
* @return bool| object
|
||||
* @deprecated
|
||||
* Dont add LIMIT to your query, it will be added by this method.
|
||||
*
|
||||
* @param string $sql The sql query string
|
||||
* @return bool|object Result of fetch_object
|
||||
*/
|
||||
public function getRow($sql)
|
||||
{
|
||||
$sql .= ' LIMIT 1;';
|
||||
$sql .= ' LIMIT 1';
|
||||
|
||||
$res = $this->query($sql);
|
||||
if ($res) {
|
||||
|
|
@ -338,9 +338,10 @@ abstract class DoliDB implements Database
|
|||
/**
|
||||
* 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
|
||||
* 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
|
||||
* 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 Result
|
||||
* @deprecated
|
||||
*/
|
||||
public function getRows($sql)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ if ($resql) { // This can fail when class is used on old database (during mig
|
|||
case 'sellist':
|
||||
$tmp = '';
|
||||
$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']);
|
||||
$tmp = array_shift($tmpkeys);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@ function getEntity($element, $shared = 1, $currentobject = null)
|
|||
{
|
||||
global $conf, $mc, $hookmanager, $object, $action;
|
||||
|
||||
if (! is_object($hookmanager)) {
|
||||
$hookmanager = new HookManager($db);
|
||||
}
|
||||
|
||||
// fix different element names (France to English)
|
||||
switch ($element) {
|
||||
case 'contrat':
|
||||
|
|
@ -2289,6 +2293,11 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||
{
|
||||
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') {
|
||||
$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_dt = new DateTime();
|
||||
$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();
|
||||
} 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
|
||||
|
|
@ -2380,11 +2389,6 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||
$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
|
||||
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.
|
||||
|
|
@ -2401,7 +2405,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||
// Analyze date
|
||||
$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
|
||||
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 '';
|
||||
} 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.
|
||||
|
|
@ -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',
|
||||
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
|
||||
'sign-out'=>'sign-out-alt',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
|
||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
|
||||
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
|
||||
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star',
|
||||
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'filter'=>'filter',
|
||||
'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',
|
||||
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
|
||||
'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',
|
||||
'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',
|
||||
'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',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'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>');
|
||||
|
||||
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">
|
||||
jQuery(document).ready(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.
|
||||
* 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 array $errors Array of errors
|
||||
* @return void
|
||||
|
|
@ -4824,7 +4828,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
|
|||
* Show a title.
|
||||
*
|
||||
* @param string $title Title to show
|
||||
* @return string Title to show
|
||||
* @return void
|
||||
* @deprecated Use load_fiche_titre instead
|
||||
* @see load_fiche_titre()
|
||||
*/
|
||||
|
|
@ -5189,16 +5193,16 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0)
|
|||
* Function to format a value into an amount for visual output
|
||||
* Function used into PDF and HTML pages
|
||||
*
|
||||
* @param float $amount Amount to format
|
||||
* @param integer $form Type of format, HTML or not (not by default)
|
||||
* @param Translate $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 $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 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
|
||||
* @param float $amount Amount to format
|
||||
* @param integer $form Type of format, HTML or not (not by default)
|
||||
* @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 $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 string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
||||
* @return string String with formated amount
|
||||
*
|
||||
* @see price2num() Revert function of price
|
||||
* @see price2num() Revert function of price
|
||||
*/
|
||||
function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $forcerounding = -1, $currency_code = '')
|
||||
{
|
||||
|
|
@ -5852,7 +5856,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
|
|||
$ret .= ' ('.$obj->default_vat_code.')';
|
||||
}
|
||||
}
|
||||
$db->free($sql);
|
||||
$db->free($resql);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
|
@ -8151,16 +8155,20 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
|
|||
return 'Bad string syntax to evaluate: '.$s;
|
||||
}
|
||||
|
||||
// We block using of php exec or php file functions
|
||||
$forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI(");
|
||||
$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('));
|
||||
// We block use of php exec or php file functions
|
||||
$forbiddenphpstrings = array('$$');
|
||||
$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 {
|
||||
$oldstringtoclean = $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(
|
||||
} while ($oldstringtoclean != $s);
|
||||
|
||||
|
|
@ -8818,7 +8826,7 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
|
|||
* 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.
|
||||
* @return string HTML code to set focus
|
||||
* @return void
|
||||
*/
|
||||
function dol_set_focus($selector)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
|
|||
dol_syslog("getURLContent request=".$request);
|
||||
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 =".$response);
|
||||
}
|
||||
dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -89,7 +89,6 @@ function ldap_prepare_head()
|
|||
return $head;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show button test LDAP synchro
|
||||
*
|
||||
|
|
@ -119,7 +118,6 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
|
|||
print '<br><br>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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") {
|
||||
continue;
|
||||
}
|
||||
if ("$val" == "objectclass") {
|
||||
if (!is_array($val) && "$val" == "objectclass") {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +179,7 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
|
|||
}
|
||||
print '<br>';
|
||||
}
|
||||
if ("$val" != $lastkey[$level] && !$subcount) {
|
||||
if (!is_array($val) && "$val" != $lastkey[$level] && !$subcount) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$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
|
||||
if ($fromcompany->managers) {
|
||||
$line2 .= ($line2 ? " - " : "").$fromcompany->managers;
|
||||
|
|
@ -1054,11 +1054,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
|
||||
// Line 3 of company infos
|
||||
// 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));
|
||||
}
|
||||
// Capital
|
||||
if ($fromcompany->capital) {
|
||||
if (!empty($fromcompany->capital) && $fromcompany->capital) {
|
||||
$tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string
|
||||
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) {
|
||||
$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
|
||||
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);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1075,7 +1075,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$line3 .= ($line3 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
|
||||
}
|
||||
// Prof Id 2
|
||||
if ($fromcompany->idprof2) {
|
||||
if (!empty($fromcompany->idprof2) && $fromcompany->idprof2) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1085,7 +1085,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
|
||||
// Line 4 of company infos
|
||||
// Prof Id 3
|
||||
if ($fromcompany->idprof3) {
|
||||
if (!empty($fromcompany->idprof3) && $fromcompany->idprof3) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1093,7 +1093,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
|
||||
}
|
||||
// Prof Id 4
|
||||
if ($fromcompany->idprof4) {
|
||||
if (!empty($fromcompany->idprof4) && $fromcompany->idprof4) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1101,7 +1101,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
|
||||
}
|
||||
// Prof Id 5
|
||||
if ($fromcompany->idprof5) {
|
||||
if (!empty($fromcompany->idprof5) && $fromcompany->idprof5) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId5", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1109,7 +1109,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5);
|
||||
}
|
||||
// Prof Id 6
|
||||
if ($fromcompany->idprof6) {
|
||||
if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
|
@ -1117,7 +1117,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
|||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6);
|
||||
}
|
||||
// IntraCommunautary VAT
|
||||
if ($fromcompany->tva_intra != '') {
|
||||
if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra != '') {
|
||||
$line4 .= ($line4 ? " - " : "").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2008-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -91,7 +91,6 @@ function dol_decode($chain, $key = '1')
|
|||
return $chain;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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')
|
||||
|
|
@ -123,7 +122,7 @@ function dol_hash($chain, $type = '0')
|
|||
} elseif ($type == '3' || $type == 'md5') {
|
||||
return md5($chain);
|
||||
} 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') {
|
||||
return hash('sha256', $chain);
|
||||
} elseif ($type == '6' || $type == 'password_hash') {
|
||||
|
|
@ -168,7 +167,6 @@ function dol_verifyHash($chain, $hash, $type = '0')
|
|||
return dol_hash($chain, $type) == $hash;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
|
@ -492,10 +490,14 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
|||
if (!$user->rights->fournisseur->commande->supprimer) {
|
||||
$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) {
|
||||
$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') {
|
||||
if (empty($user->rights->banque->modifier)) {
|
||||
$deleteok = 0;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||
if ($ldapdebug) {
|
||||
print "DEBUG: User ".$usertotest." must change password<br>\n";
|
||||
}
|
||||
$ldap->close();
|
||||
$ldap->unbind();
|
||||
sleep(1);
|
||||
$langs->load('ldap');
|
||||
$_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";
|
||||
}
|
||||
}
|
||||
$ldap->close();
|
||||
$ldap->unbind();
|
||||
}
|
||||
|
||||
// Forge LDAP user and password to test with them
|
||||
|
|
@ -166,14 +166,14 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||
|
||||
$now = dol_now();
|
||||
if ($tmpuser->datestartvalidity && $db->jdate($tmpuser->datestartvalidity) >= $now) {
|
||||
$ldap->close();
|
||||
$ldap->unbind();
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('main', 'errors'));
|
||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
|
||||
return '--bad-login-validity--';
|
||||
}
|
||||
if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <= dol_get_first_hour($now)) {
|
||||
$ldap->close();
|
||||
$ldap->unbind();
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('main', 'errors'));
|
||||
$_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"));
|
||||
}
|
||||
|
||||
$ldap->close();
|
||||
$ldap->unbind();
|
||||
}
|
||||
|
||||
return $login;
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||
|
||||
$sepaname = '______________________________________________';
|
||||
if ($thirdparty->id > 0) {
|
||||
$sepaname = $thirdparty->name.($object->account_owner ? ' ('.$object->account_owner.')' : '');
|
||||
$sepaname = $thirdparty->name.($object->proprio ? ' ('.$object->proprio.')' : '');
|
||||
}
|
||||
$posY = $pdf->GetY();
|
||||
$posY += 3;
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class modAdherent extends DolibarrModules
|
|||
$this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
|
||||
}
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -200,58 +200,58 @@ class modHRM extends DolibarrModules
|
|||
$this->rights[$r][1] = 'Read skill/job/position'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'all';
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read)
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->all->read)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 4011; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify skill/job/position'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'all';
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->all->write)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 4012; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Delete skill/job/position'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'all';
|
||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->all->delete)
|
||||
$r++;
|
||||
|
||||
// Evaluation
|
||||
$this->rights[$r][0] = 4020; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Read evaluation'; // Permission label
|
||||
$this->rights[$r][1] = 'Read evaluations'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'evaluation';
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->read)
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->read)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 4021; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/modify evaluation'; // Permission label
|
||||
$this->rights[$r][1] = 'Create/modify your own evaluation'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'evaluation';
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->write)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 4022; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Validate evaluation'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'evaluation';
|
||||
$this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->write)
|
||||
$this->rights[$r][4] = 'evaluation_advance';
|
||||
$this->rights[$r][5] = 'validate'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->validate)
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 4023; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Delete evaluation'; // Permission label
|
||||
$this->rights[$r][1] = 'Delete all evaluations'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'evaluation';
|
||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->hrm->evaluation->delete)
|
||||
$r++;
|
||||
|
||||
// Comparison
|
||||
$this->rights[$r][0] = 4030; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'See comparison menu'; // Permission label
|
||||
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'compare';
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->poste->delete)
|
||||
$this->rights[$r][4] = 'compare_advance';
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->hrm->compare_advance->read)
|
||||
$r++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ class modProduct extends DolibarrModules
|
|||
|
||||
// Add extra fields
|
||||
$import_extrafield_sample = array();
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ class modProjet extends DolibarrModules
|
|||
$this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation");
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ class modResource extends DolibarrModules
|
|||
$this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation');
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ class modService extends DolibarrModules
|
|||
}
|
||||
// Add extra fields
|
||||
$import_extrafield_sample = array();
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ class modSociete extends DolibarrModules
|
|||
$this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode');
|
||||
}
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
@ -681,7 +681,7 @@ class modSociete extends DolibarrModules
|
|||
's.note_public' => "NotePublic"
|
||||
);
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on an old database (during a migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ class modUser extends DolibarrModules
|
|||
'u.statut'=>'Status'
|
||||
);
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) { // This can fail when class is used on old database (during migration for example)
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
|
|
|||
|
|
@ -320,17 +320,22 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||
|
||||
foreach ($contact_arrray as $array_key => $contact_id) {
|
||||
$res_contact = $contactstatic->fetch($contact_id);
|
||||
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
|
||||
foreach ($tmparray as $key => $val) {
|
||||
try {
|
||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
||||
} catch (OdfException $e) {
|
||||
dol_syslog($e->getMessage(), LOG_INFO);
|
||||
} catch (SegmentException $e) {
|
||||
dol_syslog($e->getMessage(), LOG_INFO);
|
||||
if ((int) $res_contact > 0) {
|
||||
$tmparray = $this->get_substitutionarray_contact($contactstatic, $outputlangs, 'contact');
|
||||
foreach ($tmparray as $key => $val) {
|
||||
try {
|
||||
$listlines->setVars($key, $val, true, 'UTF-8');
|
||||
} catch (OdfException $e) {
|
||||
dol_syslog($e->getMessage(), LOG_INFO);
|
||||
} catch (SegmentException $e) {
|
||||
dol_syslog($e->getMessage(), LOG_INFO);
|
||||
}
|
||||
}
|
||||
$listlines->merge();
|
||||
} else {
|
||||
$this->error = $contactstatic->error;
|
||||
dol_syslog($this->error, LOG_WARNING);
|
||||
}
|
||||
$listlines->merge();
|
||||
}
|
||||
$odfHandler->mergeSegment($listlines);
|
||||
} catch (OdfException $e) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
|||
|
||||
// Parametrage du prefix customers
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.$conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER.'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.getDolGlobalString('COMPANY_ELEPHANT_MASK_CUSTOMER').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"'.$disabled.'></td>';
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
|||
|
||||
// Parametrage du prefix suppliers
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value2" value="'.$conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER.'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value2" value="'.getDolGlobalString('COMPANY_ELEPHANT_MASK_SUPPLIER').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '</tr>';
|
||||
|
||||
$texte .= '</table>';
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ foreach ($object->fields as $key => $val) {
|
|||
$value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
|
||||
}
|
||||
//var_dump($val.' '.$key.' '.$value);
|
||||
if ($val['noteditable']) {
|
||||
if (!empty($val['noteditable'])) {
|
||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
} else {
|
||||
if ($key == 'lang') {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ foreach ($object->fields as $key => $val) {
|
|||
if ($val['type'] == 'text') {
|
||||
print ' wordbreak';
|
||||
}
|
||||
if ($val['cssview']) {
|
||||
if (!empty($val['cssview'])) {
|
||||
print ' '.$val['cssview'];
|
||||
}
|
||||
print '">';
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
|||
print '</td>';
|
||||
|
||||
if (!$i) {
|
||||
if (empty($totalarray)) {
|
||||
$totalarray['nbfield'] = 0;
|
||||
}
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,18 +219,18 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
|||
|
||||
// Convert date into timestamp format
|
||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date'))) {
|
||||
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
|
||||
$datenotinstring = empty($object->array_options['options_'.$tmpkeyextra]) ? '' : $object->array_options['options_'.$tmpkeyextra];
|
||||
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
||||
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||
if (!empty($object->array_options['options_'.$tmpkeyextra]) && !is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||
$datenotinstring = $db->jdate($datenotinstring);
|
||||
}
|
||||
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
||||
$value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(12, 0, 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring;
|
||||
}
|
||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('datetime'))) {
|
||||
$datenotinstring = $object->array_options['options_'.$tmpkeyextra];
|
||||
$datenotinstring = empty($object->array_options['options_'.$tmpkeyextra]) ? '' : $object->array_options['options_'.$tmpkeyextra];
|
||||
// print 'X'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.'x';
|
||||
if (!is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||
if (!empty($object->array_options['options_'.$tmpkeyextra]) && !is_numeric($object->array_options['options_'.$tmpkeyextra])) { // For backward compatibility
|
||||
$datenotinstring = $db->jdate($datenotinstring);
|
||||
}
|
||||
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -88,7 +89,7 @@ if ($absolute_discount > 0) {
|
|||
// Is there credit notes availables ?
|
||||
if ($absolute_creditnote > 0) {
|
||||
// If validated, we show link "add credit note to payment"
|
||||
if ($cannotApplyDiscount || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
|
||||
if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut != $objclassname::STATUS_VALIDATED || $object->type == $objclassname::TYPE_CREDIT_NOTE) {
|
||||
$translationKey = !empty($discount_type) ? 'HasCreditNoteFromSupplier' : 'CompanyHasCreditNote';
|
||||
$text = $langs->trans($translationKey, price($absolute_creditnote), $langs->transnoentities("Currency".$conf->currency)).'.';
|
||||
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ if (in_array($modulepart, array('facture_paiement', 'unpaid'))) {
|
|||
*/
|
||||
|
||||
// If we have a hash public (hashp), we guess the original_file.
|
||||
$ecmfile='';
|
||||
if (!empty($hashp)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||
$ecmfile = new EcmFiles($db);
|
||||
|
|
|
|||
|
|
@ -2093,7 +2093,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
|
||||
// Test we can delete
|
||||
$this->fetchObjectLinked(null, 'order_supplier');
|
||||
if (!empty($this->linkedObjects)) {
|
||||
if (!empty($this->linkedObjects) && array_key_exists('reception', $this->linkedObjects)) {
|
||||
foreach ($this->linkedObjects['reception'] as $element) {
|
||||
if ($element->statut >= 0) {
|
||||
$this->errors[] = $langs->trans('ReceptionExist');
|
||||
|
|
|
|||
|
|
@ -882,7 +882,7 @@ $object = new Holiday($db);
|
|||
|
||||
$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
|
||||
|
||||
$title = $langs->trans('CPTitreMenu');
|
||||
$title = $langs->trans('Leave');
|
||||
$help_url = 'EN:Module_Holiday';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
|
@ -1088,7 +1088,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DescCP").'</td>';
|
||||
print '<td class="tdtop">';
|
||||
$doleditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -1158,7 +1158,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
setEventMessages($errors, null, 'errors');
|
||||
}
|
||||
|
||||
// On vérifie si l'utilisateur à le droit de lire cette demande
|
||||
// check if the user has the right to read this request
|
||||
if ($canread) {
|
||||
$head = holiday_prepare_head($object);
|
||||
|
||||
|
|
@ -1289,7 +1289,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DescCP').'</td>';
|
||||
print '<td class="tdtop">';
|
||||
$doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -1433,11 +1433,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
|
||||
if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) {
|
||||
if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
print '<div class="center">';
|
||||
if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
print '<input type="submit" value="'.$langs->trans("Save").'" class="button button-save">';
|
||||
print $form->buttonsSaveCancel();
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
|
@ -1521,7 +1519,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
$action = 'presend';
|
||||
}
|
||||
|
||||
if ($action != 'presend') {
|
||||
if ($action != 'presend' && $action != 'edit') {
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
|
|
|
|||
|
|
@ -137,8 +137,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
|||
$form = new Form($db);
|
||||
|
||||
$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
|
||||
|
||||
$title = $langs->trans('InterventionCard');
|
||||
$title = $langs->trans("Leave").' - '.$langs->trans("Files");
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
|
|
@ -347,12 +346,12 @@ if ($object->id) {
|
|||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
|
||||
$modulepart = 'holiday';
|
||||
$permissiontoadd = $user->rights->holiday->write;
|
||||
$permtoedit = $user->rights->holiday->write;
|
||||
$param = '&id='.$object->id;
|
||||
$relativepathwithnofile = $modulepart.'/'.dol_sanitizeFileName($object->ref).'/';
|
||||
$savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ $result = restrictedArea($user, 'holiday', $object->id, 'holiday');
|
|||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("Holiday")." - ".$langs->trans("Info");
|
||||
$title = $langs->trans("Leave")." - ".$langs->trans("Info");
|
||||
$helpurl = "";
|
||||
llxHeader("", $title, $helpurl);
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class Position extends CommonObject
|
|||
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,),
|
||||
'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,),
|
||||
'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,),
|
||||
'commentaire_abandon' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,),
|
||||
'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
|
||||
|
|
@ -129,7 +129,7 @@ class Position extends CommonObject
|
|||
public $fk_job;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
public $commentaire_abandon;
|
||||
public $abort_comment;
|
||||
public $note_public;
|
||||
public $note_private;
|
||||
public $fk_user_creat;
|
||||
|
|
|
|||
|
|
@ -256,10 +256,13 @@ $fk_usergroup1 = GETPOST('fk_usergroup1');
|
|||
</div>
|
||||
|
||||
<?php
|
||||
dol_fiche_end();
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Return a html list element with diff between required rank and user rank
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ if ($step == 2 && $datatoimport) {
|
|||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Module
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
|
||||
print '<td>';
|
||||
$titleofmodule = $objimport->array_import_module[0]['module']->getName();
|
||||
// Special cas for import common to module/services
|
||||
|
|
@ -571,10 +571,10 @@ if ($step == 3 && $datatoimport) {
|
|||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<table width="100%" class="border tableforfield">';
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Module
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
|
||||
print '<td>';
|
||||
$titleofmodule = $objimport->array_import_module[0]['module']->getName();
|
||||
// Special cas for import common to module/services
|
||||
|
|
@ -603,7 +603,7 @@ if ($step == 3 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Source file format
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td class="nowraponall">';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
|
|
@ -733,8 +733,8 @@ if ($step == 3 && $datatoimport) {
|
|||
$relativepath = $file;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="16">'.img_mime($file).'</td>';
|
||||
print '<td>';
|
||||
print img_mime($file, '', 'pictofixedwidth');
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3'.$param.'" target="_blank">';
|
||||
print $file;
|
||||
print '</a>';
|
||||
|
|
@ -876,7 +876,7 @@ if ($step == 4 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Module
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
|
||||
print '<td>';
|
||||
$titleofmodule = $objimport->array_import_module[0]['module']->getName();
|
||||
// Special cas for import common to module/services
|
||||
|
|
@ -905,7 +905,7 @@ if ($step == 4 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Source file format
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
|
|
@ -926,8 +926,8 @@ if ($step == 4 && $datatoimport) {
|
|||
print $langs->trans("Separator").' : ';
|
||||
print '<input type="text" size="1" name="separator" value="'.dol_escape_htmltag($separator).'"/>';
|
||||
print ' '.$langs->trans("Enclosure").' : ';
|
||||
print '<input type="text" size="1" name="enclosure" value="'.dol_escape_htmltag($enclosure).'"/>';
|
||||
print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button" />';
|
||||
print '<input type="text" size="1" name="enclosure" value="'.dol_escape_htmltag($enclosure).'"/> ';
|
||||
print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button small" />';
|
||||
print '</form>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -938,6 +938,7 @@ if ($step == 4 && $datatoimport) {
|
|||
$modulepart = 'import';
|
||||
$relativepath = GETPOST('filetoimport');
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
|
||||
print img_mime($file, '', 'pictofixedwidth');
|
||||
print $filetoimport;
|
||||
print '</a>';
|
||||
print '</td></tr>';
|
||||
|
|
@ -1385,7 +1386,7 @@ if ($step == 5 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Module
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
|
||||
print '<td>';
|
||||
$titleofmodule = $objimport->array_import_module[0]['module']->getName();
|
||||
// Special cas for import common to module/services
|
||||
|
|
@ -1414,7 +1415,7 @@ if ($step == 5 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Source file format
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
|
|
@ -1435,6 +1436,7 @@ if ($step == 5 && $datatoimport) {
|
|||
$modulepart = 'import';
|
||||
$relativepath = GETPOST('filetoimport');
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
|
||||
print img_mime($file, '', 'pictofixedwidth');
|
||||
print $filetoimport;
|
||||
print '</a>';
|
||||
print '</td></tr>';
|
||||
|
|
@ -1509,7 +1511,7 @@ if ($step == 5 && $datatoimport) {
|
|||
print '<table width="100%" class="border tableforfield">';
|
||||
|
||||
// Tables imported
|
||||
print '<tr><td class="titlefield">';
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
print $langs->trans("TablesTarget");
|
||||
print '</td><td>';
|
||||
$listtables = array();
|
||||
|
|
@ -1675,10 +1677,15 @@ if ($step == 5 && $datatoimport) {
|
|||
print '<div class="center">'.img_picto($langs->trans("OK"), 'tick').' <b>'.$langs->trans("NoError").'</b></div><br><br>';
|
||||
print '<div class="ok">';
|
||||
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br><br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print $langs->trans("NbOfLinesOK", $nbok).'<br><br>';
|
||||
print '<br>';
|
||||
print '<div class="info">';
|
||||
print $langs->trans("NbOfLinesOK", $nbok).'<br>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Show Errors
|
||||
|
|
@ -1823,7 +1830,7 @@ if ($step == 6 && $datatoimport) {
|
|||
print '<table width="100%" class="border">';
|
||||
|
||||
// Module
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Module").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Module").'</td>';
|
||||
print '<td>';
|
||||
$titleofmodule = $objimport->array_import_module[0]['module']->getName();
|
||||
// Special cas for import common to module/services
|
||||
|
|
@ -1852,7 +1859,7 @@ if ($step == 6 && $datatoimport) {
|
|||
print '<table width="100%" class="border">';
|
||||
|
||||
// Source file format
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("SourceFileFormat").'</td>';
|
||||
print '<td>';
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
|
|
@ -1875,6 +1882,7 @@ if ($step == 6 && $datatoimport) {
|
|||
$modulepart = 'import';
|
||||
$relativepath = GETPOST('filetoimport');
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
|
||||
print img_mime($file, '', 'pictofixedwidth');
|
||||
print $filetoimport;
|
||||
print '</a>';
|
||||
print '</td></tr>';
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -87,6 +87,9 @@ ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0;
|
|||
ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL;
|
||||
ALTER TABLE llx_holiday ADD COLUMN fk_user_approve integer DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_ticket MODIFY COLUMN progress integer;
|
||||
|
||||
|
||||
ALTER TABLE llx_emailcollector_emailcollectoraction MODIFY COLUMN actionparam TEXT;
|
||||
|
||||
ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN lang varchar(6);
|
||||
|
|
@ -157,24 +160,23 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', '
|
|||
-- START GRH/HRM MODULE
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_evaluation(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
label varchar(255),
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
status smallint NOT NULL,
|
||||
date_eval date,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL
|
||||
-- END MODULEBUILDER FIELDS
|
||||
CREATE TABLE llx_hrm_evaluation
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
|
||||
label varchar(255),
|
||||
description text,
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
status smallint NOT NULL,
|
||||
date_eval date,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL
|
||||
) ENGINE=innodb;
|
||||
ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid);
|
||||
ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref);
|
||||
|
|
@ -193,19 +195,19 @@ create table llx_hrm_evaluation_extrafields
|
|||
ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object);
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_evaluationdet(
|
||||
CREATE TABLE llx_hrm_evaluationdet
|
||||
(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
fk_evaluation integer NOT NULL,
|
||||
rank integer NOT NULL,
|
||||
required_rank integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
-- END MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
fk_evaluation integer NOT NULL,
|
||||
rankorder integer NOT NULL,
|
||||
required_rank integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid);
|
||||
|
|
@ -226,20 +228,18 @@ ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_obj
|
|||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_job(
|
||||
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
deplacement varchar(255),
|
||||
note_public text,
|
||||
note_private text,
|
||||
fk_user_creat integer,
|
||||
fk_user_modif integer
|
||||
|
||||
CREATE TABLE llx_hrm_job
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
deplacement varchar(255),
|
||||
note_public text,
|
||||
note_private text,
|
||||
fk_user_creat integer,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid);
|
||||
|
|
@ -259,23 +259,21 @@ ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object);
|
|||
|
||||
|
||||
CREATE TABLE llx_hrm_job_user(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
-- ref varchar(128) NOT NULL,
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_contrat integer,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL,
|
||||
date_start date,
|
||||
date_end date,
|
||||
commentaire_abandon varchar(255),
|
||||
note_public text,
|
||||
note_private text,
|
||||
fk_user_creat integer,
|
||||
fk_user_modif integer
|
||||
-- END MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
-- ref varchar(128) NOT NULL,
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_contrat integer,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL,
|
||||
date_start date,
|
||||
date_end date,
|
||||
abort_comment varchar(255),
|
||||
note_public text,
|
||||
note_private text,
|
||||
fk_user_creat integer,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid);
|
||||
|
|
@ -294,22 +292,21 @@ ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_obj
|
|||
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_skill(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
label varchar(255),
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
required_level integer NOT NULL,
|
||||
date_validite integer NOT NULL,
|
||||
temps_theorique double(24,8) NOT NULL,
|
||||
skill_type integer NOT NULL,
|
||||
note_public text,
|
||||
note_private text
|
||||
-- END MODULEBUILDER FIELDS
|
||||
CREATE TABLE llx_hrm_skill
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
label varchar(255),
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
required_level integer NOT NULL,
|
||||
date_validite integer NOT NULL,
|
||||
temps_theorique double(24,8) NOT NULL,
|
||||
skill_type integer NOT NULL,
|
||||
note_public text,
|
||||
note_private text
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid);
|
||||
|
|
@ -327,15 +324,14 @@ create table llx_hrm_skill_extrafields
|
|||
ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object);
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_skilldet(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
description text,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
rank integer
|
||||
-- END MODULEBUILDER FIELDS
|
||||
CREATE TABLE llx_hrm_skilldet
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
description text,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
rankorder integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid);
|
||||
|
|
@ -352,18 +348,17 @@ create table llx_hrm_skilldet_extrafields
|
|||
ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object);
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_skillrank(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_skill integer NOT NULL,
|
||||
rank integer NOT NULL,
|
||||
fk_object integer NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
objecttype varchar(128) NOT NULL
|
||||
-- END MODULEBUILDER FIELDS
|
||||
CREATE TABLE llx_hrm_skillrank
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_skill integer NOT NULL,
|
||||
rankorder integer NOT NULL,
|
||||
fk_object integer NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
objecttype varchar(128) NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid);
|
||||
|
|
@ -429,4 +424,3 @@ ALTER TABLE llx_socpeople DROP COLUMN googleplus;
|
|||
ALTER TABLE llx_socpeople DROP COLUMN youtube;
|
||||
ALTER TABLE llx_socpeople DROP COLUMN whatsapp;
|
||||
|
||||
|
||||
|
|
@ -16,17 +16,16 @@
|
|||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_evaluationdet(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
fk_evaluation integer NOT NULL,
|
||||
rank integer NOT NULL,
|
||||
required_rank integer NOT NULL,
|
||||
CREATE TABLE llx_hrm_evaluationdet
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
fk_evaluation integer NOT NULL,
|
||||
rankorder integer NOT NULL,
|
||||
required_rank integer NOT NULL,
|
||||
import_key varchar(14)
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@
|
|||
|
||||
CREATE TABLE llx_hrm_job_user(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
-- ref varchar(128) NOT NULL,
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_contrat integer,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL,
|
||||
date_start datetime,
|
||||
date_end datetime,
|
||||
commentaire_abandon varchar(255),
|
||||
description text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp,
|
||||
fk_contrat integer,
|
||||
fk_user integer NOT NULL,
|
||||
fk_job integer NOT NULL,
|
||||
date_start datetime,
|
||||
date_end datetime,
|
||||
abort_comment varchar(255),
|
||||
note_public text,
|
||||
note_private text,
|
||||
fk_user_creat integer,
|
||||
|
|
|
|||
|
|
@ -17,12 +17,10 @@
|
|||
|
||||
|
||||
CREATE TABLE llx_hrm_skilldet(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
description text,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
rank integer
|
||||
-- END MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
description text,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_skill integer NOT NULL,
|
||||
rankorder integer
|
||||
) ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -15,16 +15,15 @@
|
|||
-- along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
CREATE TABLE llx_hrm_skillrank(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_skill integer NOT NULL,
|
||||
rank integer NOT NULL,
|
||||
fk_object integer NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
CREATE TABLE llx_hrm_skillrank
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_skill integer NOT NULL,
|
||||
rankorder integer NOT NULL,
|
||||
fk_object integer NOT NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
objecttype varchar(128) NOT NULL
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ CREATE TABLE llx_ticket
|
|||
message text,
|
||||
fk_statut integer,
|
||||
resolution integer,
|
||||
progress varchar(100),
|
||||
progress integer DEFAULT 0, -- progression 0 - 100 or null
|
||||
timing varchar(20),
|
||||
type_code varchar(32),
|
||||
category_code varchar(32),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -104,7 +104,7 @@ foreach ($object->fields as $key => $val) {
|
|||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if ($val['searchall']) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
|
|
@ -444,6 +444,7 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
|
|
@ -458,9 +459,9 @@ foreach ($object->fields as $key => $val) {
|
|||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
|
|
@ -469,9 +470,9 @@ foreach ($object->fields as $key => $val) {
|
|||
print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
} elseif ($key == 'lang') {
|
||||
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
|
||||
print $formadmin->select_language($searchkey, 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($searchkey).'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -522,7 +523,7 @@ print '</tr>'."\n";
|
|||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine = 0;
|
||||
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||
if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||
if (preg_match('/\$object/', $val)) {
|
||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
|
|
|
|||
|
|
@ -501,6 +501,7 @@ WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to se
|
|||
WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other.
|
||||
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: <strong>%s</strong>.
|
||||
WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask your domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: <strong>%s</strong>.
|
||||
ActualMailSPFRecordFound=Actual SPF record found : %s
|
||||
ClickToShowDescription=Click to show description
|
||||
DependsOn=This module needs the module(s)
|
||||
RequiredBy=This module is required by module(s)
|
||||
|
|
|
|||
|
|
@ -271,6 +271,12 @@ ProfId3RU=Prof Id 3 (KPP)
|
|||
ProfId4RU=Prof Id 4 (OKPO)
|
||||
ProfId5RU=-
|
||||
ProfId6RU=-
|
||||
ProfId1UA=Prof Id 1 (EDRPOU)
|
||||
ProfId2UA=Prof Id 2 (DRFO)
|
||||
ProfId3UA=Prof Id 3 (INN)
|
||||
ProfId4UA=Prof Id 4 (Certificate)
|
||||
ProfId5UA=Prof Id 5 (RNOKPP)
|
||||
ProfId6UA=Prof Id 6 (TRDPAU)
|
||||
ProfId1DZ=RC
|
||||
ProfId2DZ=Art.
|
||||
ProfId3DZ=NIF
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ CREATE_NEW_SALARY_WITHOUT_AUTO_PAYMENT=By default, leave empty the option "Autom
|
|||
Salary=Salary
|
||||
Salaries=Salaries
|
||||
NewSalary=New salary
|
||||
AddSalary=Add salary
|
||||
NewSalaryPayment=New salary card
|
||||
AddSalaryPayment=Add salary payment
|
||||
SalaryPayment=Salary payment
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ RuleForWarehouse=Rule for warehouses
|
|||
WarehouseAskWarehouseOnThirparty=Set a warehouse on Third-parties
|
||||
WarehouseAskWarehouseDuringPropal=Set a warehouse on Commercial proposals
|
||||
WarehouseAskWarehouseDuringOrder=Set a warehouse on Sales Orders
|
||||
WarehouseAskWarehouseDuringProject=Set a warehouse on Projects
|
||||
UserDefaultWarehouse=Set a warehouse on Users
|
||||
MainDefaultWarehouse=Default warehouse
|
||||
MainDefaultWarehouseUser=Use a default warehouse for each user
|
||||
|
|
@ -262,4 +263,4 @@ ErrorSameBatchNumber=Same batch number found in inventory list
|
|||
ProductBatchDoesNotExist=Product with batch/serial does not exist
|
||||
ProductBarcodeDoesNotExist=Product with barcode does not exist
|
||||
WarehouseId=Warehouse ID
|
||||
WarehouseRef=Warehouse Ref
|
||||
WarehouseRef=Warehouse Ref
|
||||
|
|
|
|||
|
|
@ -354,13 +354,14 @@ if ($action == 'edit') {
|
|||
$result = $c->fetch($conf->global->{$constname});
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
} elseif ($result > 0 ) {
|
||||
$ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||
$toprint = array();
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
|
||||
}
|
||||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
$ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||
$toprint = array();
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
|
||||
}
|
||||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
print $langs->trans("Prospect");
|
||||
|
|
|
|||
|
|
@ -2178,8 +2178,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
print $object->getLibStatut(0, 2);
|
||||
print '</td></tr>';
|
||||
if ((($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
|
||||
|| ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) {
|
||||
if ((($object->status_batch == '1' && !empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
|
||||
|| ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && !empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS)))) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotMask").'</td><td>';
|
||||
print $object->batch_mask;
|
||||
print '</td></tr>';
|
||||
|
|
@ -2689,7 +2689,6 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
|
|||
|
||||
// Documents
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $comref.'/'.$objectref.'.pdf';
|
||||
if (!empty($conf->product->multidir_output[$object->entity])) {
|
||||
$filedir = $conf->product->multidir_output[$object->entity].'/'.$objectref; //Check repertories of current entities
|
||||
} else {
|
||||
|
|
@ -2699,7 +2698,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
|
|||
$genallowed = $usercanread;
|
||||
$delallowed = $usercancreate;
|
||||
|
||||
print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
|
||||
print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 28, 0, '', 0, '', $langs->getDefaultLang(), '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
|
|
|||
|
|
@ -931,7 +931,7 @@ END;
|
|||
'pfp.fk_availability'=>array('label'=>$langs->trans("Availability"), 'enabled' => !empty($conf->global->FOURN_PRODUCT_AVAILABILITY), 'checked'=>0, 'position'=>4),
|
||||
'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5),
|
||||
'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9),
|
||||
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => $conf->multicurrency->enabled, 'checked'=>0, 'position'=>10),
|
||||
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10),
|
||||
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
|
||||
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
|
||||
'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => $conf->barcode->enabled, 'checked'=>0, 'position'=>15),
|
||||
|
|
@ -942,14 +942,19 @@ END;
|
|||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||
if ($extrafields->attributes["product_fournisseur_price"] && array_key_exists('label', $extrafields->attributes["product_fournisseur_price"])) {
|
||||
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||
|
||||
if (!empty($extralabels)) {
|
||||
foreach ($extralabels as $key => $value) {
|
||||
// Show field if not hidden
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||
$extratitle = $langs->trans($value);
|
||||
$arrayfields['ef.'.$key] = array('label'=>$extratitle, 'checked'=>0, 'position'=>(end($arrayfields)['position'] + 1), 'langfile'=>$extrafields->attributes["product_fournisseur_price"]['langfile'][$key], 'help'=>$extrafields->attributes["product_fournisseur_price"]['help'][$key]);
|
||||
if (!empty($extralabels)) {
|
||||
foreach ($extralabels as $key => $value) {
|
||||
// Show field if not hidden
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||
$extratitle = $langs->trans($value);
|
||||
$arrayfields['ef.' . $key] = array('label' => $extratitle, 'checked' => 0,
|
||||
'position' => (end($arrayfields)['position'] + 1),
|
||||
'langfile' => $extrafields->attributes["product_fournisseur_price"]['langfile'][$key],
|
||||
'help' => $extrafields->attributes["product_fournisseur_price"]['help'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1023,29 +1028,31 @@ END;
|
|||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||
if ($extrafields->attributes["product_fournisseur_price"] && array_key_exists('label', $extrafields->attributes["product_fournisseur_price"])) {
|
||||
$extralabels = $extrafields->attributes["product_fournisseur_price"]['label'];
|
||||
|
||||
if (!empty($extralabels)) {
|
||||
foreach ($extralabels as $key => $value) {
|
||||
// Show field if not hidden
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) {
|
||||
$langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
|
||||
}
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) {
|
||||
$extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key]));
|
||||
} else {
|
||||
$extratitle = $langs->trans($value);
|
||||
}
|
||||
if (!empty($arrayfields['ef.'.$key]['checked'])) {
|
||||
print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($extralabels)) {
|
||||
foreach ($extralabels as $key => $value) {
|
||||
// Show field if not hidden
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['langfile'][$key])) {
|
||||
$langs->load($extrafields->attributes["product_fournisseur_price"]['langfile'][$key]);
|
||||
}
|
||||
if (!empty($extrafields->attributes["product_fournisseur_price"]['help'][$key])) {
|
||||
$extratitle = $form->textwithpicto($langs->trans($value), $langs->trans($extrafields->attributes["product_fournisseur_price"]['help'][$key]));
|
||||
} else {
|
||||
$extratitle = $langs->trans($value);
|
||||
}
|
||||
if (!empty($arrayfields['ef.' . $key]['checked'])) {
|
||||
print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.' . $key, '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_object($hookmanager)) {
|
||||
$parameters = array('id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
|
||||
$parameters = array('id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
|
|
@ -1213,7 +1220,7 @@ END;
|
|||
}
|
||||
|
||||
if (is_object($hookmanager)) {
|
||||
$parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>$id_fourn, 'prod_id'=>$object->id);
|
||||
$parameters = array('id_pfp'=>$productfourn->product_fourn_price_id, 'id_fourn'=>(!empty($id_fourn)?$id_fourn:''), 'prod_id'=>$object->id);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ $arrayofmode = array(
|
|||
'facture' => 'Facture'
|
||||
);
|
||||
$title .= ' '.$form->selectarray('mode', $arrayofmode, $mode, 1);
|
||||
$title .= ' <input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">';
|
||||
$title .= ' <input type="submit" class="button small" name="refresh" value="'.$langs->trans("Refresh").'">';
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
|
@ -198,7 +198,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort
|
|||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'p.fk_product_type', '', $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', '', $param, '', $sortfield, $sortorder);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||
$mode = (GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'byunit');
|
||||
$search_year = GETPOST('search_year', 'int');
|
||||
$search_categ = GETPOST('search_categ', 'int');
|
||||
$notab = GETPOST('notab', 'int');
|
||||
|
||||
$error = 0;
|
||||
$mesg = '';
|
||||
|
|
@ -56,7 +57,7 @@ if (!empty($user->socid)) {
|
|||
}
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (!empty($id) ? $id : $ref);
|
||||
$fieldvalue = ($id > 0 ? $id : $ref);
|
||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
|
|
@ -69,6 +70,11 @@ if (empty($search_year)) {
|
|||
}
|
||||
$moreforfilter = "";
|
||||
|
||||
$object = new Product($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
||||
|
||||
|
||||
|
|
@ -85,9 +91,10 @@ $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product
|
|||
|
||||
$form = new Form($db);
|
||||
$htmlother = new FormOther($db);
|
||||
$object = new Product($db);
|
||||
|
||||
if (!$id && empty($ref)) {
|
||||
if (!($id > 0) && empty($ref) || $notab) {
|
||||
$notab = 1;
|
||||
|
||||
llxHeader("", $langs->trans("ProductStatistics"));
|
||||
|
||||
$type = GETPOST('type', 'int');
|
||||
|
|
@ -132,7 +139,7 @@ if (!$id && empty($ref)) {
|
|||
}
|
||||
|
||||
|
||||
if ($result && (!empty($id) || !empty($ref))) {
|
||||
if ($result && ($id > 0 || !empty($ref)) && empty($notab)) {
|
||||
$head = product_prepare_head($object);
|
||||
$titre = $langs->trans("CardProduct".$object->type);
|
||||
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
|
||||
|
|
@ -145,11 +152,11 @@ if ($result && (!empty($id) || !empty($ref))) {
|
|||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
if (empty($id) && empty($ref)) {
|
||||
if ((!($id > 0) && empty($ref)) || $notab) {
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php'.($type != '' ? '?type='.$type : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/stats/card.php'.($type != '' ? '?type='.((int) $type) : '');
|
||||
$head[$h][1] = $langs->trans("Chart");
|
||||
$head[$h][2] = 'chart';
|
||||
$h++;
|
||||
|
|
@ -162,7 +169,7 @@ if (empty($id) && empty($ref)) {
|
|||
$title = $langs->trans("ListProductByPopularity");
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != '' ? '?type='.$type : '');
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/popuprop.php'.($type != '' ? '?type='.((int) $type) : '');
|
||||
$head[$h][1] = $langs->trans("ProductsPerPopularity");
|
||||
$head[$h][2] = 'popularity';
|
||||
$h++;
|
||||
|
|
@ -171,21 +178,29 @@ if (empty($id) && empty($ref)) {
|
|||
}
|
||||
|
||||
|
||||
if ($result || empty($id)) {
|
||||
if ($result || !($id > 0)) {
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
if (empty($id) || $notab) {
|
||||
print '<input type="hidden" name="notab" value="1">';
|
||||
}
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
|
||||
if (empty($id)) {
|
||||
if (!($id > 0) || $notab) {
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ProductsAndServices").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
|
||||
$array = array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
|
||||
print $form->selectarray('type', $array, $type);
|
||||
print '</td></tr>';
|
||||
|
||||
// Product
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ProductOrService").'</td><td>';
|
||||
print img_picto('', 'product', 'class="pictofixedwidth"');
|
||||
print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, 'maxwidth500');
|
||||
print '</td></tr>';
|
||||
|
||||
// Tag
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -194,6 +209,8 @@ if ($result || empty($id)) {
|
|||
print $moreforfilter;
|
||||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
}
|
||||
|
||||
// Year
|
||||
|
|
@ -224,7 +241,7 @@ if ($result || empty($id)) {
|
|||
}
|
||||
|
||||
if ($mode == 'bynumber') {
|
||||
print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id') ?GETPOST('id') : $object->id).($type != '' ? '&type='.$type : '').'&mode=byunit&search_year='.$search_year.'">';
|
||||
print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?'.(GETPOSTISSET('id') ? 'id='.GETPOST('id', 'int') : 'id='.$object->id).(($type != '' && $type != '-1') ? '&type='.((int) $type) : '').'&mode=byunit&search_year='.((int) $search_year).($notab ? '¬ab='.$notab : '').'">';
|
||||
} else {
|
||||
print '<span class="a-mesure marginleftonly marginrightonly">';
|
||||
}
|
||||
|
|
@ -240,7 +257,7 @@ if ($result || empty($id)) {
|
|||
}
|
||||
|
||||
if ($mode == 'byunit') {
|
||||
print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id') ?GETPOST('id') : $object->id).($type != '' ? '&type='.$type : '').'&mode=bynumber&search_year='.$search_year.'">';
|
||||
print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?'.(GETPOSTISSET('id') ? 'id='.GETPOST('id', 'int') : 'id='.$object->id).(($type != '' && $type != '-1') ? '&type='.((int) $type) : '').'&mode=bynumber&search_year='.((int) $search_year).($notab ? '¬ab='.$notab : '').'">';
|
||||
} else {
|
||||
print '<span class="a-mesure marginleftonly marginrightonly">';
|
||||
}
|
||||
|
|
@ -258,9 +275,7 @@ if ($result || empty($id)) {
|
|||
}
|
||||
print '<br>';
|
||||
|
||||
//print '<table width="100%">';
|
||||
|
||||
// Generation des graphs
|
||||
// Generation of graphs
|
||||
$dir = (!empty($conf->product->multidir_temp[$object->entity]) ? $conf->product->multidir_temp[$object->entity] : $conf->service->multidir_temp[$object->entity]);
|
||||
if ($object->id > 0) { // We are on statistics for a dedicated product
|
||||
if (!file_exists($dir.'/'.$object->id)) {
|
||||
|
|
@ -385,7 +400,7 @@ if ($result || empty($id)) {
|
|||
$px->SetShading(3);
|
||||
//print 'x '.$key.' '.$graphfiles[$key]['file'];
|
||||
|
||||
$url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.$object->entity.'&file='.urlencode($graphfiles[$key]['file']);
|
||||
$url = DOL_URL_ROOT.'/viewimage.php?modulepart='.$graphfiles[$key]['modulepart'].'&entity='.((int) $object->entity).'&file='.urlencode($graphfiles[$key]['file']).($notab ? '¬ab='.$notab : '');
|
||||
$px->draw($dir."/".$graphfiles[$key]['file'], $url);
|
||||
|
||||
$graphfiles[$key]['total'] = $px->total();
|
||||
|
|
@ -446,7 +461,9 @@ if ($result || empty($id)) {
|
|||
} else {
|
||||
$dategenerated = ($mesg ? '<span class="error">'.$mesg.'</span>' : $langs->trans("ChartNotGenerated"));
|
||||
}
|
||||
$linktoregenerate = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id') ?GETPOST('id') : $object->id).((string) $type != '' ? '&type='.$type : '').'&action=recalcul&mode='.$mode.'&search_year='.$search_year.'&search_categ='.$search_categ.'">'.img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh').'</a>';
|
||||
$linktoregenerate = '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?'.(GETPOSTISSET('id') ? 'id='.GETPOST('id', 'int') : 'id='.$object->id).(((string) $type != '' && $type != '-1') ? '&type='.((int) $type) : '').'&action=recalcul&mode='.urlencode($mode).'&search_year='.((int) $search_year).($search_categ > 0 ? '&search_categ='.((int) $search_categ) : '').'">';
|
||||
$linktoregenerate .= img_picto($langs->trans("ReCalculate").' ('.$dategenerated.')', 'refresh');
|
||||
$linktoregenerate .= '</a>';
|
||||
|
||||
// Show graph
|
||||
print '<table class="noborder centpercent">';
|
||||
|
|
@ -480,7 +497,7 @@ if ($result || empty($id)) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$id) {
|
||||
if (!($id > 0)) {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ $now = dol_now();
|
|||
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
$title = $langs->trans("ListOfWarehouses");
|
||||
|
||||
$totalarray = array();
|
||||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
|
|
@ -566,7 +567,6 @@ print '</tr>'."\n";
|
|||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
|
||||
$warehouse = new Entrepot($db);
|
||||
|
||||
|
|
|
|||
|
|
@ -358,12 +358,14 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
|||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product AND s.fk_entrepot IN ('.$db->sanitize($listofqualifiedwarehousesid).')';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
|
||||
$list_warehouse = (empty($listofqualifiedwarehousesid) ? '0' : $listofqualifiedwarehousesid);
|
||||
$sql .= ' AND s.fk_entrepot IN ('.$db->sanitize($list_warehouse) .')';
|
||||
|
||||
//$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
|
||||
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')';
|
||||
}
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -577,6 +579,9 @@ print load_fiche_titre($langs->trans('Replenishment'), '', 'stock');
|
|||
print dol_get_fiche_head($head, 'replenish', '', -1, '');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDesc").'</span>'."\n";
|
||||
|
||||
//$link = '<a title=' .$langs->trans("MenuNewWarehouse"). ' href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create">'.$langs->trans("MenuNewWarehouse").'</a>';
|
||||
|
||||
if (empty($fk_warhouse) && !empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ReplenishmentStatusDescPerWarehouse").'</span>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -164,7 +164,7 @@ if ($id == '' && $ref == '') {
|
|||
exit();
|
||||
}
|
||||
|
||||
$mine = (!empty($_REQUEST['mode']) && $_REQUEST['mode'] == 'mine') ? 1 : 0;
|
||||
$mine = GETPOST('mode') == 'mine' ? 1 : 0;
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
|
||||
$object = new Project($db);
|
||||
|
|
@ -366,19 +366,19 @@ $listofreferent = array(
|
|||
'class'=>'Entrepot',
|
||||
'table'=>'entrepot',
|
||||
'datefieldname'=>'date_entrepot',
|
||||
'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/product/stock/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'entrepot',
|
||||
'buttonnew'=>'AddWarehouse',
|
||||
'project_field'=>'fk_project',
|
||||
'testnew'=>$user->rights->stock->creer,
|
||||
'test'=>$conf->stock->enabled && $user->rights->stock->lire),
|
||||
'test'=>$conf->stock->enabled && $user->rights->stock->lire && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
|
||||
'propal'=>array(
|
||||
'name'=>"Proposals",
|
||||
'title'=>"ListProposalsAssociatedProject",
|
||||
'class'=>'Propal',
|
||||
'table'=>'propal',
|
||||
'datefieldname'=>'datep',
|
||||
'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'propal',
|
||||
'buttonnew'=>'AddProp',
|
||||
'testnew'=>$user->rights->propal->creer,
|
||||
|
|
@ -389,7 +389,7 @@ $listofreferent = array(
|
|||
'class'=>'Commande',
|
||||
'table'=>'commande',
|
||||
'datefieldname'=>'date_commande',
|
||||
'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'orders',
|
||||
'buttonnew'=>'CreateOrder',
|
||||
'testnew'=>$user->rights->commande->creer,
|
||||
|
|
@ -401,7 +401,7 @@ $listofreferent = array(
|
|||
'margin'=>'add',
|
||||
'table'=>'facture',
|
||||
'datefieldname'=>'datef',
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'bills',
|
||||
'buttonnew'=>'CreateBill',
|
||||
'testnew'=>$user->rights->facture->creer,
|
||||
|
|
@ -412,7 +412,7 @@ $listofreferent = array(
|
|||
'class'=>'FactureRec',
|
||||
'table'=>'facture_rec',
|
||||
'datefieldname'=>'datec',
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'bills',
|
||||
'buttonnew'=>'CreateBill',
|
||||
'testnew'=>$user->rights->facture->creer,
|
||||
|
|
@ -423,7 +423,7 @@ $listofreferent = array(
|
|||
'class'=>'SupplierProposal',
|
||||
'table'=>'supplier_proposal',
|
||||
'datefieldname'=>'date_valid',
|
||||
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'lang'=>'supplier_proposal',
|
||||
'buttonnew'=>'AddSupplierProposal',
|
||||
'testnew'=>$user->rights->supplier_proposal->creer,
|
||||
|
|
@ -434,7 +434,7 @@ $listofreferent = array(
|
|||
'class'=>'CommandeFournisseur',
|
||||
'table'=>'commande_fournisseur',
|
||||
'datefieldname'=>'date_commande',
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'lang'=>'suppliers',
|
||||
'buttonnew'=>'AddSupplierOrder',
|
||||
'testnew'=>($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer),
|
||||
|
|
@ -446,7 +446,7 @@ $listofreferent = array(
|
|||
'margin'=>'minus',
|
||||
'table'=>'facture_fourn',
|
||||
'datefieldname'=>'datef',
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), // No socid parameter here, the socid is often the customer and we create a supplier object
|
||||
'lang'=>'suppliers',
|
||||
'buttonnew'=>'AddSupplierInvoice',
|
||||
'testnew'=>($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer),
|
||||
|
|
@ -457,7 +457,7 @@ $listofreferent = array(
|
|||
'class'=>'Contrat',
|
||||
'table'=>'contrat',
|
||||
'datefieldname'=>'date_contrat',
|
||||
'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'contracts',
|
||||
'buttonnew'=>'AddContract',
|
||||
'testnew'=>$user->rights->contrat->creer,
|
||||
|
|
@ -470,7 +470,7 @@ $listofreferent = array(
|
|||
'datefieldname'=>'date_valid',
|
||||
'disableamount'=>0,
|
||||
'margin'=>'minus',
|
||||
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'interventions',
|
||||
'buttonnew'=>'AddIntervention',
|
||||
'testnew'=>$user->rights->ficheinter->creer,
|
||||
|
|
@ -481,7 +481,7 @@ $listofreferent = array(
|
|||
'class'=>'Expedition',
|
||||
'table'=>'expedition',
|
||||
'datefieldname'=>'date_valid',
|
||||
'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/expedition/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'sendings',
|
||||
'buttonnew'=>'CreateShipment',
|
||||
'testnew'=>0,
|
||||
|
|
@ -492,7 +492,7 @@ $listofreferent = array(
|
|||
'class'=>'Mo',
|
||||
'table'=>'mrp_mo',
|
||||
'datefieldname'=>'date_valid',
|
||||
'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/mrp/mo_card.php?action=create&origin=project&originid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'mrp',
|
||||
'buttonnew'=>'CreateMO',
|
||||
'testnew'=>'$user->rights->mrp->write',
|
||||
|
|
@ -506,7 +506,7 @@ $listofreferent = array(
|
|||
'datefieldname'=>'dated',
|
||||
'margin'=>'minus',
|
||||
'disableamount'=>1,
|
||||
'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/deplacement/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'trips',
|
||||
'buttonnew'=>'AddTrip',
|
||||
'testnew'=>$user->rights->deplacement->creer,
|
||||
|
|
@ -519,7 +519,7 @@ $listofreferent = array(
|
|||
'datefieldname'=>'date',
|
||||
'margin'=>'minus',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'trips',
|
||||
'buttonnew'=>'AddTrip',
|
||||
'testnew'=>$user->rights->expensereport->creer,
|
||||
|
|
@ -532,7 +532,7 @@ $listofreferent = array(
|
|||
'table'=>'don',
|
||||
'datefieldname'=>'datedon',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'donations',
|
||||
'buttonnew'=>'AddDonation',
|
||||
'testnew'=>$user->rights->don->creer,
|
||||
|
|
@ -545,7 +545,7 @@ $listofreferent = array(
|
|||
'table'=>'loan',
|
||||
'datefieldname'=>'datestart',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/loan/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'loan',
|
||||
'buttonnew'=>'AddLoan',
|
||||
'testnew'=>$user->rights->loan->write,
|
||||
|
|
@ -558,7 +558,7 @@ $listofreferent = array(
|
|||
'table'=>'chargesociales',
|
||||
'datefieldname'=>'date_ech',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/sociales/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'compta',
|
||||
'buttonnew'=>'AddSocialContribution',
|
||||
'testnew'=>$user->rights->tax->charges->lire,
|
||||
|
|
@ -571,7 +571,7 @@ $listofreferent = array(
|
|||
'table'=>'projet_task',
|
||||
'datefieldname'=>'task_date',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'buttonnew'=>'AddTimeSpent',
|
||||
'testnew'=>$user->rights->projet->creer,
|
||||
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
|
||||
|
|
@ -588,13 +588,13 @@ $listofreferent = array(
|
|||
'name'=>"Salaries",
|
||||
'title'=>"ListSalariesAssociatedProject",
|
||||
'class'=>'Salary',
|
||||
'table'=>'payment_salary',
|
||||
'datefieldname'=>'datev',
|
||||
'table'=>'salary',
|
||||
'datefieldname'=>'datesp',
|
||||
'margin'=>'minus',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/salaries/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'salaries',
|
||||
'buttonnew'=>'AddSalaryPayment',
|
||||
'buttonnew'=>'AddSalary',
|
||||
'testnew'=>$user->rights->salaries->write,
|
||||
'test'=>$conf->salaries->enabled && $user->rights->salaries->read),
|
||||
'variouspayment'=>array(
|
||||
|
|
@ -605,7 +605,7 @@ $listofreferent = array(
|
|||
'datefieldname'=>'datev',
|
||||
'margin'=>'minus',
|
||||
'disableamount'=>0,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id,
|
||||
'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'banks',
|
||||
'buttonnew'=>'AddVariousPayment',
|
||||
'testnew'=>$user->rights->banque->modifier,
|
||||
|
|
@ -618,7 +618,7 @@ $listofreferent = array(
|
|||
'table'=>'actioncomm',
|
||||
'datefieldname'=>'datep',
|
||||
'disableamount'=>1,
|
||||
'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid,
|
||||
'urlnew'=>DOL_URL_ROOT.'/comm/action/card.php?action=create&projectid='.$id.'&socid='.$socid.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
|
||||
'lang'=>'agenda',
|
||||
'buttonnew'=>'AddEvent',
|
||||
'testnew'=>$user->rights->agenda->myactions->create,
|
||||
|
|
@ -814,7 +814,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
}
|
||||
|
||||
// Define $total_ht_by_line
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
|
||||
$total_ht_by_line = $element->amount;
|
||||
} elseif ($tablename == 'fichinter') {
|
||||
$total_ht_by_line = $element->getAmount();
|
||||
|
|
@ -856,7 +856,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
}
|
||||
|
||||
// Define $total_ttc_by_line
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
|
||||
$total_ttc_by_line = $element->amount;
|
||||
} elseif ($tablename == 'fichinter') {
|
||||
$total_ttc_by_line = $element->getAmount();
|
||||
|
|
@ -1073,7 +1073,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
print ''; // if $key == 'project_task', we don't want details per user
|
||||
} elseif (in_array($tablename, array('payment_various'))) {
|
||||
print ''; // if $key == 'payment_various', we don't have any thirdparty
|
||||
} elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) {
|
||||
} elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'salary'))) {
|
||||
print $langs->trans("User");
|
||||
} else {
|
||||
print $langs->trans("ThirdParty");
|
||||
|
|
@ -1231,8 +1231,8 @@ foreach ($listofreferent as $key => $value) {
|
|||
$date = $element->date; // No draft status on lines
|
||||
} elseif ($tablename == 'stock_mouvement') {
|
||||
$date = $element->datem;
|
||||
} elseif ($tablename == 'payment_salary') {
|
||||
$date = $element->datev;
|
||||
} elseif ($tablename == 'salary') {
|
||||
$date = $element->datesp;
|
||||
} elseif ($tablename == 'payment_various') {
|
||||
$date = $element->datev;
|
||||
} elseif ($tablename == 'chargesociales') {
|
||||
|
|
@ -1290,7 +1290,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($expensereport->fk_user_author);
|
||||
print $tmpuser->getNomUrl(1, '', 48);
|
||||
} elseif ($tablename == 'payment_salary') {
|
||||
} elseif ($tablename == 'salary') {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($element->fk_user);
|
||||
print $tmpuser->getNomUrl(1, '', 48);
|
||||
|
|
@ -1318,7 +1318,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
if (empty($value['disableamount'])) {
|
||||
$total_ht_by_line = null;
|
||||
$othermessage = '';
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
|
||||
$total_ht_by_line = $element->amount;
|
||||
} elseif ($tablename == 'fichinter') {
|
||||
$total_ht_by_line = $element->getAmount();
|
||||
|
|
@ -1372,7 +1372,7 @@ foreach ($listofreferent as $key => $value) {
|
|||
// Amount inc tax
|
||||
if (empty($value['disableamount'])) {
|
||||
$total_ttc_by_line = null;
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') {
|
||||
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') {
|
||||
$total_ttc_by_line = $element->amount;
|
||||
} elseif ($tablename == 'fichinter') {
|
||||
$total_ttc_by_line = $element->getAmount();
|
||||
|
|
|
|||
|
|
@ -67,10 +67,12 @@ $search_task_user = GETPOST('search_task_user', 'int');
|
|||
$search_task_progress = GETPOST('search_task_progress');
|
||||
$search_task_budget_amount = GETPOST('search_task_budget_amount');
|
||||
$search_societe = GETPOST('search_societe');
|
||||
$search_opp_status = GETPOST("search_opp_status", 'alpha');
|
||||
|
||||
$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
|
||||
$mine = GETPOST('mode', 'alpha') == 'mine' ? 1 : 0;
|
||||
if ($mine) {
|
||||
$search_task_user = $user->id; $mine = 0;
|
||||
$search_task_user = $user->id;
|
||||
$mine = 0;
|
||||
}
|
||||
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
|
|
@ -346,7 +348,7 @@ $sql .= ", ".MAIN_DB_PREFIX."projet_task as t";
|
|||
if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid";
|
||||
}
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (isset($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 (t.rowid = ef.fk_object)";
|
||||
}
|
||||
if ($search_project_user > 0) {
|
||||
|
|
@ -604,7 +606,9 @@ print '<input type="hidden" name="action" value="list">';
|
|||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
if (!empty($type)) {
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
}
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
// Show description of content
|
||||
|
|
@ -634,7 +638,7 @@ if ($search_all) {
|
|||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$morehtmlfilter = '';
|
||||
$moreforfilter = '';
|
||||
|
||||
// Filter on categories
|
||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||
|
|
@ -861,10 +865,34 @@ if (!empty($arrayfields['t.tobill']['checked'])) {
|
|||
if (!empty($arrayfields['t.billed']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
$totalarray = array(
|
||||
'nbfield' => 0,
|
||||
'val' => array(
|
||||
't.planned_workload' => 0,
|
||||
't.duration_effective' => 0,
|
||||
't.progress' => 0,
|
||||
't.budget_amount' => 0,
|
||||
),
|
||||
'totalplannedworkload' => 0,
|
||||
'totaldurationeffective' => 0,
|
||||
'totaldurationdeclared' => 0,
|
||||
'totaltobillfield' => 0,
|
||||
'totalbilledfield' => 0,
|
||||
'totalbudget_amountfield' => 0,
|
||||
'totalbudgetamount' => 0,
|
||||
'totaltobill' => 0,
|
||||
'totalbilled' => 0,
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// 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
|
||||
print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['t.datec']['checked'])) {
|
||||
|
|
@ -887,7 +915,6 @@ if (!empty($conf->global->PROJECT_TIMES_SPENT_FORMAT)) {
|
|||
}
|
||||
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
|
@ -1148,7 +1175,7 @@ while ($i < min($num, $limit)) {
|
|||
}
|
||||
$totalarray['val']['t.budget_amount'] += $obj->budget_amount;
|
||||
if (!$i) {
|
||||
$totalarray['totalbudget_amount'] = $totalarray['nbfield'];
|
||||
$totalarray['totalbudget_amountfield'] = $totalarray['nbfield'];
|
||||
}
|
||||
$totalarray['totalbudgetamount'] += $obj->budget_amount;
|
||||
print '</td>';
|
||||
|
|
@ -1269,7 +1296,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota
|
|||
print '<td class="center">'.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).'</td>';
|
||||
} elseif ($totalarray['totalbilledfield'] == $i) {
|
||||
print '<td class="center">'.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).'</td>';
|
||||
} elseif ($totalarray['totalbudget_amount'] == $i) {
|
||||
} elseif ($totalarray['totalbudget_amountfield'] == $i) {
|
||||
print '<td class="center">'.price($totalarray['totalbudgetamount'], 0, $langs, 1, 0, 0, $conf->currency).'</td>';
|
||||
} else {
|
||||
print '<td></td>';
|
||||
|
|
|
|||
|
|
@ -268,6 +268,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||
} else {
|
||||
// Need to create a confattendee
|
||||
$confattendee->date_creation = dol_now();
|
||||
$confattendee->date_subscription = dol_now();
|
||||
$confattendee->email = $email;
|
||||
$confattendee->fk_project = $project->id;
|
||||
$confattendee->fk_actioncomm = $id;
|
||||
|
|
|
|||
|
|
@ -224,8 +224,9 @@ class FormResource
|
|||
$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
|
||||
} elseif ($format == 3) {
|
||||
$value = $arraytypes['code'];
|
||||
} elseif (empty($value)) {
|
||||
print ' ';
|
||||
}
|
||||
print $value ? $value : ' ';
|
||||
print '</option>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ $id = GETPOSTINT('id');
|
|||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$confirm = GETPOST('confirm');
|
||||
|
||||
$label = GETPOST('label', 'alphanohtml');
|
||||
|
|
@ -76,7 +78,6 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('salarycard', 'globalcard'));
|
||||
|
||||
$object = new Salary($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
|
|
@ -98,6 +99,7 @@ $socid = GETPOSTINT('socid');
|
|||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
restrictedArea($user, 'salaries', $object->id, 'salary', '');
|
||||
|
||||
|
||||
|
|
@ -105,9 +107,39 @@ restrictedArea($user, 'salaries', $object->id, 'salary', '');
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel) {
|
||||
header("Location: list.php");
|
||||
exit;
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
$error = 0;
|
||||
|
||||
$backurlforlist = dol_buildpath('/salaries/list.php', 1);
|
||||
|
||||
if (empty($backtopage) || ($cancel && empty($id))) {
|
||||
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
|
||||
$backtopage = $backurlforlist;
|
||||
} else {
|
||||
$backtopage = dol_buildpath('/salaries/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($cancel) {
|
||||
/*var_dump($cancel);
|
||||
var_dump($backtopage);exit;*/
|
||||
if (!empty($backtopageforcancel)) {
|
||||
header("Location: ".$backtopageforcancel);
|
||||
exit;
|
||||
} elseif (!empty($backtopage)) {
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Link to a project
|
||||
|
|
@ -405,8 +437,7 @@ llxHeader("", $title, $help_url);
|
|||
$form = new Form($db);
|
||||
if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db);
|
||||
|
||||
if ($id) {
|
||||
$object = new Salary($db);
|
||||
if ($id > 0) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db);
|
||||
|
|
@ -440,6 +471,12 @@ if ($action == 'create') {
|
|||
print '<form name="salary" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("NewSalary"), '', 'salary');
|
||||
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ if (!$conf->use_javascript_ajax) {
|
|||
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
|
||||
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
|
||||
);
|
||||
print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
|
||||
print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global, 'COMPANY_USE_SEARCH_TO_SELECT')?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:''), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button reposition" name="COMPANY_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
|
|
@ -767,7 +767,7 @@ if (!$conf->use_javascript_ajax) {
|
|||
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
|
||||
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
|
||||
);
|
||||
print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, $conf->global->CONTACT_USE_SEARCH_TO_SELECT, 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
|
||||
print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT", $arrval, (property_exists($conf->global, 'CONTACT_USE_SEARCH_TO_SELECT')?$conf->global->CONTACT_USE_SEARCH_TO_SELECT:''), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button reposition" name="CONTACT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
|
|
@ -870,7 +870,7 @@ if (empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
|
|||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("DefaultCustomerType").'</td>';
|
||||
print '<td>';
|
||||
print $formcompany->selectProspectCustomerType($conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT, 'defaultcustomertype', 'defaultcustomertype', 'admin');
|
||||
print $formcompany->selectProspectCustomerType((property_exists($conf->global, 'THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')?$conf->global->THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT:''), 'defaultcustomertype', 'defaultcustomertype', 'admin');
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="submit" class="button reposition" name="THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT" value="'.$langs->trans("Modify").'">';
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -160,16 +162,16 @@ if ($object->client) {
|
|||
$obj = $db->fetch_object($resql);
|
||||
$nbFactsClient = $obj->nb;
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire) {
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire) {
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire) {
|
||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire) {
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
}
|
||||
|
|
@ -219,6 +221,7 @@ print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?socid='.$socid.'">';
|
|||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
$sql_select = '';
|
||||
$documentstaticline = '';
|
||||
/*if ($type_element == 'action')
|
||||
{ // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
|
@ -232,7 +235,8 @@ $sql_select = '';
|
|||
if ($type_element == 'fichinter') { // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
$documentstatic = new Fichinter($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, ';
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, NULL as paid, ';
|
||||
$sql_select .= 'NULL as fk_product, NULL as info_bits, NULL as date_start, NULL as date_end, NULL as prod_qty, NULL as total_ht, ';
|
||||
$tables_from = MAIN_DB_PREFIX."fichinter as f LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as d ON d.fk_fichinter = f.rowid"; // Must use left join to work also with option that disable usage of lines.
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND f.entity = ".$conf->entity;
|
||||
|
|
@ -242,7 +246,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices
|
|||
if ($type_element == 'invoice') { // Customer : show products from invoices
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$documentstatic = new Facture($db);
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
|
||||
$sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, d.fk_remise_except, ';
|
||||
$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d";
|
||||
$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_facture = f.rowid";
|
||||
|
|
@ -254,7 +258,7 @@ if ($type_element == 'invoice') { // Customer : show products from invoices
|
|||
if ($type_element == 'propal') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
$documentstatic = new Propal($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, ';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, NULL as paid,';
|
||||
$tables_from = MAIN_DB_PREFIX."propal as c,".MAIN_DB_PREFIX."propaldet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_propal = c.rowid";
|
||||
|
|
@ -266,7 +270,7 @@ if ($type_element == 'propal') {
|
|||
if ($type_element == 'order') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$documentstatic = new Commande($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, ';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, NULL as paid, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande as c,".MAIN_DB_PREFIX."commandedet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_commande = c.rowid";
|
||||
|
|
@ -290,7 +294,7 @@ if ($type_element == 'supplier_invoice') { // Supplier : Show products from inv
|
|||
if ($type_element == 'supplier_proposal') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
$documentstatic = new SupplierProposal($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, ';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, ';
|
||||
$tables_from = MAIN_DB_PREFIX."supplier_proposal as c,".MAIN_DB_PREFIX."supplier_proposaldet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_supplier_proposal = c.rowid";
|
||||
|
|
@ -302,7 +306,7 @@ if ($type_element == 'supplier_proposal') {
|
|||
if ($type_element == 'supplier_order') { // Supplier : Show products from orders.
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$documentstatic = new CommandeFournisseur($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, ';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, ';
|
||||
$tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_commande = c.rowid";
|
||||
|
|
@ -315,7 +319,7 @@ if ($type_element == 'contract') { // Order
|
|||
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
||||
$documentstatic = new Contrat($db);
|
||||
$documentstaticline = new ContratLigne($db);
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, ';
|
||||
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, NULL as paid,';
|
||||
$tables_from = MAIN_DB_PREFIX."contrat as c,".MAIN_DB_PREFIX."contratdet as d";
|
||||
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid);
|
||||
$where .= " AND d.fk_contrat = c.rowid";
|
||||
|
|
@ -341,7 +345,7 @@ if (!empty($sql_select)) {
|
|||
$sql .= ' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, ';
|
||||
}
|
||||
if ($type_element != 'fichinter') {
|
||||
$sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity,';
|
||||
$sql .= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity, ';
|
||||
}
|
||||
$sql .= " s.rowid as socid ";
|
||||
if ($type_element != 'fichinter') {
|
||||
|
|
@ -423,7 +427,7 @@ if ($sql_select) {
|
|||
if ($year) {
|
||||
$param .= "&year=".urlencode($year);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
if ($optioncss) {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
|
|
@ -567,6 +571,7 @@ if ($sql_select) {
|
|||
</a>
|
||||
<?php
|
||||
if ($objp->description) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) {
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$discount->fetch($objp->fk_remise_except);
|
||||
|
|
@ -652,7 +657,10 @@ if ($sql_select) {
|
|||
$total_qty += $objp->prod_qty;
|
||||
|
||||
print '<td class="right"><span class="amount">'.price($objp->total_ht).'</span></td>';
|
||||
$total_ht += $objp->total_ht;
|
||||
if (empty($total_ht)) {
|
||||
$total_ht = 0;
|
||||
}
|
||||
$total_ht += (float) $objp->total_ht;
|
||||
|
||||
print '<td class="right">'.price($objp->total_ht / (empty($objp->prod_qty) ? 1 : $objp->prod_qty)).'</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -776,16 +776,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
$obj = $db->fetch_object($resql);
|
||||
$nbFactsClient = $obj->nb;
|
||||
$thirdTypeArray['customer'] = $langs->trans("customer");
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire) {
|
||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
|
||||
}
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire) {
|
||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
|
||||
}
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire) {
|
||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
|
||||
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
|
||||
}
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire) {
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
|
||||
}
|
||||
|
||||
|
|
@ -1305,7 +1305,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
}
|
||||
print_liste_field_titre("DefaultRIB", '', '', '', '', '', '', '', 'center ');
|
||||
print_liste_field_titre('', '', '', '', '', '', '', '', 'center ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($rib_list as $rib) {
|
||||
|
|
@ -1394,7 +1394,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
|
||||
$out = '';
|
||||
if (is_array($modellist) && count($modellist)) {
|
||||
$out .= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">';
|
||||
$out .= '<form action="'.$_SERVER["PHP_SELF"].(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">';
|
||||
$out .= '<input type="hidden" name="action" value="builddocrib">';
|
||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$out .= '<input type="hidden" name="socid" value="'.$object->id.'">';
|
||||
|
|
@ -1408,14 +1408,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
$modelselected = $conf->global->BANKADDON_PDF;
|
||||
}
|
||||
|
||||
$out .= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
$out .= $form->selectarray('modelrib'.$rib->id, $modellist, $modelselected, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
$out .= ajax_combobox('modelrib'.$rib->id);
|
||||
|
||||
$allowgenifempty = 0;
|
||||
|
||||
// Language code (if multilang)
|
||||
if ($conf->global->MAIN_MULTILANGS) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
$defaultlang = $codelang ? $codelang : $langs->getDefaultLang();
|
||||
$defaultlang = $langs->getDefaultLang();
|
||||
$morecss = 'maxwidth150';
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
$morecss = 'maxwidth100';
|
||||
|
|
|
|||
|
|
@ -1121,14 +1121,24 @@ if ($resql) {
|
|||
}
|
||||
|
||||
$hookmanager->initHooks(array('takeposfrontend'));
|
||||
$reshook = $hookmanager->executeHooks('ActionButtons');
|
||||
if (!empty($reshook)) {
|
||||
if (is_array($reshook) && !isset($reshook['title'])) {
|
||||
foreach ($reshook as $reshook) {
|
||||
$menus[$r++] = $reshook;
|
||||
$parameters = array('menus'=>$menus);
|
||||
$reshook = $hookmanager->executeHooks('ActionButtons', $parameters);
|
||||
if ($reshook == 0) { //add buttons
|
||||
if (is_array($hookmanager->resArray) ) {
|
||||
foreach ($hookmanager->resArray as $resArray) {
|
||||
foreach ($resArray as $butmenu) {
|
||||
$menus[$r++] = $butmenu;
|
||||
}
|
||||
}
|
||||
} elseif ($reshook == 1) {
|
||||
$r = 0; //replace buttons
|
||||
if (is_array($hookmanager->resArray) ) {
|
||||
foreach ($hookmanager->resArray as $resArray) {
|
||||
foreach ($resArray as $butmenu) {
|
||||
$menus[$r++] = $butmenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$menus[$r++] = $reshook;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ if ($action == "freezone") {
|
|||
if ($action == "addnote") {
|
||||
$desc = GETPOST('addnote', 'alpha');
|
||||
if ($idline==0) {
|
||||
$invoice->update_note_public($desc);
|
||||
$invoice->update_note($desc, '_public');
|
||||
} else foreach ($invoice->lines as $line) {
|
||||
if ($line->id == $idline) {
|
||||
$result = $invoice->updateline($line->id, $desc, $line->subprice, $line->qty, $line->remise_percent, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);
|
||||
|
|
@ -1159,7 +1159,7 @@ $( document ).ready(function() {
|
|||
$result = $adh->fetch('', '', $invoice->socid);
|
||||
if ($result > 0) {
|
||||
$adh->ref = $adh->getFullName($langs);
|
||||
if (empty($adh->statut)) {
|
||||
if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED ) {
|
||||
$s .= "<s>";
|
||||
}
|
||||
$s .= $adh->getFullName($langs);
|
||||
|
|
@ -1175,7 +1175,7 @@ $( document ).ready(function() {
|
|||
$s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated
|
||||
}
|
||||
}
|
||||
if (empty($adh->statut)) {
|
||||
if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) {
|
||||
$s .= "</s>";
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -232,6 +233,12 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Link ticket to project
|
||||
if (GETPOST('origin', 'alpha') == 'projet') {
|
||||
$projectid = GETPOST('originid', 'int');
|
||||
} else {
|
||||
$projectid = GETPOST('projectid', 'int');
|
||||
}
|
||||
|
||||
if ($projectid > 0) {
|
||||
$object->setProject($projectid);
|
||||
}
|
||||
|
|
@ -611,7 +618,7 @@ if (empty($reshook)) {
|
|||
if ($ret > 0) {
|
||||
$log_action = $langs->trans('TicketInitialMessageModified')." \n";
|
||||
// include the Diff class
|
||||
dol_include_once('/ticket/class/utils_diff.class.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/utils_diff.class.php';
|
||||
// output the result of comparing two files as plain text
|
||||
$log_action .= Diff::toString(Diff::compare(strip_tags($oldvalue_message), strip_tags($object->message)));
|
||||
|
||||
|
|
@ -1041,11 +1048,11 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print $langs->trans("AssignedTo");
|
||||
if ($object->fk_statut < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?track_id='.$object->track_id.'&action=view&set=assign_ticket">'.img_edit($langs->trans('Modify'), '').'</a></td>';
|
||||
print '</td><td class="right"><a class="editfielda" href="'.$url_page_current.'?track_id='.$object->track_id.'&action=view&set=assign_ticket">'.img_edit($langs->trans('Modify'), '').'</a>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->fk_user_assign > 0) {
|
||||
if (GETPOST('set', 'alpha') != "assign_ticket" && $object->fk_user_assign > 0) {
|
||||
$userstat->fetch($object->fk_user_assign);
|
||||
print $userstat->getNomUrl(-1);
|
||||
}
|
||||
|
|
@ -1056,30 +1063,30 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="assign_user">';
|
||||
print '<input type="hidden" name="track_id" value="'.$object->track_id.'">';
|
||||
print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
|
||||
//print '<label for="fk_user_assign">'.$langs->trans("AssignUser").'</label> ';
|
||||
print $form->select_dolusers($user->id, 'fk_user_assign', 1);
|
||||
print ' <input type="submit" class="button" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
|
||||
print ' <input type="submit" class="button small" name="btn_assign_user" value="'.$langs->trans("Validate").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Progression
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans('Progression').'</td><td class="left">';
|
||||
print '</td>';
|
||||
if ($action != 'progression' && $object->fk_statut < $object::STATUS_CLOSED && !$user->socid) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=progression&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="5">';
|
||||
print '</td><td>';
|
||||
if ($user->rights->ticket->write && $action == 'progression') {
|
||||
print '<form action="'.$url_page_current.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
print '<input type="hidden" name="action" value="set_progression">';
|
||||
print '<input type="text" class="flat" size="20" name="progress" value="'.$object->progress.'">';
|
||||
print ' <input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||
print '<input type="text" class="flat width75" name="progress" value="'.$object->progress.'">';
|
||||
print ' <input type="submit" class="button button-edit small" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print($object->progress > 0 ? $object->progress : '0').'%';
|
||||
|
|
@ -1088,32 +1095,53 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print '</tr>';
|
||||
|
||||
// Timing (Duration sum of linked fichinter)
|
||||
if ($conf->ficheinter->enabled) {
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$object->fetchObjectLinked();
|
||||
$num = count($object->linkedObjects);
|
||||
$timing = 0;
|
||||
$foundinter = 0;
|
||||
if ($num) {
|
||||
foreach ($object->linkedObjects as $objecttype => $objects) {
|
||||
if ($objecttype = "fichinter") {
|
||||
foreach ($objects as $fichinter) {
|
||||
$foundinter++;
|
||||
$timing += $fichinter->duration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<tr><td valign="top">';
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("TicketDurationAuto"), $langs->trans("TicketDurationAutoInfos"), 1);
|
||||
print '</td><td>';
|
||||
print convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
print $foundinter ? convertSecondToTime($timing, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY) : '';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Fin colonne gauche et début colonne droite
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
print '<form method="post" name="formticketproperties" action="'.$url_page_current.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="change_property">';
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
|
||||
print '<table class="border tableforfield centpercent noborderbottom">';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="valignmiddle">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
|
||||
print '<td class="valignmiddle titlefield">';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
|
||||
print $langs->trans("Categories");
|
||||
if ($action != 'categories' && !$user->socid) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=categories&track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
|
||||
|
|
@ -1123,7 +1151,7 @@ if ($action == 'create' || $action == 'presend') {
|
|||
|
||||
if ($user->rights->ticket->write && $action == 'categories') {
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1);
|
||||
if (count($cate_arbo)) {
|
||||
if (is_array($cate_arbo)) {
|
||||
// Categories
|
||||
print '<td colspan="3">';
|
||||
print '<form action="'.$url_page_current.'" method="post">';
|
||||
|
|
@ -1139,7 +1167,7 @@ if ($action == 'create' || $action == 'presend') {
|
|||
}
|
||||
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Save').'">';
|
||||
print '<input type="submit" class="button button-edit small" value="'.$langs->trans('Save').'">';
|
||||
print '</form>';
|
||||
print "</td>";
|
||||
}
|
||||
|
|
@ -1148,27 +1176,15 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Fin colonne gauche et début colonne droite
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
|
||||
// View Original message
|
||||
$actionobject->viewTicketOriginalMessage($user, $action, $object);
|
||||
|
||||
// Classification of ticket
|
||||
print '<form method="post" name="formticketproperties" action="'.$url_page_current.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="change_property">';
|
||||
print '<input type="hidden" name="track_id" value="'.$track_id.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder tableforfield centpercent margintable">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
|
@ -1177,11 +1193,11 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
|
||||
print '<input type="submit" class="button" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
print '<input type="submit" class="button small" name="btn_update_ticket_prop" value="'.$langs->trans("Modify").'" />';
|
||||
} else {
|
||||
// Button to edit Properties
|
||||
if ($object->fk_statut < $object::STATUS_NEED_MORE_INFO && $user->rights->ticket->write) {
|
||||
print '<a class="editfielda" href="card.php?track_id='.$object->track_id.'&action=view&set=properties">'.img_edit($langs->trans('Modify')).'</a>';
|
||||
print ' <a class="editfielda" href="card.php?track_id='.$object->track_id.'&action=view&set=properties">'.img_edit($langs->trans('Modify')).'</a>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1191,7 +1207,7 @@ if ($action == 'create' || $action == 'presend') {
|
|||
print '<tr>';
|
||||
// Type
|
||||
print '<td class="titlefield">';
|
||||
print $langs->trans('TicketChangeType');
|
||||
print $langs->trans('Type');
|
||||
print '</td><td>';
|
||||
$formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
||||
print '</td>';
|
||||
|
|
@ -1199,15 +1215,15 @@ if ($action == 'create' || $action == 'presend') {
|
|||
// Group
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans('TicketChangeCategory');
|
||||
print $langs->trans('TicketCategory');
|
||||
print '</td><td>';
|
||||
$formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2);
|
||||
$formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2, 0, 0, 0, 'maxwidth500');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Severity
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $langs->trans('TicketChangeSeverity');
|
||||
print $langs->trans('TicketSeverity');
|
||||
print '</td><td>';
|
||||
$formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class Ticket extends CommonObject
|
|||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>520, 'notnull'=>1),
|
||||
'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,),
|
||||
'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'),
|
||||
'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2),
|
||||
'progress' => array('type'=>'integer', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2, 'csslist'=>'width50'),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
|
|
@ -1258,12 +1258,12 @@ class Ticket extends CommonObject
|
|||
/**
|
||||
* Return status label of object
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->libStatut($this->fk_statut, $mode);
|
||||
return $this->libStatut($this->fk_statut, $mode, 0, $this->progress);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1274,9 +1274,10 @@ class Ticket extends CommonObject
|
|||
* @param string $status Id status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @param int $notooltip 1=No tooltip
|
||||
* @param int $progress Progression (0 to 100)
|
||||
* @return string Label
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0, $notooltip = 0)
|
||||
public function LibStatut($status, $mode = 0, $notooltip = 0, $progress = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
@ -1312,7 +1313,15 @@ class Ticket extends CommonObject
|
|||
$params = array('tooltip' => 'no');
|
||||
}
|
||||
|
||||
return dolGetStatus($langs->transnoentitiesnoconv($labelStatus), $langs->transnoentitiesnoconv($labelStatusShort), '', $statusType, $mode, '', $params);
|
||||
$labelStatus = $langs->transnoentitiesnoconv($labelStatus);
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv($labelStatusShort);
|
||||
|
||||
if ($status == self::STATUS_IN_PROGRESS && $progress > 0) {
|
||||
$labelStatus .= ' ('.round($progress).'%)';
|
||||
$labelStatusShort .= ' ('.round($progress).'%)';
|
||||
}
|
||||
|
||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode, '', $params);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -334,20 +334,18 @@ $title = $langs->trans('TicketList');
|
|||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$sql .= "t.".$key.", ";
|
||||
}
|
||||
$sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$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 : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/, $/', '', $sql);
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (isset($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 (t.rowid = ef.fk_object)";
|
||||
|
|
@ -383,15 +381,16 @@ foreach ($search as $key => $val) {
|
|||
$sql .= natural_search($key, join(',', $newarrayofstatus), 2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') {
|
||||
} elseif ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') {
|
||||
if ($search[$key] > 0) {
|
||||
$sql .= natural_search($key, $search[$key], 2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
|
||||
if ($search[$key] != '') {
|
||||
// $search[$key] can be an array of values, or a string. We add filter if array not empty or if it is a string.
|
||||
if ((is_array($search[$key]) && !empty($search[$key])) || (!is_array($search[$key]) && $search[$key] != '')) {
|
||||
$sql .= natural_search($key, $search[$key], $mode_search);
|
||||
}
|
||||
}
|
||||
|
|
@ -423,7 +422,6 @@ if ($search_dateclose_end) {
|
|||
$sql .= " AND t.date_close <= '".$db->idate($search_dateclose_end)."'";
|
||||
}
|
||||
|
||||
|
||||
if (!$user->socid && ($mode == "mine" || (!$user->admin && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY))) {
|
||||
$sql .= " AND (t.fk_user_assign = ".((int) $user->id);
|
||||
if (empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
|
|
@ -674,8 +672,6 @@ $arrayofmassactions = array(
|
|||
);
|
||||
if ($user->rights->ticket->write) {
|
||||
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Close");
|
||||
}
|
||||
if ($user->rights->ticket->write) {
|
||||
$arrayofmassactions['reopen'] = img_picto('', 'folder-open', 'class="pictofixedwidth"').$langs->trans("ReOpen");
|
||||
}
|
||||
if ($user->rights->ticket->delete) {
|
||||
|
|
@ -767,18 +763,22 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
|||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'fk_statut') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
if ($key == 'type_code') {
|
||||
if ($key == 'progress') {
|
||||
print '<td class="liste_titre right'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print '<input type="text" class="flat maxwidth50" name="search_'.$key.'" value="'.dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]).'">';
|
||||
print '</td>';
|
||||
} elseif ($key == 'type_code') {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
$formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150'));
|
||||
print '</td>';
|
||||
|
|
@ -872,24 +872,33 @@ print '</tr>'."\n";
|
|||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'fk_statut' || $key == 'severity_code') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
}
|
||||
}
|
||||
$totalarray = array(
|
||||
'nbfield' => 0,
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// 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, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ')."\n";
|
||||
|
|
@ -910,7 +919,7 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a
|
|||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
|
||||
$cacheofoutputfield = array();
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
|
@ -945,15 +954,17 @@ while ($i < min($num, $limit)) {
|
|||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td';
|
||||
if ($cssforfield || $val['css']) {
|
||||
if ($cssforfield || (array_key_exists('css', $val) && $val['css'])) {
|
||||
print ' class="';
|
||||
}
|
||||
print $cssforfield;
|
||||
if ($cssforfield && $val['css']) {
|
||||
if ($cssforfield && array_key_exists('css', $val) && $val['css']) {
|
||||
print ' ';
|
||||
}
|
||||
print $val['css'];
|
||||
if ($cssforfield || $val['css']) {
|
||||
if (array_key_exists('css', $val)) {
|
||||
print $val['css'];
|
||||
}
|
||||
if ($cssforfield || (array_key_exists('css', $val) && $val['css'])) {
|
||||
print '"';
|
||||
}
|
||||
print '>';
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user