diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json
index 4266a6f00b1..cc0768a27ef 100644
--- a/dev/examples/zapier/package.json
+++ b/dev/examples/zapier/package.json
@@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
- "zapier-platform-core": "10.1.2"
+ "zapier-platform-core": "11.0.0"
},
"devDependencies": {
"mocha": "^5.2.0",
diff --git a/dev/resources/iso-normes/address_format.txt b/dev/resources/iso-normes/address_format.txt
index cc3b23285c8..d87e90e79b5 100644
--- a/dev/resources/iso-normes/address_format.txt
+++ b/dev/resources/iso-normes/address_format.txt
@@ -1 +1,4 @@
-http://bitboost.com/ref/international-address-formats.html#Formats
\ No newline at end of file
+https://bitboost.com/ref/international-address-formats.html#Formats
+
+https://www.upu.int/en/Postal-Solutions/Programmes-Services/Addressing-Solutions
+
diff --git a/dev/resources/iso-normes/code_nace.txt b/dev/resources/iso-normes/code_nace.txt
index 0c490bd4bf1..a07e3a76b31 100644
--- a/dev/resources/iso-normes/code_nace.txt
+++ b/dev/resources/iso-normes/code_nace.txt
@@ -1 +1,5 @@
-http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=FR&StrLayoutCode=#
\ No newline at end of file
+NACE
+
+https://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=EN&StrLayoutCode=
+
+https://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community
diff --git a/dev/resources/iso-normes/countries_iso-3166_en.txt b/dev/resources/iso-normes/countries_iso-3166_en.txt
index b953435d1c9..d6624026963 100644
--- a/dev/resources/iso-normes/countries_iso-3166_en.txt
+++ b/dev/resources/iso-normes/countries_iso-3166_en.txt
@@ -3,11 +3,12 @@
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
# It lists 240 official short names and code elements. One line of text contains one entry.
# A country name and its code element are separated by a semicolon (;).
-# http://www.iso.org/iso/fr/iso3166_en_code_lists.txt
+# https://www.iso.org/iso-3166-country-codes.html
-# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
-# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
-# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
+# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
+# ISO-3166: https://en.wikipedia.org/wiki/ISO_3166-1
+# ISO-3166 alpha 2: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
+# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
AFGHANISTAN;AF
ÅLAND ISLANDS;AX
@@ -254,4 +255,4 @@ WALLIS AND FUTUNA;WF
WESTERN SAHARA;EH
YEMEN;YE
ZAMBIA;ZM
-ZIMBABWE;ZW
\ No newline at end of file
+ZIMBABWE;ZW
diff --git a/dev/resources/iso-normes/countries_iso-3166_fr.txt b/dev/resources/iso-normes/countries_iso-3166_fr.txt
index 578c0f0effe..532b73ef47e 100644
--- a/dev/resources/iso-normes/countries_iso-3166_fr.txt
+++ b/dev/resources/iso-normes/countries_iso-3166_fr.txt
@@ -3,11 +3,12 @@
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
# It lists 240 official short names and code elements. One line of text contains one entry.
# A country name and its code element are separated by a semicolon (;).
-# http://www.iso.org/iso/fr/iso3166_fr_code_lists.txt
+# https://www.iso.org/fr/iso-3166-country-codes.html
-# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
-# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
-# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
+# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
+# ISO-3166: https://fr.wikipedia.org/wiki/ISO_3166-1
+# ISO-3166 alpha 2: https://fr.wikipedia.org/wiki/ISO_3166-1_alpha-2
+# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
AFGHANISTAN;AF
AFRIQUE DU SUD;ZA
@@ -254,4 +255,4 @@ VIET NAM;VN
WALLIS ET FUTUNA;WF
YÉMEN;YE
ZAMBIE;ZM
-ZIMBABWE;ZW
\ No newline at end of file
+ZIMBABWE;ZW
diff --git a/dev/resources/iso-normes/locales.txt b/dev/resources/iso-normes/locales.txt
index cb39e45ec0d..67ea5280342 100644
--- a/dev/resources/iso-normes/locales.txt
+++ b/dev/resources/iso-normes/locales.txt
@@ -1,9 +1,9 @@
For languages:
-http://demo.icu-project.org/icu-bin/locexp?d_=fr
+https://icu4c-demos.unicode.org/icu-bin/icudemos - Locale Explorer -> Error 404
For format number:
-http://en.wikipedia.org/wiki/Decimal_mark
+https://en.wikipedia.org/wiki/Decimal_mark
For date format:
-http://en.wikipedia.org/wiki/Date_format_by_country
\ No newline at end of file
+https://en.wikipedia.org/wiki/Date_format_by_country
diff --git a/dev/resources/iso-normes/vat_number_names.txt b/dev/resources/iso-normes/vat_number_names.txt
index 23fce59ed3b..b1e8d469ec8 100644
--- a/dev/resources/iso-normes/vat_number_names.txt
+++ b/dev/resources/iso-normes/vat_number_names.txt
@@ -1 +1,7 @@
-http://en.wikipedia.org/wiki/VAT_identification_number
\ No newline at end of file
+https://en.wikipedia.org/wiki/VAT_identification_number
+
+terms
+(en) VAT = Value Added Tax
+(fr) TVA = Taxe sur la Valeur Ajouté
+(es) NIF / CIF
+(de) USt / MwSt
diff --git a/dev/resources/iso-normes/world_tax_rates.txt b/dev/resources/iso-normes/world_tax_rates.txt
index 740062288dc..c007474e5fd 100644
--- a/dev/resources/iso-normes/world_tax_rates.txt
+++ b/dev/resources/iso-normes/world_tax_rates.txt
@@ -1,4 +1,5 @@
http://www.taxrates.cc/index.html
+https://en.wikipedia.org/wiki/List_of_countries_by_tax_rates
For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst
diff --git a/dev/resources/sepa/text.txt b/dev/resources/sepa/text.txt
index dbcfeded5a4..dfa55834e58 100644
--- a/dev/resources/sepa/text.txt
+++ b/dev/resources/sepa/text.txt
@@ -1,3 +1,7 @@
+https://en.wikipedia.org/wiki/Single_Euro_Payments_Area
+https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html
+https://www.europeanpaymentscouncil.eu/about-sepa
+
Spec for credit transfer:
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index 5150bea861e..f2a7c6f3f55 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -93,6 +93,8 @@ if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
}
+$permissiontoadd = $canaddmember;
+
// Security check
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index f8a782a54e5..d03574d473b 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -871,8 +871,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
if ($value == 'price' || preg_match('/^amount/i', $value)) {
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
- } elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') {
- $_POST[$keycode] = price2num(GETPOST($keycode), 8);
+ } elseif ($value == 'taux' || $value == 'localtax1') {
+ $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
} elseif ($value == 'entity') {
$_POST[$keycode] = getEntity($tabname[$id]);
}
@@ -940,8 +940,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
if ($field == 'price' || preg_match('/^amount/i', $field)) {
$_POST[$keycode] = price2num(GETPOST($keycode), 'MU');
- } elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') {
- $_POST[$keycode] = price2num(GETPOST($keycode), 8);
+ } elseif ($field == 'taux' || $field == 'localtax1') {
+ $_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
} elseif ($field == 'entity') {
$_POST[$keycode] = getEntity($tabname[$id]);
}
@@ -1254,13 +1254,13 @@ if ($id) {
$valuetoshow = $langs->trans("UseLocalTax")." 2"; $class = "center"; $sortable = 0;
}
if ($value == 'localtax1') {
- $valuetoshow = $langs->trans("Rate")." 2"; $class = "center";
+ $valuetoshow = $langs->trans("RateOfTaxN", '2'); $class = "center";
}
if ($value == 'localtax2_type') {
$valuetoshow = $langs->trans("UseLocalTax")." 3"; $class = "center"; $sortable = 0;
}
if ($value == 'localtax2') {
- $valuetoshow = $langs->trans("Rate")." 3"; $class = "center";
+ $valuetoshow = $langs->trans("RateOfTaxN", '3'); $class = "center";
}
if ($value == 'organization') {
$valuetoshow = $langs->trans("Organization");
@@ -1598,17 +1598,18 @@ if ($id) {
}
$cssprefix = 'center ';
}
+
if ($value == 'localtax1_type') {
$valuetoshow = $langs->trans("UseLocalTax")." 2"; $cssprefix = "center "; $sortable = 0;
}
if ($value == 'localtax1') {
- $valuetoshow = $langs->trans("Rate")." 2"; $cssprefix = "center "; $sortable = 0;
+ $valuetoshow = $langs->trans("RateOfTaxN", '2'); $cssprefix = "center "; $sortable = 0;
}
if ($value == 'localtax2_type') {
$valuetoshow = $langs->trans("UseLocalTax")." 3"; $cssprefix = "center "; $sortable = 0;
}
if ($value == 'localtax2') {
- $valuetoshow = $langs->trans("Rate")." 3"; $cssprefix = "center "; $sortable = 0;
+ $valuetoshow = $langs->trans("RateOfTaxN", '3'); $cssprefix = "center "; $sortable = 0;
}
if ($value == 'organization') {
$valuetoshow = $langs->trans("Organization");
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 8fcbc898844..2d3133c9fce 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -48,7 +48,7 @@ $substitutionarrayfortest = array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
- '__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '
' : '',
+ '__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '
' : '',
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
@@ -737,14 +737,14 @@ if ($action == 'edit') {
print '
| '.$langs->trans("MAIN_MAIL_ERRORS_TO").' | ';
- print ''.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : '');
+ print ' | '.(getDolGlobalString('MAIN_MAIL_ERRORS_TO'));
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) {
print img_warning($langs->trans("ErrorBadEMail"));
}
diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php
index 2b6a4e81fb4..12c90cf3c21 100644
--- a/htdocs/admin/security_file.php
+++ b/htdocs/admin/security_file.php
@@ -66,7 +66,7 @@ if ($action == 'updateform') {
} elseif ($action == 'delete') {
// Delete file
$langs->load("other");
- $file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
+ $file = $conf->admin->dir_temp.'/'.GETPOST('urlfile', 'alpha');
$ret = dol_delete_file($file);
if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs');
diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php
index 530860dee71..50b27b30964 100644
--- a/htdocs/admin/system/filecheck.php
+++ b/htdocs/admin/system/filecheck.php
@@ -53,8 +53,8 @@ print ''.$langs->trans("FileCheckDesc").'
print '';
print ' ';
print '| '.$langs->trans("Version").' | '.$langs->trans("Value").' | '."\n";
-print '| '.$langs->trans("VersionLastInstall").' | '.$conf->global->MAIN_VERSION_LAST_INSTALL.' | '."\n";
-print '| '.$langs->trans("VersionLastUpgrade").' | '.$conf->global->MAIN_VERSION_LAST_UPGRADE.' | '."\n";
+print '| '.$langs->trans("VersionLastInstall").' | '.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').' | '."\n";
+print '| '.$langs->trans("VersionLastUpgrade").' | '.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').' | '."\n";
print '| '.$langs->trans("VersionProgram").' | '.DOL_VERSION;
// If current version differs from last upgrade
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
@@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
}
-if (!$error && $xml) {
+if (empty($error) && !empty($xml)) {
$checksumconcat = array();
$file_list = array();
$out = '';
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 0d4f60f3851..428c80676a2 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -157,7 +157,7 @@ $title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title);
-print '';
+print '';
print '';
print '';
print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.' ';
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index 935804ada10..fbc2412a9df 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -42,7 +42,7 @@ if ($user->socid > 0) {
}
// Load translation files required by the page
-$langs->loadLangs(array("companies", "admin", "users", "other"));
+$langs->loadLangs(array("companies", "admin", "users", "other","withdrawals"));
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
@@ -285,7 +285,7 @@ if ($result) {
$param .= "&date_endyear=".urlencode($date_endyear);
}
- $langs->load('withdrawals');
+ $center = '';
if ($num) {
$center = ''.$langs->trans("Purge").'';
}
diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php
index e6f5ed9b353..91e46269994 100644
--- a/htdocs/asset/document.php
+++ b/htdocs/asset/document.php
@@ -40,12 +40,6 @@ $socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result=restrictedArea($user, 'asset', $id, '');
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -69,6 +63,14 @@ if ($object->fetch($id)) {
$upload_dir = $conf->asset->dir_output."/".dol_sanitizeFileName($object->ref);
}
+$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result=restrictedArea($user, 'asset', $id, '');
+
/*
* Actions
diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php
index c0196670cfb..e59b22c45b2 100644
--- a/htdocs/bom/bom_document.php
+++ b/htdocs/bom/bom_document.php
@@ -85,6 +85,8 @@ if ($id > 0 || !empty($ref)) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
+$permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+
/*
* Actions
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 817c750a571..eeca990ef28 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -754,6 +754,7 @@ if ($type == Categorie::TYPE_CONTACT) {
$num = count($contacts);
$nbtotalofrecords = '';
$newcardbutton = '';
+ $objsoc = new Societe($db);
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit);
print ''."\n";
@@ -770,6 +771,11 @@ if ($type == Categorie::TYPE_CONTACT) {
print "\t".''."\n";
print '| ';
print $contact->getNomUrl(1, 'category');
+ if ($contact->socid > 0) {
+ $objsoc->fetch($contact->socid);
+ print ' - ';
+ print $objsoc->getNomUrl(1, 'contact');
+ }
print " | \n";
// Link to delete from category
print '';
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index f521fa2ab59..c55d4e114cc 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -88,6 +88,8 @@ if ($user->socid && $socid) {
$result = restrictedArea($user, 'societe', $socid);
}
+$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+
/*
* Actions
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 654dea6d697..86aff8a36e0 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -281,7 +281,13 @@ if (empty($reshook)) {
complete_substitutions_array($substitutionarray, $langs);
$newsubject = make_substitutions($subject, $substitutionarray);
- $newmessage = make_substitutions($message, $substitutionarray);
+ $newmessage = make_substitutions($message, $substitutionarray, null, 0);
+
+ $moreinheader = '';
+ if (preg_match('/__UNSUBSCRIBE__/', $message)) {
+ $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n";
+ $moreinheader = make_substitutions($moreinheader, $substitutionarray);
+ }
$arr_file = array();
$arr_mime = array();
@@ -299,7 +305,7 @@ if (empty($reshook)) {
// Mail making
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
- $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing');
+ $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing');
if ($mail->error) {
$res = 0;
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 29310aa831b..984d77e7263 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -347,7 +347,7 @@ if (empty($reshook)) {
$duration = GETPOST('duree_validite', 'int');
if (empty($datep)) {
- setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors');
$action = 'create';
$error++;
}
@@ -1622,7 +1622,7 @@ if ($action == 'create') {
}
// Date
- print ' | | '.$langs->trans('Date').' | ';
+ print ' | | '.$langs->trans('DatePropal').' | ';
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
print ' | ';
@@ -2063,7 +2063,7 @@ if ($action == 'create') {
print '';
print '';
print '| ';
- print $langs->trans('Date');
+ print $langs->trans('DatePropal');
print ' | ';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 4e592c8371e..2b21c545c63 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -80,6 +80,8 @@ if (!$sortfield) {
$object = new Propal($db);
$object->fetch($id, $ref);
+$permissiontoadd = $user->rights->propale->creer;
+
// Security check
if (!empty($user->socid)) {
$socid = $user->socid;
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 43c83117457..e1ec555837f 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -10,7 +10,7 @@
* Copyright (C) 2012 Christophe Battarel
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2016-2018 Ferran Marcet
+ * Copyright (C) 2016-2021 Ferran Marcet
* Copyright (C) 2017-2018 Charlene Benke
* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2019 Alexandre Spangaro
@@ -182,7 +182,7 @@ $arrayfields = array(
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
- 'p.date'=>array('label'=>"Date", 'checked'=>1),
+ 'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
@@ -711,24 +711,12 @@ if ($resql) {
if ($sall) {
$param .= '&sall='.urlencode($sall);
}
- if ($search_date_start) {
- $param .= '&search_date_start='.urlencode($search_date_start);
- }
- if ($search_date_end) {
- $param .= '&search_date_end='.urlencode($search_date_end);
- }
- if ($search_dateend_start) {
- $param .= '&search_dateend_start='.urlencode($search_dateend_start);
- }
- if ($search_dateend_end) {
- $param .= '&search_dateend_end='.urlencode($search_dateend_end);
- }
- if ($search_datedelivery_start) {
- $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
- }
- if ($search_datedelivery_end) {
- $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
- }
+ if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
+ if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
+ if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
+ if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
+ if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
+ if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
@@ -787,37 +775,37 @@ if ($resql) {
$param .= '&search_categ_cus='.urlencode($search_categ_cus);
}
if ($search_product_category != '') {
- $param .= '&search_product_category='.$search_product_category;
+ $param .= '&search_product_category='.urlencode($search_product_category);
}
if ($search_fk_cond_reglement > 0) {
- $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
+ $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
}
if ($search_fk_shipping_method > 0) {
- $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
+ $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
}
if ($search_fk_input_reason > 0) {
- $param .= '&search_fk_input_reason='.$search_fk_input_reason;
+ $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
}
if ($search_fk_mode_reglement > 0) {
- $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
+ $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
}
if ($search_type_thirdparty > 0) {
- $param .= '&search_type_thirdparty='.$search_type_thirdparty;
+ $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
}
if ($search_town) {
- $param .= '&search_town='.$search_town;
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_zip) {
- $param .= '&search_zip='.$search_zip;
+ $param .= '&search_zip='.urlencode($search_zip);
}
if ($search_state) {
- $param .= '&search_state='.$search_state;
+ $param .= '&search_state='.urlencode($search_state);
}
if ($search_town) {
- $param .= '&search_town='.$search_town;
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_country) {
- $param .= '&search_country='.$search_country;
+ $param .= '&search_country='.urlencode($search_country);
}
// Add $param from extra fields
@@ -825,23 +813,22 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"),
- 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"),
-
+ 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if ($permissiontosendbymail) {
- $arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail");
+ $arrayofmassactions['presend']=img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
}
if ($permissiontovalidate) {
- $arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate");
+ $arrayofmassactions['prevalidate']=img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
}
if ($permissiontoclose) {
- $arrayofmassactions['presign']=img_picto('', 'propal').' '.$langs->trans("Sign");
- $arrayofmassactions['nopresign']=img_picto('', 'propal').' '.$langs->trans("NoSign");
- $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled");
+ $arrayofmassactions['presign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("Sign");
+ $arrayofmassactions['nopresign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("NoSign");
+ $arrayofmassactions['setbilled'] =img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
}
if ($permissiontodelete) {
- $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete");
+ $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index b4dddc9a1bf..c289112ee9f 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -44,12 +44,6 @@ $confirm = GETPOST('confirm');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref');
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'commande', $id, '');
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -78,6 +72,14 @@ if (!$sortfield) {
$object = new Commande($db);
+$permissiontoadd = $user->rights->commande->creer;
+
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'commande', $id, '');
+
/*
* Actions
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 3747b2107b2..5bb8e6ccb0c 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -9,7 +9,7 @@
* Copyright (C) 2015-2018 Frédéric France
* Copyright (C) 2015 Marcos García
* Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2016 Ferran Marcet
+ * Copyright (C) 2016-2021 Ferran Marcet
* Copyright (C) 2018 Charlene Benke
* Copyright (C) 2021 Anthony Berton
*
@@ -706,10 +706,10 @@ if ($resql) {
$param .= '&search_status='.urlencode($search_status);
}
if ($search_datecloture_start) {
- $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
+ $param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y');
}
if ($search_datecloture_end) {
- $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
+ $param .= '&search_datecloture_endday='.dol_print_date($search_datecloture_end, '%d').'&search_datecloture_endmonth='.dol_print_date($search_datecloture_end, '%m').'&search_datecloture_endyear='.dol_print_date($search_datecloture_end, '%Y');
}
if ($search_dateorder_start) {
$param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
@@ -805,16 +805,16 @@ if ($resql) {
$param .= '&search_billed='.urlencode($search_billed);
}
if ($search_fk_cond_reglement > 0) {
- $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
+ $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
}
if ($search_fk_shipping_method > 0) {
- $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
+ $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
}
if ($search_fk_mode_reglement > 0) {
- $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
+ $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
}
if ($search_fk_input_reason > 0) {
- $param .= '&search_fk_input_reason='.$search_fk_input_reason;
+ $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
}
// Add $param from extra fields
@@ -887,7 +887,6 @@ if ($resql) {
}
if ($massaction == 'createbills') {
- //var_dump($_REQUEST);
print '';
print '';
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index bf30b1831f9..30aa32a8d58 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -829,7 +829,7 @@ if ($action == 'create') {
print '
| | | |