%META:TOPICINFO{author="JohannesHartig" date="1335696070" format="1.1" reprev="1.2" version="1.2"}%
---+!! !ApprovalTablePlugin

<!--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/ApprovalTablePlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/ApprovalTablePluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
<sticky><div style="float:right; background-color:#EBEEF0; margin:0 0 20px 20px; padding: 0 10px 0 10px;">
%TOC{title="Page contents"}%
</div></sticky>

%SHORTDESCRIPTION%

---++ Introduction

This Plugin is kind of an extension to the ApprovalPlugin. It reads the "ApprovalDef" states of a topic and displays them in a table. 

---++ Syntax Rules

---+++ Adding table to topic

=%<nop>APPROVALTABLE%=

---+++ Approval Definition of Topic

   * The states in the state table must be in the order in which they shall appear in the table
   * Every state consists actually of two states in the StateTable (e.g., "Start" and "StartApproval")
      * One with the name of the state
      * One with the name of the state plus "Approval"  ( to simulate the decision-phase)
   * There must be a state "PAUSED" defined at the end of the state table ( %ICON{led-red}% )
   * For every state three phases are existing: Edit ( %P% ), Decision ( %S% ), Completed ( %Y% )



---++ Examples

---+++ Adding table to topic

   * =%<nop>APPROVALTABLE%= expands to: 
%TABLE{tablewidth="250px;" columnwidths="230px,20px"}%
| StateOne | %Y% |
| StateTwo | %P% |
| StateThree | |
| | |
| PAUSED | %ICON{led-red}% |

---+++ Approval Definition of Topic

---++++ The State Table

| *State* | *Allow Edit* | *Message* |
| StateOne | | Needs approval for StateTwo |
| StateOneApproval | | Approval for StateTwo |
| StateTwo | | Needs approval for StateThree |
| StateTwoApproval | | Approval for StateThree |
| StateThree | | StateThree achieved |
| PAUSED | | This flow is paused |

---++++ The Transition Table

| *State* | *Action* | *Next State* | *Allowed* | *Notify* | *Sign Off's (%)* |
| StateOne | Send for approval | StateOneApproval | | | |
| StateOneApproval | Approve StateTwo | StateTwo | | | |
| StateOneApproval | Pause | PAUSED | | | |
| StateTwo | Send for approval | StateTwoApproval | | | |
| StateTwoApproval | Approve StateThree | StateThree | | | |
| StateTwoApproval | Pause | PAUSED | | | |
| PAUSED | Send back to StateOne  | StateOne | | | |
| PAUSED | Send back to StateTwo  | StateTwo | | | |


---++ Plugin Installation & Configuration

__Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

   * For an __automated installation__, run the [[%SCRIPTURL{configure}%][configure]] script and follow "Find More Extensions" in the in the __Extensions__ section.

   * Or, follow these __manual installation__ steps: 
      * Download the ZIP file from the Plugins home (see below).
      * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
| *File:* | *Description:* |
| ==data/TWiki/%TOPIC%.txt== | Plugin topic |
| ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module |
   * 
      * Set the ownership of the extracted directories and files to the webserver user.
      * Install the dependencies (if any).

   * Plugin __configuration and testing__: 
      * Run the [[%SCRIPTURL{configure}%][configure]] script and enable the plugin in the __Plugins__ section.
      * Configure additional plugin settings in the __Extensions__ section if needed.
      * Test if the installation was successful: See example above.

---++ Dependencies

   * ApprovalPlugin

---++ Plugin Info

   * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: 
      * Set SHORTDESCRIPTION = Displays ApprovalPlugin states in a table

|  Plugin Author: | TWiki:Main.JohannesHartig |
|  Copyright: | � 2012 TWiki:Main.JohannesHartig <br /> � 2012 TWiki:TWiki.TWikiContributor |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Plugin Version: | 2012-04-28 (V0.1) |
|  Change History: | <!-- versions below in reverse order --> |
|  2012-04-28: | Initial version |
|  TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
|  CPAN Dependencies: | none |
|  Other Dependencies: | ApprovalPlugin |
|  Perl Version: | 5.005 |
|  TWiki:Plugins.Benchmark: | %SYSTEMWEB%.GoodStyle nn%, %SYSTEMWEB%.FormattedSearch nn%, %TOPIC% nn% |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalTablePlugin |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalTablePluginDev |
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/ApprovalTablePluginAppraisal |

__Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
