This question about Using an extension: Answered

Warning banner for non-approved revision?

Is it possible to display a banner warning that the current page is not the latest approved revision?

I need this for use in a Quality Control system.

-- JohnWike - 20 Apr 2010

To achieve this, I'm using the following template definition in a VIEW_TEMPLATE:
%TMPL:DEF{"contentheader"}%
<style>.stateDefault {border:1px solid red; color:red; background:#fff2f2; text-align:center;} .stateApproved {border-color:green; color:green; background:#ebffeb;}</style>%IF{ "$ WORKFLOWSTATE!='APPROVED' " then="<div class='foswikiNotification stateDefault'>This topic is *not* in an *approved* state! Check the last approved version, if available: %WORKFLOWLASTVERSION_APPROVED%</div>" else="<div class='foswikiNotification stateDefault stateApproved'>This topic is in an *approved* state!</div>" }%
%TMPL:END%

I'm sure there are other (nicer?) ways to get the same result.

-- MartinKaufmann - 21 Apr 2010

Thanks for your answer Martin, but it does not tell you whether the version displayed on the screen is the approved revision or not, it only tells you to look at the approved version. I need something that indicates unambiguously that the document displayed is the approved revision.

-- JohnWike - 22 Apr 2010

In our application it does exactly what you describe. If WORKFLOWSTATE is not equal APPROVED it displays a red box which a link to the last approved version ( WORKFLOWLASTVERSION_APPROVED), else it displays a green box indicating that the topic is approved. Do the macros %WORKFLOWSTATE% and %WORKFLOWLASTVERSION_APPROVED% work in your case?

-- MartinKaufmann - 22 Apr 2010

The macros do work and the banner you describe is displayed, but the same banner is displayed on every revision of the page. I want people to be able to carry on using the last approved version whilst unapproved editing is still taking place on later revisions. I therefore need the banner on the last approved revision to specifically say "This is the last approved version so you can use it", whilst the banners on later unapproved versions say "Don't use this because it hasn't been approved yet". I hope that is more clear. Thanks for your attention.

-- JohnWike - 22 Apr 2010

OK, now I got you. I once tried to do what you describe but wasn't successful. Even better would be an automatic redirect to the last approved version.

-- MartinKaufmann - 23 Apr 2010

The sensible way to do what you describe is to point the great unwashed at a separate web that contains only "approved" versions. The MirrorWebPlugin is where I'd start looking for a solution to this.

-- CrawfordCurrie - 28 Jun 2010

QuestionForm edit

Subject Using an extension
Extension WorkflowPlugin
Version Foswiki 1.0.6
Status Answered
Topic revision: r7 - 28 Jun 2010, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy