wip
This commit is contained in:
parent
06db81f3c3
commit
675a17a74c
@ -382,7 +382,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
*
|
*
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
private function _init($array_sql, $options = '')
|
protected function _init($array_sql, $options = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$err=0;
|
$err=0;
|
||||||
@ -484,7 +484,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
*
|
*
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
private function _remove($array_sql, $options = '')
|
protected function _remove($array_sql, $options = '')
|
||||||
{
|
{
|
||||||
$err=0;
|
$err=0;
|
||||||
|
|
||||||
@ -658,11 +658,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
@include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php';
|
@include_once DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php';
|
||||||
|
|
||||||
$content = dolMd2Html(
|
$content = dolMd2Html(
|
||||||
$content, 'parsedown',
|
$content,
|
||||||
|
'parsedown',
|
||||||
array(
|
array(
|
||||||
'doc/'=>dol_buildpath(strtolower($this->name).'/doc/', 1),
|
'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1),
|
||||||
'img/'=>dol_buildpath(strtolower($this->name).'/img/', 1),
|
'img/' => dol_buildpath(strtolower($this->name).'/img/', 1),
|
||||||
'images/'=>dol_buildpath(strtolower($this->name).'/imgages/', 1),
|
'images/' => dol_buildpath(strtolower($this->name).'/imgages/', 1),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -671,8 +672,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
$content = nl2br($content);
|
$content = nl2br($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Mostly for internal modules
|
else
|
||||||
{
|
{
|
||||||
|
// Mostly for internal modules
|
||||||
if (! empty($this->descriptionlong)) {
|
if (! empty($this->descriptionlong)) {
|
||||||
if (is_array($this->langfiles)) {
|
if (is_array($this->langfiles)) {
|
||||||
foreach($this->langfiles as $val)
|
foreach($this->langfiles as $val)
|
||||||
@ -805,14 +807,20 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
$ret='';
|
$ret='';
|
||||||
|
|
||||||
$newversion=preg_replace('/_deprecated/', '', $this->version);
|
$newversion=preg_replace('/_deprecated/', '', $this->version);
|
||||||
if ($newversion == 'experimental') { $ret=($translated?$langs->transnoentitiesnoconv("VersionExperimental"):$newversion);
|
if ($newversion == 'experimental') {
|
||||||
} elseif ($newversion == 'development') { $ret=($translated?$langs->transnoentitiesnoconv("VersionDevelopment"):$newversion);
|
$ret=($translated?$langs->transnoentitiesnoconv("VersionExperimental"):$newversion);
|
||||||
} elseif ($newversion == 'dolibarr') { $ret=DOL_VERSION;
|
} elseif ($newversion == 'development') {
|
||||||
} elseif ($newversion) { $ret=$newversion;
|
$ret=($translated?$langs->transnoentitiesnoconv("VersionDevelopment"):$newversion);
|
||||||
} else { $ret=($translated?$langs->transnoentitiesnoconv("VersionUnknown"):'unknown');
|
} elseif ($newversion == 'dolibarr') {
|
||||||
|
$ret=DOL_VERSION;
|
||||||
|
} elseif ($newversion) {
|
||||||
|
$ret=$newversion;
|
||||||
|
} else {
|
||||||
|
$ret=($translated?$langs->transnoentitiesnoconv("VersionUnknown"):'unknown');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/_deprecated/', $this->version)) { $ret.=($translated?' ('.$langs->transnoentitiesnoconv("Deprecated").')':$this->version);
|
if (preg_match('/_deprecated/', $this->version)) {
|
||||||
|
$ret.=($translated?' ('.$langs->transnoentitiesnoconv("Deprecated").')':$this->version);
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -825,13 +833,17 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
*/
|
*/
|
||||||
public function isCoreOrExternalModule()
|
public function isCoreOrExternalModule()
|
||||||
{
|
{
|
||||||
if ($this->version == 'dolibarr' || $this->version == 'dolibarr_deprecated') { return 'core';
|
if ($this->version == 'dolibarr' || $this->version == 'dolibarr_deprecated') {
|
||||||
|
return 'core';
|
||||||
}
|
}
|
||||||
if (! empty($this->version) && ! in_array($this->version, array('experimental','development'))) { return 'external';
|
if (! empty($this->version) && ! in_array($this->version, array('experimental','development'))) {
|
||||||
|
return 'external';
|
||||||
}
|
}
|
||||||
if (! empty($this->editor_name) || ! empty($this->editor_url)) { return 'external';
|
if (! empty($this->editor_name) || ! empty($this->editor_url)) {
|
||||||
|
return 'external';
|
||||||
}
|
}
|
||||||
if ($this->numero >= 100000) { return 'external';
|
if ($this->numero >= 100000) {
|
||||||
|
return 'external';
|
||||||
}
|
}
|
||||||
return 'unknown';
|
return 'unknown';
|
||||||
}
|
}
|
||||||
@ -911,11 +923,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) { $err++;
|
if (! $resql) {
|
||||||
} else
|
$err++;
|
||||||
{
|
} else {
|
||||||
$obj=$this->db->fetch_object($resql);
|
$obj=$this->db->fetch_object($resql);
|
||||||
if ($obj) { return $this->db->jdate($obj->tms);
|
if ($obj) {
|
||||||
|
return $this->db->jdate($obj->tms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,15 +951,16 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getLastActiveDate", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) { $err++;
|
if (! $resql) {
|
||||||
} else
|
$err++;
|
||||||
{
|
} else {
|
||||||
$obj=$this->db->fetch_object($resql);
|
$obj=$this->db->fetch_object($resql);
|
||||||
$tmp=array();
|
$tmp=array();
|
||||||
if ($obj->note) {
|
if ($obj->note) {
|
||||||
$tmp=json_decode($obj->note, true);
|
$tmp=json_decode($obj->note, true);
|
||||||
}
|
}
|
||||||
if ($obj) { return array('authorid'=>$tmp['authorid'], 'ip'=>$tmp['ip'], 'lastactivationdate'=>$this->db->jdate($obj->tms));
|
if ($obj) {
|
||||||
|
return array('authorid'=>$tmp['authorid'], 'ip'=>$tmp['ip'], 'lastactivationdate'=>$this->db->jdate($obj->tms));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -974,7 +988,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::_active delete activation constant", LOG_DEBUG);
|
dol_syslog(get_class($this)."::_active delete activation constant", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) { $err++;
|
if (! $resql) {
|
||||||
|
$err++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$note=json_encode(array('authorid'=>(is_object($user)?$user->id:0), 'ip'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])));
|
$note=json_encode(array('authorid'=>(is_object($user)?$user->id:0), 'ip'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])));
|
||||||
@ -1029,7 +1044,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
* @param string $reldir Relative directory where to scan files
|
* @param string $reldir Relative directory where to scan files
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
private function _load_tables($reldir)
|
protected function _load_tables($reldir)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class modNotification extends DolibarrModules
|
|||||||
* @param string $options Options when enabling module ('', 'noboxes')
|
* @param string $options Options when enabling module ('', 'noboxes')
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
// Permissions
|
// Permissions
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|||||||
@ -124,13 +124,14 @@ class modPrelevement extends DolibarrModules
|
|||||||
$this->rights[$r][4] = 'bons';
|
$this->rights[$r][4] = 'bons';
|
||||||
$this->rights[$r][5] = 'credit';
|
$this->rights[$r][5] = 'credit';
|
||||||
|
|
||||||
/* $this->rights[2][0] = 154;
|
/*
|
||||||
|
$this->rights[2][0] = 154;
|
||||||
$this->rights[2][1] = 'Setup withdraw account';
|
$this->rights[2][1] = 'Setup withdraw account';
|
||||||
$this->rights[2][2] = 'w';
|
$this->rights[2][2] = 'w';
|
||||||
$this->rights[2][3] = 0;
|
$this->rights[2][3] = 0;
|
||||||
$this->rights[2][4] = 'bons';
|
$this->rights[2][4] = 'bons';
|
||||||
$this->rights[2][5] = 'configurer';
|
$this->rights[2][5] = 'configurer';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Menus
|
// Menus
|
||||||
//-------
|
//-------
|
||||||
|
|||||||
@ -521,7 +521,7 @@ class modProduct extends DolibarrModules
|
|||||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.recuperableonly'=>'VATNPR'));
|
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.recuperableonly'=>'VATNPR'));
|
||||||
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
||||||
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
||||||
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array(
|
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array(
|
||||||
'sp.price'=>"PriceQtyMinHT*",
|
'sp.price'=>"PriceQtyMinHT*",
|
||||||
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
|
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
|
||||||
'sp.remise_percent'=>'DiscountQtyMin'
|
'sp.remise_percent'=>'DiscountQtyMin'
|
||||||
@ -633,7 +633,7 @@ $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r], array
|
|||||||
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes')
|
* @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes')
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user