RenderWorkflowInfo
renders an info block at the top of a ControlledTopic

Documentation

This TopicFunction renders the header of a ControlledTopic.

Parameters
  • OBJECT the topic to render the info block for
  • APPROVE_STATE, the state where the controlled topic is approved/live/ready to be used, defaults to approved

Implementation

%STARTINCLUDE%<div class="foswikiPageForm foswikiHideOnPrint clearfix %ENCODE{"%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" rev="%URLPARAM{"rev"}%"}%" old=" " new="_"}%">
%IF{"$'URLPARAM{rev}'='' and '%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" format="$numactions"}%'>0" 
   then="<div class='foswikiRight'>$percntBUTTON{\"%TRANSLATE{"Change State"}%\" href=\"#changeStateDialog\" class=\"jqUIDialogLink\"}$percnt</div>"
}%<table class='foswikiLayoutTable foswikiHideOnPrint'>
%WORKFLOWSTATE{
   "%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" 
   rev="%URLPARAM{"rev"}%" 
   format="<tr class='message'>
      <th>%TRANSLATE{"Message"}%</th>
      $percntIF{
         \"'$state'!='%APPROVED_STATE{default="approved"}%'\" 
         then=\"<td class='foswikiAlert'> $percntJQICON{\"fa-exclamation-triangle\"}$percnt\" 
         else=\"<td class='foswikiOK'>$percntJQICON{\"fa-check-circle\"}$percnt\"
      }$percnt $percntTRANSLATE{\"$message\"}$percnt</td>
   </tr>$percntIF{
      \"'$percntENCODE{\"$comment\" type=\"quote\"}$percnt'!=''\"
      then=\"<tr>
               <th>Comment</th>
               <td>$comment</th>
            </tr>\"
   }$percnt"
}%%WORKFLOWSTATE{
   "%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" 
   rev="%URLPARAM{"rev"}%" 
   state="%APPROVED_STATE{default="approved"}%"
   hidenull="on"
   format="<tr class='last'>
      <th>%TRANSLATE{"Last in [_1]" args="$state"}%</th>
      <td>$time &#124; [[$user]] &#124; <a href='%SCRIPTURLPATH{"view"}%/$web/$topic?rev=$rev'>%TRANSLATE{"View"}%</a> &#124; <a href='%SCRIPTURLPATH{"compare"}%/$web/$topic?rev1=$rev&rev2=%NATMAXREV%'>%TRANSLATE{"Diff"}%</a></td>
   </tr>"
}%</table>
</div>

<div id="changeStateDialog" title="%TRANSLATE{"Change State"}%" class="jqUIDialog foswikiHideOnPrint" style="display:none" data-modal="true" data-position="center" data-width="540" data-cached="true">
<form class="workflowChangeStateForm" action="%SCRIPTURLPATH{"rest"}%/WorkflowPlugin/changeState" method="post">
  <input type='hidden' name='WORKFLOWSTATE' value='%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%"}%' />
  <input type='hidden' name='topic' value='%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%' />
  <input type='hidden' name='t' value='%GMTIME{"$epoch"}%' />
  <div class="foswikiFormSteps">
    <div class="foswikiFormStep">
      <h3>%TRANSLATE{"New State"}%:</h3>
      %FORMATLIST{"%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" format="$actions"}%"
         split="\s*,\s*"
         selection="^(%FORMATLIST{"%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" format="$actions"}%" split="\s*,\s*" limit="1"}%)$"
         marker="checked='checked'"
         format="<label><input type='radio' name='WORKFLOWACTION' $marker value='$1'>$1</label>"
         separator="$n"
      }%
    </div>
    <div class='foswikiFormStep'>
      <h3>%TRANSLATE{"Comment"}%:</h3>
      <input type="text" name="WORKFLOWCOMMENT" size="60" class="foswikiInputField" />
    </div>
  </div>
  <a class="jqUIDialogButton jqUIDialogSubmit {icon:'ui-icon-circle-check'}">%MAKETEXT{"Submit"}%</a>
  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%MAKETEXT{"Cancel"}%</a>
</form>
</div>%STOPINCLUDE%

Test

%IF{"$'URLPARAM{rev}'='' and '%WORKFLOWSTATE{"ControlledTestTopic" format="$numactions"}%'>0" then="
$percntBUTTON{\"Change State\" href=\"#changeStateDialog\" class=\"jqUIDialogLink\"}$percnt
" }% %WORKFLOWSTATE{ "ControlledTestTopic" rev="" format=" $percntIF{ \"'$state'!='approved'\" then=\"$percntIF{ \"'$percntENCODE{\"$comment\" type=\"quote\"}$percnt'!=''\" then=\"\" }$percnt" }%%WORKFLOWSTATE{ "ControlledTestTopic" rev="" state="approved" hidenull="on" format="" }%
Message $percntJQICON{\"fa-exclamation-triangle\"}$percnt\" else=\"$percntJQICON{\"fa-check-circle\"}$percnt\" }$percnt $percntTRANSLATE{\"$message\"}$percnt
Comment $comment
Last in $state $time | User | View | Diff

Calls to 'RenderWorkflowInfo'

Copyright

© 2006-2013 Michael Daum http://michaeldaumconsulting.com

This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. For more details read the LICENSE.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Das Urheberrecht © liegt bei den mitwirkenden Autoren. Alle Inhalte dieser Kollaborations-Plattform sind Eigentum der Autoren.