Skip to content

Commit 301333b

Browse files
authored
Merge pull request #1604 from abantecart/1.3.4
1.3.4
2 parents 3277cb8 + f8920ac commit 301333b

File tree

948 files changed

+120842
-121306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

948 files changed

+120842
-121306
lines changed

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \
2121
docker-php-ext-install -j$(nproc) iconv mbstring mysqli pdo_mysql zip soap && \
2222
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
2323
docker-php-ext-install -j$(nproc) gd && \
24-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
24+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2525

2626
ADD default /etc/nginx/sites-available/
2727

@@ -38,7 +38,7 @@ RUN git clone https://github.com/abantecart/abantecart-src.git /var/www/abanteca
3838
RUN chown -R www-data:www-data /var/www/abantecart
3939
WORKDIR /var/www/abantecart/public_html/
4040

41-
RUN service mariadb start && /usr/local/bin/php ./install/cli_install.php install --db_host=127.0.0.1 --db_user=admin --db_password=pass --db_name=abantecart --db_driver=amysqli --db_prefix=abc_ --admin_path=admin --username=admin --password=admin --email=admin@admin.com --http_server=http://localhost --with-sample-data
41+
RUN service mariadb start && /usr/local/bin/php ./install/cli_install.php install --db_host=127.0.0.1 --db_user=admin --db_password=pass --db_name=abantecart --db_driver=amysqli --db_prefix=abc_ --admin_path=admin --username=admin --password=admin --email=admin@admin.com --http_server=http://localhost --with-sample-data=abantecart_sample_data.sql
4242

4343
RUN apt-get clean
4444

public_html/admin/controller/pages/catalog/attribute.php

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@
1717
versions in the future. If you wish to customize AbanteCart for your
1818
needs please refer to http://www.AbanteCart.com for more information.
1919
------------------------------------------------------------------------------*/
20-
if (!defined('DIR_CORE') || !IS_ADMIN) {
21-
header('Location: static_pages/');
22-
}
2320

