35 require_once
"./classes/class.ilObjectGUI.php";
51 $this->ctrl->saveParameter($this,array(
"ref_id"));
57 $this->lng->loadLanguageModule(
'payment');
61 $this->ref_id = $a_ref_id;
71 $cmd = $this->ctrl->getCmd();
73 if (!
$cmd = $this->ctrl->getCmd())
87 if($this->object->getType() ==
'crs' && $this->
object->isSubscriptionMembershipLimited())
89 $this->
object->initCourseMemberObject();
91 if($this->object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
106 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_purchase_details.html',
'payment');
108 if($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES)
115 $prices = $this->price_obj->getPrices();
117 if($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId()))
119 $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId());
120 if (is_array($prices) &&
130 $this->tpl->setCurrentBlock(
"shopping_cart");
131 $this->tpl->setVariable(
"LINK_GOTO_SHOPPING_CART",
"ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
132 $this->tpl->setVariable(
"TXT_GOTO_SHOPPING_CART", $this->lng->txt(
'pay_goto_shopping_cart'));
133 # $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
134 $this->tpl->parseCurrentBlock(
"shopping_cart");
137 $this->ctrl->setParameter($this,
"ref_id", $this->pobject->getRefId());
139 # if (!is_array($buyedObject) ||
140 # (is_array($buyedObject) && is_array($prices) && count($prices) > 1))
142 $this->tpl->setVariable(
"DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
145 $this->tpl->setVariable(
"TYPE_IMG",
ilUtil::getImagePath(
'icon_'.$this->object->getType().
'_b.gif'));
146 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_'.$this->object->getType()));
147 $this->tpl->setVariable(
"TITLE",$this->object->getTitle());
151 $this->tpl->setVariable(
"TITLE",$this->lng->txt(
'object_not_found'));
154 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
'info'));
155 switch($this->pobject->getPayMethod())
163 case $this->pobject->PAY_METHOD_BILL:
164 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
165 if (is_array($buyedObject))
167 if (is_array($prices) && count($prices) > 1)
169 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
170 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
175 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
176 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
180 case $this->pobject->PAY_METHOD_BMF:
181 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
182 if (is_array($buyedObject))
184 if (is_array($prices) && count($prices) > 1)
186 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
187 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
192 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
193 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
197 case $this->pobject->PAY_METHOD_PAYPAL:
198 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
199 if (is_array($buyedObject))
201 if (is_array($prices) && count($prices) > 1)
203 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
204 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
209 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
210 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
214 case $this->pobject->PAY_METHOD_EPAY:
215 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
216 if (is_array($buyedObject))
218 if (is_array($prices) && count($prices) > 1)
220 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
221 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
226 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
227 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
232 $this->tpl->setVariable(
"ROWSPAN",count($prices));
233 $this->tpl->setVariable(
"TXT_PRICES",$this->lng->txt(
'prices'));
236 if (is_array($prices))
238 # if (count($prices) > 1)
241 foreach($prices as $price)
245 $placeholderCheckbox =
"CHECKBOX";
246 $placeholderDuration =
"DURATION";
247 $placeholderPrice =
"PRICE";
251 $placeholderCheckbox =
"ROW_CHECKBOX";
252 $placeholderDuration =
"ROW_DURATION";
253 $placeholderPrice =
"ROW_PRICE";
255 $this->tpl->setCurrentBlock(
"price_row");
256 if ($buyedObject[
"price_id"] == $price[
'price_id'])
264 $this->tpl->setVariable($placeholderDuration,$price[
'duration'].
' '.$this->lng->txt(
'paya_months'));
266 $this->tpl->parseCurrentBlock();
270 # else if (!is_array($buyedObject))
272 # foreach($prices as $price)
274 # $this->tpl->setVariable("CHECKBOX",ilUtil::formRadioButton(0,'price_id',$price['price_id']));
275 # $this->tpl->setVariable("DURATION",$price['duration'].' '.$this->lng->txt('paya_months'));
276 # $this->tpl->setVariable("PRICE",ilPaymentPrices::_getPriceString($price['price_id']));
285 if($this->object->getType() ==
'crs' && $this->
object->isSubscriptionMembershipLimited())
287 $this->
object->initCourseMemberObject();
289 if($this->object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
296 if(!isset(
$_POST[
'price_id']))
309 $this->sc_obj->setPriceId((
int)
$_POST[
'price_id']);
310 $this->sc_obj->setPobjectId($this->pobject->getPobjectId());
311 $this->sc_obj->add();
313 # $tmp_obj =& ilObjectFactory::getInstanceByRefId($this->pobject->getRefId());
315 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_purchase_details.html',
'payment');
316 $this->tpl->setCurrentBlock(
"shopping_cart");
317 $this->tpl->setVariable(
"LINK_GOTO_SHOPPING_CART",
"ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
318 $this->tpl->setVariable(
"TXT_GOTO_SHOPPING_CART", $this->lng->txt(
'pay_goto_shopping_cart'));
319 # $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
320 $this->tpl->parseCurrentBlock(
"shopping_cart");
331 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
340 include_once
'./payment/classes/class.ilPaymentObject.php';
348 include_once
'./payment/classes/class.ilPaymentPrices.php';
350 $this->price_obj =&
new ilPaymentPrices($this->pobject->getPobjectId());
357 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.payb_content.html");
359 $this->tpl->setVariable(
"HEADER",$this->object->getTitle());
360 $this->tpl->setVariable(
"DESCRIPTION",$this->object->getDescription());
362 # $this->__buildStylesheet();
363 # $this->__buildStatusline();
368 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
374 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html",
"Services/Locator");
375 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
377 $this->tpl->setCurrentBlock(
"locator_item");
378 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
379 $this->tpl->setVariable(
"LINK_ITEM",
"../repository.php?getlast=true");
380 $this->tpl->parseCurrentBlock();