25include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
39 global $langs, $conf, $mysoc;
44 $this->rights_class =
'blockedlog';
48 $this->family =
"base";
50 $this->module_position =
'76';
52 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
53 $this->
description =
"Enable a log on some business events into a non reversible log. This module may be mandatory for some countries.";
55 $this->version =
'dolibarr';
57 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
59 $this->picto =
'technic';
62 $this->dirs = array();
66 $this->config_page_url = array(
'blockedlog.php?withtab=1@blockedlog');
70 $this->hidden =
false;
71 $this->depends = array(
'always'=>
'modFacture');
72 $this->requiredby = array();
73 $this->conflictwith = array();
74 $this->langfiles = array(
'blockedlog');
76 $this->warnings_activation = array();
77 $this->warnings_activation_ext = array();
78 $this->warnings_unactivation = array(
'FR'=>
'BlockedLogAreRequiredByYourCountryLegislation');
93 $this->always_enabled = (!empty($conf->blockedlog->enabled)
95 && in_array((empty($mysoc->country_code) ?
'' : $mysoc->country_code), explode(
',',
getDolGlobalString(
'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY')))
100 $this->
const = array(
101 1=>array(
'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY',
'chaine',
'FR',
'This is list of country code where the module may be mandatory', 0,
'current', 0)
106 $this->tabs = array();
110 $this->boxes = array();
114 $this->rights = array();
117 $this->rights[$r][0] = $this->numero + $r;
118 $this->rights[$r][1] =
'Read archived events and fingerprints';
119 $this->rights[$r][3] = 0;
120 $this->rights[$r][4] =
'read';
121 $this->rights[$r][5] =
'';
126 $this->menu[$r] = array(
127 'fk_menu'=>
'fk_mainmenu=tools',
129 'leftmenu'=>
'blockedlogbrowser',
131 'titre'=>
'BrowseBlockedLog',
132 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
133 'url'=>
'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser',
134 'langs'=>
'blockedlog',
136 'enabled'=>
'$conf->blockedlog->enabled',
137 'perms'=>
'$user->rights->blockedlog->read',
152 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
154 return $b->alreadyUsed(1);
166 public function init($options =
'')
173 require_once DOL_DOCUMENT_ROOT .
'/blockedlog/class/blockedlog.class.php';
177 $object->element =
'module';
178 $object->ref =
'systemevent';
179 $object->entity = $conf->entity;
183 $result = $b->setObjectData($object,
'MODULE_SET', 0);
185 $this->error = $b->error;
186 $this->errors = $b->errors;
190 $res = $b->create($user);
192 $this->error = $b->error;
193 $this->errors = $b->errors;
197 return $this->
_init($sql, $options);
208 public function remove($options =
'')
215 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
219 $object->element =
'module';
220 $object->ref =
'systemevent';
221 $object->entity = $conf->entity;
225 $result = $b->setObjectData($object,
'MODULE_RESET', 0);
227 $this->error = $b->error;
228 $this->errors = $b->errors;
232 if ($b->alreadyUsed(1)) {
233 $res = $b->create($user,
'0000000000');
235 $res = $b->create($user);
238 $this->error = $b->error;
239 $this->errors = $b->errors;
243 return $this->
_remove($sql, $options);
Class to manage Blocked Log.
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
Class to describe a BlockedLog module.
init($options='')
Function called when module is enabled.
alreadyUsed()
Check if module was already used before unactivation linked to warnings_unactivation property.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
$conf db name
Only used if Module[ID]Name translation string is not found.