2421
class ControllerPagesCatalogAttribute extends AController
2522
{
2623
public $error = [];
27-
/**
28-
* @var AAttribute_Manager
29-
*/
24+
/** @var AAttribute_Manager */
3025
private $attribute_manager;
3126

3227
public function __construct($registry, $instance_id, $controller, $parent_controller = '')
@@ -37,7 +32,6 @@ public function __construct($registry, $instance_id, $controller, $parent_contro
3732

3833
public function main()
3934
{
40-
4135
//init controller data
4236
$this->extensions->hk_InitData($this, __FUNCTION__);
4337

@@ -49,17 +43,21 @@ public function main()
4943
unset($this->session->data['success']);
5044
}
5145

52-
$this->document->initBreadcrumb([
53-
'href' => $this->html->getSecureURL('index/home'),
54-
'text' => $this->language->get('text_home'),
55-
'separator' => false,
56-
]);
57-
$this->document->addBreadcrumb([
58-
'href' => $this->html->getSecureURL('catalog/attribute'),
59-
'text' => $this->language->get('heading_title'),
60-
'separator' => ' :: ',
61-
'current' => true,
62-
]);
46+
$this->document->initBreadcrumb(
47+
[
48+
'href' => $this->html->getSecureURL('index/home'),
49+
'text' => $this->language->get('text_home'),
50+
'separator' => false,
51+
]
52+
);
53+
$this->document->addBreadcrumb(
54+
[
55+
'href' => $this->html->getSecureURL('catalog/attribute'),
56+
'text' => $this->language->get('heading_title'),
57+
'separator' => ' :: ',
58+
'current' => true,
59+
]
60+
);
6361

6462
$grid_settings = [
6563
'table_id' => 'attribute_grid',
@@ -127,7 +125,6 @@ public function main()
127125

128126
$grid = $this->dispatch('common/listing_grid', [$grid_settings]);
129127
$this->view->assign('listing_grid', $grid->dispatchGetOutput());
130-
131128
$this->view->assign('insert', $this->html->getSecureURL('catalog/attribute/insert'));
132129

133130
$results = $this->attribute_manager->getAttributeTypes();
@@ -148,7 +145,6 @@ public function main()
148145

149146
public function insert()
150147
{
151-
152148
//init controller data
153149
$this->extensions->hk_InitData($this, __FUNCTION__);
154150

@@ -157,7 +153,7 @@ public function insert()
157153
if ($this->request->is_POST() && $this->validateAttributeForm()) {
158154
$attribute_id = $this->attribute_manager->addAttribute($this->request->post);
159155
$this->session->data['success'] = $this->language->get('text_success');
160-
redirect($this->html->getSecureURL('catalog/attribute/update', '&attribute_id='.$attribute_id));
156+
redirect($this->html->getSecureURL('catalog/attribute/update', '&attribute_id=' . $attribute_id));
161157
}
162158
$this->_getForm();
163159

@@ -177,12 +173,16 @@ public function update()
177173
$this->document->setTitle($this->language->get('heading_title'));
178174

179175
if ($this->request->is_POST() && $this->validateAttributeForm()) {
180-
$this->data['inserted'] =
181-
$this->attribute_manager->updateAttribute($this->request->get['attribute_id'], $this->request->post);
176+
$this->data['inserted'] = $this->attribute_manager->updateAttribute(
177+
$this->request->get['attribute_id'],
178+
$this->request->post
179+
);
182180
$this->extensions->hk_ProcessData($this, __FUNCTION__);
183181
$this->session->data['success'] = $this->language->get('text_success');
184-
redirect($this->html->getSecureURL('catalog/attribute/update',
185-
'&attribute_id='.$this->request->get['attribute_id']));
182+
redirect($this->html->getSecureURL(
183+
'catalog/attribute/update',
184+
'&attribute_id=' . $this->request->get['attribute_id'])
185+
);
186186
}
187187

188188
$this->_getForm();
@@ -191,10 +191,10 @@ public function update()
191191
$this->extensions->hk_UpdateData($this, __FUNCTION__);
192192
}
193193

194-
private function _getForm()
194+
protected function _getForm()
195195
{
196196

197-
$this->data = [];
197+
$this->data = $attribute_type_info = [];
198198
$this->data['error'] = $this->error;
199199
$this->data['cancel'] = $this->html->getSecureURL('catalog/attribute');
200200
$this->data['get_attribute_type'] = $this->html->getSecureURL('r/catalog/attribute/get_attribute_type');
@@ -218,7 +218,9 @@ private function _getForm()
218218
$this->language->getContentLanguageID()
219219
);
220220

221-
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById((int)$attribute_info['attribute_type_id']);
221+
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById(
222+
(int)$attribute_info['attribute_type_id']
223+
);
222224

223225
//load values for attributes with options
224226

@@ -241,7 +243,9 @@ private function _getForm()
241243
}
242244

243245
if (has_value($this->request->get['attribute_type_id'])) {
244-
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById((int)$this->request->get['attribute_type_id']);
246+
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById(
247+
(int)$this->request->get['attribute_type_id']
248+
);
245249
}
246250

247251
$fields = [
@@ -301,14 +305,14 @@ private function _getForm()
301305
}*/
302306

303307
if (!$attribute_id) {
304-
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/insert', '&attribute_type_id='.$attribute_type_id);
305-
$this->data['heading_title'] = $this->language->get('text_insert').$this->language->get('text_attribute');
308+
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/insert', '&attribute_type_id=' . $attribute_type_id);
309+
$this->data['heading_title'] = $this->language->get('text_insert') . $this->language->get('text_attribute');
306310
$this->data['update'] = '';
307311
$form = new AForm('ST');
308312
} else {
309-
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/update', '&attribute_id='.$attribute_id.'&attribute_type_id='.$attribute_type_id);
310-
$this->data['heading_title'] = $this->language->get('text_edit').$this->language->get('text_attribute');
311-
$this->data['update'] = $this->html->getSecureURL('listing_grid/attribute/update_field', '&id='.$attribute_id);
313+
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/update', '&attribute_id=' . $attribute_id . '&attribute_type_id=' . $attribute_type_id);
314+
$this->data['heading_title'] = $this->language->get('text_edit') . $this->language->get('text_attribute');
315+
$this->data['update'] = $this->html->getSecureURL('listing_grid/attribute/update_field', '&id=' . $attribute_id);
312316
$form = new AForm('HT');
313317
$this->data['attribute_id'] = $attribute_id;
314318
}
@@ -441,15 +445,17 @@ public function validateAttributeForm()
441445
$this->request->post['placeholder'] = trim($this->request->post['placeholder']);
442446
}
443447

444-
$this->error = array_merge($this->error, $this->attribute_manager->validateAttributeCommonData($this->request->post));
448+
$this->error = array_merge(
449+
$this->error,
450+
$this->attribute_manager->validateAttributeCommonData($this->request->post)
451+
);
445452

446453
//update controller data
447454
$this->extensions->hk_UpdateData($this, __FUNCTION__);
448-
449455
return (!$this->error);
450456
}
451457

452-
private function _initTabs($active = null)
458+
protected function _initTabs($active = null)
453459
{
454460
$method = (has_value($this->request->get['attribute_id']) ? 'update' : 'insert');
455461

@@ -469,15 +475,16 @@ private function _initTabs($active = null)
469475

470476
$this->data['tabs'][$type_id] = [
471477
'text' => $type['type_name'],
472-
'href' => $method == 'insert' ? $this->html->getSecureURL('catalog/attribute/'.$method, '&attribute_type_id='.$type_id) : '',
478+
'href' => $method == 'insert'
479+
? $this->html->getSecureURL('catalog/attribute/' . $method, '&attribute_type_id=' . $type_id)
480+
: '',
473481
];
474482
}
475483

