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())
85 if($this->object->getType() ==
'crs' && $this->
object->isSubscriptionMembershipLimited())
87 $this->
object->initCourseMemberObject();
89 if($this->object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
100 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_purchase_details.html',
'payment');
102 if($this->pobject->getStatus() == $this->pobject->STATUS_EXPIRES)
109 $prices = $this->price_obj->getPrices();
111 if($this->sc_obj->isInShoppingCart($this->pobject->getPobjectId()))
113 $buyedObject = $this->sc_obj->getEntry($this->pobject->getPobjectId());
114 if (is_array($prices) &&
124 $this->tpl->setCurrentBlock(
"shopping_cart");
125 $this->tpl->setVariable(
"LINK_GOTO_SHOPPING_CART",
"ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
126 $this->tpl->setVariable(
"TXT_GOTO_SHOPPING_CART", $this->lng->txt(
'pay_goto_shopping_cart'));
127 # $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
128 $this->tpl->parseCurrentBlock(
"shopping_cart");
131 $this->ctrl->setParameter($this,
"ref_id", $this->pobject->getRefId());
133 # if (!is_array($buyedObject) ||
134 # (is_array($buyedObject) && is_array($prices) && count($prices) > 1))
136 $this->tpl->setVariable(
"DETAILS_FORMACTION",$this->ctrl->getFormAction($this));
137 $this->tpl->setVariable(
"TYPE_IMG",
ilUtil::getImagePath(
'icon_'.$this->object->getType().
'_b.gif'));
138 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'obj_'.$this->object->getType()));
139 $this->tpl->setVariable(
"TITLE",$this->object->getTitle());
142 $this->tpl->setVariable(
"TXT_INFO",$this->lng->txt(
'info'));
143 switch($this->pobject->getPayMethod())
145 case $this->pobject->PAY_METHOD_BILL:
146 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_bill'));
147 $this->tpl->setVariable(
"INPUT_CMD",
'getBill');
148 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_get_bill'));
151 case $this->pobject->PAY_METHOD_BMF:
152 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
153 if (is_array($buyedObject))
155 if (is_array($prices) && count($prices) > 1)
157 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
158 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
163 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
164 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
168 case $this->pobject->PAY_METHOD_PAYPAL:
169 $this->tpl->setVariable(
"INFO_PAY",$this->lng->txt(
'pay_info'));
170 if (is_array($buyedObject))
172 if (is_array($prices) && count($prices) > 1)
174 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
175 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_change_price'));
180 $this->tpl->setVariable(
"INPUT_CMD",
'addToShoppingCart');
181 $this->tpl->setVariable(
"INPUT_VALUE",$this->lng->txt(
'pay_add_to_shopping_cart'));
186 $this->tpl->setVariable(
"ROWSPAN",count($prices));
187 $this->tpl->setVariable(
"TXT_PRICES",$this->lng->txt(
'prices'));
190 if (is_array($prices))
192 # if (count($prices) > 1)
195 foreach($prices as $price)
199 $placeholderCheckbox =
"CHECKBOX";
200 $placeholderDuration =
"DURATION";
201 $placeholderPrice =
"PRICE";
205 $placeholderCheckbox =
"ROW_CHECKBOX";
206 $placeholderDuration =
"ROW_DURATION";
207 $placeholderPrice =
"ROW_PRICE";
209 $this->tpl->setCurrentBlock(
"price_row");
210 if ($buyedObject[
"price_id"] == $price[
'price_id'])
218 $this->tpl->setVariable($placeholderDuration,$price[
'duration'].
' '.$this->lng->txt(
'paya_months'));
220 $this->tpl->parseCurrentBlock();
224 # else if (!is_array($buyedObject))
226 # foreach($prices as $price)
228 # $this->tpl->setVariable("CHECKBOX",ilUtil::formRadioButton(0,'price_id',$price['price_id']));
229 # $this->tpl->setVariable("DURATION",$price['duration'].' '.$this->lng->txt('paya_months'));
230 # $this->tpl->setVariable("PRICE",ilPaymentPrices::_getPriceString($price['price_id']));
239 if($this->object->getType() ==
'crs' && $this->
object->isSubscriptionMembershipLimited())
241 $this->
object->initCourseMemberObject();
243 if($this->object->getSubscriptionMaxMembers() <= $this->
object->members_obj->getCountMembers())
250 if(!isset($_POST[
'price_id']))
263 $this->sc_obj->setPriceId((
int) $_POST[
'price_id']);
264 $this->sc_obj->setPobjectId($this->pobject->getPobjectId());
265 $this->sc_obj->add();
267 # $tmp_obj =& ilObjectFactory::getInstanceByRefId($this->pobject->getRefId());
269 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.pay_purchase_details.html',
'payment');
270 $this->tpl->setCurrentBlock(
"shopping_cart");
271 $this->tpl->setVariable(
"LINK_GOTO_SHOPPING_CART",
"ilias.php?cmdClass=ilpaymentgui&baseClass=ilPersonalDesktopGUI&cmd=showShoppingCart");
272 $this->tpl->setVariable(
"TXT_GOTO_SHOPPING_CART", $this->lng->txt(
'pay_goto_shopping_cart'));
273 # $this->tpl->setVariable("TXT_BUY", $this->lng->txt('pay_click_to_buy'));
274 $this->tpl->parseCurrentBlock(
"shopping_cart");
285 include_once
'./payment/classes/class.ilPaymentShoppingCart.php';
294 include_once
'./payment/classes/class.ilPaymentObject.php';
302 include_once
'./payment/classes/class.ilPaymentPrices.php';
304 $this->price_obj =&
new ilPaymentPrices($this->pobject->getPobjectId());
311 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.payb_content.html");
313 $this->tpl->setVariable(
"HEADER",$this->object->getTitle());
314 $this->tpl->setVariable(
"DESCRIPTION",$this->object->getDescription());
316 # $this->__buildStylesheet();
317 # $this->__buildStatusline();
322 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
328 $this->tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html");
329 $this->tpl->setVariable(
"TXT_LOCATOR",$this->lng->txt(
"locator"));
331 $this->tpl->setCurrentBlock(
"locator_item");
332 $this->tpl->setVariable(
"ITEM", $this->lng->txt(
"repository"));
333 $this->tpl->setVariable(
"LINK_ITEM",
"../repository.php?getlast=true");
334 $this->tpl->parseCurrentBlock();