eplan/core/modules/modEplan.class.php
Eduard Wisch 82d58c8ce4
All checks were successful
Deploy Eplan / deploy (push) Successful in 9s
Plan aus ElektroPlan als „hochgeladen" indexieren — steht im Reiter Dateien, nicht vorne (1.1.2) [deploy]
dokument_upload legte die PDF nur in den Auftragsordner. Ohne Eintrag in
llx_ecm_files indexiert Dolibarr sie selbst als „unknown", und der Kasten
„Verknüpfte Dokumente" (FileArchive 4.15 filtert nach gen_or_uploaded)
zeigte sie weiter vorne. Jetzt: Eintrag mit gen_or_uploaded = 'uploaded'
und Beleg-Bezug; erneutes Speichern aktualisiert den Eintrag statt ihn
doppelt anzulegen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 21:35:51 +02:00

113 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));
// 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.2';
$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('data' => array('thirdpartycard'), 'entity' => '0'),
'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__',
// Am KUNDEN setzt den Reiter die Hook-Klasse (nur bei vorhandenen Auftraegen —
// ohne Auftrag gibt es nichts zu vermessen). Der Reiter am AUFTRAG bleibt fest.
);
// 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);
}
}