[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

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

   1  <?php
   2  //
   3  // Definition of  class
   4  //
   5  // Created on: <25-Nov-2002 15:40:10 wy>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  include_once ( "kernel/common/template.php" );
  30  include_once ( "kernel/classes/ezdiscountrule.php" );
  31  include_once ( "lib/ezutils/classes/ezhttppersistence.php" );
  32  
  33  $module =& $Params["Module"];
  34  
  35  $http =& eZHttpTool::instance();
  36  
  37  $discountGroupArray = eZDiscountRule::fetchList();
  38  
  39  if ( $http->hasPostVariable( "AddDiscountGroupButton" ) )
  40  {
  41      $params = array();
  42      $Module->redirectTo( $Module->functionURI( "discountgroupedit" ) );
  43      return;
  44  }
  45  
  46  if ( $http->hasPostVariable( "EditGroupButton" ) && $http->hasPostVariable( "EditGroupID" ) )
  47  {
  48      $Module->redirectTo( $Module->functionURI( "discountgroupedit" ) . "/" . $http->postVariable( "EditGroupID" ) );
  49      return;
  50  }
  51  
  52  if ( $http->hasPostVariable( "RemoveDiscountGroupButton" ) )
  53  {
  54      $discountRuleIDList = $http->postVariable( "discountGroupIDList" );
  55  
  56      $db =& eZDB::instance();
  57      $db->begin();
  58      foreach ( $discountRuleIDList  as $discountRuleID )
  59      {
  60          eZDiscountRule::remove( $discountRuleID );
  61      }
  62      $db->commit();
  63  
  64      // we changed prices of products (no discount now) => remove content caches
  65      include_once ( 'kernel/classes/ezcontentcachemanager.php' );
  66      eZContentCacheManager::clearAllContentCache();
  67  
  68      $module->redirectTo( $module->functionURI( "discountgroup" ) . "/" );
  69      return;
  70  }
  71  $module->setTitle( "View discount group" );
  72  $tpl =& templateInit();
  73  $tpl->setVariable( "discountgroup_array", $discountGroupArray );
  74  $tpl->setVariable( "module", $module );
  75  
  76  $Result = array();
  77  $Result['content'] =& $tpl->fetch( "design:shop/discountgroup.tpl" );
  78  $Result['path'] = array( array( 'url' => '/shop/discountgroup/',
  79                                  'text' => ezi18n( 'kernel/shop', 'Discount group' ) ) );
  80  ?>


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