RenderWorkflowInfo
renders an info block at the top of a ControlledTopic

02 May 2019 - 20:19 | Version 1 |

Documentation

This TopicFunction renders the header of a ControlledTopic.

Parameters
  • OBJECT the topic to render the info block for
  • APPROVED_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'>
%WORKFLOWSTATE{
   "%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" 
   rev="%URLPARAM{"rev"}%" 
   format="<tr class='message'>
      <th>%TRANSLATE{"State"}%</th>
      <td class='clsWorkflowState $state'><span class='clsWorkflowMessage'>$percntTRANSLATE{\"$message\"}$percnt</span></td>
   </tr>$percntIF{
      \"'$percntENCODE{\"$comment\" type=\"quote\"}$percnt'!=''\"
      then=\"<tr>
               <th>%TRANSLATE{"Comment"}%</th>
               <td>$percntENCODE{\"$comment\" type=\"quote\"}$percnt</th>
            </tr>\"
   }$percnt"
}%%WORKFLOWSTATE{
   "%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" 
   rev="%URLPARAM{"rev"}%" 
   state="%APPROVED_STATE{default="approved"}%"
   hidenull="on"
   format="<tr class='last $percntIF{\"'%WORKFLOWSTATE{"%OBJECT{default="%BASEWEB%.%BASETOPIC%"}%" rev="%URLPARAM{"rev"}%"}%'='%APPROVED_STATE{default="approved"}%'\" then=\"foswikiHidden\"}$percnt'>
      <th>$percntTRANSLATE{\"Last [_1]\" args=\"$percntTRANSLATE{\"$state\"}$percnt\"}$percnt</th>
      <td>$time &#124; [[$user]] &#124; <a href='%SCRIPTURLPATH{"view"}%/$web/$topic?rev=$rev'>%TRANSLATE{"View"}%</a> &#124; <a href='%SCRIPTURLPATH{"diff"}%/$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-width="540">
<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{"Action"}%:</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'>$percntTRANSLATE{\"$1\"}$percnt</label>"
         separator="$n"
      }%
    </div>
    <div class='foswikiFormStep'>
      <h3>%TRANSLATE{"Comment"}%:</h3>
      <textarea name="WORKFLOWCOMMENT" rows="3" cols="75" class="foswikiTextArea"></textarea>
    </div>
  </div>
  <a class="jqUIDialogButton jqUIDialogSubmit {icon:'ui-icon-circle-check'}">%TRANSLATE{"Submit"}%</a>
  <a class="jqUIDialogButton jqUIDialogClose {icon:'ui-icon-cancel'}">%TRANSLATE{"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{ \"'$percntENCODE{\"$comment\" type=\"quote\"}$percnt'!=''\" then=\"\" }$percnt" }%%WORKFLOWSTATE{ "ControlledTestTopic" rev="" state="approved" hidenull="on" format="" }%
State $percntTRANSLATE{\"$message\"}$percnt
Comment $percntENCODE{\"$comment\" type=\"quote\"}$percnt
$percntTRANSLATE{\"Last [_1]\" args=\"$percntTRANSLATE{\"$state\"}$percnt\"}$percnt $time | User | View | Diff

Controlled Test Topic

Calls to 'RenderWorkflowInfo'

Copyright

© 2006-2019 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.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding AustLII Communities? Send feedback
This website is using cookies. More info. That's Fine