eplan/core/modules/modEplan.class.php
Eduard Wisch b2393b0385
All checks were successful
Deploy Eplan / deploy (push) Successful in 1s
feat: Tabs Aufmaß auf Auftrag + Kundenkarte [deploy]
- Tab "Aufmaß" auf Auftragskarte: PWA-Link mit Auftrags-Kontext,
  Grundriss-Liste (Platzhalter für Backend-Anbindung)
- Tab "Aufmaß" auf Kundenkarte: Aufträge des Kunden mit Aufmaß-Button
- Neue Rechte: read, write, admin
- Konstanten: EPLAN_TAB_ON_ORDER, EPLAN_TAB_ON_THIRDPARTY
- Standard Dolibarr Include-Pattern für Container-Kompatibilität

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 18:32:21 +02:00

109 lines
4.1 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));
$this->description = "Aufmaß-Tab auf Aufträgen und Kundenkarten — Verknüpfung zur ElektroPlan PWA.";
$this->descriptionlong = "Fügt Aufträgen und Kundenkarten einen Reiter 'Aufmaß' hinzu. Zeigt verknüpfte Grundrisse, öffnet die ElektroPlan PWA mit Auftrags-Kontext und ermöglicht PDF-Export direkt als Dolibarr-Dokument.";
$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] = 'Aufmaß einsehen';
$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] = 'Aufmaß bearbeiten';
$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] = 'Eplan Einstellungen verwalten';
$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);
}
}