88 public $module_position =
'50';
105 public $dirs = array();
110 public $boxes = array();
115 public $const = array();
120 public $cronjobs = array();
130 public $rights_class;
135 public $menu = array();
164 public $module_parts = array();
176 public $dbversion =
"-";
208 public $descriptionlong;
221 public $export_label;
223 public $export_permission;
224 public $export_fields_array;
225 public $export_TypeFields_array;
226 public $export_entities_array;
227 public $export_special_array;
228 public $export_dependencies_array;
229 public $export_sql_start;
230 public $export_sql_end;
231 public $export_sql_order;
244 public $import_label;
255 public $always_enabled;
260 public $core_enabled;
276 public $config_page_url;
295 public $conflictwith;
307 public $warnings_activation;
314 public $warnings_activation_ext;
327 public $need_dolibarr_version;
332 public $hidden =
false;
366 protected function _init($array_sql, $options =
'')
390 if (!$err && !preg_match(
'/newboxdefonly/', $options)) {
395 if (!$err && !preg_match(
'/noboxes/', $options)) {
420 $num = count($array_sql);
421 for ($i = 0; $i < $num; $i++)
424 $val = $array_sql[$i];
427 if (is_array($val)) {
429 $ignoreerror = $val[
'ignoreerror'];
432 $sql = str_replace(
'__ENTITY__', $conf->entity, $sql);
434 dol_syslog(get_class($this).
"::_init ignoreerror=".$ignoreerror.
"", LOG_DEBUG);
435 $result = $this->
db->query($sql, $ignoreerror);
438 $this->error = $this->
db->lasterror();
441 dol_syslog(get_class($this).
"::_init Warning ".$this->
db->lasterror(), LOG_WARNING);
452 $this->
db->rollback();
466 protected function _remove($array_sql, $options =
'')
494 if (!$err && !preg_match(
'/(newboxdefonly|noboxes)/', $options)) {
519 $num = count($array_sql);
520 for ($i = 0; $i < $num; $i++)
523 dol_syslog(get_class($this).
"::_remove", LOG_DEBUG);
524 $result = $this->
db->query($array_sql[$i]);
526 $this->error = $this->
db->error();
537 $this->
db->rollback();
552 $langs->load(
"admin");
554 if ($langs->transnoentitiesnoconv(
"Module".$this->numero.
"Name") != (
"Module".$this->numero.
"Name")) {
556 return $langs->transnoentitiesnoconv(
"Module".$this->numero.
"Name");
559 if (is_array($this->langfiles)) {
560 foreach ($this->langfiles as $val)
562 if ($val) { $langs->load($val);
567 if ($langs->trans(
"Module".$this->name.
"Name") != (
"Module".$this->name.
"Name")) {
569 return $langs->transnoentitiesnoconv(
"Module".$this->
name.
"Name");
573 return $langs->transnoentitiesnoconv($this->
name);
586 $langs->load(
"admin");
588 if ($langs->transnoentitiesnoconv(
"Module".$this->numero.
"Desc") != (
"Module".$this->numero.
"Desc")) {
590 return $langs->transnoentitiesnoconv(
"Module".$this->numero.
"Desc");
593 if (is_array($this->langfiles)) {
594 foreach ($this->langfiles as $val)
596 if ($val) { $langs->load($val);
601 if ($langs->transnoentitiesnoconv(
"Module".$this->name.
"Desc") != (
"Module".$this->name.
"Desc")) {
603 return $langs->trans(
"Module".$this->
name.
"Desc");
620 $langs->load(
"admin");
622 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
623 include_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
629 $content = file_get_contents($pathoffile);
631 if ((
float) DOL_VERSION >= 6.0) {
632 @include_once DOL_DOCUMENT_ROOT.
'/core/lib/parsemd.lib.php';
644 $content = nl2br($content);
648 if (!empty($this->descriptionlong)) {
649 if (is_array($this->langfiles)) {
650 foreach ($this->langfiles as $val)
652 if ($val) { $langs->load($val);
657 $content = $langs->transnoentitiesnoconv($this->descriptionlong);
677 $pathoffile =
dol_buildpath(strtolower($this->
name).
'/README-'.$langs->defaultlang.
'.md', 0);
682 $tmp = explode(
'_', $langs->defaultlang);
683 $pathoffile =
dol_buildpath(strtolower($this->
name).
'/README-'.$tmp[0].
'.md', 0);
695 return ($filefound ? $pathoffile :
'');
707 $langs->load(
"admin");
709 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
710 include_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
716 $pathoffile =
dol_buildpath(strtolower($this->
name).
'/ChangeLog-'.$langs->defaultlang.
'.md', 0);
729 $content = file_get_contents($pathoffile);
731 if ((
float) DOL_VERSION >= 6.0) {
732 @include_once DOL_DOCUMENT_ROOT.
'/core/lib/parsemd.lib.php';
735 $content = nl2br($content);
749 return $this->editor_name;
759 return $this->editor_url;
773 $langs->load(
"admin");
777 $newversion = preg_replace(
'/_deprecated/',
'', $this->version);
778 if ($newversion ==
'experimental') {
779 $ret = ($translated ? $langs->transnoentitiesnoconv(
"VersionExperimental") : $newversion);
780 } elseif ($newversion ==
'development') {
781 $ret = ($translated ? $langs->transnoentitiesnoconv(
"VersionDevelopment") : $newversion);
782 } elseif ($newversion ==
'dolibarr') {
784 } elseif ($newversion) {
787 $ret = ($translated ? $langs->transnoentitiesnoconv(
"VersionUnknown") :
'unknown');
790 if (preg_match(
'/_deprecated/', $this->version)) {
791 $ret .= ($translated ?
' ('.$langs->transnoentitiesnoconv(
"Deprecated").
')' : $this->version);
804 if ($this->version ==
'dolibarr' || $this->version ==
'dolibarr_deprecated') {
807 if (!empty($this->version) && !in_array($this->version, array(
'experimental',
'development'))) {
810 if (!empty($this->editor_name) || !empty($this->editor_url)) {
813 if ($this->numero >= 100000) {
827 return $this->langfiles;
841 $langstring =
"ExportDataset_".$this->export_code[$r];
842 if ($langs->trans($langstring) == $langstring) {
844 return $langs->trans($this->export_label[$r]);
847 return $langs->trans($langstring);
863 $langstring =
"ImportDataset_".$this->import_code[$r];
865 if ($langs->trans($langstring) == $langstring) {
867 return $langs->transnoentitiesnoconv($this->import_label[$r]);
870 return $langs->transnoentitiesnoconv($langstring);
886 $sql =
"SELECT tms FROM ".MAIN_DB_PREFIX.
"const";
887 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($this->const_name).
"'";
888 $sql .=
" AND entity IN (0, ".$conf->entity.
")";
890 dol_syslog(get_class($this).
"::getLastActiveDate", LOG_DEBUG);
896 $obj = $this->
db->fetch_object(
$resql);
898 return $this->
db->jdate($obj->tms);
917 $sql =
"SELECT tms, note FROM ".MAIN_DB_PREFIX.
"const";
918 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($this->const_name).
"'";
919 $sql .=
" AND entity IN (0, ".$conf->entity.
")";
921 dol_syslog(get_class($this).
"::getLastActiveDate", LOG_DEBUG);
927 $obj = $this->
db->fetch_object(
$resql);
930 $tmp = json_decode($obj->note,
true);
933 return array(
'authorid'=>$tmp[
'authorid'],
'ip'=>$tmp[
'ip'],
'lastactivationdate'=>$this->
db->jdate($obj->tms));
955 $entity = ((!empty($this->always_enabled) || !empty($this->core_enabled)) ? 0 : $conf->entity);
957 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
958 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($this->const_name).
"'";
959 $sql .=
" AND entity IN (0, ".$entity.
")";
961 dol_syslog(get_class($this).
"::_active delete activation constant", LOG_DEBUG);
967 $note = json_encode(array(
'authorid'=>(is_object($user) ? $user->id : 0),
'ip'=>(empty(
$_SERVER[
'REMOTE_ADDR']) ?
'' :
$_SERVER[
'REMOTE_ADDR'])));
969 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"const (name, value, visible, entity, note) VALUES";
970 $sql .=
" (".$this->db->encrypt($this->const_name, 1);
971 $sql .=
", ".$this->db->encrypt(
'1', 1);
972 $sql .=
", 0, ".$entity;
973 $sql .=
", '".$this->db->escape($note).
"')";
975 dol_syslog(get_class($this).
"::_active insert activation constant", LOG_DEBUG);
998 $entity = ((!empty($this->always_enabled) || !empty($this->core_enabled)) ? 0 : $conf->entity);
1000 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
1001 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($this->const_name).
"'";
1002 $sql .=
" AND entity IN (0, ".$entity.
")";
1004 dol_syslog(get_class($this).
"::_unactive", LOG_DEBUG);
1005 $this->
db->query($sql);
1029 if (empty($reldir)) {
1033 include_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
1036 foreach ($conf->file->dol_document_root as $dirroot)
1039 $dir = $dirroot.$reldir;
1042 $handle = @opendir($dir);
1043 if (is_resource($handle)) {
1048 while (($file = readdir($handle)) !==
false)
1053 foreach ($files as $file)
1055 if (preg_match(
'/\.sql$/i', $file) && !preg_match(
'/\.key\.sql$/i', $file) && substr($file, 0, 4) ==
'llx_' && substr($file, 0, 4) !=
'data') {
1056 $result =
run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0,
'', 1);
1057 if ($result <= 0) { $error++;
1066 while (($file = readdir($handle)) !==
false)
1071 foreach ($files as $file)
1073 if (preg_match(
'/\.key\.sql$/i', $file) && substr($file, 0, 4) ==
'llx_' && substr($file, 0, 4) !=
'data') {
1074 $result =
run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0,
'', 1);
1075 if ($result <= 0) { $error++;
1084 while (($file = readdir($handle)) !==
false)
1089 foreach ($files as $file)
1091 if (preg_match(
'/\.sql$/i', $file) && !preg_match(
'/\.key\.sql$/i', $file) && substr($file, 0, 4) ==
'data') {
1092 $result =
run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0,
'', 1);
1093 if ($result <= 0) { $error++;
1102 while (($file = readdir($handle)) !==
false)
1107 foreach ($files as $file)
1109 if (preg_match(
'/\.sql$/i', $file) && !preg_match(
'/\.key\.sql$/i', $file) && substr($file, 0, 6) ==
'update') {
1110 $result =
run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG) ? 1 : 0,
'', 1);
1111 if ($result <= 0) { $error++;
1126 dol_syslog(
"A module ask to load sql files into ".$reldir.
" but this directory was not found.", LOG_WARNING);
1143 include_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
1149 if (is_array($this->boxes)) {
1150 dol_syslog(get_class($this).
"::insert_boxes", LOG_DEBUG);
1154 foreach ($this->boxes as $key => $value)
1156 $file = isset($this->boxes[$key][
'file']) ? $this->boxes[$key][
'file'] :
'';
1157 $note = isset($this->boxes[$key][
'note']) ? $this->boxes[$key][
'note'] :
'';
1158 $enabledbydefaulton = isset($this->boxes[$key][
'enabledbydefaulton']) ? $this->boxes[$key][
'enabledbydefaulton'] :
'Home';
1160 if (empty($file)) { $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] :
'';
1162 if (empty($note)) { $note = isset($this->boxes[$key][2]) ? $this->boxes[$key][2] :
'';
1166 $sql =
"SELECT count(*) as nb FROM ".MAIN_DB_PREFIX.
"boxes_def";
1167 $sql .=
" WHERE file = '".$this->db->escape($file).
"'";
1168 $sql .=
" AND entity = ".$conf->entity;
1169 if ($note) { $sql .=
" AND note ='".$this->db->escape($note).
"'";
1172 $result = $this->
db->query($sql);
1174 $obj = $this->
db->fetch_object($result);
1175 if ($obj->nb == 0) {
1179 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"boxes_def (file, entity, note)";
1180 $sql .=
" VALUES ('".$this->db->escape($file).
"', ";
1181 $sql .= $conf->entity.
", ";
1182 $sql .= $note ?
"'".$this->db->escape($note).
"'" :
"null";
1185 dol_syslog(get_class($this).
"::insert_boxes", LOG_DEBUG);
1190 if (!$err && !preg_match(
'/newboxdefonly/', $option)) {
1191 $lastid = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"boxes_def",
"rowid");
1193 foreach ($pos_name as $key2 => $val2)
1196 if ($enabledbydefaulton && $val2 != $enabledbydefaulton) {
continue;
1199 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"boxes (box_id,position,box_order,fk_user,entity)";
1200 $sql .=
" VALUES (".$lastid.
", ".$key2.
", '0', 0, ".$conf->entity.
")";
1202 dol_syslog(get_class($this).
"::insert_boxes onto page ".$key2.
"=".$val2.
"", LOG_DEBUG);
1210 $this->
db->commit();
1212 $this->error = $this->
db->lasterror();
1213 $this->
db->rollback();
1218 $this->error = $this->
db->lasterror();
1241 if (is_array($this->boxes)) {
1242 foreach ($this->boxes as $key => $value)
1245 $file = $this->boxes[$key][
'file'];
1251 if ($file ==
'box_graph_product_distribution.php') {
1252 if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
1253 dol_syslog(
"We discard deleting module ".$file.
" because another module still active requires it.");
1259 $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] :
'';
1262 if ($this->
db->type ==
'sqlite3') {
1265 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"boxes ";
1266 $sql .=
"WHERE ".MAIN_DB_PREFIX.
"boxes.box_id IN (";
1267 $sql .=
"SELECT ".MAIN_DB_PREFIX.
"boxes_def.rowid ";
1268 $sql .=
"FROM ".MAIN_DB_PREFIX.
"boxes_def ";
1269 $sql .=
"WHERE ".MAIN_DB_PREFIX.
"boxes_def.file = '".$this->
db->escape($file).
"') ";
1270 $sql .=
"AND ".MAIN_DB_PREFIX.
"boxes.entity = ".$conf->entity;
1272 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"boxes";
1273 $sql .=
" USING ".MAIN_DB_PREFIX.
"boxes, ".MAIN_DB_PREFIX.
"boxes_def";
1274 $sql .=
" WHERE ".MAIN_DB_PREFIX.
"boxes.box_id = ".MAIN_DB_PREFIX.
"boxes_def.rowid";
1275 $sql .=
" AND ".MAIN_DB_PREFIX.
"boxes_def.file = '".$this->
db->escape($file).
"'";
1276 $sql .=
" AND ".MAIN_DB_PREFIX.
"boxes.entity = ".$conf->entity;
1279 dol_syslog(get_class($this).
"::delete_boxes", LOG_DEBUG);
1282 $this->error = $this->
db->lasterror();
1286 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"boxes_def";
1287 $sql .=
" WHERE file = '".$this->db->escape($file).
"'";
1288 $sql .=
" AND entity = ".$conf->entity;
1290 dol_syslog(get_class($this).
"::delete_boxes", LOG_DEBUG);
1293 $this->error = $this->
db->lasterror();
1311 include_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
1317 if (is_array($this->cronjobs)) {
1318 dol_syslog(get_class($this).
"::insert_cronjobs", LOG_DEBUG);
1320 foreach ($this->cronjobs as $key => $value)
1322 $entity = isset($this->cronjobs[$key][
'entity']) ? $this->cronjobs[$key][
'entity'] : $conf->entity;
1323 $label = isset($this->cronjobs[$key][
'label']) ? $this->cronjobs[$key][
'label'] :
'';
1324 $jobtype = isset($this->cronjobs[$key][
'jobtype']) ? $this->cronjobs[$key][
'jobtype'] :
'';
1325 $class = isset($this->cronjobs[$key][
'class']) ? $this->cronjobs[$key][
'class'] :
'';
1326 $objectname = isset($this->cronjobs[$key][
'objectname']) ? $this->cronjobs[$key][
'objectname'] :
'';
1327 $method = isset($this->cronjobs[$key][
'method']) ? $this->cronjobs[$key][
'method'] :
'';
1328 $command = isset($this->cronjobs[$key][
'command']) ? $this->cronjobs[$key][
'command'] :
'';
1329 $parameters = isset($this->cronjobs[$key][
'parameters']) ? $this->cronjobs[$key][
'parameters'] :
'';
1330 $comment = isset($this->cronjobs[$key][
'comment']) ? $this->cronjobs[$key][
'comment'] :
'';
1331 $frequency = isset($this->cronjobs[$key][
'frequency']) ? $this->cronjobs[$key][
'frequency'] :
'';
1332 $unitfrequency = isset($this->cronjobs[$key][
'unitfrequency']) ? $this->cronjobs[$key][
'unitfrequency'] :
'';
1333 $priority = isset($this->cronjobs[$key][
'priority']) ? $this->cronjobs[$key][
'priority'] :
'';
1334 $datestart = isset($this->cronjobs[$key][
'datestart']) ? $this->cronjobs[$key][
'datestart'] :
'';
1335 $dateend = isset($this->cronjobs[$key][
'dateend']) ? $this->cronjobs[$key][
'dateend'] :
'';
1336 $status = isset($this->cronjobs[$key][
'status']) ? $this->cronjobs[$key][
'status'] :
'';
1337 $test = isset($this->cronjobs[$key][
'test']) ? $this->cronjobs[$key][
'test'] :
'';
1340 $sql =
"SELECT count(*) as nb FROM ".MAIN_DB_PREFIX.
"cronjob";
1341 $sql .=
" WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class).
"'";
1343 $sql .=
" AND classesname = '".$this->db->escape($class).
"'";
1346 $sql .=
" AND objectname = '".$this->db->escape($objectname).
"'";
1349 $sql .=
" AND methodename = '".$this->db->escape($method).
"'";
1352 $sql .=
" AND command = '".$this->db->escape($command).
"'";
1354 $sql .=
" AND entity = ".$entity;
1358 $result = $this->
db->query($sql);
1360 $obj = $this->
db->fetch_object($result);
1361 if ($obj->nb == 0) {
1365 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,";
1366 if (is_int($frequency)) { $sql .=
' frequency,'; }
1367 if (is_int($unitfrequency)) { $sql .=
' unitfrequency,'; }
1368 if (is_int($priority)) { $sql .=
' priority,'; }
1369 if (is_int($status)) { $sql .=
' status,'; }
1370 $sql .=
" entity, test)";
1371 $sql .=
" VALUES (";
1372 $sql .=
"'".$this->db->escape(empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class).
"', ";
1373 $sql .=
"'".$this->db->idate($now).
"', ";
1374 $sql .= ($datestart ?
"'".$this->db->idate($datestart).
"'" :
"'".$this->db->idate($now).
"'").
", ";
1375 $sql .= ($dateend ?
"'".$this->db->idate($dateend).
"'" :
"NULL").
", ";
1376 $sql .=
"'".$this->db->escape($label).
"', ";
1377 $sql .=
"'".$this->db->escape($jobtype).
"', ";
1378 $sql .= ($class ?
"'".$this->db->escape($class).
"'" :
"null").
",";
1379 $sql .= ($objectname ?
"'".$this->db->escape($objectname).
"'" :
"null").
",";
1380 $sql .= ($method ?
"'".$this->db->escape($method).
"'" :
"null").
",";
1381 $sql .= ($command ?
"'".$this->db->escape($command).
"'" :
"null").
",";
1382 $sql .= ($parameters ?
"'".$this->db->escape($parameters).
"'" :
"null").
",";
1383 $sql .= ($comment ?
"'".$this->db->escape($comment).
"'" :
"null").
",";
1384 if (is_int($frequency)) { $sql .=
"'".$this->db->escape($frequency).
"', ";
1386 if (is_int($unitfrequency)) { $sql .=
"'".$this->db->escape($unitfrequency).
"', ";
1388 if (is_int($priority)) {$sql .=
"'".$this->db->escape($priority).
"', ";
1390 if (is_int($status)) { $sql .=
"'".$this->db->escape($status).
"', ";
1392 $sql .= $entity.
",";
1393 $sql .=
"'".$this->db->escape($test).
"'";
1402 $this->
db->commit();
1404 $this->error = $this->
db->lasterror();
1405 $this->
db->rollback();
1410 $this->error = $this->
db->lasterror();
1433 if (is_array($this->cronjobs)) {
1434 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"cronjob";
1435 $sql .=
" WHERE module_name = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class).
"'";
1436 $sql .=
" AND entity = ".$conf->entity;
1437 $sql .=
" AND test = '1'";
1440 dol_syslog(get_class($this).
"::delete_cronjobs", LOG_DEBUG);
1443 $this->error = $this->
db->lasterror();
1464 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
1465 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" like '".$this->
db->escape($this->const_name).
"_TABS_%'";
1466 $sql .=
" AND entity = ".$conf->entity;
1468 dol_syslog(get_class($this).
"::delete_tabs", LOG_DEBUG);
1469 if (!$this->
db->query($sql)) {
1470 $this->error = $this->
db->lasterror();
1490 if (!empty($this->tabs)) {
1491 dol_syslog(get_class($this).
"::insert_tabs", LOG_DEBUG);
1494 foreach ($this->tabs as $key => $value)
1496 if (is_array($value) && count($value) == 0) {
continue;
1499 $entity = $conf->entity;
1502 if (is_array($value)) {
1503 $newvalue = $value[
'data'];
1504 if (isset($value[
'entity'])) { $entity = $value[
'entity'];
1509 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"const (";
1514 $sql .=
", visible";
1517 $sql .=
" VALUES (";
1518 $sql .= $this->
db->encrypt($this->const_name.
"_TABS_".$i, 1);
1519 $sql .=
", 'chaine'";
1520 $sql .=
", ".$this->db->encrypt($newvalue, 1);
1523 $sql .=
", ".$entity;
1529 if ($this->
db->lasterrno() !=
'DB_ERROR_RECORD_ALREADY_EXISTS') {
1530 $this->error = $this->
db->lasterror();
1531 $this->errors[] = $this->
db->lasterror();
1556 if (empty($this->
const)) {
return 0;
1559 dol_syslog(get_class($this).
"::insert_const", LOG_DEBUG);
1561 foreach ($this->
const as $key => $value)
1563 $name = $this->
const[$key][0];
1564 $type = $this->
const[$key][1];
1565 $val = $this->
const[$key][2];
1566 $note = isset($this->
const[$key][3]) ? $this->
const[$key][3] :
'';
1567 $visible = isset($this->
const[$key][4]) ? $this->
const[$key][4] : 0;
1568 $entity = (!empty($this->
const[$key][5]) && $this->
const[$key][5] !=
'current') ? 0 : $conf->entity;
1571 if (empty($visible)) { $visible =
'0';
1573 if (empty($val) && $val !=
'0') { $val =
'';
1576 $sql =
"SELECT count(*)";
1577 $sql .=
" FROM ".MAIN_DB_PREFIX.
"const";
1578 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($name).
"'";
1579 $sql .=
" AND entity = ".$entity;
1581 $result = $this->
db->query($sql);
1583 $row = $this->
db->fetch_row($result);
1587 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"const (name,type,value,note,visible,entity)";
1588 $sql .=
" VALUES (";
1589 $sql .= $this->
db->encrypt($name, 1);
1590 $sql .=
",'".$this->db->escape($type).
"'";
1591 $sql .=
",".(($val !=
'') ? $this->
db->encrypt($val, 1) :
"''");
1592 $sql .=
",".($note ?
"'".$this->db->escape($note).
"'" :
"null");
1593 $sql .=
",'".$this->db->escape($visible).
"'";
1594 $sql .=
",".$entity;
1597 if (!$this->
db->query($sql)) {
1601 dol_syslog(get_class($this).
"::insert_const constant '".$name.
"' already exists", LOG_WARNING);
1624 if (empty($this->
const)) {
return 0;
1627 foreach ($this->
const as $key => $value)
1629 $name = $this->
const[$key][0];
1630 $deleteonunactive = (!empty($this->
const[$key][6])) ? 1 : 0;
1632 if ($deleteonunactive) {
1633 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
1634 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($name).
"'";
1635 $sql .=
" AND entity in (0, ".$conf->entity.
")";
1636 dol_syslog(get_class($this).
"::delete_const", LOG_DEBUG);
1637 if (!$this->
db->query($sql)) {
1638 $this->error = $this->
db->lasterror();
1659 global $conf, $user;
1662 $entity = (!empty($force_entity) ? $force_entity : $conf->entity);
1664 dol_syslog(get_class($this).
"::insert_permissions", LOG_DEBUG);
1667 $sql_del =
"SELECT ".$this->db->decrypt(
'value').
" as value";
1668 $sql_del .=
" FROM ".MAIN_DB_PREFIX.
"const";
1669 $sql_del .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($this->const_name).
"'";
1670 $sql_del .=
" AND entity IN (0,".$entity.
")";
1672 $resql = $this->
db->query($sql_del);
1675 $obj = $this->
db->fetch_object(
$resql);
1676 if ($obj !== null && !empty($obj->value) && !empty($this->rights)) {
1678 foreach ($this->rights as $key => $value)
1680 $r_id = $this->rights[$key][0];
1681 $r_desc = $this->rights[$key][1];
1682 $r_type = isset($this->rights[$key][2]) ? $this->rights[$key][2] :
'';
1683 $r_def = empty($this->rights[$key][3]) ? 0 : $this->rights[$key][3];
1684 $r_perms = $this->rights[$key][4];
1685 $r_subperms = isset($this->rights[$key][5]) ? $this->rights[$key][5] :
'';
1686 $r_modul = empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class;
1688 if (empty($r_type)) { $r_type =
'w'; }
1691 $sql =
"SELECT count(*) as nb FROM ".MAIN_DB_PREFIX.
"rights_def";
1692 $sql .=
" WHERE id = ".$r_id.
" AND entity = ".$entity;
1694 $resqlselect = $this->
db->query($sql);
1696 $objcount = $this->
db->fetch_object($resqlselect);
1697 if ($objcount && $objcount->nb == 0) {
1700 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"rights_def";
1701 $sql .=
" (id, entity, libelle, module, type, bydefault, perms, subperms)";
1703 $sql .=
"(".$r_id.
",".$entity.
",'".$this->
db->escape($r_desc).
"','".$this->
db->escape($r_modul).
"','".$this->
db->escape($r_type).
"',".$r_def.
",'".$this->
db->escape($r_perms).
"','".$this->
db->escape($r_subperms).
"')";
1705 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"rights_def";
1706 $sql .=
" (id, entity, libelle, module, type, bydefault, perms)";
1708 $sql .=
"(".$r_id.
",".$entity.
",'".$this->
db->escape($r_desc).
"','".$this->
db->escape($r_modul).
"','".$this->
db->escape($r_type).
"',".$r_def.
",'".$this->
db->escape($r_perms).
"')";
1711 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"rights_def ";
1712 $sql .=
" (id, entity, libelle, module, type, bydefault)";
1714 $sql .=
"(".$r_id.
",".$entity.
",'".$this->
db->escape($r_desc).
"','".$this->
db->escape($r_modul).
"','".$this->
db->escape($r_type).
"',".$r_def.
")";
1717 $resqlinsert = $this->
db->query($sql, 1);
1719 if (!$resqlinsert) {
1720 if ($this->
db->errno() !=
"DB_ERROR_RECORD_ALREADY_EXISTS") {
1721 $this->error = $this->
db->lasterror();
1724 }
else {
dol_syslog(get_class($this).
"::insert_permissions record already exists", LOG_INFO);
1728 $this->
db->free($resqlinsert);
1731 $this->
db->free($resqlselect);
1735 if ($reinitadminperms) {
1736 if (!class_exists(
'User')) {
1737 include_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
1739 $sql =
"SELECT rowid FROM ".MAIN_DB_PREFIX.
"user WHERE admin = 1";
1740 dol_syslog(get_class($this).
"::insert_permissions Search all admin users", LOG_DEBUG);
1741 $resqlseladmin = $this->
db->query($sql, 1);
1742 if ($resqlseladmin) {
1743 $num = $this->
db->num_rows($resqlseladmin);
1747 $obj2 = $this->
db->fetch_object($resqlseladmin);
1748 dol_syslog(get_class($this).
"::insert_permissions Add permission to user id=".$obj2->rowid);
1750 $tmpuser =
new User($this->
db);
1751 $result = $tmpuser->fetch($obj2->rowid);
1753 $tmpuser->addrights($r_id,
'',
'', 0, 1);
1755 dol_syslog(get_class($this).
"::insert_permissions Failed to add the permission to user because fetch return an error", LOG_ERR);
1765 if ($reinitadminperms && !empty($user->admin))
1768 $user->clearrights();
1774 $this->error = $this->
db->lasterror();
1795 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"rights_def";
1796 $sql .=
" WHERE module = '".$this->db->escape(empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class).
"'";
1797 $sql .=
" AND entity = ".$conf->entity;
1798 dol_syslog(get_class($this).
"::delete_permissions", LOG_DEBUG);
1799 if (!$this->
db->query($sql)) {
1800 $this->error = $this->
db->lasterror();
1819 if (!is_array($this->menu) || empty($this->menu)) {
return 0;
1822 include_once DOL_DOCUMENT_ROOT.
'/core/class/menubase.class.php';
1824 dol_syslog(get_class($this).
"::insert_menus", LOG_DEBUG);
1830 foreach ($this->menu as $key => $value)
1833 $menu->menu_handler =
'all';
1836 $menu->module = empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class;
1838 if (!$this->menu[$key][
'fk_menu']) {
1842 $fk_parent = $this->menu[$key][
'fk_menu'];
1843 if (preg_match(
'/^r=/', $fk_parent))
1845 $fk_parent = str_replace(
'r=',
'', $fk_parent);
1846 if (isset($this->menu[$fk_parent][
'rowid'])) {
1847 $menu->fk_menu = $this->menu[$fk_parent][
'rowid'];
1850 } elseif (preg_match(
'/^fk_mainmenu=([a-zA-Z0-9_]+),fk_leftmenu=([a-zA-Z0-9_]+)$/', $fk_parent, $reg)) {
1851 $menu->fk_menu = -1;
1852 $menu->fk_mainmenu = $reg[1];
1853 $menu->fk_leftmenu = $reg[2];
1855 } elseif (preg_match(
'/^fk_mainmenu=([a-zA-Z0-9_]+)$/', $fk_parent, $reg)) {
1856 $menu->fk_menu = -1;
1857 $menu->fk_mainmenu = $reg[1];
1858 $menu->fk_leftmenu =
'';
1861 if (!$foundparent) {
1862 $this->error =
"ErrorBadDefinitionOfMenuArrayInModuleDescriptor";
1863 dol_syslog(get_class($this).
"::insert_menus ".$this->error.
" ".$this->menu[$key][
'fk_menu'], LOG_ERR);
1867 $menu->type = $this->menu[$key][
'type'];
1868 $menu->mainmenu = isset($this->menu[$key][
'mainmenu']) ? $this->menu[$key][
'mainmenu'] : (isset($menu->fk_mainmenu) ? $menu->fk_mainmenu :
'');
1869 $menu->leftmenu = isset($this->menu[$key][
'leftmenu']) ? $this->menu[$key][
'leftmenu'] :
'';
1870 $menu->title = $this->menu[$key][
'titre'];
1871 $menu->url = $this->menu[$key][
'url'];
1872 $menu->langs = $this->menu[$key][
'langs'];
1873 $menu->position = $this->menu[$key][
'position'];
1874 $menu->perms = $this->menu[$key][
'perms'];
1875 $menu->target = isset($this->menu[$key][
'target']) ? $this->menu[$key][
'target'] :
'';
1876 $menu->user = $this->menu[$key][
'user'];
1877 $menu->enabled = isset($this->menu[$key][
'enabled']) ? $this->menu[$key][
'enabled'] : 0;
1878 $menu->position = $this->menu[$key][
'position'];
1881 $result = $menu->create($user);
1883 $this->menu[$key][
'rowid'] = $result;
1885 $this->error = $menu->error;
1886 dol_syslog(get_class($this).
'::insert_menus result='.$result.
" ".$this->error, LOG_ERR);
1894 $this->
db->commit();
1896 dol_syslog(get_class($this).
"::insert_menus ".$this->error, LOG_ERR);
1897 $this->
db->rollback();
1918 $module = empty($this->rights_class) ?strtolower($this->
name) : $this->rights_class;
1920 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"menu";
1921 $sql .=
" WHERE module = '".$this->db->escape($module).
"'";
1922 $sql .=
" AND entity = ".$conf->entity;
1924 dol_syslog(get_class($this).
"::delete_menus", LOG_DEBUG);
1927 $this->error = $this->
db->lasterror();
1943 global $langs, $conf;
1947 if (isset($this->dirs) && is_array($this->dirs)) {
1948 foreach ($this->dirs as $key => $value)
1952 if (!is_array($value)) { $dir = $value;
1954 $constname = $this->const_name.
"_DIR_";
1955 $dir = $this->dirs[$key][1];
1956 $addtodatabase = empty($this->dirs[$key][2]) ?
'' : $this->dirs[$key][2];
1957 $subname = empty($this->dirs[$key][3]) ?
'' : strtoupper($this->dirs[$key][3]);
1958 $forcename = empty($this->dirs[$key][4]) ?
'' : strtoupper($this->dirs[$key][4]);
1960 if (!empty($forcename)) { $constname =
'MAIN_MODULE_'.$forcename.
"_DIR_";
1962 if (!empty($subname)) { $constname = $constname.$subname.
"_";
1965 $name = $constname.strtoupper($this->dirs[$key][0]);
1969 if (empty($conf->global->MAIN_MODULE_MULTICOMPANY) || $conf->entity == 1) { $fulldir = DOL_DATA_ROOT.$dir;
1970 }
else { $fulldir = DOL_DATA_ROOT.
"/".$conf->entity.$dir;
1973 if (!empty($fulldir) && !file_exists($fulldir)) {
1974 if (
dol_mkdir($fulldir, DOL_DATA_ROOT) < 0) {
1975 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $fulldir);
1976 dol_syslog(get_class($this).
"::_init ".$this->error, LOG_ERR);
1982 if (!empty($addtodatabase)) {
1984 if ($result) { $err++;
2010 $sql =
"SELECT count(*)";
2011 $sql .=
" FROM ".MAIN_DB_PREFIX.
"const";
2012 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" = '".$this->
db->escape($name).
"'";
2013 $sql .=
" AND entity = ".$conf->entity;
2015 dol_syslog(get_class($this).
"::insert_dirs", LOG_DEBUG);
2016 $result = $this->
db->query($sql);
2018 $row = $this->
db->fetch_row($result);
2021 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"const (name,type,value,note,visible,entity)";
2022 $sql .=
" VALUES (".$this->db->encrypt($name, 1).
",'chaine',".$this->
db->encrypt($dir, 1).
",'Directory for module ".$this->
name.
"','0',".$conf->entity.
")";
2024 dol_syslog(get_class($this).
"::insert_dirs", LOG_DEBUG);
2025 $this->
db->query($sql);
2028 $this->error = $this->
db->lasterror();
2049 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
2050 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" LIKE '".$this->
db->escape($this->const_name).
"_DIR_%'";
2051 $sql .=
" AND entity = ".$conf->entity;
2053 dol_syslog(get_class($this).
"::delete_dirs", LOG_DEBUG);
2054 if (!$this->
db->query($sql)) {
2055 $this->error = $this->
db->lasterror();
2075 if (is_array($this->module_parts) && !empty($this->module_parts)) {
2076 foreach ($this->module_parts as $key => $value)
2078 if (is_array($value) && count($value) == 0) {
continue;
2081 $entity = $conf->entity;
2085 if (is_array($value)) {
2088 if (isset($value[
'data']) && is_array($value[
'data'])) {
2089 $newvalue = json_encode($value[
'data']);
2090 if (isset($value[
'entity'])) { $entity = $value[
'entity'];
2092 } elseif (isset($value[
'data']) && !is_array($value[
'data'])) {
2093 $newvalue = $value[
'data'];
2094 if (isset($value[
'entity'])) { $entity = $value[
'entity'];
2098 $newvalue = json_encode($value);
2102 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"const (";
2107 $sql .=
", visible";
2110 $sql .=
" VALUES (";
2111 $sql .= $this->
db->encrypt($this->const_name.
"_".strtoupper($key), 1);
2112 $sql .=
", 'chaine'";
2113 $sql .=
", ".$this->db->encrypt($newvalue, 1);
2116 $sql .=
", ".$entity;
2119 dol_syslog(get_class($this).
"::insert_module_parts for key=".$this->const_name.
"_".strtoupper($key), LOG_DEBUG);
2121 $resql = $this->
db->query($sql, 1);
2123 if ($this->
db->lasterrno() !=
'DB_ERROR_RECORD_ALREADY_EXISTS') {
2125 $this->error = $this->
db->lasterror();
2127 dol_syslog(get_class($this).
"::insert_module_parts for ".$this->const_name.
"_".strtoupper($key).
" Record already exists.", LOG_WARNING);
2147 $entity = $conf->entity;
2149 if (is_array($this->module_parts) && !empty($this->module_parts)) {
2150 foreach ($this->module_parts as $key => $value)
2153 if (is_array($value) && isset($value[
'entity'])) { $entity = $value[
'entity'];
2156 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"const";
2157 $sql .=
" WHERE ".$this->db->decrypt(
'name').
" LIKE '".$this->
db->escape($this->const_name).
"_".strtoupper($key).
"'";
2158 $sql .=
" AND entity = ".$entity;
2160 dol_syslog(get_class($this).
"::delete_const_".$key.
"", LOG_DEBUG);
2161 if (!$this->
db->query($sql)) {
2162 $this->error = $this->
db->lasterror();
2180 public function init($options =
'')
2182 return $this->
_init(array(), $options);
2193 public function remove($options =
'')
2195 return $this->
_remove(array(), $options);
2208 global $conf, $langs;
2214 $imginfo =
"info_black";
2217 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($this)));
2221 if (preg_match(
'/development/i', $version)) $versiontrans .=
'warning';
2222 if (preg_match(
'/experimental/i', $version)) $versiontrans .=
'warning';
2223 if (preg_match(
'/deprecated/i', $version)) $versiontrans .=
'warning';
2226 <div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ?
' info-box-module-disabled' :
'').($this->
isCoreOrExternalModule() ==
'external' ?
' info-box-module-external' :
'').
'">
2227 <div class="info-box info-box-sm info-box-module">
2228 <div class="info-box-icon'.(empty($conf->global->$const_name) ?
'' :
' info-box-icon-module-enabled'.($versiontrans ?
' info-box-icon-module-warning' :
'')).
'">';
2233 if (!empty($this->picto))
2235 if (preg_match(
'/^\//i', $this->picto))
print img_picto($alttext, $this->picto,
'class="inline-block valignmiddle"', 1);
2236 else print img_object($alttext, $this->picto,
'class="inline-block valignmiddle"');
2238 print img_object($alttext,
'generic',
'class="inline-block valignmiddle"');
2241 if ($this->
isCoreOrExternalModule() ==
'external' || preg_match(
'/development|experimental|deprecated/i', $version)) {
2242 print '<span class="info-box-icon-version'.($versiontrans ?
' '.$versiontrans :
'').
'" title="'.$langs->trans(
"Version").
' '.$this->
getVersion(1).
'">';
2248 <div class="info-box-content info-box-text-module'.(empty($conf->global->$const_name) ?
'' :
' info-box-module-enabled'.($versiontrans ?
' info-box-content-warning' :
'')).
'">
2249 <span class="info-box-title">'.$this->
getName().
'</span>
2252 print '<div class="valignmiddle inline-block info-box-more">';
2254 print '<a class="valignmiddle inline-block" href="javascript:document_preview(\''.DOL_URL_ROOT.
'/admin/modulehelp.php?id='.$this->numero.
'\',\
'text/html\',\''.dol_escape_js($langs->trans(
"Module")).
'\')
">'.img_picto(($this->isCoreOrExternalModule() == 'external' ? $langs->trans("ExternalModule
").' - ' : '').$langs->trans("ClickToShowDescription
"), $imginfo).'</a>';
2257 print '<div class="valignmiddle
inline-block info-box-actions
">';
2258 print '<div class="valignmiddle
inline-block info-box-setup
">';
2259 print $codetoconfig;
2261 print '<div class="valignmiddle
inline-block marginleftonly marginrightonly
">';
2262 print $codeenabledisable;
2267 </div><!-- /.info-box-content -->
2268 </div><!-- /.info-box -->
getLastActivationInfo()
Gives the last author of activation.
_unactive()
Module deactivation.
delete_dirs()
Removes directories.
insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0)
Adds access rights.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
delete_permissions()
Removes access rights.
dol_now($mode= 'auto')
Return date for now.
static getListOfPagesForBoxes()
Name of positions (See below)
Class to manage Dolibarr users.
getName()
Gives the translated module name if translation exists in admin.lang or into language files of module...
insert_boxes($option= '')
Adds boxes.
$conf db name
Only used if Module[ID]Name translation string is not found.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
insert_const()
Adds constants.
insert_dirs($name, $dir)
Adds directories definitions.
$conf db
API class for accounts.
getImportDatasetLabel($r)
Gives translated label of an import dataset.
getExportDatasetLabel($r)
Gives translated label of an export dataset.
isCoreOrExternalModule()
Tells if module is core or external.
getLastActivationDate()
Gives the last date of activation.
_remove($array_sql, $options= '')
Disable function.
delete_const()
Removes constants tagged 'deleteonunactive'.
delete_boxes()
Removes boxes.
getDescLongReadmeFound()
Return path of file if a README file was found.
insert_cronjobs()
Adds cronjobs.
getPublisher()
Gives the publisher name.
getChangeLog()
Gives the changelog.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
getLangFilesArray()
Gives module related language files list.
delete_tabs()
Removes tabs.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
getVersion($translated=1)
Gives module version (translated if param $translated is on) For 'experimental' modules, gives 'experimental' translation For 'dolibarr' modules, gives Dolibarr version.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
run_sql($sqlfile, $silent=1, $entity= '', $usesavepoint=1, $handler= '', $okerror= 'default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0)
Launch a sql file.
delete_menus()
Removes menu entries.
delete_cronjobs()
Removes boxes.
dol_is_file($pathoffile)
Return if path is a file.
print $_SERVER["PHP_SELF"]
Edit parameters.
getPublisherUrl()
Gives the publisher url.
delete_module_parts()
Removes generic parts.
getDescLong()
Gives the long description of a module.
_active()
Insert constants for module activation.
print
Draft customers invoices.
init($options= '')
Function called when module is enabled.
_init($array_sql, $options= '')
Enables a module.
getDesc()
Gives the translated module description if translation exists in admin.lang or the default module des...
dolMd2Html($content, $parser= 'parsedown', $replaceimagepath=null)
Function to parse MD content into HTML.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
insert_module_parts()
Adds generic parts.
create_dirs()
Creates directories.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
getKanbanView($codeenabledisable= '', $codetoconfig= '')
Return Kanban view of a module.
__construct($db)
Constructor.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
insert_menus()
Adds menu entries.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
_load_tables($reldir)
Create tables and keys required by module.