476-
if (in_array($active, array_keys($this->data['tabs']))) {
477-
$this->data['tabs'][$active]['active'] = 1;
478-
} else {
479-
$this->data['tabs'][key($this->data['tabs'])]['active'] = 1;
480-
}
484+
$active = in_array($active, array_keys($this->data['tabs']))
485+
? $active
486+
: key($this->data['tabs']);
487+
$this->data['tabs'][$active]['active'] = 1;
481488
}
482489
}
483490

public_html/admin/controller/pages/catalog/product_promotions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
class ControllerPagesCatalogProductPromotions extends AController
2626
{
2727
public $error = [];
28+
public $data = [];
2829

2930
public function main()
3031
{
@@ -51,7 +52,7 @@ public function main()
5152
$this->request->post
5253
);
5354
} else { //insert
54-
$this->model_catalog_product->addProductDiscount(
55+
$this->data['product_discount_id'] = $this->model_catalog_product->addProductDiscount(
5556
$this->request->get['product_id'],
5657
$this->request->post
5758
);
@@ -63,13 +64,14 @@ public function main()
6364
$this->request->post
6465
);
6566
} else { //insert
66-
$this->model_catalog_product->addProductSpecial(
67+
$this->data['product_special_id'] = $this->model_catalog_product->addProductSpecial(
6768
$this->request->get['product_id'],
6869
$this->request->post
6970
);
7071
}
7172
}
7273
$this->session->data['success'] = $this->language->get('text_success');
74+
$this->extensions->hk_ProcessData($this, __FUNCTION__);
7375
redirect(
7476
$this->html->getSecureURL(
7577
'catalog/product_promotions',

public_html/admin/controller/pages/extension/extensions.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,13 @@ public function edit()
792792
$this->data['extension_info']['note'] = $ext->getConfig('note')
793793
? $this->html->convertLinks($this->language->get($extension.'_note'))
794794
: '';
795+
$noteWrp = $ext->getConfig('note_wrapper');
796+
if($noteWrp) {
797+
$view = new AView(Registry::getInstance(),0);
798+
$view->assign('note_text', $this->data['extension_info']['note']);
799+
$this->data['extension_info']['note_wrapper'] = $view->fetch($noteWrp);
800+
}
801+
795802
$config = $ext->getConfig();
796803
if (!empty($config->preview->item)) {
797804
foreach ($config->preview->item as $item) {

public_html/admin/controller/pages/extension/extensions_store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function main()
120120
$this->data['amp_product_url'] = $this->model_tool_mp_api->getMPURL().$mp_params.$token_param;
121121

122122
$return_url = base64_encode($this->html->getSecureURL('tool/extensions_store/install'));
123-
$mp_params = '?rt=r/checkout/purchase&return_url='.$return_url;
123+
$mp_params = '?rt=r/product/product&return_url='.$return_url;
124124
$mp_params .= '&store_id='.UNIQUE_ID;
125125
$mp_params .= '&store_url='.HTTPS_SERVER;
126126
$mp_params .= '&store_version='.VERSION;

public_html/admin/controller/pages/index/logout.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
AbanteCart, Ideal OpenSource Ecommerce Solution
66
http://www.AbanteCart.com
77
8-
Copyright © 2011-2020 Belavier Commerce LLC
8+
Copyright © 2011-2023 Belavier Commerce LLC
99
1010
This source file is subject to Open Software License (OSL 3.0)
1111
License details is bundled with this package in the file LICENSE.txt.
@@ -35,7 +35,8 @@ public function main()
3535

3636
//update controller data
3737
$this->extensions->hk_UpdateData($this, __FUNCTION__);
38-
39-
$this->redirect($this->html->getSecureURL('index/login'));
38+
unset($_COOKIE[SESSION_ID]);
39+
setcookie(SESSION_ID, '', 1);
40+
redirect($this->html->getSecureURL('index/login'));
4041
}
4142
}

public_html/admin/controller/pages/sale/order.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ public function details(...$args)
463463
$this->data['comment'] = nl2br($order_info['comment']);
464464
$this->data['firstname'] = $order_info['firstname'];
465465
$this->data['lastname'] = $order_info['lastname'];
466-
$this->data['lastname'] = $order_info['lastname'];
467466
$this->data['total'] = $this->currency->format(
468467
$order_info['total'],
469468
$order_info['currency'],

0 commit comments

Comments
 (0)