the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
127
functions/readticket.cpp
Executable file
127
functions/readticket.cpp
Executable file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "readticket.h"
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
ReadTicket::ReadTicket()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketType()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("type", temp);
|
||||
ticket->type = atoi(temp.c_str());
|
||||
|
||||
if( ticket->type >= system->mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||
ticket->type = system->mounts.pmount->param[Mount::par_ticket_type].arg.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketStatus()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("status", temp);
|
||||
ticket->status = atoi(temp.c_str());
|
||||
|
||||
if( ticket->status >= system->mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||
ticket->status = system->mounts.pmount->param[Mount::par_ticket_status].arg.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketPriority()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("priority", temp);
|
||||
ticket->priority = atoi(temp.c_str());
|
||||
|
||||
if( ticket->priority >= system->mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||
ticket->priority = system->mounts.pmount->param[Mount::par_ticket_priority].arg.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketCategory()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("category", temp);
|
||||
ticket->category = atoi(temp.c_str());
|
||||
|
||||
if( ticket->category >= system->mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||
ticket->category = system->mounts.pmount->param[Mount::par_ticket_category].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketExpected()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("expected", temp);
|
||||
ticket->expected = atoi(temp.c_str());
|
||||
|
||||
if( ticket->expected >= system->mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||
ticket->expected = system->mounts.pmount->param[Mount::par_ticket_expected].arg.size();
|
||||
}
|
||||
|
||||
|
||||
void ReadTicket::ReadTicketProgress()
|
||||
{
|
||||
static std::string temp;
|
||||
|
||||
request->PostVar("progress", temp);
|
||||
int p = atoi(temp.c_str());
|
||||
|
||||
if( p < 0 )
|
||||
p = 0;
|
||||
|
||||
if( p > 100 )
|
||||
p = 100;
|
||||
|
||||
ticket->progress = p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ReadTicket::Read(System * psystem, Request * prequest, Ticket * pticket)
|
||||
{
|
||||
system = psystem;
|
||||
request = prequest;
|
||||
ticket = pticket;
|
||||
|
||||
ticket->parent_id = request->dir_table.back()->id;
|
||||
|
||||
ReadTicketType();
|
||||
ReadTicketStatus();
|
||||
ReadTicketPriority();
|
||||
ReadTicketCategory();
|
||||
ReadTicketExpected();
|
||||
ReadTicketProgress();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user