diff --git a/ChangeLog b/ChangeLog
index 3f5fad835f7..1c0e96fc27c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@ For users:
NEW: Online proposal signature
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
+NEW: Add option to disable globaly some notifications emails.
NEW: #18326 Workflow: Close order on shipment closing.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
NEW: #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment
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/card.php b/htdocs/adherents/card.php
index cf0d82b2c7b..5b53437a212 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1788,13 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
| '.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' | |||
| '.$langs->trans("Public").' | '.yn($object->public).' | |||
| '.$langs->trans("Categories").' | '; print ''; @@ -1802,6 +1796,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ' | |||
| '.$langs->trans("DateOfBirth").' | '.dol_print_date($object->birth, 'day').' | |||
| '.$langs->trans("Public").' | '.yn($object->public).' | |||
| '.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").' | '."\n"; print ''."\n"; print ' | '."\n"; -$defval='na'; +$defval = 'na'; $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) { - $defval=reset($result)->value; +} elseif (count($result) > 0) { + $defval = reset($result)->value; } $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200'); print ' | ||
| '.$langs->trans("LDAPUserDn").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPUserDnExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPUserObjectClassList").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPUserObjectClassListExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFilterConnection").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFilterConnectionExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldFullname").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldFullnameExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FULLNAME) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldName").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldNameExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_NAME) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldFirstName").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldFirstNameExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FIRSTNAME) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldLoginUnix").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldLoginExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldLoginSamba").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldLoginSambaExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN_SAMBA) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldPasswordNotCrypted").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldPasswordCrypted").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldMail").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldMailExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_MAIL) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldPhone").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldPhoneExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_PHONE) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldMobile").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldMobileExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_MOBILE) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldSkype").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldSkypeExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SKYPE) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldFax").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldFaxExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_FAX) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldCompany").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldCompanyExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldAddress").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldAddressExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldZip").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldZipExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldTown").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldTownExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldCountry").' | '; -print ''; +print ''; print ' | '; print ' | '; print ' | |
| '.$langs->trans("LDAPFieldTitle").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldTitleExample").' | '; print ''; print ' | |
| '.$langs->trans("Note").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldDescriptionExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldSid").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldSidExample").' | '; -print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) ? ' checked' : '')."> | "; +print '"; print ' |
| '.$langs->trans("LDAPFieldGroupid").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldGroupidExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldUserid").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldUseridExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldHomedirectory").' | '; -print ''; +print ''; print ' | '.$langs->trans("LDAPFieldHomedirectoryExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldHomedirectoryprefix").' | '; -print ''; +print ''; print ' | '; print ' | '; print ' | |
| '; +print $langs->trans("NotificationDisableConfirmMessageUser").' | '; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER); +} +print ' | '; +print '|||
| '; +print $langs->trans("NotificationDisableConfirmMessageFix").' | '; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX); +} +print ' | '; +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/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php index 03209ad7673..0a979e01d39 100644 --- a/htdocs/compta/bank/account_statement_document.php +++ b/htdocs/compta/bank/account_statement_document.php @@ -120,6 +120,8 @@ if (GETPOST("rel") == 'prev') { $found = true; } +$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php + /* * Actions 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
*/
@@ -4093,6 +4102,8 @@ if ($action == 'create') {
$i++;
$close[$i]['code'] = 'badcustomer';
$i++;
+ $close[$i]['code'] = 'bankcharge';
+ $i++;
$close[$i]['code'] = 'other';
$i++;
// Help
@@ -4101,6 +4112,8 @@ if ($action == 'create') {
$i++;
$close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");
$i++;
+ $close[$i]['label'] = $langs->trans("ConfirmClassifyPaidPartiallyReasonBankChargeDesc");
+ $i++;
$close[$i]['label'] = $langs->trans("Other");
$i++;
// Texte
@@ -4109,6 +4122,8 @@ if ($action == 'create') {
$i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
$i++;
+ $close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBankCharge", $resteapayer, $langs->trans("Currency".$conf->currency)), $close[$i]['label'], 1);
+ $i++;
$close[$i]['reason'] = $form->textwithpicto($langs->transnoentities("Other"), $close[$i]['label'], 1);
$i++;
// arrayreasons[code]=reason
@@ -4243,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 1fbfdfa296a..66800c4d449 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -78,6 +78,8 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges');
+$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
@@ -125,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/compta/tva/document.php b/htdocs/compta/tva/document.php
index e2f0dcec96d..67de87d0c21 100644
--- a/htdocs/compta/tva/document.php
+++ b/htdocs/compta/tva/document.php
@@ -79,6 +79,8 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
+$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
@@ -86,7 +88,7 @@ $result = restrictedArea($user, 'tax', '', 'tva', 'charges');
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
-if ($action == 'setlib' && $user->rights->tax->charges->creer) {
+if ($action == 'setlib' && $permissiontoadd) {
$object->fetch($id);
$result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY');
if ($result < 0) {
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/document.php b/htdocs/contact/document.php
index 3005c6b7827..1870e7b8d9c 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -49,12 +49,6 @@ if (!empty($canvas)) {
$objcanvas->getCanvas('contact', 'contactcard', $canvas);
}
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -91,6 +85,15 @@ $modulepart = 'contact';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contactdocument'));
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
+
+$permissiontoadd = $user->rights->societe->contact->creer; // Used by the include of actions_dellink.inc.php
+
+
/*
* Actions
*/
diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php
index 8babb849e7e..d29aab0386b 100644
--- a/htdocs/contact/ldap.php
+++ b/htdocs/contact/ldap.php
@@ -182,7 +182,6 @@ if ($result > 0) {
}
$ldap->unbind();
- $ldap->close();
} else {
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index e005d6cfb1e..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) {
@@ -1019,6 +1031,7 @@ 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 690b5432a1b..b4cf2fc1fbf 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -84,6 +84,8 @@ $modulepart = 'contract';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard', 'globalcard'));
+$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php
+
/*
* Actions
@@ -165,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/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php
index ad9ca441e8a..86d4e923131 100644
--- a/htdocs/core/actions_linkedfiles.inc.php
+++ b/htdocs/core/actions_linkedfiles.inc.php
@@ -36,8 +36,19 @@ if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) {
die;
}
+if ((GETPOST('sendit', 'alpha')
+ || GETPOST('linkit', 'restricthtml')
+ || ($action == 'confirm_deletefile' && $confirm == 'yes')
+ || ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
+ || ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
+ dol_syslog('The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.');
+ print 'The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.';
+ die;
+}
+
+
// Submit file/link
-if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) {
+if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
if (!empty($_FILES)) {
if (is_array($_FILES['userfile']['tmp_name'])) {
$userfiles = $_FILES['userfile']['tmp_name'];
@@ -75,7 +86,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
}
}
}
-} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && !empty($permissiontoadd)) {
$link = GETPOST('link', 'alpha');
if ($link) {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') {
@@ -87,7 +98,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!is
// Delete file/link
-if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) {
+if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissiontoadd)) {
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) {
// For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
@@ -158,7 +169,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
exit;
}
}
-} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && !empty($permissiontoadd)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$langs->load('link');
$link = new Link($db);
@@ -176,7 +187,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiont
} else {
//error fetching
}
-} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) {
+} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && !empty($permissiontoadd)) {
// For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
if (!empty($upload_dir)) {
$filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 2a42d4a3d00..63b4b3f7fc6 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -205,19 +205,21 @@ if ($type == 'directory') {
'product',
'tax',
'project',
+ 'project_task',
'fichinter',
'user',
'expensereport',
'holiday',
'recruitment-recruitmentcandidature',
'banque',
+ 'chequereceipt',
'mrp-mo'
);
$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
@@ -243,6 +245,8 @@ if ($type == 'directory') {
$upload_dir = $conf->tax->dir_output;
} elseif ($module == 'project') {
$upload_dir = $conf->projet->dir_output;
+ } elseif ($module == 'project_task') {
+ $upload_dir = $conf->projet->dir_output;
} elseif ($module == 'fichinter') {
$upload_dir = $conf->ficheinter->dir_output;
} elseif ($module == 'user') {
@@ -255,8 +259,10 @@ if ($type == 'directory') {
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
} elseif ($module == 'banque') {
$upload_dir = $conf->bank->dir_output;
+ } elseif ($module == 'chequereceipt') {
+ $upload_dir = $conf->bank->dir_output.'/checkdeposits';
} elseif ($module == 'mrp-mo') {
- $upload_dir = $conf->mrp->dir_output.'/mo';
+ $upload_dir = $conf->mrp->dir_output;
} else {
$parameters = array('modulepart'=>$module);
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
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
new file mode 100644
index 00000000000..46c4b38988e
--- /dev/null
+++ b/htdocs/core/bookmarks_page.php
@@ -0,0 +1,140 @@
+
+ *
+ * This file is a modified version of datepicker.php from phpBSM to fix some
+ * bugs, to add new features and to dramatically increase speed.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see ';
+//print ' ';
+print ''; + +// Instantiate hooks of thirdparty module +$hookmanager->initHooks(array('bookmarks')); + +// Define $bookmarks +$bookmarkList = ''; +$searchForm = ''; + + +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);
+ }
+}
+
+// Execute hook printBookmarks
+$parameters = array('bookmarks'=>$bookmarkList);
+$reshook = $hookmanager->executeHooks('printBookmarks', $parameters); // Note that $action and $object may have been modified by some hooks
+if (empty($reshook)) {
+ $bookmarkList .= $hookmanager->resPrint;
+} else {
+ $bookmarkList = $hookmanager->resPrint;
+}
+
+
+print "\n";
+print "\n";
+print ''.$langs->trans("NoBookmarks").''; + $bookmarkList .= ' '; + + $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer)); + + $bookmarkList .= ' ';
+print '';
+print ''."\n";
+print ' |