added: progress bar (image) to tickets table
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@620 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user