diff --git a/templates/backOffice/default/home.html b/templates/backOffice/default/home.html index 0204fe4c7..4eefb609a 100644 --- a/templates/backOffice/default/home.html +++ b/templates/backOffice/default/home.html @@ -8,6 +8,7 @@ {module_include location='home_top'} + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"}
@@ -36,57 +37,78 @@
- + {/loop}
-
-
-
{intl l="Shop Informations"}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
{intl l="Customers"} - {count type="customer" current="false" backend_context="1"} -
{intl l="Categories"} - {count type="category" visible="*" backend_context="1"} -
{intl l="Products"} - {count type="product" visible="*" backend_context="1"} -
{intl l="Online products"} - {count type="product" visible="true" backend_context="1"} -
{intl l="Offline products"} - {count type="product" visible="false" backend_context="1"} -
{intl l="Orders"} - {count type="order" status="*" backend_context="1"} -
-
-
-
+ {* Do not display shop information block if user none of the required authorizations *} + + {capture name="shop_information_block_content"} + {loop type="auth" name="can_view" role="ADMIN" resource="admin.customer" access="VIEW"} + + {intl l="Customers"} + + {count type="customer" current="false" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.category" access="VIEW"} + + {intl l="Categories"} + + {count type="category" visible="*" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.product" access="VIEW"} + + {intl l="Products"} + + {count type="product" visible="*" backend_context="1"} + + + + {intl l="Online products"} + + {count type="product" visible="true" backend_context="1"} + + + + {intl l="Offline products"} + + {count type="product" visible="false" backend_context="1"} + + + {/loop} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"} + + {intl l="Orders"} + + {count type="order" status="*" backend_context="1"} + + + {/loop} + {/capture} + + {if trim($smarty.capture.shop_information_block_content) ne ""} +
+
+
{intl l="Shop Informations"}
+
+ + + {$smarty.capture.shop_information_block_content nofilter} + +
+
+
+
+ {/if} + + {loop type="auth" name="can_view" role="ADMIN" resource="admin.order" access="VIEW"}
{intl l="Sales statistics"}
@@ -221,6 +243,7 @@
+ {/loop}
@@ -234,11 +257,11 @@ {intl l="Latest version available"} - V1.5.4.2 + {intl l="Loading..."} {intl l="News"} - {intl l="Click here"} + {intl l="Click here"} @@ -396,9 +419,14 @@ jQuery(function($){ }); } - {/literal} + // Get the latest Thelia version + $('#latest-thelia-version').load("{url path='/admin/latest-thelia-version'}", function(response, status, xhr) { + if (status == "error") + $('#latest-thelia-version').text("Unavailable"); + }); + });