diff --git a/ajax/pwa_api.php b/ajax/pwa_api.php index 36e6e4e..ebf6641 100644 --- a/ajax/pwa_api.php +++ b/ajax/pwa_api.php @@ -10,6 +10,7 @@ * - firma_info → Firmen-Stammdaten + Logo (für Plankopf) * - auftraege_listen → Liste offener Aufträge (Commande) * - auftrag_details&id= → Einzelner Auftrag mit Positionen + * - auftraege_status&ids=1,2,3 → aktueller Status mehrerer Aufträge [{id, status}] (API 1.4.0) * - kunden_suchen&such= → Third-Party-Suche * - dokument_upload (POST) → Plan-PDF an Auftrag/Kunde anhängen */ @@ -65,7 +66,7 @@ try { echo json_encode([ 'aktiv' => true, 'modul' => 'eplan', - 'version' => '1.3.0', + 'version' => '1.4.0', 'dolibarr' => DOL_VERSION, ]); break; @@ -154,6 +155,31 @@ try { ]); break; + case 'auftraege_status': + // ElektroPlan „Öffnen": Zeichnungen abgeschlossener/stornierter Aufträge + // ausblenden — dafür der AKTUELLE Status, in einer Abfrage für alle. + $ids = array(); + foreach (explode(',', (string) GETPOST('ids', 'alphanohtml')) as $teil) { + $n = (int) trim($teil); + if ($n > 0) $ids[$n] = $n; + } + $ids = array_slice(array_values($ids), 0, 1000); + $liste = []; + if ($ids) { + $sql = "SELECT c.rowid as id, c.fk_statut FROM ".MAIN_DB_PREFIX."commande c + WHERE c.entity IN (".getEntity('commande').") + AND c.rowid IN (".implode(',', array_map('intval', $ids)).")"; + $resql = $db->query($sql); + if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $liste[] = ['id' => (int) $obj->id, 'status' => (int) $obj->fk_statut]; + } + $db->free($resql); + } + } + echo json_encode($liste); + break; + case 'kunden_suchen': $such = GETPOST('such', 'alphanohtml'); if (empty($such) || strlen($such) < 2) { echo json_encode([]); break; } diff --git a/core/modules/modEplan.class.php b/core/modules/modEplan.class.php index cf27f86..7bf88c8 100644 --- a/core/modules/modEplan.class.php +++ b/core/modules/modEplan.class.php @@ -24,7 +24,7 @@ class modEplan extends DolibarrModules $this->editor_name = 'Alles Watt läuft'; $this->editor_url = ''; - $this->version = '1.1.2'; + $this->version = '1.1.3'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->picto = 'fa-drafting-compass';