eplan/core/modules/modEplan.class.php
Eduard Wisch 4f09c6e55c
All checks were successful
Deploy Eplan / deploy (push) Successful in 9s
fix: Modul-Beschreibung + Rechte-Labels via Sprachdatei [deploy]
- Module500037Desc/DescLong aus eplan.lang statt hardcodierter deutscher
  Strings im Modul-Descriptor
- Rechte-Labels via EplanRightRead/Write/Admin übersetzbar
- QR-Code-Block auf Auftragstab (aus vorheriger Sitzung)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 09:48:49 +02:00

111 lines
4 KiB
PHP

<?php
/* Copyright (C) 2026 Eduard Wisch <data@data-it-solution.de>
* GPL v3+ — siehe COPYING
*/
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
class modEplan extends DolibarrModules
{
public function __construct($db)
{
global $conf, $langs;
$this->db = $db;
$this->numero = 500037;
$this->rights_class = 'eplan';
$this->family = "other";
$this->module_position = '91';
$this->name = preg_replace('/^mod/i', '', get_class($this));
// Beschreibung: Dolibarr nimmt automatisch Module500037Desc/DescLong
// aus eplan.lang wenn vorhanden — Hardcoded ist nur Fallback.
$this->description = "Module500037Desc";
$this->descriptionlong = "Module500037DescLong";
$this->editor_name = 'Alles Watt läuft';
$this->editor_url = '';
$this->version = '1.1.0';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'fa-drafting-compass';
$this->module_parts = array(
'triggers' => 0, 'login' => 0, 'substitutions' => 0, 'menus' => 0,
'tpl' => 0, 'barcode' => 0, 'models' => 0, 'printing' => 0,
'theme' => 0, 'css' => array(), 'js' => array(), 'hooks' => array(),
'moduleforexternal' => 0,
);
$this->dirs = array();
$this->config_page_url = array("setup.php@eplan");
$this->hidden = false;
$this->depends = array();
$this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array("eplan@eplan");
$this->phpmin = array(7, 4);
$this->need_dolibarr_version = array(19, 0);
$this->need_javascript_ajax = 0;
// Konstanten
$this->const = array(
0 => array('EPLAN_PWA_URL', 'chaine', '', 'URL zur ElektroPlan PWA', 0, 'current', 0),
1 => array('EPLAN_TAB_ON_ORDER', 'chaine', '1', 'Tab Aufmaß auf Aufträgen', 0, 'current', 0),
2 => array('EPLAN_TAB_ON_THIRDPARTY', 'chaine', '1', 'Tab Aufmaß auf Kundenkarten', 0, 'current', 0),
);
// Tabs auf Auftrag + Kundenkarte
$this->tabs = array(
'order:+aufmass:Aufmaß:eplan@eplan:$user->hasRight("eplan","read"):/custom/eplan/aufmass_order.php?id=__ID__',
'thirdparty:+aufmass:Aufmaß:eplan@eplan:$user->hasRight("eplan","read"):/custom/eplan/aufmass_thirdparty.php?socid=__ID__',
);
// Rechte
$this->rights = array();
$r = 0;
$this->rights[$r][0] = $this->numero + 0;
$this->rights[$r][1] = 'EplanRightRead';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'read';
$r++;
$this->rights[$r][0] = $this->numero + 1;
$this->rights[$r][1] = 'EplanRightWrite';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'write';
$r++;
$this->rights[$r][0] = $this->numero + 2;
$this->rights[$r][1] = 'EplanRightAdmin';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'admin';
$r++;
// Menü
$this->menu = array();
$r = 0;
$this->menu[$r] = array(
'fk_menu' => 'fk_mainmenu=tools', 'type' => 'left',
'titre' => 'Eplan', 'prefix' => '<i class="fas fa-drafting-compass pictofixedwidth"></i>',
'mainmenu' => 'tools', 'leftmenu' => 'eplan',
'url' => '/custom/eplan/admin/setup.php', 'langs' => 'eplan@eplan',
'position' => 100, 'enabled' => 'isModEnabled("eplan")',
'perms' => '$user->hasRight("eplan","read")', 'target' => '', 'user' => 0,
);
}
public function init($options = '')
{
$this->_load_tables('/install/mysql/', 'eplan');
return $this->_init(array(), $options);
}
public function remove($options = '')
{
return $this->_remove(array(), $options);
}
}