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)
94 && !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)
95 && in_array((empty($mysoc->country_code) ?
'' : $mysoc->country_code), explode(
',', $conf->global->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',
166 public function init($options =
'')
173 require_once DOL_DOCUMENT_ROOT .
'/blockedlog/class/blockedlog.class.php';
175 $object =
new stdClass();
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 =
'')
216 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
218 $object =
new stdClass();
220 $object->element =
'module';
221 $object->ref =
'systemevent';
222 $object->entity = $conf->entity;
226 $result = $b->setObjectData($object,
'MODULE_RESET', 0);
228 $this->error = $b->error;
229 $this->errors = $b->errors;
233 if ($b->alreadyUsed(1)) {
234 $res = $b->create($user,
'0000000000');
236 $res = $b->create($user);
239 $this->error = $b->error;
240 $this->errors = $b->errors;
244 return $this->
_remove($sql, $options);