ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPaymentBaseGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 include_once "./payment/classes/class.ilPaymentVendors.php";
24 
26 {
27  var $ilias;
28  var $lng;
29  var $db;
30  var $tpl;
32  var $tabs_gui;
33 
34  var $user_obj;
35 
36  var $section;
38 
39  function ilPaymentBaseGUI()
40  {
41 
42  global $ilias,$ilDB,$lng,$tpl,$rbacsystem,$ilTabs;
43 
44  $this->ilias =& $ilias;
45  $this->db =& $ilDB;
46  $this->lng =& $lng;
47  $this->tpl =& $tpl;
48 
49  $this->tabs_gui =& $ilTabs;
50 
51  $this->SECTION_STATISTIC = 1;
52  $this->SECTION_OBJECT = 2;
53  $this->SECTION_TRUSTEE = 3;
54  $this->SECTION_SHOPPING_CART = 4;
55  $this->SECTION_BUYED_OBJECTS = 5;
56  $this->SECTION_COUPONS = 6;
57 
58  $this->ADMIN = 4;
59  $this->BASE = 5;
60  }
61 
62  function setSection($a_section)
63  {
64  $this->section = $a_section;
65  }
66  function getSection()
67  {
68  return $this->section;
69  }
70  function setMainSection($a_main_section)
71  {
72  $this->main_section = $a_main_section;
73  }
74  function getMainSection()
75  {
76  return $this->main_section;
77  }
78 
79  function buildHeader()
80  {
81  $this->tpl->addBlockFile("CONTENT", "content", "tpl.payb_content.html");
82 
83  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.gif"),
84  $this->lng->txt("personal_desktop"));
85  $this->tpl->setTitle($this->lng->txt("personal_desktop"));
86 
87 # switch($this->getMainSection())
88 # {
89 # case $this->ADMIN:
90 # $this->tpl->setVariable("HEADER",$this->lng->txt('paya_header'));
91 # break;
92 
93 # case $this->BASE:
94 # $this->tpl->setVariable("HEADER",$this->lng->txt('pay_header'));
95 # break;
96 # }
97 
98 # $this->__buildStylesheet();
99 # $this->__buildStatusline();
100  $this->__buildButtons();
101  }
102 
103 
104 
105  function setTableGUIBasicData(&$tbl,&$result_set,$a_default_order_column = '')
106  {
107  $offset = $_GET["offset"];
108  $order = $_GET["sort_by"];
109  $direction = $_GET["sort_order"];
110 
111  $tbl->setOrderColumn($order,$a_default_order_column);
112  $tbl->setOrderDirection($direction);
113  $tbl->setOffset($offset);
114  $tbl->setLimit($_GET["limit"]);
115  $tbl->setMaxCount(count($result_set));
116  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
117  $tbl->setData($result_set);
118  }
119 
120 
121 
122  // PIRVATE
123  function __buildStatusline()
124  {
125  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
126  $this->__buildLocator();
127  }
128  function __buildLocator()
129  {
130  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
131  $this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
132 
133  $this->tpl->setCurrentBlock("locator_item");
134  $this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
135  $this->tpl->setVariable("LINK_ITEM","../ilias.php?baseClass=ilPersonalDesktopGUI");
136  #$this->tpl->setVariable("LINK_ITEM", "../usr_personaldesktop.php");
137  $this->tpl->parseCurrentBlock();
138 
139  switch($this->getMainSection())
140  {
141  case $this->ADMIN:
142  $this->tpl->setCurrentBlock("locator_item");
143  $this->tpl->setVariable("PREFIX",'>&nbsp;');
144  $this->tpl->setVariable("ITEM", $this->lng->txt("paya_locator"));
145  $this->tpl->setVariable("LINK_ITEM", "./payment.php?view=payment_admin");
146  $this->tpl->parseCurrentBlock();
147  break;
148 
149  case $this->BASE:
150  $this->tpl->setCurrentBlock("locator_item");
151  $this->tpl->setVariable("PREFIX",'>&nbsp;');
152  $this->tpl->setVariable("ITEM", $this->lng->txt("pay_locator"));
153  $this->tpl->setVariable("LINK_ITEM", "./payment.php");
154  $this->tpl->parseCurrentBlock();
155  break;
156  }
157 
158  // CHECK for new mail and info
160 
161  return true;
162  }
163  function __buildStylesheet()
164  {
165  $this->tpl->setVariable("LOCATION_STYLESHEET",ilUtil::getStyleSheetLocation());
166  }
167 
168  function __buildButtons()
169  {
170  $this->tpl->addBlockFile("TABS", "tabs", "tpl.tabs.html");
171 
172  if($this->getMainSection() == $this->ADMIN)
173  {
174  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
175  ilPaymentTrustees::_hasStatisticPermission($this->user_obj->getId()))
176  {
177  $this->tabs_gui->addSubTabTarget('paya_statistic',
178  $this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'),
179  '',
180  '',
181  '',
182  $this->getSection() == $this->SECTION_STATISTIC ? true : false);
183 /* $this->tpl->setCurrentBlock("tab");
184  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_STATISTIC ? 'tabactive' : 'tabinactive');
185  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'));
186  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_statistic'));
187  $this->tpl->parseCurrentBlock();*/
188  }
189  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
190  ilPaymentTrustees::_hasObjectPermission($this->user_obj->getId()))
191  {
192  $this->tabs_gui->addSubTabTarget('paya_object',
193  $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'),
194  '',
195  '',
196  '',
197  $this->getSection() == $this->SECTION_OBJECT ? true : false);
198 /* $this->tpl->setCurrentBlock("tab");
199  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_OBJECT ? 'tabactive' : 'tabinactive');
200  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'));
201  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_object'));
202  $this->tpl->parseCurrentBlock();*/
203  }
204  if(ilPaymentVendors::_isVendor($this->user_obj->getId()))
205  {
206  $this->tabs_gui->addSubTabTarget('paya_trustees',
207  $this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'),
208  '',
209  '',
210  '',
211  $this->getSection() == $this->SECTION_TRUSTEE ? true : false);
212 /* $this->tpl->setCurrentBlock("tab");
213  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_TRUSTEE ? 'tabactive' : 'tabinactive');
214  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'));
215  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_trustees'));
216  $this->tpl->parseCurrentBlock();*/
217  }
218  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
219  ilPaymentTrustees::_hasCouponsPermission($this->user_obj->getId()))
220  {
221  $this->tabs_gui->addSubTabTarget('paya_coupons_coupons',
222  $this->ctrl->getLinkTargetByClass('ilpaymentcoupongui'),
223  '',
224  '',
225  '',
226  $this->getSection() == $this->SECTION_COUPONS ? true : false);
227 /* $this->tpl->setCurrentBlock("tab");
228  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_TRUSTEE ? 'tabactive' : 'tabinactive');
229  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'));
230  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_trustees'));
231  $this->tpl->parseCurrentBlock();*/
232  }
233  }
234  if($this->getMainSection() == $this->BASE)
235  {
236  $this->tabs_gui->addSubTabTarget('paya_shopping_cart',
237  $this->ctrl->getLinkTargetByClass('ilpaymentshoppingcartgui'),
238  '',
239  '',
240  '',
241  $this->getSection() == $this->SECTION_SHOPPING_CART ? true : false);
242 /* $this->tpl->setCurrentBlock("tab");
243  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_SHOPPING_CART ? 'tabactive' : 'tabinactive');
244  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentshoppingcartgui'));
245  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_shopping_cart'));
246  $this->tpl->parseCurrentBlock();*/
247 
248  $this->tabs_gui->addSubTabTarget('paya_buyed_objects',
249  $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui'),
250  '',
251  '',
252  '',
253  $this->getSection() == $this->SECTION_BUYED_OBJECTS ? true : false);
254 /* $this->tpl->setCurrentBlock("tab");
255  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_BUYED_OBJECTS ? 'tabactive' : 'tabinactive');
256  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui'));
257  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_buyed_objects'));
258  $this->tpl->parseCurrentBlock();*/
259  }
260  }
261 
262 }
263 ?>