ILIAS  Release_4_0_x_branch Revision 61816
 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", "Services/Locator");
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->tabs_gui->addSubTabTarget('bookings',
179  $this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'),
180  '',
181  '',
182  '',
183  $this->getSection() == $this->SECTION_STATISTIC ? true : false);
184 /* $this->tpl->setCurrentBlock("tab");
185  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_STATISTIC ? 'tabactive' : 'tabinactive');
186  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentstatisticgui'));
187  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_statistic'));
188  $this->tpl->parseCurrentBlock();*/
189  }
190  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
191  ilPaymentTrustees::_hasObjectPermission($this->user_obj->getId()))
192  {
193  $this->tabs_gui->addSubTabTarget('paya_object',
194  $this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'),
195  '',
196  '',
197  '',
198  $this->getSection() == $this->SECTION_OBJECT ? true : false);
199 /* $this->tpl->setCurrentBlock("tab");
200  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_OBJECT ? 'tabactive' : 'tabinactive');
201  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentobjectgui'));
202  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_object'));
203  $this->tpl->parseCurrentBlock();*/
204  }
205  if(ilPaymentVendors::_isVendor($this->user_obj->getId()))
206  {
207  $this->tabs_gui->addSubTabTarget('paya_trustees',
208  $this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'),
209  '',
210  '',
211  '',
212  $this->getSection() == $this->SECTION_TRUSTEE ? true : false);
213 /* $this->tpl->setCurrentBlock("tab");
214  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_TRUSTEE ? 'tabactive' : 'tabinactive');
215  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'));
216  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_trustees'));
217  $this->tpl->parseCurrentBlock();*/
218  }
219  if(ilPaymentVendors::_isVendor($this->user_obj->getId()) or
220  ilPaymentTrustees::_hasCouponsPermission($this->user_obj->getId()))
221  {
222  $this->tabs_gui->addSubTabTarget('paya_coupons_coupons',
223  $this->ctrl->getLinkTargetByClass('ilpaymentcoupongui'),
224  '',
225  '',
226  '',
227  $this->getSection() == $this->SECTION_COUPONS ? true : false);
228 /* $this->tpl->setCurrentBlock("tab");
229  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_TRUSTEE ? 'tabactive' : 'tabinactive');
230  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymenttrusteegui'));
231  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_trustees'));
232  $this->tpl->parseCurrentBlock();*/
233  }
234  }
235  if($this->getMainSection() == $this->BASE)
236  {
237  $this->tabs_gui->addSubTabTarget('paya_shopping_cart',
238  $this->ctrl->getLinkTargetByClass('ilpaymentshoppingcartgui'),
239  '',
240  '',
241  '',
242  $this->getSection() == $this->SECTION_SHOPPING_CART ? true : false);
243 /* $this->tpl->setCurrentBlock("tab");
244  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_SHOPPING_CART ? 'tabactive' : 'tabinactive');
245  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentshoppingcartgui'));
246  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_shopping_cart'));
247  $this->tpl->parseCurrentBlock();*/
248 
249  $this->tabs_gui->addSubTabTarget('paya_buyed_objects',
250  $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui'),
251  '',
252  '',
253  '',
254  $this->getSection() == $this->SECTION_BUYED_OBJECTS ? true : false);
255 /* $this->tpl->setCurrentBlock("tab");
256  $this->tpl->setVariable('TAB_TYPE',$this->getSection() == $this->SECTION_BUYED_OBJECTS ? 'tabactive' : 'tabinactive');
257  $this->tpl->setVariable("TAB_LINK",$this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui'));
258  $this->tpl->setVariable("TAB_TEXT",$this->lng->txt('paya_buyed_objects'));
259  $this->tpl->parseCurrentBlock();*/
260  }
261  }
262 
263 }
264 ?>