mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Improve demo data
This commit is contained in:
parent
277c622475
commit
82bfb6a3c3
@ -211,5 +211,19 @@ return array(
|
|||||||
'Warranty ends' => 'Garantie endet',
|
'Warranty ends' => 'Garantie endet',
|
||||||
'TV remote control' => 'TV Fernbedienung',
|
'TV remote control' => 'TV Fernbedienung',
|
||||||
'Alarm clock' => 'Wecker',
|
'Alarm clock' => 'Wecker',
|
||||||
'Heat remote control' => 'Fernbedienung Heizung'
|
'Heat remote control' => 'Fernbedienung Heizung',
|
||||||
|
'Lawn mowed in the garden' => 'Rasen im Garten gemäht',
|
||||||
|
'Some good snacks' => 'Paar gute Snacks',
|
||||||
|
'Pizza dough' => 'Pizzateig',
|
||||||
|
'Sieved tomatoes' => 'Passierte Tomaten',
|
||||||
|
'Salami' => 'Salami',
|
||||||
|
'Toast' => 'Toast',
|
||||||
|
'Minced meat' => 'Hackfleisch',
|
||||||
|
'Pizza' => 'Pizza',
|
||||||
|
'Spaghetti bolognese' => 'Spaghetti Bolognese',
|
||||||
|
'Sandwiches' => 'Belegte Toasts',
|
||||||
|
'English' => 'Englisch',
|
||||||
|
'German' => 'Deutsch',
|
||||||
|
'Italian' => 'Italienisch',
|
||||||
|
'Demo in different language' => 'Demo in anderer Sprache'
|
||||||
);
|
);
|
||||||
|
@ -13,6 +13,8 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
$rowCount = $this->DatabaseService->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = -1')->fetchColumn();
|
$rowCount = $this->DatabaseService->ExecuteDbQuery('SELECT COUNT(*) FROM migrations WHERE migration = -1')->fetchColumn();
|
||||||
if (intval($rowCount) === 0)
|
if (intval($rowCount) === 0)
|
||||||
{
|
{
|
||||||
|
$loremIpsum = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.';
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
INSERT INTO locations (name) VALUES ('{$localizationService->Localize('Pantry')}'); --2
|
INSERT INTO locations (name) VALUES ('{$localizationService->Localize('Pantry')}'); --2
|
||||||
INSERT INTO locations (name) VALUES ('{$localizationService->Localize('Candy cupboard')}'); --3
|
INSERT INTO locations (name) VALUES ('{$localizationService->Localize('Candy cupboard')}'); --3
|
||||||
@ -26,6 +28,7 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
INSERT INTO quantity_units (name) VALUES ('{$localizationService->Localize('Can')}'); --6
|
INSERT INTO quantity_units (name) VALUES ('{$localizationService->Localize('Can')}'); --6
|
||||||
INSERT INTO quantity_units (name) VALUES ('{$localizationService->Localize('Bunch')}'); --7
|
INSERT INTO quantity_units (name) VALUES ('{$localizationService->Localize('Bunch')}'); --7
|
||||||
|
|
||||||
|
DELETE FROM sqlite_sequence WHERE name = 'products'; --Just to keep IDs in order as mentioned here...
|
||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Cookies')}', 3, 3, 3, 1, 8); --1
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Cookies')}', 3, 3, 3, 1, 8); --1
|
||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Chocolate')}', 3, 3, 3, 1, 8); --2
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Chocolate')}', 3, 3, 3, 1, 8); --2
|
||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Gummy bears')}', 3, 3, 3, 1, 8); --3
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock, min_stock_amount) VALUES ('{$localizationService->Localize('Gummy bears')}', 3, 3, 3, 1, 8); --3
|
||||||
@ -41,13 +44,39 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Cucumber')}', 5, 2, 2, 1); --13
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Cucumber')}', 5, 2, 2, 1); --13
|
||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Radish')}', 5, 7, 7, 1); --14
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Radish')}', 5, 7, 7, 1); --14
|
||||||
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Tomato')}', 5, 2, 2, 1); --15
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Tomato')}', 5, 2, 2, 1); --15
|
||||||
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Pizza dough')}', 3, 3, 3, 1); --16
|
||||||
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Sieved tomatoes')}', 4, 5, 5, 1); --17
|
||||||
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Salami')}', 5, 3, 3, 1); --18
|
||||||
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Toast')}', 4, 5, 5, 1); --19
|
||||||
|
INSERT INTO products (name, location_id, qu_id_purchase, qu_id_stock, qu_factor_purchase_to_stock) VALUES ('{$localizationService->Localize('Minced meat')}', 5, 3, 3, 1); --20
|
||||||
|
|
||||||
|
INSERT INTO shopping_list (note, amount) VALUES ('{$localizationService->Localize('Some good snacks')}', 1);
|
||||||
|
INSERT INTO shopping_list (product_id, amount) VALUES (20, 1);
|
||||||
|
INSERT INTO shopping_list (product_id, amount) VALUES (17, 1);
|
||||||
|
|
||||||
|
INSERT INTO recipes (name, description) VALUES ('{$localizationService->Localize('Pizza')}', '{$loremIpsum}'); --1
|
||||||
|
INSERT INTO recipes (name, description) VALUES ('{$localizationService->Localize('Spaghetti bolognese')}', '{$loremIpsum}'); --2
|
||||||
|
INSERT INTO recipes (name, description) VALUES ('{$localizationService->Localize('Sandwiches')}', '{$loremIpsum}'); --3
|
||||||
|
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (1, 16, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (1, 17, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (1, 18, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (1, 10, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (2, 6, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (2, 10, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (2, 17, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (2, 20, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (3, 10, 1);
|
||||||
|
INSERT INTO recipes_pos (recipe_id, product_id, amount) VALUES (3, 11, 1);
|
||||||
|
|
||||||
INSERT INTO habits (name, period_type, period_days) VALUES ('{$localizationService->Localize('Changed towels in the bathroom')}', 'manually', 5); --1
|
INSERT INTO habits (name, period_type, period_days) VALUES ('{$localizationService->Localize('Changed towels in the bathroom')}', 'manually', 5); --1
|
||||||
INSERT INTO habits (name, period_type, period_days) VALUES ('{$localizationService->Localize('Cleaned the kitchen floor')}', 'dynamic-regular', 7); --2
|
INSERT INTO habits (name, period_type, period_days) VALUES ('{$localizationService->Localize('Cleaned the kitchen floor')}', 'dynamic-regular', 7); --2
|
||||||
|
INSERT INTO habits (name, period_type, period_days) VALUES ('{$localizationService->Localize('Lawn mowed in the garden')}', 'dynamic-regular', 21); --3
|
||||||
|
|
||||||
INSERT INTO batteries (name, description, used_in) VALUES ('{$localizationService->Localize('Battery')}1', '{$localizationService->Localize('Warranty ends')} 2023', '{$localizationService->Localize('TV remote control')}'); --1
|
INSERT INTO batteries (name, description, used_in) VALUES ('{$localizationService->Localize('Battery')}1', '{$localizationService->Localize('Warranty ends')} 2023', '{$localizationService->Localize('TV remote control')}'); --1
|
||||||
INSERT INTO batteries (name, description, used_in) VALUES ('{$localizationService->Localize('Battery')}2', '{$localizationService->Localize('Warranty ends')} 2022', '{$localizationService->Localize('Alarm clock')}'); --2
|
INSERT INTO batteries (name, description, used_in) VALUES ('{$localizationService->Localize('Battery')}2', '{$localizationService->Localize('Warranty ends')} 2022', '{$localizationService->Localize('Alarm clock')}'); --2
|
||||||
INSERT INTO batteries (name, description, used_in, charge_interval_days) VALUES ('{$localizationService->Localize('Battery')}3', '{$localizationService->Localize('Warranty ends')} 2022', '{$localizationService->Localize('Heat remote control')}', 60); --3
|
INSERT INTO batteries (name, description, used_in, charge_interval_days) VALUES ('{$localizationService->Localize('Battery')}3', '{$localizationService->Localize('Warranty ends')} 2022', '{$localizationService->Localize('Heat remote control')}', 60); --3
|
||||||
|
INSERT INTO batteries (name, description, used_in, charge_interval_days) VALUES ('{$localizationService->Localize('Battery')}4', '{$localizationService->Localize('Warranty ends')} 2028', '{$localizationService->Localize('Heat remote control')}', 60); --4
|
||||||
|
|
||||||
INSERT INTO migrations (migration) VALUES (-1);
|
INSERT INTO migrations (migration) VALUES (-1);
|
||||||
";
|
";
|
||||||
@ -76,6 +105,7 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
$habitsService->TrackHabit(1, date('Y-m-d H:i:s', strtotime('-15 days')));
|
$habitsService->TrackHabit(1, date('Y-m-d H:i:s', strtotime('-15 days')));
|
||||||
$habitsService->TrackHabit(2, date('Y-m-d H:i:s', strtotime('-10 days')));
|
$habitsService->TrackHabit(2, date('Y-m-d H:i:s', strtotime('-10 days')));
|
||||||
$habitsService->TrackHabit(2, date('Y-m-d H:i:s', strtotime('-20 days')));
|
$habitsService->TrackHabit(2, date('Y-m-d H:i:s', strtotime('-20 days')));
|
||||||
|
$habitsService->TrackHabit(3, date('Y-m-d H:i:s', strtotime('-17 days')));
|
||||||
|
|
||||||
$batteriesService = new BatteriesService();
|
$batteriesService = new BatteriesService();
|
||||||
$batteriesService->TrackChargeCycle(1, date('Y-m-d H:i:s', strtotime('-200 days')));
|
$batteriesService->TrackChargeCycle(1, date('Y-m-d H:i:s', strtotime('-200 days')));
|
||||||
@ -87,6 +117,7 @@ class DemoDataGeneratorService extends BaseService
|
|||||||
$batteriesService->TrackChargeCycle(2, date('Y-m-d H:i:s', strtotime('-100 days')));
|
$batteriesService->TrackChargeCycle(2, date('Y-m-d H:i:s', strtotime('-100 days')));
|
||||||
$batteriesService->TrackChargeCycle(2, date('Y-m-d H:i:s', strtotime('-50 days')));
|
$batteriesService->TrackChargeCycle(2, date('Y-m-d H:i:s', strtotime('-50 days')));
|
||||||
$batteriesService->TrackChargeCycle(3, date('Y-m-d H:i:s', strtotime('-65 days')));
|
$batteriesService->TrackChargeCycle(3, date('Y-m-d H:i:s', strtotime('-65 days')));
|
||||||
|
$batteriesService->TrackChargeCycle(4, date('Y-m-d H:i:s', strtotime('-56 days')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"Version": "1.13.1",
|
"Version": "1.14.0",
|
||||||
"ReleaseDate": "2018-07-12"
|
"ReleaseDate": "2018-07-15"
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
Grocy.BaseUrl = '{{ $U('/') }}';
|
Grocy.BaseUrl = '{{ $U('/') }}';
|
||||||
Grocy.LocalizationStrings = {!! json_encode($localizationStrings) !!};
|
Grocy.LocalizationStrings = {!! json_encode($localizationStrings) !!};
|
||||||
Grocy.ActiveNav = '@yield('activeNav', '')';
|
Grocy.ActiveNav = '@yield('activeNav', '')';
|
||||||
|
Grocy.Culture = '{{ CULTURE }}';
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user