diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 4225dad5f31..dd2593329e0 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -657,7 +657,7 @@ class Adherent extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0) {
@@ -927,14 +927,11 @@ class Adherent extends CommonObject
// Removed extrafields
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
- {
- $result = $this->deleteExtraFields();
- if ($result < 0) {
- $error++;
- $errorflag = -4;
- dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
- }
+ $result = $this->deleteExtraFields();
+ if ($result < 0) {
+ $error++;
+ $errorflag = -4;
+ dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 442d8cf091f..46733575c36 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -409,7 +409,7 @@ class AdherentType extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php
index ce327cc5187..223045db2e9 100644
--- a/htdocs/admin/facture_situation.php
+++ b/htdocs/admin/facture_situation.php
@@ -36,13 +36,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'other', 'bills'));
-if (! $user->admin) accessforbidden();
+if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'alpha');
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
-$type='invoice';
+$type = 'invoice';
/*
@@ -57,17 +57,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
* View
*/
-$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
+$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader(
"", $langs->trans("BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'
);
-$form=new Form($db);
+$form = new Form($db);
-$linkback=''.$langs->trans("BackToModuleList").'';
+$linkback = ''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup');
$head = invoice_admin_prepare_head();
@@ -106,12 +106,12 @@ $arrayAvailableType = array(
);
$selected = array();
$implodeglue = '+';
-if(!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})){
+if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) {
$selected = explode('+', $conf->global->{$confkey});
}
-$curentInput = (empty($inputCount)?1:($inputCount+1));
-$formSelectInvoiceType = $form->selectarray('value'. $curentInput, $arrayAvailableType, $selected, 1);
+$curentInput = (empty($inputCount) ? 1 : ($inputCount + 1));
+$formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1);
_printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType);
//_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituation'));
@@ -126,7 +126,7 @@ $metas = array(
_printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans('RetainedwarrantyDefaultPercent'), '', $metas);
// Conditions paiements
-$inputCount = empty($inputCount)?1:($inputCount+1);
+$inputCount = empty($inputCount) ? 1 : ($inputCount + 1);
print '
| '.$langs->trans('PaymentConditionsShortRetainedWarranty').' | ';
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
- if(empty($retained_warranty_fk_cond_reglement)){
+ if (empty($retained_warranty_fk_cond_reglement)) {
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
- if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value
+ if (!empty($objectsrc->retained_warranty_fk_cond_reglement)) { // use previous situation value
$retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement;
- }else{
+ } else {
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
}
}
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 205ca88290e..bbb926f7772 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -342,7 +342,7 @@ class FactureRec extends CommonInvoice
if ($objectline->fetch($result_insert))
{
// Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($facsrc->lines[$i], 'fetch_optionals')) {
+ if (method_exists($facsrc->lines[$i], 'fetch_optionals')) {
$facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid);
$objectline->array_options = $facsrc->lines[$i]->array_options;
}
@@ -438,7 +438,7 @@ class FactureRec extends CommonInvoice
$resql = $this->db->query($sql);
if ($resql)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -2112,7 +2112,7 @@ class FactureLigneRec extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index b6f9c4d7969..d872b02a35d 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -813,12 +813,12 @@ class Facture extends CommonInvoice
$vatrate = $line->tva_tx;
if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')';
- if(!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) {
- $originid=$line->origin_id;
- $origintype=$line->origin;
+ if (!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) {
+ $originid = $line->origin_id;
+ $origintype = $line->origin;
} else {
- $originid=$line->id;
- $origintype=$this->element;
+ $originid = $line->id;
+ $origintype = $this->element;
}
$result = $this->addline(
@@ -1452,9 +1452,10 @@ class Facture extends CommonInvoice
$txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private);
if ($txttoshow)
{
- $notetoshow = $langs->trans("ViewPrivateNote").': '.dol_string_nohtmltag($txttoshow, 1);
+ //$notetoshow = $langs->trans("ViewPrivateNote").': '.dol_string_nohtmltag($txttoshow, 1);
+ $notetoshow = $langs->trans("ViewPrivateNote").': '.$txttoshow;
$result .= ' ';
- $result .= '';
+ $result .= '';
$result .= img_picto('', 'note');
$result .= '';
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
@@ -1881,7 +1882,7 @@ class Facture extends CommonInvoice
$error++; $this->errors[] = "Error ".$this->db->lasterror();
}
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0)
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -3733,44 +3734,44 @@ class Facture extends CommonInvoice
}
if (!empty($addon)) {
- dol_syslog("Call getNextNumRef with " . $addonConstName . " = " . $conf->global->FACTURE_ADDON . ", thirdparty=" . $soc->nom . ", type=" . $soc->typent_code, LOG_DEBUG);
+ dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->nom.", type=".$soc->typent_code, LOG_DEBUG);
$mybool = false;
- $file = $addon . '.php';
+ $file = $addon.'.php';
$classname = $addon;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
- $dir = dol_buildpath($reldir . 'core/modules/' . $moduleName . '/');
+ $dir = dol_buildpath($reldir.'core/modules/'.$moduleName.'/');
// Load file with numbering class (if found)
- if (is_file($dir . $file) && is_readable($dir . $file)) {
- $mybool |= include_once $dir . $file;
+ if (is_file($dir.$file) && is_readable($dir.$file)) {
+ $mybool |= include_once $dir.$file;
}
}
// For compatibility
if (!$mybool) {
- $file = $addon . '/' . $addon . '.modules.php';
- $classname = 'mod_' . $moduleName . '_' . $addon;
+ $file = $addon.'/'.$addon.'.modules.php';
+ $classname = 'mod_'.$moduleName.'_'.$addon;
$classname = preg_replace('/\-.*$/', '', $classname);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot) {
- $dir = $dirroot . '/core/modules/' . $moduleName . '/';
+ $dir = $dirroot.'/core/modules/'.$moduleName.'/';
// Load file with numbering class (if found)
- if (is_file($dir . $file) && is_readable($dir . $file)) {
- $mybool |= include_once $dir . $file;
+ if (is_file($dir.$file) && is_readable($dir.$file)) {
+ $mybool |= include_once $dir.$file;
}
}
}
if (!$mybool) {
- dol_print_error('', 'Failed to include file ' . $file);
+ dol_print_error('', 'Failed to include file '.$file);
return '';
}
@@ -3789,7 +3790,7 @@ class Facture extends CommonInvoice
return $numref;
} else {
$langs->load('errors');
- print $langs->trans('Error') . ' ' . $langs->trans('ErrorModuleSetupNotComplete', $langs->transnoentitiesnoconv($moduleSourceName));
+ print $langs->trans('Error').' '.$langs->trans('ErrorModuleSetupNotComplete', $langs->transnoentitiesnoconv($moduleSourceName));
return '';
}
}
@@ -4755,7 +4756,7 @@ class Facture extends CommonInvoice
// note : we dont need to test INVOICE_USE_RETAINED_WARRANTY because if $this->retained_warranty is not empty it's because it was set when this conf was active
$displayWarranty = false;
- if(!empty($this->retained_warranty)) {
+ if (!empty($this->retained_warranty)) {
$displayWarranty = true;
if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION)) {
@@ -4794,7 +4795,7 @@ class Facture extends CommonInvoice
$retainedWarrantyAmount = 0;
// Billed - retained warranty
- if($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION))
+ if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION))
{
$displayWarranty = true;
// Check if this situation invoice is 100% for real
@@ -4834,7 +4835,7 @@ class Facture extends CommonInvoice
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
}
- if($rounding>0){
+ if ($rounding > 0) {
return round($retainedWarrantyAmount, $rounding);
}
@@ -5237,7 +5238,7 @@ class FactureLigne extends CommonInvoiceLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet');
$this->rowid = $this->id; // For backward compatibility
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -5423,7 +5424,7 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$this->id = $this->rowid;
$result = $this->insertExtraFields();
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 7f52195297b..a3cdb1747a0 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -489,7 +489,7 @@ class Contact extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1168,7 +1168,7 @@ class Contact extends CommonObject
}
// Removed extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) {
+ if (!$error) {
// For avoid conflicts if trigger used
$result = $this->deleteExtraFields();
if ($result < 0) $error++;
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index 2b7ca20c6e8..0055b0ba428 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -146,14 +146,16 @@ if ($id > 0)
$morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->rights->contrat->creer, 'string', '', 0, 2);
}
+ $permtoedit = 0;
+
$morehtmlref .= '';
// Ref customer
- $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
- $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
+ $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $permtoedit, 'string', '', 0, 1);
+ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
// Ref supplier
$morehtmlref .= ' ';
- $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
- $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
+ $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', 0, 1);
+ $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ( '.$langs->trans("OtherContracts").')';
@@ -165,7 +167,8 @@ if ($id > 0)
if ($user->rights->contrat->creer)
{
if ($action != 'classify') {
- $morehtmlref .= ' '.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ //$morehtmlref .= ' '.img_edit($langs->transnoentitiesnoconv('SetProject')).'';
+ $morehtmlref .= ' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 9d240a31a79..322d309b15b 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -316,7 +316,7 @@ if (empty($reshook))
// Extrafields
$array_options = array();
// For avoid conflicts if trigger used
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
+ if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 310aed1cd52..5bf9f1f11c1 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1035,7 +1035,7 @@ class Contrat extends CommonObject
}
}
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1383,7 +1383,7 @@ class Contrat extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0)
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1588,7 +1588,7 @@ class Contrat extends CommonObject
{
$contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX."contratdet");
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
+ if (!$error)
{
$contractline = new ContratLigne($this->db);
$contractline->array_options = $array_options;
@@ -1777,7 +1777,7 @@ class Contrat extends CommonObject
$result = $this->update_statut($user);
if ($result >= 0)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
+ if (is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
{
$contractline = new ContratLigne($this->db);
$contractline->fetch($rowid);
@@ -1859,18 +1859,15 @@ class Contrat extends CommonObject
$error++;
}
- if (empty($error)) {
+ if (!$error) {
// Remove extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ $contractline = new ContratLigne($this->db);
+ $contractline->id = $idline;
+ $result = $contractline->deleteExtraFields();
+ if ($result < 0)
{
- $contractline = new ContratLigne($this->db);
- $contractline->id = $idline;
- $result = $contractline->deleteExtraFields();
- if ($result < 0)
- {
- $error++;
- $this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error;
- }
+ $error++;
+ $this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error;
}
}
@@ -3092,7 +3089,7 @@ class ContratLigne extends CommonObjectLine
$error++;
}
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used
+ if (!$error) // For avoid conflicts if trigger used
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -3202,6 +3199,8 @@ class ContratLigne extends CommonObjectLine
{
global $conf, $user;
+ $error = 0;
+
// Insertion dans la base
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet";
$sql .= " (fk_contrat, label, description, fk_product, qty, vat_src_code, tva_tx,";
@@ -3240,7 +3239,7 @@ class ContratLigne extends CommonObjectLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'contratdet');
// Insert of extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 330db63e30c..7d47b5102ac 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -136,6 +136,7 @@ if ($object->id)
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
+ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ( '.$langs->trans("OtherContracts").')';
// Project
if (!empty($conf->projet->enabled))
{
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index e8cfa803573..ebae28e9582 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -751,7 +751,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
}
// Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
+ if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index a5cb9bf7d35..4bcfbafa9d8 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -170,12 +170,13 @@ abstract class CommonDocGenerator
*
* @param Societe $object Object
* @param Translate $outputlangs Language object for output
+ * @param string $array_key Name of the key for return array
* @return array Array of substitution key->code
*/
- public function get_substitutionarray_thirdparty($object, $outputlangs)
+ public function get_substitutionarray_thirdparty($object, $outputlangs, $array_key = 'company')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
if (empty($object->country) && !empty($object->country_code))
{
@@ -221,27 +222,13 @@ abstract class CommonDocGenerator
'company_default_bank_bic'=>$object->bank_account->bic
);
- // Retrieve extrafields
- if (is_array($object->array_options) && count($object->array_options))
- {
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label($object->table_element, true);
- $object->fetch_optionals();
+ // Retrieve extrafields
+ if (is_array($object->array_options) && count($object->array_options))
+ {
+ $object->fetch_optionals();
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key=>$label)
- {
- if ($extrafields->attributes[$object->table_element]['type'][$key] == 'price')
- {
- $object->array_options['options_'.$key] = price($object->array_options['options_'.$key], 0, $outputlangs, 0, 0, -1, $conf->currency);
- }
- elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select' || $extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox')
- {
- $object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]];
- }
- $array_thirdparty = array_merge($array_thirdparty, array('company_options_'.$key => $object->array_options ['options_'.$key]));
- }
- }
+ $array_thirdparty = $this->fill_substitutionarray_with_extrafields($object, $array_thirdparty, $extrafields, $array_key, $outputlangs);
+ }
return $array_thirdparty;
}
@@ -251,13 +238,13 @@ abstract class CommonDocGenerator
*
* @param Contact $object contact
* @param Translate $outputlangs object for output
- * @param array $array_key Name of the key for return array
+ * @param string $array_key Name of the key for return array
* @return array Array of substitution key->code
*/
public function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
if (empty($object->country) && !empty($object->country_code))
{
@@ -298,24 +285,13 @@ abstract class CommonDocGenerator
$array_key.'_civility' => $object->civility,
);
- // Retrieve extrafields
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label($object->table_element, true);
- $object->fetch_optionals();
+ // Retrieve extrafields
+ if (is_array($object->array_options) && count($object->array_options))
+ {
+ $object->fetch_optionals();
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label)
- {
- if ($extrafields->attributes[$object->table_element]['type'][$key] == 'price')
- {
- $object->array_options['options_'.$key] = price($object->array_options ['options_'.$key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
- }
- elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select' || $extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox')
- {
- $object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]];
- }
- $array_contact = array_merge($array_contact, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
- }
+ $array_contact = $this->fill_substitutionarray_with_extrafields($object, $array_contact, $extrafields, $array_key, $outputlangs);
+ }
return $array_contact;
}
@@ -370,7 +346,7 @@ abstract class CommonDocGenerator
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
$sumpayed = $sumdeposit = $sumcreditnote = '';
$already_payed_all = 0;
@@ -389,7 +365,7 @@ abstract class CommonDocGenerator
$remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote;
if ($object->fk_account > 0) {
- require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$bank_account = new Account($this->db);
$bank_account->fetch($object->fk_account);
}
@@ -528,11 +504,6 @@ abstract class CommonDocGenerator
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{
- $extrafieldkey = $object->element;
-
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label($extrafieldkey, true);
$object->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs);
@@ -605,7 +576,7 @@ abstract class CommonDocGenerator
}
// Retrieve extrafields
- $extrafieldkey = $line->element;
+ $extrafieldkey = $line->table_element;
$array_key = "line";
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
@@ -672,7 +643,7 @@ abstract class CommonDocGenerator
public function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
dol_include_once('/core/lib/product.lib.php');
$object->list_delivery_methods($object->shipping_method_id);
$calculatedVolume = ($object->trueWidth * $object->trueHeight * $object->trueDepth);
@@ -708,16 +679,13 @@ abstract class CommonDocGenerator
$array_shipment[$array_key.'_total_vat_'.$line->tva_tx] += $line->total_tva;
}
- // Retrieve extrafields
- if (is_array($object->array_options) && count($object->array_options))
- {
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label('expedition', true);
- $object->fetch_optionals();
+ // Retrieve extrafields
+ if (is_array($object->array_options) && count($object->array_options))
+ {
+ $object->fetch_optionals();
- $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs);
- }
+ $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs);
+ }
return $array_shipment;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 20dbdf18fd3..3d8871dc07a 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5351,9 +5351,14 @@ abstract class CommonObject
* Delete all extra fields values for the current object.
*
* @return int <0 if KO, >0 if OK
+ * @see deleteExtraLanguages(), insertExtraField(), updateExtraField(), setValueFrom()
*/
public function deleteExtraFields()
{
+ global $conf;
+
+ if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
+
$this->db->begin();
$table_element = $this->table_element;
@@ -5383,18 +5388,18 @@ abstract class CommonObject
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
* @param User $userused Object user
* @return int -1=error, O=did nothing, 1=OK
- * @see insertExtraLanguages(), updateExtraField(), setValueFrom()
+ * @see insertExtraLanguages(), updateExtraField(), deleteExtraField(), setValueFrom()
*/
public function insertExtraFields($trigger = '', $userused = null)
{
global $conf, $langs, $user;
+ if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
+
if (empty($userused)) $userused = $user;
$error = 0;
- if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
-
if (!empty($this->array_options))
{
// Check parameters
@@ -5792,18 +5797,18 @@ abstract class CommonObject
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
* @param User $userused Object user
* @return int -1=error, O=did nothing, 1=OK
- * @see updateExtraLanguages(), setValueFrom(), insertExtraFields()
+ * @see updateExtraLanguages(), insertExtraFields(), deleteExtraFields(), setValueFrom()
*/
public function updateExtraField($key, $trigger = null, $userused = null)
{
global $conf, $langs, $user;
+ if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0;
+
if (empty($userused)) $userused = $user;
$error = 0;
- if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
-
if (!empty($this->array_options) && isset($this->array_options["options_".$key]))
{
// Check parameters
@@ -8174,7 +8179,7 @@ abstract class CommonObject
}
// Update extrafield
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0)
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -8335,7 +8340,7 @@ abstract class CommonObject
if (empty($error)) {
// Remove extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$tmpobjectline = new $tmpforobjectlineclass($this->db);
$tmpobjectline->id = $idline;
diff --git a/htdocs/core/class/extralanguages.class.php b/htdocs/core/class/extralanguages.class.php
index 8f61e84839c..8ae1fd0a4c7 100644
--- a/htdocs/core/class/extralanguages.class.php
+++ b/htdocs/core/class/extralanguages.class.php
@@ -69,7 +69,9 @@ class ExtraLanguages
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Load array this->attributes
+ * Load array this->attributes with list of fields per object that need an alternate translation.
+ * You can set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:...
+ * Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname
*
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
* @param boolean $forceload Force load of extra fields whatever is status of cache.
@@ -86,11 +88,25 @@ class ExtraLanguages
if ($elementtype == 'contact') $elementtype = 'socpeople';
if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur';
- $array_name_label = array(
- 'societe' => array('name'=>'Name'),
- 'contact' => array('firstname' => 'Firstname', 'lastname' => 'Lastname')
- );
+ $array_name_label = array();
+ if (! empty($conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR)) {
+ $tmpelement = explode(';', $conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR);
+ foreach($tmpelement as $elementstring) {
+ $reg=array();
+ preg_match('/^(.*):(.*)$/', $elementstring, $reg);
+ $element = $reg[1];
+ $array_name_label[$element] = array();
+ $tmpfields=explode(',', $reg[2]);
+ foreach($tmpfields as $field) {
+ //var_dump($fields);
+ //$tmpkeyvar = explode(':', $fields);
+ //$array_name_label[$element][$tmpkeyvar[0]] = $tmpkeyvar[1];
+ $array_name_label[$element][$field] = $field;
+ }
+ }
+ }
+ //var_dump($array_name_label);
$this->attributes = $array_name_label;
return $array_name_label;
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index d4e6620c0da..075fb95066b 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -971,6 +971,7 @@ class FormFile
// Get object entity
if (!empty($conf->multicompany->enabled))
{
+ $regs = array();
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs);
$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
}
diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index 2dcabbcafaa..76e910bdecd 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -352,7 +352,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '')
$content = str_replace(' contenteditable="true"', ' contenteditable="false"', $content);
- if (! empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) {
+ if (!empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) {
$content = str_replace(' 'MulticurrencyUsed',
's.multicurrency_code' => 'MulticurrencyCurrency'
);
- if (! empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level']='PriceLevel';
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel';
// Add extra fields
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
$resql = $this->db->query($sql);
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 8a38450697f..c56506eb311 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -130,7 +130,7 @@ class doc_generic_task_odt extends ModelePDFTask
public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
$resarray = array(
$array_key.'_id'=>$object->id,
@@ -150,11 +150,6 @@ class doc_generic_task_odt extends ModelePDFTask
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{
- $extrafieldkey = $object->element;
-
- require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
- $extrafields = new ExtraFields($this->db);
- $extrafields->fetch_name_optionals_label($extrafieldkey, true);
$object->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs);
@@ -167,16 +162,17 @@ class doc_generic_task_odt extends ModelePDFTask
/**
* Define array with couple substitution key => substitution value
*
- * @param array $task Task Object
+ * @param Task $task Task Object
* @param Translate $outputlangs Lang object to use for output
+ * @param string $array_key Name of the key for return array
* @return array Return a substitution array
*/
- public function get_substitutionarray_tasks($task, $outputlangs)
+ public function get_substitutionarray_tasks($task, $outputlangs, $array_key = 'task')
{
// phpcs:enable
- global $conf;
+ global $conf, $extrafields;
- return array(
+ $resarray = array(
'task_ref'=>$task->ref,
'task_fk_project'=>$task->fk_project,
'task_projectref'=>$task->projectref,
@@ -184,7 +180,10 @@ class doc_generic_task_odt extends ModelePDFTask
'task_label'=>$task->label,
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_parent,
- 'task_duration'=>$task->duration,
+ 'task_duration'=>$task->duration_effective,
+ 'task_duration_formated'=>convertSecondToTime($task->duration_effective, 'allhourmin'),
+ 'task_planned_workload'=>$task->planned_workload,
+ 'task_planned_workload_formated'=>convertSecondToTime($task->planned_workload, 'allhourmin'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start, 'day'),
@@ -192,6 +191,16 @@ class doc_generic_task_odt extends ModelePDFTask
'task_note_private'=>$task->note_private,
'task_note_public'=>$task->note_public
);
+
+ // Retrieve extrafields
+ if (is_array($task->array_options) && count($task->array_options))
+ {
+ $task->fetch_optionals();
+
+ $resarray = $this->fill_substitutionarray_with_extrafields($task, $resarray, $extrafields, $array_key, $outputlangs);
+ }
+
+ return $resarray;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 8260656e4d0..102d7e58685 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -432,7 +432,7 @@ class Don extends CommonObject
// Update extrafield
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -519,7 +519,7 @@ class Don extends CommonObject
// Update extrafield
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 624add5c075..e1c24106e09 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -380,7 +380,7 @@ class Expedition extends CommonObject
}
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1046,7 +1046,8 @@ class Expedition extends CommonObject
}
}
$line->entrepot_id = $linebatch->entrepot_id;
- $line->origin_line_id = $dbatch['ix_l'];
+ $line->origin_line_id = $dbatch['ix_l']; // deprecated
+ $line->fk_origin_line = $dbatch['ix_l'];
$line->qty = $dbatch['qty'];
$line->detail_batch = $tab;
@@ -2617,7 +2618,7 @@ class ExpeditionLigne extends CommonObjectLine
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."expeditiondet");
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -2691,7 +2692,7 @@ class ExpeditionLigne extends CommonObjectLine
if (!$error && $this->db->query($sql))
{
// Remove extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
@@ -2895,7 +2896,7 @@ class ExpeditionLigne extends CommonObjectLine
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index f8a62da7ba6..502eb5ccb69 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -305,7 +305,7 @@ class Fichinter extends CommonObject
if (!$resql) $error++;
}
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -385,7 +385,7 @@ class Fichinter extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql))
{
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1001,7 +1001,7 @@ class Fichinter extends CommonObject
if (!$resql) $error++;
}
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
// Remove extrafields
$res = $this->deleteExtraFields();
@@ -1552,7 +1552,7 @@ class FichinterLigne extends CommonObjectLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet');
$this->rowid = $this->id;
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1623,7 +1623,7 @@ class FichinterLigne extends CommonObjectLine
$resql = $this->db->query($sql);
if ($resql)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index e5505cbaa9f..c95e403a24c 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -2063,7 +2063,7 @@ class CommandeFournisseur extends CommonOrder
}
// Remove extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
@@ -3626,7 +3626,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
$this->rowid = $this->id;
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -3716,7 +3716,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$result = $this->db->query($sql);
if ($result > 0)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index 6a7d8a3e8ba..041958448fa 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -210,22 +210,11 @@ class CommandeFournisseurDispatch extends CommonObject
}
}
- // Actions on extra fields (by external module or standard code)
- // TODO le hook fait double emploi avec le trigger !!
- $hookmanager->initHooks(array('commandefournisseurdispatchdao'));
- $parameters = array('id'=>$this->id);
- $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if (empty($reshook))
- {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
- {
- $result = $this->insertExtraFields();
-
- if ($result < 0)
- {
- $error++;
- }
- }
+ // Create extrafields
+ if (! $error)
+ {
+ $result=$this->insertExtraFields();
+ if ($result < 0) $error++;
}
// Commit or rollback
@@ -373,7 +362,7 @@ class CommandeFournisseurDispatch extends CommonObject
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
if (empty($this->id) && !empty($this->rowid))$this->id = $this->rowid;
$result = $this->insertExtraFields();
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index f2f1bac9257..8bbee47a2cd 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -558,7 +558,7 @@ class FactureFournisseur extends CommonInvoice
if ($result > 0)
{
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found
if ($result < 0)
@@ -977,7 +977,7 @@ class FactureFournisseur extends CommonInvoice
}
}
- if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0)
+ if (! $error)
{
$result=$this->insertExtraFields();
if ($result < 0)
@@ -1243,7 +1243,7 @@ class FactureFournisseur extends CommonInvoice
}
// Remove extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
@@ -3145,7 +3145,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->deleteObjectLinked();
// Remove extrafields
- if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (! $error)
{
$result=$this->deleteExtraFields();
if ($result < 0)
@@ -3265,7 +3265,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->rowid = $this->id;
$error = 0;
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -3406,7 +3406,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
$this->rowid = $this->id; // backward compatibility
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index bc86076644c..f2ab694e352 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1064,7 +1064,7 @@ if (empty($reshook))
if (!$error)
{
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $object->insertExtraFields('ORDER_SUPPLIER_MODIFY');
if ($result < 0)
@@ -1190,7 +1190,7 @@ if (empty($reshook))
}
// Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
+ if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if
{
$lines[$i]->fetch_optionals();
$array_option = $lines[$i]->array_options;
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index 3605c2b5751..f41e9e3fece 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -40,6 +40,17 @@ $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST("sortfield", 'alpha');
+$sortorder = GETPOST("sortorder", 'alpha');
+$page = GETPOST("page", 'int');
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (!$sortfield) $sortfield = 'a.datep,a.id';
+if (!$sortorder) $sortorder = 'DESC,DESC';
+
if (GETPOST('actioncode', 'array'))
{
$actioncode = GETPOST('actioncode', 'array', 3);
@@ -212,12 +223,12 @@ if (!empty($object->id))
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
// List of done actions
- //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
+ //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
// List of all actions
$filters = array();
$filters['search_agenda_label'] = $search_agenda_label;
- show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters);
+ show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder);
}
// End of page
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 697c8cb74f0..0b63356480c 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -951,7 +951,7 @@ if (empty($reshook))
$product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
// Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
+ if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
}
@@ -1597,7 +1597,7 @@ if (empty($reshook))
if (!$error)
{
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $object->insertExtraFields('BILL_SUPPLIER_MODIFY');
if ($result < 0)
diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql
index c6b9049a64f..676e768c73b 100644
--- a/htdocs/install/mysql/tables/llx_commande.sql
+++ b/htdocs/install/mysql/tables/llx_commande.sql
@@ -58,7 +58,7 @@ create table llx_commande
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
module_source varchar(32), -- name of module when order generated by a dedicated module (POS, ...)
- pos_source varchar(32), -- name of POS station when order is generated by a POS module
+ pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket.
facture tinyint default 0,
fk_account integer, -- bank account
fk_currency varchar(3), -- currency code
diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql
index 5a2d5464cfc..429095e1111 100644
--- a/htdocs/install/mysql/tables/llx_facture.sql
+++ b/htdocs/install/mysql/tables/llx_facture.sql
@@ -65,7 +65,7 @@ create table llx_facture
fk_user_closing integer, -- user closing
module_source varchar(32), -- name of module when invoice generated by a dedicated module (POS, ...)
- pos_source varchar(32), -- name of POS station when invoice is generated by a POS module
+ pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket.
fk_fac_rec_source integer, -- facture rec source
fk_facture_source integer, -- facture origin if credit notes or replacement invoice
fk_projet integer DEFAULT NULL, -- project invoice is linked to
diff --git a/htdocs/install/mysql/tables/llx_societe_account.sql b/htdocs/install/mysql/tables/llx_societe_account.sql
index feffc7c9bd6..6a78a9a7839 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.sql
@@ -20,15 +20,15 @@ CREATE TABLE llx_societe_account(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer DEFAULT 1,
- key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined)
login varchar(128) NOT NULL,
pass_encoding varchar(24),
pass_crypted varchar(128),
pass_temp varchar(128), -- temporary password when asked for forget password
fk_soc integer,
+ fk_website integer, -- id of local web site
site varchar(128), -- name of external web site
site_account varchar(128), -- a key to identify the account on external web site
- fk_website integer, -- id of local web site
+ key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined)
note_private text,
date_last_login datetime,
date_previous_login datetime,
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index c3e9870266f..f4d88b0d606 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -77,7 +77,7 @@ BlogPost=Blog post
WebsiteAccount=Website account
WebsiteAccounts=Website accounts
AddWebsiteAccount=Create web site account
-BackToListOfThirdParty=Back to list for Third Party
+BackToListForThirdParty=Back to list for the third-party
DisableSiteFirst=Disable website first
MyContainerTitle=My web site title
AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists)
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 81a8d5e9df7..56b12321bb2 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -475,7 +475,7 @@ if ($id > 0)
print ' ';
print ' ';
- print ' ';
+ print '';
// Capital
if ($action == 'edit')
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index c37dbaeb3f7..e245ec2cf4e 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1052,7 +1052,7 @@ class Product extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
+ if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
@@ -1265,7 +1265,7 @@ class Product extends CommonObject
}
// Remove extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0) {
@@ -4938,7 +4938,7 @@ class Product extends CommonObject
{
$filterStatus = '4';
if (isset($includedraftpoforvirtual)) $filterStatus = '0,'.$filterStatus;
- $result = $this->load_stats_reception(0, $filterStatus, 1); // Use same tables than when module reception is not used.
+ $result = $this->load_stats_reception(0, $filterStatus, 1); // Use same tables than when module reception is not used.
if ($result < 0) dol_print_error($this->db, $this->error);
$stock_reception_fournisseur = $this->stats_reception['qty'];
}
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index d57db91aa82..dbdb6cb6f42 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -64,14 +64,14 @@ if ($id > 0 || !empty($ref))
* Actions
*/
-if ($cancel) $action ='';
+if ($cancel) $action = '';
// Action association d'un sousproduit
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
{
- $error=0;
+ $error = 0;
$maxprod = GETPOST("max_prod", 'int');
- for ($i=0; $i < $maxprod; $i++)
+ for ($i = 0; $i < $maxprod; $i++)
{
$qty = price2num(GETPOST("prod_qty_".$i, 'alpha'), 'MS');
if ($qty > 0)
@@ -109,13 +109,13 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se
}
}
- if (! $error)
+ if (!$error)
{
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
-elseif($action==='save_composed_product')
+elseif ($action === 'save_composed_product')
{
$TProduct = GETPOST('TProduct', 'array');
if (!empty($TProduct))
@@ -540,38 +540,38 @@ if ($id > 0 || !empty($ref))
if ($resql)
{
$num = $db->num_rows($resql);
- $i=0;
+ $i = 0;
- if($num == 0) print '| '.$langs->trans("NoMatchFound").' | ';
+ if ($num == 0) print '| '.$langs->trans("NoMatchFound").' | ';
$MAX = 100;
while ($i < min($num, $MAX))
{
$objp = $db->fetch_object($resql);
- if($objp->rowid != $id)
+ if ($objp->rowid != $id)
{
// check if a product is not already a parent product of this one
- $prod_arbo=new Product($db);
- $prod_arbo->id=$objp->rowid;
+ $prod_arbo = new Product($db);
+ $prod_arbo->id = $objp->rowid;
// This type is not supported (not required to have virtual products working).
if ($prod_arbo->type == Product::TYPE_ASSEMBLYKIT || $prod_arbo->type == Product::TYPE_STOCKKIT)
{
- $is_pere=0;
+ $is_pere = 0;
$prod_arbo->get_sousproduits_arbo();
// associations sousproduits
$prods_arbo = $prod_arbo->get_arbo_each_prod();
if (count($prods_arbo) > 0)
{
- foreach($prods_arbo as $key => $value)
+ foreach ($prods_arbo as $key => $value)
{
- if ($value[1]==$id)
+ if ($value[1] == $id)
{
- $is_pere=1;
+ $is_pere = 1;
}
}
}
- if ($is_pere==1)
+ if ($is_pere == 1)
{
$i++;
continue;
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 3dd22c9e5c3..9f764f7d412 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -184,10 +184,10 @@ class Entrepot extends CommonObject
$error = 0;
- $this->libelle = trim($this->libelle);
+ if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility
- // Si libelle non defini, erreur
- if ($this->libelle == '')
+ $this->label = trim($this->label);
+ if ($this->label == '')
{
$this->error = "ErrorFieldRequired";
return 0;
@@ -198,7 +198,7 @@ class Entrepot extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)";
- $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
+ $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -221,7 +221,7 @@ class Entrepot extends CommonObject
// Actions on extra fields
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -272,6 +272,7 @@ class Entrepot extends CommonObject
$error = 0;
if (empty($id)) $id = $this->id;
+ if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility
// Check if new parent is already a child of current warehouse
if (!empty($this->fk_parent))
@@ -285,7 +286,7 @@ class Entrepot extends CommonObject
}
}
- $this->libelle = trim($this->libelle);
+ $this->label = trim($this->label);
$this->description = trim($this->description);
$this->lieu = trim($this->lieu);
@@ -296,7 +297,7 @@ class Entrepot extends CommonObject
$this->country_id = ($this->country_id > 0 ? $this->country_id : 0);
$sql = "UPDATE ".MAIN_DB_PREFIX."entrepot ";
- $sql .= " SET ref = '".$this->db->escape($this->libelle)."'";
+ $sql .= " SET ref = '".$this->db->escape($this->label)."'";
$sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL");
$sql .= ", description = '".$this->db->escape($this->description)."'";
$sql .= ", statut = ".$this->statut;
@@ -319,7 +320,7 @@ class Entrepot extends CommonObject
$this->errors[] = "Error ".$this->db->lasterror();
}
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) {
+ if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0)
{
@@ -383,7 +384,7 @@ class Entrepot extends CommonObject
// Removed extrafields
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index 6db4e81db79..f0a5c0a48ea 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -185,7 +185,7 @@ class Productlot extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -359,7 +359,7 @@ class Productlot extends CommonObject
}
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 0e793361d2b..674db2cc5d6 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -316,7 +316,7 @@ class Project extends CommonObject
// Update extrafield
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -405,7 +405,7 @@ class Project extends CommonObject
// Update extrafield
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index f3f75b716c1..41f6a76afb2 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -205,7 +205,7 @@ class Task extends CommonObject
// Update extrafield
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -384,7 +384,7 @@ class Task extends CommonObject
// Update extrafield
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 1269a99d1ea..9c6e8df76f1 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -186,30 +186,25 @@ if (empty($reshook))
if ($action == 'update_extras')
{
- // Fill array 'array_options' with data from update form
- $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute'));
- if ($ret < 0) $error++;
+ $object->oldcopy = dol_clone($object);
- if (!$error)
- {
- // Actions on extra fields (by external module or standard code)
- // TODO le hook fait double emploi avec le trigger !!
- $hookmanager->initHooks(array('receptiondao'));
- $parameters = array('id' => $object->id);
- $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
- if (empty($reshook)) {
- $result = $object->insertExtraFields();
- if ($result < 0)
- {
- setEventMessages($object->error, $object->errors, 'errors');
- $error++;
- }
- } elseif ($reshook < 0)
- $error++;
- }
+ // Fill array 'array_options' with data from update form
+ $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none'));
+ if ($ret < 0) $error++;
- if ($error)
- $action = 'edit_extras';
+ if (!$error)
+ {
+ // Actions on extra fields
+ $result = $object->insertExtraFields('RECEPTION_MODIFY');
+ if ($result < 0)
+ {
+ setEventMessages($object->error, $object->errors, 'errors');
+ $error++;
+ }
+ }
+
+ if ($error)
+ $action = 'edit_extras';
}
// Create reception
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 1679f186a72..2bb34859a6b 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -305,24 +305,12 @@ class Reception extends CommonObject
}
}
- // Actions on extra fields (by external module or standard code)
- // TODO le hook fait double emploi avec le trigger !!
- $action = 'add';
- $hookmanager->initHooks(array('receptiondao'));
- $parameters = array('socid'=>$this->id);
- $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if (empty($reshook))
+ // Create extrafields
+ if (! $error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
- {
- $result = $this->insertExtraFields();
- if ($result < 0)
- {
- $error++;
- }
- }
+ $result=$this->insertExtraFields();
+ if ($result < 0) $error++;
}
- elseif ($reshook < 0) $error++;
if (!$error && !$notrigger)
{
@@ -330,29 +318,22 @@ class Reception extends CommonObject
$result = $this->call_trigger('RECEPTION_CREATE', $user);
if ($result < 0) { $error++; }
// End call triggers
+ }
- if (!$error)
- {
- $this->db->commit();
- return $this->id;
- }
- else
- {
- foreach ($this->errors as $errmsg)
- {
- dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
- $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
- }
- $this->db->rollback();
- return -1 * $error;
- }
+ if (!$error)
+ {
+ $this->db->commit();
+ return $this->id;
}
else
{
- $error++;
- $this->error = $this->db->lasterror()." - sql=$sql";
+ foreach ($this->errors as $errmsg)
+ {
+ dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
+ $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
+ }
$this->db->rollback();
- return -3;
+ return -1 * $error;
}
}
else
@@ -769,7 +750,7 @@ class Reception extends CommonObject
}
// extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used
+ if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0)
$line->array_options = $array_options;
$line->fk_product = $fk_product;
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 75c6e50dec3..4cda97b39d1 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -136,7 +136,7 @@ class Dolresource extends CommonObject
$action = 'create';
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -309,7 +309,7 @@ class Dolresource extends CommonObject
$action = 'update';
// Actions on extra fields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index 44c25b09a13..82cdf3c80ce 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -160,7 +160,7 @@ class PaymentSalary extends CommonObject
// Update extrafield
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -449,7 +449,7 @@ class PaymentSalary extends CommonObject
// Update extrafield
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php
index 8d004fa4c79..91f24bbb915 100644
--- a/htdocs/societe/checkvat/checkVatPopup.php
+++ b/htdocs/societe/checkvat/checkVatPopup.php
@@ -28,9 +28,9 @@ require_once NUSOAP_PATH.'/nusoap.php';
$langs->load("companies");
//http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
-$WS_DOL_URL = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService';
+$WS_DOL_URL = 'https://ec.europa.eu/taxation_customs/vies/services/checkVatService';
//$WS_DOL_URL_WSDL=$WS_DOL_URL.'?wsdl';
-$WS_DOL_URL_WSDL = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl';
+$WS_DOL_URL_WSDL = 'https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl';
$WS_METHOD = 'checkVat';
diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php
index 1100432c854..c50a746c444 100644
--- a/htdocs/societe/class/api_thirdparties.class.php
+++ b/htdocs/societe/class/api_thirdparties.class.php
@@ -129,7 +129,7 @@ class Thirdparties extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."societe as t";
if ($category > 0) {
if ($mode != 4) $sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c";
- if (!in_array($mode, array(1,2,3))) $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cc";
+ if (!in_array($mode, array(1, 2, 3))) $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cc";
}
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st";
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index ea175c13c6a..c35b17fe4fa 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1393,7 +1393,7 @@ class Societe extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -1771,7 +1771,7 @@ class Societe extends CommonObject
}
// Removed extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index f90cb17c230..98bdeffa637 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -79,15 +79,15 @@ class SocieteAccount extends CommonObject
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1),
- 'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Key account',),
- 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10),
+ 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1),
'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30),
'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1),
'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1),
- 'site' => array('type'=>'varchar(128)', 'label'=>'Site', 'visible'=>-1, 'enabled'=>1, 'position'=>41),
- 'site_account' => array('type'=>'varchar(128)', 'label'=>'SiteAccount', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'help'=>'A key to identify the account on external web site'),
- 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>43, 'notnull'=>-1, 'index'=>1),
+ 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'index'=>1),
+ 'site' => array('type'=>'varchar(128)', 'label'=>'ExternalSite', 'visible'=>0, 'enabled'=>1, 'position'=>43, 'help'=>'Name of the website or service if this is account on an external website or service'),
+ 'site_account' => array('type'=>'varchar(128)', 'label'=>'ExternalSiteAccount', 'visible'=>0, 'enabled'=>1, 'position'=>44, 'help'=>'A key to identify the account on external web site if this is an account on an external website'),
+ 'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>0, 'enabled'=>1, 'position'=>48, 'notnull'=>0, 'index'=>1, 'searchall'=>1, 'comment'=>'The id of third party in the external web site (for site_account if site_account defined)',),
'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,),
'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,),
//'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,),
@@ -405,11 +405,10 @@ class SocieteAccount extends CommonObject
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = '';
- $companylink = '';
$this->ref = $this->login;
- $label = ''.$langs->trans("SocieteAccount").'';
+ $label = ''.$langs->trans("WebsiteAccount").'';
$label .= ' ';
$label .= ''.$langs->trans('Login').': '.$this->ref;
//$label.= '' . $langs->trans('WebSite') . ': ' . $this->ref;
@@ -429,7 +428,7 @@ class SocieteAccount extends CommonObject
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- $label = $langs->trans("ShowsocieteAccount");
+ $label = $langs->trans("WebsiteAccount");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 7b3bf774a68..dc53f47ff26 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -449,6 +449,8 @@ while ($i < min($num, $limit))
// Store properties in $object
$objectwebsiteaccount->id = $obj->rowid;
+ $objectwebsiteaccount->login = $obj->login;
+ $objectwebsiteaccount->ref = $obj->login;
foreach ($objectwebsiteaccount->fields as $key => $val)
{
if (property_exists($obj, $key)) $object->$key = $obj->$key;
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 5910f77a819..ee9f5a1d072 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -353,7 +353,7 @@ if (empty($reshook))
}
// Extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
+ if (method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 3e69fbc167f..52bb42c4526 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -1063,7 +1063,7 @@ class SupplierProposal extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -2116,16 +2116,13 @@ class SupplierProposal extends CommonObject
// Removed extrafields
if (!$error)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
- {
- $result = $this->deleteExtraFields();
- if ($result < 0)
- {
- $error++;
- $errorflag = -4;
- dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
- }
- }
+ $result = $this->deleteExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ $errorflag = -4;
+ dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
+ }
}
if (!$error)
@@ -3106,7 +3103,7 @@ class SupplierProposalLine extends CommonObjectLine
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet');
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
@@ -3155,7 +3152,7 @@ class SupplierProposalLine extends CommonObjectLine
if ($this->db->query($sql))
{
// Remove extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
@@ -3277,7 +3274,7 @@ class SupplierProposalLine extends CommonObjectLine
$resql = $this->db->query($sql);
if ($resql)
{
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 863c0c03072..172309a233e 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -408,11 +408,9 @@ class Ticket extends CommonObject
//Update extrafield
if (!$error) {
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
- $result = $this->insertExtraFields();
- if ($result < 0) {
- $error++;
- }
+ $result = $this->insertExtraFields();
+ if ($result < 0) {
+ $error++;
}
}
@@ -838,11 +836,9 @@ class Ticket extends CommonObject
if (!$error) {
// Update extrafields
- if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
- $result = $this->insertExtraFields();
- if ($result < 0) {
- $error++;
- }
+ $result = $this->insertExtraFields();
+ if ($result < 0) {
+ $error++;
}
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index f944083f6c5..24bf871af1f 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1094,7 +1094,7 @@ class User extends CommonObject
}
// Remove extrafields
- if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ if (!$error)
{
$result = $this->deleteExtraFields();
if ($result < 0)
@@ -1762,7 +1762,7 @@ class User extends CommonObject
$action = 'update';
// Actions on extra fields
- if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
+ if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 2cf11c3851f..bc5396e9f51 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -118,12 +118,12 @@ class UserGroup extends CommonObject
/**
* @var array List of child tables. To test if we can delete object.
*/
- protected $childtables=array();
+ protected $childtables = array();
/**
* @var array List of child tables. To know object to delete on cascade.
*/
- protected $childtablesoncascade = array('usergroup_rights','usergroup_user');
+ protected $childtablesoncascade = array('usergroup_rights', 'usergroup_user');
/**
@@ -162,7 +162,7 @@ class UserGroup extends CommonObject
$this->name = $this->nom; // For compatibility with field name
- if($result)
+ if ($result)
{
if ($load_members)
{
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index 8efd7ef38e2..70030dbf1af 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -77,7 +77,7 @@ if (empty($reshook)) {
$editgroup = new Usergroup($db);
$result = $editgroup->fetch($id);
if ($result > 0) {
- $result= $editgroup->addrights($rights, $module, '', $entity);
+ $result = $editgroup->addrights($rights, $module, '', $entity);
if ($result < 0) {
setEventMessages($editgroup->error, $editgroup->errors, 'errors');
}
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 32c51d3eef1..0f684ca5232 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -327,8 +327,8 @@ if ($cancel)
$savbacktopage = $backtopage;
$backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir', 'alpha') ? '§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')) : ''); // used after a confirm_deletefile into actions_linkedfiles.inc.php
-if ($sortfield) $backtopage.='&sortfield='.$sortfield;
-if ($sortorder) $backtopage.='&sortorder='.$sortorder;
+if ($sortfield) $backtopage .= '&sortfield='.$sortfield;
+if ($sortorder) $backtopage .= '&sortorder='.$sortorder;
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
$backtopage = $savbacktopage;
@@ -2133,7 +2133,7 @@ print '';
// Add a margin under toolbar ?
$style = '';
-if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource' && ! GETPOST('createpagefromclone', 'alphanohtml')) $style = ' margin-bottom: 5px;';
+if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource' && !GETPOST('createpagefromclone', 'alphanohtml')) $style = ' margin-bottom: 5px;';
if (!GETPOST('hide_websitemenu'))
@@ -2437,7 +2437,7 @@ if (!GETPOST('hide_websitemenu'))
$preselectedlanguage = GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : ($objectpage->lang ? $objectpage->lang : $langs->defaultlang);
$onlylang = array();
if ($website->otherlang) {
- foreach(explode(',', $website->otherlang) as $langkey) {
+ foreach (explode(',', $website->otherlang) as $langkey) {
$onlylang[$langkey] = $langkey;
}
$textifempty = 1;
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 046a5005e51..be0c4c3cc41 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
$linkback = '';
- if ($socid) $linkback = ' '.$langs->trans("BackToListOfThirdParty").'';
+ if ($socid) $linkback = ' '.$langs->trans("BackToListForThirdParty").'';
if ($fk_website) $linkback = ' '.$langs->trans("BackToList").'';
$morehtmlref = ' ';
diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php
index 6bb7f12250d..34d67341afb 100644
--- a/test/phpunit/ActionCommTest.php
+++ b/test/phpunit/ActionCommTest.php
@@ -140,7 +140,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase
$localobject->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$localobject->code = 'AC_PHPUNITTEST';
$localobject->label = 'This is a description';
- $localobject->note = 'This is note';
+ $localobject->note_private = 'This is note';
$localobject->fk_project = 0;
$localobject->datep = $now;
$localobject->datef = $now;
diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php
index f5468d49c4b..2ab2fc2aff3 100644
--- a/test/phpunit/EntrepotTest.php
+++ b/test/phpunit/EntrepotTest.php
@@ -139,7 +139,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
$result=$localobject->create($user);
print __METHOD__." result=".$result."\n";
- $this->assertLessThanOrEqual($result, 0);
+ $this->assertGreaterThan(0, $result);
return $result;
}
@@ -242,24 +242,4 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
return $result;
}
-
- /**
- * testEntrepotStatic
- *
- * @return void
- */
- public function testEntrepotStatic()
- {
- global $conf,$user,$langs,$db;
- $conf=$this->savconf;
- $user=$this->savuser;
- $langs=$this->savlangs;
- $db=$this->savdb;
-
- $localobject=new Entrepot($db);
-
- //$this->assertLessThan(1, 0);
-
- return;
- }
}
diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php
index d095736042b..85137234a3b 100644
--- a/test/phpunit/MouvementStockTest.php
+++ b/test/phpunit/MouvementStockTest.php
@@ -148,13 +148,13 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase
// We create a product for tests
$warehouse1=new Entrepot($db);
$warehouse1->initAsSpecimen();
- $warehouse1->libelle.=' 1';
+ $warehouse1->label.=' 1';
$warehouse1->description.=' 1';
$warehouse1id=$warehouse1->create($user);
$warehouse2=new Entrepot($db);
$warehouse2->initAsSpecimen();
- $warehouse2->libelle.=' 2';
+ $warehouse2->label.=' 2';
$warehouse2->description.=' 2';
$warehouse2id=$warehouse2->create($user);
|