Ejemplo n.º 1
0
 /**
  *
  */
 public function preparePage()
 {
     $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
     $this->P->cb_pagetype = 'content';
     $this->P->cb_subnav = 'admin';
     $CUA = [['title' => HardcodedText::get('customeradmin_list_no'), 'key' => 'cust_no', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;'], ['title' => HardcodedText::get('customeradmin_list_company'), 'key' => 'cust_corp', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;'], ['title' => HardcodedText::get('customeradmin_list_name'), 'key' => 'cust_name', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;'], ['title' => HardcodedText::get('customeradmin_list_town'), 'key' => 'cust_town', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;'], ['title' => HardcodedText::get('customeradmin_list_active'), 'key' => 'cust_active', 'width' => '16%', 'linked' => false, 'stylehead' => 'text-align: left;'], ['title' => HardcodedText::get('customeradmin_list_edit'), 'key' => 'cust_id', 'width' => '16%', 'linked' => true, 'ltarget' => '/_admin/customeradmin.html', 'lkeyname' => 'id', 'lgetvars' => ['action' => 'edit']]];
     $aPData = $this->handleCustomerAdmin($CUA, $this->serviceManager->get('twig'));
     $this->P->cb_customcontenttemplate = 'customer/customeradmin';
     $this->P->oPayload->cl_html = $aPData["customeradmin"]["text"];
     $this->P->cb_customdata = $aPData;
 }
Ejemplo n.º 2
0
 public function preparePage()
 {
     $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
     $this->P->cb_pagetype = 'content';
     $this->P->cb_subnav = 'admin';
     $this->P->cb_customcontenttemplate = 'textcatadmin';
     $return = '';
     if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == '') {
         $aData = $this->textcats->getCompleteTextcatForCurrentLang();
         $aListSetting = [['title' => HardcodedText::get('textcatadmin_list_title_key'), 'key' => 'tc_key', 'width' => '20%', 'linked' => false], ['title' => HardcodedText::get('textcatadmin_list_title_text'), 'key' => 'tcl_text', 'width' => '80%', 'linked' => false, 'escapehtmlspecialchars' => true], ['title' => HardcodedText::get('textcatadmin_list_title_edit'), 'key' => 'tc_id', 'width' => 35, 'linked' => true, 'ltarget' => '/_admin/textcatadmin.html', 'lkeyname' => 'id', 'lgetvars' => ['action' => 'edit']]];
         $return .= Tools::makeListtable($aListSetting, $aData, $this->serviceManager->get('twig'));
     } elseif ($_GET["action"] == 'edit' || $_GET["action"] == 'delete') {
         if ($_GET["action"] == 'delete' && isset($_POST["delete"]) && $_POST["delete"] == 'do') {
             $this->textcats->deleteText($_GET["id"]);
             $this->P->cb_customdata["deleted"] = true;
         } else {
             $this->P->cb_customdata["edit"] = true;
             $this->textcats->initTextIfVoid($_GET["id"]);
             // if post:edit is set, update
             if (isset($_POST["edit"]) && $_POST["edit"] == 'do') {
                 if (HelperConfig::$core['textcat_enable_purifier']) {
                     $this->textcats->purifier = \HaaseIT\HCSF\Helper::getPurifier('textcat');
                 } else {
                     $this->textcats->purifier = false;
                 }
                 $this->textcats->saveText($_POST["lid"], $_POST["text"]);
                 $this->P->cb_customdata["updated"] = true;
             }
             $aData = $this->textcats->getSingleTextByID($_GET["id"]);
             $this->P->cb_customdata["editform"] = ['id' => $aData["tc_id"], 'lid' => $aData["tcl_id"], 'key' => $aData["tc_key"], 'lang' => $aData["tcl_lang"], 'text' => $aData["tcl_text"]];
             // show archived versions of this textcat
             /** @var \PDOStatement $hResult */
             $hResult = $this->serviceManager->get('db')->query('SELECT * FROM textcat_lang_archive WHERE tcl_id = ' . $aData["tcl_id"] . " AND tcl_lang = '" . HelperConfig::$lang . "' ORDER BY tcla_timestamp DESC");
             $iArchivedRows = $hResult->rowCount();
             if ($iArchivedRows > 0) {
                 $aListSetting = [['title' => 'tcla_timestamp', 'key' => 'tcla_timestamp', 'width' => '15%', 'linked' => false], ['title' => 'tcl_text', 'key' => 'tcl_text', 'width' => '85%', 'linked' => false, 'escapehtmlspecialchars' => true]];
                 $aData = $hResult->fetchAll();
                 $this->P->cb_customdata['archived_list'] = Tools::makeListtable($aListSetting, $aData, $this->serviceManager->get('twig'));
             }
         }
     } elseif ($_GET["action"] == 'add') {
         $this->P->cb_customdata["add"] = true;
         if (isset($_POST["add"]) && $_POST["add"] == 'do') {
             $this->P->cb_customdata["err"] = $this->textcats->verifyAddTextKey($_POST["key"]);
             if (count($this->P->cb_customdata["err"]) == 0) {
                 $this->P->cb_customdata["addform"] = ['key' => $_POST["key"], 'id' => $this->textcats->addTextKey($_POST["key"])];
             }
         }
     }
     $this->P->oPayload->cl_html = $return;
 }
