[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

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

   1  <?php
   2  //
   3  // Created on: <20-Sep-2004 15:11:32 jk>
   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  include_once ( "kernel/classes/ezworkflow.php" );
  28  include_once ( "kernel/classes/ezworkflowgrouplink.php" );
  29  include_once ( "kernel/common/template.php" );
  30  
  31  $Module =& $Params["Module"];
  32  $http =& eZHTTPTool::instance();
  33  $validation = array( 'processed' => false,
  34                       'groups' => array() );
  35  
  36  $WorkflowID = $Params["WorkflowID"];
  37  $WorkflowID = (int) $WorkflowID;
  38  if ( !is_int( $WorkflowID ) )
  39      $Module->handleError( EZ_ERROR_KERNEL_NOT_FOUND, 'kernel' );
  40  
  41  $workflow = eZWorkflow::fetch( $WorkflowID );
  42  if ( !$workflow )
  43      return $Module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
  44  
  45  if ( $http->hasPostVariable( "AddGroupButton" ) && $http->hasPostVariable( "Workflow_group") )
  46  {
  47      include_once ( "kernel/workflow/ezworkflowfunctions.php" );
  48  
  49      $selectedGroup = $http->postVariable( "Workflow_group" );
  50      eZWorkflowFunctions::addGroup( $WorkflowID, 0, $selectedGroup );
  51  }
  52  if ( $http->hasPostVariable( "DeleteGroupButton" ) && $http->hasPostVariable( "group_id_checked" ) )
  53  {
  54      include_once ( "kernel/workflow/ezworkflowfunctions.php" );
  55  
  56      $selectedGroup = $http->postVariable( "group_id_checked" );
  57      if ( !eZWorkflowFunctions::removeGroup( $WorkflowID, 0, $selectedGroup ) )
  58      {
  59          $validation['groups'][] = array( 'text' => ezi18n( 'kernel/workflow', 'You have to have at least one group that the workflow belongs to!' ) );
  60          $validation['processed'] = true;
  61      }
  62  }
  63  
  64  $event_list =& $workflow->fetchEvents();
  65  
  66  $tpl =& templateInit();
  67  $res =& eZTemplateDesignResource::instance();
  68  $res->setKeys( array( array( "workflow", $workflow->attribute( "id" ) ) ) );
  69  
  70  $tpl->setVariable( "workflow", $workflow );
  71  $tpl->setVariable( "event_list", $event_list );
  72  $tpl->setVariable( 'validation', $validation );
  73  
  74  $Result = array();
  75  $Result['content'] =& $tpl->fetch( "design:workflow/view.tpl" );
  76  $Result['path'] = array( array( 'text' => ezi18n( 'kernel/workflow', 'Workflow' ),
  77                                  'url' => false ),
  78                           array( 'text' => ezi18n( 'kernel/workflow', 'View' ),
  79                                  'url' => false ) );
  80  
  81  ?>


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