diff --git a/ChangeLog b/ChangeLog
index f439186f5ca..35696c2fd0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,7 @@ English Dolibarr ChangeLog
For users:
----------
-NEW: Module Recruitement to follow application to job positions is now stable.
+NEW: Module Recruitment to follow application to job positions is now stable.
NEW: Feature to make Stock Inventories
NEW: Several security issues after a second private bug hunting campaign.
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
@@ -50,7 +50,7 @@ NEW: Make public bookmarks editable by admin users only
NEW: If main logo not defined, can use the squarred logo on login page
NEW: The manifest file can use the squared image if available
NEW: Enhance the multicurrency rate editor
-NEW: Normalyse Type company field with ajax combobox
+NEW: Normalise Type company field with ajax combobox
NEW: preload product description on selection for customer propal/order/invoice
NEW: Search usergroups & resources
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
@@ -67,14 +67,15 @@ NEW: #16378 more E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
Accountancy
-NEW: Accountancy - Add FEC import
-NEW: Accountancy - Add a confirmation form with options on export
-NEW: Accountancy - Add select date from/to in already bind customer and supplier list
-NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
-NEW: Accountancy - In ledger & journals, show link on bank transaction
-NEW: Accountancy - Possibility to filter on journals in balance
-NEW: Accountancy - Add a page to list subledger accounts
-NEW: Multiselect ledger account code filter on book keeping list
+NEW: Add FEC import
+NEW: Add a confirmation form with options on export (for notified export and validate operations)
+NEW: Add select date from/to in already bind customer and supplier list
+NEW: FEC / FEC2 export - Add new field DateLimitReglmt
+NEW: In ledger & journals, show link on bank transaction
+NEW: Possibility to filter on journals in balance
+NEW: Add a page to list subledger accounts
+NEW: Multiselect journal code filter on journal / balance / ledger
+NEW: Add first step to close fiscal year
Agenda
NEW: add support for Friday as a non working day
@@ -93,7 +94,7 @@ NEW: can filter files in ECM/GED on status Shared / Not shared
NEW: add a check to avoid an invoice date in the future
NEW: add the total of margin in invoice list
NEW: can set a percentage when creating an invoice from another object
-NEW: Support down payment on supplier invoice (& somes ajustments)
+NEW: Support down payment on supplier invoice (& some adjustments)
Margin
NEW: add the total of margin in invoice list
@@ -162,7 +163,7 @@ NEW: Add a security center page with all information and advices related to the
NEW: Add a performance center page with all information and advices related to the performance of your instance
Modules
-NEW: Module Recruitement is now stable
+NEW: Module Recruitment is now stable
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
@@ -171,11 +172,14 @@ NEW: Check update availability for externals modules using a button on module pa
Module SimplePOS is deprecated - TakePOS is recommended for the future
new Options
-NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
-NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
-NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
-NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
-NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
+NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
+NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
+NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
+NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
+NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
+NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card
+NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities
+NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities
For developers:
@@ -209,7 +213,7 @@ NEW: hook printFieldListTitle for cabyprodserv.php
NEW: hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: add form confirm hook on company card
-NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
+NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files
WARNING:
@@ -219,12 +223,12 @@ Following changes may create regressions for some external modules, but were nec
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
-* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
+* Field "tva" renamed into "total_tva" for llx_facture, table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
-* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
+* removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index 98320613bfc..f8c0c95d3c1 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -91,7 +91,6 @@ if ($action == 'update') {
if (!$error) {
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
- var_dump($constname);
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 4c7194b2255..c156a388735 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -637,6 +637,8 @@ if ($action == 'create') {
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
+ } else {
+ print_liste_field_titre("");
}
print "\n";
@@ -683,8 +685,8 @@ if ($action == 'create') {
print '
'.price($line->debit).'
';
print '
'.price($line->credit).'
';
- if (empty($line->date_export) || empty($line->date_validation)) {
- print '
';
- if (empty($line->date_export)) {
+ if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
- print ''.img_edit().'';
+ print '' . img_edit() . '';
}
+ }
+ if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
- print ' '.img_delete().'';
+ print ''.img_delete().'';
}
}
print '
';
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 6bd39f4e227..aeaa42154d8 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -1506,6 +1506,7 @@ class BookKeeping extends CommonObject
$sql = "DELETE";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE piece_num = ".(int) $piecenum;
+ $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
$sql .= " AND entity IN (".getEntity('accountancy').")";
$resql = $this->db->query($sql);
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 1c93b247dfc..68430a71bab 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -176,7 +176,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index d3d84cb3624..7146e89648e 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
-$parameters = array('socid'=>$socid);
+$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -496,7 +496,7 @@ while ($i < min($num, $limit)) {
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
- $adherent->typeid = $obj->type;
+ $adherent->typeid = $obj->fk_type;
$adherent->datefin = $db->jdate($obj->datef);
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 033592a9afc..10560d38648 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
+$sall = GETPOST("sall", "alpha");
+$filter = GETPOST("filter", 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_email = GETPOST('search_email', 'alpha');
diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php
index 7435fc440ed..6c8f273ae77 100644
--- a/htdocs/adherents/type_translation.php
+++ b/htdocs/adherents/type_translation.php
@@ -157,7 +157,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db);
$head = member_type_prepare_head($object);
-$titre = $langs->trans("MemberType".$object->type);
+$titre = $langs->trans("MemberType".$object->id);
// Calculate $cnt_trans
$cnt_trans = 0;
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index d5873e2a50e..cee63fd91fd 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -52,22 +52,22 @@ if ($cancel) {
}
if ($action == 'update') {
- dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID2_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID3_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID4_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (!empty($conf->projet->enabled)) {
if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') {
@@ -82,20 +82,20 @@ if ($action == 'update') {
}
}
- dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DESC')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_REF')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE')) dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('SHOW_SUBPRODUCT_REF_IN_PDF')) dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php
index 032a23a68c8..79690032901 100644
--- a/htdocs/admin/system/security.php
+++ b/htdocs/admin/system/security.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("install", "other", "admin"));
+$langs->loadLangs(array("install", "other", "admin", "errors"));
if (!$user->admin) {
accessforbidden();
@@ -198,6 +198,7 @@ if (empty($fileswithwritepermission)) {
}
}
print ' ';
+print ' ';
print ''.$langs->trans("PermissionsOnFile", $conffile).': '; // $conffile is defined into filefunc.inc.php
$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
@@ -219,6 +220,16 @@ if ($perms) {
print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
}
print ' ';
+print ' ';
+
+$installlock = DOL_DATA_ROOT.'/install.lock';
+print ''.$langs->trans("DolibarrSetup").': ';
+if (file_exists($installlock)) {
+ print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
+} else {
+ print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
+}
+print ' ';
// File conf.php
diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php
index 76f16c838be..2cd7492395d 100644
--- a/htdocs/bom/bom_list.php
+++ b/htdocs/bom/bom_list.php
@@ -297,7 +297,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
- $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : '');
}
}
// Add fields from hooks
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index e5d4de26278..8d70f7c3042 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -1547,7 +1547,7 @@ if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm ==
$parameters['toselect'] = $toselect;
$parameters['uploaddir'] = $uploaddir;
$parameters['massaction'] = $massaction;
-$parameters['diroutputmassaction'] = $diroutputmassaction;
+$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 83a823edeb2..e5c75a2e7c3 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -182,10 +182,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$tmparray = array();
if (trim($_POST['sendto'])) {
- // Recipients are provided into free text
+ // Recipients are provided into free text field
$tmparray[] = trim($_POST['sendto']);
}
+ if (trim($_POST['tomail'])) {
+ // Recipients are provided into free hidden text field
+ $tmparray[] = trim($_POST['tomail']);
+ }
+
if (count($receiver) > 0) {
// Recipient was provided from combo list
foreach ($receiver as $key => $val) {
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 5683c8e6a07..33db393bbc6 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -1628,7 +1628,7 @@ class CMailFile
* @return array array of email => name
* @see getValidAddress()
*/
- public function getArrayAddress($address)
+ public static function getArrayAddress($address)
{
global $conf;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index ceac7015065..36df3b1a7b9 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -3791,7 +3791,6 @@ abstract class CommonObject
} elseif ($objecttype == 'contact') {
$module = 'societe';
}
-
// Set classfile
$classfile = strtolower($subelement);
$classname = ucfirst($subelement);
@@ -3823,6 +3822,11 @@ abstract class CommonObject
$classfile = 'conferenceorboothattendee';
$classname = 'ConferenceOrBoothAttendee';
$module = 'eventorganization';
+ } elseif ($objecttype == 'conferenceorbooth') {
+ $classpath = 'eventorganization/class';
+ $classfile = 'conferenceorbooth';
+ $classname = 'ConferenceOrBooth';
+ $module = 'eventorganization';
}
// Here $module, $classfile and $classname are set
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 5e24ee03fa4..45643e26e4c 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -193,6 +193,7 @@ class HookManager
'getFormatedSupplierRef',
'getIdProfUrl',
'getInputIdProf',
+ 'menuLeftMenuItems',
'moveUploadedFile',
'moreHtmlStatus',
'pdf_build_address',
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a6280a7c9f5..54e5b19b25c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6975,13 +6975,15 @@ class Form
// Search data
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t";
- if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
- $tmparray = explode('@', $objecttmp->ismultientitymanaged);
- $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
- }
- if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
- if (!$user->rights->societe->client->voir && !$user->socid) {
- $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ if (isset($objecttmp->ismultientitymanaged)) {
+ if (!is_numeric($objecttmp->ismultientitymanaged)) {
+ $tmparray = explode('@', $objecttmp->ismultientitymanaged);
+ $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
+ }
+ if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
+ if (!$user->rights->societe->client->voir && !$user->socid) {
+ $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ }
}
}
@@ -6992,27 +6994,29 @@ class Form
$sql .= $hookmanager->resPrint;
} else {
$sql .= " WHERE 1=1";
- if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) {
- $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
- }
- if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
- $sql .= ' AND parenttable.entity = t.'.$tmparray[0];
- }
- if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
- if ($objecttmp->element == 'societe') {
- $sql .= " AND t.rowid = ".$user->socid;
- } else {
- $sql .= " AND t.fk_soc = ".$user->socid;
+ if (isset($objecttmp->ismultientitymanaged)) {
+ if ($objecttmp->ismultientitymanaged == 1) {
+ $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
+ }
+ if (!is_numeric($objecttmp->ismultientitymanaged)) {
+ $sql .= ' AND parenttable.entity = t.'.$tmparray[0];
+ }
+ if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
+ if ($objecttmp->element == 'societe') {
+ $sql .= " AND t.rowid = ".$user->socid;
+ } else {
+ $sql .= " AND t.fk_soc = ".$user->socid;
+ }
+ }
+ if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
+ if (!$user->rights->societe->client->voir && !$user->socid) {
+ $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
+ }
}
}
if ($searchkey != '') {
$sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
}
- if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
- if (!$user->rights->societe->client->voir && !$user->socid) {
- $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
- }
- }
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
/*if (! DolibarrApi::_checkFilters($objecttmp->filter))
{
@@ -7849,6 +7853,10 @@ class Form
$tplpath = 'expensereport';
} elseif ($objecttype == 'subscription') {
$tplpath = 'adherents';
+ } elseif ($objecttype == 'conferenceorbooth') {
+ $tplpath = 'eventorganization';
+ } elseif ($objecttype == 'conferenceorboothattendee') {
+ $tplpath = 'eventorganization';
}
global $linkedObjectBlock;
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 110d80b45d1..2b8a2d15aff 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1182,7 +1182,7 @@ class FormFile
);
$reshook = $hookmanager->executeHooks('showFilesList', $parameters, $object);
- if (isset($reshook) && $reshook != '') { // null or '' for bypass
+ if (!empty($reshook)) { // null or '' for bypass
return $reshook;
} else {
if (!is_object($form)) {
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 06b6a18b870..9da814f3369 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1255,7 +1255,7 @@ class FormMail extends Form
*/
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
{
- global $conf;
+ global $conf, $langs;
$ret = new ModelMail();
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 991e3cb37cc..5f00ed6877b 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -63,7 +63,7 @@ class FormOther
* @param string $jstoexecuteonadd Name of javascript function to call
* @return string HTML component
*/
- public function getHTMLScannerForm($jstoexecuteonadd = 'barcodscannerjs')
+ public function getHTMLScannerForm($jstoexecuteonadd = 'barcodescannerjs')
{
global $langs;
@@ -73,9 +73,9 @@ class FormOther
$out .= '
';
$out .= '
Barcode scanner tool...
';
- $out .= ' Autodetect if we scan a product barcode or a lot/serial barcode ';
- $out .= ' Scan a product barcode ';
- $out .= ' Scan a product lot or serial number ';
+ $out .= ' Autodetect if we scan a product barcode or a lot/serial barcode ';
+ $out .= ' Scan a product barcode ';
+ $out .= ' Scan a product lot or serial number ';
$out .= $langs->trans("QtyToAddAfterBarcodeScan").' ';
$out .= '';
@@ -88,13 +88,16 @@ class FormOther
*/
$out .= ' ';
$out .= '
';
- $out .= '';
+ $out .= '';
$out .= '';
$out .= ' ';
- $out .= ''.$langs->trans("FeatureNotYetAvailable").'';
-
- // TODO Add call of javascript $jstoexecuteonadd so each scan will add qty into the inventory page + an ajax save.
+ $out .= '';
$out .= '
';
$out .= '
';
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 6b32799bc89..2e0a71460ba 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -65,7 +65,7 @@ class Notify
// Les codes actions sont definis dans la table llx_notify_def
// codes actions supported are
- // @todo defined also into interface_50_modNotificiation_Notificiation.class.php
+ // @todo defined also into interface_50_modNotification_Notification.class.php
public $arrayofnotifsupported = array(
'BILL_VALIDATE',
'BILL_PAYED',
@@ -80,8 +80,8 @@ class Notify
'SHIPPING_VALIDATE',
'EXPENSE_REPORT_VALIDATE',
'EXPENSE_REPORT_APPROVE',
- 'HOLIDAY_VALIDATE',
- 'HOLIDAY_APPROVE',
+ 'HOLIDAY_VALIDATE',
+ 'HOLIDAY_APPROVE',
'ACTION_CREATE'
);
@@ -546,7 +546,7 @@ class Notify
$object_type = 'holiday';
$labeltouse = $conf->global->HOLIDAY_APPROVE_TEMPLATE;
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
- break;
+ break;
case 'ACTION_CREATE':
$link = ''.$newref.'';
$dir_output = $conf->agenda->dir_output;
@@ -567,10 +567,10 @@ class Notify
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
$message = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
} else {
- $message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n";
- $message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
- $message .= "\n";
- $message .= $mesg;
+ $message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n";
+ $message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
+ $message .= "\n";
+ $message .= $mesg;
}
$ref = dol_sanitizeFileName($newref);
@@ -687,7 +687,7 @@ class Notify
break;
case 'BILL_PAYED':
$link = ''.$newref.'';
- $dir_output = $$conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
+ $dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
break;
@@ -782,7 +782,7 @@ class Notify
$dir_output = $conf->holiday->dir_output;
$object_type = 'holiday';
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
- break;
+ break;
case 'ACTION_CREATE':
$link = ''.$newref.'';
$dir_output = $conf->agenda->dir_output;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 598802ea574..d64069aa923 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -98,7 +98,7 @@ function dol_decode($chain, $key = '1')
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
*
* @param string $chain String to hash
- * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
+ * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return string Hash of string
* @see getRandomPassword()
*/
@@ -124,8 +124,10 @@ function dol_hash($chain, $type = '0')
return md5($chain);
} elseif ($type == '4' || $type == 'md5openldap') {
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
- } elseif ($type == '5') {
+ } elseif ($type == '5' || $type == 'sha256') {
return hash('sha256', $chain);
+ } elseif ($type == '6' || $type == 'password_hash') {
+ return password_hash($chain, PASSWORD_DEFAULT);
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') {
return sha1($chain);
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') {
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 25f46e6232a..bcf51c61db9 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -690,7 +690,8 @@ function print_end_menu_array()
*/
function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0)
{
- global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc;
+
+ global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc, $hookmanager;
//var_dump($tabMenu);
@@ -1738,11 +1739,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$titleboth = $langs->trans("LeadsOrProjects");
$titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default
- if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
+ if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
$titleboth = $langs->trans("Projects");
$titlenew = $langs->trans("NewProject");
}
- if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
+ if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
$titleboth = $langs->trans("Leads");
$titlenew = $langs->trans("NewLead");
}
@@ -1751,13 +1752,13 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"'));
$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer);
- if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
+ if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list');
- } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
+ } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list');
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode);
- } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
+ } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
$newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
}
@@ -1964,6 +1965,28 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
return 0;
}
+ // Allow the $menu_array of the menu to be manipulated by modules
+ $parameters = array(
+ 'mainmenu' => $mainmenu,
+ );
+ $hook_items = $menu_array;
+ $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks
+
+ if (is_numeric($reshook)) {
+ if ($reshook == 0 && !empty($hookmanager->results)) {
+ $menu_array[] = $hookmanager->results; // add
+ } elseif ($reshook == 1) {
+ $menu_array = $hookmanager->results; // replace
+ }
+
+ // @todo Sort menu items by 'position' value
+ // $position = array();
+ // foreach ($menu_array as $key => $row) {
+ // $position[$key] = $row['position'];
+ // }
+ // array_multisort($position, SORT_ASC, $menu_array);
+ }
+
// TODO Use the position property in menu_array to reorder the $menu_array
//var_dump($menu_array);
/*$new_menu_array = array();
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index 475c8fc5996..bb044900acd 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -273,7 +273,7 @@ class modFacture extends DolibarrModules
$this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
- 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
+ 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
'none.rest'=>"NumericCompute",
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index c9379fb25d6..3494cb684dc 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2012 Juanjo Menent
+ * Copyright (C) 2021 Ferran Marcet
*
* 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
@@ -148,19 +149,19 @@ class modStock extends DolibarrModules
$this->rights[4][4] = 'mouvement';
$this->rights[4][5] = 'creer';
+ $this->rights[5][0] = 1011;
+ $this->rights[5][1] = 'inventoryReadPermission'; // Permission label
+ $this->rights[5][3] = 0; // Permission by default for new user (0/1)
+ $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+ $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+
+ $this->rights[6][0] = 1012;
+ $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
+ $this->rights[6][3] = 0; // Permission by default for new user (0/1)
+ $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+ $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
+
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
- $this->rights[5][0] = 1011;
- $this->rights[5][1] = 'inventoryReadPermission'; // Permission label
- $this->rights[5][3] = 0; // Permission by default for new user (0/1)
- $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
- $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
-
- $this->rights[6][0] = 1012;
- $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
- $this->rights[6][3] = 0; // Permission by default for new user (0/1)
- $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
- $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
-
$this->rights[8][0] = 1014;
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
$this->rights[8][3] = 0; // Permission by default for new user (0/1)
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index 705c89be80f..78bcb9901af 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -122,8 +122,18 @@ class modTicket extends DolibarrModules
}
$this->dictionaries = array(
'langs' => 'ticket',
- 'tabname' => array(MAIN_DB_PREFIX."c_ticket_type", MAIN_DB_PREFIX."c_ticket_severity", MAIN_DB_PREFIX."c_ticket_category", MAIN_DB_PREFIX."c_ticket_resolution"),
- 'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"),
+ 'tabname' => array(
+ MAIN_DB_PREFIX."c_ticket_type",
+ MAIN_DB_PREFIX."c_ticket_severity",
+ MAIN_DB_PREFIX."c_ticket_category",
+ MAIN_DB_PREFIX."c_ticket_resolution"
+ ),
+ 'tablib' => array(
+ "TicketDictType",
+ "TicketDictSeverity",
+ "TicketDictCategory",
+ "TicketDictResolution"
+ ),
'tabsql' => array(
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f',
@@ -135,7 +145,7 @@ class modTicket extends DolibarrModules
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
- 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
+ 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)),
'tabhelp' => array(
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 566c7f07a2e..638ab70bb84 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -524,8 +524,8 @@ class doc_generic_task_odt extends ModelePDFTask
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->projet->dir_temp);
- if (!is_writable($conf->task->dir_temp)) {
- $this->error = "Failed to write in temp directory ".$conf->task->dir_temp;
+ if (!is_writable($conf->projet->dir_temp)) {
+ $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index c741fb213c2..143d8d5536c 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -137,6 +137,13 @@ if ($action == 'presend') {
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
+ if ($object->element === 'order_supplier' && !empty($conf->global->ORDER_SUPPLIER_EMAIL_SENDER)) {
+ $formmail->frommail = $conf->global->ORDER_SUPPLIER_EMAIL_SENDER;
+ $formmail->fromname = '';
+ $formmail->fromtype = 'special';
+ }
+
+
$formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set
diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php
index 5915fb8a633..6d6b6aa8836 100644
--- a/htdocs/core/tpl/extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/extrafields_edit.tpl.php
@@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
print $hookmanager->resPrint;
if (empty($reshook)) {
$params = array();
- $params['cols'] = $parameters['colspanvalue'];
+ $params['cols'] = isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null;
print $object->showOptionals($extrafields, 'edit', $params);
}
diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php
index c40f896e702..e2e56e1a060 100644
--- a/htdocs/core/tpl/massactions_pre.tpl.php
+++ b/htdocs/core/tpl/massactions_pre.tpl.php
@@ -205,7 +205,7 @@ if ($massaction == 'predisable') {
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
$parameters = array(
'toselect' => $toselect,
- 'uploaddir' => $uploaddir
+ 'uploaddir' => isset($uploaddir) ? $uploaddir : null
);
$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action);
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index fcc51c21df9..d441d364f4b 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -556,6 +556,21 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note;
}
+ $object->sendtoid = 0;
+ } elseif ($action == 'ORDER_SUPPLIER_CANCEL') {
+ // Load translation files required by the page
+ $langs->loadLangs(array("agenda", "other", "orders", "main"));
+
+ if (empty($object->actionmsg2)) {
+ $object->actionmsg2 = $langs->transnoentities("OrderCanceledInDolibarr", $object->ref);
+ }
+ $object->actionmsg = $langs->transnoentities("OrderCanceledInDolibarr", $object->ref);
+
+ if (!empty($object->cancel_note)) {
+ $object->actionmsg .= ' ';
+ $object->actionmsg .= $langs->trans("Reason") . ': '.$object->cancel_note;
+ }
+
$object->sendtoid = 0;
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
// Load translation files required by the page
@@ -941,7 +956,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
}
- $object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
+ if (!empty($user->login)) {
+ $object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
+ } elseif (isset($object->origin_email)) {
+ $object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$object->origin_email, $object->actionmsg);
+ }
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
index 7d315f142a7..e2b359809dd 100644
--- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
+++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
*/
class InterfaceNotification extends DolibarrTriggers
{
- // @todo Defined also into notify.class.php)
+ // @todo Defined also into notify.class.php
public $listofmanagedevents = array(
'BILL_VALIDATE',
'BILL_PAYED',
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index f983994c4ec..6ae9ab9664b 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -330,7 +330,15 @@ if (!empty($withproject)) {
print "
';
+ }
+ }
+ }
+ }
+ }
+ $resaction .= ($resaction ? ' ' : $resaction);
+ $resaction .= '' . $langs->trans("ResultOfMailSending") . ': ' . "\n";
+ $resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n ";
+ $resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n ";
+ $resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n ";
+
+ if ($nbsent) {
+ $action = ''; // Do not show form post if there was at least one successfull sent
+ //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
+ setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs');
+ setEventMessages($resaction, null, 'mesgs');
+ } else {
+ //setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file
+ setEventMessages($resaction, null, 'warnings');
+ }
+
+ $action = 'list';
+ $massaction = '';
+}
+
+
+
+$parameters['toselect'] = $toselect;
+$parameters['uploaddir'] = $uploaddir;
+$parameters['massaction'] = $massaction;
+$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
+
+$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+}
diff --git a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
new file mode 100644
index 00000000000..f2bb6f0c3ae
--- /dev/null
+++ b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
@@ -0,0 +1,61 @@
+
+ * Copyright (C) 2013 Juanjo Menent
+ * Copyright (C) 2014 Marcos García
+ *
+ * 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 .
+ */
+
+// Protection to avoid direct call of template
+if (empty($conf) || !is_object($conf)) {
+ print "Error, template page can't be called as URL";
+ exit;
+}
+
+echo "\n";
+
+global $user;
+
+$langs = $GLOBALS['langs'];
+$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
+$langs->load("eventorganization");
+
+$total = 0;
+foreach ($linkedObjectBlock as $key => $objectlink) {
+ echo '
__(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
index b9243f11823..9b285f99a10 100644
--- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
+++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
@@ -38,6 +38,8 @@
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN ref_fourn varchar(128);
ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128);
+-- -- add action trigger
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13);
CREATE TABLE llx_stocktransfer_stocktransfer(
-- BEGIN MODULEBUILDER FIELDS
diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql
index 787a2b15bd7..1d3a784dd74 100644
--- a/htdocs/install/mysql/tables/llx_adherent.sql
+++ b/htdocs/install/mysql/tables/llx_adherent.sql
@@ -48,6 +48,7 @@ create table llx_adherent
state_id integer,
country integer,
email varchar(255),
+ url varchar(255) NULL,
socialnetworks text DEFAULT NULL, -- json with socialnetworks
skype varchar(255), -- deprecated
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 4ec6a69b053..ade0f89ff1c 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2150,4 +2150,5 @@ RandomlySelectedIfSeveral=Randomly selected if several pictures are available
DatabasePasswordObfuscated=Database password is obfuscated in conf file
DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
APIsAreNotEnabled=APIs modules are not enabled
-YouShouldSetThisToOff=You should set this to 0 or off
\ No newline at end of file
+YouShouldSetThisToOff=You should set this to 0 or off
+InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s
\ No newline at end of file
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index f361e6bc192..67a242e640a 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -119,6 +119,8 @@ EventType = Event type
LabelOfBooth=Booth label
LabelOfconference=Conference label
ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet
+DateMustBeBeforeThan=%s must be before %s
+DateMustBeAfterThan=%s must be after %s
#
# Vote page
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 4143eaacdc9..63f6b5b082f 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -256,6 +256,11 @@ AutofillWithExpected=Fill real quantity with expected quantity
ShowAllBatchByDefault=By default, show batch details on product "stock" tab
CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration
FieldCannotBeNegative=Field "%s" cannot be negative
+ErrorWrongBarcodemode=Unknown Barcode mode
+ProductDoesNotExist=Product does not exist
+ErrorSameBatchNumber=Same batch number found in inventory list
+ProductBatchDoesNotExist=Product with batch/serial does not exist
+ProductBarcodeDoesNotExist=Product with barcode does not exist
ModuleStockTransferName=Stocks Transfer
ModuleStockTransferDesc=Creation of stocks transfer objects, with generation of transfer sheet
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index 3c074688b8e..0b54b1d5fa8 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -66,7 +66,7 @@ NeedMoreInformation=Waiting for reporter feedback
NeedMoreInformationShort=Waiting for feedback
Answered=Answered
Waiting=Waiting
-Closed=Closed
+SolvedClosed=Solved
Deleted=Deleted
# Dict
@@ -186,9 +186,11 @@ TicketSeverity=Severity
ShowTicket=See ticket
RelatedTickets=Related tickets
TicketAddIntervention=Create intervention
-CloseTicket=Close ticket
-CloseATicket=Close a ticket
+CloseTicket=Close|Solve ticket
+AbandonTicket=Abandon ticket
+CloseATicket=Close|Solve a ticket
ConfirmCloseAticket=Confirm ticket closing
+ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned'
ConfirmDeleteTicket=Please confirm ticket deleting
TicketDeletedSuccess=Ticket deleted with success
TicketMarkedAsClosed=Ticket marked as closed
diff --git a/htdocs/langs/fr_FR/eventorganization.lang b/htdocs/langs/fr_FR/eventorganization.lang
index 7ef2977adc3..ef7de0fd710 100644
--- a/htdocs/langs/fr_FR/eventorganization.lang
+++ b/htdocs/langs/fr_FR/eventorganization.lang
@@ -40,8 +40,8 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Modèle de courriel à envoyer aprè
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Modèle de courriel à envoyer après avoir reçu une suggestion d'un stand.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Modèle de courriel à envoyer après paiement d'une inscription à un stand.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Modèle de courriel à envoyer après paiement d'une inscription à un événement.
-EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux participants
-EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux intervenants
+EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux intervenants
+EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux participants
EVENTORGANIZATION_FILTERATTENDEES_CAT = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec/selon la catégorie
EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec le type de client
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index 85cd0932f46..01968855836 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -449,7 +449,7 @@ if ($object->id > 0) {
print dol_get_fiche_end();
- print '