From 62a0e52092da436fc84fcb66d57ef6f15272ad96 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Mon, 5 Jul 2010 17:22:30 +0000 Subject: [PATCH] added: progress bar (image) to tickets table git-svn-id: svn://ttmath.org/publicrep/winix/trunk@620 e52654a7-88a9-db11-a3e9-0013d4bc506e --- html/fun_ticket.html | 14 ++++++++------ locale/en | 1 + locale/pl | 2 ++ static/layout1/winix.css | 25 +++++++++++++++++++++++++ templates/templates.cpp | 2 ++ templates/templates.h | 2 ++ templates/ticket.cpp | 30 ++++++++++++++++++++++++++++++ 7 files changed, 70 insertions(+), 6 deletions(-) diff --git a/html/fun_ticket.html b/html/fun_ticket.html index 3bfff7e..ff7565d 100755 --- a/html/fun_ticket.html +++ b/html/fun_ticket.html @@ -10,21 +10,23 @@ [if-one ticket_tab] - +
[if-any ticket_type_tab][end] [if-any ticket_status_tab][end] + [if-any ticket_priority_tab][end] [if-any ticket_expected_tab][end] [for ticket_tab] - - [if-any ticket_type_tab][end] - [if-any ticket_status_tab][end] - [if-any ticket_priority_tab][end] - [if-any ticket_expected_tab][end] + + [if-any ticket_type_tab][end] + [if-any ticket_status_tab][end] + + [if-any ticket_priority_tab][end] + [if-any ticket_expected_tab][end] [end]
{ticket_table_name}{ticket_table_type}{ticket_table_status}{ticket_info_progress}{ticket_table_priority}{ticket_table_expected}
[if-no ticket_tab_subject_empty][ticket_tab_subject][else]<[ticket_tab_url]>[else][ticket_tab_type][ticket_tab_status][ticket_tab_priority][ticket_tab_expected][if-no ticket_tab_subject_empty][ticket_tab_subject][else]<[ticket_tab_url]>[else][ticket_tab_type][ticket_tab_status]progress [ticket_tab_progress]%[ticket_tab_priority][ticket_tab_expected]
diff --git a/locale/en b/locale/en index 1950284..7131bd3 100755 --- a/locale/en +++ b/locale/en @@ -133,6 +133,7 @@ thread_table_replies = Rep. thread_table_last_post = Last post thread_reply_in_this_thread = Reply in this thread +ticket_progress_image_path = ticket_progress ticket_create_new = Create a new ticket ticket_table_name = Ticket ticket_table_type = Type diff --git a/locale/pl b/locale/pl index 97de25f..b9703a6 100755 --- a/locale/pl +++ b/locale/pl @@ -135,6 +135,7 @@ thread_table_replies = Odp. thread_table_last_post = Ostatni post thread_reply_in_this_thread = Odpowiedz w tym wątku +ticket_progress_image_path = ticket_progress ticket_create_new = Załóż nowe zgłoszenie ticket_table_name = Zgłoszenie ticket_table_type = Rodzaj @@ -142,6 +143,7 @@ ticket_table_status = Status ticket_table_priority = Priorytet ticket_table_expected = Oczeki-
wany w + ticket_info_type = Rodzaj zgłoszenia ticket_info_status = Status ticket_info_priority = Piorytet diff --git a/static/layout1/winix.css b/static/layout1/winix.css index e93ec15..cfde951 100755 --- a/static/layout1/winix.css +++ b/static/layout1/winix.css @@ -617,6 +617,31 @@ font-size: 0.7em; } +table.tickettab { +border: 1px solid #D1D1E1; +} + + +table.tickettab th { +font-weight: bold; +} + + +table.tickettab th, table.tickettab td { +text-align: center; +border: 0; +font-size: 0.7em; +border: 1px solid #D1D1E1; +vertical-align: middle; +} + +table.tickettab td.tickettabtitle { +font-size: 1em; +text-align: left; +} + + + table.ticket { margin: 1em 0 1em 0; } diff --git a/templates/templates.cpp b/templates/templates.cpp index b5315bd..37c7c47 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -379,6 +379,7 @@ void Templates::CreateFunctions() functions.Insert("ticket_category", ticket_category); functions.Insert("ticket_expected", ticket_expected); functions.Insert("ticket_progress", ticket_progress); + functions.Insert("ticket_progress_image_number", ticket_progress_image_number); functions.Insert("ticket_tab", ticket_tab); functions.Insert("ticket_tab_url", ticket_tab_url); @@ -391,6 +392,7 @@ void Templates::CreateFunctions() functions.Insert("ticket_tab_category", ticket_tab_category); functions.Insert("ticket_tab_expected", ticket_tab_expected); functions.Insert("ticket_tab_progress", ticket_tab_progress); + functions.Insert("ticket_tab_progress_image_number",ticket_tab_progress_image_number); functions.Insert("ticket_type_tab", ticket_type_tab); functions.Insert("ticket_type_tab_defined", ticket_type_tab_defined); diff --git a/templates/templates.h b/templates/templates.h index 679b52d..776affe 100755 --- a/templates/templates.h +++ b/templates/templates.h @@ -284,6 +284,7 @@ namespace TemplatesFunctions void ticket_category(Info & i); void ticket_expected(Info & i); void ticket_progress(Info & i); + void ticket_progress_image_number(Info & i); void ticket_tab(Info & i); void ticket_tab_url(Info & i); @@ -296,6 +297,7 @@ namespace TemplatesFunctions void ticket_tab_category(Info & i); void ticket_tab_expected(Info & i); void ticket_tab_progress(Info & i); + void ticket_tab_progress_image_number(Info & i); void ticket_type_tab(Info & i); void ticket_type_tab_defined(Info & i); diff --git a/templates/ticket.cpp b/templates/ticket.cpp index bd5e1db..8b28c92 100755 --- a/templates/ticket.cpp +++ b/templates/ticket.cpp @@ -18,6 +18,21 @@ namespace TemplatesFunctions { +int ticket_calc_progress_image_number(int percent) +{ + percent = int( double(percent) / 10.0 + 0.5 ) * 10; + + if( percent < 0 ) + percent = 0; + + if( percent > 100 ) + percent = 100; + +return percent; +} + + + void ticket_is(Info & i) { i.res = request.is_ticket; @@ -80,6 +95,13 @@ void ticket_progress(Info & i) } +void ticket_progress_image_number(Info & i) +{ + int percent = request.ticket.progress; + i.out << ticket_calc_progress_image_number(percent); +} + + // -------------------------------------------------------------------------------- @@ -256,7 +278,14 @@ void ticket_tab_progress(Info & i) } +void ticket_tab_progress_image_number(Info & i) +{ + if( ticket_tab_index >= request.ticket_tab.size() ) + return; + int percent = request.ticket_tab[ticket_tab_index].progress; + i.out << ticket_calc_progress_image_number(percent); +} @@ -518,6 +547,7 @@ void ticket_expected_tab_name(Info & i) + } // namespace TemplatesFunctions