• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

payment/classes/class.ilPaymentAdminGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00034 include_once "./payment/classes/class.ilPaymentVendors.php";
00035 include_once "./payment/classes/class.ilPaymentBaseGUI.php";
00036 include_once "./payment/classes/class.ilPaymentTrustees.php";
00037 include_once "./payment/classes/class.ilPaymentBillAdminGUI.php";
00038 
00039 
00040 class ilPaymentAdminGUI extends ilPaymentBaseGUI
00041 {
00042         var $ctrl;
00043 
00044         var $user_obj;
00045 
00046         function ilPaymentAdminGUI(&$user_obj)
00047         {
00048                 global $ilCtrl;
00049 
00050                 $this->ctrl =& $ilCtrl;
00051                 
00052                 $this->ilPaymentBaseGUI();
00053                 $this->setMainSection($this->ADMIN);
00054                 
00055                 // Get user object
00056                 $this->user_obj =& $user_obj;
00057         }
00061         function &executeCommand()
00062         {
00063                 global $tree;
00064 
00065                 $cmd = $this->ctrl->getCmd();
00066                 switch ($this->ctrl->getNextClass($this))
00067                 {
00068                         case 'ilpaymenttrusteegui':
00069                                 $this->setSection($this->SECTION_TRUSTEE);
00070                                 $this->buildHeader();
00071 
00072                                 include_once './payment/classes/class.ilPaymentTrusteeGUI.php';
00073 
00074                                 $pt =& new ilPaymentTrusteeGUI($this->user_obj);
00075                                 
00076                                 $this->ctrl->forwardCommand($pt);
00077                         
00078                                 break;
00079 
00080                         case 'ilpaymentobjectgui':
00081                                 $this->setSection($this->SECTION_OBJECT);
00082                                 $this->buildHeader();
00083 
00084                                 include_once './payment/classes/class.ilPaymentObjectGUI.php';
00085 
00086                                 $po =& new ilPaymentObjectGUI($this->user_obj);
00087                                 
00088                                 $this->ctrl->forwardCommand($po);
00089                                 break;
00090 
00091                         case 'ilpaymentstatisticgui':
00092                                 $this->setSection($this->SECTION_STATISTIC);
00093                                 $this->buildHeader();
00094 
00095                                 include_once './payment/classes/class.ilPaymentStatisticGUI.php';
00096 
00097                                 $ps =& new ilPaymentStatisticGUI($this->user_obj);
00098                                 
00099                                 $this->ctrl->forwardCommand($ps);
00100                                 break;
00101 
00102                         case 'ilpaymentbilladmingui':
00103                                 $this->setSection($this->SECTION_OBJECT);
00104                                 $this->buildHeader();
00105 
00106                                 include_once './payment/classes/class.ilPaymentBillAdminGUI.php';
00107 
00108                                 $po =& new ilPaymentBillAdminGUI($this->user_obj,$_GET['pobject_id']);
00109                                 
00110                                 $this->ctrl->forwardCommand($po);
00111                                 break;
00112                                 
00113 
00114                         default:
00115                                 $this->__forwardToDefault();
00116                                 break;
00117                 }
00118         }
00119 
00120         function __forwardToDefault()
00121         {
00122                 
00123                 if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
00124                    ilPaymentTrustees::_hasStatisticPermission($this->user_obj->getId()))
00125                 {
00126                         $this->ctrl->redirectByClass('ilpaymentstatisticgui');
00127                 }
00128                 else if(ilPaymentTrustees::_hasObjectPermission($this->user_obj->getId()))
00129                 {
00130                         $this->ctrl->redirectByClass('ilpaymentobjectgui');
00131                 }
00132                 
00133                 echo 'No access to payment admin';
00134 
00135                 return false;
00136         }
00137 
00138 }
00139 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1