diff --git a/admin-dev/themes/template/header.tpl b/admin-dev/themes/template/header.tpl index ac397ab5a..63244c32b 100644 --- a/admin-dev/themes/template/header.tpl +++ b/admin-dev/themes/template/header.tpl @@ -29,36 +29,38 @@ {$meta_title} - PrestaShop™ - + {* Notifications vars *} + var autorefresh_notifications = '{$autorefresh_notifications}'; + var new_order_msg = '{l s='A new order has been made on your shop.'}'; + var order_number_msg = '{l s='Order number : '}'; + var total_msg = '{l s='Total : '}'; + var from_msg = '{l s='From : '}'; + var see_order_msg = '{l s='Click here to see that order'}'; + var new_customer_msg = '{l s='A new customer registered on your shop.'}'; + var customer_name_msg = '{l s='Customer name : '}'; + var see_customer_msg = '{l s='Click here to see that customer'}'; + var new_msg = '{l s='A new message posted on your shop.'}'; + var excerpt_msg = '{l s='Excerpt : '}'; + var see_msg = '{l s='Click here to see that message'}'; + var token_admin_orders = '{getAdminToken tab='AdminOrders'}'; + var token_admin_customers = '{getAdminToken tab='AdminCustomers'}'; + + {/if} {if isset($css_files)} {foreach from=$css_files key=css_uri item=media} @@ -70,23 +72,25 @@ {/foreach} {/if} - - - - {$HOOK_HEADER} + + {/if} + {if $display_header} + {$HOOK_HEADER} + {/if} @@ -95,56 +99,6 @@ color:{$brightness} } - - - {if $display_header} @@ -266,13 +220,13 @@ $(document).ready(function() {/if}
- {if $install_dir_exists} + {if $display_header && $install_dir_exists}
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
{/if} - {if $is_multishop && $shop_context != 'all'} + {if $display_header && $is_multishop && $shop_context != 'all'}
{if $shop_context == 'group'} {l s='You are configuring your store for group shop '}{$group_shop->name} diff --git a/js/notifications.js b/js/notifications.js index 8f6bd353b..94bd68ffc 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -1,3 +1,50 @@ +$(document).ready(function() +{ + var hints = $('.translatable span.hint'); + if (youEditFieldFor) + { + hints.html(hints.html() + '
' + youEditFieldFor + ''); + } + var html = ""; + var nb_notifs = 0; + var wrapper_id = ""; + var type = new Array(); + + $(".notifs").live("click", function(){ + // Add class "open_notifs" to the clicked notification, remove the class from other notificationqs + $('.notifs').removeClass('open_notifs'); + $(this).addClass('open_notifs'); + + wrapper_id = $(this).attr("id"); + type = wrapper_id.split("s_notif") + $.post("ajax.php", + { + "updateElementEmployee" : "1", "updateElementEmployeeType" : type[0] + }, function(data) { + if(data) + { + if(!$("#" + wrapper_id + "_wrapper").is(":visible")) + { + $(".notifs_wrapper").hide(); + $("#" + wrapper_id + "_number_wrapper").hide(); + $("#" + wrapper_id + "_wrapper").show(); + }else + { + $("#" + wrapper_id + "_wrapper").hide(); + } + } + }); + }); + + $("#main").click(function(){ + $(".notifs_wrapper").hide(); + $('.notifs').removeClass('open_notifs'); + }); + + // call it once immediately, then use setTimeout if refresh is activated + getPush(autorefresh_notifications); +}); + function getPush(refresh) { $.post("ajax.php",{"getNotifications" : "1"}, function(data) {