ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPurchaseBMFGUI Class Reference
+ Collaboration diagram for ilPurchaseBMFGUI:

Public Member Functions

 ilPurchaseBMFGUI (&$user_obj)
 cancel ()
 showPersonalData ()
 getPersonalData ()
 showPaymentType ()
 getPaymentType ()
 showDebitEntry ()
 getDebitEntry ()
 sendDebitEntry ()
 showCreditCard ()
 getCreditCard ()
 sendCreditCard ()
executeCommand ()
 execute command
 __sendBill ($customer, $paymentType, $bookingList, $result)
 __addBookings ($a_result, $a_transaction)
 __emptyShoppingCart ()
 __clearSession ()
 __loadTemplate ()
 __buildStatusline ()
 __buildLocator ()
 __buildStylesheet ()
 __showCountries (&$tpl, $value="")
 shows select box f�r countries
 __getCountries ()
 __getCountryCode ($value="")
 __getCountryName ($value="")
 __showShoppingCart ()
__initTableGUI ()
 __showItemsTable ($a_result_set)

Data Fields

 $ctrl
 $tpl
 $user_obj
 $coupon_obj = null
 $error
 $shoppingCart
 $soapClient

Private Attributes

 $totalVat = 0

Detailed Description

Definition at line 40 of file class.ilPurchaseBMFGUI.php.

Member Function Documentation

ilPurchaseBMFGUI::__addBookings (   $a_result,
  $a_transaction 
)

Definition at line 1257 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $key, ilPayMethods\_enabled(), ilPaymentPrices\_getPrice(), ilPaymentPrices\_getPriceString(), ilPaymentPrices\_getPriceStringFromAmount(), ilShopVats\getRate(), and PAY_METHOD_BMF.

Referenced by sendCreditCard(), and sendDebitEntry().