Ejemplo n.º 3
0
 /**
  *
  */
 public function preparePage()
 {
     $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
     $this->P->cb_pagetype = 'content';
     $this->P->cb_subnav = 'admin';
     $this->P->cb_customcontenttemplate = 'pageadmin';
     // adding language to page here
     if (isset($_REQUEST["action"]) && $_REQUEST["action"] == 'insert_lang') {
         $Ptoinsertlang = new UserPage($this->serviceManager, $_REQUEST["page_key"], true);
         if ($Ptoinsertlang->cb_id != NULL && $Ptoinsertlang->oPayload->cl_id == NULL) {
             $Ptoinsertlang->oPayload->insert($Ptoinsertlang->cb_id);
             header('Location: /_admin/pageadmin.html?page_key=' . $Ptoinsertlang->cb_key . '&action=edit');
             die;
         } else {
             die(HardcodedText::get('pageadmin_exception_couldnotinsertlang'));
         }
     }
     if (!isset($this->get["action"])) {
         $this->P->cb_customdata["pageselect"] = $this->showPageselect();
     } elseif (($this->get["action"] == 'edit' || $this->get["action"] == 'delete') && isset($_REQUEST["page_key"]) && $_REQUEST["page_key"] != '') {
         if ($this->get["action"] == 'delete' && isset($this->post["delete"]) && $this->post["delete"] == 'do') {
             // delete and put message in customdata
             $Ptodelete = new UserPage($this->serviceManager, $this->get["page_key"], true);
             if ($Ptodelete->cb_id != NULL) {
                 $Ptodelete->remove();
             } else {
                 die(HardcodedText::get('pageadmin_exception_pagetodeletenotfound'));
             }
             $this->P->cb_customdata["deleted"] = true;
         } else {
             // edit or update page
             if (isset($_REQUEST["page_key"]) && ($Ptoedit = new UserPage($this->serviceManager, $_REQUEST["page_key"], true))) {
                 if (isset($_REQUEST["action_a"]) && $_REQUEST["action_a"] == 'true') {
                     if (HelperConfig::$core['pagetext_enable_purifier']) {
                         $purifier = \HaaseIT\HCSF\Helper::getPurifier('page');
                     } else {
                         $purifier = false;
                     }
                     $Ptoedit->cb_pagetype = $this->post['page_type'];
                     $Ptoedit->cb_group = $this->post['page_group'];
                     $Ptoedit->cb_pageconfig = $this->post['page_config'];
                     $Ptoedit->cb_subnav = $this->post['page_subnav'];
                     $Ptoedit->purifier = $purifier;
                     $Ptoedit->write();
                     if ($Ptoedit->oPayload->cl_id != NULL) {
                         $Ptoedit->oPayload->cl_html = $this->post['page_html'];
                         $Ptoedit->oPayload->cl_title = $this->post['page_title'];
                         $Ptoedit->oPayload->cl_description = $this->post['page_description'];
                         $Ptoedit->oPayload->cl_keywords = $this->post['page_keywords'];
                         $Ptoedit->oPayload->purifier = $purifier;
                         $Ptoedit->oPayload->write();
                     }
                     $Ptoedit = new UserPage($this->serviceManager, $_REQUEST["page_key"], true);
                     $this->P->cb_customdata["updated"] = true;
                 }
                 $this->P->cb_customdata["page"] = $Ptoedit;
                 $this->P->cb_customdata["admin_page_types"] = HelperConfig::$core["admin_page_types"];
                 $this->P->cb_customdata["admin_page_groups"] = HelperConfig::$core["admin_page_groups"];
                 $aOptions = [''];
                 foreach (HelperConfig::$navigation as $sKey => $aValue) {
                     if ($sKey == 'admin') {
                         continue;
                     }
                     $aOptions[] = $sKey;
                 }
                 $this->P->cb_customdata["subnavarea_options"] = $aOptions;
                 unset($aOptions);
                 // show archived versions of this page
                 if ($Ptoedit->oPayload->cl_id != NULL) {
                     /** @var \PDOStatement $hResult */
                     $hResult = $this->serviceManager->get('db')->query('SELECT * FROM content_lang_archive WHERE cl_id = ' . $Ptoedit->oPayload->cl_id . " AND cl_lang = '" . HelperConfig::$lang . "' ORDER BY cla_timestamp DESC");
                     $iArchivedRows = $hResult->rowCount();
                     if ($iArchivedRows > 0) {
                         $aListSetting = [['title' => 'cla_timestamp', 'key' => 'cla_timestamp', 'width' => '15%', 'linked' => false], ['title' => 'cl_html', 'key' => 'cl_html', 'width' => '40%', 'linked' => false, 'escapehtmlspecialchars' => true], ['title' => 'cl_keywords', 'key' => 'cl_keywords', 'width' => '15%', 'linked' => false, 'escapehtmlspecialchars' => true], ['title' => 'cl_description', 'key' => 'cl_description', 'width' => '15%', 'linked' => false, 'escapehtmlspecialchars' => true], ['title' => 'cl_title', 'key' => 'cl_title', 'width' => '15%', 'linked' => false, 'escapehtmlspecialchars' => true]];
                         $aData = $hResult->fetchAll();
                         $this->P->cb_customdata['archived_list'] = \HaaseIT\Tools::makeListtable($aListSetting, $aData, $this->serviceManager->get('twig'));
                     }
                 }
             } else {
                 die(HardcodedText::get('pageadmin_exception_pagenotfound'));
             }
         }
     } elseif ($this->get["action"] == 'addpage') {
         $aErr = [];
         if (isset($this->post["addpage"]) && $this->post["addpage"] == 'do') {
             $sPagekeytoadd = \trim(\filter_input(INPUT_POST, 'pagekey', FILTER_SANITIZE_SPECIAL_CHARS));
             if (mb_substr($sPagekeytoadd, 0, 2) == '/_') {
                 $aErr["reservedpath"] = true;
             } elseif (strlen($sPagekeytoadd) < 4) {
                 $aErr["keytooshort"] = true;
             } else {
                 $Ptoadd = new UserPage($this->serviceManager, $sPagekeytoadd, true);
                 if ($Ptoadd->cb_id == NULL) {
                     if ($Ptoadd->insert($sPagekeytoadd)) {
                         header('Location: /_admin/pageadmin.html?page_key=' . $sPagekeytoadd . '&action=edit');
                         die;
                     } else {
                         die(HardcodedText::get('pageadmin_exception_couldnotinsertpage'));
                     }
                 } else {
                     $aErr["keyalreadyinuse"] = true;
                 }
             }
             $this->P->cb_customdata["err"] = $aErr;
             unset($aErr);
         }
         $this->P->cb_customdata["showaddform"] = true;
     }
 }
