added: issues ticket system

added functions: ticket, createticket, editticket
         (there is no 'rm' function working for tickets yet)
changed: mount parser and mount points
         now we have more parameters (arguments in parameters)
some refactoring in functions 'emacs' and 'mkdir'



git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@554 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-01-25 04:52:17 +00:00
parent 356e93914b
commit 89daf6489d
48 changed files with 2856 additions and 874 deletions

View File

@@ -72,7 +72,7 @@ void Content::SetDefaultFunctionForDir()
}
if( data.mounts.CurrentMountType() == Mount::thread )
if( data.mounts.pmount->type == Mount::thread )
{
request.pfunction = data.functions.GetFunction(FUN_THREAD);
@@ -80,6 +80,14 @@ void Content::SetDefaultFunctionForDir()
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
}
else
if( data.mounts.pmount->type == Mount::ticket )
{
request.pfunction = data.functions.GetFunction(FUN_TICKET);
if( request.pfunction )
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
}
else
{
// cms
request.pfunction = data.functions.GetFunction(FUN_LS);
@@ -184,6 +192,15 @@ void Content::MakeStandardFunction()
else
if( request.pfunction->code == FUN_UPLOAD )
FunUpload();
else
if( request.pfunction->code == FUN_CREATETICKET )
FunCreateTicket();
else
if( request.pfunction->code == FUN_EDITTICKET )
FunEditTicket();
else
if( request.pfunction->code == FUN_TICKET )
FunTicket();
else
request.status = Error::permission_denied;
@@ -245,6 +262,14 @@ void Content::MakePost()
PostFunUpload();
break;
case FUN_CREATETICKET:
PostFunCreateTicket();
break;
case FUN_EDITTICKET:
PostFunEditTicket();
break;
default:
log << log1 << "Content: unknown post function" << logend;
break;
@@ -388,16 +413,37 @@ Item * pdir;
}
void Content::RedirectToLastDir()
{
RedirectTo( *request.dir_table.back() );
}
void Content::ReadAdditionalInfo()
{
if( request.dir_table.empty() )
return;
if( data.mounts.CurrentMountType() == Mount::thread )
if( data.mounts.pmount->type == Mount::thread )
{
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == Error::ok )
request.is_thread = true;
}
else
if( data.mounts.pmount->type == Mount::ticket )
{
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == Error::ok )
{
request.is_ticket = true;
if( !request.is_item && (!request.pfunction || request.pfunction->code == FUN_TICKET) )
{
db.GetItemById(request.ticket.item_id, request.item);
// don't set request.is_item here
}
}
}
}
@@ -407,7 +453,7 @@ void Content::PrepareUrl(Item & item)
TrimWhite(item.url);
if( item.url.empty() )
item.url = item.subject; // if the subject is empty then the url will be corrected by CorrectUrl()
item.url = item.subject; // if the subject is empty then the url will be corrected by CorrectUrlOnlyAllowedChar()
CorrectUrlOnlyAllowedChar(item.url);