added: to Item struct: ameta (PT::Space)

admin meta information
added: option "a" to meta winix function
       editing admin meta information
changed: now if you don't have write access to an item
         you can't see the meta information
         previous if you had read access you could have seen them
added: in plugin ticket and thread
       support for 'closing' (ticket, thread)
       (this is only logic, we need some html yet)
added: some ezc function for getting meta/admin meta information
       (for the current item and the last directory)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@907 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-11-04 21:01:02 +00:00
parent 4809016b78
commit 0045c6c72c
24 changed files with 389 additions and 88 deletions

View File

@@ -311,7 +311,7 @@ Error Db::AddItemIntoItem(Item & item)
query.Clear();
query << R("insert into core.item (user_id, modification_user_id, group_id, privileges, "
"date_creation, date_modification, type, parent_id, content_id, "
"link_to, link_redirect, subject, guest_name, template, sort_index, meta, url) values (")
"link_to, link_redirect, subject, guest_name, template, sort_index, meta, ameta, url) values (")
<< item.user_id
<< item.modification_user_id
<< item.group_id
@@ -327,7 +327,8 @@ Error Db::AddItemIntoItem(Item & item)
<< item.guest_name
<< item.html_template
<< item.sort_index
<< item.meta;
<< item.meta
<< item.ameta;
url_without_id = AddItemCreateUrlSubject(item);
@@ -469,7 +470,7 @@ Error Db::EditItemInItem(Item & item, bool with_url)
query.Clear();
query << R("update core.item set (user_id, modification_user_id, group_id, privileges, "
"date_creation, date_modification, type, link_to, link_redirect, parent_id, subject, "
"guest_name, template, sort_index, meta");
"guest_name, template, sort_index, meta, ameta");
if( with_url )
query << R(", url");
@@ -489,7 +490,8 @@ Error Db::EditItemInItem(Item & item, bool with_url)
<< item.guest_name
<< item.html_template
<< item.sort_index
<< item.meta;
<< item.meta
<< item.ameta;
if( with_url )
{
@@ -771,7 +773,7 @@ void Db::GetItemsQuerySelect(const DbItemQuery & iq, DbTextStream & query, bool
if( iq.sel_file ) query << R(", file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size");
if( iq.sel_html_template ) query << R(", template");
if( iq.sel_sort_index ) query << R(", sort_index");
if( iq.sel_meta ) query << R(", meta");
if( iq.sel_meta ) query << R(", meta, ameta");
}
query << R(" from core.item");
@@ -1343,6 +1345,19 @@ return DoCommand(query);
}
Error Db::EditAdminMetaById(const PT::Space & ameta, long id)
{
query.Clear();
query << R("update core.item set (ameta) = (")
<< ameta
<< R(") where id=")
<< id
<< R(";");
return DoCommand(query);
}
Error Db::EditSubjectById(Item & item, long id)

View File

@@ -72,6 +72,7 @@ public:
Error EditFileById(const Item & item, long id); // file_path, file_fs, file_type
Error EditHasThumbById(bool has_thumb, long id);
Error EditMetaById(const PT::Space & meta, long id);
Error EditAdminMetaById(const PT::Space & meta, long id);
Error DelDirById(long id);
Error DelFileById(long file_id);

View File

@@ -46,6 +46,7 @@ void DbItemColumns::SetColumns(PGresult * r)
modify_index = PQfnumber(r, "modify_index");
sort_index = PQfnumber(r, "sort_index");
meta = PQfnumber(r, "meta");
ameta = PQfnumber(r, "ameta");
}
@@ -82,7 +83,8 @@ void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template);
if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index);
if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta);
if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta);
if( ameta != -1 ) db_base.AssertValueSpace(r, row, ameta, item.ameta);
}

View File

@@ -48,6 +48,7 @@ struct DbItemColumns
int modify_index;
int sort_index;
int meta;
int ameta;
DbItemColumns(DbBase & db_base_) : db_base(db_base_)
{

View File

@@ -33,7 +33,7 @@ struct DbItemQuery
bool sel_file; // file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size
bool sel_html_template; // template
bool sel_sort_index; // sort_index
bool sel_meta; // meta PT::Space
bool sel_meta; // meta and ameta (PT::Space)
bool where_id; //
bool where_parent_id; //