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:
62
content/ticket.cpp
Executable file
62
content/ticket.cpp
Executable file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "content.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/db.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/mount.h"
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::TicketDeleteFirst()
|
||||
{
|
||||
if( !request.is_ticket )
|
||||
return;
|
||||
|
||||
for(size_t i=0 ; i<request.item_table.size() ; ++i)
|
||||
{
|
||||
if( request.item_table[i].id == request.ticket.item_id )
|
||||
{
|
||||
// this is the first item with the content for the ticket
|
||||
|
||||
if( !request.HasReadAccess(request.item_table[i]) )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
}
|
||||
|
||||
request.item_table.erase(request.item_table.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::FunTicket()
|
||||
{
|
||||
if( request.is_item || data.mounts.pmount->type != Mount::ticket )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, true, true, true);
|
||||
db.GetTickets(request.dir_table.back()->id, request.ticket_tab);
|
||||
|
||||
TicketDeleteFirst();
|
||||
CheckAccessToItems();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user