diff --git a/admin/manage_categories.php b/admin/manage_categories.php index 725178ac..32c7b4a6 100644 --- a/admin/manage_categories.php +++ b/admin/manage_categories.php @@ -271,13 +271,12 @@ $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix'])
- | ' + places[this.place] + ' | '); - currentPlace = this.place; - addedElementToPlace = false; - first = true; - } - - var $template = $($('#nav-element-template').html()); + var $template = $($('#category-row-template').html()); $template.find('span[data-property="id"]').text(this.id).attr('data-value', this.id); - if (this.imageUrl === null) { - $template.find('span[data-property="image-or-font"]').html(''); + $template.find('span[data-property="category-name"]').text(this.name); + var $priority = $template.find('span[data-property="priority"]'); + if (this.priority === 0) { + // Critical + $priority.text(mfhLang.text('critical')).addClass('critical'); + } else if (this.priority === 1) { + // High + $priority.text(mfhLang.text('high')).addClass('important'); + } else if (this.priority === 2) { + // Medium + $priority.text(mfhLang.text('medium')).addClass('medium'); } else { - $template.find('span[data-property="image-or-font"]').text(this.imageUrl); + // Low + $priority.text(mfhLang.text('low')).addClass('normal'); + } + $template.find('a[data-property="number-of-tickets"]') + .text(this.numberOfTickets) + .attr('href', '#' + this.numberOfTickets); + var percentText = mfhLang.text('perat'); + var percentage = Math.round(this.numberOfTickets / totalNumberOfTickets * 100); + $template.find('div.progress').attr('title', percentText.replace('%s', percentage + '%')); + $template.find('div.progress-bar').attr('aria-value-now', percentage).css('width', percentage + '%'); + + if (this.usage === 1) { + // Tickets only + $template.find('.fa-calendar').removeClass('fa-calendar'); + } else if (this.usage === 2) { + // Events only + $template.find('.fa-ticket').removeClass('fa-ticket'); } - $template.find('span[data-property="url"]').text(this.url); - - var text = ''; - $.each(this.text, function(key, value) { - text += '
---|