Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
2991f992dc
@ -321,7 +321,7 @@ class FormSetup
|
|||||||
*/
|
*/
|
||||||
public function addItemsFromParamsArray($params)
|
public function addItemsFromParamsArray($params)
|
||||||
{
|
{
|
||||||
if (!array($params)) { return false; }
|
if (!is_array($params) || empty($params)) { return false; }
|
||||||
foreach ($params as $confKey => $param) {
|
foreach ($params as $confKey => $param) {
|
||||||
$this->addItemFromParams($confKey, $param); // todo manage error
|
$this->addItemFromParams($confKey, $param); // todo manage error
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1052,12 +1052,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||||
/**
|
/**
|
||||||
* Create tables and keys required by module:
|
* Create tables and keys required by module:
|
||||||
* - Files module.sql files with create table instructions
|
* - Files module.sql with create table instructions
|
||||||
* - Then files modules.key.sql with create keys instructions
|
* - Then modules.key.sql with create keys instructions
|
||||||
* - Then data_xxx.sql (usualy provided by external modules only)
|
* - Then data_xxx.sql (usualy provided by external modules only)
|
||||||
* - Then update_xxx.sql (usualy provided by external modules only)
|
* - Then update_xxx.sql (usualy provided by external modules only)
|
||||||
* Files must be stored in directory defined by reldir (Example: '/install/mysql/tables' or '/module/sql/')
|
* Files must be stored in directory defined by reldir (Example: '/install/mysql/tables' or '/module/sql/')
|
||||||
* This function is usually called by the this->init of module descriptors.
|
* This function may also be called by :
|
||||||
|
* - _load_tables('/install/mysql/tables/', 'modulename') into the this->init() of core module descriptors.
|
||||||
|
* - _load_tables('/mymodule/sql/') into the this->init() of external module descriptors.
|
||||||
*
|
*
|
||||||
* @param string $reldir Relative directory where to scan files. Example: '/install/mysql/tables' or '/module/sql/'
|
* @param string $reldir Relative directory where to scan files. Example: '/install/mysql/tables' or '/module/sql/'
|
||||||
* @param string $onlywithsuffix Only with the defined suffix
|
* @param string $onlywithsuffix Only with the defined suffix
|
||||||
|
|||||||
@ -230,8 +230,6 @@ class modApi extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result = $this->_load_tables('/api/sql/');
|
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -467,11 +467,6 @@ class modBom extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/bom/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields
|
// Create extrafields
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -211,8 +211,6 @@ class modDataPolicy extends DolibarrModules {
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->_load_tables('/datapolicy/sql/');
|
|
||||||
|
|
||||||
// Create extrafields
|
// Create extrafields
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -266,8 +266,6 @@ class modDav extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
//$this->_load_tables('/dav/sql/');
|
|
||||||
|
|
||||||
// Create extrafields
|
// Create extrafields
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -351,11 +351,6 @@ class modEventOrganization extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/eventorganization/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|
||||||
|
|||||||
@ -442,11 +442,6 @@ class modKnowledgeManagement extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/knowledgemanagement/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -446,11 +446,6 @@ class modMrp extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/mrp/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -265,7 +265,6 @@ class modMultiCurrency extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
//$this->_load_tables('/multicurrency/sql/');
|
|
||||||
$res = $this->_init($sql, $options);
|
$res = $this->_init($sql, $options);
|
||||||
|
|
||||||
if ($res) {
|
if ($res) {
|
||||||
|
|||||||
@ -408,11 +408,6 @@ class modPartnership extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/partnership/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -403,11 +403,6 @@ class modRecruitment extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/recruitment/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -301,21 +301,6 @@ class modResource extends DolibarrModules
|
|||||||
{
|
{
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
$result = $this->loadTables();
|
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create tables, keys and data required by module
|
|
||||||
* Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys
|
|
||||||
* and create data commands must be stored in directory /resource/sql/
|
|
||||||
* This function is called by this->init
|
|
||||||
*
|
|
||||||
* @return int <=0 if KO, >0 if OK
|
|
||||||
*/
|
|
||||||
protected function loadTables()
|
|
||||||
{
|
|
||||||
return $this->_load_tables('/resource/sql/');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -283,8 +283,6 @@ class modTakePos extends DolibarrModules
|
|||||||
|
|
||||||
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "TAKEPOS_PRINT_METHOD", "browser", 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$this->_load_tables('/takepos/sql/');
|
|
||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
// Remove permissions and default values
|
// Remove permissions and default values
|
||||||
|
|||||||
@ -390,11 +390,6 @@ class modWorkstation extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/workstation/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -281,11 +281,6 @@ class modZapier extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
$result = $this->_load_tables('/zapier/sql/');
|
|
||||||
if ($result < 0) {
|
|
||||||
return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create extrafields
|
// Create extrafields
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
//$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|||||||
@ -95,7 +95,7 @@ $setupnotempty = 0;
|
|||||||
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
|
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
|
||||||
$useFormSetup = 0;
|
$useFormSetup = 0;
|
||||||
// Convert arrayofparameter into a formSetup object
|
// Convert arrayofparameter into a formSetup object
|
||||||
if (!empty($arrayofparameters) && $useFormSetup && (float) DOL_VERSION >= 15) {
|
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||||
$formSetup = new FormSetup($db);
|
$formSetup = new FormSetup($db);
|
||||||
|
|
||||||
|
|||||||
@ -411,6 +411,7 @@ class modMyModule extends DolibarrModules
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
//$result = $this->_load_tables('/install/mysql/tables/', 'mymodule');
|
||||||
$result = $this->_load_tables('/mymodule/sql/');
|
$result = $this->_load_tables('/mymodule/sql/');
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||||
|
|||||||
@ -1031,7 +1031,7 @@ class Website extends CommonObject
|
|||||||
fputs($fp, $line);
|
fputs($fp, $line);
|
||||||
|
|
||||||
// Warning: We must keep llx_ here. It is a generic SQL.
|
// Warning: We must keep llx_ here. It is a generic SQL.
|
||||||
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias)';
|
$line = 'INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames)';
|
||||||
|
|
||||||
$line .= " VALUES(";
|
$line .= " VALUES(";
|
||||||
$line .= $objectpageold->newid."__+MAX_llx_website_page__, ";
|
$line .= $objectpageold->newid."__+MAX_llx_website_page__, ";
|
||||||
@ -1076,9 +1076,11 @@ class Website extends CommonObject
|
|||||||
$stringtoexport = str_replace('="image/'.$website->ref.'/', '="image/__WEBSITE_KEY__/', $stringtoexport);
|
$stringtoexport = str_replace('="image/'.$website->ref.'/', '="image/__WEBSITE_KEY__/', $stringtoexport);
|
||||||
|
|
||||||
$line .= "'".$this->db->escape($stringtoexport)."', "; // Replace \r \n to have record on 1 line
|
$line .= "'".$this->db->escape($stringtoexport)."', "; // Replace \r \n to have record on 1 line
|
||||||
$line .= "'".$this->db->escape($objectpageold->author_alias)."'";
|
$line .= "'".$this->db->escape($objectpageold->author_alias)."', ";
|
||||||
|
$line .= "'".$this->db->escape($objectpageold->allowed_in_frames)."'";
|
||||||
$line .= ");";
|
$line .= ");";
|
||||||
$line .= "\n";
|
$line .= "\n";
|
||||||
|
|
||||||
fputs($fp, $line);
|
fputs($fp, $line);
|
||||||
|
|
||||||
// Add line to update home page id during import
|
// Add line to update home page id during import
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user