Completed
Push — master ( 0afdc4...0e57e6 )
by Alexey
04:27
created
system/modules/Ecommerce/widgets/cart/delivery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
         } else {
10 10
           $checked = '';
11 11
         }
12
-        echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">';
12
+        echo '<li'.($checked ? ' class="active"' : '').'><a href = "#" onclick = "document.getElementById(\''.$hiddenId.'\').value=\''.$delivery->id.'\';inji.Ecommerce.Cart.calcSum();return false;">';
13 13
         echo $delivery->name;
14 14
         echo '</a></li>';
15 15
       }
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
     if ($cart->delivery) {
28 28
       echo "<h4>Информация о доставке</h4>";
29 29
       if ($cart->delivery->price_text || $cart->delivery->price) {
30
-        echo "<div>Стоимость доставки: <b>" . ($cart->delivery->price_text ? $cart->delivery->price_text : ( $cart->delivery->price . ' ' . ($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.') )) . '</b></div>';
30
+        echo "<div>Стоимость доставки: <b>".($cart->delivery->price_text ? $cart->delivery->price_text : ($cart->delivery->price.' '.($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.'))).'</b></div>';
31 31
       }
32 32
       if ((float) $cart->delivery->max_cart_price) {
33
-        echo '<div>При заказе товаров на сумму от ' . $cart->delivery->max_cart_price . ' руб - бесплатно</div>';
33
+        echo '<div>При заказе товаров на сумму от '.$cart->delivery->max_cart_price.' руб - бесплатно</div>';
34 34
       }
35 35
       echo $cart->delivery->info;
36 36
       if ($cart->delivery->fields) {
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Cart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
   ];
213 213
 
214 214
   public static function itemName($item) {
215
-    return $item->pk() . '. ' . $item->name();
215
+    return $item->pk().'. '.$item->name();
216 216
   }
217 217
 
218 218
   public static $forms = [
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery/Field.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
       'userfield' => ['type' => 'text'],
22 22
       'required' => ['type' => 'bool'],
23 23
       'save' => ['type' => 'bool'],
24
-      'fieldItem'=>['type'=>'dataManager','relation'=>'fieldItems'],
24
+      'fieldItem'=>['type'=>'dataManager', 'relation'=>'fieldItems'],
25 25
       //Системные
26 26
       'date_create' => ['type' => 'dateTime'],
27 27
   ];
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
   public static $dataManagers = [
37 37
       'manager' => [
38 38
           'cols' => [
39
-              'name', 'type', 'userfield', 'required','fieldItem',  'save'
39
+              'name', 'type', 'userfield', 'required', 'fieldItem', 'save'
40 40
           ],
41 41
       ]
42 42
   ];
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
           'map' => [
46 46
               ['name', 'type'],
47 47
               ['required', 'save'],
48
-              [ 'userfield']
48
+              ['userfield']
49 49
           ]
50 50
       ]
51 51
   ];
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Parser/Item/Images.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
     $dir = pathinfo($this->object->walker->migtarionLog->source, PATHINFO_DIRNAME);
26 26
     $this->model->image_file_id = 0;
27 27
     foreach ($value as $key => $imagePath) {
28
-      if (!$imagePath || !file_exists($dir . '/' . $imagePath)) {
28
+      if (!$imagePath || !file_exists($dir.'/'.$imagePath)) {
29 29
         continue;
30 30
       }
31 31
       $notEq = true;
32
-      $md5Cur = md5_file($dir . '/' . $imagePath);
32
+      $md5Cur = md5_file($dir.'/'.$imagePath);
33 33
       foreach ($this->model->images as $imageId => $image) {
34 34
         $file = $image->file;
35 35
         $md5File = '';
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         }
48 48
       }
49 49
       if ($notEq) {
50
-        $file_id = \App::$primary->files->uploadFromUrl($dir . '/' . $imagePath, ['accept_group' => 'image', 'upload_code' => 'MigrationUpload']);
50
+        $file_id = \App::$primary->files->uploadFromUrl($dir.'/'.$imagePath, ['accept_group' => 'image', 'upload_code' => 'MigrationUpload']);
51 51
         $image = new \Ecommerce\Item\Image([
52 52
             'item_id' => $this->model->pk(),
53 53
             'file_id' => $file_id
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/CartController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $warecount = $cartitem->price->offer->warehouseCount($cart->id);
62 62
             if ($cartitem->count > $warecount) {
63 63
               $error = true;
64
-              Msg::add('Вы заказали <b>' . $cartitem->item->name . '</b> больше чем есть на складе. на складе: <b>' . $warecount . '</b>', 'danger');
64
+              Msg::add('Вы заказали <b>'.$cartitem->item->name.'</b> больше чем есть на складе. на складе: <b>'.$warecount.'</b>', 'danger');
65 65
             }
66 66
           }
67 67
         }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
           foreach ($deliverys[$cart->delivery_id]->fields as $field) {
74 74
             if (empty($_POST['deliveryFields'][$field->id]) && $field->required) {
75 75
               $error = 1;
76
-              Msg::add('Вы не указали: ' . $field->name, 'danger');
76
+              Msg::add('Вы не указали: '.$field->name, 'danger');
77 77
             }
78 78
           }
79 79
         }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         foreach (\Ecommerce\UserAdds\Field::getList() as $field) {
90 90
           if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
91 91
             $error = 1;
92
-            Msg::add('Вы не указали: ' . $field->name, 'danger');
92
+            Msg::add('Вы не указали: '.$field->name, 'danger');
93 93
           }
94 94
         }
95 95
         if (!empty($_POST['discounts']['card_item_id'])) {
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
           }
127 127
           $cart = \Ecommerce\Cart::get($cart->id);
128 128
           if (!empty(\App::$cur->ecommerce->config['notify_mail'])) {
129
-            $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/ecommerce/Cart">Админ панель</a>';
130
-            $title = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
131
-            \Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
129
+            $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/admin/ecommerce/Cart">Админ панель</a>';
130
+            $title = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
131
+            \Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
132 132
           }
133 133
           if ($this->notifications) {
134 134
             $notification = new Notifications\Notification();
135
-            $notification->name = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
135
+            $notification->name = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
136 136
             $notification->text = 'Перейдите в админ панель чтобы просмотреть новый заказ';
137 137
             $notification->chanel_id = $this->notifications->getChanel('Ecommerce-orders')->id;
138 138
             $notification->save();
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
         'href' => '/ecommerce/cart'
178 178
     ];
179 179
     $bread[] = [
180
-        'text' => 'Заказ: №' . $cart->id,
181
-        'href' => '/ecommerce/cart/orderDetail/' . $cart->id
180
+        'text' => 'Заказ: №'.$cart->id,
181
+        'href' => '/ecommerce/cart/orderDetail/'.$cart->id
182 182
     ];
183
-    $this->view->setTitle('Заказ №' . $cart->id);
183
+    $this->view->setTitle('Заказ №'.$cart->id);
184 184
     $this->view->page(['data' => compact('cart', 'bread')]);
185 185
   }
186 186
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
       $result->send();
269 269
     }
270 270
 
271
-    $item->sales ++;
271
+    $item->sales++;
272 272
     $item->save();
273 273
 
274 274
     if (empty($_GET['count']))
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     $stages = Ecommerce\Cart\Stage::getList();
281 281
     if (empty($this->module->config['sell_over_warehouse']) && $price->offer->warehouseCount() < $count) {
282 282
       $result->success = false;
283
-      $result->content = 'На складе недостаточно товара! Доступно: ' . $price->offer->warehouseCount();
283
+      $result->content = 'На складе недостаточно товара! Доступно: '.$price->offer->warehouseCount();
284 284
       $result->send();
285 285
     }
286 286
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     }
299 299
     $cart->date_last_activ = date('Y-m-d H:i:s');
300 300
     $cart->calc();
301
-    $result->successMsg = '<a href="/ecommerce/view/' . $item->id . '">' . $item->name() . ($price->offer->name() ? ' (' . $price->offer->name() . ')' : '') . '</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
301
+    $result->successMsg = '<a href="/ecommerce/view/'.$item->id.'">'.$item->name().($price->offer->name() ? ' ('.$price->offer->name().')' : '').'</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
302 302
     $result->send();
303 303
   }
304 304
 
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/EcommerceController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
       foreach ($fields as $field) {
43 43
         if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
44 44
           $error = 1;
45
-          Msg::add('Вы не указали: ' . $field->name);
45
+          Msg::add('Вы не указали: '.$field->name);
46 46
         }
47 47
       }
48 48
       if (!$error) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $extra->price = $card->price;
71 71
         $extra->count = 1;
72 72
         $extra->cart_id = $cart->id;
73
-        $extra->info = 'card:' . $card->id . '|cardItem:' . $cardItem->id;
73
+        $extra->info = 'card:'.$card->id.'|cardItem:'.$cardItem->id;
74 74
         $extra->save();
75 75
         Tools::redirect('/ecommerce/cart/success');
76 76
       }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
       $items = $this->ecommerce->getItems();
85 85
       $return = [];
86 86
       foreach ($items as $item) {
87
-        $return[] = ['name' => $item->name(), 'search' => $item->search_index . ' ' . $item->name];
87
+        $return[] = ['name' => $item->name(), 'search' => $item->search_index.' '.$item->name];
88 88
       }
89 89
       $return = json_encode($return);
90 90
       Cache::set('itemsAutocomplete', [], $return);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
       $categoryIds = array_values(array_filter(explode('/', $category->tree_path)));
159 159
       foreach ($categoryIds as $id) {
160 160
         $cat = Ecommerce\Category::get($id);
161
-        $bread[] = array('text' => $cat->name, 'href' => '/ecommerce/itemList/' . $cat->id);
161
+        $bread[] = array('text' => $cat->name, 'href' => '/ecommerce/itemList/'.$cat->id);
162 162
       }
