fixed: ticket sets a default function only for directories
fixed: reading a new url and subject in Functions::ReadItem() added: tickets are sorted now (by date) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@659 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -168,8 +168,6 @@ void Functions::Add(FunctionBase & fun)
|
||||
|
||||
void Functions::Create()
|
||||
{
|
||||
Add(fun_template);
|
||||
|
||||
Add(fun_adduser);
|
||||
Add(fun_cat);
|
||||
Add(fun_chmod);
|
||||
@@ -192,6 +190,7 @@ void Functions::Create()
|
||||
Add(fun_rm);
|
||||
Add(fun_run);
|
||||
Add(fun_subject);
|
||||
Add(fun_template);
|
||||
Add(fun_thread);
|
||||
Add(fun_tinymce);
|
||||
Add(fun_uname);
|
||||
@@ -200,10 +199,6 @@ void Functions::Create()
|
||||
Add(fun_who);
|
||||
|
||||
plugin.Call(WINIX_CREATE_FUNCTIONS);
|
||||
// Add(fun_ticket);
|
||||
// Add(fun_createticket);
|
||||
// Add(fun_editticket);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -366,31 +361,13 @@ void Functions::CheckGetPostTimes(time_t difference)
|
||||
|
||||
|
||||
// returning true if the 'url' has to be changed
|
||||
bool Functions::ReadItemUrlSubject(Item & item, Item::Type item_type)
|
||||
void Functions::ReadItemUrlSubject(Item & item, Item::Type item_type)
|
||||
{
|
||||
bool with_url = false;
|
||||
|
||||
const std::string & new_url = request->PostVar("url");
|
||||
const std::string & new_subject = request->PostVar("subject");
|
||||
|
||||
if( item_type == Item::file )
|
||||
{
|
||||
if( !request->is_item || new_url != item.url )
|
||||
with_url = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// !! dla katalogow zawsze ma modyfikowac url?
|
||||
with_url = true;
|
||||
}
|
||||
|
||||
|
||||
if( !new_url.empty() )
|
||||
item.url = new_url;
|
||||
|
||||
if( !new_subject.empty() )
|
||||
item.subject = new_subject;
|
||||
std::string * new_subject = request->PostVarp("subject");
|
||||
std::string * new_url = request->PostVarp("url");
|
||||
|
||||
if( new_subject )
|
||||
item.subject = *new_subject;
|
||||
|
||||
if( item.subject.empty() )
|
||||
{
|
||||
@@ -399,10 +376,11 @@ bool Functions::ReadItemUrlSubject(Item & item, Item::Type item_type)
|
||||
item.subject += ToStr(db->Size(request->dir_tab.back()->id, Item::file));
|
||||
}
|
||||
|
||||
if( new_url )
|
||||
item.url = *new_url;
|
||||
|
||||
// if item.url is empty then it will be set from item.subject
|
||||
PrepareUrl(item);
|
||||
|
||||
return with_url;
|
||||
}
|
||||
|
||||
|
||||
@@ -483,20 +461,18 @@ void Functions::ReadItemContentWithType(Item & item)
|
||||
// item_type - the type of an item you are expecting to read
|
||||
// returns true if the url has to be changed
|
||||
// at the moment this is only checked for Item::file - for Item::dir it returns always true
|
||||
bool Functions::ReadItem(Item & item, Item::Type item_type)
|
||||
void Functions::ReadItem(Item & item, Item::Type item_type)
|
||||
{
|
||||
if( item_type == Item::none )
|
||||
return false;
|
||||
return;
|
||||
|
||||
item.type = item_type;
|
||||
item.parent_id = request->dir_tab.back()->id; // !! moze to dac jako parametr?
|
||||
|
||||
bool edit_with_url = ReadItemUrlSubject(item, item_type);
|
||||
ReadItemUrlSubject(item, item_type);
|
||||
|
||||
if( item_type == Item::file )
|
||||
ReadItemContentWithType(item);
|
||||
|
||||
return edit_with_url;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user