';
}
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{
if ($conf->global->MARGIN_TYPE == "1")
- print '
'.$langs->trans('BuyingPrice').'
';
+ print '
'.$langs->trans('BuyingPrice').'
';
else
- print '
'.$langs->trans('CostPrice').'
';
+ print '
'.$langs->trans('CostPrice').'
';
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
- print '
'.$langs->trans('MarginRate').'
';
+ print '
'.$langs->trans('MarginRate').'
';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
- print '
'.$langs->trans('MarkRate').'
';
+ print '
'.$langs->trans('MarkRate').'
';
}
// Total HT
- print '
'.$langs->trans('TotalHTShort').'
';
+ print '
'.$langs->trans('TotalHTShort').'
';
- print '
'; // No width to allow autodim
+ print '
'; // No width to allow autodim
- print '
';
+ print '
';
- print '
';
+ print '
';
print "
\n";
@@ -3801,10 +3801,10 @@ abstract class CommonObject
foreach ($tab as $key => $value)
{
- // Test fetch_array ! is_int($key) because fetch_array seult is a mix table with Key as alpha and Key as int (depend db engine)
+ // Test fetch_array ! is_int($key) because fetch_array result is a mix table with Key as alpha and Key as int (depend db engine)
if ($key != 'rowid' && $key != 'tms' && $key != 'fk_member' && ! is_int($key))
{
- // we can add this attribute to adherent object
+ // we can add this attribute to object
$this->array_options["options_".$key]=$value;
}
}
@@ -3852,7 +3852,7 @@ abstract class CommonObject
/**
* Add/Update all extra fields values for the current object.
* Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
- * This function delte record with all extrafields and insert them again from the array $this->array_options.
+ * This function delete record with all extrafields and insert them again from the array $this->array_options.
*
* @return int -1=error, O=did nothing, 1=OK
*/
@@ -3906,12 +3906,25 @@ abstract class CommonObject
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
- $object = new $InfoFieldList[0]($this->db);
- if ($value)
- {
- $object->fetch(0,$value);
- $this->array_options[$key]=$object->id;
- }
+ if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
+ {
+ $object = new $InfoFieldList[0]($this->db);
+ if ($value)
+ {
+ $res=$object->fetch(0,$value);
+ if ($res > 0) $this->array_options[$key]=$object->id;
+ else
+ {
+ $this->error="Ref '".$value."' for object '".$object->element."' not found";
+ $this->db->rollback();
+ return -1;
+ }
+ }
+ }
+ else
+ {
+ dol_syslog('Error bad setup of extrafield', LOG_WARNING);
+ }
break;
}
}
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 4d9fec42bf9..aa2f014c7ba 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -111,7 +111,7 @@ class ExtraFields
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
* @param int $unique Is field unique or not
* @param int $required Is field required or not
- * @param string $default_value Defaulted value
+ * @param string $default_value Defaulted value (Example: '', '0', 'null', 'avalue')
* @param array $param Params for field
* @param int $alwayseditable Is attribute always editable regardless of the document status
* @param string $perms Permission to check
@@ -1085,10 +1085,19 @@ class ExtraFields
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
- $object = new $InfoFieldList[0]($this->db);
- $object->fetch($value);
- $out='';
-
+ if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
+ {
+ $object = new $InfoFieldList[0]($this->db);
+ $object->fetch($value);
+ $valuetoshow=$object->ref;
+ if ($object->element == 'societe') $valuetoshow=$object->name; // Special case for thirdparty because ref is id because name is not unique
+ $out.='';
+ }
+ else
+ {
+ dol_syslog('Error bad setup of extrafield', LOG_WARNING);
+ $out.='Error bad setup of extrafield';
+ }
}
/* Add comments
if ($type == 'date') $out.=' (YYYY-MM-DD)';
@@ -1326,9 +1335,17 @@ class ExtraFields
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
- $object = new $InfoFieldList[0]($this->db);
- $object->fetch($value);
- $value=$object->getNomUrl(3);
+ if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
+ {
+ $object = new $InfoFieldList[0]($this->db);
+ $object->fetch($value);
+ $value=$object->getNomUrl(3);
+ }
+ else
+ {
+ dol_syslog('Error bad setup of extrafield', LOG_WARNING);
+ $out.='Error bad setup of extrafield';
+ }
}
}
elseif ($type == 'text')
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index 142c0903212..174da1ae409 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -100,9 +100,12 @@
info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
@@ -148,7 +148,7 @@ if (empty($usemargins)) $usemargins=0;
global->PRODUCT_USE_UNITS)
{
- print '
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 6f720c0a92b..ed2eb3cdffa 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -398,6 +398,7 @@ ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value
fo
ExtrafieldParamHelpradio=Parameters list have to be like key,value
for example : 1,value1 2,value2 3,value3 ...
ExtrafieldParamHelpsellist=Parameters list comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another : c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelpchkbxlst=Parameters list comes from a table Syntax : table_name:label_field:id_field::filter Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value if you want to filter on extrafields use syntaxt extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another : c_typent:libelle:id:parent_list_code|parent_column:filter
+ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath Syntax : ObjectName:Classpath Example : Societe:societe/class/societe.class.php
LibraryToBuildPDF=Library used to build PDF
WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation. To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are: 1 : local tax apply on products and services without vat (localtax is calculated on amount without tax) 2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax) 3 : local tax apply on products without vat (localtax is calculated on amount without tax) 4 : local tax apply on products including vat (localtax is calculated on amount + main vat) 5 : local tax apply on services without vat (localtax is calculated on amount without tax) 6 : local tax apply on services including vat (localtax is calculated on amount + tax)
@@ -1692,4 +1693,10 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier
MailToSendSupplierOrder=To send supplier order
MailToSendSupplierInvoice=To send supplier invoice
MailToThirdparty=To send email from thirdparty page
-ByDefaultInList=Show by default on list view
\ No newline at end of file
+ByDefaultInList=Show by default on list view
+YouUseLastStableVersion=You use the last stable version
+TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites)
+TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites)
+ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes.
+ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so it contains only fixes of bugs. We recommend everybody using an older version to upgrade to this one. As any maintenance release, no new features, nor data structure change is present into this version. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes.
+
\ No newline at end of file