Ejemplo n.º 4
0
 /**
  * @param $aItemlist
  * @return array
  */
 private function admin_prepareItemlist($aItemlist)
 {
     $aList = [['title' => HardcodedText::get('itemadmin_list_itemno'), 'key' => 'itemno', 'width' => 100, 'linked' => false], ['title' => HardcodedText::get('itemadmin_list_name'), 'key' => 'name', 'width' => 350, 'linked' => false], ['title' => HardcodedText::get('itemadmin_list_edit'), 'key' => 'itemno', 'width' => 30, 'linked' => true, 'ltarget' => '/_admin/itemadmin.html', 'lkeyname' => 'itemno', 'lgetvars' => ['action' => 'showitem']]];
     $aData = [];
     foreach ($aItemlist["data"] as $aValue) {
         $aData[] = ['itemno' => $aValue['itm_no'], 'name' => $aValue['itm_name']];
     }
     $aLData = ['numrows' => $aItemlist["numrows"], 'listtable' => Tools::makeListtable($aList, $aData, $this->serviceManager->get('twig'))];
     return $aLData;
 }
Ejemplo n.º 5
0
 /**
  * @param $aGroups
  * @return bool|mixed
  */
 private function admin_showItemgroups($aGroups)
 {
     $aList = [['title' => HardcodedText::get('itemgroupadmin_list_no'), 'key' => 'gno', 'width' => 80, 'linked' => false, 'style-data' => 'padding: 5px 0;'], ['title' => HardcodedText::get('itemgroupadmin_list_name'), 'key' => 'gname', 'width' => 350, 'linked' => false, 'style-data' => 'padding: 5px 0;'], ['title' => HardcodedText::get('itemgroupadmin_list_edit'), 'key' => 'gid', 'width' => 30, 'linked' => true, 'ltarget' => '/_admin/itemgroupadmin.html', 'lkeyname' => 'gid', 'lgetvars' => ['action' => 'editgroup'], 'style-data' => 'padding: 5px 0;']];
     if (count($aGroups) > 0) {
         $aData = [];
         foreach ($aGroups as $aValue) {
             $aData[] = ['gid' => $aValue['itmg_id'], 'gno' => $aValue['itmg_no'], 'gname' => $aValue['itmg_name']];
         }
         return Tools::makeListtable($aList, $aData, $this->serviceManager->get('twig'));
     } else {
         return false;
     }
 }
