Item class has been moved to a new directory 'models', a new class has been added: ItemContent
and same fields from Item were moved to ItemContent Item - id - parent_id - type (file, dir, symlink) - url - subject - template (html template) - sort_index - content_id ItemContent - id - ref -> references (renamed) - user_id - modification_user_id - group_id - privileges - date_creation - date_modification - guest_name - link_to - link_redirect - file_path - file_fs - file_type - file_size - has_thumb -> file_has_thumb (renamed) - hash -> file_hash (renamed) - hash_type -> file_hash_type (renamed) - content -> content_raw (renamed) - content_type -> content_raw_type (renamed) - content_parsed - content_parsed_type - meta - ameta -> meta_admin (renamed) - modify_index (removed) WIP: #4
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2014, Tomasz Sowa
|
||||
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -89,7 +89,7 @@ bool ShowThreads::Sort::operator()(const Item * item1, const Item * item2)
|
||||
else
|
||||
{
|
||||
// sorting by date
|
||||
return item1->date_creation > item2->date_creation;
|
||||
return item1->item_content.date_creation > item2->item_content.date_creation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,21 +99,31 @@ bool ShowThreads::Sort::operator()(const Item * item1, const Item * item2)
|
||||
void ShowThreads::ReadFiles()
|
||||
{
|
||||
// reading files
|
||||
DbItemQuery iq;
|
||||
iq.SetAll(false, false);
|
||||
iq.sel_url = true;
|
||||
iq.sel_subject = true;
|
||||
iq.sel_date = true;
|
||||
iq.sel_user_id = true;
|
||||
iq.sel_group_id = true;
|
||||
iq.sel_guest_name = true;
|
||||
iq.sel_privileges = true;
|
||||
iq.sel_date = true;
|
||||
iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
iq.WhereType(Item::file);
|
||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
// DbItemQuery iq;
|
||||
// iq.SetAll(false, false);
|
||||
// iq.sel_url = true;
|
||||
// iq.sel_subject = true;
|
||||
// iq.sel_date = true;
|
||||
// iq.sel_user_id = true;
|
||||
// iq.sel_group_id = true;
|
||||
// iq.sel_guest_name = true;
|
||||
// iq.sel_privileges = true;
|
||||
// iq.sel_date = true;
|
||||
// iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
// iq.WhereType(Item::file);
|
||||
// iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
|
||||
|
||||
db->GetItems(thread_info->item_tab, iq);
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
thread_info->item_tab = finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"parent_id", cur->request->dir_tab.back()->id).
|
||||
eq(L"type", static_cast<int>(Item::file)).
|
||||
eq(L"content.file_type", WINIX_ITEM_FILETYPE_NONE).
|
||||
get_vector();
|
||||
|
||||
//db->GetItems(thread_info->item_tab, iq);
|
||||
system->CheckAccessToItems(thread_info->item_tab);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user