public static function getCartData($hParams = array())
 {
     // Warenkorbstatus aus dem RP abfragen
     $cart = shopShopping::readCart(array('sid' => bbRpc::getSid(), 'return_items' => 1, 'return_orderable' => 1));
     $haItems = array('tariff' => array(), 'domain' => array(), 'add-on' => array(), 'normaly' => array());
     $aiItemCount = array('all' => 0, 'tariff' => 0, 'domain' => 0, 'add-on' => 0, 'normaly' => 0);
     $bTariffNeedsDomain = false;
     // Artikel im Warenkorb vorhanden
     if ($cart) {
         // Gruppierung nach Produkttyp
         foreach ($haItems as $sNorm => &$aItems) {
             foreach ($cart['items'] as $hItem) {
                 if ($hItem['product']['norm'] === $sNorm) {
                     $aItems[] = $hItem;
                     if (array_key_exists('amount', $hItem)) {
                         $aiItemCount[$sNorm] += $hItem['amount'];
                     } else {
                         $aiItemCount[$sNorm]++;
                     }
                 }
             }
             $aiItemCount['all'] += $aiItemCount[$sNorm];
         }
         $bTariffNeedsDomain = $aiItemCount['tariff'] && !$aiItemCount['domain'] && $haItems['tariff'][0]['product']['need_domain'];
     } else {
         $cart = array();
     }
     // Cart um formatierte Daten erweitern
     $cart['items'] = $haItems;
     $cart['item_count'] = $aiItemCount;
     $cart['tariff_needs_domain'] = $bTariffNeedsDomain;
     return $cart;
 }
 /**
  * Statusmeldung der bbRpc-Klasse hinzufügen
  *
  * @return void
  */
 public static final function injectRPCMsgs()
 {
     global $asCustomErrorMessages;
     // Statusmeldungen der bbRpc-Klasse auslesen
     $ahMsgs = bbRpc::getMessages(array('delete_previous' => 1));
     // Zuordnungen der bbRpc-Typen zu den Typen dieser Klasse
     $hTypeMap = array('err' => 'error', 'warn' => 'warning', 'ok' => 'success', 'notice' => 'notice');
     foreach ($ahMsgs as $hMsg) {
         // eigene Fehlermeldungen der dist/settings/errors.inc.php nutzen
         $sMsg = array_key_exists($hMsg['msg'], $asCustomErrorMessages) ? $asCustomErrorMessages[$hMsg['msg']] : $hMsg['msg'];
         if (preg_match('/(?!\\$tab)\\$([a-zA-Z0-9_-]+)/', $hMsg['msg'], $aMatch) && count($aMatch) === 2 && ($sFld = $aMatch[1])) {
             static::add($sMsg, null, $hTypeMap[$hMsg['typ']], $sFld, null, null, array_key_exists('parent_key', $hMsg) ? $hMsg['parent_key'] : null);
         } else {
             static::add($sMsg, null, $hTypeMap[$hMsg['typ']]);
         }
     }
 }
 public static function loginAction()
 {
     if (Settings::getValue(SETTINGS_FILE, 'register', 'only_new_customers')) {
         Renderer::setAction('register');
         static::registerAction();
         return;
     }
     if (array_key_exists('_login', $GLOBALS['_POST'])) {
         $login = array('name' => $GLOBALS['_POST']['_login']['user'], 'pass' => $GLOBALS['_POST']['_login']['password'], 'return_customer' => 1);
         if (strlen($login['name']) && strlen($login['pass'])) {
             $customer = bbRpc::call('shLogin::setShopCustomer', $login);
             if (is_array($customer)) {
                 Renderer::setAction('checkout');
                 session_start();
                 $_SESSION['customer'] = $customer;
                 session_write_close();
                 static::checkoutAction();
             }
         }
     }
 }
 public static function validatePayinfo($hParams = array())
 {
     $ret = bbRpc::call('bbCustomer::validatePayinfo', $hParams);
     return $ret;
 }
 public static function getContractPdf($hParams = array())
 {
     $ret = bbRpc::call('shDraft::genPdf', $hParams);
     return $ret;
 }
 public static function read($hParams)
 {
     $ret = bbRpc::call('shSettings::read', $hParams);
     return $ret;
 }
 public static function saveCartItem($hParams = array())
 {
     $ret = bbRpc::call('bbShopping::saveCartItem', $hParams);
     return $ret;
 }
 public static function readInterval($hParams = array())
 {
     $data = bbRpc::call('bbProduct::readInterval', $hParams);
     return $data;
 }