Commit c29491c6 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add allowcomments column to view and artefact tables


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent cb2f88fd
......@@ -333,6 +333,7 @@
<FIELD NAME="note" TYPE="text" NOTNULL="false" />
<FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="false" />
<FIELD NAME="authorname" TYPE="text" NOTNULL="false" />
<FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
......@@ -580,6 +581,7 @@
<FIELD NAME="template" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
<FIELD NAME="copynewuser" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
<FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
<FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
......
......@@ -1401,9 +1401,16 @@ function xmldb_core_upgrade($oldversion=0) {
(author IS NULL AND authorname IS NOT NULL)
)');
// Install the comment artefact
if ($data = check_upgrades('artefact.comment')) {
upgrade_plugin($data);
}
// Flag all views & artefacts to enable/disable comments
table_column('artefact', null, 'allowcomments', 'integer', 1);
table_column('view', null, 'allowcomments', 'integer', 1, null, 1);
// Initially allow comments on blogposts, images, files
set_field_select('artefact', 'allowcomments', 1, 'artefacttype IN (?,?,?)', array('blogpost', 'image', 'file'));
}
return $status;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment