diff --git a/README-FR.md b/README-FR.md
index 81fdff13047..a67bf204076 100644
--- a/README-FR.md
+++ b/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)].
-
-
+[](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
diff --git a/README.md b/README.md
index 54fdf1e958b..b0f7a2c3761 100644
--- a/README.md
+++ b/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:
-
-
+[](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)]
-
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index cce6351950c..7ce22e790c3 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono';
+* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
+ of the function, replace:
+
+ $roman = '';
+
+with:
+
+ $roman = '';
+ if ($number >= 4000) {
+ // do not represent numbers above 4000 in Roman numerals
+ return strval($number);
+ }
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index d98357bc93c..e7616ededf3 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -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);
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index 0dca0d86193..5967d670856 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -59,7 +59,7 @@ $permissiontoedit = $user->rights->adherent->cotisation->creer; // Used by the i
$hookmanager->initHooks(array('subscriptioncard', 'globalcard'));
// Security check
-$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id
+$result = restrictedArea($user, 'subscription', 0); // TODO Check on object id
/*
diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 8060398574c..1cce5388f90 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -83,26 +83,26 @@ if ($action == 'set') {
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
$defaultValues = new DefaultValues($db);
- $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete','t.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
- if (!is_array($result) && $result<0) {
+ $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
+ if (!is_array($result) && $result < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
- } elseif (count($result)>0) {
+ } elseif (count($result) > 0) {
foreach ($result as $defval) {
- $defaultValues->id=$defval->id;
+ $defaultValues->id = $defval->id;
$resultDel = $defaultValues->delete($user);
- if ($resultDel<0) {
+ if ($resultDel < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
}
}
}
- $defaultValues->type='createform';
- $defaultValues->entity=$conf->entity;
- $defaultValues->user_id=0;
- $defaultValues->page='comm/action/card.php';
- $defaultValues->param='complete';
- $defaultValues->value=GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
- $resultCreat=$defaultValues->create($user);
- if ($resultCreat<0) {
+ $defaultValues->type = 'createform';
+ $defaultValues->entity = $conf->entity;
+ $defaultValues->user_id = 0;
+ $defaultValues->page = 'comm/action/card.php';
+ $defaultValues->param = 'complete';
+ $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
+ $resultCreat = $defaultValues->create($user);
+ if ($resultCreat < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
}
} elseif ($action == 'specimen') { // For orders
@@ -355,13 +355,13 @@ print '
| ' . $langs->trans('Parameter') . ' | ' . $langs->trans('Value') . ' |
|---|---|
| '.$langs->trans('Parameter').' | '.$langs->trans('Value').' |
| ';
@@ -829,7 +828,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
// Filter on days
print img_picto('', 'clock', 'class="fawidth30 inline-block paddingleft"');
print ''.$langs->trans("DaysOfWeek").'';
- print "\n".' ';
+ print "\n".' ';
print '';
if (empty($conf->dol_use_jmobile)) {
print ' - ';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 222f6ab8a87..c046281f18e 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2014,14 +2014,14 @@ if ($action == 'create') {
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
// Thirdparty
- $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project if (!empty($conf->projet->enabled)) { $langs->load("projects"); - $morehtmlref .= ' '.$langs->trans('Project').' '; + $morehtmlref .= ' '.$langs->trans('Project').''; if ($usercancreate) { if ($action != 'classify') { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; @@ -2041,9 +2041,10 @@ if ($action == 'create') { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ': '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 69876476907..fedf6a6233d 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -166,9 +166,10 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index e1e9eec4ee4..1135dfcf0c2 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -159,9 +159,10 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 5a8d2b2294c..dc43af9ceff 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -106,9 +106,10 @@ if (!empty($conf->projet->enabled)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 3535ae0cde1..1ccbd22d511 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -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)) { diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index c46fb7a67b2..13fa42edb29 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -130,9 +130,10 @@ if ($object->id > 0) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index cb62cf0094f..db29da62565 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2075,9 +2075,10 @@ if ($action == 'create' && $usercancreate) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 5b9705209c5..a4d857a47fd 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -161,9 +161,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 7eb835fe938..b2b024f686a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -153,9 +153,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index d9221096392..38d8beba2ec 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -106,9 +106,10 @@ if (!empty($conf->projet->enabled)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index c3218c8cbe8..55140c30ae2 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -125,9 +125,10 @@ if ($id > 0 || !empty($ref)) { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ''; - $morehtmlref .= $proj->ref; - $morehtmlref .= ''; + $morehtmlref .= ' : '.$proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.$proj->title; + } } else { $morehtmlref .= ''; } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index fddf7a2879f..8abbdaa0dd3 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -578,7 +578,7 @@ print ' '; foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { - continue; // list not qualified + continue; // list not qualified } $disabled = ''; if (empty($val['perms'])) { diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index eabe47e54ca..8628e287bd0 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -8,7 +8,7 @@ * Copyright (C) 2016 Juanjo Menent '.$langs->trans("ErrorRecordNotFound").' ';
+ llxFooter();
+ exit;
+ }
+
/*
* Show object in view mode
*/
@@ -4249,9 +4258,10 @@ if ($action == 'create') {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index b589607ac37..100334e046a 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -126,8 +126,8 @@ class FactureRec extends CommonInvoice
public $suspended; // status
- public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice
- public $generate_pdf; // 1 to generate PDF on invoice generation (default)
+ public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice
+ public $generate_pdf; // 1 to generate PDF on invoice generation (default)
/**
* @var int 1 if status is draft
@@ -712,12 +712,12 @@ class FactureRec extends CommonInvoice
//$line->code_ventilation = $objp->fk_code_ventilation;
$line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price;
- $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility
+ $line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility
$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $objp->fk_product_fournisseur_price, $objp->pa_ht);
$line->buyprice = $marginInfos[0];
- $line->pa_ht = $marginInfos[0]; // For backward compatibility
+ $line->pa_ht = $marginInfos[0]; // For backward compatibility
$line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2];
$line->rang = $objp->rang;
@@ -1930,14 +1930,14 @@ class FactureLigneRec extends CommonInvoiceLine
public $fk_product_fournisseur_price;
- public $fk_fournprice; // For backward compatibility
+ public $fk_fournprice; // For backward compatibility
public $rang;
public $desc;
public $description;
- public $fk_product_type; // Use instead product_type
+ public $fk_product_type; // Use instead product_type
public $fk_contract_line;
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 90641062b40..04c1383c4a5 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1560,8 +1560,11 @@ class Facture extends CommonInvoice
$hookmanager->initHooks(array('invoicedao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if ($reshook > 0) $result = $hookmanager->resPrint;
- else $result .= $hookmanager->resPrint;
+ if ($reshook > 0) {
+ $result = $hookmanager->resPrint;
+ } else {
+ $result .= $hookmanager->resPrint;
+ }
return $result;
}
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index 4381557cd28..6354c0bf5fd 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -100,6 +100,14 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $langs->load('errors');
+ echo ''.$langs->trans("ErrorRecordNotFound").' ';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);
@@ -160,9 +168,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index c9b6f9a39a8..89a67e75cb7 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -92,6 +92,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $langs->load('errors');
+ echo ''.$langs->trans("ErrorRecordNotFound").' ';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
@@ -153,9 +161,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index 69322187e59..f8dd1418000 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -62,6 +62,14 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $langs->load('errors');
+ echo ''.$langs->trans("ErrorRecordNotFound").' ';
+ llxFooter();
+ exit;
+}
+
$form = new Form($db);
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
@@ -112,9 +120,10 @@ if (!empty($conf->projet->enabled)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 84ad5bd0f31..52b2fcceee0 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -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);
}
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index 40bb97fa236..6f699774d32 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -77,6 +77,14 @@ if (empty($reshook)) {
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $langs->load('errors');
+ echo ''.$langs->trans("ErrorRecordNotFound").' ';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);
@@ -129,9 +137,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index c49d98baafe..d815fad4ba6 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -371,9 +371,10 @@ if ($object->id > 0) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 9b235926421..33e14407dd6 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -5,7 +5,7 @@
* Copyright (C) 2011-2016 Juanjo Menent ';
$paymentstatic->id = $value["paymentid"];
$paymentstatic->ref = $value["paymentref"];
+ $paymentstatic->date = $value["paymentdate"];
if ($paymentstatic->id) {
print $paymentstatic->getNomUrl(1);
} else {
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index 03dfd0288bd..42bf73eaae6 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -90,10 +90,10 @@ if (empty($reshook)) {
}
}
if ($action == 'create') {
- $default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
+ $default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
if ($id_bankaccount != $conf->global->{$default_account}) {
- $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default
+ $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); //Set as default
}
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index e7e9840af61..c095dc24b99 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -514,9 +514,10 @@ if ($id > 0) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index fa95b08faca..9a4b50e3474 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -600,7 +600,7 @@ class PaymentSocialContribution extends CommonObject
$result = $acc->add_url_line(
$bank_line_id,
$socialcontrib->fk_user,
- DOL_URL_ROOT . '/user/card.php?id=',
+ DOL_URL_ROOT.'/user/card.php?id=',
$fuser->getFullName($langs),
'user'
);
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index d0cf3a1f34c..66800c4d449 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -127,9 +127,10 @@ if ($object->id) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php
index eefd667b964..546a4c711d0 100644
--- a/htdocs/compta/sociales/info.php
+++ b/htdocs/compta/sociales/info.php
@@ -94,9 +94,10 @@ if (!empty($conf->projet->enabled)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 9e9895444b8..62f2262e2d6 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -818,7 +818,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print ' | ';
- print ' | '.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)).' | ';
+ print '';
+ print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
+ print ' | ';
print '';
+ print ' | ';
$useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
- print ' | '.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty).' | ';
+ print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty);
+ print '';
print ''.$langs->trans("No_Email").' | '.yn($object->no_email).' | '.$langs->trans("No_Email").' | ';
+ if ($object->email) {
+ print yn($object->no_email);
+ } else {
+ print ''.$langs->trans("EMailNotDefined").'';
+ }
+ print ' | '.$langs->trans("ContactVisibility").' | ';
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index db65ba8c7d2..82c26b559d2 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -204,6 +204,12 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
$arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1);
}
+$arrayfields['unsubscribed'] = array(
+ 'label'=>'No_Email',
+ 'checked'=>0,
+ 'enabled'=>(!empty($conf->mailing->enabled)),
+ 'position'=>41);
+
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
@@ -355,7 +361,7 @@ if ($resql) {
}
$sql = "SELECT s.rowid as socid, s.nom as name,";
-$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.no_email,";
+$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,";
$sql .= " p.socialnetworks, p.photo,";
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,";
@@ -366,6 +372,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}
+if (!empty($conf->mailing->enabled)) {
+ $sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed";
+}
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@@ -499,8 +508,11 @@ if (strlen($search_town)) {
if (count($search_roles) > 0) {
$sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
}
-if ($search_no_email != '' && $search_no_email >= 0) {
- $sql .= " AND p.no_email = ".((int) $search_no_email);
+if ($search_no_email != -1 && $search_no_email > 0) {
+ $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0";
+}
+if ($search_no_email != -1 && $search_no_email == 0) {
+ $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
}
if ($search_status != '' && $search_status >= 0) {
$sql .= " AND p.statut = ".((int) $search_status);
@@ -568,75 +580,75 @@ llxHeader('', $title, $help_url);
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
- $param .= '&contextpage='.$contextpage;
+ $param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
- $param .= '&limit='.$limit;
+ $param .= '&limit='.((int) $limit);
}
-$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
-$param .= '&type='.urlencode($type).'&view='.urlencode($view);
+$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
+$param .= '&type='.urlencode($type).'&view='.urlencode($view);
if (!empty($search_categ) && $search_categ != '-1') {
- $param .= '&search_categ='.urlencode($search_categ);
+ $param .= '&search_categ='.urlencode($search_categ);
}
if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
- $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
+ $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
}
if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
- $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
+ $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
}
if ($sall != '') {
- $param .= '&sall='.urlencode($sall);
+ $param .= '&sall='.urlencode($sall);
}
if ($search_id > 0) {
- $param .= "&search_id=".urlencode($search_id);
+ $param .= "&search_id=".urlencode($search_id);
}
if ($search_lastname != '') {
- $param .= '&search_lastname='.urlencode($search_lastname);
+ $param .= '&search_lastname='.urlencode($search_lastname);
}
if ($search_firstname != '') {
- $param .= '&search_firstname='.urlencode($search_firstname);
+ $param .= '&search_firstname='.urlencode($search_firstname);
}
if ($search_societe != '') {
- $param .= '&search_societe='.urlencode($search_societe);
+ $param .= '&search_societe='.urlencode($search_societe);
}
if ($search_address != '') {
- $param .= '&search_address='.urlencode($search_address);
+ $param .= '&search_address='.urlencode($search_address);
}
if ($search_zip != '') {
- $param .= '&search_zip='.urlencode($search_zip);
+ $param .= '&search_zip='.urlencode($search_zip);
}
if ($search_town != '') {
- $param .= '&search_town='.urlencode($search_town);
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_country != '') {
$param .= "&search_country=".urlencode($search_country);
}
if ($search_poste != '') {
- $param .= '&search_poste='.urlencode($search_poste);
+ $param .= '&search_poste='.urlencode($search_poste);
}
if ($search_phone_pro != '') {
- $param .= '&search_phone_pro='.urlencode($search_phone_pro);
+ $param .= '&search_phone_pro='.urlencode($search_phone_pro);
}
if ($search_phone_perso != '') {
- $param .= '&search_phone_perso='.urlencode($search_phone_perso);
+ $param .= '&search_phone_perso='.urlencode($search_phone_perso);
}
if ($search_phone_mobile != '') {
- $param .= '&search_phone_mobile='.urlencode($search_phone_mobile);
+ $param .= '&search_phone_mobile='.urlencode($search_phone_mobile);
}
if ($search_fax != '') {
- $param .= '&search_fax='.urlencode($search_fax);
+ $param .= '&search_fax='.urlencode($search_fax);
}
if ($search_email != '') {
- $param .= '&search_email='.urlencode($search_email);
+ $param .= '&search_email='.urlencode($search_email);
}
if ($search_no_email != '') {
- $param .= '&search_no_email='.urlencode($search_no_email);
+ $param .= '&search_no_email='.urlencode($search_no_email);
}
if ($search_status != '') {
- $param .= '&search_status='.urlencode($search_status);
+ $param .= '&search_status='.urlencode($search_status);
}
if ($search_priv == '0' || $search_priv == '1') {
- $param .= "&search_priv=".urlencode($search_priv);
+ $param .= "&search_priv=".urlencode($search_priv);
}
if ($search_stcomm != '') {
$param .= '&search_stcomm='.urlencode($search_stcomm);
@@ -843,7 +855,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
print '';
print ' | ';
}
-if (!empty($arrayfields['p.no_email']['checked'])) {
+if (!empty($arrayfields['unsubscribed']['checked'])) {
print '';
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
print ' | ';
@@ -965,8 +977,8 @@ if (!empty($arrayfields['p.fax']['checked'])) {
if (!empty($arrayfields['p.email']['checked'])) {
print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
}
-if (!empty($arrayfields['p.no_email']['checked'])) {
- print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
+if (!empty($arrayfields['unsubscribed']['checked'])) {
+ print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
@@ -1156,8 +1168,14 @@ while ($i < min($num, $limit)) {
}
}
// No EMail
- if (!empty($arrayfields['p.no_email']['checked'])) {
- print ''.yn($obj->no_email).' | ';
+ if (!empty($arrayfields['unsubscribed']['checked'])) {
+ print '';
+ if (empty($obj->email)) {
+ //print ''.$langs->trans("NoEmail").'';
+ } else {
+ print yn(($obj->unsubscribed > 0) ? 1 : 0);
+ }
+ print ' | ';
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index 60136fe0dc7..eeeccddd671 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -194,9 +194,10 @@ if ($id > 0) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index f30ff3ead4c..31405545dbb 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -505,8 +505,8 @@ if (empty($reshook)) {
$desc = $prod->description;
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
- if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
- $product_desc='';
+ if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
+ $product_desc = '';
}
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -1335,9 +1335,10 @@ if ($action == 'create') {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 793273c833f..fe8edd30ea4 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1729,85 +1729,77 @@ class Contrat extends CommonObject
}
}
- $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'";
- $sql .= ",price_ht='".price2num($price)."'";
- $sql .= ",subprice='".price2num($subprice)."'";
- $sql .= ",remise='".price2num($remise)."'";
- $sql .= ",remise_percent='".price2num($remise_percent)."'";
- $sql .= ",qty='".$qty."'";
- $sql .= ",tva_tx='".price2num($tvatx)."'";
- $sql .= ",localtax1_tx='".price2num($localtax1tx)."'";
- $sql .= ",localtax2_tx='".price2num($localtax2tx)."'";
- $sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'";
- $sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'";
- $sql .= ", total_ht='".price2num($total_ht)."'";
- $sql .= ", total_tva='".price2num($total_tva)."'";
- $sql .= ", total_localtax1='".price2num($total_localtax1)."'";
- $sql .= ", total_localtax2='".price2num($total_localtax2)."'";
- $sql .= ", total_ttc='".price2num($total_ttc)."'";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description = '".$this->db->escape($desc)."'";
+ $sql .= ",price_ht = ".((float) price2num($price));
+ $sql .= ",subprice = ".((float) price2num($subprice));
+ $sql .= ",remise = ".((float) price2num($remise));
+ $sql .= ",remise_percent = ".((float) price2num($remise_percent));
+ $sql .= ",qty = ".((float) $qty);
+ $sql .= ",tva_tx = ".((float) price2num($tvatx));
+ $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx));
+ $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx));
+ $sql .= ",localtax1_type='".$this->db->escape($localtax1_type);
+ $sql .= ",localtax2_type='".$this->db->escape($localtax2_type);
+ $sql .= ", total_ht = ".((float) price2num($total_ht));
+ $sql .= ", total_tva = ".((float) price2num($total_tva));
+ $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1));
+ $sql .= ", total_localtax2 = ".((float) price2num($total_localtax2));
+ $sql .= ", total_ttc = ".((float) price2num($total_ttc));
$sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null");
- $sql .= ", buy_price_ht='".price2num($pa_ht)."'";
+ $sql .= ", buy_price_ht = ".((float) price2num($pa_ht));
if ($date_start > 0) {
- $sql .= ",date_ouverture_prevue='".$this->db->idate($date_start)."'";
+ $sql .= ",date_ouverture_prevue = '".$this->db->idate($date_start)."'";
} else {
- $sql .= ",date_ouverture_prevue=null";
+ $sql .= ",date_ouverture_prevue = null";
}
if ($date_end > 0) {
- $sql .= ",date_fin_validite='".$this->db->idate($date_end)."'";
+ $sql .= ",date_fin_validite = '".$this->db->idate($date_end)."'";
} else {
- $sql .= ",date_fin_validite=null";
+ $sql .= ",date_fin_validite = null";
}
if ($date_debut_reel > 0) {
- $sql .= ",date_ouverture='".$this->db->idate($date_debut_reel)."'";
+ $sql .= ",date_ouverture = '".$this->db->idate($date_debut_reel)."'";
} else {
- $sql .= ",date_ouverture=null";
+ $sql .= ",date_ouverture = null";
}
if ($date_fin_reel > 0) {
- $sql .= ",date_cloture='".$this->db->idate($date_fin_reel)."'";
+ $sql .= ",date_cloture = '".$this->db->idate($date_fin_reel)."'";
} else {
- $sql .= ",date_cloture=null";
+ $sql .= ",date_cloture = null";
}
- $sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null");
+ $sql .= ", fk_unit = ".($fk_unit > 0 ? ((int) $fk_unit) : "null");
$sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
- $result = $this->update_statut($user);
- if ($result >= 0) {
- if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used
- $contractline = new ContratLigne($this->db);
- $contractline->fetch($rowid);
- $contractline->fetch_optionals();
+ if (is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used
+ $contractline = new ContratLigne($this->db);
+ $contractline->fetch($rowid);
- // We replace values in $contractline->array_options only for entries defined into $array_options
- foreach ($array_options as $key => $value) {
- $contractline->array_options[$key] = $array_options[$key];
- }
-
- $result = $contractline->insertExtraFields();
- if ($result < 0) {
- $this->error[] = $contractline->error;
- $error++;
- }
+ // We replace values in $contractline->array_options only for entries defined into $array_options
+ foreach ($array_options as $key => $value) {
+ $contractline->array_options[$key] = $array_options[$key];
}
- if (empty($error)) {
- // Call trigger
- $result = $this->call_trigger('LINECONTRACT_UPDATE', $user);
- if ($result < 0) {
- $this->db->rollback();
- return -3;
- }
- // End call triggers
-
- $this->db->commit();
- return 1;
+ $result = $contractline->insertExtraFields();
+ if ($result < 0) {
+ $this->error[] = $contractline->error;
+ $error++;
}
- } else {
- $this->db->rollback();
- dol_syslog(get_class($this)."::updateline Erreur -2");
- return -2;
+ }
+
+ if (empty($error)) {
+ // Call trigger
+ $result = $this->call_trigger('LINECONTRACT_UPDATE', $user);
+ if ($result < 0) {
+ $this->db->rollback();
+ return -3;
+ }
+ // End call triggers
+
+ $this->db->commit();
+ return 1;
}
} else {
$this->db->rollback();
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index 9b016e92b19..d053a9a4fa0 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -177,9 +177,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index c54823ee142..b4cf2fc1fbf 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -167,9 +167,10 @@ if ($object->id) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index 50f84a148a4..01378a65786 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -134,9 +134,10 @@ if ($id > 0 || !empty($ref)) {
if (!empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
+ $morehtmlref .= ' : '.$proj->getNomUrl(1);
+ if ($proj->title) {
+ $morehtmlref .= ' - '.$proj->title;
+ }
} else {
$morehtmlref .= '';
}
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index f46c1051c53..63b4b3f7fc6 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -218,8 +218,8 @@ if ($type == 'directory') {
$parameters = array('modulepart'=>$module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
- if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) {
- $automodules[]=$hookmanager->resArray['module'];
+ if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) {
+ $automodules[] = $hookmanager->resArray['module'];
}
// TODO change for multicompany sharing
diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php
index 52cc23faf8f..0b1106ca20a 100644
--- a/htdocs/core/ajax/row.php
+++ b/htdocs/core/ajax/row.php
@@ -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;
diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php
index 05ae866463f..46c4b38988e 100644
--- a/htdocs/core/bookmarks_page.php
+++ b/htdocs/core/bookmarks_page.php
@@ -20,7 +20,7 @@
/**
* \file htdocs/core/bookmarks_page.php
- * \brief File to return a page with the complete list of bookmarks (all search input fields)
+ * \brief File to return a page with the complete list of bookmarks
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
@@ -45,7 +45,7 @@ if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php
}
-$langs->load("main");
+$langs->loadLangs(array("bookmarks"));
$right = ($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right');
$left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
@@ -57,7 +57,7 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left');
$title = $langs->trans("Bookmarks");
-// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
+// URL http://mydolibarr/core/bookmarks_page?dol_use_jmobile=1 can be used for tests
$head = ''."\n";
$arrayofjs = array();
$arrayofcss = array();
@@ -69,44 +69,58 @@ print ''."\n";
print '';
//print ' ';
if ($totalnb) {
- $this->info_box_contents[][]=array(
+ $this->info_box_contents[][] = array(
'td' => 'center',
'text' => $stringtoshow
);
} else {
$this->info_box_contents[0][0] = array(
'td' => 'class="center opacitymedium"',
- 'text' => $stringtoshow . $langs->trans("BoxNoTicketLastXDays", $days)
+ 'text' => $stringtoshow.$langs->trans("BoxNoTicketLastXDays", $days)
);
}
} else {
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 3b98d3f3356..c7a5beae245 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -970,8 +970,8 @@ abstract class CommonInvoiceLine extends CommonObjectLine
public $date_end_fill; // If set to 1, when invoice is created from a template invoice, it will also auto set the field date_end at creation
public $buy_price_ht;
- public $buyprice; // For backward compatibility
- public $pa_ht; // For backward compatibility
+ public $buyprice; // For backward compatibility
+ public $pa_ht; // For backward compatibility
public $marge_tx;
public $marque_tx;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index c68cc9c7d84..91446f38070 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1851,7 +1851,7 @@ abstract class CommonObject
$result = false;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table;
- $sql .= " WHERE ".$field." = '".$key."'";
+ $sql .= " WHERE ".$field." = '".$this->db->escape($key)."'";
if (!empty($element)) {
$sql .= " AND entity IN (".getEntity($element).")";
} else {
diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php
index ad69982357c..f6edb58207c 100644
--- a/htdocs/core/class/defaultvalues.class.php
+++ b/htdocs/core/class/defaultvalues.class.php
@@ -88,7 +88,7 @@ class DefaultValues extends CommonObject
/**
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
- public $fields=array(
+ public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
'type' =>array('type'=>'varchar(10)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
@@ -145,8 +145,12 @@ class DefaultValues extends CommonObject
$this->db = $db;
- if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
- if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0;
+ if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
+ $this->fields['rowid']['visible'] = 0;
+ }
+ if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
+ $this->fields['entity']['enabled'] = 0;
+ }
// Unset fields that are disabled
foreach ($this->fields as $key => $val) {
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 68bba0e04b5..56f7c41994b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -193,12 +193,12 @@ class Form
* @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
- * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
+ * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of numeric value). Use '' to use same than $value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @param string $moreparam More param to add on the form action href URL
* @param int $notabletag Do no output table tags
- * @param string $formatfunc Call a specific function to output field
+ * @param string $formatfunc Call a specific function to output field in view mode (For example: 'dol_print_email')
* @param string $paramid Key of parameter for id ('id', 'socid')
* @return string HTML edit field
*/
@@ -214,7 +214,7 @@ class Form
}
// When option to edit inline is activated
- if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
+ if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select
$ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
} else {
$editmode = (GETPOST('action', 'aZ09') == 'edit'.$htmlname);
@@ -236,7 +236,7 @@ class Form
} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) {
$tmp = explode(':', $typeofdata);
$valuetoshow = price2num($editvalue ? $editvalue : $value);
- $ret .= '';
+ $ret .= '';
} elseif (preg_match('/^(checkbox)/', $typeofdata)) {
$tmp = explode(':', $typeofdata);
$ret .= '';
@@ -5088,8 +5088,7 @@ class Form
if ($selected) {
$projet = new Project($this->db);
$projet->fetch($selected);
- //print ''.$projet->title.'';
- $out .= $projet->getNomUrl(0, '', 1);
+ $out .= $projet->getNomUrl(1, '', 1);
} else {
$out .= " ";
}
@@ -8679,7 +8678,7 @@ class Form
*/
public function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '')
{
- global $langs, $conf, $hookmanager, $extralanguages;
+ global $conf, $langs, $hookmanager, $extralanguages;
$ret = '';
if (empty($fieldid)) {
@@ -8691,7 +8690,7 @@ class Form
// Preparing gender's display if there is one
$addgendertxt = '';
- if (!empty($object->gender)) {
+ if (property_exists($object, 'gender') && !empty($object->gender)) {
$addgendertxt = ' ';
switch ($object->gender) {
case 'man':
@@ -8705,6 +8704,15 @@ class Form
break;
}
}
+ /*
+ $addadmin = '';
+ if (property_exists($object, 'admin')) {
+ if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
+ $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
+ } elseif (!empty($object->admin)) {
+ $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
+ }
+ }*/
// Add where from hooks
if (is_object($hookmanager)) {
@@ -8837,7 +8845,7 @@ class Form
$ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : '');
}
} elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) {
- $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt;
+ $ret .= dol_htmlentities($object->getFullName($langs));
} elseif (in_array($object->element, array('action', 'agenda'))) {
$ret .= $object->ref.''; -$nbofsearch = 0; - // Instantiate hooks of thirdparty module $hookmanager->initHooks(array('bookmarks')); // Define $bookmarks -$bookmarks = ''; +$bookmarkList = ''; +$searchForm = ''; -$arrayresult = array(); -//include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; +if (empty($conf->bookmarks->enabled)) { + $langs->load("admin"); + $bookmarkList .= ' '.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).''; + $bookmarkList .= ' '; +} else { + // Menu with list of bookmarks + $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; + $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; + $sql .= " AND entity IN (".getEntity('bookmarks').")"; + $sql .= " ORDER BY position"; + if ($resql = $db->query($sql)) { + $bookmarkList = ' ';
+ $i = 0;
+ while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
+ $bookmarkList .= 'target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
+ $bookmarkList .= dol_escape_htmltag($obj->title);
+ $bookmarkList .= '';
+ $i++;
+ }
+ if ($i == 0) {
+ $bookmarkList .= ' ';
+
+
+ $searchForm .= '';
+ } else {
+ dol_print_error($db);
}
-
- //$bookmarks .= printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, $val['img'], $showtitlebefore, ($i > 0 ? 0 : 1));
-
- $i++;
}
-
-// Execute hook printSearchForm
-$parameters = array('bookmarks'=>$bookmarks);
+// Execute hook printBookmarks
+$parameters = array('bookmarks'=>$bookmarkList);
$reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
- $bookmarks .= $hookmanager->resPrint;
+ $bookmarkList .= $hookmanager->resPrint;
} else {
- $bookmarks = $hookmanager->resPrint;
+ $bookmarkList = $hookmanager->resPrint;
}
@@ -115,7 +129,7 @@ print "\n";
print ''.$langs->trans("NoBookmarks").''; + $bookmarkList .= ' '; -$i = 0; -$accesskeyalreadyassigned = array(); -foreach ($arrayresult as $key => $val) { - $tmp = explode('?', $val['url']); - $urlaction = $tmp[0]; - $keysearch = 'search_all'; + $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer)); - $accesskey = ''; - if (!$accesskeyalreadyassigned[$val['label'][0]]) { - $accesskey = $val['label'][0]; - $accesskeyalreadyassigned[$accesskey] = $accesskey; + $bookmarkList .= ' ';
print '';
print ''."\n";
print ' ' . $labelStatus . ' | ';
- $stringtoprint .= '' . price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency) . ' | ';
+ $stringtoprint .= ''.$labelStatus.' | ';
+ $stringtoprint .= ''.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).' | ';
$stringtoprint .= "'.$object->label; } elseif (in_array($object->element, array('adherent_type'))) { @@ -9085,7 +9093,7 @@ class Form } $ret .= '
';
$out .= $langs->trans("GroupEmails");
$out .= ' | ';
- $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
- $out .= $langs->trans("OneEmailPerRecipient");
- $out .= '';
+ $out .= ' withoptiononeemailperrecipient > 0 ? ' checked="checked"' : '').'> ';
+ $out .= '';
+ $out .= '';
$out .= ' - ';
$out .= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
$out .= '';
@@ -773,12 +773,11 @@ class FormMail extends Form
if (!empty($this->withmaindocfile)) {
if ($this->withmaindocfile == 1) {
- $out .= '';
+ $out .= '';
+ } elseif ($this->withmaindocfile == -1) {
+ $out .= '';
}
- if ($this->withmaindocfile == -1) {
- $out .= '';
- }
- $out .= ' '.$langs->trans("JoinMainDoc").'. | '; + $out .= ' '; } if (is_numeric($this->withfile)) { diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 34ea7b0a2e8..022bf55f243 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -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; } diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index b78ff5cfa8e..2773ece2569 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -104,6 +104,7 @@ class FormPropal print ''; } + $i = 0; foreach ($listofstatus as $key => $obj) { if ($excludedraft) { if ($obj['code'] == 'Draft' || $obj['code'] == 'PR_DRAFT') { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b9f320b7db8..7e2154ee309 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1,17 +1,18 @@ - * Copyright (C) 2016 Christophe Battarel ';
- print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
- print ' | ';
+ print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
+ print ' | | ';
// Warehouse
print ''; print ' | '; + // Stock if ($conf->stock->enabled) { print ''; if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { print img_warning($langs->trans('StockTooLow')).' '; } - print $tmpproduct->stock_reel; // Available + print price2num($tmpproduct->stock_reel, 'MS'); // Available print ' | '; } + // Lot if ($conf->productbatch->enabled) { - print ''; // Lot + print ' | '; } + // Action delete line if ($permissiontodelete) { - $href = $_SERVER["PHP_SELF"]; - $href .= '?id='.$object->id; - $href .= '&action=deleteline'; - $href .= '&lineid='.$line->id; + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id); print ' | '; - print ''; - print img_picto('', "delete"); + print ''; + print img_picto('', 'delete'); print ''; print ' | '; } @@ -911,16 +919,26 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show detailed of already consumed with js code to collapse foreach ($arrayoflines as $line2) { print ''; + + // Cost if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { print ' | '; } + + // Already consumed print ' | '; + + // Warehouse print ' | '; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (empty($line->disable_stock_change)) { @@ -970,10 +1007,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { print ''.$langs->trans("NoStockChangeOnServices").''; } - // Lot / Batch print ' | '; + + // Stock + if ($conf->stock->enabled) { + print ''; + } + + // Lot / Batch if ($conf->productbatch->enabled) { - print ' | '; + print ' | aaa'; if ($tmpproduct->status_batch) { $preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : ''); print ''; @@ -981,6 +1024,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ' | '; } + + // Action delete line + if ($permissiontodelete) { + print ''; + } + print ''; } } @@ -1003,13 +1052,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $nblinetoproduce++; } } - $newlinetext = ''; - if ($object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall') { - if ($nblinetoproduce == 0 || $object->mrptype == 1) { - $newlinetext = 'id.'&action=addproduceline&token='.newToken().'">'.$langs->trans("AddNewProduceLines").''; - } + + $newcardbutton = ''; + $url = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=addproduceline&token='.newToken(); + $permissiontoaddaproductline = $object->status != $object::STATUS_PRODUCED && $object->status != $object::STATUS_CANCELED && $action != 'consumeorproduce' && $action != 'consumeandproduceall'; + $parameters = array('morecss'=>'reposition'); + if ($nblinetoproduce == 0 || $object->mrptype == 1) { + $newcardbutton = dolGetButtonTitle($langs->trans('AddNewProduceLines'), '', 'fa fa-plus-circle size15x', $url, '', $permissiontoaddaproductline, $parameters); } - print load_fiche_titre($langs->trans('Production'), '', '', 0, '', '', $newlinetext); + + print load_fiche_titre($langs->trans('Production'), $newcardbutton, '', 0, '', ''); print ' |
| '; - print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); + print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 1, array(), 0, '1', 0, 'maxwidth300'); print ' | '; // Qty print ''; @@ -1052,10 +1104,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ' | '; // Qty already produced - print ' | '; + print ' | '; // Warehouse - print ' | '; print ''; + print ''; print ' | '; // Lot - serial if ($conf->productbatch->enabled) { @@ -1155,7 +1207,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $href .= '&action=deleteline'; $href .= '&lineid='.$line->id; print ''; - print ''; + print ''; print img_picto('', "delete"); print ''; print ' | '; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index dee6476f773..16e728512f6 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -282,7 +282,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $_SESSION["FinalPaymentAmt"] = $paymentAmount; $_SESSION["currencyCodeType"] = $currencyCodeType; $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole' - $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip + $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 9ba8d9cec09..84562bf95a4 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -144,7 +144,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price level (from 1 to 6) $sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price "; - $sql .= " WHERE fk_product = '".$id."'"; + $sql .= " WHERE fk_product = ".((int) $id); $sql .= " AND entity IN (".getEntity('productprice').")"; $sql .= " AND price_level = ".((int) $price_level); $sql .= " ORDER BY date_price"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 79418b83c43..b14d4a4efca 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1922,11 +1922,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '|
| '.$langs->trans("CountryOrigin").' | '; print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } print ' | ||||||