From c0d79b15185f0cb18cde3214adc9b5d979ed301e Mon Sep 17 00:00:00 2001 From: DeeeeLAN Date: Wed, 25 Sep 2019 00:00:36 -0700 Subject: [PATCH 1/6] Fixed #378 (#380) * fixed barcode button on iOS and made nicer on the desktop * fixed indentation * fixed indentation --- views/components/barcodescanner.blade.php | 1 + 1 file changed, 1 insertion(+) diff --git a/views/components/barcodescanner.blade.php b/views/components/barcodescanner.blade.php index 548af94f..7a6ca411 100644 --- a/views/components/barcodescanner.blade.php +++ b/views/components/barcodescanner.blade.php @@ -16,6 +16,7 @@ margin-top: 4px; margin-right: 5px; z-index: 1000; + cursor: pointer; } .combobox-container #barcodescanner-start-button { From 2eb3d8fe471a54b99a30f3efbb63b3b168c7203e Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 25 Sep 2019 09:16:43 +0200 Subject: [PATCH 2/6] Updated changelog for #378 / #380 --- changelog/53_UNRELEASED_2019-xx-xx.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/53_UNRELEASED_2019-xx-xx.md b/changelog/53_UNRELEASED_2019-xx-xx.md index dcb1ea86..b1c66d26 100644 --- a/changelog/53_UNRELEASED_2019-xx-xx.md +++ b/changelog/53_UNRELEASED_2019-xx-xx.md @@ -3,6 +3,7 @@ - Improved the responsiveness of the meal plan and calendar page by automatically switching to a day calendar view on smaller screens (thanks for the idea @kriddles) - The calendar now also contains all planned recipes from the meal plan on the corresponding day - When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item +- Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN) - The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times - Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu) - Some style/CSS detail-refinements From 53f0893f556ccd5dbe3801cd6e88c6f8bf662b86 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 25 Sep 2019 09:32:06 +0200 Subject: [PATCH 3/6] Fix unit conversion handling (factor of destination qu is always 1) (fixes #382) --- changelog/53_UNRELEASED_2019-xx-xx.md | 1 + public/viewjs/components/productamountpicker.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog/53_UNRELEASED_2019-xx-xx.md b/changelog/53_UNRELEASED_2019-xx-xx.md index b1c66d26..18f1aca8 100644 --- a/changelog/53_UNRELEASED_2019-xx-xx.md +++ b/changelog/53_UNRELEASED_2019-xx-xx.md @@ -4,6 +4,7 @@ - The calendar now also contains all planned recipes from the meal plan on the corresponding day - When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item - Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN) +- Fixed a problem regarding quantity unit conversion handling for recipe ingredients of products with no unit relations, but only a different purchase/stock quantity unit - The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times - Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu) - Some style/CSS detail-refinements diff --git a/public/viewjs/components/productamountpicker.js b/public/viewjs/components/productamountpicker.js index ced3987c..0e34a587 100644 --- a/public/viewjs/components/productamountpicker.js +++ b/public/viewjs/components/productamountpicker.js @@ -11,7 +11,13 @@ Grocy.Components.ProductAmountPicker.Reload = function(productId, destinationQuI $("#qu_id").attr("data-destination-qu-name", FindObjectInArrayByPropertyValue(Grocy.QuantityUnits, 'id', destinationQuId).name); conversionsForProduct.forEach(conversion => { - $("#qu_id").append(''); + var factor = conversion.factor; + if (conversion.to_qu_id == destinationQuId) + { + factor = 1; + } + + $("#qu_id").append(''); }); } From 04808eaa66490077b4805501c6d8db6464c5e806 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 25 Sep 2019 09:52:32 +0200 Subject: [PATCH 4/6] Include the server timezone in iCal calendar export (closes #379) --- changelog/53_UNRELEASED_2019-xx-xx.md | 1 + controllers/CalendarApiController.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/changelog/53_UNRELEASED_2019-xx-xx.md b/changelog/53_UNRELEASED_2019-xx-xx.md index 18f1aca8..c39d246a 100644 --- a/changelog/53_UNRELEASED_2019-xx-xx.md +++ b/changelog/53_UNRELEASED_2019-xx-xx.md @@ -5,6 +5,7 @@ - When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item - Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN) - Fixed a problem regarding quantity unit conversion handling for recipe ingredients of products with no unit relations, but only a different purchase/stock quantity unit +- Improved that dates in the iCal calendar export now includes the server timezone - The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times - Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu) - Some style/CSS detail-refinements diff --git a/controllers/CalendarApiController.php b/controllers/CalendarApiController.php index e579e532..a641a553 100644 --- a/controllers/CalendarApiController.php +++ b/controllers/CalendarApiController.php @@ -26,12 +26,20 @@ class CalendarApiController extends BaseApiController $events = $this->CalendarService->GetEvents(); foreach($events as $event) { + $date = new \DateTime($event['start']); + $date->setTimezone(date_default_timezone_get()); + + if ($event['date_format'] === 'date') + { + $date->setTime(23, 59, 59); + } + $vEvent = new \Eluceo\iCal\Component\Event(); - $vEvent->setDtStart(new \DateTime($event['start'])) - ->setDtEnd(new \DateTime($event['start'])) + $vEvent->setDtStart($date) + ->setDtEnd($date) ->setSummary($event['title']) ->setNoTime($event['date_format'] === 'date') - ->setUseUtc(false); + ->setUseTimezone(true); $vCalendar->addComponent($vEvent); } From fd140834436c874e85fb734e536dbb1d9a30c8ed Mon Sep 17 00:00:00 2001 From: Lewis Juggins Date: Wed, 25 Sep 2019 12:08:41 +0100 Subject: [PATCH 5/6] Support meal plan as default page (#383) * Support meal plan as default page * Update SystemController.php --- controllers/SystemController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/SystemController.php b/controllers/SystemController.php index 36b5dbf3..54cdb252 100644 --- a/controllers/SystemController.php +++ b/controllers/SystemController.php @@ -85,6 +85,11 @@ class SystemController extends BaseController if ($entryPage === 'calendar' && constant('GROCY_FEATURE_FLAG_CALENDAR')) { return '/calendar'; } + + // Meal Plan + if ($entryPage === 'mealplan' && constant('GROCY_FEATURE_FLAG_RECIPES')) { + return '/mealplan'; + } return '/about'; } From 75f8ecfad237dfe6538fecf3656f975ae52c9f6b Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Wed, 25 Sep 2019 13:11:20 +0200 Subject: [PATCH 6/6] Updated the changelog and config-dist.php for #383) --- changelog/53_UNRELEASED_2019-xx-xx.md | 1 + config-dist.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/53_UNRELEASED_2019-xx-xx.md b/changelog/53_UNRELEASED_2019-xx-xx.md index c39d246a..fc4244eb 100644 --- a/changelog/53_UNRELEASED_2019-xx-xx.md +++ b/changelog/53_UNRELEASED_2019-xx-xx.md @@ -6,6 +6,7 @@ - Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN) - Fixed a problem regarding quantity unit conversion handling for recipe ingredients of products with no unit relations, but only a different purchase/stock quantity unit - Improved that dates in the iCal calendar export now includes the server timezone +- It's now also possible to set the meal plan page as the default/entry page (`config.php` setting `ENTRY_PAGE`) (thanks @lwis) - The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times - Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu) - Some style/CSS detail-refinements diff --git a/config-dist.php b/config-dist.php index a8f34897..53817a24 100644 --- a/config-dist.php +++ b/config-dist.php @@ -51,7 +51,7 @@ Setting('DISABLE_URL_REWRITING', false); # Specify an custom homepage if desired - by default the homepage will be set to the stock overview, # this needs to be one of the following values: -# stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar +# stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan Setting('ENTRY_PAGE', 'stock'); # Set this to true if you want to disable authentication / the login screen,