Changelog/little naming changes/fixes/new translations strings for #1056

This commit is contained in:
Bernd Bestel 2020-10-17 11:03:47 +02:00
parent cd65195532
commit e24f3143b5
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
7 changed files with 98 additions and 95 deletions

View File

@ -32,6 +32,7 @@
- Product edit page improvements ("Save & continue" button, deleting and adding a product picuture is now possible in one go) (thanks @Ma27) - Product edit page improvements ("Save & continue" button, deleting and adding a product picuture is now possible in one go) (thanks @Ma27)
- For products with tare weight handling enabled, it's now optionally possible to consume a fixed/exact amount (just like for "normal" products) in case you don't want to weigh the whole container this time (new checkbox on the consume page) (thanks @fipwmaqzufheoxq92ebc) - For products with tare weight handling enabled, it's now optionally possible to consume a fixed/exact amount (just like for "normal" products) in case you don't want to weigh the whole container this time (new checkbox on the consume page) (thanks @fipwmaqzufheoxq92ebc)
- The stock overview page now also shows the value - new column and also the total value in the header (thanks @kriddles) - The stock overview page now also shows the value - new column and also the total value in the header (thanks @kriddles)
- It's now possible to set a custom purchased date on purchase (new field on the purchase page, hidden by default - enable it by a new stock setting (top right corner settings menu)) (thanks @kriddles)
- Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB` - Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB`
- Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu) - Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu)
- Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles) - Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles)

View File