163 163
       $bread[] = array('text' => $category->name);
164 164
       $this->view->setTitle($category->name);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     foreach ($catalogIds as $id) {
224 224
       $cat = Ecommerce\Category::get($id);
225 225
       if ($cat) {
226
-        $bread[] = ['text' => $cat->name, 'href' => '/ecommerce/itemList/' . $cat->id];
226
+        $bread[] = ['text' => $cat->name, 'href' => '/ecommerce/itemList/'.$cat->id];
227 227
       }
228 228
     }
229 229
     $bread[] = ['text' => $item->name()];
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
     $this->view->addMetaTag(['property' => 'og:title', 'content' => $item->name]);
240 240
     $this->view->addMetaTag(['property' => 'og:description', 'content' => $item->description]);
241 241
     if ($item->image) {
242
-      $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://' . INJI_DOMAIN_NAME . $item->image->path]);
242
+      $this->view->addMetaTag(['property' => 'og:image', 'content' => 'http://'.INJI_DOMAIN_NAME.$item->image->path]);
243 243
     }
244
-    $this->view->addMetaTag(['property' => 'og:url', 'content' => 'http://' . INJI_DOMAIN_NAME . '/view/' . $item->id]);
244
+    $this->view->addMetaTag(['property' => 'og:url', 'content' => 'http://'.INJI_DOMAIN_NAME.'/view/'.$item->id]);
245 245
 
246 246
     $this->view->page($options);
