feat(02-01): extract furniture data from legacy into structured class
- Created Umzugsliste_Furniture_Data class with singleton pattern - Extracted all 118 furniture items from 7 rooms with exact cbm values - Preserved exact item names and order from legacy liste.php - Room structure: wohnzimmer (32), schlafzimmer (15), arbeitszimmer (11), bad (3), kueche_esszimmer (18), kinderzimmer (18), keller (21) - All items have name, cbm (float), and montage (boolean) properties Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
234
includes/class-furniture-data.php
Normal file
234
includes/class-furniture-data.php
Normal file
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
/**
|
||||
* Furniture Data
|
||||
*
|
||||
* Provides furniture inventory data extracted from legacy liste.php
|
||||
*
|
||||
* @package Umzugsliste
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Furniture data class
|
||||
*/
|
||||
class Umzugsliste_Furniture_Data {
|
||||
|
||||
/**
|
||||
* Instance
|
||||
*
|
||||
* @var Umzugsliste_Furniture_Data
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* Get instance
|
||||
*
|
||||
* @return Umzugsliste_Furniture_Data
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( null === self::$instance ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
private function __construct() {
|
||||
// Private constructor for singleton
|
||||
}
|
||||
|
||||
/**
|
||||
* Get room definitions
|
||||
*
|
||||
* @return array Room definitions with keys and German labels
|
||||
*/
|
||||
public static function get_rooms() {
|
||||
return array(
|
||||
'wohnzimmer' => 'Wohnzimmer',
|
||||
'schlafzimmer' => 'Schlafzimmer',
|
||||
'arbeitszimmer' => 'Arbeitszimmer',
|
||||
'bad' => 'Bad',
|
||||
'kueche_esszimmer' => 'Küche/Esszimmer',
|
||||
'kinderzimmer' => 'Kinderzimmer',
|
||||
'keller' => 'Keller/Speicher/Garage',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get furniture items for a specific room
|
||||
*
|
||||
* @param string $room_key Room key (wohnzimmer, schlafzimmer, etc.)
|
||||
* @return array Furniture items with name, cbm, and montage properties
|
||||
*/
|
||||
public static function get_furniture_items( $room_key ) {
|
||||
$all_items = self::get_all_furniture_data();
|
||||
|
||||
if ( ! isset( $all_items[ $room_key ] ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
return $all_items[ $room_key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all furniture data
|
||||
*
|
||||
* Extracted from legacy liste.php - preserves exact item names, cbm values, and order
|
||||
*
|
||||
* @return array All furniture items organized by room
|
||||
*/
|
||||
private static function get_all_furniture_data() {
|
||||
return array(
|
||||
'wohnzimmer' => array(
|
||||
array( 'name' => 'Sofa, Couch, je Sitz', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Sitzelemente, je Sitz', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Sessel mit Armlehne', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Sessel ohne Armlehne', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Stuhl', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 0,6 m', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 1,0 m', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Tisch über 1,0 m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Schrank, zerlegbar, je m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Anbauwand, je angefangenem Meter', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Regal, zerlegbar, je angefangenem Meter', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Buffet mit Aufsatz', 'cbm' => 1.8, 'montage' => true ),
|
||||
array( 'name' => 'Standuhr', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Schreibtisch bis 1,6 m', 'cbm' => 1.2, 'montage' => true ),
|
||||
array( 'name' => 'Schreibtisch über 1,6 m', 'cbm' => 1.7, 'montage' => true ),
|
||||
array( 'name' => 'Sekretär', 'cbm' => 1.2, 'montage' => true ),
|
||||
array( 'name' => 'Sideboard', 'cbm' => 1.2, 'montage' => true ),
|
||||
array( 'name' => 'Musikschrank/Turm', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Stereoanlage', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Fernseher', 'cbm' => 0.3, 'montage' => true ),
|
||||
array( 'name' => 'DVD-Player', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Klavier', 'cbm' => 1.5, 'montage' => true ),
|
||||
array( 'name' => 'Flügel', 'cbm' => 2.0, 'montage' => true ),
|
||||
array( 'name' => 'Heimorgel', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Stehlampe', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Bilder', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Deckenlampe', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Teppich', 'cbm' => 0.3, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Nähmaschine', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Staubsauger', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Mülltonne', 'cbm' => 0.1, 'montage' => true ),
|
||||
),
|
||||
'schlafzimmer' => array(
|
||||
array( 'name' => 'Schrank 2 Türen, nicht zerlegt', 'cbm' => 1.5, 'montage' => true ),
|
||||
array( 'name' => 'Schrank, zerl., je angefangenem Meter', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Doppelbett komplett', 'cbm' => 2.0, 'montage' => true ),
|
||||
array( 'name' => 'Einzelbett komplett', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Franz. Bett komplett', 'cbm' => 1.5, 'montage' => true ),
|
||||
array( 'name' => 'Nachttisch', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Kommode', 'cbm' => 0.7, 'montage' => true ),
|
||||
array( 'name' => 'Wäschetruhe', 'cbm' => 0.3, 'montage' => true ),
|
||||
array( 'name' => 'Hocker/Stuhl', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Spiegel', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Deckenlampe', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Kleiderboxen', 'cbm' => 0.6, 'montage' => true ),
|
||||
array( 'name' => 'Wäscheständer', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Bügelbrett', 'cbm' => 0.2, 'montage' => true ),
|
||||
),
|
||||
'arbeitszimmer' => array(
|
||||
array( 'name' => 'Aktenschrank, je lfd. m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Schreibtisch bis 1,6 m', 'cbm' => 1.2, 'montage' => true ),
|
||||
array( 'name' => 'Schreibtisch über 1,6 m', 'cbm' => 1.7, 'montage' => true ),
|
||||
array( 'name' => 'Stuhl', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Stuhl mit Armlehne', 'cbm' => 0.3, 'montage' => true ),
|
||||
array( 'name' => 'Sessel mit Armlehne', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Bücherregal, je lfd. m', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'PC', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Drucker', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Kopierer', 'cbm' => 0.1, 'montage' => true ),
|
||||
),
|
||||
'bad' => array(
|
||||
array( 'name' => 'Unterschrank', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Spiegelschrank', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Kommode', 'cbm' => 0.5, 'montage' => true ),
|
||||
),
|
||||
'kueche_esszimmer' => array(
|
||||
array( 'name' => 'Buffet mit Aufsatz', 'cbm' => 1.8, 'montage' => true ),
|
||||
array( 'name' => 'Buffet ohne Aufsatz', 'cbm' => 1.5, 'montage' => true ),
|
||||
array( 'name' => 'Oberteil, je Tür', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Unterteil, je Tür', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 1,0 m', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 1,2 m', 'cbm' => 0.6, 'montage' => true ),
|
||||
array( 'name' => 'Tisch über 1,2 m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Stuhl', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Eckbank, je Sitz', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Herd', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Spülmaschine', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Waschmaschine/Trockner', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Kühlschrank bis 120 l', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Kühlschrank über 120 l', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Arbeitsplatte, je lfd. m', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Vitrine (Glasschrank)', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Sideboard', 'cbm' => 1.2, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
),
|
||||
'kinderzimmer' => array(
|
||||
array( 'name' => 'Schrank mit 2 Türen, nicht zerlegt', 'cbm' => 1.5, 'montage' => true ),
|
||||
array( 'name' => 'Schrank zerl., je lfd. m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Bett, komplett', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Kinderbett, komplett', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Etagenbett, komplett', 'cbm' => 1.6, 'montage' => true ),
|
||||
array( 'name' => 'Anbauwand, je lfd. m', 'cbm' => 1.0, 'montage' => true ),
|
||||
array( 'name' => 'Nachttisch', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Kommode', 'cbm' => 0.7, 'montage' => true ),
|
||||
array( 'name' => 'Schreibpult', 'cbm' => 0.7, 'montage' => true ),
|
||||
array( 'name' => 'Spielzeugkiste', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 1,0 m', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Tisch bis 1,2 m', 'cbm' => 0.6, 'montage' => true ),
|
||||
array( 'name' => 'Tisch über 1,2 m', 'cbm' => 0.8, 'montage' => true ),
|
||||
array( 'name' => 'Laufgitter', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Stuhl/Hocker', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Deckenlampe', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Kleiderboxen', 'cbm' => 0.6, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
),
|
||||
'keller' => array(
|
||||
array( 'name' => 'Fahrad, Moped', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Dreirad/Kinderrad', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Tischtennisplatte', 'cbm' => 0.3, 'montage' => true ),
|
||||
array( 'name' => 'Sonnenschirm', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Autoreifen', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Koffer', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Klapptisch/-stuhl', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Kinderwagen', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Regal, zerlegbar, je lfd. m', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Rasenmäher', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Schubkarre', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Werkbank, zerlegbar', 'cbm' => 0.4, 'montage' => true ),
|
||||
array( 'name' => 'Werkzeugschrank', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Werkzeugkoffer', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Ski', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Schlitten', 'cbm' => 0.2, 'montage' => true ),
|
||||
array( 'name' => 'Blumenkübel/Kasten', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Kleiderboxen', 'cbm' => 0.6, 'montage' => true ),
|
||||
array( 'name' => 'Umzugskarton', 'cbm' => 0.1, 'montage' => true ),
|
||||
array( 'name' => 'Grill', 'cbm' => 0.5, 'montage' => true ),
|
||||
array( 'name' => 'Gartengeräte', 'cbm' => 0.1, 'montage' => true ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get additional work sections
|
||||
*
|
||||
* Returns the additional work sections that appear after the room furniture inventory
|
||||
* Note: Sonstiges is a free text field (textarea), not included here
|
||||
*
|
||||
* @return array Additional work sections
|
||||
*/
|
||||
public static function get_additional_work() {
|
||||
// To be populated in Task 3
|
||||
return array();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user