Ejemplo n.º 6
0
 public static function sendVerificationMail($sEmailVerificationcode, $sTargetAddress, ServiceManager $serviceManager, $bCust = false)
 {
     if ($bCust) {
         $sSubject = $serviceManager->get('textcats')->T("register_mail_emailverification_subject");
         $aP['link'] = 'http' . (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ? 's' : '') . '://';
         $aP['link'] .= $_SERVER["SERVER_NAME"] . '/_misc/verifyemail.html?key=' . $sEmailVerificationcode;
         $sMessage = $serviceManager->get('twig')->render('customer/sendverificationmail.twig', $aP);
     } else {
         $sSubject = HardcodedText::get('newcustomerregistration_mail_subject');
         $sMessage = HardcodedText::get('newcustomerregistration_mail_text1') . ' ';
         $sMessage .= $sTargetAddress . HardcodedText::get('newcustomerregistration_mail_text2') . ' ' . date(HelperConfig::$core['locale_format_date_time']);
         $sTargetAddress = HelperConfig::$core["email_sender"];
     }
     \HaaseIT\HCSF\Helper::mailWrapper($sTargetAddress, $sSubject, $sMessage);
 }
Ejemplo n.º 7
0
 /**
  * @param $CSA
  * @return array
  */
 private function handleShopAdmin($CSA)
 {
     $aSData = [];
     $aData = [];
     if (!isset($_GET["action"])) {
         $bIgnoreStorno = false;
         $sql = 'SELECT * FROM orders WHERE ';
         if (!isset($_REQUEST["type"]) or $_REQUEST["type"] == 'openinwork') {
             $sql .= "(o_ordercompleted = 'n' OR o_ordercompleted = 'i') ";
         } elseif ($_REQUEST["type"] == 'closed') {
             $sql .= "o_ordercompleted = 'y' ";
         } elseif ($_REQUEST["type"] == 'open') {
             $sql .= "o_ordercompleted = 'n' ";
         } elseif ($_REQUEST["type"] == 'inwork') {
             $sql .= "o_ordercompleted = 'i' ";
         } elseif ($_REQUEST["type"] == 'storno') {
             $sql .= "o_ordercompleted = 's' ";
         } elseif ($_REQUEST["type"] == 'deleted') {
             $sql .= "o_ordercompleted = 'd' ";
         } elseif ($_REQUEST["type"] == 'all') {
             $sql .= "o_ordercompleted != 'd' ";
             $bIgnoreStorno = true;
         } else {
             die(HardcodedText::get('shopadmin_error_invalidrequest'));
         }
         $bFromTo = false;
         $sFrom = null;
         $sTo = null;
         if (isset($_REQUEST["type"]) && ($_REQUEST["type"] == 'deleted' or $_REQUEST["type"] == 'all' or $_REQUEST["type"] == 'closed')) {
             $sql .= "AND ";
             $sFrom = \filter_var($_REQUEST["fromyear"], FILTER_SANITIZE_NUMBER_INT) . '-' . Tools::dateAddLeadingZero(\filter_var($_REQUEST["frommonth"], FILTER_SANITIZE_NUMBER_INT));
             $sFrom .= '-' . Tools::dateAddLeadingZero(\filter_var($_REQUEST["fromday"], FILTER_SANITIZE_NUMBER_INT));
             $sTo = \filter_var($_REQUEST["toyear"], FILTER_SANITIZE_NUMBER_INT) . '-' . Tools::dateAddLeadingZero(\filter_var($_REQUEST["tomonth"], FILTER_SANITIZE_NUMBER_INT));
             $sTo .= '-' . Tools::dateAddLeadingZero(\filter_var($_REQUEST["today"], FILTER_SANITIZE_NUMBER_INT));
             $sql .= "o_orderdate >= :from ";
             $sql .= "AND o_orderdate <= :to ";
             $bFromTo = true;
         }
         $sql .= "ORDER BY o_ordertimestamp DESC";
         $hResult = $this->db->prepare($sql);
         if ($bFromTo) {
             $hResult->bindValue(':from', $sFrom);
             $hResult->bindValue(':to', $sTo);
         }
         $hResult->execute();
         if ($hResult->rowCount() != 0) {
             $i = 0;
             $j = 0;
             $k = 0;
             $fGesamtnetto = 0.0;
             while ($aRow = $hResult->fetch()) {
                 if ($aRow["o_ordercompleted"] == 'y') {
                     $sStatus = '<span style="color: green; font-weight: bold;">' . HardcodedText::get('shopadmin_orderstatus_completed') . '</span>';
                 } elseif ($aRow["o_ordercompleted"] == 'n') {
                     $sStatus = '<span style="color: orange; font-weight: bold;">' . HardcodedText::get('shopadmin_orderstatus_open') . '</span>';
                 } elseif ($aRow["o_ordercompleted"] == 'i') {
                     $sStatus = '<span style="color: orange;">' . HardcodedText::get('shopadmin_orderstatus_inwork') . '</span>';
                 } elseif ($aRow["o_ordercompleted"] == 's') {
                     $sStatus = '<span style="color: red; font-weight: bold;">' . HardcodedText::get('shopadmin_orderstatus_canceled') . '</span>';
                 } elseif ($aRow["o_ordercompleted"] == 'd') {
                     $sStatus = HardcodedText::get('shopadmin_orderstatus_deleted');
                 } else {
                     $sStatus = '';
                 }
                 if ($aRow["o_paymentcompleted"] == 'y') {
                     $sZahlungsmethode = '<span style="color: green;">';
                 } else {
                     $sZahlungsmethode = '<span style="color: red;">';
                 }
                 $mZahlungsmethode = $this->serviceManager->get('textcats')->T("order_paymentmethod_" . $aRow["o_paymentmethod"], true);
                 if ($mZahlungsmethode) {
                     $sZahlungsmethode .= $mZahlungsmethode;
                 } else {
                     $sZahlungsmethode .= ucwords($aRow["o_paymentmethod"]);
                 }
                 $sZahlungsmethode .= '</span>';
                 if (trim($aRow["o_corpname"]) == '') {
                     $sName = $aRow["o_name"];
                 } else {
                     $sName = $aRow["o_corpname"];
                 }
                 $aData[] = ['o_id' => $aRow["o_id"], 'o_account_no' => $aRow["o_custno"], 'o_email' => $aRow["o_email"], 'o_cust' => $sName . '<br>' . $aRow["o_zip"] . ' ' . $aRow["o_town"], 'o_authed' => $aRow["o_authed"], 'o_sumnettoall' => number_format($aRow["o_sumnettoall"], HelperConfig::$core['numberformat_decimals'], HelperConfig::$core['numberformat_decimal_point'], HelperConfig::$core['numberformat_thousands_seperator']) . ' ' . HelperConfig::$shop["waehrungssymbol"] . ($aRow["o_mindermenge"] != 0 && $aRow["o_mindermenge"] != '' ? '<br>+' . number_format($aRow["o_mindermenge"], HelperConfig::$core['numberformat_decimals'], HelperConfig::$core['numberformat_decimal_point'], HelperConfig::$core['numberformat_thousands_seperator']) . ' ' . HelperConfig::$shop["waehrungssymbol"] : ''), 'o_order_status' => $sStatus . (trim($aRow["o_lastedit_user"]) != '' ? '<br>' . $aRow["o_lastedit_user"] : ''), 'o_ordertime_number' => date(HelperConfig::$core['locale_format_date_time'], $aRow["o_ordertimestamp"]) . (trim($aRow["o_transaction_no"]) != '' ? '<br>' . $aRow["o_transaction_no"] : ''), 'o_order_host_payment' => $sZahlungsmethode . '<br>' . $aRow["o_srv_hostname"]];
                 if (!($aRow["o_ordercompleted"] == 's' && $bIgnoreStorno)) {
                     $fGesamtnetto += $aRow["o_sumnettoall"];
                     $j++;
                 } else {
                     $k++;
                 }
                 $i++;
             }
             $aSData['listtable_orders'] = Tools::makeListtable($CSA["list_orders"], $aData, $this->serviceManager->get('twig'));
             $aSData['listtable_i'] = $i;
             $aSData['listtable_j'] = $j;
             $aSData['listtable_k'] = $k;
             $aSData['listtable_gesamtnetto'] = $fGesamtnetto;
         } else {
             $aSData['nomatchingordersfound'] = true;
         }
     } elseif (isset($_GET["action"]) && $_GET["action"] == 'edit') {
         $iId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
         $sql = 'SELECT * FROM orders WHERE o_id = :id';
         /** @var \PDOStatement $hResult */
         $hResult = $this->db->prepare($sql);
         $hResult->bindValue(':id', $iId);
         $hResult->execute();
         if ($hResult->rowCount() == 1) {
             $aSData["orderdata"] = $hResult->fetch();
             $sql = 'SELECT * FROM orders_items WHERE oi_o_id = :id';
             $hResult = $this->db->prepare($sql);
             $hResult->bindValue(':id', $iId);
             $hResult->execute();
             $aItems = $hResult->fetchAll();
             $aUserdata = ['cust_no' => $aSData["orderdata"]["o_custno"], 'cust_email' => $aSData["orderdata"]["o_email"], 'cust_corp' => $aSData["orderdata"]["o_corpname"], 'cust_name' => $aSData["orderdata"]["o_name"], 'cust_street' => $aSData["orderdata"]["o_street"], 'cust_zip' => $aSData["orderdata"]["o_zip"], 'cust_town' => $aSData["orderdata"]["o_town"], 'cust_phone' => $aSData["orderdata"]["o_phone"], 'cust_cellphone' => $aSData["orderdata"]["o_cellphone"], 'cust_fax' => $aSData["orderdata"]["o_fax"], 'cust_country' => $aSData["orderdata"]["o_country"], 'cust_group' => $aSData["orderdata"]["o_group"]];
             $aSData["customerform"] = \HaaseIT\HCSF\Customer\Helper::buildCustomerForm(HelperConfig::$lang, 'shopadmin', '', $aUserdata);
             $aSData["orderdata"]["options_shippingservices"] = [''];
             foreach (HelperConfig::$shop["shipping_services"] as $sValue) {
                 $aSData["orderdata"]["options_shippingservices"][] = $sValue;
             }
             $aItemsCarttable = [];
             foreach ($aItems as $aValue) {
                 $aPrice = ['netto_list' => $aValue["oi_price_netto_list"], 'netto_sale' => $aValue["oi_price_netto_sale"], 'netto_rebated' => $aValue["oi_price_netto_rebated"], 'netto_use' => $aValue["oi_price_netto_use"], 'brutto_use' => $aValue["oi_price_brutto_use"]];
                 //$aPrice = $oItem->calcPrice($aValue["oi_price_netto"], HelperConfig::$shop["vat"][$aValue["oi_vat_id"]], '', true);
                 $aItemsCarttable[$aValue["oi_cartkey"]] = ['amount' => $aValue["oi_amount"], 'price' => $aPrice, 'vat' => $aValue["oi_vat"], 'rg' => $aValue["oi_rg"], 'rg_rebate' => $aValue["oi_rg_rebate"], 'name' => $aValue["oi_itemname"], 'img' => $aValue["oi_img"]];
             }
             $aSData = array_merge(\HaaseIT\HCSF\Shop\Helper::buildShoppingCartTable($aItemsCarttable, true, $aSData["orderdata"]["o_group"], '', $aSData["orderdata"]["o_vatfull"], $aSData["orderdata"]["o_vatreduced"]), $aSData);
         } else {
             $aSData['ordernotfound'] = true;
         }
     }
     return $aSData;
 }
Ejemplo n.º 8
0
 /**
  * @param ServiceManager $serviceManager
  */
 public static function loadNavigation(ServiceManager $serviceManager)
 {
     if (is_file(PATH_BASEDIR . 'config/navigation.local.yml')) {
         $navstruct = Yaml::parse(file_get_contents(PATH_BASEDIR . 'config/navigation.local.yml'));
     } else {
         $navstruct = Yaml::parse(file_get_contents(PATH_BASEDIR . 'config/navigation.yml'));
     }
     if (!empty($navstruct) && static::$core['navigation_fetch_text_from_textcats']) {
         $textcats = $serviceManager->get('textcats');
         $TMP = [];
         foreach ($navstruct as $key => $item) {
             foreach ($item as $subkey => $subitem) {
                 if (!empty($textcats->T($subkey))) {
                     $TMP[$key][$textcats->T($subkey)] = $subitem;
                 } else {
                     $TMP[$key][$subkey] = $subitem;
                 }
             }
         }
         $navstruct = $TMP;
         unset($TMP);
     }
     if (isset($navstruct["admin"])) {
         unset($navstruct["admin"]);
     }
     $navstruct["admin"][HardcodedText::get('admin_nav_home')] = '/_admin/index.html';
     if (static::$core["enable_module_shop"]) {
         $navstruct["admin"][HardcodedText::get('admin_nav_orders')] = '/_admin/shopadmin.html';
         $navstruct["admin"][HardcodedText::get('admin_nav_items')] = '/_admin/itemadmin.html';
         $navstruct["admin"][HardcodedText::get('admin_nav_itemgroups')] = '/_admin/itemgroupadmin.html';
     }
     if (static::$core["enable_module_customer"]) {
         $navstruct["admin"][HardcodedText::get('admin_nav_customers')] = '/_admin/customeradmin.html';
     }
     $navstruct["admin"][HardcodedText::get('admin_nav_pages')] = '/_admin/pageadmin.html';
     $navstruct["admin"][HardcodedText::get('admin_nav_textcats')] = '/_admin/textcatadmin.html';
     $navstruct["admin"][HardcodedText::get('admin_nav_cleartemplatecache')] = '/_admin/cleartemplatecache.html';
     $navstruct["admin"][HardcodedText::get('admin_nav_clearimagecache')] = '/_admin/clearimagecache.html';
     $navstruct["admin"][HardcodedText::get('admin_nav_phpinfo')] = '/_admin/phpinfo.html';
     $navstruct["admin"][HardcodedText::get('admin_nav_dbstatus')] = '/_admin/dbstatus.html';
     static::$navigation = $navstruct;
 }
