diff --git a/db/mariadb.sql b/db/mariadb.sql index fe2733f..1fdd94a 100644 --- a/db/mariadb.sql +++ b/db/mariadb.sql @@ -66,6 +66,7 @@ CREATE TABLE vessel ( ballast smallint(6) UNSIGNED DEFAULT NULL, beltpos_aft float(4,2) UNSIGNED DEFAULT NULL, beltpos_bow float(4,2) UNSIGNED DEFAULT NULL, + shapefile varchar(40) DEFAULT NULL, remarks varchar(150) DEFAULT NULL, PRIMARY KEY (vid) ); diff --git a/webgui/config.inc-sample b/webgui/config.inc-sample index 48b3b35..ee48b72 100644 --- a/webgui/config.inc-sample +++ b/webgui/config.inc-sample @@ -28,6 +28,9 @@ $g_mailto_webmaster = 'webmaster@example.com'; $g_timezone = 'Europe/Berlin'; $g_locale = 'de_DE.UTF-8'; +// vessel base shapes directory +$g_shapedir = 'shapes'; + // documents and images $g_doc_basepath = '/var/local/yms'; $g_doc_maxsize = 1024*1024*16; // 16 MB diff --git a/webgui/index.php b/webgui/index.php index 187bdd1..d2e471c 100644 --- a/webgui/index.php +++ b/webgui/index.php @@ -80,6 +80,7 @@ switch ($submit = form_get_action()) { $p[':ballast'] = gpc_get_int($_POST, 'ballast'); $p[':beltpos_aft'] = gpc_get_float($_POST, 'beltpos_aft'); $p[':beltpos_bow'] = gpc_get_float($_POST, 'beltpos_bow'); + $p[':shapefile'] = gpc_get_string($_POST, 'shapefile'); $p[':remarks'] = gpc_get_string($_POST, 'remarks', 150); $fields = join(',', array_map(function($s) { return ltrim($s, ':') . '=' . $s; }, array_keys($p))); $sth = $pdo->prepare("UPDATE vessel SET $fields WHERE vid=:vid"); @@ -143,22 +144,22 @@ echo "\n"; // Get current vessel data $sql = "SELECT vesselname, model, loa, lwl, beam, draught, draught_min," - . " displacement, ballast, beltpos_aft, beltpos_bow, remarks " + . " displacement, ballast, beltpos_aft, beltpos_bow, shapefile," + . " remarks " . "FROM vessel " . "WHERE vid=?"; $sth = $pdo->prepare($sql); $sth->execute([$vid]); $vessel = $sth->fetch(); -?> - - - - -Elizabethan 29 - - */ ?> -
+// get vessel shape +// TODO predefine base shapes for different vessels +$shapefilepath = dirname(__FILE__).'/'.$g_shapedir.'/'.$vessel['shapefile']; +if (isset($vessel['shapefile']) and file_exists($shapefilepath)) { + $baseshape = file_get_contents($shapefilepath); +} else { + // use internal default shape + $baseshape = <<fetch(); transform="matrix(1,0,0,-1,-4.9118388e-8,123.69274)" /> +EOT; +} + +$shape = new SimpleXMLElement($baseshape); +$g = $shape->addChild('g'); +$g->addAttribute('id', 'boxlayout'); + +// line for belt +$line = $g->addChild('line'); +$line->addAttribute('x1', '100'); +$line->addAttribute('y1', '0'); +$line->addAttribute('x2', '100'); +$line->addAttribute('y2', '100'); +$line->addAttribute('style', 'stroke:#ff0000;stroke-width:0.25px'); + +// rectangle for storage +$rect = $g->addChild('rect'); +$rect->addAttribute('x', '2'); +$rect->addAttribute('y', '14'); +$rect->addAttribute('width', '20'); +$rect->addAttribute('height', '26'); +$rect->addAttribute('stroke', '#000'); +$rect->addAttribute('stroke-width', '0.25px'); +$rect->addAttribute('fill', '#57E389'); +$rect->addAttribute('fill-opacity', '0.4'); + +// text with link +$link = $g->addChild('a'); +$link->addAttribute('xlink:href', 'storage.php?f=view&id=1'); +$text = $link->addChild('text', 'Box1'); +$text->addAttribute('font-size', '3.5'); +$text->addAttribute('x', '4'); +$text->addAttribute('y', '18'); + +?> +
+asXML()?> +
@@ -331,7 +370,8 @@ elseif ($action == ACT_EDIT): // ========== VARIANT: edit single record ===================================== $sql = "SELECT vesselname, vtype, model, loa, lwl, beam, draught, draught_min," - . " displacement, ballast, beltpos_aft, beltpos_bow, remarks " + . " displacement, ballast, beltpos_aft, beltpos_bow, shapefile," + . " remarks " . "FROM vessel " . "WHERE vid=?"; $sth = $pdo->prepare($sql); @@ -385,6 +425,10 @@ $vessel = $sth->fetch(PDO::FETCH_OBJ);
+
+ + +
diff --git a/webgui/locale/de_DE/de_DE.po b/webgui/locale/de_DE.po similarity index 83% rename from webgui/locale/de_DE/de_DE.po rename to webgui/locale/de_DE.po index bf00385..2f83360 100644 --- a/webgui/locale/de_DE/de_DE.po +++ b/webgui/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: YMS 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-09 09:10+0200\n" +"POT-Creation-Date: 2024-04-10 17:14+0200\n" "PO-Revision-Date: 2024-03-15 13:50+0100\n" "Last-Translator: Thomas Hooge \n" "Language-Team: LANGUAGE \n" @@ -16,11 +16,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: box.php:10 index.php:240 +#: box.php:10 index.php:241 msgid "Boxes" msgstr "Kisten" -#: box.php:70 maintenance.php:69 projects.php:76 storage.php:97 task.php:62 +#: box.php:70 checklist.php:45 maintenance.php:69 projects.php:76 +#: storage.php:97 task.php:62 #, php-format msgid "Unknown function '%s'!" msgstr "Unbekannte Funktion '%s'!" @@ -38,12 +39,12 @@ msgstr "Farbe" msgid "Content" msgstr "Inhalt" -#: box.php:96 box.php:171 equipment.php:339 inventory.php:248 +#: box.php:96 box.php:171 equipment.php:352 inventory.php:248 msgid "Weight" msgstr "Gewicht" -#: box.php:114 company.php:148 documents.php:208 equipment.php:276 -#: equipment_js.php:85 inventory.php:162 maintenance.php:113 +#: box.php:114 checklist.php:83 company.php:148 documents.php:208 +#: equipment.php:289 equipment_js.php:85 inventory.php:162 maintenance.php:113 #: measurement.php:177 projects.php:119 projects.php:147 provisions.php:128 #: storage.php:137 storage.php:168 task.php:111 #, php-format @@ -54,7 +55,7 @@ msgstr "%d Datensätze" msgid "Add Box" msgstr "Kiste hinzufügen" -#: box.php:132 index.php:279 inventory.php:186 inventory.php:190 +#: box.php:132 index.php:280 inventory.php:186 inventory.php:190 #: inventory.php:286 inventory.php:290 provisions.php:157 provisions.php:182 #: provisions.php:219 storage.php:10 msgid "Storage" @@ -62,8 +63,8 @@ msgstr "Stauraum" #: box.php:146 box.php:172 box.php:234 company.php:130 company.php:196 #: company.php:292 documents.php:225 documents.php:297 documents.php:384 -#: equipment.php:251 equipment.php:309 equipment.php:344 equipment.php:439 -#: equipment_js.php:65 index.php:314 index.php:376 maintenance.php:96 +#: equipment.php:264 equipment.php:322 equipment.php:357 equipment.php:452 +#: equipment_js.php:65 index.php:315 index.php:377 maintenance.php:96 #: maintenance.php:179 maintenance.php:235 projects.php:104 projects.php:175 #: projects.php:198 projects.php:267 storage.php:125 storage.php:218 #: storage.php:290 @@ -71,8 +72,8 @@ msgid "Remarks" msgstr "Bemerkungen" #: box.php:150 company.php:166 company.php:295 documents.php:250 -#: documents.php:387 equipment.php:313 equipment.php:442 equipment_js.php:112 -#: equipment_js.php:279 index.php:318 inventory.php:194 maintenance.php:144 +#: documents.php:387 equipment.php:326 equipment.php:455 equipment_js.php:112 +#: equipment_js.php:279 index.php:319 inventory.php:194 maintenance.php:144 #: measurement.php:219 projects.php:178 projects.php:270 provisions.php:159 #: storage.php:195 storage.php:293 task.php:131 msgid "Save" @@ -80,8 +81,8 @@ msgstr "Speichern" #: box.php:151 company.php:167 company.php:296 company.php:322 #: documents.php:251 documents.php:388 dropdown.php:196 dropdown.php:260 -#: equipment.php:314 equipment.php:443 equipment_js.php:113 -#: equipment_js.php:247 equipment_js.php:280 index.php:319 inventory.php:195 +#: equipment.php:327 equipment.php:456 equipment_js.php:113 +#: equipment_js.php:247 equipment_js.php:280 index.php:320 inventory.php:195 #: maintenance.php:145 measurement.php:220 projects.php:179 projects.php:271 #: provisions.php:160 storage.php:196 storage.php:294 task.php:132 msgid "Back" @@ -91,7 +92,7 @@ msgstr "Zurück" msgid "Inventory in box" msgstr "Inventar in der Kiste" -#: box.php:189 index.php:260 inventory.php:10 +#: box.php:189 index.php:261 inventory.php:10 msgid "Inventory" msgstr "Inventar" @@ -103,21 +104,56 @@ msgstr "Kiste ist leer" msgid "Edit Box" msgstr "Kiste bearbeiten" -#: box.php:230 equipment.php:423 inventory.php:279 +#: box.php:230 equipment.php:436 inventory.php:279 msgid "Weight, kg" msgstr "Gewicht, kg" -#: box.php:248 company.php:333 documents.php:400 dropdown.php:266 -#: equipment.php:469 equipment_js.php:289 index.php:387 inventory.php:348 -#: maintenance.php:251 measurement.php:279 projects.php:283 provisions.php:233 -#: storage.php:320 task.php:187 +#: box.php:248 checklist.php:151 company.php:333 documents.php:400 +#: dropdown.php:266 equipment.php:482 equipment_js.php:289 index.php:388 +#: inventory.php:348 maintenance.php:251 measurement.php:279 projects.php:283 +#: provisions.php:233 storage.php:320 task.php:187 msgid "Unknown function call: Please report to system development!" msgstr "Unbekannter Funktionsaufruf: Bitte der Systementwickelung melden!" -#: checklist.php:10 index.php:286 +#: checklist.php:10 index.php:287 msgid "Checklists" msgstr "Checklisten" +#: checklist.php:67 checklist.php:96 checklist.php:113 documents.php:187 +#: documents.php:221 documents.php:296 documents.php:380 +msgid "Title" +msgstr "Titel" + +#: checklist.php:68 checklist.php:138 +msgid "State" +msgstr "Status" + +#: checklist.php:92 +msgid "Add Checklist" +msgstr "Checkliste hinzufügen" + +#: checklist.php:111 +msgid "View Checklist" +msgstr "Checkliste ansehen" + +#: checklist.php:129 +msgid "Edit checklist" +msgstr "Checkliste bearbeiten" + +#: checklist.php:134 company.php:128 company.php:162 company.php:185 +#: company.php:234 dropdown.php:177 dropdown.php:215 equipment.php:310 +#: equipment.php:423 equipment_js.php:97 equipment_js.php:264 index.php:307 +#: inventory.php:145 inventory.php:175 inventory.php:271 measurement.php:191 +#: measurement.php:243 projects.php:101 projects.php:136 projects.php:161 +#: projects.php:194 projects.php:241 provisions.php:141 provisions.php:202 +#: storage.php:124 storage.php:183 storage.php:274 task.php:171 +msgid "Name" +msgstr "Name" + +#: checklist.php:146 +msgid "Delete checklist" +msgstr "Lösche Checkliste" + #: company.php:10 msgid "Company" msgstr "Firma" @@ -138,16 +174,6 @@ msgstr "Firma Nr. %d gelöscht" msgid "Unknown function!" msgstr "Unbekannte Funktion!" -#: company.php:128 company.php:162 company.php:185 company.php:234 -#: dropdown.php:177 dropdown.php:215 equipment.php:297 equipment.php:410 -#: equipment_js.php:97 equipment_js.php:264 index.php:306 inventory.php:145 -#: inventory.php:175 inventory.php:271 measurement.php:191 measurement.php:243 -#: projects.php:101 projects.php:136 projects.php:161 projects.php:194 -#: projects.php:241 provisions.php:141 provisions.php:202 storage.php:124 -#: storage.php:183 storage.php:274 task.php:171 -msgid "Name" -msgstr "Name" - #: company.php:129 company.php:186 documents.php:185 documents.php:312 msgid "Type" msgstr "Typ" @@ -225,7 +251,7 @@ msgstr "Stadt" msgid "Delete Company" msgstr "Firma löschen" -#: company.php:309 equipment.php:458 inventory.php:338 storage.php:309 +#: company.php:309 equipment.php:471 inventory.php:338 storage.php:309 #, php-format msgid "Record no. %d" msgstr "Datensatz Nr. %d" @@ -278,10 +304,6 @@ msgstr "ID" msgid "Filename" msgstr "Dateiname" -#: documents.php:187 documents.php:221 documents.php:296 documents.php:380 -msgid "Title" -msgstr "Titel" - #: documents.php:188 msgid "Links" msgstr "Verknüpfungen" @@ -366,7 +388,7 @@ msgstr "" msgid "Adding values is usually not critical." msgstr "" -#: dropdown.php:146 equipment.php:246 equipment_js.php:61 provisions.php:103 +#: dropdown.php:146 equipment.php:259 equipment_js.php:61 provisions.php:103 msgid "Description" msgstr "Beschreibung" @@ -398,16 +420,15 @@ msgstr "Liste bearbeiten: %s" msgid "Add" msgstr "Hinzufügen" -#: equipment.php:10 equipment_js.php:10 index.php:245 maintenance.php:95 +#: equipment.php:10 equipment_js.php:10 index.php:246 maintenance.php:95 #: maintenance.php:135 maintenance.php:178 maintenance.php:222 #: measurement.php:216 measurement.php:268 msgid "Equipment" msgstr "Ausrüstung" #: equipment.php:14 equipment.php:15 -#, fuzzy msgid "unknown" -msgstr "Unbekannt" +msgstr "unbekannt" #: equipment.php:119 #, php-format @@ -432,73 +453,73 @@ msgstr "Dateityp nicht zum Hochladen zugelassen:" msgid "File to big: %s.%s" msgstr "Datei zu groß: %s.%s" -#: equipment.php:236 +#: equipment.php:249 msgid "Apply" msgstr "" -#: equipment.php:247 equipment.php:302 equipment.php:336 equipment.php:413 +#: equipment.php:260 equipment.php:315 equipment.php:349 equipment.php:426 msgid "Manufacturer" msgstr "Hersteller" -#: equipment.php:248 equipment.php:305 equipment.php:337 equipment.php:415 +#: equipment.php:261 equipment.php:318 equipment.php:350 equipment.php:428 #: equipment_js.php:63 equipment_js.php:105 equipment_js.php:134 -#: equipment_js.php:272 index.php:310 index.php:344 +#: equipment_js.php:272 index.php:311 index.php:345 msgid "Model" msgstr "Modell" -#: equipment.php:249 equipment.php:338 equipment.php:419 equipment_js.php:64 +#: equipment.php:262 equipment.php:351 equipment.php:432 equipment_js.php:64 #: equipment_js.php:109 equipment_js.php:135 equipment_js.php:276 msgid "Serial" msgstr "Seriennummer" -#: equipment.php:250 +#: equipment.php:263 msgid "Age" msgstr "Alter" -#: equipment.php:260 +#: equipment.php:273 #, php-format msgid "%dm" msgstr "" -#: equipment.php:262 +#: equipment.php:275 #, php-format msgid "%dy" msgstr "" -#: equipment.php:294 equipment_js.php:94 +#: equipment.php:307 equipment_js.php:94 msgid "Add Equipment" msgstr "Ausrüstung hinzufügen" -#: equipment.php:301 equipment.php:343 equipment.php:436 +#: equipment.php:314 equipment.php:356 equipment.php:449 msgid "Category" msgstr "" -#: equipment.php:340 inventory.php:249 +#: equipment.php:353 inventory.php:249 msgid "Price" msgstr "Preis" -#: equipment.php:341 equipment.php:431 inventory.php:250 inventory.php:298 +#: equipment.php:354 equipment.php:444 inventory.php:250 inventory.php:298 msgid "Purchase date" msgstr "Kaufdatum" -#: equipment.php:342 equipment.php:435 +#: equipment.php:355 equipment.php:448 msgid "Supplier" msgstr "Lieferant" -#: equipment.php:406 equipment_js.php:261 +#: equipment.php:419 equipment_js.php:261 msgid "Edit Equipment" msgstr "Ausrüstung bearbeiten" -#: equipment.php:427 inventory.php:294 +#: equipment.php:440 inventory.php:294 #, php-format msgid "Price, %s" msgstr "Preis, %s" -#: equipment.php:456 +#: equipment.php:469 msgid "Delete equipment" msgstr "Ausrüstung löschen" -#: equipment.php:462 +#: equipment.php:475 msgid "" "Deleting an equipment item is final. There is no way back. Only delete if " "you are absolute sure." @@ -565,23 +586,23 @@ msgstr "LüA" msgid "Lwl" msgstr "LWL" -#: index.php:197 index.php:356 +#: index.php:197 index.php:357 msgid "Beam" msgstr "Breite" -#: index.php:198 index.php:360 +#: index.php:198 index.php:361 msgid "Draught" msgstr "Tiefgang" -#: index.php:199 index.php:364 +#: index.php:199 index.php:365 msgid "Draught, min." msgstr "Tiefgang, min." -#: index.php:200 index.php:368 +#: index.php:200 index.php:369 msgid "Displacement" msgstr "Verdrängung" -#: index.php:201 index.php:372 +#: index.php:201 index.php:373 msgid "Ballast" msgstr "Ballast" @@ -589,63 +610,55 @@ msgstr "Ballast" msgid "Statistics" msgstr "Statistik" -#: index.php:222 -msgid "Default" -msgstr "" - -#: index.php:222 -msgid "Tank" -msgstr "" - -#: index.php:232 +#: index.php:233 msgid "Storage type" msgstr "Stauraumart" -#: index.php:246 index.php:261 +#: index.php:247 index.php:262 msgid "Count" msgstr "Anzahl" -#: index.php:276 +#: index.php:277 msgid "Base data" msgstr "Stammdaten" -#: index.php:278 +#: index.php:279 msgid "Selection lists" msgstr "Auswahllisten" -#: index.php:280 +#: index.php:281 msgid "Companies" msgstr "Firmen" -#: index.php:283 +#: index.php:284 msgid "Additional modules" msgstr "Zusatzmodule" -#: index.php:285 measurement.php:10 +#: index.php:286 measurement.php:10 msgid "Measurements" msgstr "Maße/Messungen" -#: index.php:287 search.php:10 search.php:31 +#: index.php:288 search.php:10 search.php:31 msgid "Search" msgstr "Suche" -#: index.php:301 +#: index.php:302 msgid "Add additional yacht" msgstr "Zusätzliche Yacht hinzufügen" -#: index.php:336 +#: index.php:337 msgid "Edit Yacht" msgstr "Yacht bearbeiten" -#: index.php:340 +#: index.php:341 msgid "Vesselname" msgstr "Yachtname" -#: index.php:348 +#: index.php:349 msgid "LoA" msgstr "LüA" -#: index.php:352 +#: index.php:353 msgid "LwL" msgstr "LWL" @@ -848,15 +861,15 @@ msgstr "nicht zugeordnet" #: measurement.php:154 msgid "Measurement" -msgstr "" +msgstr "Messung" #: measurement.php:155 measurement.php:195 measurement.php:247 msgid "Note" -msgstr "" +msgstr "Notiz" #: measurement.php:156 msgid "Measured" -msgstr "" +msgstr "Gemessen" #: measurement.php:157 measurement.php:214 measurement.php:266 #: provisions.php:105 provisions.php:148 provisions.php:179 provisions.php:209 @@ -865,7 +878,7 @@ msgstr "Einheit" #: measurement.php:158 measurement.php:215 measurement.php:267 msgid "Accuracy" -msgstr "" +msgstr "Genauigkeit" #: measurement.php:186 msgid "Add measurement" @@ -921,7 +934,7 @@ msgstr "Verantwortlich" #: projects.php:204 msgid "Assigned tasks" -msgstr "" +msgstr "Zugeordnete Aufgaben" #: projects.php:213 task.php:10 task.php:94 task.php:127 task.php:149 msgid "Task" diff --git a/webgui/locale/de_DE/LC_MESSAGES/yms.mo b/webgui/locale/de_DE/LC_MESSAGES/yms.mo index adfed24..f41e6de 100644 Binary files a/webgui/locale/de_DE/LC_MESSAGES/yms.mo and b/webgui/locale/de_DE/LC_MESSAGES/yms.mo differ diff --git a/webgui/shapes/bavaria34.svg b/webgui/shapes/bavaria34.svg new file mode 100644 index 0000000..0be0b53 --- /dev/null +++ b/webgui/shapes/bavaria34.svg @@ -0,0 +1,228 @@ + + + + diff --git a/webgui/shapes/elizabethan29.svg b/webgui/shapes/elizabethan29.svg new file mode 100644 index 0000000..f23cc95 --- /dev/null +++ b/webgui/shapes/elizabethan29.svg @@ -0,0 +1,565 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + 11 + + + + + + + + + + + + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webgui/shapes/generic.svg b/webgui/shapes/generic.svg new file mode 100644 index 0000000..1892efe --- /dev/null +++ b/webgui/shapes/generic.svg @@ -0,0 +1,26 @@ + + + + + + + diff --git a/webgui/shapes/varianta65.svg b/webgui/shapes/varianta65.svg new file mode 100644 index 0000000..c62a8d5 --- /dev/null +++ b/webgui/shapes/varianta65.svg @@ -0,0 +1,119 @@ + + + +