mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
Review
- Default FEATURE_FLAG_THERMAL_PRINTER to disabled - Added missing localization strings (and slightly adjusted one)
This commit is contained in:
parent
2b0bbc34c0
commit
f6e3546d3f
|
|
@ -198,7 +198,7 @@ Setting('FEATURE_FLAG_STOCK_PRODUCT_FREEZING', true);
|
|||
Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD', true); // Activate the number pad in due date fields on (supported) mobile browsers
|
||||
Setting('FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS', true);
|
||||
Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true);
|
||||
Setting('FEATURE_FLAG_THERMAL_PRINTER', true);
|
||||
Setting('FEATURE_FLAG_THERMAL_PRINTER', false);
|
||||
|
||||
// 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 for calculating if a product is below its minimum stock amount
|
||||
|
|
|
|||
|
|
@ -2077,3 +2077,15 @@ msgstr ""
|
|||
|
||||
msgid "A product or a note is required"
|
||||
msgstr ""
|
||||
|
||||
msgid "Thermal printer"
|
||||
msgstr ""
|
||||
|
||||
msgid "Printing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Connecting to printer..."
|
||||
msgstr ""
|
||||
|
||||
msgid "Unable to print"
|
||||
msgstr ""
|
||||
|
|
|
|||
|
|
@ -433,14 +433,16 @@ $(document).on("click", "#print-shopping-list-button", function(e)
|
|||
cancel: {
|
||||
label: __t('Cancel'),
|
||||
className: 'btn-secondary',
|
||||
callback: function () {
|
||||
callback: function()
|
||||
{
|
||||
bootbox.hideAll();
|
||||
}
|
||||
},
|
||||
printtp: {
|
||||
label: __t('Thermal printer'),
|
||||
className: 'btn-secondary',
|
||||
callback: function () {
|
||||
callback: function()
|
||||
{
|
||||
bootbox.hideAll();
|
||||
var printHeader = $("#print-show-header").prop("checked");
|
||||
var thermalPrintDialog = bootbox.dialog({
|
||||
|
|
@ -448,14 +450,14 @@ $(document).on("click", "#print-shopping-list-button", function(e)
|
|||
message: '<p><i class="fa fa-spin fa-spinner"></i> ' + __t('Connecting to printer...') + '</p>'
|
||||
});
|
||||
//Delaying for one second so that the alert can be closed
|
||||
setTimeout(function ()
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Api.Get('print/shoppinglist/thermal?list=' + $("#selected-shopping-list").val() + '&printHeader=' + printHeader,
|
||||
function (result)
|
||||
function(result)
|
||||
{
|
||||
bootbox.hideAll();
|
||||
},
|
||||
function (xhr)
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
var validResponse = true;
|
||||
|
|
@ -468,9 +470,10 @@ $(document).on("click", "#print-shopping-list-button", function(e)
|
|||
}
|
||||
if (validResponse)
|
||||
{
|
||||
thermalPrintDialog.find('.bootbox-body').html(__t('Unable to print: ') + jsonError.error_message);
|
||||
} else {
|
||||
thermalPrintDialog.find('.bootbox-body').html(__t('Unable to print: ') + xhr.responseText);
|
||||
thermalPrintDialog.find('.bootbox-body').html(__t('Unable to print') + '<br><pre><code>' + jsonError.error_message + '</pre></code>');
|
||||
} else
|
||||
{
|
||||
thermalPrintDialog.find('.bootbox-body').html(__t('Unable to print') + '<br><pre><code>' + xhr.responseText + '</pre></code>');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -480,29 +483,32 @@ $(document).on("click", "#print-shopping-list-button", function(e)
|
|||
ok: {
|
||||
label: __t('Print'),
|
||||
className: 'btn-primary responsive-button',
|
||||
callback: function ()
|
||||
callback: function()
|
||||
{
|
||||
bootbox.hideAll();
|
||||
$('.modal-backdrop').remove();
|
||||
$(".print-timestamp").text(moment().format("l LT"));
|
||||
|
||||
$("#description-for-print").html($("#description").val());
|
||||
if ($("#description").text().isEmpty()) {
|
||||
if ($("#description").text().isEmpty())
|
||||
{
|
||||
$("#description-for-print").parent().addClass("d-print-none");
|
||||
}
|
||||
|
||||
if (!$("#print-show-header").prop("checked")) {
|
||||
if (!$("#print-show-header").prop("checked"))
|
||||
{
|
||||
$("#print-header").addClass("d-none");
|
||||
}
|
||||
|
||||
if (!$("#print-group-by-product-group").prop("checked")) {
|
||||
if (!$("#print-group-by-product-group").prop("checked"))
|
||||
{
|
||||
shoppingListPrintShadowTable.rowGroup().enable(false);
|
||||
shoppingListPrintShadowTable.order.fixed({});
|
||||
shoppingListPrintShadowTable.draw();
|
||||
}
|
||||
|
||||
$(".print-layout-container").addClass("d-none");
|
||||
$("." + $("input[name='print-layout-type']:checked").val()).removeClass("d-none");
|
||||
$(".print-layout-container").addClass("d-none");
|
||||
$("." + $("input[name='print-layout-type']:checked").val()).removeClass("d-none");
|
||||
|
||||
window.print();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user