@ -1,110 +1,108 @@
<?php <?php
# Settings can also be overwritten in two ways // Settings can also be overwritten in two ways
# //
# First priority // First priority
# A .txt file with the same name as the setting in /data/settingoverrides // A .txt file with the same name as the setting in /data/settingoverrides
# the content of the file is used as the setting value // the content of the file is used as the setting value
# //
# Second priority // Second priority
# An environment variable with the same name as the setting and prefix "GROCY_" // An environment variable with the same name as the setting and prefix "GROCY_"
# so for example "GROCY_BASE_URL" // so for example "GROCY_BASE_URL"
# //
# Third priority // Third priority
# The settings defined here below // The settings defined here below
// Either "production", "dev", "demo" or "prerelease"
# Either "production", "dev", "demo" or "prerelease" // When not "production", authentication will be disabled and
# When not "production", authentication will be disabled and // demo data will be populated during database migrations
# demo data will be populated during database migrations
Setting('MODE', 'production'); Setting('MODE', 'production');
# Either "en" or "de" or the directory name of // Either "en" or "de" or the directory name of
# one of the other available localization folders in the "/localization" directory // one of the other available localization folders in the "/localization" directory
Setting('DEFAULT_LOCALE', 'en'); Setting('DEFAULT_LOCALE', 'en');
# This is used to define the first day of a week for calendar views in the frontend, // This is used to define the first day of a week for calendar views in the frontend,
# leave empty to use the locale default // leave empty to use the locale default
# Needs to be a number where Sunday = 0, Monday = 1 and so forth // Needs to be a number where Sunday = 0, Monday = 1 and so forth
Setting('CALENDAR_FIRST_DAY_OF_WEEK', ''); Setting('CALENDAR_FIRST_DAY_OF_WEEK', '');
# If calendars should show week numbers // If calendars should show week numbers
Setting('CALENDAR_SHOW_WEEK_OF_YEAR', true); Setting('CALENDAR_SHOW_WEEK_OF_YEAR', true);
# To keep it simple: grocy does not handle any currency conversions, // To keep it simple: grocy does not handle any currency conversions,
# this here is used to format all money values, // this here is used to format all money values,
# so doesn't really matter, but should be the // so doesn't really matter, but should be the
# ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.) // ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.)
Setting('CURRENCY', 'USD'); Setting('CURRENCY', 'USD');
# When running grocy in a subdirectory, this should be set to the relative path, otherwise empty // When running grocy in a subdirectory, this should be set to the relative path, otherwise empty
# Example: // Example:
# Webserver root directory = /var/www // Webserver root directory = /var/www
# grocy directory = /var/www/grocy // grocy directory = /var/www/grocy
# => BASE_PATH = /grocy // => BASE_PATH = /grocy
Setting('BASE_PATH', ''); Setting('BASE_PATH', '');
# The base url of your installation, // The base url of your installation,
# should be just "/" when running directly under the root of a (sub)domain // should be just "/" when running directly under the root of a (sub)domain
# or for example "https://example.com/grocy" when using a subdirectory // or for example "https://example.com/grocy" when using a subdirectory
Setting('BASE_URL', '/'); Setting('BASE_URL', '/');
# The plugin to use for external barcode lookups, // The plugin to use for external barcode lookups,
# must be the filename without .php extension and must be located in /data/plugins, // must be the filename without .php extension and must be located in /data/plugins,
# see /data/plugins/DemoBarcodeLookupPlugin.php for an example implementation // see /data/plugins/DemoBarcodeLookupPlugin.php for an example implementation
Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin'); Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin');
# If, however, your webserver does not support URL rewriting, set this to true // If, however, your webserver does not support URL rewriting, set this to true
Setting('DISABLE_URL_REWRITING', false); Setting('DISABLE_URL_REWRITING', false);
# Specify an custom homepage if desired - by default the homepage will be set to the stock overview, // 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: // this needs to be one of the following values:
# stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan // stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan
Setting('ENTRY_PAGE', 'stock'); Setting('ENTRY_PAGE', 'stock');
# Set this to true if you want to disable authentication / the login screen, // Set this to true if you want to disable authentication / the login screen,
# places where user context is needed will then use the default (first existing) user // places where user context is needed will then use the default (first existing) user
Setting('DISABLE_AUTH', false); Setting('DISABLE_AUTH', false);
# Either "Grocy\Middleware\DefaultAuthMiddleware", "Grocy\Middleware\ReverseProxyAuthMiddleware" // Either "Grocy\Middleware\DefaultAuthMiddleware", "Grocy\Middleware\ReverseProxyAuthMiddleware"
# or any class that implements Grocy\Middleware\AuthMiddleware // or any class that implements Grocy\Middleware\AuthMiddleware
Setting('AUTH_CLASS', 'Grocy\Middleware\DefaultAuthMiddleware'); Setting('AUTH_CLASS', 'Grocy\Middleware\DefaultAuthMiddleware');
# When using ReverseProxyAuthMiddleware, // When using ReverseProxyAuthMiddleware,
# the name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication) // the name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication)
Setting('REVERSE_PROXY_AUTH_HEADER', 'REMOTE_USER'); Setting('REVERSE_PROXY_AUTH_HEADER', 'REMOTE_USER');
# Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API) // Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API)
Setting('DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false); Setting('DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false);
# Set this if you want to have a different start day for the weekly meal plan view, // Set this if you want to have a different start day for the weekly meal plan view,
# leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above) // leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above)
# Needs to be a number where Sunday = 0, Monday = 1 and so forth // Needs to be a number where Sunday = 0, Monday = 1 and so forth
Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', ''); Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', '');
# Default permissions for new users // Default permissions for new users
# the array needs to contain the technical/constant names // the array needs to contain the technical/constant names
# see the file controllers/Users/User.php for possible values // see the file controllers/Users/User.php for possible values
Setting('DEFAULT_PERMISSIONS', ['ADMIN']); Setting('DEFAULT_PERMISSIONS', ['ADMIN']);
// Default user settings
// These settings can be changed per user, here the defaults
// are defined which are used when the user has not changed the setting so far
# Default user settings // Night mode related
# These settings can be changed per user, here the defaults
# are defined which are used when the user has not changed the setting so far
# Night mode related
DefaultUserSetting('night_mode_enabled', false); // If night mode is enabled always DefaultUserSetting('night_mode_enabled', false); // If night mode is enabled always
DefaultUserSetting('auto_night_mode_enabled', false); // If night mode is enabled automatically when inside a given time range (see the two settings below) DefaultUserSetting('auto_night_mode_enabled', false); // If night mode is enabled automatically when inside a given time range (see the two settings below)
DefaultUserSetting('auto_night_mode_time_range_from', "20:00"); // Format HH:mm DefaultUserSetting('auto_night_mode_time_range_from', '20:00'); // Format HH:mm
DefaultUserSetting('auto_night_mode_time_range_to', "07:00"); // Format HH:mm DefaultUserSetting('auto_night_mode_time_range_to', '07:00'); // Format HH:mm
DefaultUserSetting('auto_night_mode_time_range_goes_over_midnight', true); // If the time range above goes over midnight DefaultUserSetting('auto_night_mode_time_range_goes_over_midnight', true); // If the time range above goes over midnight
DefaultUserSetting('currently_inside_night_mode_range', false); // If we're currently inside of night mode time range (this is not user configurable, but stored as a user setting because it's evaluated client side to be able to use the client time instead of the maybe different server time) DefaultUserSetting('currently_inside_night_mode_range', false); // If we're currently inside of night mode time range (this is not user configurable, but stored as a user setting because it's evaluated client side to be able to use the client time instead of the maybe different server time)
# Keep screen on settings // Keep screen on settings
DefaultUserSetting('keep_screen_on', false); // Keep the screen always on DefaultUserSetting('keep_screen_on', false); // Keep the screen always on
DefaultUserSetting('keep_screen_on_when_fullscreen_card', false); // Keep the screen on when a "fullscreen-card" is displayed DefaultUserSetting('keep_screen_on_when_fullscreen_card', false); // Keep the screen on when a "fullscreen-card" is displayed
# Stock settings // Stock settings
DefaultUserSetting('product_presets_location_id', -1); // Default location id for new products (-1 means no location is preset) DefaultUserSetting('product_presets_location_id', -1); // Default location id for new products (-1 means no location is preset)
DefaultUserSetting('product_presets_product_group_id', -1); // Default product group id for new products (-1 means no product group is preset) DefaultUserSetting('product_presets_product_group_id', -1); // Default product group id for new products (-1 means no product group is preset)
DefaultUserSetting('product_presets_qu_id', -1); // Default quantity unit id for new products (-1 means no quantity unit is preset) DefaultUserSetting('product_presets_qu_id', -1); // Default quantity unit id for new products (-1 means no quantity unit is preset)
@ -114,46 +112,46 @@ DefaultUserSetting('stock_default_consume_amount', 1);
DefaultUserSetting('scan_mode_consume_enabled', false); DefaultUserSetting('scan_mode_consume_enabled', false);
DefaultUserSetting('scan_mode_purchase_enabled', false); DefaultUserSetting('scan_mode_purchase_enabled', false);
DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true); DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true);
DefaultUserSetting('product_display_purchased_date', false); DefaultUserSetting('show_purchased_date_on_purchase', false); // Wheter the purchased date should be editable on purchase (defaults to today otherwise)
# Shopping list settings // Shopping list settings
DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set
DefaultUserSetting('shopping_list_show_calendar', false); DefaultUserSetting('shopping_list_show_calendar', false);
DefaultUserSetting('shopping_list_disable_auto_compact_view_on_mobile', false); DefaultUserSetting('shopping_list_disable_auto_compact_view_on_mobile', false);
# Recipe settings // Recipe settings
DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group
# Chores settings // Chores settings
DefaultUserSetting('chores_due_soon_days', 5); DefaultUserSetting('chores_due_soon_days', 5);
# Batteries settings // Batteries settings
DefaultUserSetting('batteries_due_soon_days', 5); DefaultUserSetting('batteries_due_soon_days', 5);
# Tasks settings // Tasks settings
DefaultUserSetting('tasks_due_soon_days', 5); DefaultUserSetting('tasks_due_soon_days', 5);
# If the page should be automatically reloaded when there was // If the page should be automatically reloaded when there was
# an external change // an external change
DefaultUserSetting('auto_reload_on_db_change', true); DefaultUserSetting('auto_reload_on_db_change', true);
# Show a clock in the header next to the logo or not // Show a clock in the header next to the logo or not
DefaultUserSetting('show_clock_in_header', false); DefaultUserSetting('show_clock_in_header', false);
# Component configuration for Quagga2 - read https://github.com/ericblade/quagga2#configobject for details // Component configuration for Quagga2 - read https://github.com/ericblade/quagga2#configobject for details
# Below is a generic good configuration, // Below is a generic good configuration,
# for an iPhone 7 Plus, halfsample = true, patchsize = small, frequency = 5 yields very good results // for an iPhone 7 Plus, halfsample = true, patchsize = small, frequency = 5 yields very good results
DefaultUserSetting('quagga2_numofworkers', 4); DefaultUserSetting('quagga2_numofworkers', 4);
DefaultUserSetting('quagga2_halfsample', false); DefaultUserSetting('quagga2_halfsample', false);
DefaultUserSetting('quagga2_patchsize', 'medium'); DefaultUserSetting('quagga2_patchsize', 'medium');
DefaultUserSetting('quagga2_frequency', 10); DefaultUserSetting('quagga2_frequency', 10);
DefaultUserSetting('quagga2_debug', true); DefaultUserSetting('quagga2_debug', true);
# Feature flags // Feature flags
# grocy was initially about "stock management for your household", many other things // grocy was initially about "stock management for your household", many other things
# came and still come by, because they are useful - here you can disable the parts // came and still come by, because they are useful - here you can disable the parts
# which you don't need to have a less cluttered UI // which you don't need to have a less cluttered UI
# (set the setting to "false" to disable the corresponding part, which should be self explanatory) // (set the setting to "false" to disable the corresponding part, which should be self explanatory)
Setting('FEATURE_FLAG_STOCK', true); Setting('FEATURE_FLAG_STOCK', true);
Setting('FEATURE_FLAG_SHOPPINGLIST', true); Setting('FEATURE_FLAG_SHOPPINGLIST', true);
Setting('FEATURE_FLAG_RECIPES', true); Setting('FEATURE_FLAG_RECIPES', true);
@ -163,8 +161,7 @@ Setting('FEATURE_FLAG_BATTERIES', true);
Setting('FEATURE_FLAG_EQUIPMENT', true); Setting('FEATURE_FLAG_EQUIPMENT', true);
Setting('FEATURE_FLAG_CALENDAR', true); Setting('FEATURE_FLAG_CALENDAR', true);
// Sub feature flags
# Sub feature flags
Setting('FEATURE_FLAG_STOCK_PRICE_TRACKING', true); Setting('FEATURE_FLAG_STOCK_PRICE_TRACKING', true);
Setting('FEATURE_FLAG_STOCK_LOCATION_TRACKING', true); Setting('FEATURE_FLAG_STOCK_LOCATION_TRACKING', true);
Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING', true); Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING', true);
@ -174,7 +171,6 @@ Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD', true); // Activa
Setting('FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS', true); Setting('FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS', true);
Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true); Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true);
// Feature settings
# Feature settings
Setting('FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT', true); // When set to true opened items will be counted as missing from stock when calculating if a product is below its minimum. Setting('FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT', true); // When set to true opened items will be counted as missing from stock when calculating if a product is below its minimum.
Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automaticaly in every camera barcode scanner. Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automaticaly in every camera barcode scanner.

