2010-08-10 18:12:50 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of Winix
|
2014-10-04 20:04:03 +02:00
|
|
|
* and is distributed under the 2-Clause BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2014-02-12 17:30:49 +01:00
|
|
|
* Copyright (c) 2008-2014, Tomasz Sowa
|
2010-08-10 18:12:50 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2014-10-04 20:04:03 +02:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
2010-08-10 18:12:50 +02:00
|
|
|
*/
|
|
|
|
|
2010-10-24 01:12:47 +02:00
|
|
|
#include "funticket.h"
|
2011-01-20 19:37:51 +01:00
|
|
|
#include "core/plugin.h"
|
|
|
|
#include "plugins/thread/pluginmsg.h"
|
2010-10-19 02:31:20 +02:00
|
|
|
|
2014-02-12 17:30:49 +01:00
|
|
|
namespace Winix
|
|
|
|
{
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
namespace Ticket
|
2010-08-10 18:12:50 +02:00
|
|
|
{
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
FunTicket::FunTicket()
|
|
|
|
{
|
2010-11-21 01:19:17 +01:00
|
|
|
fun.url = L"ticket";
|
2010-08-10 22:43:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
void FunTicket::SetTDb(TDb * ptdb)
|
2010-08-10 22:43:38 +02:00
|
|
|
{
|
2010-09-29 23:24:34 +02:00
|
|
|
tdb = ptdb;
|
|
|
|
}
|
2010-08-10 22:43:38 +02:00
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
|
|
|
|
void FunTicket::SetTicketInfo(TicketInfo * pinfo)
|
|
|
|
{
|
|
|
|
ticket_info = pinfo;
|
2010-08-10 22:43:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
bool FunTicket::HasAccess()
|
2010-08-10 22:43:38 +02:00
|
|
|
{
|
2011-01-23 15:15:30 +01:00
|
|
|
return cur->request->is_item && system->HasReadAccess(cur->request->item);
|
2010-08-10 18:12:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-10-19 02:31:20 +02:00
|
|
|
void FunTicket::MakeGet()
|
2010-08-10 18:12:50 +02:00
|
|
|
{
|
2011-01-05 22:24:11 +01:00
|
|
|
ticket_info->Clear();
|
2010-10-19 02:31:20 +02:00
|
|
|
ticket_info->FindCurrentConf();
|
2011-01-05 22:24:11 +01:00
|
|
|
ticket_info->ticket = &ticket;
|
2012-01-16 11:12:38 +01:00
|
|
|
ticket_info->item = &cur->request->item;
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
tdb->GetTicket(cur->request->item.id, ticket);
|
2011-01-20 19:37:51 +01:00
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
plugin.Call(WINIX_PL_THREAD_PREPARE_THREAD, cur->request->item.id);
|
2010-10-19 02:31:20 +02:00
|
|
|
}
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace
|
2014-02-12 17:30:49 +01:00
|
|
|
|
|
|
|
} // namespace Winix
|
|
|
|
|