Ejemplo n.º 9
0
 public function preparePage()
 {
     $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager);
     $this->P->cb_pagetype = 'content';
     $this->P->oPayload->cl_html = \HaaseIT\HCSF\HardcodedText::get('site_currently_in_maintenance_mode');
 }
Ejemplo n.º 10
0
 public function testGetHardcodedTextFail()
 {
     $HT = ['test' => 'textstring'];
     \HaaseIT\HCSF\HardcodedText::init($HT);
     $this->assertEquals('Missing Hardcoded Text: undefined', \HaaseIT\HCSF\HardcodedText::get('undefined'));
 }
Ejemplo n.º 11
0
        \session_unset();
        $_SESSION['hijackprevention']['remote_addr'] = $_SERVER['REMOTE_ADDR'];
        $_SESSION['hijackprevention']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
    }
}
date_default_timezone_set(HelperConfig::$core["defaulttimezone"]);
if (file_exists(PATH_BASEDIR . 'src/hardcodedtextcats/' . HelperConfig::$lang . '.php')) {
    $HT = (require PATH_BASEDIR . 'src/hardcodedtextcats/' . HelperConfig::$lang . '.php');
} else {
    if (file_exists(PATH_BASEDIR . 'src/hardcodedtextcats/' . key(HelperConfig::$core["lang_available"]) . '.php')) {
        $HT = (require PATH_BASEDIR . 'src/hardcodedtextcats/' . key(HelperConfig::$core["lang_available"]) . '.php');
    } else {
        $HT = (require PATH_BASEDIR . 'src/hardcodedtextcats/de.php');
    }
}
HardcodedText::init($HT);
$serviceManager->setFactory('db', function () {
    return null;
});
if (!HelperConfig::$core['maintenancemode']) {
    // ----------------------------------------------------------------------------
    // Begin database init
    // ----------------------------------------------------------------------------
    $serviceManager->setFactory('entitymanager', function () {
        $doctrineconfig = Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([PATH_BASEDIR . "/src"], HelperConfig::$core['debug']);
        $connectionParams = ['url' => HelperConfig::$secrets['db_type'] . '://' . HelperConfig::$secrets['db_user'] . ':' . HelperConfig::$secrets['db_password'] . '@' . HelperConfig::$secrets['db_server'] . '/' . HelperConfig::$secrets['db_name'], 'charset' => 'UTF8', 'driverOptions' => [\PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION]];
        return Doctrine\ORM\EntityManager::create($connectionParams, $doctrineconfig);
    });
    $serviceManager->setFactory('db', function (ServiceManager $serviceManager) {
        return $serviceManager->get('entitymanager')->getConnection()->getWrappedConnection();
    });