diff --git a/README.md b/README.md
index 2cfe4138d62..54fdf1e958b 100644
--- a/README.md
+++ b/README.md
@@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other application/modules
-- Electronic Document Management (EDM)
+- Electronic Document Management (EDM)
- Bookmarks management
- Reporting
- Data export/import
-- Barcodes
+- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
-- Social platforms linking
+- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- Email-Collector
@@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Users and groups with finely grained rights
- Multi-Currency
- Multi-Company (by adding of an external module)
-
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
-
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
-
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
@@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with European GDPR rules
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
-- …
+- ...
### System Environment / Requirements
diff --git a/SECURITY.md b/SECURITY.md
index 61f4a392db8..427b1cc7ae2 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -54,12 +54,12 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us
* $dolibarr_main_prod must be set to 1 into conf.php
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
* $dolibarr_main_force_https must be set to something else than 0.
-* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default)
+* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 3 into backoffice menu Home - Setup - Other (this protection should be set to 3 soon by default)
* The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools)
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
-* CSRF attacks are accepted when using a POST URL, but when using GET URL, they are validated only for creating, updating or deleting data resctricted from pages restricted to admin users.
+* CSRF attacks are accepted but double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3.
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
Scope is the web application (back office) and the APIs.
diff --git a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
index 4061fb9f4cf..e619c2c8fda 100644
--- a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
+++ b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
@@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` (
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`affect` int(11) NOT NULL,
`delay` int(11) NOT NULL,
- `newByMonth` double(8,5) NOT NULL DEFAULT 0.00000,
+ `newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
`fk_country` int(11) DEFAULT NULL,
`active` int(11) DEFAULT 1,
PRIMARY KEY (`rowid`),
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 9596cd96af8..a842c294937 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -186,12 +186,28 @@ if ($action == 'update') {
$msg .= '
';
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 3f75ee30d02..7183605ae10 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -220,6 +220,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Define array with couple substitution key => substitution value
+ * For example {company_name}, {company_name_alias}
*
* @param Societe $object Object
* @param Translate $outputlangs Language object for output
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index faf2ab18d2c..f63081660d6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
- $ecmfile->src_object_type = $this->table_element;
+ $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
@@ -7808,7 +7808,7 @@ abstract class CommonObject
$out .= $labeltoshow;
}
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {
- $out .= ' *';
+ $out .= ' *';
}
} else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {
@@ -8220,7 +8220,7 @@ abstract class CommonObject
$return .= ' ';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) {
- $return .= 'id.'&action=addthumb&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').' ';
+ $return .= 'id.'&action=addthumb&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').' ';
}
// Special cas for product
if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) {
@@ -9405,6 +9405,11 @@ abstract class CommonObject
*/
public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = true)
{
+ // Handle single category
+ if (!is_array($categories)) {
+ $categories = array($categories);
+ }
+
dol_syslog(get_class($this)."::setCategoriesCommon Oject Id:".$this->id.' type_categ:'.$type_categ.' nb tag add:'.count($categories), LOG_DEBUG);
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@@ -9414,11 +9419,6 @@ abstract class CommonObject
return -1;
}
- // Handle single category
- if (!is_array($categories)) {
- $categories = array($categories);
- }
-
// Get current categories
$c = new Categorie($this->db);
$existing = $c->containing($this->id, $type_categ, 'id');
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 8e43a70c3fe..ee91d67b9ce 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -624,14 +624,15 @@ class Conf
if (!empty($this->global->MAILING_EMAIL_FROM)) {
$this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
}
- if (!isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) {
- $this->global->MAIN_EMAIL_ADD_TRACK_ID = 1;
- }
if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
$this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
}
+ if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
+ $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
+ }
+
// Format for date (used by default when not found or not searched in lang)
$this->format_date_short = "%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
$this->format_date_short_java = "dd/MM/yyyy"; // Format of day with Java tags
@@ -828,7 +829,10 @@ class Conf
// Enable by default the CSRF protection by token.
if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
- $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1; // Value 2 uses also CSRF check for all GET requests
+ // Value 1 makes CSRF check for all POST parameters only
+ // Value 2 makes also CSRF check for GET requests with action = a sensitive requests like action=del, action=remove...
+ // Value 3 makes also CSRF check for all GET requests with a param action or massaction
+ $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 1;
// Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended)
}
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index a1725526898..e4a91d903df 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -741,7 +741,7 @@ class DolGraph
/**
* Build a graph using JFlot library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
- * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
+ * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
* $this->legend= array("Val1",...,"Valn"); // list of n series name
* $this->type = array('bars',...'lines','linesnopoint'); or array('pie') or array('polar')
@@ -1028,7 +1028,7 @@ class DolGraph
/**
* Build a graph using Chart library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
- * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
+ * $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // when there is n series to show for each x
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
* $this->legend= array("Val1",...,"Valn"); // list of n series name
* $this->type = array('bars',...'lines', 'linesnopoint'); or array('pie') or array('polar') or array('piesemicircle');
@@ -1303,6 +1303,8 @@ class DolGraph
$this->stringtoshow .= 'var options = { maintainAspectRatio: false, aspectRatio: 2.5, ';
if (empty($showlegend)) {
$this->stringtoshow .= 'legend: { display: false }, ';
+ } else {
+ $this->stringtoshow .= 'legend: { position: \'' . ($showlegend == 2 ? 'right' : 'top') . '\' },';
}
$this->stringtoshow .= 'scales: { xAxes: [{ ';
if ($this->hideXValues) {
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 8deda2ecd09..99b2c3521c6 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -791,7 +791,7 @@ class Form
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER.
- $ret .= 'use_javascript_ajax) ? '' : ' style="display: none"').' class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
+ $ret .= 'use_javascript_ajax) ? '' : ' style="display: none"').' class="button small'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '';
if (!empty($conf->use_javascript_ajax)) {
@@ -1680,11 +1680,6 @@ class Form
if ($resql) {
$num = $this->db->num_rows($resql);
- if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
- }
-
if ($htmlname != 'none' && !$options_only) {
$out .= '';
}
+ if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
+ $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
+ }
+
$this->num = $num;
return $out;
} else {
@@ -5783,11 +5783,11 @@ class Form
return $num;
} else {
- $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).'';
+ $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).'';
return -1;
}
} else {
- $this->error = ''.$this->db->error().'';
+ $this->error = ''.$this->db->error().'';
return -2;
}
}
@@ -5838,9 +5838,9 @@ class Form
// Check parameters
if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
if ($societe_vendeuse->id == $mysoc->id) {
- $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").'';
+ $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").'';
} else {
- $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").'';
+ $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").'';
}
return $return;
}
@@ -7923,7 +7923,7 @@ class Form
}
if (!$nboftypesoutput) {
- print '
'.$langs->trans("None").'
';
+ print '
'.$langs->trans("None").'
';
}
print '';
@@ -8789,8 +8789,8 @@ class Form
public function showFilterButtons()
{
$out = '
'."\n";
}
}
@@ -1674,7 +1707,8 @@ class FormFile
dol_include_once($hookmanager->resArray['classpath']);
if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
if (class_exists($hookmanager->resArray['classname'])) {
- $object_instance = new ${$hookmanager->resArray['classname']}($this->db);
+ $tmpclassname = $hookmanager->resArray['classname'];
+ $object_instance = new $tmpclassname($this->db);
}
}
}
@@ -1813,9 +1847,11 @@ class FormFile
print '';
// File
+ // Check if document source has external module part, if it the case use it for module part on document.php
+ preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '
'."\n";
}
print ''."\n";
}
@@ -433,7 +433,7 @@ class MenuManager
print '';
}
} else {
- print $tabstring.''.$menu_array[$i]['titre'].'';
+ print $tabstring.''.$menu_array[$i]['titre'].'';
}
// If title is not pure text and contains a table, no carriage return added
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index 2e1ab3b5ef4..08d31e3cd95 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -295,12 +295,14 @@ class doc_generic_bom_odt extends ModelePDFBom
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- // On peut utiliser le nom de la societe du contact
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index adb26a38e0a..1e6aeac79e5 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -53,7 +53,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
public $phpmin = array(5, 6);
/**
- * @var string Dolibarr version of the loaded document
+ * Dolibarr version of the loaded document
+ * @var string
*/
public $version = 'dolibarr';
@@ -96,7 +97,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$this->option_freetext = 1; // Support add of a personalised text
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
- // Recupere emetteur
+ // Get source company
$this->emetteur = $mysoc;
if (!$this->emetteur->country_code) {
$this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined
@@ -234,6 +235,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$sav_charset_output = $outputlangs->charset_output;
$outputlangs->charset_output = 'UTF-8';
+ // Load translation files required by the page
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->commande->dir_output) {
@@ -271,7 +273,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$newfiletmp = preg_replace('/template_/i', '', $newfiletmp);
$newfiletmp = preg_replace('/modele_/i', '', $newfiletmp);
$newfiletmp = $objectref.'_'.$newfiletmp;
- //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
+
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
@@ -307,11 +309,14 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@@ -379,6 +384,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_other = $this->get_substitutionarray_other($outputlangs);
// retrieve contact information for use in object as contact_xxx tags
$array_thirdparty_contact = array();
+
if ($usecontact && is_object($contactobject)) {
$array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
}
@@ -455,7 +461,6 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
// Call the beforeODTSave hook
-
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index d45bab013e9..d83bf427ead 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -1449,7 +1449,7 @@ class pdf_einstein extends ModelePDFCommandes
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 52f96764473..01fde021cb0 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -1634,7 +1634,7 @@ class pdf_eratosthene extends ModelePDFCommandes
}
//Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index b1e441175d9..a640d342ddc 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -295,11 +295,14 @@ class doc_generic_contract_odt extends ModelePDFContract
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index 638c22221bd..69a4d5ce96e 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -720,7 +720,7 @@ class pdf_strato extends ModelePDFContract
$this->recipient = $object->thirdparty;
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
index 2893234e719..9c549576818 100644
--- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php
@@ -860,7 +860,7 @@ class pdf_storm extends ModelePDFDeliveryOrder
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
index 4656784f50d..19e319d0522 100644
--- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php
@@ -859,7 +859,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 5229645afe5..c504d97a854 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -307,11 +307,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a SHIPPING contact and we dont use as recipient we store the contact object for later use
+ // if we have a SHIPPING contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index 28d797acffc..cf8b03f1fea 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -29,7 +29,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
-
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
/**
* Class to build sending documents with model espadon
@@ -1121,7 +1121,7 @@ class pdf_espadon extends ModelePdfExpedition
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index f2434c93d26..56c8fb143fb 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -676,7 +676,7 @@ class pdf_merou extends ModelePdfExpedition
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index aa6603fa35a..4b542e4e636 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -1071,7 +1071,7 @@ class pdf_rouget extends ModelePdfExpedition
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index ec494302e93..ef20b4ff389 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -308,11 +308,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
+ // if we have a BILLING contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 0fe149af0df..037074bce23 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1927,7 +1927,7 @@ class pdf_crabe extends ModelePDFFactures
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 021f195c577..b919b90abfd 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -2143,7 +2143,7 @@ class pdf_sponge extends ModelePDFFactures
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index 37d64c43e17..e23a0aa1701 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -674,7 +674,7 @@ class pdf_soleil extends ModelePDFFicheinter
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index 7b2af1e0032..6ba84727b3f 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -295,11 +295,14 @@ class doc_generic_member_odt extends ModelePDFMember
// Recipient name
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index b6ad4c6b8ff..c2d697b4a4d 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -302,11 +302,14 @@ class doc_generic_mo_odt extends ModelePDFMo
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 05eef305c37..d702299769e 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -118,15 +118,10 @@ class doc_generic_product_odt extends ModelePDFProduct
$form = new Form($this->db);
$texte = $this->description.". \n";
- $texte .= '
';
@@ -319,11 +304,14 @@ class doc_generic_product_odt extends ModelePDFProduct
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@@ -344,7 +332,7 @@ class doc_generic_product_odt extends ModelePDFProduct
// Line of free text
$newfreetext = '';
- $paramfreetext = 'product_FREE_TEXT';
+ $paramfreetext = 'PRODUCT_FREE_TEXT';
if (!empty($conf->global->$paramfreetext)) {
$newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray);
}
@@ -372,7 +360,6 @@ class doc_generic_product_odt extends ModelePDFProduct
//print html_entity_decode($odfHandler->__toString());
//print exit;
- $object->fetch_optionals();
// Make substitutions into odt of freetext
try {
@@ -399,7 +386,7 @@ class doc_generic_product_odt extends ModelePDFProduct
complete_substitutions_array($tmparray, $outputlangs, $object);
// Call the ODTSubstitution hook
- $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach ($tmparray as $key => $value) {
@@ -480,6 +467,7 @@ class doc_generic_product_odt extends ModelePDFProduct
}
}
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (!empty($conf->global->MAIN_UMASK)) {
diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php
index 0f069143ab1..def14bd37b3 100644
--- a/htdocs/core/modules/product_batch/mod_lot_free.php
+++ b/htdocs/core/modules/product_batch/mod_lot_free.php
@@ -18,7 +18,7 @@
*/
/**
- * \file htdocs/core/modules/product/mod_lot_free.php
+ * \file htdocs/core/modules/product_batch/mod_lot_free.php
* \ingroup productbatch
* \brief File containing class for numbering model of Lot free
*/
diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php
index 5e8fde199c1..abe094220d2 100644
--- a/htdocs/core/modules/product_batch/mod_sn_advanced.php
+++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php
@@ -22,7 +22,7 @@
*/
/**
- * \file htdocs/core/modules/product_batch/mod_batch_advanced.php
+ * \file htdocs/core/modules/product_batch/mod_sn_advanced.php
* \ingroup productbatch
* \brief File containing class for numbering model of SN advanced
*/
diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php
index 95e1bd20359..67d39ec085a 100644
--- a/htdocs/core/modules/product_batch/mod_sn_free.php
+++ b/htdocs/core/modules/product_batch/mod_sn_free.php
@@ -18,7 +18,7 @@
*/
/**
- * \file htdocs/core/modules/product/mod_sn_free.php
+ * \file htdocs/core/modules/product_batch/mod_sn_free.php
* \ingroup productbatch
* \brief File containing class for numbering model of SN free
*/
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index bd2fcfa471f..fb0991c8da1 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -335,11 +335,14 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index bf079c47b66..e964d61cda3 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1616,7 +1616,7 @@ class pdf_azur extends ModelePDFPropales
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 97f76df31bb..9dcccb92fdc 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -1731,7 +1731,7 @@ class pdf_cyan extends ModelePDFPropales
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 34d34ec3e19..4729231ac8b 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -62,8 +62,7 @@ class doc_generic_reception_odt extends ModelePdfReception
{
global $conf, $langs, $mysoc;
- $langs->load("main");
- $langs->load("companies");
+ $langs->loadLangs(array("main", "companies"));
$this->db = $db;
$this->name = "ODT templates";
@@ -173,6 +172,11 @@ class doc_generic_reception_odt extends ModelePdfReception
}
$texte .= '';
}
+ // Add input to upload a new template file.
+ $texte .= '
';
@@ -223,10 +227,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$sav_charset_output = $outputlangs->charset_output;
$outputlangs->charset_output = 'UTF-8';
- $outputlangs->load("main");
- $outputlangs->load("dict");
- $outputlangs->load("companies");
- $outputlangs->load("bills");
+ $outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
if ($conf->reception->dir_output."/reception") {
// If $object is id instead of object
@@ -288,21 +289,25 @@ class doc_generic_reception_odt extends ModelePdfReception
return -1;
}
- // If BILLING contact defined on invoice, we use it
+ // If CUSTOMER contact defined on reception, we use it
$usecontact = false;
- $arrayidcontact = $object->getIdContact('external', 'BILLING');
+ $arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
if (count($arrayidcontact) > 0) {
$usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
+ $contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
@@ -318,6 +323,7 @@ class doc_generic_reception_odt extends ModelePdfReception
'__TOTAL_VAT__' => $object->total_tva
);
complete_substitutions_array($substitutionarray, $langs, $object);
+
// Call the ODTSubstitution hook
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@@ -343,6 +349,7 @@ class doc_generic_reception_odt extends ModelePdfReception
);
} catch (Exception $e) {
$this->error = $e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
// After construction $odfHandler->contentXml contains content and
@@ -359,67 +366,23 @@ class doc_generic_reception_odt extends ModelePdfReception
dol_syslog($e->getMessage(), LOG_INFO);
}
- // Make substitutions into odt of user info
- $tmparray = $this->get_substitutionarray_user($user, $outputlangs);
- //var_dump($tmparray); exit;
- foreach ($tmparray as $key => $value) {
- try {
- if (preg_match('/logo$/', $key)) { // Image
- //var_dump($value);exit;
- if (file_exists($value)) {
- $odfHandler->setImage($key, $value);
- } else {
- $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
- }
- } else // Text
- {
- $odfHandler->setVars($key, $value, true, 'UTF-8');
- }
- } catch (OdfException $e) {
- dol_syslog($e->getMessage(), LOG_INFO);
- }
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet = $this->get_substitutionarray_object($object, $outputlangs);
+ $array_user = $this->get_substitutionarray_user($user, $outputlangs);
+ $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
+ $array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
+ $array_other = $this->get_substitutionarray_other($outputlangs);
+ // retrieve contact information for use in object as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact && is_object($contactobject)) {
+ $array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
}
- // Make substitutions into odt of mysoc
- $tmparray = $this->get_substitutionarray_mysoc($mysoc, $outputlangs);
- //var_dump($tmparray); exit;
- foreach ($tmparray as $key => $value) {
- try {
- if (preg_match('/logo$/', $key)) { // Image
- //var_dump($value);exit;
- if (file_exists($value)) {
- $odfHandler->setImage($key, $value);
- } else {
- $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
- }
- } else // Text
- {
- $odfHandler->setVars($key, $value, true, 'UTF-8');
- }
- } catch (OdfException $e) {
- dol_syslog($e->getMessage(), LOG_INFO);
- }
- }
- // Make substitutions into odt of thirdparty
- $tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
- foreach ($tmparray as $key => $value) {
- try {
- if (preg_match('/logo$/', $key)) { // Image
- if (file_exists($value)) {
- $odfHandler->setImage($key, $value);
- } else {
- $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8');
- }
- } else // Text
- {
- $odfHandler->setVars($key, $value, true, 'UTF-8');
- }
- } catch (OdfException $e) {
- dol_syslog($e->getMessage(), LOG_INFO);
- }
- }
- // Replace tags of object + external modules
- $tmparray = $this->get_substitutionarray_reception($object, $outputlangs);
+
+ $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_user, $array_soc, $array_thirdparty, $array_objet, $array_other, $array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
// Call the ODTSubstitution hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@@ -441,25 +404,36 @@ class doc_generic_reception_odt extends ModelePdfReception
}
// Replace tags of lines
try {
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line) {
- $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
- $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- foreach ($tmparray as $key => $val) {
- try {
- $listlines->setVars($key, $val, true, 'UTF-8');
- } catch (OdfException $e) {
- dol_syslog($e->getMessage(), LOG_INFO);
- } catch (SegmentException $e) {
- dol_syslog($e->getMessage(), LOG_INFO);
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ } catch (OdfException $e) {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines) {
+ $linenumber = 0;
+ foreach ($object->lines as $line) {
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
+ $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ foreach ($tmparray as $key => $val) {
+ try {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ } catch (OdfException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
+ } catch (SegmentException $e) {
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
} catch (OdfException $e) {
$this->error = $e->getMessage();
dol_syslog($this->error, LOG_WARNING);
@@ -486,6 +460,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
} else {
@@ -493,6 +468,7 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler->saveToDisk($file);
} catch (Exception $e) {
$this->error = $e->getMessage();
+ dol_syslog($e->getMessage(), LOG_INFO);
return -1;
}
}
@@ -505,6 +481,8 @@ class doc_generic_reception_odt extends ModelePdfReception
$odfHandler = null; // Destroy object
+ $this->result = array('fullpath'=>$file);
+
return 1; // Success
} else {
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
index 68ceb87ba96..38344a5f486 100644
--- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php
+++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php
@@ -972,7 +972,7 @@ class pdf_squille extends ModelePdfReception
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index 2e48160d038..1d02b8003da 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -308,11 +308,14 @@ class doc_generic_stock_odt extends ModelePDFStock
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
index 3119ffa8dc5..c4fb2ef7b50 100644
--- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
@@ -1238,7 +1238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $mysoc;
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index 49ba1ec6cdf..dfb05d2d55f 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -298,11 +298,14 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index 3e04844119b..436017cda0a 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -1407,7 +1407,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
index bb12b19c829..8c706f59db3 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -1314,7 +1314,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// Recipient name
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 8cd572a1bcf..18e5a210aa1 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -332,11 +332,14 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 5bd9b8cf339..1bf47275599 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -1418,7 +1418,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
// Recipient name
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socname = $object->contact;
} else {
$socname = $object->thirdparty;
diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
index 82ce006447e..e20cbf44cf7 100644
--- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
+++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
@@ -293,11 +293,14 @@ class doc_generic_ticket_odt extends ModelePDFTicket
// Recipient name
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index 7e07539aa8e..050eb43d44a 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -325,7 +325,7 @@ class doc_generic_user_odt extends ModelePDFUser
// Recipient name
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$socobject = $object->contact;
} else {
$socobject = $object->thirdparty;
diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
index cf91120d3f8..134c5e00362 100644
--- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
+++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
@@ -315,11 +315,14 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Recipient name
if (!empty($usecontact)) {
- if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
- $socobject = $object->contact;
+ // We can use the company of contact instead of thirdparty company
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ $object->contact->fetch_thirdparty();
+ $socobject = $object->contact->thirdparty;
+ $contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
- // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
+ // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {
diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php
index 2f1c113fcf5..6750cc0b1a5 100644
--- a/htdocs/core/tpl/admin_extrafields_view.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php
@@ -141,9 +141,9 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
}
print '
';
- print '
';
+ print '
';
print $langs->trans("None");
- print '
';
+ print '';
print '
';
}
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 2961dea7c96..212e766589c 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -146,10 +146,6 @@ if ($action == 'presend') {
$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
- include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
- }
$formmail->withfrom = 1;
// Fill list of recipient with email inside <>.
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 078b68d864e..3def83f4e0d 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -135,19 +135,19 @@ if ($permission) {
+
';
} ?>
-
';
if ($userstatic->id) {
- print $userstatic->getLoginUrl(1);
+ print $userstatic->getLoginUrl(-1);
} else {
print ' ';
}
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index e13d43c612d..55d92b7835b 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -1447,7 +1447,7 @@ class Holiday extends CommonObject
// Update each user counter
foreach ($users as $userCounter) {
- $nbDaysToAdd = (isset($typeleaves[$userCounter['type']]['newByMonth']) ? $typeleaves[$userCounter['type']]['newByMonth'] : 0);
+ $nbDaysToAdd = (isset($typeleaves[$userCounter['type']]['newbymonth']) ? $typeleaves[$userCounter['type']]['newbymonth'] : 0);
if (empty($nbDaysToAdd)) {
continue;
}
@@ -2081,7 +2081,7 @@ class Holiday extends CommonObject
{
global $mysoc;
- $sql = "SELECT rowid, code, label, affect, delay, newByMonth";
+ $sql = "SELECT rowid, code, label, affect, delay, newbymonth";
$sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types";
$sql .= " WHERE (fk_country IS NULL OR fk_country = ".((int) $mysoc->country_id).')';
if ($active >= 0) {
@@ -2096,7 +2096,7 @@ class Holiday extends CommonObject
$num = $this->db->num_rows($result);
if ($num) {
while ($obj = $this->db->fetch_object($result)) {
- $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth);
+ $types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newbymonth'=>$obj->newbymonth);
}
return $types;
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index fdcdb5f88e6..621443fb408 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -358,7 +358,7 @@ if (count($typeleaves) == 0) {
//var_dump($users['rowid'].' - '.$val['rowid']);
print '
';
if ($canedit) {
- print '';
+ print '';
} else {
print $nbtoshow;
}
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 5139e12ab7a..2ab7e3976aa 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -1205,7 +1205,7 @@ if ($step == 4 && $datatoimport) {
// async: false
// });'."\n";
// Now reload page
- print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&boxorder=\' + boxorder;'."\n";
+ print 'var newlocation= \''.$_SERVER["PHP_SELF"].'?step=4'.$param.'&action=saveorder&token='.newToken().'&boxorder=\' + boxorder;'."\n";
//print 'alert(newlocation);';
print 'window.location.href=newlocation;'."\n";
print '}'."\n";
diff --git a/htdocs/index.php b/htdocs/index.php
index 880b5577bbb..8c1433c79cb 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -337,6 +337,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
),
'supplier_proposal' =>
array(
+ 'lang' => 'supplier_proposal',
'groupName' => 'SupplierProposals',
'globalStatsKey' => 'askprice',
'stats' =>
@@ -486,6 +487,9 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
if (!empty($boards)) {
+ if (!empty($groupElement['lang'])) {
+ $langs->load($groupElement['lang']);
+ }
$groupName = $langs->trans($groupElement['groupName']);
$groupKeyLowerCase = strtolower($groupKey);
$nbTotalForGroup = 0;
diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql
index 4465756f00a..7217fda7d09 100644
--- a/htdocs/install/mysql/data/llx_00_c_country.sql
+++ b/htdocs/install/mysql/data/llx_00_c_country.sql
@@ -279,5 +279,5 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (24
-- Set field eec
-UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IM','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');
+UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','DK','EE','ES','FI','FR','GR','HR','NL','HU','IE','IT','LT','LU','LV','MC','MT','PL','PT','RO','SE','SK','SI');
diff --git a/htdocs/install/mysql/data/llx_c_holiday_type.sql b/htdocs/install/mysql/data/llx_c_holiday_type.sql
index addd7f9942e..65f9a51b037 100644
--- a/htdocs/install/mysql/data/llx_c_holiday_type.sql
+++ b/htdocs/install/mysql/data/llx_c_holiday_type.sql
@@ -25,12 +25,12 @@
--
-- Generic to all countries
-insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL, 1);
-insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_OTHER', 'Other leave', 0, 0, 0, NULL, 1);
+insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_SICK', 'Sick leave', 0, 0, 0, NULL, 1);
+insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_OTHER', 'Other leave', 0, 0, 0, NULL, 1);
-- Not enabled by default, we prefer to have an entrey dedicated to country
-insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL, 0);
+insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_PAID', 'Paid vacation', 1, 7, 0, NULL, 0);
-- Leaves specific to France
-insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_RTT_FR', 'RTT' , 1, 7, 0.83, 1, 1);
-insert into llx_c_holiday_types(code, label, affect, delay, newByMonth, fk_country, active) values ('LEAVE_PAID_FR', 'Paid vacation', 1, 30, 2.08334, 1, 1);
+insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_RTT_FR', 'RTT' , 1, 7, 0.83, 1, 1);
+insert into llx_c_holiday_types(code, label, affect, delay, newbymonth, fk_country, active) values ('LEAVE_PAID_FR', 'Paid vacation', 1, 30, 2.08334, 1, 1);
diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql
index cae269783e4..12b0b92a13e 100644
--- a/htdocs/install/mysql/data/llx_c_tva.sql
+++ b/htdocs/install/mysql/data/llx_c_tva.sql
@@ -330,7 +330,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (107,10, '6','0','VAT 6%', 1);
-insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0);
+insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (108,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0);
-- UKRAINE (id country=226)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT rate 0',1);
@@ -379,10 +379,6 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 4
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1);
--- SOUTH AFRICA (id country=205)
-INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1);
-INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1);
-
-- VENEZUELA (id country=232)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1);
diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql
index 2f2975a158c..d7193d87a49 100644
--- a/htdocs/install/mysql/data/llx_const.sql
+++ b/htdocs/install/mysql/data/llx_const.sql
@@ -85,7 +85,7 @@ insert into llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXP
--
-- Mail Mailing
--
-insert into llx_const (name, value, type, note, visible) values ('MAIN_FIX_FOR_BUGGED_MTA','1','chaine','Set constant to fix email ending from PHP with some linux ike system',1);
+--insert into llx_const (name, value, type, note, visible) values ('MAIN_FIX_FOR_BUGGED_MTA','1','chaine','Set constant to fix email ending from PHP with some linux like system',1);
insert into llx_const (name, value, type, note, visible) values ('MAILING_EMAIL_FROM','no-reply@mydomain.com','chaine','EMail emmetteur pour les envois d emailings',0);
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 912eb7fe0eb..82a6bdec3dc 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
@@ -78,6 +78,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
-- v15
+
+ALTER TABLE llx_c_holiday_types CHANGE COLUMN newByMonth newbymonth double(8,5) DEFAULT 0 NOT NULL;
+
ALTER TABLE llx_product ADD COLUMN mandatory_period tinyint NULL DEFAULT 0;
ALTER TABLE llx_holiday ADD COLUMN date_approve DATETIME DEFAULT NULL;
@@ -128,7 +131,7 @@ ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgem
ALTER TABLE llx_categorie_knowledgemanagement ADD INDEX idx_categorie_knowledgemanagement_fk_knowledgemanagement (fk_knowledgemanagement);
ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
-ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_knowledgemanagement_rowid FOREIGN KEY (fk_knowledgemanagement) REFERENCES llx_knowledgemanagement (rowid);
+ALTER TABLE llx_categorie_knowledgemanagement ADD CONSTRAINT fk_categorie_knowledgemanagement_knowledgemanagement_rowid FOREIGN KEY (fk_knowledgemanagement) REFERENCES llx_knowledgemanagement_knowledgerecord (rowid);
ALTER TABLE llx_product_lot ADD COLUMN barcode varchar(180) DEFAULT NULL;
ALTER TABLE llx_product_lot ADD COLUMN fk_barcode_type integer DEFAULT NULL;
@@ -150,3 +153,220 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2010', '
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2011', 'Ideell förening');
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (20, '2012', 'Stiftelse');
+-- START GRH/HRM MODULE
+
+
+CREATE TABLE llx_hrm_evaluation(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ ref varchar(128) DEFAULT '(PROV)' NOT NULL,
+ label varchar(255),
+ description text,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ import_key varchar(14),
+ status smallint NOT NULL,
+ date_eval date,
+ fk_user integer NOT NULL,
+ fk_job integer NOT NULL
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid);
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref);
+ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_status (status);
+
+
+create table llx_hrm_evaluation_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object);
+
+
+CREATE TABLE llx_hrm_evaluationdet(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ fk_skill integer NOT NULL,
+ fk_evaluation integer NOT NULL,
+ rank integer NOT NULL,
+ required_rank integer NOT NULL,
+ import_key varchar(14)
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid);
+ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_skill (fk_skill);
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_evaluation (fk_evaluation);
+
+
+create table llx_hrm_evaluationdet_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object);
+
+
+
+
+CREATE TABLE llx_hrm_job(
+
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ label varchar(255) NOT NULL,
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ deplacement varchar(255),
+ note_public text,
+ note_private text,
+ fk_user_creat integer,
+ fk_user_modif integer
+
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid);
+ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_label (label);
+
+
+create table llx_hrm_job_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object);
+
+
+
+CREATE TABLE llx_hrm_job_user(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ -- ref varchar(128) NOT NULL,
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_contrat integer,
+ fk_user integer NOT NULL,
+ fk_job integer NOT NULL,
+ date_start date,
+ date_end date,
+ commentaire_abandon varchar(255),
+ note_public text,
+ note_private text,
+ fk_user_creat integer,
+ fk_user_modif integer
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid);
+-- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref);
+
+
+create table llx_hrm_job_user_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object);
+
+
+
+CREATE TABLE llx_hrm_skill(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ label varchar(255),
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ required_level integer NOT NULL,
+ date_validite integer NOT NULL,
+ temps_theorique double(24,8) NOT NULL,
+ skill_type integer NOT NULL,
+ note_public text,
+ note_private text
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid);
+ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_skill_type (skill_type);
+
+create table llx_hrm_skill_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object);
+
+
+CREATE TABLE llx_hrm_skilldet(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ description text,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ fk_skill integer NOT NULL,
+ rank integer
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid);
+ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+
+create table llx_hrm_skilldet_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object);
+
+
+CREATE TABLE llx_hrm_skillrank(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ fk_skill integer NOT NULL,
+ rank integer NOT NULL,
+ fk_object integer NOT NULL,
+ date_creation datetime NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ objecttype varchar(128) NOT NULL
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
+
+ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid);
+ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill);
+ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+
+--END GRH/HRM MODULE
diff --git a/htdocs/install/mysql/tables/llx_c_holiday_types.sql b/htdocs/install/mysql/tables/llx_c_holiday_types.sql
index 9c09d486bec..b602ee1d330 100644
--- a/htdocs/install/mysql/tables/llx_c_holiday_types.sql
+++ b/htdocs/install/mysql/tables/llx_c_holiday_types.sql
@@ -22,7 +22,7 @@ CREATE TABLE llx_c_holiday_types (
label varchar(255) NOT NULL,
affect integer NOT NULL, -- a request will change sold or not
delay integer NOT NULL, -- Minimum delay to be allowed to make request
- newByMonth double(8,5) DEFAULT 0 NOT NULL, -- Amount of new days for each user each month
+ newbymonth double(8,5) DEFAULT 0 NOT NULL, -- Amount of new days for each user each month
fk_country integer DEFAULT NULL, -- This type is dedicated to a country
active integer DEFAULT 1
) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql
new file mode 100644
index 00000000000..804bc6b4803
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluation.key.sql
@@ -0,0 +1,29 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_rowid (rowid);
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_ref (ref);
+ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_evaluation ADD INDEX idx_hrm_evaluation_status (status);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_evaluation ADD UNIQUE INDEX uk_hrm_evaluation_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_evaluation ADD CONSTRAINT llx_hrm_evaluation_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation.sql
new file mode 100644
index 00000000000..bc9b7a1effc
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluation.sql
@@ -0,0 +1,37 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_evaluation(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ ref varchar(128) DEFAULT '(PROV)' NOT NULL,
+ label varchar(255),
+ description text,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ import_key varchar(14),
+ status smallint NOT NULL,
+ date_eval date,
+ fk_user integer NOT NULL,
+ fk_job integer NOT NULL
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql
new file mode 100644
index 00000000000..ff9ba9d6cb6
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_evaluation_extrafields ADD INDEX idx_evaluation_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql
new file mode 100644
index 00000000000..da00cc3c333
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluation_extrafields.sql
@@ -0,0 +1,25 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_evaluation_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql
new file mode 100644
index 00000000000..05309ce57e2
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.key.sql
@@ -0,0 +1,29 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_rowid (rowid);
+ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_skill (fk_skill);
+ALTER TABLE llx_hrm_evaluationdet ADD INDEX idx_hrm_evaluationdet_fk_evaluation (fk_evaluation);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_evaluationdet ADD UNIQUE INDEX uk_hrm_evaluationdet_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_evaluationdet ADD CONSTRAINT llx_hrm_evaluationdet_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql
new file mode 100644
index 00000000000..0509cc80146
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet.sql
@@ -0,0 +1,32 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_evaluationdet(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ fk_skill integer NOT NULL,
+ fk_evaluation integer NOT NULL,
+ rank integer NOT NULL,
+ required_rank integer NOT NULL,
+ import_key varchar(14)
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql
new file mode 100644
index 00000000000..5072e2eb67b
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_evaluationdet_extrafields ADD INDEX idx_evaluationdet_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql
new file mode 100644
index 00000000000..4d4031ba228
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_evaluationdet_extrafields.sql
@@ -0,0 +1,24 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_evaluationdet_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_job.key.sql b/htdocs/install/mysql/tables/llx_hrm_job.key.sql
new file mode 100644
index 00000000000..6fe7da6016e
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job.key.sql
@@ -0,0 +1,27 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_rowid (rowid);
+ALTER TABLE llx_hrm_job ADD INDEX idx_hrm_job_label (label);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_job ADD UNIQUE INDEX uk_hrm_job_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_job ADD CONSTRAINT llx_hrm_job_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_job.sql b/htdocs/install/mysql/tables/llx_hrm_job.sql
new file mode 100644
index 00000000000..51f472af377
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job.sql
@@ -0,0 +1,32 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_job(
+
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ label varchar(255) NOT NULL,
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ deplacement varchar(255),
+ note_public text,
+ note_private text,
+ fk_user_creat integer,
+ fk_user_modif integer
+
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql
new file mode 100644
index 00000000000..b5226dc4c38
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_job_extrafields ADD INDEX idx_job_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql
new file mode 100644
index 00000000000..10cccf1c36f
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_extrafields.sql
@@ -0,0 +1,25 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_job_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql
new file mode 100644
index 00000000000..ead2f7f3b18
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_user.key.sql
@@ -0,0 +1,27 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_rowid (rowid);
+-- ALTER TABLE llx_hrm_job_user ADD INDEX idx_hrm_job_user_ref (ref);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_job_user ADD UNIQUE INDEX uk_hrm_job_user_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_job_user ADD CONSTRAINT llx_hrm_job_user_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user.sql b/htdocs/install/mysql/tables/llx_hrm_job_user.sql
new file mode 100644
index 00000000000..ce9620623dd
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_user.sql
@@ -0,0 +1,36 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+CREATE TABLE llx_hrm_job_user(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ -- ref varchar(128) NOT NULL,
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_contrat integer,
+ fk_user integer NOT NULL,
+ fk_job integer NOT NULL,
+ date_start datetime,
+ date_end datetime,
+ commentaire_abandon varchar(255),
+ note_public text,
+ note_private text,
+ fk_user_creat integer,
+ fk_user_modif integer
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql
new file mode 100644
index 00000000000..99ed1f4c1bc
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_job_user_extrafields ADD INDEX idx_position_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql
new file mode 100644
index 00000000000..7495563f68d
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_job_user_extrafields.sql
@@ -0,0 +1,25 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_job_user_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill.key.sql
new file mode 100644
index 00000000000..b3196bf8522
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skill.key.sql
@@ -0,0 +1,28 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_rowid (rowid);
+ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_hrm_skill ADD INDEX idx_hrm_skill_skill_type (skill_type);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_skill ADD UNIQUE INDEX uk_hrm_skill_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_skill ADD CONSTRAINT llx_hrm_skill_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skill.sql b/htdocs/install/mysql/tables/llx_hrm_skill.sql
new file mode 100644
index 00000000000..96a31be588a
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skill.sql
@@ -0,0 +1,35 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_skill(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ label varchar(255),
+ description text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ required_level integer NOT NULL,
+ date_validite integer NOT NULL,
+ temps_theorique double(24,8) NOT NULL,
+ skill_type integer NOT NULL,
+ note_public text,
+ note_private text
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql
new file mode 100644
index 00000000000..a4ae591731e
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_skill_extrafields ADD INDEX idx_skill_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql
new file mode 100644
index 00000000000..d47657e34f8
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skill_extrafields.sql
@@ -0,0 +1,25 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_skill_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql
new file mode 100644
index 00000000000..289276e07b5
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skilldet.key.sql
@@ -0,0 +1,27 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_skilldet ADD INDEX idx_hrm_skilldet_rowid (rowid);
+ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_skilldet ADD UNIQUE INDEX uk_hrm_skilldet_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_skilldet ADD CONSTRAINT llx_hrm_skilldet_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql
new file mode 100644
index 00000000000..fba82645915
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skilldet.sql
@@ -0,0 +1,28 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_skilldet(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ description text,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ fk_skill integer NOT NULL,
+ rank integer
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql
new file mode 100644
index 00000000000..319eb193a18
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.key.sql
@@ -0,0 +1,21 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+--
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_skilldet_extrafields ADD INDEX idx_skilldet_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql
new file mode 100644
index 00000000000..a6e14f476c0
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skilldet_extrafields.sql
@@ -0,0 +1,24 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+-- 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 https://www.gnu.org/licenses/.
+
+create table llx_hrm_skilldet_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql
new file mode 100644
index 00000000000..11d89b0187c
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skillrank.key.sql
@@ -0,0 +1,27 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+-- 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 https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_rowid (rowid);
+ALTER TABLE llx_hrm_skillrank ADD INDEX idx_hrm_skillrank_fk_skill (fk_skill);
+ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+-- END MODULEBUILDER INDEXES
+
+--ALTER TABLE llx_hrm_skillrank ADD UNIQUE INDEX uk_hrm_skillrank_fieldxy(fieldx, fieldy);
+
+--ALTER TABLE llx_hrm_skillrank ADD CONSTRAINT llx_hrm_skillrank_fk_field FOREIGN KEY (fk_field) REFERENCES llx_hrm_myotherobject(rowid);
+
diff --git a/htdocs/install/mysql/tables/llx_hrm_skillrank.sql b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql
new file mode 100644
index 00000000000..5c4deb95938
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_hrm_skillrank.sql
@@ -0,0 +1,30 @@
+-- Copyright (C) 2021 Gauthier VERDOL
+-- Copyright (C) 2021 Greg Rastklan
+-- Copyright (C) 2021 Jean-Pascal BOUDET
+-- 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 https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_hrm_skillrank(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ fk_skill integer NOT NULL,
+ rank integer NOT NULL,
+ fk_object integer NOT NULL,
+ date_creation datetime NOT NULL,
+ tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ objecttype varchar(128) NOT NULL
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_usergroup.sql
similarity index 100%
rename from htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql
rename to htdocs/install/mysql/tables/llx_workstation_workstation_usergroup.sql
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index 129ee9d7827..b36914ad36b 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -283,7 +283,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
$db->free($resql);
} else {
if ($db->lasterrno() != 'DB_ERROR_NOSUCHTABLE') {
- print '
\n";
}
}
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index e63323e6c33..9b3d6b02af3 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -133,7 +133,6 @@ IdModule=Module ID
IdPermissions=Permissions ID
LanguageBrowserParameter=Parameter %s
LocalisationDolibarrParameters=Localization parameters
-ClientTZ=Client Time Zone (user)
ClientHour=Client time (user)
OSTZ=Server OS Time Zone
PHPTZ=PHP server Time Zone
@@ -161,7 +160,7 @@ Purge=Purge
PurgeAreaDesc=This page allows you to delete all files generated or stored by Dolibarr (temporary files or all files in %s directory). Using this feature is not normally necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server.
PurgeDeleteLogFile=Delete log files, including %s defined for Syslog module (no risk of losing data)
PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago.
-PurgeDeleteTemporaryFilesShort=Delete log and temporary files
+PurgeDeleteTemporaryFilesShort=Delete log and temporary files (no risk of losing data)
PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory: %s. This will delete all generated documents related to elements (third parties, invoices etc...), files uploaded into the ECM module, database backup dumps and temporary files.
PurgeRunNow=Purge now
PurgeNothingToDelete=No directory or files to delete.
@@ -518,6 +517,8 @@ ProductDocumentTemplates=Document templates to generate product document
FreeLegalTextOnExpenseReports=Free legal text on expense reports
WatermarkOnDraftExpenseReports=Watermark on draft expense reports
ProjectIsRequiredOnExpenseReports=The project is mandatory for entering an expense report
+PrefillExpenseReportDatesWithCurrentMonth=Pre-fill start and end dates of new expense report with start and end dates of the current month
+ForceExpenseReportsLineAmountsIncludingTaxesOnly=Force the entry of expense report amounts always in amount with taxes
AttachMainDocByDefault=Set this to 1 if you want to attach main document to email by default (if applicable)
FilesAttachedToEmail=Attach file
SendEmailsReminders=Send agenda reminders by emails
@@ -2157,7 +2158,7 @@ NoWritableFilesFoundIntoRootDir=No writable files or directories of the common p
RecommendedValueIs=Recommended: %s
Recommended=Recommended
NotRecommended=Not recommended
-ARestrictedPath=A restricted path
+ARestrictedPath=Some restricted path
CheckForModuleUpdate=Check for external modules updates
CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available.
ModuleUpdateAvailable=An update is available
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index e475a815ac9..afdff97ded6 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -265,6 +265,7 @@ DateInvoice=Invoice date
DatePointOfTax=Point of tax
NoInvoice=No invoice
NoOpenInvoice=No open invoice
+NbOfOpenInvoices=Number of open invoices
ClassifyBill=Classify invoice
SupplierBillsToPay=Unpaid vendor invoices
CustomerBillsUnpaid=Unpaid customer invoices
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index b68b62c2a43..fb6e20adcca 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1155,4 +1155,5 @@ ConfirmMassLeaveApproval=Mass leave approval confirmation
RecordAproved=Record approved
RecordsApproved=%s Record(s) approved
Properties=Properties
-hasBeenValidated=%s has been validated
\ No newline at end of file
+hasBeenValidated=%s has been validated
+ClientTZ=Client Time Zone (user)
diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index 763af20c6b4..71e44e8f281 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -37,7 +37,8 @@ ManufacturingDate=Manufacturing date
DestructionDate=Destruction date
FirstUseDate=First use date
QCFrequency=Quality control frequency (in days)
-
+ShowAllLots=Show all lots
+HideLots=Hide lots
#Traceability - qc status
OutOfOrder=Out of order
InWorkingOrder=In working order
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 6f6d74c0cda..7775071a55c 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -465,13 +465,13 @@ if (!defined('NOTOKENRENEWAL') && !defined('NOSESSION')) {
if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN')) || defined('CSRFCHECK_WITH_TOKEN')) {
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
$sensitiveget = false;
- if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') == 2) {
+ if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
// All GET actions and mass actions are processed as sensitive.
$sensitiveget = true;
- } else {
- // Only GET actions coded with a &token into url are processed as sensitive.
+ } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) {
+ // Few GET actions coded with a &token into url are processed as sensitive.
$arrayofactiontoforcetokencheck = array(
- 'activate', 'add', 'addrights', 'addtimespent',
+ 'activate',
'doprev', 'donext', 'dvprev', 'dvnext',
'install',
'reopen'
@@ -479,7 +479,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) {
$sensitiveget = true;
}
- if (preg_match('/^(classify|close|confirm|del|disable|enable|remove|set|unset|update)/', GETPOST('action', 'aZ09'))) {
+ if (preg_match('/^(add|classify|close|confirm|copy|del|disable|enable|remove|set|unset|update|save)/', GETPOST('action', 'aZ09'))) {
$sensitiveget = true;
}
}
@@ -3081,7 +3081,7 @@ if (!function_exists("llxFooter")) {
*/
function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0)
{
- global $conf, $db, $langs, $user, $mysoc, $object;
+ global $conf, $db, $langs, $user, $mysoc, $object, $hookmanager;
global $delayedhtmlcontent;
global $contextpage, $page, $limit;
global $dolibarr_distrib;
@@ -3304,6 +3304,11 @@ if (!function_exists("llxFooter")) {
}
}
+ $reshook = $hookmanager->executeHooks('beforeBodyClose'); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) {
+ print $hookmanager->resPrint;
+ }
+
print "