Field with fieldId: 150 not found in definition of 5
! Flagged Revisions
For the documentation, see ((doc:Flagged Revisions)) & ((doc:Wiki Argument Variables))
!! ISO9001
Improvements needed to facilitate the use of Tiki for the ISO9001 quality protocol.
See also profile ((pr:ISO9001)) and [wish5112]
See: https://tiki.org/tiki-view_forum_thread.php?forumId=3&comments_parentId=54311
New wiki argument variables added in trunk (for Tiki14): {sign user="xavi" datetime="2014-12-30T14:47:22+00:00"}
* currentVersion
* currentVersionApprover
* currentVersionApproval
* currentVersionApproved
+ See: {commit id=53372}, {commit id=53373}
!! Tiki9 Flagged Revisions
Flagged revisions could use a little TLC. See http://doc.tiki.org/Flagged+Revisions#FAQ Here are some notes that are hoped to make that TLC easier for a newb.
#How are they implemented in the database?
+See the Database references table below. When you approve a Flagged Revision, a record is appended in tiki_objects_attributes, with itemId=tiki_history.historyId, type="wiki history", attribute="tiki.history.moderation", and value="OK". Then follow table.fields tiki_objects_attributes. itemId => tiki_history.historyId => tiki_history.pageName and tiki_history.version, which are two fields which match those in tabe tiki_pages.
#There is no way to list all current pending Flagged Revisions.
##A simple way to implement that might be to modify tiki-listpages.php by adding another Filter, very similar and following the tiki-listpages.php and tikilib.php code paths of "exact_match", selectable by a checkbox, labeled something like "Flagged Revisions pending approval". See tikilib.php function list_pages(). Need to define $mid = "where" clause, and "elseif ($type == 'flaggedrev_pending')".
!!-Database references
||Table | Relevant Fields
tiki_pages |page_id(=14)%%%~~#090:pageName~~(=Procedures)%%%~~#00F:version~~(=2)%%%data(=latest content, may or may not yet be approved)
tiki_pages_changes |Empty
tiki_history|~~#F00:historyId~~(=77)%%%~~#090:pageName~~(=Procedures)%%%~~#00F:version~~(=2)%%%data(=blob)
tiki_objects_attributes|attributeId(=autoincrement)%%%type(="wiki history")%%%itemId(=~~#F00:tiki_history.historyId~~)%%%attribute(="tiki.history.moderation") %%%value(="OK")
||
When you save an edit to a wiki page, a new record is appended to tiki_history database table, with an incremented version number. The new current wiki content is stuffed in the data blob field (easily readable in a text editor). tiki-pagehistory.php?page=PageName will list each saved edit separately, but those that have been approved contain the text "(approved)" in the "Information" column; so where is that "(approved)" stored or calculated?
So, after all this review, I think we can implement a listing of wiki pages pending flagged-revision approval by adding, on tiki-listpages.php, to the Type: dropdown, which currently has only an option for "Pages not in structure", a new option called "Pages Pending Approval".
!!-Reference Notes, Ignore
!!!TPL files
#tiki-flaggedrev_approval_header.tpl
+{if $prefs.flaggedrev_approval eq 'y' and $revision_approval}
+ {if ($revision_approved or $revision_displayed) and $revision_approved neq $lastVersion}
+ {if $lastVersion eq $revision_displayed}
!!!PHP Files
#lib/wiki/flaggedrevisionlib.php
## function page_requires_approval($pageName)
### $attributelib->set_attribute('wiki history', $version_info['historyId'], $attribute, $value);
###$attribute="tiki.history.moderation", $value="OK" ($flag="moderation")
#lib/wiki/histlib.php
#tiki-pagehistory.php
##$auto_query_args = array('page', 'oldver', 'newver', 'compare', 'diff_style', 'show_translation_history', 'show_all_versions', 'history_offset', 'paginate', 'history_pagesize');
##$info = $tikilib->get_page_info($page);
##if (isset($_REQUEST['preview'], $_REQUEST['flaggedrev'], $_REQUEST['page']) && $prefs['flaggedrev_approval'] == 'y' && $tiki_p_wiki_approve == 'y') {$targetFlag = null;
### if (isset($_REQUEST['approve'])) {
+ $targetFlag = 'OK';
+$targetVersion = (int) $_REQUEST['approve'];
+$targetFlag is what is pushed into the "value" field in database table tiki_object_attributes.
### $flaggedrevisionlib->flag_revision($info['pageName'], $targetVersion, 'moderation', $targetFlag);
#lib/attributes/attributelib.php
!!!Notes
#page_ref_id is a wiki Structure page reference. Interestingly, tiki-editpage.php?page=PageName&page_ref_id=5 has both a "page=" and a "page_ref_id=".
#Is it possible to create a search like in tiki-search_replace.php, $results = $wikilib->get_pages_contains() that instead lists pages with pending approvals?
#By selecting the appropriate checkboxes here ____, tiki-listpages.php can list "Last ver." and "Vers.", which are usually the same, but sometimes different, but, at the moment don't make sense to my test page pending Flagged Revisions, dangit. Also, at the bottom, it has a "Perform action with checked:" dropdown that could include an option to approve the pending Flagged Revisions, someday.
!!Bugs/Tracker
!!! Open
{wishes filtervalue="188" status="o"}
!!! Pending
{wishes filtervalue="188" status="p"}
!!!- Closed
{wishes filtervalue="188" status="c"}
!! Related
* http://tech.slashdot.org/story/09/08/24/224259/Wikipedia-To-Require-Editing-Approval
* http://en.wikipedia.org/wiki/Wikipedia:Flagged_revisions
* http://features.sheep.art.pl/StagedCommits
-=Alias=-
* (alias(Staging))
* (alias(Approval))
* (alias(Flagged revision))
* (alias(Flagged revisions))
* (alias(Wiki Page Staging and Approval))
* (alias(Wiki Staging and Approval))