247 247
   }
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Mode/Init.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
   public function process() {
17 17
     echo "zip=no\n";
18
-    echo 'file_limit=' . \Tools::toBytes(ini_get('post_max_size'));
18
+    echo 'file_limit='.\Tools::toBytes(ini_get('post_max_size'));
19 19
     $this->end();
20 20
 
21 21
     //clean files
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
       $query = \App::$cur->db->newQuery();
24 24
       $query->operation = 'select';
25 25
       $query->table = \Exchange1c\Exchange\File::table();
26
-      $query->cols = \Exchange1c\Exchange\File::colPrefix() . 'id';
26
+      $query->cols = \Exchange1c\Exchange\File::colPrefix().'id';
27 27
       $queryArr = $query->buildQuery();
28
-      $queryArr['query'].=' where `' . \Exchange1c\Exchange\File::colPrefix() . 'deleted` = 0 AND  `' . \Exchange1c\Exchange\File::colPrefix() . 'date_create` < NOW() - INTERVAL ' . \App::$cur->exchange1c->config['maxSaveFilesInterval'];
28
+      $queryArr['query'] .= ' where `'.\Exchange1c\Exchange\File::colPrefix().'deleted` = 0 AND  `'.\Exchange1c\Exchange\File::colPrefix().'date_create` < NOW() - INTERVAL '.\App::$cur->exchange1c->config['maxSaveFilesInterval'];
29 29
       try {
30 30
         $ids = array_keys($query->query($queryArr)->getArray(\Exchange1c\Exchange\File::colPrefix().'id'));
31 31
       } catch (\PDOException $exc) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         } elseif ($exc->getCode() == '42S22') {
35 35
           $cols = \Exchange1c\Exchange\File::cols();
36 36
           foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) {
37
-            if (!isset($cols[\Exchange1c\Exchange\File::colPrefix() . $colName])) {
37
+            if (!isset($cols[\Exchange1c\Exchange\File::colPrefix().$colName])) {
38 38
               \Exchange1c\Exchange\File::createCol($colName);
39 39
             }
40 40
           }
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Mode/File.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@
 block discarded – undo
25 25
     $filename = \Tools::parsePath($_GET['filename']);
26 26
     if (strpos($filename, '/') !== false) {
27 27
       $subDir = substr($filename, 0, strrpos($filename, "/") + 1);
28
-      \Tools::createDir($dir . '/' . $subDir);
28
+      \Tools::createDir($dir.'/'.$subDir);
29 29
     }
30 30
     $text = '';
31
-    if (false === file_put_contents($dir . '/' . $filename, file_get_contents("php://input"))) {
32
-      $text = 'Fail on save file: ' . $filename;
31
+    if (false === file_put_contents($dir.'/'.$filename, file_get_contents("php://input"))) {
32
+      $text = 'Fail on save file: '.$filename;
33 33
       $file->status = 'failure';
34 34
     } else {
35
-      $file->size = ceil(filesize($dir . '/' . $filename));
35
+      $file->size = ceil(filesize($dir.'/'.$filename));
36 36
       $file->name = $filename;
37 37
       $file->status = 'success';
38 38
     }
39 39
     $file->save();
40 40
     if (strpos($filename, '1cbitrix') !== false) {
41
-      $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $filename));
41
+      $data = new \SimpleXMLElement(file_get_contents($dir.'/'.$filename));
42 42
       $orders = new \Exchange1c\Parser\Orders($data);
43 43
       $orders->process();
44 44
     }
Please login to merge, or discard this patch.
system/modules/Exchange1c/models/Exchange/File.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
   ];
31 31
 
32 32
   public function deleteFile() {
33
-    if ($this->exchange && file_exists($this->exchange->path . '/' . $this->name)) {
34
-      unlink($this->exchange->path . '/' . $this->name);
33
+    if ($this->exchange && file_exists($this->exchange->path.'/'.$this->name)) {
34
+      unlink($this->exchange->path.'/'.$this->name);
35 35
     }
36 36
     $this->deleted = 1;
37 37
     $this->save();
Please login to merge, or discard this patch.