@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
| 227 | - * @return bool |
|
| 227 | + * @return false|null |
|
| 228 | 228 | */ |
| 229 | 229 | private function doCheckout() |
| 230 | 230 | { |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
| 332 | - * @param $iInsertID |
|
| 332 | + * @param string $iInsertID |
|
| 333 | 333 | * @param $sMailbody_us |
| 334 | 334 | * @param $sMailbody_they |
| 335 | 335 | * @param $aImagesToSend |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | /** |
| 379 | - * @param $field |
|
| 379 | + * @param string $field |
|
| 380 | 380 | * @return string |
| 381 | 381 | */ |
| 382 | 382 | private function getPostValue($field) |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * @param $sReply |
|
| 121 | + * @param string $sReply |
|
| 122 | 122 | * @param array $aMore |
| 123 | 123 | */ |
| 124 | 124 | private function replyToCartUpdate($sReply, $aMore = []) { |
@@ -214,6 +214,9 @@ discard block |
||
| 214 | 214 | return $aP; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | + /** |
|
| 218 | + * @param Page $P |
|
| 219 | + */ |
|
| 217 | 220 | private static function getDebug($aP, $P) |
| 218 | 221 | { |
| 219 | 222 | if (!empty($_POST)) { |
@@ -260,6 +263,9 @@ discard block |
||
| 260 | 263 | return $sLang; |
| 261 | 264 | } |
| 262 | 265 | |
| 266 | + /** |
|
| 267 | + * @param string $purpose |
|
| 268 | + */ |
|
| 263 | 269 | public static function getPurifier($purpose) |
| 264 | 270 | { |
| 265 | 271 | $purifier_config = \HTMLPurifier_Config::createDefault(); |
@@ -85,6 +85,9 @@ |
||
| 85 | 85 | return $hResult->execute(); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param string $sPagekeytoadd |
|
| 90 | + */ |
|
| 88 | 91 | public function insert($sPagekeytoadd) { |
| 89 | 92 | $aData = [ |
| 90 | 93 | 'cb_key' => $sPagekeytoadd, |
@@ -56,7 +56,9 @@ |
||
| 56 | 56 | $hResult->fetch(); |
| 57 | 57 | |
| 58 | 58 | if ($this->cb_pagetype !== 'shorturl') { |
| 59 | - if (!$bReturnRaw) $this->cb_pageconfig = json_decode($this->cb_pageconfig); |
|
| 59 | + if (!$bReturnRaw) { |
|
| 60 | + $this->cb_pageconfig = json_decode($this->cb_pageconfig); |
|
| 61 | + } |
|
| 60 | 62 | $this->oPayload = $this->getPayload(); |
| 61 | 63 | } |
| 62 | 64 | } |
@@ -81,7 +81,9 @@ discard block |
||
| 81 | 81 | ]; |
| 82 | 82 | $sql = DBTools::buildPSInsertQuery($aData, 'itemgroups_text'); |
| 83 | 83 | $hResult = $this->db->prepare($sql); |
| 84 | - foreach ($aData as $sKey => $sValue) $hResult->bindValue(':'.$sKey, $sValue); |
|
| 84 | + foreach ($aData as $sKey => $sValue) { |
|
| 85 | + $hResult->bindValue(':'.$sKey, $sValue); |
|
| 86 | + } |
|
| 85 | 87 | $hResult->execute(); |
| 86 | 88 | header('Location: /_admin/itemgroupadmin.html?gid='.$iGID.'&action=editgroup'); |
| 87 | 89 | die(); |
@@ -107,14 +109,20 @@ discard block |
||
| 107 | 109 | $sGNo = filter_var($_REQUEST["no"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); |
| 108 | 110 | $sImg = filter_var($_REQUEST["img"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); |
| 109 | 111 | |
| 110 | - if (strlen($sName) < 3) $aErr["nametooshort"] = true; |
|
| 111 | - if (strlen($sGNo) < 3) $aErr["grouptooshort"] = true; |
|
| 112 | + if (strlen($sName) < 3) { |
|
| 113 | + $aErr["nametooshort"] = true; |
|
| 114 | + } |
|
| 115 | + if (strlen($sGNo) < 3) { |
|
| 116 | + $aErr["grouptooshort"] = true; |
|
| 117 | + } |
|
| 112 | 118 | if (count($aErr) == 0) { |
| 113 | 119 | $sql = 'SELECT itmg_no FROM itemgroups_base WHERE itmg_no = :no'; |
| 114 | 120 | $hResult = $this->db->prepare($sql); |
| 115 | 121 | $hResult->bindValue(':no', $sGNo); |
| 116 | 122 | $hResult->execute(); |
| 117 | - if ($hResult->rowCount() > 0) $aErr["duplicateno"] = true; |
|
| 123 | + if ($hResult->rowCount() > 0) { |
|
| 124 | + $aErr["duplicateno"] = true; |
|
| 125 | + } |
|
| 118 | 126 | } |
| 119 | 127 | if (count($aErr) == 0) { |
| 120 | 128 | $aData = [ |
@@ -124,7 +132,9 @@ discard block |
||
| 124 | 132 | ]; |
| 125 | 133 | $sql = DBTools::buildPSInsertQuery($aData, 'itemgroups_base'); |
| 126 | 134 | $hResult = $this->db->prepare($sql); |
| 127 | - foreach ($aData as $sKey => $sValue) $hResult->bindValue(':'.$sKey, $sValue); |
|
| 135 | + foreach ($aData as $sKey => $sValue) { |
|
| 136 | + $hResult->bindValue(':'.$sKey, $sValue); |
|
| 137 | + } |
|
| 128 | 138 | $hResult->execute(); |
| 129 | 139 | $iLastInsertID = $this->db->lastInsertId(); |
| 130 | 140 | header('Location: /_admin/itemgroupadmin.html?action=editgroup&added&gid='.$iLastInsertID); |
@@ -161,7 +171,9 @@ discard block |
||
| 161 | 171 | $hResult->execute(); |
| 162 | 172 | $iNumRows = $hResult->rowCount(); |
| 163 | 173 | |
| 164 | - if ($iNumRows > 0) return 'duplicateno'; |
|
| 174 | + if ($iNumRows > 0) { |
|
| 175 | + return 'duplicateno'; |
|
| 176 | + } |
|
| 165 | 177 | |
| 166 | 178 | $aData = [ |
| 167 | 179 | 'itmg_name' => filter_var($_REQUEST["name"], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW), |
@@ -194,7 +206,9 @@ discard block |
||
| 194 | 206 | ]; |
| 195 | 207 | $sql = DBTools::buildPSUpdateQuery($aData, 'itemgroups_text', 'itmgt_id'); |
| 196 | 208 | $hResult = $this->db->prepare($sql); |
| 197 | - foreach ($aData as $sKey => $sValue) $hResult->bindValue(':' . $sKey, $sValue); |
|
| 209 | + foreach ($aData as $sKey => $sValue) { |
|
| 210 | + $hResult->bindValue(':' . $sKey, $sValue); |
|
| 211 | + } |
|
| 198 | 212 | $hResult->execute(); |
| 199 | 213 | } |
| 200 | 214 | |
@@ -237,11 +251,15 @@ discard block |
||
| 237 | 251 | $sql = 'SELECT * FROM itemgroups_base ' |
| 238 | 252 | . 'LEFT OUTER JOIN itemgroups_text ON itemgroups_base.itmg_id = itemgroups_text.itmgt_pid' |
| 239 | 253 | . ' AND itemgroups_text.itmgt_lang = :lang'; |
| 240 | - if ($iGID != '') $sql .= ' WHERE itmg_id = :gid'; |
|
| 254 | + if ($iGID != '') { |
|
| 255 | + $sql .= ' WHERE itmg_id = :gid'; |
|
| 256 | + } |
|
| 241 | 257 | $sql .= ' ORDER BY itmg_no'; |
| 242 | 258 | $hResult = $this->db->prepare($sql); |
| 243 | 259 | $hResult->bindValue(':lang', HelperConfig::$lang); |
| 244 | - if ($iGID != '') $hResult->bindValue(':gid', $iGID); |
|
| 260 | + if ($iGID != '') { |
|
| 261 | + $hResult->bindValue(':gid', $iGID); |
|
| 262 | + } |
|
| 245 | 263 | $hResult->execute(); |
| 246 | 264 | |
| 247 | 265 | $aGroups = $hResult->fetchAll(); |
@@ -86,8 +86,7 @@ discard block |
||
| 86 | 86 | if (!is_array($mItemno)) { |
| 87 | 87 | $hResult->bindValue(':itemno', $mItemno, \PDO::PARAM_STR); |
| 88 | 88 | } |
| 89 | - } |
|
| 90 | - elseif (isset($_REQUEST["searchtext"]) && strlen($_REQUEST["searchtext"]) > 2) { |
|
| 89 | + } elseif (isset($_REQUEST["searchtext"]) && strlen($_REQUEST["searchtext"]) > 2) { |
|
| 91 | 90 | $sSearchtext = filter_var(trim($_REQUEST["searchtext"]), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); |
| 92 | 91 | if (isset($_REQUEST["artnoexact"])) { |
| 93 | 92 | $hResult->bindValue(':searchtext', $sSearchtext, \PDO::PARAM_STR); |
@@ -114,8 +113,9 @@ discard block |
||
| 114 | 113 | $sql .= 'item_base.itm_no = :itemno'; |
| 115 | 114 | } |
| 116 | 115 | } elseif (isset($_REQUEST["searchtext"]) && \strlen($_REQUEST["searchtext"]) > 2) { |
| 117 | - if (isset($_REQUEST["artnoexact"])) $sql .= 'item_base.itm_no = :searchtext'; |
|
| 118 | - else { |
|
| 116 | + if (isset($_REQUEST["artnoexact"])) { |
|
| 117 | + $sql .= 'item_base.itm_no = :searchtext'; |
|
| 118 | + } else { |
|
| 119 | 119 | $sql .= '(item_base.itm_no LIKE :searchtextwild1 OR itm_name LIKE :searchtextwild2'; |
| 120 | 120 | $sql .= ' OR itml_name_override LIKE :searchtextwild3 OR itml_text1 LIKE :searchtextwild4'; |
| 121 | 121 | $sql .= ' OR itml_text2 LIKE :searchtextwild5)'; |
@@ -123,7 +123,9 @@ discard block |
||
| 123 | 123 | } else { |
| 124 | 124 | if (is_array($mItemIndex)) { |
| 125 | 125 | $sql .= "("; |
| 126 | - foreach ($mItemIndex as $sAIndex) $sql .= "itm_index LIKE '%".filter_var($sAIndex, FILTER_SANITIZE_SPECIAL_CHARS)."%' OR "; |
|
| 126 | + foreach ($mItemIndex as $sAIndex) { |
|
| 127 | + $sql .= "itm_index LIKE '%".filter_var($sAIndex, FILTER_SANITIZE_SPECIAL_CHARS)."%' OR "; |
|
| 128 | + } |
|
| 127 | 129 | $sql = \HaaseIT\Toolbox\Tools::cutStringend($sql, 4); |
| 128 | 130 | $sql .= ")"; |
| 129 | 131 | } else { |
@@ -116,9 +116,13 @@ |
||
| 116 | 116 | If the last part of the path doesn't include a dot (.) and is not empty, apend a slash. |
| 117 | 117 | If there is already a slash at the end, the last part of the path array will be empty. |
| 118 | 118 | */ |
| 119 | - if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') $this->sPath .= '/'; |
|
| 119 | + if (mb_strpos($aPath[count($aPath) - 1], '.') === false && $aPath[count($aPath) - 1] != '') { |
|
| 120 | + $this->sPath .= '/'; |
|
| 121 | + } |
|
| 120 | 122 | |
| 121 | - if ($this->sPath[strlen($this->sPath) - 1] == '/') $this->sPath .= 'index.html'; |
|
| 123 | + if ($this->sPath[strlen($this->sPath) - 1] == '/') { |
|
| 124 | + $this->sPath .= 'index.html'; |
|
| 125 | + } |
|
| 122 | 126 | |
| 123 | 127 | $this->P = new UserPage($this->serviceManager, $this->sPath); |
| 124 | 128 | } |
@@ -27,6 +27,9 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | class Helper |
| 29 | 29 | { |
| 30 | + /** |
|
| 31 | + * @param string $sLang |
|
| 32 | + */ |
|
| 30 | 33 | public static function validateCustomerForm($sLang, $aErr = [], $bEdit = false) |
| 31 | 34 | { |
| 32 | 35 | if (!isset($_POST["email"]) || !\filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) { |
@@ -92,6 +95,11 @@ discard block |
||
| 92 | 95 | return ''; |
| 93 | 96 | } |
| 94 | 97 | |
| 98 | + /** |
|
| 99 | + * @param string $sKeyConfig |
|
| 100 | + * @param string $sKeyForm |
|
| 101 | + * @param boolean $aUserData |
|
| 102 | + */ |
|
| 95 | 103 | public static function getCustomerFormDefaultValue($sKeyConfig, $sKeyForm, $aUserData) { |
| 96 | 104 | $sDefaultValue = self::getUserData($sKeyConfig, $aUserData); |
| 97 | 105 | if (!$sDefaultValue && isset($_SESSION["formsave_addrform"][$sKeyForm])) { |
@@ -101,6 +109,9 @@ discard block |
||
| 101 | 109 | return $sDefaultValue; |
| 102 | 110 | } |
| 103 | 111 | |
| 112 | + /** |
|
| 113 | + * @param string $sLang |
|
| 114 | + */ |
|
| 104 | 115 | public static function buildCustomerForm($sLang, $sPurpose = 'none', $sErr = '', $aUserData = false) |
| 105 | 116 | { |
| 106 | 117 | $sDefaultCountry = self::getCustomerFormDefaultValue('cust_country', "country", $aUserData); |
@@ -160,14 +160,11 @@ |
||
| 160 | 160 | |
| 161 | 161 | if ($aRow["o_paymentmethod"] === 'prepay') { |
| 162 | 162 | $sPaymentmethod = $this->textcats->T("order_paymentmethod_prepay"); |
| 163 | - } |
|
| 164 | - elseif ($aRow["o_paymentmethod"] === 'paypal') { |
|
| 163 | + } elseif ($aRow["o_paymentmethod"] === 'paypal') { |
|
| 165 | 164 | $sPaymentmethod = $this->textcats->T("order_paymentmethod_paypal"); |
| 166 | - } |
|
| 167 | - elseif ($aRow["o_paymentmethod"] === 'debit') { |
|
| 165 | + } elseif ($aRow["o_paymentmethod"] === 'debit') { |
|
| 168 | 166 | $sPaymentmethod = $this->textcats->T("order_paymentmethod_debit"); |
| 169 | - } |
|
| 170 | - elseif ($aRow["o_paymentmethod"] === 'invoice') { |
|
| 167 | + } elseif ($aRow["o_paymentmethod"] === 'invoice') { |
|
| 171 | 168 | $sPaymentmethod = $this->textcats->T("order_paymentmethod_invoice"); |
| 172 | 169 | } else { |
| 173 | 170 | $sPaymentmethod = ucwords($aRow["o_paymentmethod"]); |