Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
82dd321662
12 changed files with 37 additions and 24 deletions
|
|
@ -537,7 +537,7 @@ class PaymentVAT extends CommonObject
|
|||
$this->id = 0;
|
||||
$this->fk_tva = 0;
|
||||
$this->datec = dol_now();
|
||||
$this->tms = '';
|
||||
$this->tms = dol_now();
|
||||
$this->datep = '';
|
||||
$this->amount = '';
|
||||
$this->fk_typepaiement = 0;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class box_activity extends ModeleBoxes
|
|||
$this->db = $db;
|
||||
|
||||
// FIXME: Pb into some status
|
||||
$this->enabled = (getDolGlobalString('MAIN_FEATURES_LEVEL')); // Not enabled by default due to bugs (see previous comments)
|
||||
$this->enabled = getDolGlobalInt('MAIN_FEATURES_LEVEL'); // Not enabled by default due to bugs (see previous comments)
|
||||
|
||||
$this->hidden = !(
|
||||
(isModEnabled('facture') && $user->hasRight('facture', 'read'))
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
|||
public $max = 5;
|
||||
|
||||
/**
|
||||
* @var int Condition to have widget enabled
|
||||
* @var bool|int Condition to have widget enabled
|
||||
*/
|
||||
public $enabled = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -206,6 +206,28 @@ function getDolUserInt($key, $default = 0, $tmpuser = null)
|
|||
return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
|
||||
}
|
||||
|
||||
define(
|
||||
'DEPRECATED_MODULE_MAPPING',
|
||||
array(
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'delivery_note',
|
||||
'facture' => 'invoice',
|
||||
'fichinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Is Dolibarr module enabled
|
||||
*
|
||||
|
|
@ -217,17 +239,7 @@ function isModEnabled($module)
|
|||
global $conf;
|
||||
|
||||
// Fix old names (map to new names)
|
||||
$arrayconv = array(
|
||||
'adherent' => 'member',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'expedition' => 'delivery_note',
|
||||
'facture' => 'invoice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
);
|
||||
$arrayconv = DEPRECATED_MODULE_MAPPING;
|
||||
|
||||
if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
|
||||
// Special cases: both use the same module.
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||
public $enabled_bydefault;
|
||||
|
||||
/**
|
||||
* @var bool Whether to hide the module.
|
||||
* @var bool|int Whether to hide the module.
|
||||
*/
|
||||
public $hidden = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class modCollab extends DolibarrModules
|
|||
|
||||
// Dependencies
|
||||
//-------------
|
||||
$this->hidden = getDolGlobalString('MODULE_COLLAB_DISABLED'); // A condition to disable module
|
||||
$this->hidden = getDolGlobalInt('MODULE_COLLAB_DISABLED'); // A condition to disable module
|
||||
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class modCron extends DolibarrModules
|
|||
|
||||
// Dependencies
|
||||
//-------------
|
||||
$this->hidden = getDolGlobalString('MODULE_CRON_DISABLED'); // A condition to disable module
|
||||
$this->hidden = getDolGlobalInt('MODULE_CRON_DISABLED'); // A condition to disable module
|
||||
$this->depends = array(); // List of modules id that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class modSocialNetworks extends DolibarrModules
|
|||
$this->config_page_url = array(DOL_URL_ROOT.'/admin/dict.php?id=38');
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = getDolGlobalString('MODULE_SOCIALNETWORKS_DISABLED'); // A condition to hide module
|
||||
$this->hidden = getDolGlobalInt('MODULE_SOCIALNETWORKS_DISABLED'); // A condition to hide module
|
||||
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
||||
|
|
|
|||
|
|
@ -281,8 +281,8 @@ class modTakePos extends DolibarrModules
|
|||
if ($searchcompanyid == 0) {
|
||||
$societe->name = $nametouse;
|
||||
$societe->client = 1;
|
||||
$societe->code_client = -1;
|
||||
$societe->code_fournisseur = -1;
|
||||
$societe->code_client = '-1';
|
||||
$societe->code_fournisseur = '-1';
|
||||
$societe->note_private = "Default customer automatically created by Point Of Sale module activation. Can be used as the default generic customer in the Point Of Sale setup. Can also be edited or removed if you don't need a generic customer.";
|
||||
|
||||
$searchcompanyid = $societe->create($user);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class modWebsite extends DolibarrModules
|
|||
$this->config_page_url = array('website.php');
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = getDolGlobalString('MODULE_WEBSITE_DISABLED'); // A condition to disable module
|
||||
$this->hidden = getDolGlobalInt('MODULE_WEBSITE_DISABLED'); // A condition to disable module
|
||||
$this->depends = array('modFckeditor'); // List of modules id that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
|
|
|
|||
|
|
@ -720,10 +720,10 @@ class Dolresource extends CommonObject
|
|||
$this->element_type = trim($this->element_type);
|
||||
}
|
||||
if (isset($this->busy)) {
|
||||
$this->busy = trim($this->busy);
|
||||
$this->busy = (int) $this->busy;
|
||||
}
|
||||
if (isset($this->mandatory)) {
|
||||
$this->mandatory = trim($this->mandatory);
|
||||
$this->mandatory = (int) $this->mandatory;
|
||||
}
|
||||
|
||||
// Update request
|
||||
|
|
|
|||
|
|
@ -633,6 +633,7 @@ class CodingPhpTest extends CommonClassTest
|
|||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'delivery_note',
|
||||
'facture' => 'invoice',
|
||||
'fichinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
|
|
@ -647,6 +648,7 @@ class CodingPhpTest extends CommonClassTest
|
|||
'member_type' => 1,
|
||||
'bank' => 1,
|
||||
'category' => 1,
|
||||
'delivery_note' => 1,
|
||||
'order' => 1,
|
||||
'contract' => 1,
|
||||
'stock' => 1,
|
||||
|
|
@ -680,7 +682,6 @@ class CodingPhpTest extends CommonClassTest
|
|||
'ecotax' => 1,
|
||||
'emailcollector' => 1,
|
||||
'eventorganization' => 1,
|
||||
'expedition' => 1,
|
||||
'expensereport' => 1,
|
||||
'export' => 1,
|
||||
'externalsite' => 1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue