Miglioramento grafico hook

This commit is contained in:
Thomas Zilio 2019-05-24 11:15:05 -07:00
parent 9b66644273
commit dcbb0627b1
4 changed files with 21 additions and 30 deletions

View File

@ -238,7 +238,8 @@ if (Auth::check()) {
<i class="fa fa-bell-o"></i>
<span class="label label-warning">
<span id="hooks-loading"><i class="fa fa-spinner fa-spin"></i></span>
<span id="hooks-count"></span>
<span id="hooks-number"></span>
<span id="hooks-counter" class="hide">0</span>
</span>
</a>
<ul class="dropdown-menu">

View File

@ -1538,8 +1538,8 @@ function executeHook(hook, length){
notification = '<li class="hook-element"><a href="' + (result.link ? result.link : "#") + '"><i class="' + result.icon + '"></i><span class="small" > ' + result.message + '</span></a></li>';
// Inserimento della notifica
hooks_count = $("#hooks-count");
number = parseInt(hooks_count.text());
hooks_number = $("#hooks-number");
number = parseInt(hooks_number.text());
number = isNaN(number) ? 0 : number;
if(result.notify) {
@ -1547,13 +1547,19 @@ function executeHook(hook, length){
$("#hooks").prepend(notification);
} else {
$("#hooks").append(notification);
//$("#hooks").append(notification);
}
hooks_count.text(number);
hooks_number.text(number);
// Contatore dell'esecuzione degli hook
hooks_counter = $("#hooks-counter");
counter = parseInt(hooks_counter.text());
counter++;
hooks_counter.text(counter);
// Rimozione eventuale della rotella di caricamento
if($(".hook-element").length == hooks.length) {
if(counter == hooks.length) {
$("#hooks-loading").hide();
if (number > 1){

View File

@ -24,21 +24,13 @@ class InvoiceHook extends HookManager
});
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
$icon = 'fa fa-file-text-o';
if ($count > 0) {
$message = tr('Ci sono _NUM_ fatture passive da importare', [
'_NUM_' => $count,
]);
$icon_color = 'text-yellow';
} else {
$message = tr('Nessuna fattura passiva da importare');
$icon_color = 'text-green';
$link = '#';
}
$message = tr('Ci sono _NUM_ fatture passive da importare', [
'_NUM_' => $count,
]);
return [
'icon' => $icon.' '.$icon_color,
'icon' => 'fa fa-file-text-o text-yellow',
'link' => $link,
'message' => $message,
'notify' => !empty($count),

View File

@ -24,21 +24,13 @@ class ReceiptHook extends HookManager
});
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
$icon = 'fa fa-ticket';
if ($count > 0) {
$message = tr('Ci sono _NUM_ ricevute da importare', [
'_NUM_' => $count,
]);
$icon_color = 'fa fa-ticket text-yellow';
} else {
$message = tr('Nessuna ricevuta da importare');
$icon_color = 'fa fa-ticket text-green';
$link = '#';
}
$message = tr('Ci sono _NUM_ ricevute da importare', [
'_NUM_' => $count,
]);
return [
'icon' => $icon.' '.$icon_color,
'icon' => 'fa fa-ticket text-yellow',
'link' => $link,
'message' => $message,
'notify' => !empty($count),