[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

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

   1  <?php
   2  //
   3  // Created on: <09-Oct-2006 17:00:00 rl>
   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 ( "lib/ezutils/classes/ezhttptool.php" );
  28  $http =& eZHTTPTool::instance();
  29  $Module =& $Params["Module"];
  30  
  31  include_once ( "kernel/classes/eztrigger.php" );
  32  
  33  //////////////////////
  34  //$userID = eZUser::currentUserID();
  35  $conds = array();
  36  //$conds['user_id'] =  $userID;
  37  $conds['status'] = array( array( EZ_WORKFLOW_STATUS_DEFERRED_TO_CRON,
  38                                   EZ_WORKFLOW_STATUS_FETCH_TEMPLATE,
  39                                   EZ_WORKFLOW_STATUS_REDIRECT ) );
  40  $db = eZDB::instance();
  41  if ( $db->databaseName() == 'oracle' )
  42      $conds['LENGTH(memento_key)'] = array( '!=', 0 );
  43  else
  44      $conds['memento_key'] = array( '!=', '' );
  45  
  46  $plist = eZWorkflowProcess::fetchList( $conds );
  47  
  48  $totalProcessCount = 0;
  49  $outList2 = array();
  50  include_once ( 'lib/ezutils/classes/ezoperationmemento.php' );
  51  foreach ( $plist as $p )
  52  {
  53      $mementoMain = eZOperationMemento::fetchMain( $p->attribute( 'memento_key' ) );
  54      $mementoChild = eZOperationMemento::fetchChild( $p->attribute( 'memento_key' ) );
  55      $mementoMainData = $mementoMain->data();
  56      $mementoChildData = $mementoChild->data();
  57  
  58      $triggers = eZTrigger::fetchList( array( 'module_name' => $mementoChildData['module_name'],
  59                                               'function_name' => $mementoChildData['operation_name'],
  60                                               'name' => $mementoChildData['name'] ) );
  61      if ( count( $triggers ) > 0 )
  62      {
  63          $trigger =& $triggers[0];
  64          if ( is_object( $trigger ) )
  65          {
  66              $nkey = $trigger->attribute( 'module_name' ) . '/' . $trigger->attribute( 'function_name' ) . '/' . $trigger->attribute( 'name' );
  67  
  68              if ( !isset( $outList2[ $nkey ] ) )
  69              {
  70                  $outList2[ $nkey ] = array( 'trigger' => $trigger,
  71                                              'process_list' => array() );
  72              }
  73              $outList2[ $nkey ][ 'process_list' ][] = $p;
  74              $totalProcessCount++;
  75          }
  76      }
  77  }
  78  
  79  // Template handling
  80  include_once ( "kernel/common/template.php" );
  81  $tpl =& templateInit();
  82  
  83  $tpl->setVariable( "module", $Module );
  84  $tpl->setVariable( "trigger_list", $outList2 );
  85  $tpl->setVariable( "total_process_count", $totalProcessCount );
  86  
  87  $Module->setTitle( "Workflow processes list" );
  88  $Result = array();
  89  $Result['content'] =& $tpl->fetch( "design:workflow/processlist.tpl" );
  90  $Result['path'] = array( array( 'text' => ezi18n( 'kernel/workflow', 'Workflow' ),
  91                                  'url' => false ),
  92                           array( 'text' => ezi18n( 'kernel/workflow', 'Process list' ),
  93                                  'url' => false ) );
  94  
  95  ?>


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