{
global $ilObjDataCache;
include_once './payment/classes/class.ilPaymentBookings.php';
include_once './payment/classes/class.ilPaymentShoppingCart.php';
include_once './payment/classes/class.ilPaymentObject.php';
include_once './payment/classes/class.ilPaymentPrices.php';
include_once './Services/Payment/classes/class.ilShopUtils.php';
$booking_obj =& new ilPaymentBookings();
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
$items = $sc_obj->getEntries(PAY_METHOD_BMF);
$sc_obj->clearCouponItemsSession();
foreach($items as $entry)
{
$pobject =& new ilPaymentObject($this->user_obj,$entry['pobject_id']);
$price = ilPaymentPrices::_getPrice($entry['price_id']);
if (!empty($_SESSION["coupons"]["bmf"]))
{
$entry["math_price"] = $entry['price']; // (float) ilPaymentPrices::_getPriceFromArray($price);
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
{
$_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += $entry['price']; //(float) ilPaymentPrices::_getPriceFromArray($price);
$_SESSION["coupons"]["bmf"][$key]["items"][] = $entry;
}
}
}
unset($pobject);
}
$coupon_discount_items = $sc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
$i = 0;
foreach($items as $entry)
{
$pobject =& new ilPaymentObject($this->user_obj,$entry['pobject_id']);
$price = ilPaymentPrices::_getPrice($entry['price_id']);
if (array_key_exists($entry["pobject_id"], $coupon_discount_items))
{
$bonus = $coupon_discount_items[$entry["pobject_id"]]["math_price"] - $coupon_discount_items[$entry["pobject_id"]]["discount_price"];
}
$booking_obj->setTransaction($a_transaction);
$booking_obj->setPobjectId($entry['pobject_id']);
$booking_obj->setCustomerId($this->user_obj->getId());
$booking_obj->setVendorId($pobject->getVendorId());
$booking_obj->setPayMethod($pobject->getPayMethod());
$booking_obj->setOrderDate(time());
$booking_obj->setDuration($price['duration']);
$booking_obj->setPrice(ilPaymentPrices::_getPriceString($entry['price_id']));
//$booking_obj->setDiscount($bonus > 0 ? ilPaymentPrices::_getPriceStringFromAmount((-1) * $bonus) : "");
$booking_obj->setDiscount($bonus > 0 ? ilPaymentPrices::_getPriceStringFromAmount((-1) * $bonus) : 0);
$booking_obj->setPayed(1);
$booking_obj->setAccess(1);
$booking_obj->setVoucher($a_result->buchungsListe->buchungen[$i++]->belegNr);
$booking_obj->setTransactionExtern($a_result->buchungsListe->kassenzeichen);
$obj_id = $ilObjDataCache->lookupObjId($pobject->getRefId());
$obj_title = $ilObjDataCache->lookupTitle($obj_id);
$oVAT = new ilShopVats((int)$pobject->getVatId());
$obj_vat_rate = $oVAT->getRate();
$obj_vat_unit = $pobject->getVat(ilPaymentPrices::_getPriceString($entry['price_id']));
$booking_obj->setObjectTitle($obj_title);
$booking_obj->setVatRate($obj_vat_rate);
$booking_obj->setVatUnit($obj_vat_unit);
//sets the customers address for the bill if enabled in administration
include_once './payment/classes/class.ilPayMethods.php';
$save_user_adr_bmf = (int) ilPayMethods::_enabled('save_user_adr_bmf') ? 1 : 0;
if($save_user_adr_bmf == 1)
{
$booking_obj->setStreet($_SESSION['bmf']['personal_data']['street'], $_SESSION['bmf']['personal_data']['house_number']);
$booking_obj->setPoBox($_SESSION['bmf']['personal_data']['po_box']);
$booking_obj->setZipcode($_SESSION['bmf']['personal_data']['zipcode']);
$booking_obj->setCity($_SESSION['bmf']['personal_data']['city']);
$booking_obj->setCountry($_SESSION['bmf']['personal_data']['country']);
}
$current_booking_id = $booking_obj->add();
if (!empty($_SESSION["coupons"]["bmf"]) && $current_booking_id)
{
foreach ($_SESSION["coupons"]["bmf"] as $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
if ($this->coupon_obj->isObjectAssignedToCoupon($pobject->getRefId()))
{
$this->coupon_obj->addCouponForBookingId($current_booking_id);
}
}
}
unset($current_booking_id);
unset($pobject);
}
if (!empty($_SESSION["coupons"]["bmf"]))
{
foreach ($_SESSION["coupons"]["bmf"] as $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$this->coupon_obj->addTracking();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__buildLocator ( )

Definition at line 1416 of file class.ilPurchaseBMFGUI.php.

References ilUtil\sendInfo().

{
$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
$this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
$this->tpl->setCurrentBlock("locator_item");
$this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
$this->tpl->setVariable("LINK_ITEM","../ilias.php?baseClass=ilPersonalDesktopGUI");
#$this->tpl->setVariable("LINK_ITEM", "../usr_personaldesktop.php");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("locator_item");
$this->tpl->setVariable("PREFIX",'> ');
# $this->tpl->setVariable("ITEM", $this->lng->txt("pay_locator"));
$this->tpl->setVariable("ITEM", "Payment");
$this->tpl->setVariable("LINK_ITEM", "./payment.php");
$this->tpl->parseCurrentBlock();
// CHECK for new mail and info
return true;
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::__buildStatusline ( )

Definition at line 1410 of file class.ilPurchaseBMFGUI.php.

Referenced by __loadTemplate().

{
$this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
# $this->__buildLocator();
}

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__buildStylesheet ( )

Definition at line 1440 of file class.ilPurchaseBMFGUI.php.

References ilUtil\getStyleSheetLocation().

Referenced by __loadTemplate().

{
$this->tpl->setVariable("LOCATION_STYLESHEET",ilUtil::getStyleSheetLocation());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__clearSession ( )

Definition at line 1394 of file class.ilPurchaseBMFGUI.php.

References $_SESSION.

Referenced by sendCreditCard(), and sendDebitEntry().

{
$_SESSION["coupons"]["bmf"] = "";
$_SESSION["bmf"]["payment_type"] = "";
$_SESSION["bmf"]["debit_entry"] = array();
$_SESSION["bmf"]["credit_card"] = array();
}

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__emptyShoppingCart ( )

Definition at line 1385 of file class.ilPurchaseBMFGUI.php.

Referenced by sendCreditCard(), and sendDebitEntry().

{
include_once './payment/classes/class.ilPaymentShoppingCart.php';
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
return $sc_obj->emptyShoppingCart();
}

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__getCountries ( )

Definition at line 1467 of file class.ilPurchaseBMFGUI.php.

References $lng.

Referenced by __getCountryCode(), __getCountryName(), and __showCountries().

{
global $lng;
$lng->loadLanguageModule("meta");
$cntcodes = array ("DE","ES","FR","GB","AT","CH","AF","AL","DZ","AS","AD","AO",
"AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY",
"BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","IO","BN","BG","BF",
"BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM",
"CG","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","TP","EC",
"EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","FX","GF","PF",
"TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GN",
"GW","GY","HT","HM","HN","HU","IS","IN","ID","IR","IQ","IE","IL","IT",
"JM","JP","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS",
"LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH",
"MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","MA","MZ","MM","NA",
"NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM",
"PK","PW","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO",
"RU","RW","KN","LC","VC","WS","SM","ST","SA","CH","SN","SC","SL","SG",
"SK","SI","SB","SO","ZA","GS","ES","LK","SH","PM","SD","SR","SJ","SZ",
"SE","SY","TW","TJ","TZ","TH","TG","TK","TO","TT","TN","TR","TM","TC",
"TV","UG","UA","AE","GB","UY","US","UM","UZ","VU","VA","VE","VN","VG",
"VI","WF","EH","YE","ZR","ZM","ZW");
$cntrs = array();
foreach($cntcodes as $cntcode)
{
$cntrs[$cntcode] = $lng->txt("meta_c_".$cntcode);
}
asort($cntrs);
return $cntrs;
}

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__getCountryCode (   $value = "")

Definition at line 1500 of file class.ilPurchaseBMFGUI.php.

References __getCountries().

Referenced by ilPurchaseBMFGUI().

{
$countries = $this->__getCountries();
foreach($countries as $code => $text)
{
if ($text == $value)
{
return $code;
}
}
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__getCountryName (   $value = "")

Definition at line 1513 of file class.ilPurchaseBMFGUI.php.

References __getCountries().

Referenced by __sendBill().

{
$countries = $this->__getCountries();
return $countries[$value];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilPurchaseBMFGUI::__initTableGUI ( )

Definition at line 1640 of file class.ilPurchaseBMFGUI.php.

Referenced by __showItemsTable().

{
include_once "./Services/Table/classes/class.ilTableGUI.php";
return new ilTableGUI(0,false);
}

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__loadTemplate ( )

Definition at line 1402 of file class.ilPurchaseBMFGUI.php.

References __buildStatusline(), and __buildStylesheet().

Referenced by ilPurchaseBMFGUI().

{
$this->tpl->addBlockFile("CONTENT", "content", "tpl.payb_content.html");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__sendBill (   $customer,
  $paymentType,
  $bookingList,
  $result 
)

Definition at line 1082 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $key, $result, $totalVat, $tpl, __getCountryName(), ilShopUtils\_formatFloat(), ilShopUtils\_formatVAT(), ilMimeMail\From(), ilUtil\html2pdf(), and ilUtil\makeDir().

Referenced by sendCreditCard(), and sendDebitEntry().

{
include_once './classes/class.ilTemplate.php';
include_once "./Services/Utilities/classes/class.ilUtil.php";
include_once './payment/classes/class.ilGeneralSettings.php';
include_once './payment/classes/class.ilPaymentShoppingCart.php';
include_once 'Services/Mail/classes/class.ilMimeMail.php';
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
$genSet = new ilGeneralSettings();
$tpl = new ilTemplate("./payment/templates/default/tpl.pay_bmf_bill.html", true, true, true);
$tpl->setVariable("VENDOR_ADDRESS", nl2br(utf8_decode($genSet->get("address"))));
$tpl->setVariable("VENDOR_ADD_INFO", nl2br(utf8_decode($genSet->get("add_info"))));
$tpl->setVariable("VENDOR_BANK_DATA", nl2br(utf8_decode($genSet->get("bank_data"))));
$tpl->setVariable("TXT_BANK_DATA", utf8_decode($this->lng->txt("pay_bank_data")));
$tpl->setVariable("CUSTOMER_FIRSTNAME", $customer->vorname);
$tpl->setVariable("CUSTOMER_LASTNAME", $customer->nachname);
if ($customer->rechnungsAdresse->strasse != "" &&
$customer->rechnungsAdresse->hausNr != "")
{
$tpl->setVariable("CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->strasse . " ". $customer->rechnungsAdresse->hausNr);
}
else
{
$tpl->setVariable("CUSTOMER_STREET_POBOX", $customer->rechnungsAdresse->postfach);
}
$tpl->setVariable("CUSTOMER_ZIPCODE", $customer->rechnungsAdresse->PLZ);
$tpl->setVariable("CUSTOMER_CITY", $customer->rechnungsAdresse->ort);
$tpl->setVariable("CUSTOMER_COUNTRY", $this->__getCountryName($customer->rechnungsAdresse->land));
$tpl->setVariable("BILL_NO", $result->buchungsListe->kassenzeichen);
$tpl->setVariable("DATE", date("d.m.Y"));
$tpl->setVariable("TXT_BILL", utf8_decode($this->lng->txt("pays_bill")));
$tpl->setVariable("TXT_BILL_NO", utf8_decode($this->lng->txt("pay_bill_no")));
$tpl->setVariable("TXT_DATE", utf8_decode($this->lng->txt("date")));
$tpl->setVariable("TXT_ARTICLE", utf8_decode($this->lng->txt("pay_article")));
$tpl->setVariable('TXT_VAT_RATE', utf8_decode($this->lng->txt('vat_rate')));
$tpl->setVariable('TXT_VAT_UNIT', utf8_decode($this->lng->txt('vat_unit')));
$tpl->setVariable("TXT_PRICE", utf8_decode($this->lng->txt("price_a")));
$bookEntries = $sc_obj->getShoppingCart();
for ($i = 0; $i < count($bookEntries); $i++)
{
$tmp_pobject =& new ilPaymentObject($this->user_obj, $bookEntries[$i]['pobject_id']);
$assigned_coupons = '';
if (!empty($_SESSION["coupons"]["bmf"]))
{
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$assigned_coupons .= '<br />' . $this->lng->txt('paya_coupons_coupon') . ': ' . $coupon["pcc_code"];
}
}
}
$tpl->setCurrentBlock("loop");
$tpl->setVariable("LOOP_OBJ_TYPE", utf8_decode($this->lng->txt($bookEntries[$i]["typ"])));
$tpl->setVariable("LOOP_TITLE", $bookEntries[$i]["buchungstext"]. $assigned_coupons);
$tpl->setVariable("LOOP_TXT_ENTITLED_RETRIEVE", utf8_decode($this->lng->txt("pay_entitled_retrieve")));
$tpl->setVariable("LOOP_DURATION", $bookEntries[$i]["dauer"] . " " . utf8_decode($this->lng->txt("paya_months")));
$tpl->setVariable('LOOP_VAT_RATE', ilShopUtils::_formatVAT($bookEntries[$i]['vat_rate']));
$tpl->setVariable('LOOP_VAT_UNIT', ilShopUtils::_formatFloat($bookEntries[$i]['vat_unit']).' '.$genSet->get('currency_unit'));
$totalVat += (float)$bookEntries[$i]['vat_unit'];
$tpl->setVariable("LOOP_PRICE", number_format($bookEntries[$i]["betrag"], 2, ",", ".") . " " . $genSet->get("currency_unit"));
$tpl->parseCurrentBlock("loop");
unset($tmp_pobject);
}
if (!empty($_SESSION["coupons"]["bmf"]))
{
if (count($items = $bookEntries))
{
$sub_total_amount = $bookingList->betrag;
foreach ($_SESSION["coupons"]["bmf"] as $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$total_object_price = 0.0;
$current_coupon_bonus = 0.0;
foreach ($bookEntries as $item)
{
$tmp_pobject =& new ilPaymentObject($this->user_obj, $item['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$total_object_price += $item["betrag"];
}
unset($tmp_pobject);
}
$current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
$sub_total_amount += $current_coupon_bonus;
$tpl->setCurrentBlock("cloop");
$tpl->setVariable("TXT_COUPON", utf8_decode($this->lng->txt("paya_coupons_coupon") . " " . $coupon["pcc_code"]));
$tpl->setVariable("BONUS", number_format($current_coupon_bonus * (-1), 2, ',', '.') . " " . $genSet->get("currency_unit"));
$tpl->parseCurrentBlock();
}
$tpl->setVariable("TXT_SUBTOTAL_AMOUNT", utf8_decode($this->lng->txt("pay_bmf_subtotal_amount")));
$tpl->setVariable("SUBTOTAL_AMOUNT", number_format($sub_total_amount, 2, ",", ".") . " " . $genSet->get("currency_unit"));
}
}
if ($bookingList->betrag < 0) $bookingList->betrag = 0.0;
$tpl->setVariable("TXT_TOTAL_AMOUNT", utf8_decode($this->lng->txt("pay_bmf_total_amount")));
$tpl->setVariable("TOTAL_AMOUNT", number_format($bookingList->betrag, 2, ",", ".") . " " . $genSet->get("currency_unit"));
if ($this->totalVat > 0)
{
$tpl->setVariable("TOTAL_VAT", ilShopUtils::_formatFloat($totalVat) . " " . $genSet->get('currency_unit'));
$tpl->setVariable("TXT_TOTAL_VAT", utf8_decode($this->lng->txt("pay_bmf_vat_included")));
}
if ($paymentType == "debit_entry")
{
$tpl->setVariable("TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt("pay_payed_debit_entry")));
}
else
{
$tpl->setVariable("TXT_PAYMENT_TYPE", utf8_decode($this->lng->txt("pay_payed_credit_card")));
}
if (!@file_exists($genSet->get("pdf_path")))
{
ilUtil::makeDir($genSet->get("pdf_path"));
}
if (@file_exists($genSet->get("pdf_path")))
{
ilUtil::html2pdf($tpl->get(), $genSet->get("pdf_path") . "/" . $result->buchungsListe->kassenzeichen . ".pdf");
}
if (@file_exists($genSet->get("pdf_path") . "/" . $result->buchungsListe->kassenzeichen . ".pdf") &&
$customer->EMailAdresse != "" &&
$this->ilias->getSetting("admin_email") != "")
{
$m= new ilMimeMail; // create the mail
$m->From( $this->ilias->getSetting("admin_email") );
$m->To( $customer->EMailAdresse );
$m->Subject( $this->lng->txt("pay_message_subject") );
$message = $this->lng->txt("pay_message_hello") . " " . utf8_encode($customer->vorname) . " " . utf8_encode($customer->nachname) . ",\n\n";
$message .= $this->lng->txt("pay_message_thanks") . "\n\n";
$message .= $this->lng->txt("pay_message_attachment") . "\n\n";
$message .= $this->lng->txt("pay_message_regards") . "\n\n";
$message .= strip_tags($genSet->get("address"));
$m->Body( $message ); // set the body
$m->Attach( $genSet->get("pdf_path") . "/" . $result->buchungsListe->kassenzeichen . ".pdf", "application/pdf" ) ; // attach a file of type image/gif
$m->Send(); // send the mail
}
@unlink($genSet->get("pdf_path") . "/" . $result->buchungsListe->kassenzeichen . ".html");
@unlink($genSet->get("pdf_path") . "/" . $result->buchungsListe->kassenzeichen . ".pdf");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__showCountries ( $tpl,
  $value = "" 
)

shows select box f�r countries

Definition at line 1448 of file class.ilPurchaseBMFGUI.php.

References $tpl, and __getCountries().

Referenced by showPersonalData().

{
$countries = $this->__getCountries();
foreach($countries as $code => $text)
{
$tpl->setCurrentBlock("loop_countries");
$tpl->setVariable("LOOP_COUNTRIES", $code);
$tpl->setVariable("LOOP_COUNTRIES_TXT", $text);
if ($value != "" &&
$value == $code)
{
$tpl->setVariable("LOOP_COUNTRIES_SELECTED", " selected");
}
$tpl->parseCurrentBlock("loop_countries");
}
$tpl->setVariable("TXT_PLEASE_SELECT", $this->lng->txt("pay_bmf_please_select"));
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__showItemsTable (   $a_result_set)

Definition at line 1647 of file class.ilPurchaseBMFGUI.php.

References $_GET, $_SESSION, $tpl, __initTableGUI(), ilShopUtils\_formatFloat(), ilPaymentPrices\_getPrice(), and PAY_METHOD_BMF.

Referenced by __showShoppingCart().

{
include_once './payment/classes/class.ilGeneralSettings.php';
$genSet = new ilGeneralSettings();
$tbl =& $this->__initTableGUI();
$tpl =& $tbl->getTemplateObject();
// SET FORMAACTION
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("paya_shopping_cart"),"icon_pays_b.gif",$this->lng->txt("paya_shopping_cart"));
$tbl->setHeaderNames(array($this->lng->txt("title"),
$this->lng->txt("duration"),
$this->lng->txt('vat_rate'),
$this->lng->txt('vat_unit'),
$this->lng->txt("price_a")));
$tbl->setHeaderVars(array("title",
"duration",
"vat_rate",
"vat_unit",
"price"),
array("cmd" => "",
"cmdClass" => "ilpurchasebmfgui",
"cmdNode" => $_GET["cmdNode"]));
$tbl->disable("footer");
$tbl->disable("sort");
$tbl->disable("linkbar");
$offset = $_GET["offset"];
$order = $_GET["sort_by"];
$direction = $_GET["sort_order"] ? $_GET['sort_order'] : 'desc';
$tbl->setOrderColumn($order,'title');
$tbl->setOrderDirection($direction);
$tbl->setOffset($offset);
$tbl->setLimit($_GET["limit"]);
$tbl->setMaxCount(count($a_result_set));
# $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
$tbl->setData($a_result_set);
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
$totalAmount = $sc_obj->getTotalAmount();
$tpl->setCurrentBlock("tbl_footer_linkbar");
$amount .= "<table class=\"\" style=\"float: right;\">\n";
if (!empty($_SESSION["coupons"]["bmf"]))
{
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if (count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$amount .= "<tr>\n";
$amount .= "<td>\n";
$amount .= "<b>" . $this->lng->txt("pay_bmf_subtotal_amount") . ":";
$amount .= "</td>\n";
$amount .= "<td>\n";
$amount .= number_format($totalAmount[PAY_METHOD_BMF], 2, ',', '.') . " " . $genSet->get("currency_unit") . "</b>";
$amount .= "</td>\n";
$amount .= "</tr>\n";
foreach ($_SESSION["coupons"]["bmf"] as $coupon)
{
$this->coupon_obj->setCurrentCoupon($coupon);
$this->coupon_obj->setId($coupon["pc_pk"]);
$total_object_price = 0.0;
$current_coupon_bonus = 0.0;
foreach ($items as $item)
{
$tmp_pobject =& new ilPaymentObject($this->user_obj, $item['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$price_data = ilPaymentPrices::_getPrice($item['price_id']);
$price = (float) $price_data["price"];
$total_object_price += $price;
}
unset($tmp_pobject);
}
$current_coupon_bonus = $this->coupon_obj->getCouponBonus($total_object_price);
$totalAmount[PAY_METHOD_BMF] += $current_coupon_bonus * (-1);
$amount .= "<tr>\n";
$amount .= "<td>\n";
$amount .= $this->lng->txt("paya_coupons_coupon") . " " . $coupon["pcc_code"] . ":";
$amount .= "</td>\n";
$amount .= "<td>\n";
$amount .= number_format($current_coupon_bonus * (-1), 2, ',', '.') . " " . $genSet->get("currency_unit");
$amount .= "</td>\n";
$amount .= "</tr>\n";
}
if ($totalAmount[PAY_METHOD_BMF] < 0)
{
$totalAmount[PAY_METHOD_BMF] = 0;
$this->totalVat = 0;
}
}
}
$amount .= "<tr>\n";
$amount .= "<td>\n";
$amount .= "<b>" . $this->lng->txt("pay_bmf_total_amount") . ":";
$amount .= "</td>\n";
$amount .= "<td>\n";
$amount .= number_format($totalAmount[PAY_METHOD_BMF], 2, ',', '.') . " " . $genSet->get("currency_unit");
$amount .= "</td>\n";
$amount .= "</tr>\n";
if ($this->totalVat > 0)
{
$amount .= "<tr>\n";
$amount .= "<td>\n";
$amount .= $this->lng->txt('pay_bmf_vat_included') . ":";
$amount .= "</td>\n";
$amount .= "<td>\n";
$amount .= ilShopUtils::_formatFloat($this->totalVat) . " " . $genSet->get('currency_unit');
$amount .= "</td>\n";
$amount .= "</tr>\n";
}
$amount .= "</table>\n";
$tpl->setVariable("LINKBAR", $amount);
$tpl->parseCurrentBlock("tbl_footer_linkbar");
$tpl->setCurrentBlock('tbl_footer');
$tpl->setVariable('COLUMN_COUNT',5);
$tpl->parseCurrentBlock();
$tbl->render();
$this->tpl->setVariable("ITEMS_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::__showShoppingCart ( )

Definition at line 1571 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $key, __showItemsTable(), ilShopUtils\_formatVAT(), ilPaymentPrices\_getPrice(), ilPaymentPrices\_getPriceString(), ilObjectFactory\getInstanceByRefId(), PAY_METHOD_BMF, and ilUtil\sendInfo().

Referenced by showCreditCard(), and showDebitEntry().

{
include_once './payment/classes/class.ilGeneralSettings.php';
$genSet = new ilGeneralSettings();
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
$counter = 0;
foreach($items as $item)
{
$tmp_pobject =& new ilPaymentObject($this->user_obj,$item['pobject_id']);
$tmp_obj =& ilObjectFactory::getInstanceByRefId($tmp_pobject->getRefId());
$price_arr = ilPaymentPrices::_getPrice($item['price_id']);
$assigned_coupons = '';
if (!empty($_SESSION["coupons"]["bmf"]))
{
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$assigned_coupons .= '<br />' . $this->lng->txt('paya_coupons_coupon') . ': ' . $coupon["pcc_code"];
}
}
}
$f_result[$counter][] = $tmp_obj->getTitle();
if ($assigned_coupons != '') $f_result[$counter][count($f_result[$counter]) - 1] .= $assigned_coupons;
// $f_result[$counter][] = $price_arr['duration'] . " " . $this->lng->txt("paya_months");
if($price_arr['duration'] == 0)
{
$f_result[$counter][] = $this->lng->txt('unlimited_duration');
}
else
{
$f_result[$counter][] = $price_arr['duration'] . ' ' . $this->lng->txt('paya_months');
}
$oVAT = new ilShopVats((int)$tmp_pobject->getVatId());
$f_result[$counter][] = ilShopUtils::_formatVAT($oVAT->getRate());
$float_price = $price_arr['price'];
$f_result[$counter][] = $tmp_pobject->getVat($float_price, 'GUI').' '.$genSet->get('currency_unit');
$this->totalVat = $this->totalVat + $tmp_pobject->getVat($float_price);
$f_result[$counter][] = ilPaymentPrices::_getPriceString($item['price_id']);
unset($tmp_obj);
unset($tmp_pobject);
++$counter;
}
return $this->__showItemsTable($f_result);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::cancel ( )

Definition at line 106 of file class.ilPurchaseBMFGUI.php.

References ilUtil\redirect().

{
ilUtil::redirect("./payment.php");
}

+ Here is the call graph for this function:

& ilPurchaseBMFGUI::executeCommand ( )

execute command

Definition at line 1062 of file class.ilPurchaseBMFGUI.php.

References $cmd.

{
global $tree;
$cmd = $this->ctrl->getCmd();
switch ($this->ctrl->getNextClass($this))
{
default:
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'showPersonalData';
}
$this->$cmd();
break;
}
}
ilPurchaseBMFGUI::getCreditCard ( )

Definition at line 836 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, sendCreditCard(), ilUtil\sendInfo(), and showCreditCard().

{
if ($_POST["card_holder"] == "" ||
$_POST["card_number"]["block_1"] == "" ||
$_POST["card_number"]["block_2"] == "" ||
$_POST["card_number"]["block_3"] == "" ||
$_POST["card_number"]["block_4"] == "" ||
$_POST["validity"]["month"] == "" ||
$_POST["validity"]["year"] == "" ||
$_POST["validity"]["year"]."-".$_POST["validity"]["month"] < date("Y-m"))
{
$this->error = $this->lng->txt('pay_bmf_credit_card_not_valid');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
if ($_POST["terms_conditions"] != 1)
{
$this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
if ($_POST["password"] == "" ||
md5($_POST["password"]) != $this->user_obj->getPasswd())
{
$this->error = $this->lng->txt('pay_bmf_password_not_valid');
ilUtil::sendInfo($this->error);
$this->showCreditCard();
return;
}
$_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] = $_POST["validity"]["month"];
$_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] = $_POST["validity"]["year"];
$_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_POST["card_holder"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_1"] = $_POST["card_number"]["block_1"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_2"] = $_POST["card_number"]["block_2"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_3"] = $_POST["card_number"]["block_3"];
$_SESSION["bmf"]["credit_card"]["kreditkartenNr"]["block_4"] = $_POST["card_number"]["block_4"];
$_SESSION["bmf"]["credit_card"]["kartenpruefnummer"] = $_POST["check_number"];
# zum testen
$this->error = "";
$this->sendCreditCard();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getDebitEntry ( )

Definition at line 428 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, sendDebitEntry(), ilUtil\sendInfo(), and showDebitEntry().

{
if ($_POST["account_holder"] == "" ||
$_POST["bank_code"] == "" ||
$_POST["account_number"] == "")
{
$this->error = $this->lng->txt('pay_bmf_debit_entry_not_valid');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
if ($_POST["terms_conditions"] != 1)
{
$this->error = $this->lng->txt('pay_bmf_check_terms_conditions');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
if ($_POST["password"] == "" ||
md5($_POST["password"]) != $this->user_obj->getPasswd())
{
$this->error = $this->lng->txt('pay_bmf_password_not_valid');
ilUtil::sendInfo($this->error);
$this->showDebitEntry();
return;
}
$_SESSION["bmf"]["debit_entry"]["BLZ"] = $_POST["bank_code"];
$_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_POST["account_holder"];
$_SESSION["bmf"]["debit_entry"]["kontoNr"] = $_POST["account_number"];
$this->error = "";
$this->sendDebitEntry();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getPaymentType ( )

Definition at line 313 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showCreditCard(), showDebitEntry(), and showPaymentType().

{
if (($_POST["payment_type"] != "credit_card" && $_POST["payment_type"] != "debit_entry") ||
($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] == "debit_entry"))
{
$this->error = $this->lng->txt('pay_bmf_payment_type_not_valid');
ilUtil::sendInfo($this->error);
$this->showPaymentType();
return;
}
$_SESSION["bmf"]["payment_type"] = $_POST["payment_type"];
$this->error = "";
if ($_SESSION["bmf"]["payment_type"] == "credit_card")
{
$this->showCreditCard();
}
else
{
$this->showDebitEntry();
}
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::getPersonalData ( )

Definition at line 196 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), showPaymentType(), and showPersonalData().

{
if ($_SESSION["bmf"]["personal_data"]["firstname"] == "" ||
$_SESSION["bmf"]["personal_data"]["lastname"] == "" ||
$_POST["zipcode"] == "" ||
$_POST["city"] == "" ||
$_POST["country"] == "" ||
$_SESSION["bmf"]["personal_data"]["email"] == "")
{
$this->error = $this->lng->txt('pay_bmf_personal_data_not_valid');
ilUtil::sendInfo($this->error);
$this->showPersonalData();
return;
}
if (($_POST["street"] == "" && $_POST["house_number"] == "" && $_POST["po_box"] == "") ||
(($_POST["street"] != "" || $_POST["house_number"] != "") && $_POST["po_box"] != "") ||
($_POST["street"] != "" && $_POST["house_number"] == "") ||
($_POST["street"] == "" && $_POST["house_number"] != ""))
{
$this->error = $this->lng->txt('pay_bmf_street_or_pobox');
ilUtil::sendInfo($this->error);
$this->showPersonalData();
return;
}
$_SESSION["bmf"]["personal_data"]["firstname"] = $this->user_obj->getFirstname();
$_SESSION["bmf"]["personal_data"]["lastname"] = $this->user_obj->getLastname();
$_SESSION["bmf"]["personal_data"]["street"] = $_POST["street"];
$_SESSION["bmf"]["personal_data"]["house_number"] = $_POST["house_number"];
$_SESSION["bmf"]["personal_data"]["po_box"] = $_POST["po_box"];
$_SESSION["bmf"]["personal_data"]["zipcode"] = $_POST["zipcode"];
$_SESSION["bmf"]["personal_data"]["city"] = $_POST["city"];
$_SESSION["bmf"]["personal_data"]["country"] = $_POST["country"];
$_SESSION["bmf"]["personal_data"]["email"] = $this->user_obj->getEmail();
$_SESSION["bmf"]["personal_data"]["language"] = $this->user_obj->getLanguage();
if ($_SESSION["bmf"]["personal_data"]["country"] != "DE")
{
if ($_SESSION["bmf"]["payment_type"] == "debit_entry")
{
$_SESSION["bmf"]["payment_type"] = "";
}
}
$this->error = "";
$this->showPaymentType();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::ilPurchaseBMFGUI ( $user_obj)

Definition at line 53 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $ilCtrl, $ilDB, $lng, $tpl, $user_obj, __getCountryCode(), and __loadTemplate().

{
global $ilias, $ilDB, $lng, $tpl, $rbacsystem, $ilCtrl, $ilTabs;
$this->ilias = $ilias;
$this->db = $ilDB;
$this->lng = $lng;
$this->ctrl = $ilCtrl;
$this->tpl = $tpl;
// Get user object
$this->user_obj = $user_obj;
$this->coupon_obj = new ilPaymentCoupons($this->user_obj);
if (!is_array($_SESSION["bmf"]["personal_data"]))
{
$_SESSION["bmf"]["personal_data"]["firstname"] = $this->user_obj->getFirstname();
$_SESSION["bmf"]["personal_data"]["lastname"] = $this->user_obj->getLastname();
if (strpos("_" . $this->user_obj->getStreet(), " ") > 0)
{
$houseNo = substr($this->user_obj->getStreet(), strrpos($this->user_obj->getStreet(), " ")+1);
$street = substr($this->user_obj->getStreet(), 0, strlen($this->user_obj->getStreet())-(strlen($houseNo)+1));
$_SESSION["bmf"]["personal_data"]["street"] = $street;
$_SESSION["bmf"]["personal_data"]["house_number"] = $houseNo;
}
else
{
$_SESSION["bmf"]["personal_data"]["street"] = $this->user_obj->getStreet();
$_SESSION["bmf"]["personal_data"]["house_number"] = "";
}
$_SESSION["bmf"]["personal_data"]["po_box"] = "";
$_SESSION["bmf"]["personal_data"]["zipcode"] = $this->user_obj->getZipcode();
$_SESSION["bmf"]["personal_data"]["city"] = $this->user_obj->getCity();
$_SESSION["bmf"]["personal_data"]["country"] = $this->__getCountryCode($this->user_obj->getCountry());
$_SESSION["bmf"]["personal_data"]["email"] = $this->user_obj->getEmail();
$_SESSION["bmf"]["personal_data"]["language"] = $this->user_obj->getLanguage();
}
if (!is_array($_SESSION["coupons"]["bmf"]))
{
$_SESSION["coupons"]["bmf"] = array();
}
$this->__loadTemplate();
$this->error = "";
$this->lng->loadLanguageModule("payment");
$ilTabs->clearTargets();
$ilTabs->clearSubTabs();
}

+ Here is the call graph for this function:

ilPurchaseBMFGUI::sendCreditCard ( )

Definition at line 881 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $error, $key, $result, __addBookings(), __clearSession(), __emptyShoppingCart(), __sendBill(), PAY_METHOD_BMF, ilUtil\sendInfo(), showCreditCard(), showPaymentType(), and showPersonalData().

Referenced by getCreditCard().

{
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
$this->psc_obj->clearCouponItemsSession();
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$payment = new KreditkartenzahlungWS();
$customer = new Kunde($this->user_obj->getId());
$creditCard = new Kreditkarte();
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
$tmp_bookEntries = $sc_obj->getShoppingCart();
if (!is_array($tmp_bookEntries))
{
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$totalAmount = 0;
for ($i = 0; $i < count($tmp_bookEntries); $i++)
{
$booking = true;
if (!empty($_SESSION["coupons"]["bmf"]))
{
$price = $tmp_bookEntries[$i]["betrag"];
$tmp_bookEntries[$i]["math_price"] = (float) $price;
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$tmp_pobject =& new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += (float) $price;
$_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
$booking = false;
}
unset($tmp_pobject);
}
}
if ($booking)
{
$tmp_bookEntries[$i]["betrag_string"] = number_format( (float) $tmp_bookEntries[$i]["betrag"] , 2, ",", ".");
$bookEntries[] = new Buchung($tmp_bookEntries[$i]);
$totalAmount += $tmp_bookEntries[$i]["betrag"];
}
else
{
$tmp_bookEntries[$i]["betrag_string"] = number_format( (float) $tmp_bookEntries[$i]["betrag"] , 2, ",", ".");
}
}
$coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
{
foreach ($coupon_discount_items as $item)
{
$item["betrag"] = $item["discount_price"];
$bookEntries[] = new Buchung($item);
$totalAmount += $item["discount_price"];
}
}
$values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
$bookingList = new BuchungsListe($this->user_obj->getId(), $values);
}
$resultObj = $payment->zahlenUndAnlegenKunde($customer, $creditCard, $bookingList);
$result = $resultObj->ergebnis;
// if(true == true) #zum testen
if (is_object($result))
{
if ($result->code < 0)
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
if ($result->code == -103 ||
$result->code == -104 ||
$result->code == -107 ||
($result->code <= -202 && $result->code >= -208) ||
$result->code == -213)
{
$this->showPersonalData();
}
else if ($result->code == -507 ||
$result->code == -510 ||
$result->code == -511)
{
$this->showPaymentType();
}
else if ($result->code == -701 ||
$result->code == -1701 ||
$result->code == -1706 ||
$result->code == -1707 ||
$result->code == -1710 ||
$result->code == -1711)
{
$this->showCreditCard();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
#zum testen
// everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
$this->__sendBill($customer, $_SESSION["bmf"]["payment_type"], $bookingList, $resultObj);
$this->__addBookings($resultObj,$bookingList->getTransaction());
$this->__clearSession();
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','payment');
#$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
if ($this->ilias->getSetting("https") != 1)
{
$this->tpl->setCurrentBlock("buyed_objects");
#$this->ctrl->redirectByClass("ilPaymentBuyedObjectsGUI", "ilpaymentbuyedobjectsgui");
#$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
$link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
$this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
$this->tpl->parseCurrentBlock("buyed_objects");
}
$this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
#zum testen
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::sendDebitEntry ( )

Definition at line 463 of file class.ilPurchaseBMFGUI.php.

References $_SESSION, $address, $error, $key, $result, __addBookings(), __clearSession(), __emptyShoppingCart(), __sendBill(), PAY_METHOD_BMF, ilUtil\sendInfo(), showDebitEntry(), showPaymentType(), and showPersonalData().

Referenced by getDebitEntry().

{
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
$this->psc_obj->clearCouponItemsSession();
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$customer = new KundenstammdatenPflegeWS();
$newCustomer = new Kunde($this->user_obj->getId());
$resultCustomerObj = $customer->anlegenKunde($newCustomer);
$resultCustomer = $resultCustomerObj->ergebnis;
if (is_object($resultCustomer))
{
if ($resultCustomer->code < 0)
{
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $resultCustomer->code . ": " . $resultCustomer->kurzText . "<br>\n" . $resultCustomer->langText;
if ($resultCustomer->code == -103 ||
$resultCustomer->code == -104 ||
$resultCustomer->code == -107 ||
($resultCustomer->code <= -202 && $resultCustomer->code >= -208) ||
$resultCustomer->code == -213)
{
$this->showPersonalData();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
$payment = new LastschriftWS();
$debitEntry = new Lastschrift();
$bank = new Bankverbindung();
$sc_obj =& new ilPaymentShoppingCart($this->user_obj);
$tmp_bookEntries = $sc_obj->getShoppingCart();
if (!is_array($tmp_bookEntries))
{
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$totalAmount = 0;
for ($i = 0; $i < count($tmp_bookEntries); $i++)
{
$booking = true;
if (!empty($_SESSION["coupons"]["bmf"]))
{
$price = $tmp_bookEntries[$i]["betrag"];
$tmp_bookEntries[$i]["math_price"] = (float) $price;
foreach ($_SESSION["coupons"]["bmf"] as $key => $coupon)
{
$this->coupon_obj->setId($coupon["pc_pk"]);
$this->coupon_obj->setCurrentCoupon($coupon);
$tmp_pobject =& new ilPaymentObject($this->user_obj, $tmp_bookEntries[$i]['pobject_id']);
if ($this->coupon_obj->isObjectAssignedToCoupon($tmp_pobject->getRefId()))
{
$_SESSION["coupons"]["bmf"][$key]["total_objects_coupon_price"] += (float) $price;
$_SESSION["coupons"]["bmf"][$key]["items"][] = $tmp_bookEntries[$i];
$booking = false;
}
unset($tmp_pobject);
}
}
if ($booking)
{
$tmp_bookEntries[$i]["betrag_string"] = number_format( (float) $tmp_bookEntries[$i]["betrag"] , 2, ",", ".");
$bookEntries[] = new Buchung($tmp_bookEntries[$i]);
$totalAmount += $tmp_bookEntries[$i]["betrag"];
}
else
{
$tmp_bookEntries[$i]["betrag_string"] = number_format( (float) $tmp_bookEntries[$i]["betrag"] , 2, ",", ".");
}
}
$coupon_discount_items = $this->psc_obj->calcDiscountPrices($_SESSION["coupons"]["bmf"]);
if (is_array($coupon_discount_items) && !empty($coupon_discount_items))
{
foreach ($coupon_discount_items as $item)
{
$item["betrag"] = $item["discount_price"];
$bookEntries[] = new Buchung($item);
$totalAmount += $item["betrag"];
}
}
$values = array("betrag" => $totalAmount, "buchungen" => $bookEntries);
$bookingList = new BuchungsListe($this->user_obj->getId(), $values);
}
$resultObj = $payment->abbuchenOhneEinzugsermaechtigung($resultCustomerObj->kunde->EShopKundenNr, $address, $bank, $bookingList);
$result = $resultObj->ergebnis;
if (is_object($result))
{
if ($result->code < 0)
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
$error = $this->lng->txt('pay_bmf_server_error_code') . " " . $result->code . ": " . $result->kurzText . "<br>\n" . $result->langText;
if ($result->code == -103 ||
$result->code == -104 ||
$result->code == -107 ||
($result->code <= -202 && $result->code >= -208) ||
$result->code == -213)
{
$this->showPersonalData();
}
else if ($result->code == -507 ||
$result->code == -510 ||
$result->code == -511)
{
$this->showPaymentType();
}
else if ($result->code == -402 ||
$result->code == -402 ||
$result->code == -403 ||
$result->code == -406 ||
$result->code == -410 ||
$result->code == -413 ||
$result->code == -701 ||
$result->code == -702 ||
$result->code == -703)
{
$this->showDebitEntry();
}
else
{
$error .= "<br>\n" . $this->lng->txt('pay_bmf_server_error_sysadmin');
$this->showPersonalData();
}
}
else
{
$resultCustomerObj->kunde->vorname = utf8_decode($resultCustomerObj->kunde->vorname);
$resultCustomerObj->kunde->nachname = utf8_decode($resultCustomerObj->kunde->nachname);
$resultCustomerObj->kunde->rechnungsAdresse->strasse = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->strasse);
$resultCustomerObj->kunde->rechnungsAdresse->hausNr = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->hausNr);
$resultCustomerObj->kunde->rechnungsAdresse->postfach = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->postfach);
$resultCustomerObj->kunde->rechnungsAdresse->PLZ = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->PLZ);
$resultCustomerObj->kunde->rechnungsAdresse->ort = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->ort);
$resultCustomerObj->kunde->rechnungsAdresse->land = utf8_decode($resultCustomerObj->kunde->rechnungsAdresse->land);
// everything ok => send confirmation, fill statistik, delete session, delete shopping cart.
$this->__sendBill($resultCustomerObj->kunde, $_SESSION["bmf"]["payment_type"], $bookingList, $resultObj);
$this->__addBookings($resultObj,$bookingList->getTransaction());
$this->__clearSession();
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_thanks'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_thanks'));
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','payment');
if ($this->ilias->getSetting("https") != 1)
{
$this->tpl->setCurrentBlock("buyed_objects");
#$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", "./payment.php?baseClass=ilpaymentbuyedobjectsgui&cmd=2");
#$link = $this->ctrl->getLinkTargetByClass('ilpaymentbuyedobjectsgui', 'showItems');
$link = $this->ctrl->getLinkTargetByClass('ilshopboughtobjectsgui');
$this->tpl->setVariable("LINK_GOTO_BUYED_OBJECTS", $link);
$this->tpl->setVariable("TXT_GOTO_BUYED_OBJECTS", $this->lng->txt('pay_goto_buyed_objects'));
$this->tpl->parseCurrentBlock("buyed_objects");
}
$this->tpl->setVariable("TXT_CLOSE_WINDOW", $this->lng->txt('close_window'));
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
}
}
else
{
$this->tpl->setVariable("HEADER",$this->lng->txt('error'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_bmf_server_error_communication'));
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showCreditCard ( )

Definition at line 689 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, __showShoppingCart(), ilUtil\getImagePath(), PAY_METHOD_BMF, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getCreditCard(), getPaymentType(), and sendCreditCard().

{
// user_id $this->user_obj->getId()
// all
/* if ($_SESSION["bmf"]["credit_card"]["karteninhaber"] == "" &&
$this->error == "" &&
$_POST["card_holder"] == "")
{
$_SESSION["bmf"]["credit_card"]["karteninhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
}*/
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_credit_card.html','payment');
#$this->tpl = new ilTemplate('tpl.pay_bmf_credit_card.html', true, true, 'payment');
$this->tpl->setVariable("CREDIT_CARD_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_credit_card'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_credit_card_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_credit_card'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
$this->tpl->setVariable("TXT_CARD_HOLDER",$this->lng->txt('pay_bmf_card_holder'));
$this->tpl->setVariable("TXT_CHECK_NUMBER",$this->lng->txt('pay_bmf_check_number'));
$this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
$this->tpl->setVariable("TXT_CARD_NUMBER",$this->lng->txt('pay_bmf_card_number'));
$this->tpl->setVariable("TXT_VALIDITY",$this->lng->txt('pay_bmf_validity'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
$this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
$this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
$this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
$this->tpl->setVariable("CARD_HOLDER",
$this->error != "" && isset($_POST['card_holder'])
? ilUtil::prepareFormOutput($_POST['card_holder'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['karteninhaber'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_1",
$this->error != "" && isset($_POST['card_number']['block_1'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_1'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_1'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_2",
$this->error != "" && isset($_POST['card_number']['block_2'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_2'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_2'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_3",
$this->error != "" && isset($_POST['card_number']['block_3'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_3'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_3'],true));
$this->tpl->setVariable("CARD_NUMBER_BLOCK_4",
$this->error != "" && isset($_POST['card_number']['block_4'])
? ilUtil::prepareFormOutput($_POST['card_number']['block_4'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kreditkartenNr']['block_4'],true));
$this->tpl->setVariable("CHECK_NUMBER",
$this->error != "" && isset($_POST['check_number'])
? ilUtil::prepareFormOutput($_POST['check_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["credit_card"]['kartenpruefnummer'],true));
for ($i = 1; $i <= 12; $i++)
{
$this->tpl->setCurrentBlock("loop_validity_months");
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS", $i < 10 ? "0" . $i : $i);
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_TXT", $i < 10 ? "0" . $i : $i);
if ($this->error != "" &&
isset($_POST['validity']['month']))
{
if ($_POST['validity']['month'] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
}
}
else
{
if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["monat"] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_MONTHS_SELECTED", " selected");
}
}
$this->tpl->parseCurrentBlock("loop_validity_months");
}
for ($i = date("Y"); $i <= (date("Y")+6); $i++)
{
$this->tpl->setCurrentBlock("loop_validity_years");
$this->tpl->setVariable("LOOP_VALIDITY_YEARS", $i);
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_TXT", $i);
if ($this->error != "" &&
isset($_POST['validity']['year']))
{
if ($_POST['validity']['year'] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
}
}
else
{
if ($_SESSION["bmf"]["credit_card"]["gueltigkeit"]["jahr"] == $i)
{
$this->tpl->setVariable("LOOP_VALIDITY_YEARS_SELECTED", " selected");
}
}
$this->tpl->parseCurrentBlock("loop_validity_years");
}
/* if ($this->error != "" &&
isset($_POST["terms_conditions"]))
{
$this->tpl->setVariable("TERMS_CONDITIONS_" . $_POST["terms_conditions"], " checked") ;
}*/
/* if ($this->error != "" &&
isset($_POST["password"]))
{
$this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
}*/
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showDebitEntry ( )

Definition at line 337 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, __showShoppingCart(), ilUtil\getImagePath(), PAY_METHOD_BMF, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getDebitEntry(), getPaymentType(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
/* if ($_SESSION["bmf"]["debit_entry"]["kontoinhaber"] == "" &&
$this->error == "" &&
$_POST["account_holder"] == "")
{
$_SESSION["bmf"]["debit_entry"]["kontoinhaber"] = $_SESSION["bmf"]["personal_data"]["vorname"] . " " . $_SESSION["bmf"]["personal_data"]["nachname"];
}*/
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_debit_entry.html','payment');
#$this->tpl = new ilTemplate('tpl.pay_bmf_debit_entry.html', true, true, 'payment');
$this->tpl->setVariable("DEBIT_ENTRY_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step3_debit_entry'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_debit_entry_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_debit_entry'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
$this->tpl->setVariable("TXT_ACCOUNT_HOLDER",$this->lng->txt('pay_bmf_account_holder'));
$this->tpl->setVariable("TXT_OPTIONAL",$this->lng->txt('pay_bmf_optional'));
$this->tpl->setVariable("TXT_BANK_CODE",$this->lng->txt('pay_bmf_bank_code'));
$this->tpl->setVariable("TXT_ACCOUNT_NUMBER",$this->lng->txt('pay_bmf_account_number'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS",$this->lng->txt('pay_bmf_terms_conditions'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_READ",$this->lng->txt('pay_bmf_terms_conditions_read'));
$this->tpl->setVariable("TXT_TERMS_CONDITIONS_SHOW",$this->lng->txt('pay_bmf_terms_conditions_show'));
$this->tpl->setVariable("LINK_TERMS_CONDITIONS","./payment.php?view=conditions");
$this->tpl->setVariable("TXT_PASSWORD",$this->lng->txt('password'));
$this->tpl->setVariable("TXT_CONFIRM_ORDER",$this->lng->txt('pay_confirm_order'));
$this->tpl->setVariable("INPUT_VALUE",$this->lng->txt('pay_send_order'));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
$this->tpl->setVariable("ACCOUNT_HOLDER",
$this->error != "" && isset($_POST['account_holder'])
? ilUtil::prepareFormOutput($_POST['account_holder'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoinhaber'],true));
$this->tpl->setVariable("BANK_CODE",
$this->error != "" && isset($_POST['bank_code'])
? ilUtil::prepareFormOutput($_POST['bank_code'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['BLZ'],true));
$this->tpl->setVariable("ACCOUNT_NUMBER",
$this->error != "" && isset($_POST['account_number'])
? ilUtil::prepareFormOutput($_POST['account_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["debit_entry"]['kontoNr'],true));
/* if ($this->error != "" &&
isset($_POST["terms_conditions"]))
{
$this->tpl->setVariable("TERMS_CONDITIONS_" . strtoupper($_POST["terms_conditions"]), " checked") ;
}*/
/* if ($this->error != "" &&
isset($_POST["password"]))
{
$this->tpl->setVariable("PASSWORD", ilUtil::prepareFormOutput($_POST['password'],true));
}*/
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPaymentType"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showPaymentType ( )

Definition at line 246 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, ilUtil\getImagePath(), PAY_METHOD_BMF, and ilUtil\sendInfo().

Referenced by getPaymentType(), getPersonalData(), sendCreditCard(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_payment_type.html','payment');
$this->tpl->setVariable("PAYMENT_TYPE_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step2'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_payment_type'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_payment_type'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
if ($_SESSION["bmf"]["personal_data"]["country"] == "DE")
{
$this->tpl->setVariable("TXT_DEBIT_ENTRY",$this->lng->txt('pay_bmf_debit_entry'));
}
$this->tpl->setVariable("TXT_CREDIT_CARD",$this->lng->txt('pay_bmf_credit_card'));
$this->tpl->setVariable("INPUT_VALUE",ucfirst($this->lng->txt('next')));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
if ($this->error != "" &&
isset($_POST["payment_type"]))
{
$this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_POST["payment_type"]), " checked") ;
}
else
{
if (($_SESSION["bmf"]["personal_data"]["country"] != "DE" && $_POST["payment_type"] != "debit_entry") ||
$_SESSION["bmf"]["personal_data"]["country"] == "DE")
{
$this->tpl->setVariable("PAYMENT_TYPE_" . strtoupper($_SESSION["bmf"]["payment_type"]), " checked") ;
}
}
// Button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
$this->tpl->setCurrentBlock("btn_cell");
$this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "showPersonalData"));
$this->tpl->setVariable("BTN_TXT", $this->lng->txt('pay_bmf_back'));
$this->tpl->parseCurrentBlock("btn_cell");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPurchaseBMFGUI::showPersonalData ( )

Definition at line 111 of file class.ilPurchaseBMFGUI.php.

References $_POST, $_SESSION, __showCountries(), ilUtil\getImagePath(), PAY_METHOD_BMF, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().

Referenced by getPersonalData(), sendCreditCard(), and sendDebitEntry().

{
// user_id $this->user_obj->getId()
// all
$this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
if(!count($items = $this->psc_obj->getEntries(PAY_METHOD_BMF)))
{
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_bmf_your_order'));
$this->tpl->touchBlock("stop_floating");
ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
}
else
{
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.pay_bmf_personal_data.html','payment');
#$this->tpl = new ilTemplate('tpl.pay_bmf_personal_data.html', true, true, 'payment');
$this->tpl->setVariable("PERSONAL_DATA_FORMACTION",$this->ctrl->getFormAction($this));
// set table header
$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_pays_b.gif'));
$this->tpl->setVariable("ALT_IMG",$this->lng->txt('obj_usr'));
$this->tpl->setVariable("HEADER",$this->lng->txt('pay_step1'));
$this->tpl->setVariable("TITLE",$this->lng->txt('pay_bmf_personal_data'));
$this->tpl->setVariable("DESCRIPTION",$this->lng->txt('pay_bmf_description_personal_data'));
$this->tpl->touchBlock("stop_floating");
$this->tpl->setVariable("TXT_CLOSE_WINDOW",$this->lng->txt('close_window'));
// set plain text variables
$this->tpl->setVariable("TXT_FIRSTNAME",$this->lng->txt('firstname'));
$this->tpl->setVariable("TXT_LASTNAME",$this->lng->txt('lastname'));
$this->tpl->setVariable("TXT_STREET",$this->lng->txt('street'));
$this->tpl->setVariable("TXT_HOUSE_NUMBER",$this->lng->txt('pay_bmf_house_number'));
$this->tpl->setVariable("TXT_OR",$this->lng->txt('pay_bmf_or'));
$this->tpl->setVariable("TXT_PO_BOX",$this->lng->txt('pay_bmf_po_box'));
$this->tpl->setVariable("TXT_ZIPCODE",$this->lng->txt('zipcode'));
$this->tpl->setVariable("TXT_CITY",$this->lng->txt('city'));
$this->tpl->setVariable("TXT_COUNTRY",$this->lng->txt('country'));
$this->tpl->setVariable("TXT_EMAIL",$this->lng->txt('email'));
$this->tpl->setVariable("INPUT_VALUE",ucfirst($this->lng->txt('next')));
$this->tpl->setVariable("CANCEL",$this->lng->txt('cancel'));
// fill defaults
$this->error != "" && isset($_POST['country']) ? $this->__showCountries($this->tpl, $_POST['country']) : $this->__showCountries($this->tpl, $_SESSION['bmf']['personal_data']['country']);
/* $this->tpl->setVariable("FIRSTNAME",
$this->error != "" && isset($_POST['firstname'])
? ilUtil::prepareFormOutput($_POST['firstname'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['vorname'],true));
$this->tpl->setVariable("LASTNAME",
$this->error != "" && isset($_POST['lastname'])
? ilUtil::prepareFormOutput($_POST['lastname'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['nachname'],true));*/
$this->tpl->setVariable("FIRSTNAME", $this->user_obj->getFirstname());
$this->tpl->setVariable("LASTNAME", $this->user_obj->getLastname());
$this->tpl->setVariable("STREET",
$this->error != "" && isset($_POST['street'])
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['street'],true));
$this->tpl->setVariable("HOUSE_NUMBER",
$this->error != "" && isset($_POST['house_number'])
? ilUtil::prepareFormOutput($_POST['house_number'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['house_number'],true));
$this->tpl->setVariable("PO_BOX",
$this->error != "" && isset($_POST['po_box'])
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['po_box'],true));
$this->tpl->setVariable("ZIPCODE",
$this->error != "" && isset($_POST['zipcode'])
? ilUtil::prepareFormOutput($_POST['zipcode'],true)
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['zipcode'],true));
$this->tpl->setVariable("CITY",
$this->error != "" && isset($_POST['city'])
: ilUtil::prepareFormOutput($_SESSION['bmf']["personal_data"]['city'],true));
$this->tpl->setVariable("EMAIL", $this->user_obj->getEmail());
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilPurchaseBMFGUI::$coupon_obj = null

Definition at line 46 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$ctrl

Definition at line 42 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$error

Definition at line 47 of file class.ilPurchaseBMFGUI.php.

Referenced by sendCreditCard(), and sendDebitEntry().

ilPurchaseBMFGUI::$shoppingCart

Definition at line 48 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$soapClient

Definition at line 50 of file class.ilPurchaseBMFGUI.php.

ilPurchaseBMFGUI::$totalVat = 0
private

Definition at line 51 of file class.ilPurchaseBMFGUI.php.

Referenced by __sendBill().

ilPurchaseBMFGUI::$tpl
ilPurchaseBMFGUI::$user_obj

Definition at line 45 of file class.ilPurchaseBMFGUI.php.

Referenced by ilPurchaseBMFGUI().


The documentation for this class was generated from the following file: