From 98395917e87ef0532893d6146e447d99daa6c056 Mon Sep 17 00:00:00 2001 From: bMancone Date: Mon, 2 Jan 2012 14:27:31 +0000 Subject: [PATCH] // Added warning for supply orders if there is not at least one warehouse --- .../themes/default/template/import/form.tpl | 27 +++++++++---------- .../admin/AdminSupplyOrdersController.php | 4 +++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/admin-dev/themes/default/template/import/form.tpl b/admin-dev/themes/default/template/import/form.tpl index 7ee5dc712..5196416fd 100644 --- a/admin-dev/themes/default/template/import/form.tpl +++ b/admin-dev/themes/default/template/import/form.tpl @@ -268,20 +268,19 @@ $(".import_products_categories").hide(); $("#entitie").html($("#entity > option:selected").text().toLowerCase()); - $.getJSON("ajax.php", - { - getAvailableFields:1, - entity: $("#entity").val() - }, - function(j) - { - var fields = ""; - $("#availableFields").empty(); - for (var i = 0; i < j.length; i++) - fields += j[i].field; - $("#availableFields").html(fields); - activeClueTip(); - }); + $.getJSON("ajax.php", { + getAvailableFields:1, + entity: $("#entity").val() + }, + function(j) { + var fields = ""; + $("#availableFields").empty(); + for (var i = 0; i < j.length; i++) + fields += j[i].field; + $("#availableFields").html(fields); + activeClueTip(); + } + ); }); diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 04967885a..c22ff586f 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -179,6 +179,10 @@ class AdminSupplyOrdersControllerCore extends AdminController //get warehouses list $warehouses = Warehouse::getWarehouses(true); + // displays warning if there are no warehouses + if (!$warehouses) + $this->displayWarning($this->l('You must have at least one warehouse. See Stock/Warehouses')); + //get currencies list $currencies = Currency::getCurrencies();