[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/shop/ -> orderview.php (source)

   1  <?php
   2  //
   3  // Created on: <31-Jul-2002 16:49:13 bf>
   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  $OrderID = $Params['OrderID'];
  28  $module =& $Params['Module'];
  29  include_once ( "kernel/common/template.php" );
  30  
  31  include_once ( "kernel/classes/ezorder.php" );
  32  
  33  $ini =& eZINI::instance();
  34  $http =& eZHTTPTool::instance();
  35  $user =& eZUser::currentUser();
  36  $access = false;
  37  $order = eZOrder::fetch( $OrderID );
  38  if ( !$order )
  39  {
  40      return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
  41  }
  42  
  43  $accessToAdministrate = $user->hasAccessTo( 'shop', 'administrate' );
  44  $accessToAdministrateWord = $accessToAdministrate['accessWord'];
  45  
  46  $accessToBuy = $user->hasAccessTo( 'shop', 'buy' );
  47  $accessToBuyWord = $accessToBuy['accessWord'];
  48  
  49  if ( $accessToAdministrateWord != 'no' )
  50  {
  51      $access = true;
  52  }
  53  elseif ( $accessToBuyWord != 'no' )
  54  {
  55      if ( $user->id() == $ini->variable( 'UserSettings', 'AnonymousUserID' ) )
  56      {
  57          if( $OrderID != $http->sessionVariable( 'UserOrderID' ) )
  58          {
  59              $access = false;
  60          }
  61          else
  62          {
  63              $access = true;
  64          }
  65      }
  66      else
  67      {
  68          if ( $order->attribute( 'user_id' ) == $user->id() )
  69          {
  70              $access = true;
  71          }
  72          else
  73          {
  74              $access = false;
  75          }
  76      }
  77  }
  78  if ( !$access )
  79  {
  80       return $module->handleError( EZ_ERROR_KERNEL_ACCESS_DENIED, 'kernel' );
  81  }
  82  $tpl =& templateInit();
  83  
  84  
  85  $tpl->setVariable( "order", $order );
  86  
  87  $Result = array();
  88  $Result['content'] =& $tpl->fetch( "design:shop/orderview.tpl" );
  89  $Result['path'] = array( array( 'url' => 'shop/orderlist',
  90                                  'text' => ezi18n( 'kernel/shop', 'Order list' ) ),
  91                           array( 'url' => false,
  92                                  'text' => ezi18n( 'kernel/shop', 'Order #%order_id', null, array( '%order_id' => $order->attribute( 'order_nr' ) ) ) ) );
  93  
  94  ?>


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