Author Topic

Clemens T

Monday 02 June 2008 8:16:36 am

Comment49646

Got it!

This is not documented or whatever, but my thanks goes to the following thread:http://ez.no/developer/forum/developer/before_publish_event_with_tempaltes

The key is publishing data without publishing new object info via:
<b>HasObjectInput</b> and<b>PublishButton</b>.

My very simple template code now looks like this:

<form method="post" action="{"/content/action/"|ezurl(,'no')}">
	<input type="hidden" name="HasObjectInput" value="0" />
	<input type="hidden" name="done" value="1" />
	<input class="button" type="submit" name="PublishButton" value="Finish" />
</form>

My Execute function:

    function execute( &$process, &$event )
    {
	$http =& eZHTTPTool::instance();

	if($http->hasPostVariable("done"))
	{
		
                //do anything I want to do...				
		return EZ_WORKFLOW_TYPE_STATUS_ACCEPTED;
	} 
	else
	{
		$requestURI = eZSys::requestURI();
		
              $process->Template = array();
              $process->Template['templateName'] = 'design:workflow_event.tpl';
              $process->Template['templateVars'] = array ( 'event' => $event );
 
						
		return EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT;
	}
    }