25include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
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 = (isModEnabled(
'blockedlog')
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'=>
'isModEnabled("blockedlog")',
137 'perms'=>
'$user->hasRight("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';
184 $action =
'MODULE_SET';
185 $result = $b->setObjectData(
$object, $action, 0);
188 $this->error = $b->error;
189 $this->errors = $b->errors;
193 $res = $b->create($user);
195 $this->error = $b->error;
196 $this->errors = $b->errors;
200 return $this->
_init($sql, $options);
211 public function remove($options =
'')
218 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
228 $result = $b->setObjectData(
$object,
'MODULE_RESET', 0);
230 $this->error = $b->error;
231 $this->errors = $b->errors;
235 if ($b->alreadyUsed(1)) {
236 $res = $b->create($user,
'0000000000');
238 $res = $b->create($user);
241 $this->error = $b->error;
242 $this->errors = $b->errors;
246 return $this->
_remove($sql, $options);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_now($mode='auto')
Return date for now.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$conf db name
Only used if Module[ID]Name translation string is not found.