[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/workflow/ -> run.php (source)

   1  <?php
   2  //
   3  // Created on: <01-Jul-2002 17:06:14 amos>
   4  //
   5  // SOFTWARE NAME: eZ publish
   6  // SOFTWARE RELEASE: 3.9.0
   7  // BUILD VERSION: 17785
   8  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
   9  // SOFTWARE LICENSE: GNU General Public License v2.0
  10  // NOTICE: >
  11  //   This program is free software; you can redistribute it and/or
  12  //   modify it under the terms of version 2.0  of the GNU General
  13  //   Public License as published by the Free Software Foundation.
  14  //
  15  //   This program is distributed in the hope that it will be useful,
  16  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  17  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18  //   GNU General Public License for more details.
  19  //
  20  //   You should have received a copy of version 2.0 of the GNU General
  21  //   Public License along with this program; if not, write to the Free
  22  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  23  //   MA 02110-1301, USA.
  24  //
  25  //
  26  
  27  $Module =& $Params["Module"];
  28  
  29  $WorkflowProcessID = null;
  30  if ( !isset( $Params["WorkflowProcessID"] ) )
  31  {
  32      $Module->redirectTo( $Module->functionURI( "list" ) );
  33      return;
  34  }
  35  
  36  $WorkflowProcessID = $Params["WorkflowProcessID"];
  37  
  38  include_once ( "kernel/classes/ezworkflowprocess.php" );
  39  
  40  $process = eZWorkflowProcess::fetch( $WorkflowProcessID );
  41  if ( $process === null )
  42  {
  43      $Module->redirectTo( $Module->functionURI( "list" ) );
  44      return;
  45  }
  46  
  47  include_once ( "lib/ezutils/classes/ezhttptool.php" );
  48  $http =& eZHTTPTool::instance();
  49  
  50  // include_once( "lib/ezutils/classes/ezexecutionstack.php" );
  51  // $execStack =& eZExecutionStack::instance();
  52  // $execStack->addEntry( $Module->functionURI( "run" ) . "/" . $WorkflowProcessID,
  53  //                       $Module->attribute( "name" ), "run" );
  54  
  55  // Template handling
  56  include_once ( "kernel/common/template.php" );
  57  $tpl =& templateInit();
  58  
  59  include_once ( "kernel/classes/ezworkflow.php" );
  60  $workflow = eZWorkflow::fetch( $process->attribute( "workflow_id" ) );
  61  
  62  $workflowEvent = null;
  63  if ( $process->attribute( "event_id" ) != 0 )
  64      $workflowEvent = eZWorkflowEvent::fetch( $process->attribute( "event_id" ) );
  65  
  66  $process->run( $workflow, $workflowEvent, $eventLog );
  67  // Store changes to process
  68  if ( $process->attribute( 'status' ) != EZ_WORKFLOW_STATUS_DONE )
  69  {
  70      $process->store();
  71  }
  72  if ( $process->attribute( 'status' ) == EZ_WORKFLOW_STATUS_DONE )
  73  {
  74  //    list ( $module, $function, $parameters ) = $process->getModuleInfo();
  75  }
  76  $tpl->setVariable( "event_log", $eventLog );
  77  $tpl->setVariable( "current_workflow", $workflow );
  78  
  79  $Module->setTitle( "Workflow run" );
  80  
  81  $tpl->setVariable( "process", $process );
  82  $tpl->setVariable( "module", $Module );
  83  $tpl->setVariable( "http", $http );
  84  
  85  $Result = array();
  86  $Result['content'] =& $tpl->fetch( "design:workflow/run.tpl" );
  87  
  88  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7