diff --git a/ChangeLog b/ChangeLog
index 7537a891c9b..d4a8b55625f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,8 +19,8 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
-* Field "tva" renamed into "total_tva" in llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
-* Field "total" renamed into "total_ttc" in llx_propal, llx_supplier_proposal 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 "total" renamed into "total_ttc" for table lx_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
diff --git a/dev/examples/zapier/README.md b/dev/examples/zapier/README.md
index 453a5224993..e452cc2aa6b 100644
--- a/dev/examples/zapier/README.md
+++ b/dev/examples/zapier/README.md
@@ -1,68 +1,6 @@
# HOW TO BUILD
+Take a look at the dolibarr wiki page of Zapier module:
-## ENABLE MODULE ZAPIER ON DOLIBARR
-
-This should also enable the module API (required for authentication by Zapier service and to execute action in Dolibarr by Zapier).
-
-Create the Dolibarr login that will be used by Zapier to call APIs. Give the login the permissions on the action you plan to automate.
-
-
-## CREATE A ZAPIER DEVELOPPER ACCOUNT
-
-At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/)
-
-
-## INSTALL ZAPIER COMMAND LINE TOOLS WITH LINK TO ZAPIER ONLINE ACCOUNT
-
-### Install Node.js
-
-An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.
-
-After installation, confirm that Node.js is ready to use:
- `node --version`
-
-### Install the Zapier CLI
-
-Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:
-
- `cd dev/examples/zapier`
-
- `npm install -g zapier-platform-cli` to install the CLI globally
-
- `zapier --version` to return version of the CLI
-
-### Run Zapier Login
-
-Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.
-
- `zapier login`
-
-This command will set up a .zapierrc file in your home directory.
-
-### Install the Project
-
-In zapier example directory, run:
-
- `cd dev/examples/zapier`
-
- `npm install`
-
-### Deploying your App
-
-Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.
-
- `zapier register` (the first time, choose name for example "Dolibarr")
-
- `zapier push`
-
-After a push, the Application, with the name you defined during the register step, is available when creating a Zap.
-
-You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction)
-
-
-### Create a Zap
-
-Create a ZAP that use the application you registered.
-For authentication, you must enter the login / pass of account used by Zapier to call APIs.
+https://wiki.dolibarr.org/index.php?title=Module_Zapier
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index ac8a8c6354d..4338d7ad803 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -91,8 +91,10 @@ $form = new Form($db);
$fiscalyearstatic = new Fiscalyear($db);
$title = $langs->trans('AccountingPeriods');
-$helpurl = "";
-llxHeader('', $title, $helpurl);
+
+$help_url = "EN:Module_Double_Entry_Accounting";
+
+llxHeader('', $title, $help_url);
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php
index 7fdd7c19e32..410807144f5 100644
--- a/htdocs/accountancy/admin/fiscalyear_card.php
+++ b/htdocs/accountancy/admin/fiscalyear_card.php
@@ -149,8 +149,10 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
$form = new Form($db);
$title = $langs->trans("Fiscalyear")." - ".$langs->trans("Card");
-$helpurl = "";
-llxHeader("", $title, $helpurl);
+
+$help_url = "EN:Module_Double_Entry_Accounting";
+
+llxHeader('', $title, $help_url);
if ($action == 'create') {
print load_fiche_titre($langs->trans("NewFiscalYear"));
diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php
index 6fc5ac3cad8..d472350fab7 100644
--- a/htdocs/accountancy/admin/fiscalyear_info.php
+++ b/htdocs/accountancy/admin/fiscalyear_info.php
@@ -39,10 +39,14 @@ if (!$user->rights->accounting->fiscalyear->write) {
$id = GETPOST('id', 'int');
+
// View
+
$title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info");
-$helpurl = "";
-llxHeader("", $title, $helpurl);
+
+$help_url = "EN:Module_Double_Entry_Accounting";
+
+llxHeader('', $title, $help_url);
if ($id) {
$object = new Fiscalyear($db);
diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/member.php
similarity index 100%
rename from htdocs/adherents/admin/adherent.php
rename to htdocs/adherents/admin/member.php
diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/member_emails.php
similarity index 79%
rename from htdocs/adherents/admin/adherent_emails.php
rename to htdocs/adherents/admin/member_emails.php
index e1867285930..cdda83b4714 100644
--- a/htdocs/adherents/admin/adherent_emails.php
+++ b/htdocs/adherents/admin/member_emails.php
@@ -24,7 +24,7 @@
*/
/**
- * \file htdocs/adherents/admin/adherent.php
+ * \file htdocs/adherents/admin/member_emails.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
@@ -55,6 +55,7 @@ $constantes = array(
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
+ 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member',
'ADHERENT_MAIL_FROM'=>'string',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html',
@@ -69,9 +70,24 @@ $constantes = array(
//
if ($action == 'updateall') {
$db->begin();
- $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0;
- $res1 = dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
- if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) {
+
+ $res = 0;
+ foreach ($constantes as $constname => $value) {
+ $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue'));
+ $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
+ $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'restricthtml') : GETPOST('constnote'));
+
+ $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
+ $constvalue = preg_replace('/:member$/', '', $constvalue);
+
+ $res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity);
+ if ($res <= 0) {
+ $error++;
+ $action = 'list';
+ }
+ }
+
+ if ($error > 0) {
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
} else {
@@ -126,19 +142,19 @@ $head = member_admin_prepare_head();
print dol_get_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user');
// TODO Use global form
-//print '
';
+print '';
+print '';
print dol_get_fiche_end();
diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/member_extrafields.php
similarity index 79%
rename from htdocs/adherents/admin/adherent_extrafields.php
rename to htdocs/adherents/admin/member_extrafields.php
index 0465b7eee4f..7f5262bc7c6 100644
--- a/htdocs/adherents/admin/adherent_extrafields.php
+++ b/htdocs/adherents/admin/member_extrafields.php
@@ -19,7 +19,7 @@
*/
/**
- * \file htdocs/adherents/admin/adherent_extrafields.php
+ * \file htdocs/adherents/admin/member_extrafields.php
* \ingroup member
* \brief Page to setup extra fields of members
*/
@@ -89,12 +89,7 @@ if ($action != 'create' && $action != 'edit') {
}
-/* ************************************************************************** */
-/* */
-/* Creation of an optional field */
-/* */
-/* ************************************************************************** */
-
+// Creation of an optional field
if ($action == 'create') {
print ' ';
print load_fiche_titre($langs->trans('NewAttribute'));
@@ -102,11 +97,7 @@ if ($action == 'create') {
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
-/* ************************************************************************** */
-/* */
-/* Edition of an optional field */
-/* */
-/* ************************************************************************** */
+// Edition of an optional field
if ($action == 'edit' && !empty($attrname)) {
print ' ';
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php
similarity index 79%
rename from htdocs/adherents/admin/adherent_type_extrafields.php
rename to htdocs/adherents/admin/member_type_extrafields.php
index c33ee5a4739..91a9233e5d0 100644
--- a/htdocs/adherents/admin/adherent_type_extrafields.php
+++ b/htdocs/adherents/admin/member_type_extrafields.php
@@ -22,7 +22,7 @@
*/
/**
- * \file htdocs/adherents/admin/adherent_type_extrafields.php
+ * \file htdocs/adherents/admin/member_type_extrafields.php
* \ingroup member
* \brief Page to setup extra fields of members
*/
@@ -92,12 +92,7 @@ if ($action != 'create' && $action != 'edit') {
}
-/* ************************************************************************** */
-/* */
-/* Creation of an optional field */
-/* */
-/* ************************************************************************** */
-
+// Creation of an optional field
if ($action == 'create') {
print " ";
print load_fiche_titre($langs->trans('NewAttribute'));
@@ -105,11 +100,7 @@ if ($action == 'create') {
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
-/* ************************************************************************** */
-/* */
-/* Edition of an optional field */
-/* */
-/* ************************************************************************** */
+// Edition of an optional field
if ($action == 'edit' && !empty($attrname)) {
print " ";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index d13b4a27c43..d4f2df25c0c 100644
--- a/htdocs/adherents/admin/website.php
+++ b/htdocs/adherents/admin/website.php
@@ -178,7 +178,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '
';
+*/
/*
// Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
// Ask for payment bank during order
-if ($conf->banque->enabled)
-{
+if ($conf->banque->enabled) {
print '
\n";
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index 5ea0e4821d6..4c56b0223cd 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
}
$value = $datenotinstring;
} else {
- $value = $obj->$tmpkey;
+ $value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : '');
}
// If field is a computed field, we make computation to get value
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) {
diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php
index 77329eb06a4..72f888f256a 100644
--- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php
@@ -37,17 +37,17 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
if (in_array($typeofextrafield, array('int', 'double'))) {
$searchclass = 'searchnum';
}
- print '';
+ print '';
} elseif (in_array($typeofextrafield, array('datetime', 'timestamp'))) {
$morecss = '';
- echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
+ echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
} else {
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
$morecss = '';
if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) {
$morecss = 'maxwidth200';
}
- echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
+ echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
}
print '';
}
diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php
index de165c8c752..6ff7bba2390 100644
--- a/htdocs/core/tpl/filemanager.tpl.php
+++ b/htdocs/core/tpl/filemanager.tpl.php
@@ -71,7 +71,8 @@ print '
';
// Toolbar
if ($permtoadd) {
- print '';
+ $websitekeyandpageid = (!empty($websitekey) ? '&website='.$websitekey : '').(!empty($pageid) ? '&pageid='.$pageid : '');
+ print '';
print '';
print '';
} else {
diff --git a/htdocs/datapolicy/langs/en_US/datapolicy.lang b/htdocs/datapolicy/langs/en_US/datapolicy.lang
index ad5308ce8ce..368caffcbda 100644
--- a/htdocs/datapolicy/langs/en_US/datapolicy.lang
+++ b/htdocs/datapolicy/langs/en_US/datapolicy.lang
@@ -19,7 +19,7 @@ Module4100Name = Data Privacy Policy
Module4100Desc = Module to manage Data Privacy (Conformity with the GDPR)
#
-# Page d'administration
+# Administration page
#
datapolicySetup = Module Data Privacy Policy Setup
Deletion = Deletion of data
@@ -39,21 +39,21 @@ DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Nor prospect/Nor customer
DATAPOLICY_CONTACT_FOURNISSEUR = Supplier
DATAPOLICY_ADHERENT = Member
DATAPOLICY_Tooltip_SETUP = Type of contact - Indicate your choices for each type.
-DATAPOLICYMail=Emails Setup
-DATAPOLICYSUBJECTMAIL=Subject of email
-DATAPOLICYCONTENTMAIL=Content of the email
-DATAPOLICYSUBSITUTION=You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person):
-DATAPOLICYACCEPT=Message after agreement
-DATAPOLICYREFUSE=Message after desagreement
-SendAgreementText=You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button.
-SendAgreement=Send emails
+DATAPOLICYMail = Emails Setup
+DATAPOLICYSUBJECTMAIL = Subject of email
+DATAPOLICYCONTENTMAIL = Content of the email
+DATAPOLICYSUBSITUTION = You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person):
+DATAPOLICYACCEPT = Message after agreement
+DATAPOLICYREFUSE = Message after desagreement
+SendAgreementText = You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button.
+SendAgreement = Send emails
AllAgreementSend = All emails have been sent
-TXTLINKDATAPOLICYACCEPT= Text for the link "agreement"
-TXTLINKDATAPOLICYREFUSE= Text for the link "desagreement"
+TXTLINKDATAPOLICYACCEPT = Text for the link "agreement"
+TXTLINKDATAPOLICYREFUSE = Text for the link "desagreement"
#
-# Extrafield
+# Extrafields
#
DATAPOLICY_BLOCKCHECKBOX = GDPR : Processing of personal data
DATAPOLICY_consentement = Consent obtained for the processing of personal data
@@ -67,26 +67,26 @@ DATAPOLICY_POPUP_ANONYME_TITLE = Anonymize a thirdparty
DATAPOLICY_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr because there are related items. In accordance with the GDPR, you will make all this data anonymous to respect your obligations. Would you like to continue ?
#
-# Bouton portabilité
+# Button for portability
#
DATAPOLICY_PORTABILITE = Portability GDPR
DATAPOLICY_PORTABILITE_TITLE = Export of personal data
DATAPOLICY_PORTABILITE_CONFIRMATION = You want to export the personal data of this contact. Are you sure ?
#
-# Note ajoutés lors d'une anonymisation
+# Notes added during an anonymization
#
ANONYMISER_AT = Anonymised the %s
-#V2
-DATAPOLICYReturn=GDPR Validation
+# V2
+DATAPOLICYReturn = GDPR Validation
DATAPOLICY_date = Date of agreement/desagreement GDPR
DATAPOLICY_send = Date sending agreement email
DATAPOLICYReturn = GDPR Return
DATAPOLICY_SEND = Send GDPR email
MailSent = Email has been sent
-#ERROR
-ErrorSubjectIsRequired= Error : The subject of email is required. Indicate it in the module setup
+# ERROR
+ErrorSubjectIsRequired = Error : The subject of email is required. Indicate it in the module setup
=Due to a technical problem, we were unable to register your choice. We apologize for that. Contact us to send us your choice.
NUMBER_MONTH_BEFORE_DELETION = Number of month before deletion
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index 6f223821bd3..495d0334a10 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -17,7 +17,7 @@
*/
/**
- * \file event.php
+ * \file htdocs/eventorganization/conferenceorbooth_card.php
* \ingroup eventorganization
* \brief Page to create/edit/view conferenceorbooth
*/
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index f46891b6847..7e10b5b5f1f 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -126,6 +126,12 @@ $permissiondellink = $user->rights->expedition->delivery->creer; // Used by the
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expedition', $object->id, '');
+
/*
* Actions
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index a096b2155ce..174b97b4a7e 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -41,12 +41,6 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'expedition', $id, '');
-
$object = new Expedition($db);
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
@@ -69,6 +63,12 @@ if ($id > 0 || !empty($ref)) {
}
}
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expedition', $object->id, '');
+
/*
* Actions
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index 836b469cb77..faff2a8d0a0 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -45,12 +45,6 @@ $confirm = GETPOST('confirm');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref');
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'expedition', $id, '');
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -71,14 +65,21 @@ if (!$sortfield) {
$object = new Expedition($db);
+if ($object->fetch($id, $ref)) {
+ $object->fetch_thirdparty();
+ $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
+}
+
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expedition', $object->id, '');
+
/*
* Actions
*/
-if ($object->fetch($id)) {
- $object->fetch_thirdparty();
- $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
-}
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index c8209910b48..db28e409309 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -39,13 +39,6 @@ $id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); //
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
-// Security check
-$socid = '';
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, $origin, $origin_id);
-
$object = new Expedition($db);
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
@@ -66,10 +59,18 @@ if ($id > 0 || !empty($ref)) {
$objectsrc = new Propal($db);
$objectsrc->fetch($object->$typeobject->id);
}
+
+ $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
}
$permissionnote = $user->rights->expedition->creer; // Used by the include of actions_setnotes.inc.php
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expedition', $object->id, '');
+
/*
* Actions
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 66efd5c4ca7..809b4803ff5 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -73,6 +73,11 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expedition', $object->id, '');
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index 151edbdba2b..6bdc495472c 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -39,7 +39,7 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
-$nowyear = strftime("%Y", dol_now());
+$nowyear = dol_print_date(dol_now(), "%Y");
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
@@ -48,6 +48,12 @@ $endyear = $year;
// Load translation files required by the page
$langs->loadLangs(array('sendings', 'other', 'companies'));
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+restrictedArea($user, 'expedition');
+
/*
* View
diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php
index 74455d7dca2..254fd9aad90 100644
--- a/htdocs/expedition/stats/month.php
+++ b/htdocs/expedition/stats/month.php
@@ -29,6 +29,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$year = GETPOST('year', 'int');
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+restrictedArea($user, 'expedition');
+
/*
* View
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index dc23a8ab362..b3d0cf49a32 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -154,6 +154,9 @@ $upload_dir = $conf->export->dir_temp.'/'.$user->id;
//$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1);
$usefilters = 1;
+// Security check
+$result = restrictedArea($user, 'export');
+
/*
* Actions
@@ -449,7 +452,7 @@ if ($step == 1 || !$datatoexport) {
if ($objexport->array_export_perms[$key]) {
print ''.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').'';
} else {
- print $langs->trans("NotEnoughPermissions");
+ print ''.$langs->trans("NotEnoughPermissions").'';
}
print '';
}
diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php
index 22b1729550d..3ba5e0a3591 100644
--- a/htdocs/exports/index.php
+++ b/htdocs/exports/index.php
@@ -27,11 +27,12 @@ require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
// Load translation files required by the page
$langs->load("exports");
+$export = new Export($db);
+$export->load_arrays($user);
+
// Security check
$result = restrictedArea($user, 'export');
-$export = new Export($db);
-$export->load_arrays($user);
/*
* View
diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php
index 2fec51a0f5b..552d9f70c97 100644
--- a/htdocs/fichinter/admin/fichinter_extrafields.php
+++ b/htdocs/fichinter/admin/fichinter_extrafields.php
@@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') {
print "