View File

@ -1921,3 +1921,6 @@ msgstr ""
msgid "%s total value" msgid "%s total value"
msgstr "" msgstr ""
msgid "Show purchased date on purchase form (otherwise the purchased date defaults to today)"
msgstr ""

View File

@ -29,7 +29,12 @@
var jsonData = {}; var jsonData = {};
jsonData.amount = amount; jsonData.amount = amount;
if (Grocy.UserSettings.show_purchased_date_on_purchase)
{
jsonData.purchased_date = Grocy.Components.DateTimePicker2.GetValue(); jsonData.purchased_date = Grocy.Components.DateTimePicker2.GetValue();
}
if (Grocy.Components.DateTimePicker) if (Grocy.Components.DateTimePicker)
{ {
jsonData.best_before_date = Grocy.Components.DateTimePicker.GetValue(); jsonData.best_before_date = Grocy.Components.DateTimePicker.GetValue();

View File

@ -9,7 +9,7 @@ if (BoolVal(Grocy.UserSettings.show_icon_on_stock_overview_page_when_product_is_
{ {
$("#show_icon_on_stock_overview_page_when_product_is_on_shopping_list").prop("checked", true); $("#show_icon_on_stock_overview_page_when_product_is_on_shopping_list").prop("checked", true);
} }
if (BoolVal(Grocy.UserSettings.product_display_purchased_date)) if (BoolVal(Grocy.UserSettings.show_purchased_date_on_purchase))
{ {
$("#product_display_purchased_date").prop("checked", true); $("#show_purchased_date_on_purchase").prop("checked", true);
} }

View File

@ -53,7 +53,7 @@
class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>' class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
)) ))
@if(boolval($userSettings['product_display_purchased_date'])) @if(boolval($userSettings['show_purchased_date_on_purchase']))
@include('components.datetimepicker2', array( @include('components.datetimepicker2', array(
'id' => 'purchased_date', 'id' => 'purchased_date',
'label' => 'Purchased date', 'label' => 'Purchased date',
@ -61,11 +61,9 @@
'initWithNow' => true, 'initWithNow' => true,
'limitEndToNow' => false, 'limitEndToNow' => false,
'limitStartToNow' => false, 'limitStartToNow' => false,
'invalidFeedback' => $__t('A purchase date is required'), 'invalidFeedback' => $__t('A purchased date is required'),
'nextInputSelector' => '#best_before_date', 'nextInputSelector' => '#best_before_date',
'additionalCssClasses' => 'date-only-datetimepicker2', 'additionalCssClasses' => 'date-only-datetimepicker2',
'earlierThanInfoLimit' => date('Y-m-d'),
'earlierThanInfoText' => $__t('The given date is earlier than today, are you sure?'),
'additionalGroupCssClasses' => $additionalGroupCssClasses, 'additionalGroupCssClasses' => $additionalGroupCssClasses,
'activateNumberPad' => GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD 'activateNumberPad' => GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD
)) ))

View File

@ -95,11 +95,11 @@
</label> </label>
</div> </div>
<div class="checkbox"> <div class="checkbox">
<label for="product_display_purchased_date"> <label for="show_purchased_date_on_purchase">
<input type="checkbox" <input type="checkbox"
class="user-setting-control" class="user-setting-control"
id="product_display_purchased_date" id="show_purchased_date_on_purchase"
data-setting-key="product_display_purchased_date"> {{ $__t('Show purchased date on product purchase form to allow editing from default todays date') }} data-setting-key="show_purchased_date_on_purchase"> {{ $__t('Show purchased date on purchase form (otherwise the purchased date defaults to today)') }}
</label> </label>
</div> </div>
</div> </div>