mirror of
https://github.com/grocy/grocy.git
synced 2025-08-05 05:15:37 +00:00
Changelog and small changes for #552)
This commit is contained in:
parent
13f99ad5f2
commit
1953a26d7f
@ -19,7 +19,11 @@
|
|||||||
### Meal plan improvements
|
### Meal plan improvements
|
||||||
- Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product
|
- Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product
|
||||||
- Added an edit button to all types of meal plan entries
|
- Added an edit button to all types of meal plan entries
|
||||||
- Fixed that the meal plan not used the full height on mobile devices (also applies/fixes the same for the calendar)
|
- Fixed that the meal plan not used the full height on mobile devices
|
||||||
|
|
||||||
|
### Calendar fixes
|
||||||
|
- Fixed to only include events when the corresponding feature flag is enabled (e. g. don't show expiring products when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is set to `false`) (thanks @kriddles)
|
||||||
|
- Fixed that the calendar not used the full height on mobile devices
|
||||||
|
|
||||||
### General & other improvements/fixes
|
### General & other improvements/fixes
|
||||||
- Optimized the top navbar height and overall spacing to waste less space
|
- Optimized the top navbar height and overall spacing to waste less space
|
||||||
|
@ -102,47 +102,51 @@ class CalendarService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$recipes = $this->Database->recipes();
|
|
||||||
$mealPlanDayRecipes = $this->Database->recipes()->where('type', 'mealplan-day');
|
|
||||||
$titlePrefix = $this->LocalizationService->__t('Meal plan recipe') . ': ';
|
|
||||||
$mealPlanRecipeEvents = array();
|
$mealPlanRecipeEvents = array();
|
||||||
foreach($mealPlanDayRecipes as $mealPlanDayRecipe)
|
if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
|
||||||
{
|
{
|
||||||
$recipesOfCurrentDay = $this->Database->recipes_nestings_resolved()->where('recipe_id = :1 AND includes_recipe_id != :1', $mealPlanDayRecipe->id);
|
$recipes = $this->Database->recipes();
|
||||||
foreach ($recipesOfCurrentDay as $recipeOfCurrentDay)
|
$mealPlanDayRecipes = $this->Database->recipes()->where('type', 'mealplan-day');
|
||||||
|
$titlePrefix = $this->LocalizationService->__t('Meal plan recipe') . ': ';
|
||||||
|
|
||||||
|
foreach($mealPlanDayRecipes as $mealPlanDayRecipe)
|
||||||
{
|
{
|
||||||
$mealPlanRecipeEvents[] = array(
|
$recipesOfCurrentDay = $this->Database->recipes_nestings_resolved()->where('recipe_id = :1 AND includes_recipe_id != :1', $mealPlanDayRecipe->id);
|
||||||
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name,
|
foreach ($recipesOfCurrentDay as $recipeOfCurrentDay)
|
||||||
'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name,
|
{
|
||||||
'date_format' => 'date',
|
$mealPlanRecipeEvents[] = array(
|
||||||
'description' => $this->UrlManager->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name)
|
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name,
|
||||||
|
'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name,
|
||||||
|
'date_format' => 'date',
|
||||||
|
'description' => $this->UrlManager->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mealPlanDayNotes = $this->Database->meal_plan()->where('type', 'note');
|
||||||
|
$titlePrefix = $this->LocalizationService->__t('Meal plan note') . ': ';
|
||||||
|
$mealPlanNotesEvents = array();
|
||||||
|
foreach($mealPlanDayNotes as $mealPlanDayNote)
|
||||||
|
{
|
||||||
|
$mealPlanNotesEvents[] = array(
|
||||||
|
'title' => $titlePrefix . $mealPlanDayNote->note,
|
||||||
|
'start' => $mealPlanDayNote->day,
|
||||||
|
'date_format' => 'date'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$mealPlanDayNotes = $this->Database->meal_plan()->where('type', 'note');
|
$products = $this->Database->products();
|
||||||
$titlePrefix = $this->LocalizationService->__t('Meal plan note') . ': ';
|
$mealPlanDayProducts = $this->Database->meal_plan()->where('type', 'product');
|
||||||
$mealPlanNotesEvents = array();
|
$titlePrefix = $this->LocalizationService->__t('Meal plan product') . ': ';
|
||||||
foreach($mealPlanDayNotes as $mealPlanDayNote)
|
$mealPlanProductEvents = array();
|
||||||
{
|
foreach($mealPlanDayProducts as $mealPlanDayProduct)
|
||||||
$mealPlanNotesEvents[] = array(
|
{
|
||||||
'title' => $titlePrefix . $mealPlanDayNote->note,
|
$mealPlanProductEvents[] = array(
|
||||||
'start' => $mealPlanDayNote->day,
|
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($products, 'id', $mealPlanDayProduct->product_id)->name,
|
||||||
'date_format' => 'date'
|
'start' => $mealPlanDayProduct->day,
|
||||||
);
|
'date_format' => 'date'
|
||||||
}
|
);
|
||||||
|
}
|
||||||
$products = $this->Database->products();
|
|
||||||
$mealPlanDayProducts = $this->Database->meal_plan()->where('type', 'product');
|
|
||||||
$titlePrefix = $this->LocalizationService->__t('Meal plan product') . ': ';
|
|
||||||
$mealPlanProductEvents = array();
|
|
||||||
foreach($mealPlanDayProducts as $mealPlanDayProduct)
|
|
||||||
{
|
|
||||||
$mealPlanProductEvents[] = array(
|
|
||||||
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($products, 'id', $mealPlanDayProduct->product_id)->name,
|
|
||||||
'start' => $mealPlanDayProduct->day,
|
|
||||||
'date_format' => 'date'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($stockEvents, $taskEvents, $choreEvents, $batteryEvents, $mealPlanRecipeEvents, $mealPlanNotesEvents, $mealPlanProductEvents);
|
return array_merge($stockEvents, $taskEvents, $choreEvents, $batteryEvents, $mealPlanRecipeEvents, $mealPlanNotesEvents, $mealPlanProductEvents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user