Workflow and templates

Workflow and templates

Monday 02 June 2008 6:06:56 am - 3 replies

Modified on Monday 02 June 2008 7:00:42 am by Clemens T

Author Message

Clemens T

Monday 02 June 2008 8:16:36 am

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;
	}
    }

Andrew Duck

Thursday 29 January 2009 5:08:51 am

Is this functionality still available in eZ 4.0.1?

My use case is eZWorkflowEventType::STATUS_FETCH_TEMPLATE_REPEAT to load up the first template which works fine, but then submitting data from this template back to the workflow event for evaluation and further processing does not appear to work.

Is this possible with the content module, content/action?

I have attempted posting data to /content/action with and without HasObjectInput but I end up at the object history page forcing me to create a new draft.

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Kristof Coomans

Friday 30 January 2009 6:36:42 am

Issue reported here by Andrew: http://issues.ez.no/IssueView.php?Id=14371

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.