';
}
-
+
$texte.= '';
$texte.= '
';
@@ -354,21 +354,22 @@ class doc_generic_order_odt extends ModelePDFCommandes
{
}
- // Make substitutions into odt
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in order as contact_xxx tags
- $array_thirdparty_contact = array();
- if ($usecontact)
- $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+ // retrieve contact information for use in order as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
// Call the ODTSubstitution hook
-
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@@ -392,30 +393,42 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -468,7 +481,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index d99d43396bc..98b644c8cce 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -290,27 +290,40 @@ class doc_generic_contract_odt extends ModelePDFContract
{
$socobject=$object->thirdparty;
}
- // Make substitution
- $substitutionarray=array(
- '__FROM_NAME__' => $this->emetteur->name,
- '__FROM_EMAIL__' => $this->emetteur->email,
- '__TOTAL_TTC__' => $object->total_ttc,
- '__TOTAL_HT__' => $object->total_ht,
- '__TOTAL_VAT__' => $object->total_vat
- );
- complete_substitutions_array($substitutionarray, $langs, $object);
+
+ $object->fetch_optionals();
+
+
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs); // complete with vars not set as properties by get_substitutionarray_each_var_object
+ $array_user=$this->get_substitutionarray_user($user,$outputlangs);
+ $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
+ $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
+ $array_other=$this->get_substitutionarray_other($outputlangs);
+ // retrieve contact information for use in contract as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+
+ $substitutionarray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
+ complete_substitutions_array($substitutionarray, $outputlangs, $object);
+
+ $tmparray = $substitutionarray;
+
// Call the ODTSubstitution hook
- $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$substitutionarray);
+ $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
// Line of free text
$newfreetext='';
- $paramfreetext='contract_FREE_TEXT';
+ $paramfreetext='CONTRACT_FREE_TEXT';
if (! empty($conf->global->$paramfreetext))
{
- $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
+ $newfreetext=make_substitutions($conf->global->$paramfreetext,$tmparray);
}
+
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
@@ -344,24 +357,6 @@ class doc_generic_contract_odt extends ModelePDFContract
{
}
- // Make substitutions into odt
- $array_contract=$this->get_substitutionarray_each_var_object($object, $outputlangs);
- $array_user=$this->get_substitutionarray_user($user,$outputlangs);
- $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
- $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
- $array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in contract as contact_xxx tags
- $array_thirdparty_contact = array();
- if ($usecontact)
- $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
-
- $tmparray = array_merge($array_contract,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
- complete_substitutions_array($tmparray, $outputlangs, $object);
- $object->fetch_optionals();
- // Call the ODTSubstitution hook
- $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
- $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key=>$value)
{
try {
@@ -379,33 +374,46 @@ class doc_generic_contract_odt extends ModelePDFContract
{
}
}
+
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -456,7 +464,7 @@ class doc_generic_contract_odt extends ModelePDFContract
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 77a5677c003..9c45c135ac3 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -437,30 +437,42 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_shipment_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_shipment_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -511,7 +523,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index 15d48694277..c236c9ad017 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -328,7 +328,15 @@ class pdf_standard extends ModeleExpenseReport
$nextColumnPosX = $this->posxprojet;
}
- $pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, dol_trunc($outputlangs->transnoentities($object->lines[$i]->type_fees_code), 10), 0, 'C');
+ $expensereporttypecode = $object->lines[$i]->type_fees_code;
+ $expensereporttypecodetoshow = $outputlangs->transnoentities($expensereporttypecode);
+ if ($expensereporttypecodetoshow == $expensereporttypecode)
+ {
+ $expensereporttypecodetoshow = preg_replace('/^(EX_|TF_)/', '', $expensereporttypecodetoshow);
+ }
+ $expensereporttypecodetoshow = dol_trunc($expensereporttypecodetoshow, 9); // 10 is too much
+
+ $pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C');
// Project
if (! empty($conf->projet->enabled))
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 79b848c5773..6d9d5172a7f 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -361,20 +361,22 @@ class doc_generic_invoice_odt extends ModelePDFFactures
{
}
- // Make substitutions into odt
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
$array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in invoice as contact_xxx tags
- $array_thirdparty_contact = array();
- if ($usecontact)
- $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+ // retrieve contact information for use in invoice as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
@@ -401,30 +403,42 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -475,7 +489,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php
index a1674d6ab08..f71b6b925f0 100644
--- a/htdocs/core/modules/mailings/fraise.modules.php
+++ b/htdocs/core/modules/mailings/fraise.modules.php
@@ -127,7 +127,7 @@ class mailing_fraise extends MailingTargets
$s.='';
$sql = "SELECT rowid, libelle, statut";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
- $sql.= " WHERE entity = ".$conf->entity;
+ $sql.= " WHERE entity IN (".getEntity('member_type').")";
$sql.= " ORDER BY rowid";
$resql = $this->db->query($sql);
if ($resql)
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index 9bad202251e..ea7208cc5dd 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -54,7 +54,6 @@ class modAccounting extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
- $this->special = 0;
$this->picto = 'accounting';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index aa098146dc7..d26836fa646 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -56,7 +56,6 @@ class modAdherent extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='user';
// Data directories to create when module is enabled
@@ -291,7 +290,7 @@ class modAdherent extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'subscription as c ON c.fk_adherent = a.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON a.country = co.rowid';
- $this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid AND ta.entity IN ('.getEntity('adherent').') ';
+ $this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid AND ta.entity IN ('.getEntity('member_type').') ';
$this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
// Imports
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index 89085ea4d6c..01aa8896c35 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -59,7 +59,6 @@ class modAgenda extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='action';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php
index 34c8e62a03f..3e27031fd6f 100644
--- a/htdocs/core/modules/modApi.class.php
+++ b/htdocs/core/modules/modApi.class.php
@@ -51,7 +51,7 @@ class modApi extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -60,8 +60,6 @@ class modApi extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php
index c9fde5f0087..d32a63b5a86 100644
--- a/htdocs/core/modules/modBanque.class.php
+++ b/htdocs/core/modules/modBanque.class.php
@@ -58,7 +58,6 @@ class modBanque extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='account';
// Data directories to create when module is enabled
@@ -138,8 +137,8 @@ class modBanque extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php
index da8b51c8e8e..1f734af0871 100644
--- a/htdocs/core/modules/modBarcode.class.php
+++ b/htdocs/core/modules/modBarcode.class.php
@@ -51,7 +51,6 @@ class modBarcode extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 2;
$this->picto='barcode';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php
index b18f8bebf62..07331bcbc3c 100644
--- a/htdocs/core/modules/modBlockedLog.class.php
+++ b/htdocs/core/modules/modBlockedLog.class.php
@@ -55,8 +55,6 @@ class modBlockedLog extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 2;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modBookmark.class.php b/htdocs/core/modules/modBookmark.class.php
index 8924be16ba4..191e12bc2eb 100644
--- a/htdocs/core/modules/modBookmark.class.php
+++ b/htdocs/core/modules/modBookmark.class.php
@@ -52,7 +52,6 @@ class modBookmark extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 2;
$this->picto='bookmark';
// Data directories to create when module is enabled
@@ -98,10 +97,10 @@ class modBookmark extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par d�faut
$this->rights[$r][4] = 'supprimer';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
}
diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php
index 33b44297628..4be7a937d1a 100644
--- a/htdocs/core/modules/modCashDesk.class.php
+++ b/htdocs/core/modules/modCashDesk.class.php
@@ -55,7 +55,6 @@ class modCashDesk extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = 'list';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index b56d405c354..153dd9ae58b 100644
--- a/htdocs/core/modules/modCategorie.class.php
+++ b/htdocs/core/modules/modCategorie.class.php
@@ -54,7 +54,6 @@ class modCategorie extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = 'category';
// Data directories to create when module is enabled
@@ -107,12 +106,12 @@ class modCategorie extends DolibarrModules
$this->rights[$r][4] = 'supprimer';
$r++;
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
@@ -308,7 +307,7 @@ class modCategorie extends DolibarrModules
's.url'=>"company",
's.email'=>"company"
); // We define here only fields that use another picto
-
+
// Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople'";
$resql=$this->db->query($sql);
@@ -346,7 +345,7 @@ class modCategorie extends DolibarrModules
}
}
// End add axtra fields
-
+
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';
diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php
index c0983cc1a8b..4a5bcfc2f89 100644
--- a/htdocs/core/modules/modClickToDial.class.php
+++ b/htdocs/core/modules/modClickToDial.class.php
@@ -43,7 +43,7 @@ class modClickToDial extends DolibarrModules
$this->db = $db;
$this->numero = 58;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion du Click To Dial";
@@ -51,7 +51,6 @@ class modClickToDial extends DolibarrModules
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 1;
$this->picto='phoning';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php
index 01a80d0b702..5349b000ac3 100644
--- a/htdocs/core/modules/modCollab.class.php
+++ b/htdocs/core/modules/modCollab.class.php
@@ -54,8 +54,6 @@ class modCollab extends DolibarrModules
$this->version = 'development';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
$this->picto='globe';
diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index e80833ae7c4..aecfb8bd090 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -59,7 +59,6 @@ class modCommande extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='order';
// Data directories to create when module is enabled
@@ -104,7 +103,7 @@ class modCommande extends DolibarrModules
$this->const[$r][2] = "__(Draft)__";
$this->const[$r][3] = 'Watermark to show on draft orders';
$this->const[$r][4] = 0;*/
-
+
// Boxes
$this->boxes = array(
0=>array('file'=>'box_commandes.php','enabledbydefaulton'=>'Home'),
@@ -177,12 +176,12 @@ class modCommande extends DolibarrModules
$this->rights[$r][4] = 'commande';
$this->rights[$r][5] = 'export';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php
index c07318fb36b..41349d214fc 100644
--- a/htdocs/core/modules/modComptabilite.class.php
+++ b/htdocs/core/modules/modComptabilite.class.php
@@ -57,7 +57,6 @@ class modComptabilite extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='accounting';
// Config pages
@@ -94,12 +93,12 @@ class modComptabilite extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'resultat';
$this->rights[$r][5] = 'lire';
-
-
+
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php
index 1b17b773c77..ac722cd04ef 100644
--- a/htdocs/core/modules/modContrat.class.php
+++ b/htdocs/core/modules/modContrat.class.php
@@ -55,7 +55,6 @@ class modContrat extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='contract';
// Data directories to create when module is enabled
@@ -71,28 +70,28 @@ class modContrat extends DolibarrModules
// Constants
$this->const = array();
$r=0;
-
+
$this->const[$r][0] = "CONTRACT_ADDON";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "mod_contract_serpis";
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des contrats';
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "CONTRACT_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "strato";
$this->const[$r][3] = 'Name of PDF model of contract';
$this->const[$r][4] = 0;
$r++;
-
+
$this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
-
+
// Boxes
$this->boxes = array(
0=>array('file'=>'box_contracts.php','enabledbydefaulton'=>'Home'),
@@ -103,7 +102,7 @@ class modContrat extends DolibarrModules
$this->rights = array();
$this->rights_class = 'contrat';
$r=0;
-
+
$r++;
$this->rights[$r][0] = 161;
$this->rights[$r][1] = 'Lire les contrats';
@@ -146,12 +145,12 @@ class modContrat extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'export';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$langs->load("contracts");
@@ -223,7 +222,7 @@ class modContrat extends DolibarrModules
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt';
$dirodt=DOL_DATA_ROOT.'/doctemplates/contracts';
$dest=$dirodt.'/template_contract.odt';
-
+
if (file_exists($src) && ! file_exists($dest))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -236,12 +235,12 @@ class modContrat extends DolibarrModules
return 0;
}
}
-
+
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[1][2])."' AND type = 'contract' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[1][2])."','contract',".$conf->entity.")"
);
-
+
return $this->_init($sql,$options);
}
}
diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php
index 8afcc26c80f..b148149910f 100644
--- a/htdocs/core/modules/modCron.class.php
+++ b/htdocs/core/modules/modCron.class.php
@@ -54,8 +54,6 @@ class modCron extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 2;
// Name of image file used for this module.
$this->picto = 'technic';
diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php
index ec8d665b1e0..3baa7b74590 100644
--- a/htdocs/core/modules/modDeplacement.class.php
+++ b/htdocs/core/modules/modDeplacement.class.php
@@ -54,7 +54,6 @@ class modDeplacement extends DolibarrModules
$this->version = 'dolibarr_deprecated';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = "trip";
// Data directories to create when module is enabled
@@ -108,12 +107,12 @@ class modDeplacement extends DolibarrModules
$this->rights[5][3] = 0;
$this->rights[5][4] = 'export';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
$r=0;
@@ -134,12 +133,12 @@ class modDeplacement extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE d.fk_user = u.rowid';
$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('deplacement').')';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR d.fk_soc IS NULL)';
-
+
if (! empty($user)) // Not defined during migration process
{
$childids = $user->getAllChildIds();
$childids[]=$user->id;
-
+
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
}
}
diff --git a/htdocs/core/modules/modDocumentGeneration.class.php b/htdocs/core/modules/modDocumentGeneration.class.php
index ec40c8b6dc5..211fb38feca 100644
--- a/htdocs/core/modules/modDocumentGeneration.class.php
+++ b/htdocs/core/modules/modDocumentGeneration.class.php
@@ -53,7 +53,6 @@ class modDocumentGeneration extends DolibarrModules
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='email';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php
index 08564e241aa..dacfad736bf 100644
--- a/htdocs/core/modules/modDon.class.php
+++ b/htdocs/core/modules/modDon.class.php
@@ -52,7 +52,6 @@ class modDon extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='bill';
diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php
index 21aa3644e3e..c7bc152ff64 100644
--- a/htdocs/core/modules/modDynamicPrices.class.php
+++ b/htdocs/core/modules/modDynamicPrices.class.php
@@ -49,8 +49,6 @@ class modDynamicPrices extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php
index b263b16e29e..5b85ada7f70 100644
--- a/htdocs/core/modules/modECM.class.php
+++ b/htdocs/core/modules/modECM.class.php
@@ -57,8 +57,6 @@ class modECM extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 0;
// Name of png file (without png) used for this module
$this->picto='dir';
diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php
index 94c86e6e3b1..6fab26d68f6 100644
--- a/htdocs/core/modules/modExpedition.class.php
+++ b/htdocs/core/modules/modExpedition.class.php
@@ -58,7 +58,6 @@ class modExpedition extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = "sending";
// Data directories to create when module is enabled
@@ -222,8 +221,8 @@ class modExpedition extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php
index 4d84c0a6d05..9cc16969748 100644
--- a/htdocs/core/modules/modExpenseReport.class.php
+++ b/htdocs/core/modules/modExpenseReport.class.php
@@ -51,7 +51,6 @@ class modExpenseReport extends DolibarrModules
$this->description = "Manage and claim expense reports (transportation, meal, ...)";
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='trip';
// Data directories to create when module is enabled.
diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php
index 4f754711ea1..b88438f5fe1 100644
--- a/htdocs/core/modules/modExport.class.php
+++ b/htdocs/core/modules/modExport.class.php
@@ -51,7 +51,6 @@ class modExport extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = 'technic';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php
index e3f4a538c4d..cf02888b9d2 100644
--- a/htdocs/core/modules/modExternalRss.class.php
+++ b/htdocs/core/modules/modExternalRss.class.php
@@ -52,7 +52,6 @@ class modExternalRss extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 1;
$this->picto='rss';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modExternalSite.class.php b/htdocs/core/modules/modExternalSite.class.php
index 388bc340776..18bb0b000b2 100644
--- a/htdocs/core/modules/modExternalSite.class.php
+++ b/htdocs/core/modules/modExternalSite.class.php
@@ -49,7 +49,7 @@ class modExternalSite extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','technic','other'
// It is used to sort modules in module setup page
- $this->family = "other";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
@@ -58,8 +58,6 @@ class modExternalSite extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 1;
// Name of png file (without png) used for this module
$this->picto='bookmark';
// Call to inside lang's file
diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php
index 5e4785d4225..bdd745437e1 100644
--- a/htdocs/core/modules/modFTP.class.php
+++ b/htdocs/core/modules/modFTP.class.php
@@ -48,7 +48,7 @@ class modFTP extends DolibarrModules
// Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
// It is used to sort modules in module setup page
- $this->family = "other";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
@@ -57,8 +57,6 @@ class modFTP extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of png file (without png) used for this module
$this->picto='dir';
@@ -110,7 +108,7 @@ class modFTP extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'write';
-
+
// Menus
//-------
$this->menu[$r]=array('fk_menu'=>0,
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index 04628560d74..9a23c0e5e9d 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -57,7 +57,6 @@ class modFacture extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = 'bill';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php
index 54e1eadd735..812aa227ff6 100644
--- a/htdocs/core/modules/modFckeditor.class.php
+++ b/htdocs/core/modules/modFckeditor.class.php
@@ -52,7 +52,6 @@ class modFckeditor extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 2;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='list';
diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php
index 0d9f73b76e4..0ba8f1bc42d 100644
--- a/htdocs/core/modules/modFicheinter.class.php
+++ b/htdocs/core/modules/modFicheinter.class.php
@@ -58,7 +58,6 @@ class modFicheinter extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = "intervention";
// Data directories to create when module is enabled
@@ -147,12 +146,12 @@ class modFicheinter extends DolibarrModules
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'unvalidate';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
//Exports
//--------
$r=1;
diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php
index 74c0070c92e..6034af489e5 100644
--- a/htdocs/core/modules/modFournisseur.class.php
+++ b/htdocs/core/modules/modFournisseur.class.php
@@ -59,7 +59,6 @@ class modFournisseur extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='company';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php
index eeb1b482198..88bc8b7e8b9 100644
--- a/htdocs/core/modules/modGeoIPMaxmind.class.php
+++ b/htdocs/core/modules/modGeoIPMaxmind.class.php
@@ -44,7 +44,7 @@ class modGeoIPMaxmind extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -53,8 +53,6 @@ class modGeoIPMaxmind extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php
index c8ef071cf7e..8f25ed2025a 100644
--- a/htdocs/core/modules/modGravatar.class.php
+++ b/htdocs/core/modules/modGravatar.class.php
@@ -48,7 +48,7 @@ class modGravatar extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -57,8 +57,6 @@ class modGravatar extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php
index 3d1ea43f63c..a209fdccf2e 100644
--- a/htdocs/core/modules/modHRM.class.php
+++ b/htdocs/core/modules/modHRM.class.php
@@ -31,41 +31,40 @@ class modHRM extends DolibarrModules
* Constructor.
* Define names, constants, directories, boxes, permissions
*
- * @param DoliDB $db
+ * @param DoliDB $db Database handler
*/
public function __construct($db)
{
global $langs, $conf;
-
+
$this->db = $db;
$this->numero = 4000;
$this->rights_class = 'hrm';
-
+
$this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace( '/^mod/i', '', get_class($this));
$this->description = "Management of employees carrier and feelings (department, employment contract)";
-
+
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
-
+
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
- $this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
$this->picto='generic';
-
+
// define triggers
$this->module_parts = array();
-
+
// Data directories to create when module is enabled
$this->dirs = array();
-
+
// Config pages
$this->config_page_url = array('admin_hrm.php@hrm');
-
+
// Dependencies
$this->depends = array();
$this->requiredby = array(/*"
@@ -76,14 +75,14 @@ class modHRM extends DolibarrModules
$this->conflictwith = array();
$this->phpmin = array (
5,
- 3
+ 3
); // Minimum version of PHP required by module
$this->need_dolibarr_version = array (
3,
- 9
+ 9
); // Minimum version of Dolibarr required by module
$this->langfiles = array (
- "hrm"
+ "hrm"
);
// Dictionnaries
@@ -95,7 +94,7 @@ class modHRM extends DolibarrModules
// Boxes
$this->boxes = array ();
-
+
// Permissions
$this->rights = array(); // Permission array used by this module
$r = 0;
@@ -106,21 +105,21 @@ class modHRM extends DolibarrModules
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'read';
$r ++;
-
+
$this->rights[$r][0] = 4002;
$this->rights[$r][1] = 'Create employees';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'write';
$r ++;
-
+
$this->rights[$r][0] = 4003;
$this->rights[$r][1] = 'Delete employees';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'employee';
$this->rights[$r][5] = 'delete';
$r ++;
-
+
$this->rights[$r][0] = 4004;
$this->rights[$r][1] = 'Export employees';
$this->rights[$r][3] = 0;
@@ -128,13 +127,13 @@ class modHRM extends DolibarrModules
$this->rights[$r][5] = 'export';
$r ++;
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
-
+
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus
diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php
index aef9eb9a7bb..3fd056b525e 100644
--- a/htdocs/core/modules/modHoliday.class.php
+++ b/htdocs/core/modules/modHoliday.class.php
@@ -62,8 +62,6 @@ class modHoliday extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php
index 18696ef4b11..01d66644dc7 100644
--- a/htdocs/core/modules/modImport.class.php
+++ b/htdocs/core/modules/modImport.class.php
@@ -51,7 +51,6 @@ class modImport extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto = 'technic';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php
index 7b992fe0fde..7d4d1251f31 100644
--- a/htdocs/core/modules/modIncoterm.class.php
+++ b/htdocs/core/modules/modIncoterm.class.php
@@ -57,8 +57,6 @@ class modIncoterm extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
$this->picto='generic';
$this->module_parts = array();
diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php
index 4f7cb8cacbb..2d91fd121bb 100644
--- a/htdocs/core/modules/modLabel.class.php
+++ b/htdocs/core/modules/modLabel.class.php
@@ -51,7 +51,6 @@ class modLabel extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 2;
$this->picto='label';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php
index 27174a7dda0..0f183bd6c76 100644
--- a/htdocs/core/modules/modLdap.class.php
+++ b/htdocs/core/modules/modLdap.class.php
@@ -42,15 +42,13 @@ class modLdap extends DolibarrModules
$this->db = $db;
$this->numero = 200;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Synchronisation Ldap";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php
index 7e445a3dbce..51779f6ffc5 100644
--- a/htdocs/core/modules/modLoan.class.php
+++ b/htdocs/core/modules/modLoan.class.php
@@ -54,7 +54,6 @@ class modLoan extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='bill';
// Data directories to create when module is enabled
@@ -118,7 +117,7 @@ class modLoan extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'delete';
$this->rights[$r][5] = '';
-
+
$r++;
$this->rights[$r][0] = 525;
$this->rights[$r][1] = 'Access loan calculator';
@@ -135,12 +134,12 @@ class modLoan extends DolibarrModules
$this->rights[$r][4] = 'export';
$this->rights[$r][5] = '';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php
index 64966e2105c..46b31a08696 100644
--- a/htdocs/core/modules/modMailing.class.php
+++ b/htdocs/core/modules/modMailing.class.php
@@ -51,7 +51,6 @@ class modMailing extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='email';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php
index 209dcba3d2b..9a019db7fea 100644
--- a/htdocs/core/modules/modMailmanSpip.class.php
+++ b/htdocs/core/modules/modMailmanSpip.class.php
@@ -43,7 +43,7 @@ class modMailmanSpip extends DolibarrModules
$this->db = $db;
$this->numero = 105;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Mailman or Spip interface for member module";
@@ -52,7 +52,6 @@ class modMailmanSpip extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 1;
$this->picto='technic';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php
index 0a7f1a73a67..53fba120656 100644
--- a/htdocs/core/modules/modMargin.class.php
+++ b/htdocs/core/modules/modMargin.class.php
@@ -57,8 +57,6 @@ class modMargin extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 2;
// Name of png file (without png) used for this module.
// Png file must be in theme/yourtheme/img directory under name object_pictovalue.png.
$this->picto='margin';
diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php
index 606cdd7af22..2c7b917d6d2 100644
--- a/htdocs/core/modules/modModuleBuilder.class.php
+++ b/htdocs/core/modules/modModuleBuilder.class.php
@@ -51,8 +51,6 @@ class modModuleBuilder extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php
index 9d1be806de1..0dbfe3380cf 100644
--- a/htdocs/core/modules/modMultiCurrency.class.php
+++ b/htdocs/core/modules/modMultiCurrency.class.php
@@ -65,8 +65,6 @@ class modMultiCurrency extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php
index a4a56e1da0d..cc016d294b5 100644
--- a/htdocs/core/modules/modNotification.class.php
+++ b/htdocs/core/modules/modNotification.class.php
@@ -41,7 +41,7 @@ class modNotification extends DolibarrModules
$this->db = $db;
$this->numero = 600;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "EMail notifications (push) on business Dolibarr events";
@@ -49,7 +49,6 @@ class modNotification extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 1;
$this->picto='email';
// Data directories to create when module is enabled.
diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php
index 0dce715a9f4..8b045608a6d 100644
--- a/htdocs/core/modules/modOauth.class.php
+++ b/htdocs/core/modules/modOauth.class.php
@@ -46,7 +46,7 @@ class modOauth extends DolibarrModules
$this->numero = 66000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
$this->module_position = 510;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@@ -55,8 +55,6 @@ class modOauth extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php
index ea10750ad7c..fcee9f585aa 100644
--- a/htdocs/core/modules/modOpenSurvey.class.php
+++ b/htdocs/core/modules/modOpenSurvey.class.php
@@ -61,8 +61,6 @@ class modOpenSurvey extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php
index 6cbdd5e2127..164c9b0753a 100644
--- a/htdocs/core/modules/modPaybox.class.php
+++ b/htdocs/core/modules/modPaybox.class.php
@@ -48,7 +48,7 @@ class modPayBox extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "other";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -57,8 +57,6 @@ class modPayBox extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php
index 08f1c77e6d6..3ea0535bd4f 100644
--- a/htdocs/core/modules/modPaypal.class.php
+++ b/htdocs/core/modules/modPaypal.class.php
@@ -49,7 +49,7 @@ class modPaypal extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "other";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -58,8 +58,6 @@ class modPaypal extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php
index 542a02e7589..4d91c937d99 100644
--- a/htdocs/core/modules/modPrelevement.class.php
+++ b/htdocs/core/modules/modPrelevement.class.php
@@ -57,7 +57,6 @@ class modPrelevement extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
// Name of png file (without png) used for this module
$this->picto='payment';
@@ -74,15 +73,15 @@ class modPrelevement extends DolibarrModules
// Constants
$this->const = array();
$r=0;
-
+
$this->const[$r][0] = "BANK_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "sepamandate";
$this->const[$r][3] = 'Name of manager to generate SEPA mandate';
$this->const[$r][4] = 0;
$r++;
-
-
+
+
// Boxes
$this->boxes = array();
@@ -129,11 +128,11 @@ class modPrelevement extends DolibarrModules
$this->rights[2][4] = 'bons';
$this->rights[2][5] = 'configurer';
*/
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
}
@@ -155,7 +154,7 @@ class modPrelevement extends DolibarrModules
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'bankaccount' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','bankaccount',".$conf->entity.")",
- );
+ );
return $this->_init($sql,$options);
}
diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php
index 89bf6115dae..9924e1861b4 100644
--- a/htdocs/core/modules/modPrinting.class.php
+++ b/htdocs/core/modules/modPrinting.class.php
@@ -46,7 +46,7 @@ class modPrinting extends DolibarrModules
$this->numero = 64000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
$this->module_position = 520;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@@ -54,8 +54,6 @@ class modPrinting extends DolibarrModules
$this->description = "Enable Direct Printing System.";
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 427b2cd72e0..b2a0a6faf4f 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -59,7 +59,6 @@ class modProduct extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='product';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php
index 9dbc8eb0212..91e8ddbae3c 100644
--- a/htdocs/core/modules/modProductBatch.class.php
+++ b/htdocs/core/modules/modProductBatch.class.php
@@ -47,7 +47,7 @@ class modProductBatch extends DolibarrModules
$this->family = "products";
$this->module_position = 45;
-
+
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Batch number, eat-by and sell-by date management module";
@@ -56,7 +56,6 @@ class modProductBatch extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where dluo is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='stock';
@@ -95,12 +94,12 @@ class modProductBatch extends DolibarrModules
$this->rights = array(); // Permission array used by this module
$r=0;
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
$r=0;
diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index edf5a1ab050..ab837803349 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -58,7 +58,6 @@ class modProjet extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->config_page_url = array("project.php@projet");
$this->picto='project';
diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php
index a6b38f7d5ff..d4db0130492 100644
--- a/htdocs/core/modules/modPropale.class.php
+++ b/htdocs/core/modules/modPropale.class.php
@@ -58,7 +58,6 @@ class modPropale extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='propal';
// Data directories to create when module is enabled
@@ -101,13 +100,13 @@ class modPropale extends DolibarrModules
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
-
+
/*$this->const[$r][0] = "PROPALE_DRAFT_WATERMARK";
$this->const[$r][2] = "__(Draft)__";
$this->const[$r][3] = 'Watermark to show on draft proposals';
$this->const[$r][4] = 0;
$r++;*/
-
+
// Boxes
$this->boxes = array(
0=>array('file'=>'box_graph_propales_permonth.php','enabledbydefaulton'=>'Home'),
@@ -170,12 +169,12 @@ class modPropale extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php
index 50c93f07220..02e156a7abf 100644
--- a/htdocs/core/modules/modReceiptPrinter.class.php
+++ b/htdocs/core/modules/modReceiptPrinter.class.php
@@ -46,7 +46,7 @@ class modReceiptPrinter extends DolibarrModules
$this->numero = 67000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "technic";
+ $this->family = "interface";
$this->module_position = 530;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
@@ -55,8 +55,6 @@ class modReceiptPrinter extends DolibarrModules
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php
index 148dbece597..a13410ddcf1 100644
--- a/htdocs/core/modules/modResource.class.php
+++ b/htdocs/core/modules/modResource.class.php
@@ -69,9 +69,6 @@ class modResource extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled
// (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
- // Where to store the module in setup page
- // (0=common,1=interface,2=others,3=very specific)
- $this->special = 2;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png
// use this->picto='pictovalue'
diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php
index aecb9eeb49f..1e648c1386a 100644
--- a/htdocs/core/modules/modSalaries.class.php
+++ b/htdocs/core/modules/modSalaries.class.php
@@ -60,7 +60,6 @@ class modSalaries extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='bill';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php
index 7a9a3f4df3f..20261e98ca6 100644
--- a/htdocs/core/modules/modService.class.php
+++ b/htdocs/core/modules/modService.class.php
@@ -57,7 +57,6 @@ class modService extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='service';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php
index 4c7d862cf66..d84520318a3 100644
--- a/htdocs/core/modules/modSkype.class.php
+++ b/htdocs/core/modules/modSkype.class.php
@@ -44,7 +44,7 @@ class modSkype extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "crm";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable Skype links into contacts";
@@ -52,8 +52,6 @@ class modSkype extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
$this->picto='skype';
diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php
index c41c2d391cc..52e865cbdbc 100644
--- a/htdocs/core/modules/modSociete.class.php
+++ b/htdocs/core/modules/modSociete.class.php
@@ -58,7 +58,6 @@ class modSociete extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->config_page_url = array("societe.php@societe");
// Name of image file used for this module.
$this->picto='company';
diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php
index c23a02eeac1..ccbf6f83f57 100644
--- a/htdocs/core/modules/modStock.class.php
+++ b/htdocs/core/modules/modStock.class.php
@@ -57,7 +57,6 @@ class modStock extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='stock';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php
index 7e6b15dee74..46af17cee55 100644
--- a/htdocs/core/modules/modStripe.class.php
+++ b/htdocs/core/modules/modStripe.class.php
@@ -48,7 +48,7 @@ class modStripe extends DolibarrModules
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
- $this->family = "other";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
@@ -57,8 +57,6 @@ class modStripe extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=other)
- $this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png'
diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php
index 8869f0cd343..34584ea3ffa 100644
--- a/htdocs/core/modules/modSupplierProposal.class.php
+++ b/htdocs/core/modules/modSupplierProposal.class.php
@@ -56,7 +56,6 @@ class modSupplierProposal extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='supplier_proposal';
$this->dirs = array();
@@ -177,7 +176,7 @@ class modSupplierProposal extends DolibarrModules
'position'=>302
);
$r++;
-
+
$this->menu[$r]=array(
'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu',
'type'=>'left',
@@ -233,8 +232,8 @@ class modSupplierProposal extends DolibarrModules
return $this->_init($sql, $options);
}
-
-
+
+
/**
* Function called when module is disabled.
@@ -249,8 +248,8 @@ class modSupplierProposal extends DolibarrModules
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE module = 'askpricesupplier'"
);
-
+
return $this->_remove($sql, $options);
- }
-
+ }
+
}
\ No newline at end of file
diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php
index 5f7ad0f387f..97c7b71ae21 100644
--- a/htdocs/core/modules/modSyslog.class.php
+++ b/htdocs/core/modules/modSyslog.class.php
@@ -57,8 +57,6 @@ class modSyslog extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 2;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php
index 8dfc7283b90..f3fa7d4e9db 100644
--- a/htdocs/core/modules/modTax.class.php
+++ b/htdocs/core/modules/modTax.class.php
@@ -58,7 +58,6 @@ class modTax extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='bill';
// Data directories to create when module is enabled
@@ -119,10 +118,10 @@ class modTax extends DolibarrModules
// Menus
//-------
-
+
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
@@ -140,7 +139,7 @@ class modTax extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementcharge as p ON p.fk_charge = c.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id';
$this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('tax').')';
-
+
// Import social contributions
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
@@ -151,14 +150,14 @@ class modTax extends DolibarrModules
$this->import_fields_array[$r]=array('t.libelle'=>"Label*",'t.fk_type'=>"Type",
't.amount'=>"Amount*",'t.date_ech'=>"DateDue*",'t.periode'=>"PeriodEndDate*"
);
-
+
$this->import_convertvalue_array[$r]=array(
't.fk_type'=>array('rule'=>'fetchidfromref','classfile'=>'/compta/sociales/class/cchargesociales.class.php','class'=>'Cchargesociales','method'=>'fetch','element'=>'Cchargesociales')
);
$this->import_examplevalues_array[$r]=array('t.libelle'=>"Social/fiscal contribution",'t.fk_type'=>"TAXPRO (must be id or code found into dictionary)",
't.date_ech'=>"2016-01-01", 't.periode'=>"2016-01-01"
);
-
+
// Import Taxes
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
@@ -169,14 +168,14 @@ class modTax extends DolibarrModules
$this->import_fields_array[$r]=array('t.datep'=>"DatePayment*",'t.datev'=>"DateValue*",'t.label'=>"Label*",'t.fk_typepayment'=>"PaymentMode*",
't.amount'=>"Amount*",'t.num_payment'=>'Numero'
);
-
+
$this->import_convertvalue_array[$r]=array(
't.fk_typepayment'=>array('rule'=>'fetchidfromref','classfile'=>'/compta/paiement/class/cpaiement.class.php','class'=>'Cpaiement','method'=>'fetch','element'=>'Cpaiement')
);
$this->import_examplevalues_array[$r]=array('t.label'=>"VAT Payment 1st quarter 2016",'t.fk_typepayment'=>"CHQ (must be id or code found into dictionary)",
't.datep'=>"2016-04-02", 't.datev'=>"2016-03-31", 't.amount'=>1000, 't.num_payment'=>'123456'
);
-
+
}
diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php
index 95474ac8921..92323f853f6 100644
--- a/htdocs/core/modules/modUser.class.php
+++ b/htdocs/core/modules/modUser.class.php
@@ -55,7 +55,6 @@ class modUser extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->special = 0;
$this->picto='group';
// Data directories to create when module is enabled
diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php
index 358a35b4435..87a2e2ce491 100644
--- a/htdocs/core/modules/modVariants.class.php
+++ b/htdocs/core/modules/modVariants.class.php
@@ -62,8 +62,6 @@ class modVariants extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php
index ae979eb026e..8963f81813f 100644
--- a/htdocs/core/modules/modWebServices.class.php
+++ b/htdocs/core/modules/modWebServices.class.php
@@ -40,7 +40,7 @@ class modWebServices extends DolibarrModules
$this->db = $db;
$this->numero = 2600;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the Dolibarr web services server";
@@ -48,8 +48,6 @@ class modWebServices extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php
index 2dd0ee871c5..9b6535143b3 100644
--- a/htdocs/core/modules/modWebServicesClient.class.php
+++ b/htdocs/core/modules/modWebServicesClient.class.php
@@ -40,7 +40,7 @@ class modWebServicesClient extends DolibarrModules
$this->db = $db;
$this->numero = 2660;
- $this->family = "technic";
+ $this->family = "interface";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable the web service client to call external supplier web services";
@@ -48,8 +48,6 @@ class modWebServicesClient extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 1;
// Name of image file used for this module.
$this->picto='technic';
diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php
index d62576c5063..fb6e91283db 100644
--- a/htdocs/core/modules/modWebsite.class.php
+++ b/htdocs/core/modules/modWebsite.class.php
@@ -54,8 +54,6 @@ class modWebsite extends DolibarrModules
$this->version = 'experimental';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 0;
// Name of image file used for this module.
$this->picto='globe';
diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php
index 5c348cdf77f..e721513073a 100644
--- a/htdocs/core/modules/modWorkflow.class.php
+++ b/htdocs/core/modules/modWorkflow.class.php
@@ -56,8 +56,6 @@ class modWorkflow extends DolibarrModules
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
- $this->special = 2;
// Name of png file (without png) used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 8af397d15c1..6c5fa8652f9 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -95,7 +95,7 @@ class doc_generic_product_odt extends ModelePDFProduct
function info($langs)
{
global $conf,$langs;
-
+
$langs->load("companies");
$langs->load("errors");
@@ -361,6 +361,7 @@ class doc_generic_product_odt extends ModelePDFProduct
//print html_entity_decode($odfHandler->__toString());
//print exit;
+ $object->fetch_optionals();
// Make substitutions into odt of freetext
try {
@@ -369,25 +370,26 @@ class doc_generic_product_odt extends ModelePDFProduct
catch(OdfException $e)
{
}
-
- // Make substitutions into odt
- $array_global = $this->get_substitutionarray_each_var_object($object, $outputlangs);
+
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
+ //$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- //$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in product as contact_xxx tags
- $array_thirdparty_contact = array();
- if ($usecontact)
- $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+ // retrieve contact information for use in product as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
- $tmparray = array_merge($array_global,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
- $object->fetch_optionals();
+
// Call the ODTSubstitution hook
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+
foreach($tmparray as $key=>$value)
{
try {
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 35e8ace270e..5c0d025252e 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -569,24 +569,25 @@ class doc_generic_project_odt extends ModelePDFProjects
//print exit;
-
-
- // Make substitutions into odt of user info
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in project as contact_xxx tags
- $array_project_contact = array();
- if ($usecontact)
- $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+ // retrieve contact information for use in project as contact_xxx tags
+ $array_project_contact = array();
+ if ($usecontact) $array_project_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_project_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+
foreach($tmparray as $key=>$value)
{
try {
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 c846d7f6a23..5f7ff754a65 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
@@ -507,17 +507,18 @@ class doc_generic_task_odt extends ModelePDFTask
//print exit;
-
-
- // Make substitutions into odt of user info
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($project,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($project,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
foreach($tmparray as $key=>$value)
{
try {
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 372edb5e5de..bc34d5b5691 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -375,6 +375,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
//print html_entity_decode($odfHandler->__toString());
//print exit;
+ $object->fetch_optionals();
// Make substitutions into odt of freetext
try {
@@ -384,23 +385,25 @@ class doc_generic_proposal_odt extends ModelePDFPropales
{
}
- // Make substitutions into odt
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_object_from_properties=$this->get_substitutionarray_each_var_object($object, $outputlangs);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- // retrieve contact information for use in proposal as contact_xxx tags
- $array_thirdparty_contact = array();
- if ($usecontact)
- $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
+ // retrieve contact information for use in proposal as contact_xxx tags
+ $array_thirdparty_contact = array();
+ if ($usecontact) $array_thirdparty_contact=$this->get_substitutionarray_contact($contactobject,$outputlangs,'contact');
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
+ $tmparray = array_merge($substitutionarray,$array_object_from_properties,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object);
- $object->fetch_optionals();
+
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+
foreach($tmparray as $key=>$value)
{
try {
@@ -421,30 +424,42 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -495,7 +510,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 4f445501669..a8497416501 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -381,18 +381,21 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
{
}
- // Make substitutions into odt
+ // Define substitution array
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
+ $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_user=$this->get_substitutionarray_user($user,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
- $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($outputlangs);
- $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
+ $tmparray = array_merge($substitutionarray,$array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object);
+
// Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+
foreach($tmparray as $key=>$value)
{
try {
@@ -413,30 +416,42 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->lines as $line)
- {
- $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
- complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
- {
- try
- {
- $listlines->setVars($key, $val, true, 'UTF-8');
- }
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
- }
- $listlines->merge();
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
+ {
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->lines as $line)
+ {
+ $tmparray=$this->get_substitutionarray_lines($line,$outputlangs);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$line);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlines->merge();
+ }
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -487,7 +502,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
index d237e1bce38..443981907e0 100644
--- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
+++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
@@ -389,7 +389,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key=>$value)
{
- try
+ try
{
if (preg_match('/logo$/',$key)) // Image
{
@@ -408,34 +408,46 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Replace tags of lines
try
{
- $listlines = $odfHandler->setSegment('lines');
- foreach ($object->members as $u)
+ $foundtagforlines = 1;
+ try {
+ $listlines = $odfHandler->setSegment('lines');
+ }
+ catch(OdfException $e)
{
- $tmparray=$this->get_substitutionarray_each_var_object($u,$outputlangs);
- unset($tmparray['object_pass']);
- unset($tmparray['object_pass_indatabase']);
- complete_substitutions_array($tmparray, $outputlangs, $object, $user, "completesubstitutionarray_users");
- // Call the ODTSubstitutionLine hook
- $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$u);
- $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- foreach($tmparray as $key => $val)
+ // We may arrive here if tags for lines not present into template
+ $foundtagforlines = 0;
+ dol_syslog($e->getMessage(), LOG_INFO);
+ }
+ if ($foundtagforlines)
+ {
+ foreach ($object->members as $u)
{
- try
+ $tmparray=$this->get_substitutionarray_each_var_object($u,$outputlangs);
+ unset($tmparray['object_pass']);
+ unset($tmparray['object_pass_indatabase']);
+ complete_substitutions_array($tmparray, $outputlangs, $object, $user, "completesubstitutionarray_users");
+ // Call the ODTSubstitutionLine hook
+ $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray,'line'=>$u);
+ $reshook=$hookmanager->executeHooks('ODTSubstitutionLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ foreach($tmparray as $key => $val)
{
- if(!is_array($val)) {
- $listlines->setVars($key, $val, true, 'UTF-8');
+ try
+ {
+ if(!is_array($val)) {
+ $listlines->setVars($key, $val, true, 'UTF-8');
+ }
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
}
}
- catch(OdfException $e)
- {
- }
- catch(SegmentException $e)
- {
- }
+ $listlines->merge();
}
- $listlines->merge();
+ $odfHandler->mergeSegment($listlines);
}
- $odfHandler->mergeSegment($listlines);
}
catch(OdfException $e)
{
@@ -443,7 +455,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
dol_syslog($this->error, LOG_WARNING);
return -1;
}
-
+
// Replace labels translated
$tmparray=$outputlangs->get_translations_for_substitutions();
foreach($tmparray as $key=>$value)
@@ -486,7 +498,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index fdf2f722932..a48e8a5f31a 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -93,6 +93,7 @@ $langs->load("modulebuilder");
else if (type == 'int') { size.val('10').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
else if (type == 'text') { size.val('2000').removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
else if (type == 'varchar') { size.val('255').removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
+ else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
@@ -165,6 +166,7 @@ $langs->load("modulebuilder");
textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index e0b4927bf19..a919b545a36 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -91,6 +91,7 @@ $langs->load("modulebuilder");
else if (type == 'int') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
+ else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide();}
else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();jQuery("#helpchkbxlst").hide();jQuery("#helplink").hide();}
@@ -166,7 +167,7 @@ if((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_ar
}
}
}
-elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') )
+elseif (($type== 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password'))
{
$paramlist=array_keys($param['options']);
$param_chain = $paramlist[0];
@@ -210,7 +211,7 @@ else
-
+
trans("Value"); ?>
@@ -224,6 +225,7 @@ else
textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0,'', 0, 2, 'helpvalue2')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"),1,0,'', 0, 2, 'helpvalue3')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelplink"),1,0,'', 0, 2, 'helpvalue4')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"),1,0,'', 0, 2, 'helpvalue5')?>
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 82d6c746640..27b70e1b8cf 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -155,9 +155,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
- // Fill array 'array_options' with data from update form
+ $object->oldcopy = dol_clone($object);
+
+ // Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 0141fc1dea5..3b7a2d74818 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -180,9 +180,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
- // Fill array 'array_options' with data from update form
+ $object->oldcopy = dol_clone($object);
+
+ // Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index a71ba9762b6..dd5db880bc9 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -286,9 +286,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
- // Fill array 'array_options' with data from update form
+ $object->oldcopy = dol_clone($object);
+
+ // Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
@@ -1978,7 +1980,8 @@ else
$i = 0;$total = 0;
print '
';
- print ''.$langs->trans('Piece').' ';
+ print ''.$langs->trans('LineNb').' ';
+ //print ''.$langs->trans('Piece').' ';
print ''.$langs->trans('Date').' ';
if (! empty($conf->projet->enabled)) print ''.$langs->trans('Project').' ';
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print ''.$langs->trans('CarCategory').' ';
@@ -2001,15 +2004,21 @@ else
foreach ($object->lines as &$line)
{
- $piece_comptable = $i + 1;
+ $numline = $i + 1;
if ($action != 'editline' || $line->rowid != GETPOST('rowid'))
{
print ' ';
print '';
+ print $numline;
+ print ' ';
+
+ /*print '';
print img_picto($langs->trans("Document"), "object_generic");
- print ' '.$piece_comptable.' ';
+ print ' '.$piece_comptable.' ';
+ print '';*/
+
print ''.dol_print_date($db->jdate($line->date), 'day').' ';
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 3eddb02c28b..9b623d21279 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -741,9 +741,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
+ $object->oldcopy = dol_clone($object);
+
// Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 6f06a6778fd..c6f0c8bb446 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -114,9 +114,11 @@ if (empty($reshook))
if ($action == 'update_extras') {
$object->fetch($id);
+ $object->oldcopy = dol_clone($object);
+
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 1ae96927ee6..c4792edac4c 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder
// Check parameters
if (empty($id) && empty($ref)) return -1;
- $sql = "SELECT c.rowid, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_vat,";
+ $sql = "SELECT c.rowid, c.entity, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_vat,";
$sql.= " c.localtax1, c.localtax2, ";
$sql.= " c.date_creation, c.date_valid, c.date_approve, c.date_approve2,";
$sql.= " c.fk_user_author, c.fk_user_valid, c.fk_user_approve, c.fk_user_approve2,";
@@ -253,6 +253,8 @@ class CommandeFournisseur extends CommonOrder
}
$this->id = $obj->rowid;
+ $this->entity = $obj->entity;
+
$this->ref = $obj->ref;
$this->ref_supplier = $obj->ref_supplier;
$this->socid = $obj->fk_soc;
@@ -2964,7 +2966,58 @@ class CommandeFournisseur extends CommonOrder
}
return 4;
}
- }
+ }elseif(! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) )
+ {//set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...)
+
+ $close=0;
+
+ if( count($diff_array) > 0 )
+ {//there are some difference between the two arrays
+
+ //scan the array of results
+ foreach($diff_array as $key => $value)
+ {//if the quantity delivered is greater or equal to wish quantity
+ if($qtydelivered[$key] >= $qtywished[$key] )
+ {
+ $close++;
+ }
+
+ }
+ }
+
+
+ if($close == count($diff_array))
+ {//all the products are received equal or more than the wished quantity
+ if ($closeopenorder)
+ {
+ $ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
+ if ($ret<0) {
+ return -1;
+ }
+ return 5;
+ }
+ else
+ {
+ //Diff => received partially
+ $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
+ if ($ret<0) {
+ return -1;
+ }
+ return 4;
+ }
+
+
+ }
+ else
+ {//all the products are not received
+ $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
+ if ($ret<0) {
+ return -1;
+ }
+ return 4;
+ }
+
+ }
else
{
//Diff => received partially
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 0823ceb9fd7..b9a2f72b9bd 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -64,10 +64,6 @@ class ProductFournisseur extends Product
var $fourn_unitprice;
var $fourn_tva_tx;
var $fourn_tva_npr;
- /**
- * @deprecated
- */
- var $fourn_unitcharges; // old version used a buggy system to calculate margin of a charge field on supplier price. Now margin is on pmp, best supplier price or cost price.
var $fk_supplier_price_expression;
var $supplier_reputation; // reputation of supplier
@@ -245,7 +241,6 @@ class ProductFournisseur extends Product
$error=0;
$unitBuyPrice = price2num($buyprice/$qty,'MU');
- $unitCharges = price2num($charges/$qty,'MU');
$now=dol_now();
@@ -280,7 +275,6 @@ class ProductFournisseur extends Product
$sql.= " remise_percent = ".$remise_percent.",";
$sql.= " remise = ".$remise.",";
$sql.= " unitprice = ".$unitBuyPrice.",";
- $sql.= " unitcharges = ".$unitCharges.","; // deprecated
$sql.= " fk_availability = ".$availability.",";
$sql.= " multicurrency_price = ".(isset($multicurrency_buyprice)?"'".$this->db->escape(price2num($multicurrency_buyprice))."'":'null').",";
$sql.= " multicurrency_unitprice = ".(isset($multicurrency_unitBuyPrice)?"'".$this->db->escape(price2num($multicurrency_unitBuyPrice))."'":'null').",";
@@ -342,7 +336,7 @@ class ProductFournisseur extends Product
// Add price for this quantity to supplier
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price(";
$sql.= " multicurrency_price, multicurrency_unitprice, multicurrency_tx, fk_multicurrency, multicurrency_code,";
- $sql .= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, unitcharges, fk_availability, default_vat_code, info_bits, entity, delivery_time_days, supplier_reputation)";
+ $sql .= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, fk_availability, default_vat_code, info_bits, entity, delivery_time_days, supplier_reputation)";
$sql .= " values(";
$sql.= (isset($multicurrency_buyprice)?"'".$this->db->escape(price2num($multicurrency_buyprice))."'":'null').",";
$sql.= (isset($multicurrency_unitBuyPrice)?"'".$this->db->escape(price2num($multicurrency_unitBuyPrice))."'":'null').",";
@@ -361,7 +355,6 @@ class ProductFournisseur extends Product
$sql .= " " . $unitBuyPrice . ",";
$sql .= " " . $tva_tx . ",";
$sql .= " " . $charges . ",";
- $sql .= " " . $unitCharges . ",";
$sql .= " " . $availability . ",";
$sql .= " ".($newdefaultvatcode?"'".$this->db->escape($newdefaultvatcode)."'":"null").",";
$sql .= " " . $newnpr . ",";
@@ -442,7 +435,7 @@ class ProductFournisseur extends Product
{
global $conf;
$sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.fk_availability,";
- $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges, pfp.fk_supplier_price_expression, pfp.delivery_time_days,"; // , pfp.recuperableonly as fourn_tva_npr"; FIXME this field not exist in llx_product_fournisseur_price
+ $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.fk_supplier_price_expression, pfp.delivery_time_days,"; // , pfp.recuperableonly as fourn_tva_npr"; FIXME this field not exist in llx_product_fournisseur_price
$sql.= " pfp.supplier_reputation";
$sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
@@ -468,7 +461,6 @@ class ProductFournisseur extends Product
$this->fourn_remise_percent = $obj->remise_percent;
$this->fourn_remise = $obj->remise;
$this->fourn_unitprice = $obj->unitprice;
- $this->fourn_unitcharges = $obj->unitcharges; // deprecated
$this->fourn_tva_tx = $obj->tva_tx;
// TODO
// $this->fourn_tva_npr = $obj->fourn_tva_npr; // TODO this field not exist in llx_product_fournisseur_price. We should add it ?
@@ -534,7 +526,7 @@ class ProductFournisseur extends Product
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
$sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
- $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation";
+ $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation";
$sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -567,7 +559,6 @@ class ProductFournisseur extends Product
$prodfourn->fourn_remise = $record["remise"];
$prodfourn->fourn_unitprice = $record["unitprice"];
$prodfourn->fourn_charges = $record["charges"]; // deprecated
- $prodfourn->fourn_unitcharges = $record["unitcharges"]; // deprecated
$prodfourn->fourn_tva_tx = $record["tva_tx"];
$prodfourn->fourn_id = $record["fourn_id"];
$prodfourn->fourn_name = $record["supplier_name"];
@@ -657,7 +648,7 @@ class ProductFournisseur extends Product
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
$sql.= " pfp.rowid as product_fourn_price_id, pfp.ref_fourn,";
- $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.charges, pfp.unitcharges, ";
+ $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.charges,";
$sql.= " pfp.remise, pfp.remise_percent, pfp.fk_supplier_price_expression, pfp.delivery_time_days";
$sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
@@ -693,7 +684,7 @@ class ProductFournisseur extends Product
{
$fourn_price = $record["price"];
// discount calculated buy price
- $fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"];
+ $fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) - $record["remise"];
if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
$prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
@@ -727,7 +718,6 @@ class ProductFournisseur extends Product
$this->fourn_remise = $record["remise"];
$this->fourn_unitprice = $record["unitprice"];
$this->fourn_charges = $record["charges"]; // deprecated
- $this->fourn_unitcharges = $record["unitcharges"]; // deprecated
$this->fourn_tva_tx = $record["tva_tx"];
$this->fourn_id = $record["fourn_id"];
$this->fourn_name = $record["supplier_name"];
@@ -830,14 +820,14 @@ class ProductFournisseur extends Product
$out .= ''.$langs->trans("Supplier").' ';
$out .= ''.$langs->trans("SupplierRef").' ';
foreach ($productFournList as $productFourn) {
- $out.= '
'.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) + $productFourn->fourn_unitcharges - $productFourn->fourn_remise):'').' ';
+ $out.= ''.($showunitprice?price($productFourn->fourn_unitprice * (1 -$productFourn->fourn_remise_percent/100) - $productFourn->fourn_remise):'').' ';
$out.= ''.($showunitprice?$productFourn->fourn_qty:'').' ';
$out.= ''.$productFourn->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' ';
$out.= ''.$productFourn->fourn_ref.' ';
}
$out .= '';
} else {
- $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
+ $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_remise).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
}
return $out;
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 1992a888a47..4f641b100bf 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -946,9 +946,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
+ $object->oldcopy = dol_clone($object);
+
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index f3deb4b12a3..760c80737f4 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -914,7 +914,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
+ $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['cf.datec']['checked'])) print_liste_field_titre($arrayfields['cf.datec']['label'],$_SERVER["PHP_SELF"],"cf.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 99a4a7edbc1..fc2f543b0a4 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1257,9 +1257,11 @@ if (empty($reshook))
}
if ($action == 'update_extras')
{
+ $object->oldcopy = dol_clone($object);
+
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (!$error)
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 1e056292517..083967935fa 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -762,7 +762,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
+ $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER["PHP_SELF"],"f.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index b5dbc72fba0..08d3495c33c 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -1475,10 +1475,11 @@ if ($step == 5 && $datatoimport)
$sourcelinenb=0; $endoffile=0;
// Loop on each input file record
- while ($sourcelinenb < $nboflines && ! $endoffile)
+ while (($sourcelinenb < $nboflines) && ! $endoffile)
{
$sourcelinenb++;
// Read line and store it into $arrayrecord
+ //dol_syslog("line ".$sourcelinenb.' - '.$nboflines.' - '.$excludefirstline.' - '.$endatlinenb);
$arrayrecord=$obj->import_read_record();
if ($arrayrecord === false)
{
@@ -1487,7 +1488,7 @@ if ($step == 5 && $datatoimport)
continue;
}
if ($excludefirstline && ($sourcelinenb < $excludefirstline)) continue;
- if ($endatlinenb && ($sourcelinenb > $endatlinenb)) continue;
+ if ($endatlinenb && ($sourcelinenb > $endatlinenb)) break;
// Run import
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid,$updatekeys);
@@ -1857,7 +1858,7 @@ if ($step == 6 && $datatoimport)
continue;
}
if ($excludefirstline && ($sourcelinenb < $excludefirstline)) continue;
- if ($endatlinenb && ($sourcelinenb > $endatlinenb)) continue;
+ if ($endatlinenb && ($sourcelinenb > $endatlinenb)) break;
// Run import
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid,$updatekeys);
diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
index 1e0388cff94..56659ea714c 100644
--- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
+++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
@@ -242,7 +242,7 @@ UPDATE llx_bank_account SET accountancy_journal = 'OD' WHERE accountancy_journal
ALTER TABLE llx_bank_account ADD COLUMN fk_accountancy_journal integer;
ALTER TABLE llx_bank_account ADD INDEX idx_fk_accountancy_journal (fk_accountancy_journal);
-UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
+UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code AND aj.entity = ba.entity) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
--Update general ledger for FEC format & harmonization
diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
index 6e9e480cdb0..190e0dcf05f 100644
--- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
+++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql
@@ -321,6 +321,8 @@ CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
active integer DEFAULT 1
)ENGINE=innodb;
+ALTER TABLE llx_expensereport_ik ADD COLUMN ikoffset double DEFAULT 0 NOT NULL;
+
CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat (
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(48) NOT NULL,
diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
index 558c3c6292e..74909c7a649 100644
--- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
+++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
@@ -29,6 +29,8 @@
-- For 8.0
+ALTER TABLE llx_product_fournisseur_price DROP COLUMN unitcharges;
+
ALTER TABLE llx_societe ADD COLUMN fk_entrepot integer DEFAULT 0;
ALTER TABLE llx_projet ADD COLUMN bill_time integer DEFAULT 0;
@@ -57,5 +59,6 @@ insert into llx_c_type_container (code,label,module,active) values ('other',
ALTER TABLE `llx_product_fournisseur_price` CHANGE `multicurrency_price_ttc` `multicurrency_unitprice` DOUBLE(24,8) NULL DEFAULT NULL;
ALTER TABLE `llx_product_fournisseur_price_log` CHANGE `multicurrency_price_ttc` `multicurrency_unitprice` DOUBLE(24,8) NULL DEFAULT NULL;
+ALTER TABLE llx_expensereport_det ADD COLUMN docnumber varchar(128) after fk_expensereport;
diff --git a/htdocs/install/mysql/tables/llx_expensereport_det.sql b/htdocs/install/mysql/tables/llx_expensereport_det.sql
index 5cc7b1b86f5..fc0bd6e697f 100644
--- a/htdocs/install/mysql/tables/llx_expensereport_det.sql
+++ b/htdocs/install/mysql/tables/llx_expensereport_det.sql
@@ -20,9 +20,10 @@ CREATE TABLE llx_expensereport_det
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
fk_expensereport integer NOT NULL,
- fk_c_type_fees integer NOT NULL,
+ docnumber varchar(128), -- To store a ref of a accounting doc (piece)
+ fk_c_type_fees integer NOT NULL, -- Type of expense
fk_c_exp_tax_cat integer,
- fk_projet integer,
+ fk_projet integer, -- Id of project
comments text NOT NULL,
product_type integer DEFAULT -1,
qty real NOT NULL,
diff --git a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
index 1c86bfe04f8..14664225a9d 100755
--- a/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
+++ b/htdocs/install/mysql/tables/llx_product_fournisseur_price.sql
@@ -29,13 +29,12 @@ create table llx_product_fournisseur_price
fk_soc integer,
ref_fourn varchar(30),
fk_availability integer,
- price double(24,8) DEFAULT 0,
+ price double(24,8) DEFAULT 0, -- price without tax for quantity
quantity double,
remise_percent double NOT NULL DEFAULT 0,
remise double NOT NULL DEFAULT 0,
- unitprice double(24,8) DEFAULT 0,
+ unitprice double(24,8) DEFAULT 0, -- unit price without tax
charges double(24,8) DEFAULT 0, -- to store transport cost. Constant PRODUCT_CHARGES must be set to see it.
- unitcharges double(24,8) DEFAULT 0, -- deprecated
default_vat_code varchar(10),
tva_tx double(6,3) NOT NULL,
localtax1_tx double(6,3) DEFAULT 0,
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index 6b662e4306d..838ef34afa3 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -491,7 +491,7 @@ if (! $error && $db->connected && $action == "set")
'thirdparties' => 'thirdparty',
'usergroups' => 'usergroups',
'users' => 'user',
- 'usergroups' => 'usergroups',
+ 'usergroups' => 'usergroups',
);
foreach($docs as $cursordir => $cursorfile)
{
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 02c44ebee88..d6bf4d01fe9 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -411,6 +411,7 @@ ExtrafieldCheckBoxFromList=Checkboxes from table
ExtrafieldLink=Link to an object
ComputedFormula=Computed field
ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object:
$db, $conf, $langs, $mysoc, $user, $object .
WARNING : Only some properties of $object may be available. If you need a properties not loaded, just fetch yourself the object into your formula like in the second example.
Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.
Example of formula:
$object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)
Example to reload object
(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'
Other example of formula to force load of object and its parent object:
(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Parent project not found'
+ExtrafieldParamHelpPassword=Keep this field empty means value will be stored without encryption (field must be only hidden with star on screen).
Set here value 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retreive original value)
ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
code3,value3
...
In order to have the list depending on another complementary attribute list :
1,value1|options_
parent_list_code :parent_key
2,value2|options_
parent_list_code :parent_key
In order to have the list depending on another list :
1,value1|
parent_list_code :parent_key
2,value2|
parent_list_code :parent_key
ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
3,value3
...
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
3,value3
...
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index a6a330ad68a..9da257b639d 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -857,6 +857,7 @@ FileNotShared=File not shared to exernal public
Project=Project
Projects=Projects
Rights=Permissions
+LineNb=Line nb
# Week day
Monday=Monday
Tuesday=Tuesday
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index b2218508ef6..06c602df330 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -193,9 +193,11 @@ elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
// Update extrafields
if ($action == 'update_extras')
{
+ $object->oldcopy = dol_clone($object);
+
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php
index b6584f8d909..c34574791c1 100644
--- a/htdocs/modulebuilder/template/admin/about.php
+++ b/htdocs/modulebuilder/template/admin/about.php
@@ -42,14 +42,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once '../lib/mymodule.lib.php';
// Translations
-$langs->load("errors");
-$langs->load("admin");
-$langs->load("mymodule@mymodule");
+$langs->loadLangs(array("errors","admin","mymodule@mymodule"));
// Access control
-if (! $user->admin) {
- accessforbidden();
-}
+if (! $user->admin) accessforbidden();
// Parameters
$action = GETPOST('action', 'alpha');
@@ -73,7 +69,7 @@ $page_name = "MyModuleAbout";
llxHeader('', $langs->trans($page_name));
// Subheader
-$linkback = '
'.$langs->trans("BackToModuleList").' ';
+$linkback = '
'.$langs->trans("BackToModuleList").' ';
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule');
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 19908d33546..58a572a42ac 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -71,7 +71,7 @@ $page_name = "MyModuleSetup";
llxHeader('', $langs->trans($page_name));
// Subheader
-$linkback = '
'.$langs->trans("BackToModuleList").' ';
+$linkback = '
'.$langs->trans("BackToModuleList").' ';
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule');
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index 1d8ba3dace6..eea2a85e656 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -53,7 +53,7 @@ class modMyModule extends DolibarrModules
// Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'mymodule';
- // Family can be 'crm','financial','hr','projects','products','ecm','technic','interface','other'
+ // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
// It is used to group modules by family in module setup page
$this->family = "other";
// Module position in the family on 2 digits ('01', '10', '20', ...)
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 72715ec27f1..2ef8fa97030 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -422,7 +422,7 @@ foreach($object->fields as $key => $val)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
-$parameters=array('arrayfields'=>$arrayfields);
+$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index a6cc3427243..79120aa1191 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -370,7 +370,7 @@ if ($id > 0 || ! empty($ref))
}
print '';
- $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT');
+ $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise), 'MT');
$total+=$totalline;
print '
';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index e8fa94c2ae0..462be52b082 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -753,11 +753,6 @@ SCRIPT;
print_liste_field_titre("DiscountQtyMin",$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("NbDaysToDelivery",$_SERVER["PHP_SELF"],"pfp.delivery_time_days","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("ReputationForThisProduct",$_SERVER["PHP_SELF"],"pfp.supplier_reputation","",$param,'align="center"',$sortfield,$sortorder);
- // Charges ????
- if ($conf->global->PRODUCT_CHARGES)
- {
- if (! empty($conf->margin->enabled)) print_liste_field_titre("UnitCharges");
- }
print_liste_field_titre('');
print "\n";
@@ -842,18 +837,6 @@ SCRIPT;
}
print' ';
- // Charges ????
- /*
- if ($conf->global->PRODUCT_CHARGES)
- {
- if (! empty($conf->margin->enabled))
- {
- print '
';
- print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):" ");
- print ' ';
- }
- }*/
-
if (is_object($hookmanager))
{
$parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$object->id);
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index ebb2c0a421a..662c15507f0 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -654,7 +654,7 @@ else
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
- $parameters=array('arrayfields'=>$arrayfields);
+ $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
@@ -793,7 +793,7 @@ else
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
{
$htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
- print $form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise).' '.$langs->trans("HT"),$htmltext);
+ print $form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"),$htmltext);
}
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
}
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 8e639c90108..f269e260b25 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -122,9 +122,11 @@ if (empty($reshook))
if ($action == 'update_extras')
{
- // Fill array 'array_options' with data from update form
+ $object->oldcopy = dol_clone($object);
+
+ // Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
- $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
+ $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
if ($ret < 0) $error++;
if (! $error)
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 8dbce2790fa..c8096559c9c 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -584,10 +584,10 @@ class Project extends CommonObject
$i++;
}
$this->db->free($result);
-
- /* Return array */
- return $elements;
}
+
+ /* Return array even if empty*/
+ return $elements;
}
else
{
diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php
index 61685ed8267..61919c54b1a 100644
--- a/htdocs/public/demo/index.php
+++ b/htdocs/public/demo/index.php
@@ -178,8 +178,6 @@ foreach ($modulesdir as $dir)
$filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
//print "x".$modName." ".$orders[$i]."\n
";
- if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
- else $categ[$objMod->special]=1;
$dirmod[$i] = $dirroot;
$j++;
$i++;
@@ -329,7 +327,7 @@ foreach ($demoprofiles as $profilearray)
print '
';
}
- print '