Skip to content

Commit

Permalink
Merge pull request #1604 from abantecart/1.3.4
Browse files Browse the repository at this point in the history
1.3.4
  • Loading branch information
abantecart committed Jul 21, 2023
2 parents 3277cb8 + f8920ac commit 301333b
Show file tree
Hide file tree
Showing 948 changed files with 120,842 additions and 121,306 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \
docker-php-ext-install -j$(nproc) iconv mbstring mysqli pdo_mysql zip soap && \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
docker-php-ext-install -j$(nproc) gd && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

ADD default /etc/nginx/sites-available/

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

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
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

RUN apt-get clean

Expand Down
93 changes: 50 additions & 43 deletions public_html/admin/controller/pages/catalog/attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
versions in the future. If you wish to customize AbanteCart for your
needs please refer to http://www.AbanteCart.com for more information.
------------------------------------------------------------------------------*/
if (!defined('DIR_CORE') || !IS_ADMIN) {
header('Location: static_pages/');
}

class ControllerPagesCatalogAttribute extends AController
{
public $error = [];
/**
* @var AAttribute_Manager
*/
/** @var AAttribute_Manager */
private $attribute_manager;

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

public function main()
{

//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);

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

$this->document->initBreadcrumb([
'href' => $this->html->getSecureURL('index/home'),
'text' => $this->language->get('text_home'),
'separator' => false,
]);
$this->document->addBreadcrumb([
'href' => $this->html->getSecureURL('catalog/attribute'),
'text' => $this->language->get('heading_title'),
'separator' => ' :: ',
'current' => true,
]);
$this->document->initBreadcrumb(
[
'href' => $this->html->getSecureURL('index/home'),
'text' => $this->language->get('text_home'),
'separator' => false,
]
);
$this->document->addBreadcrumb(
[
'href' => $this->html->getSecureURL('catalog/attribute'),
'text' => $this->language->get('heading_title'),
'separator' => ' :: ',
'current' => true,
]
);

$grid_settings = [
'table_id' => 'attribute_grid',
Expand Down Expand Up @@ -127,7 +125,6 @@ public function main()

$grid = $this->dispatch('common/listing_grid', [$grid_settings]);
$this->view->assign('listing_grid', $grid->dispatchGetOutput());

$this->view->assign('insert', $this->html->getSecureURL('catalog/attribute/insert'));

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

public function insert()
{

//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);

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

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

if ($this->request->is_POST() && $this->validateAttributeForm()) {
$this->data['inserted'] =
$this->attribute_manager->updateAttribute($this->request->get['attribute_id'], $this->request->post);
$this->data['inserted'] = $this->attribute_manager->updateAttribute(
$this->request->get['attribute_id'],
$this->request->post
);
$this->extensions->hk_ProcessData($this, __FUNCTION__);
$this->session->data['success'] = $this->language->get('text_success');
redirect($this->html->getSecureURL('catalog/attribute/update',
'&attribute_id='.$this->request->get['attribute_id']));
redirect($this->html->getSecureURL(
'catalog/attribute/update',
'&attribute_id=' . $this->request->get['attribute_id'])
);
}

$this->_getForm();
Expand All @@ -191,10 +191,10 @@ public function update()
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}

private function _getForm()
protected function _getForm()
{

$this->data = [];
$this->data = $attribute_type_info = [];
$this->data['error'] = $this->error;
$this->data['cancel'] = $this->html->getSecureURL('catalog/attribute');
$this->data['get_attribute_type'] = $this->html->getSecureURL('r/catalog/attribute/get_attribute_type');
Expand All @@ -218,7 +218,9 @@ private function _getForm()
$this->language->getContentLanguageID()
);

$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById((int)$attribute_info['attribute_type_id']);
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById(
(int)$attribute_info['attribute_type_id']
);

//load values for attributes with options

Expand All @@ -241,7 +243,9 @@ private function _getForm()
}

if (has_value($this->request->get['attribute_type_id'])) {
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById((int)$this->request->get['attribute_type_id']);
$attribute_type_info = $this->attribute_manager->getAttributeTypeInfoById(
(int)$this->request->get['attribute_type_id']
);
}

$fields = [
Expand Down Expand Up @@ -301,14 +305,14 @@ private function _getForm()
}*/

if (!$attribute_id) {
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/insert', '&attribute_type_id='.$attribute_type_id);
$this->data['heading_title'] = $this->language->get('text_insert').$this->language->get('text_attribute');
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/insert', '&attribute_type_id=' . $attribute_type_id);
$this->data['heading_title'] = $this->language->get('text_insert') . $this->language->get('text_attribute');
$this->data['update'] = '';
$form = new AForm('ST');
} else {
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/update', '&attribute_id='.$attribute_id.'&attribute_type_id='.$attribute_type_id);
$this->data['heading_title'] = $this->language->get('text_edit').$this->language->get('text_attribute');
$this->data['update'] = $this->html->getSecureURL('listing_grid/attribute/update_field', '&id='.$attribute_id);
$this->data['action'] = $this->html->getSecureURL('catalog/attribute/update', '&attribute_id=' . $attribute_id . '&attribute_type_id=' . $attribute_type_id);
$this->data['heading_title'] = $this->language->get('text_edit') . $this->language->get('text_attribute');
$this->data['update'] = $this->html->getSecureURL('listing_grid/attribute/update_field', '&id=' . $attribute_id);
$form = new AForm('HT');
$this->data['attribute_id'] = $attribute_id;
}
Expand Down Expand Up @@ -441,15 +445,17 @@ public function validateAttributeForm()
$this->request->post['placeholder'] = trim($this->request->post['placeholder']);
}

$this->error = array_merge($this->error, $this->attribute_manager->validateAttributeCommonData($this->request->post));
$this->error = array_merge(
$this->error,
$this->attribute_manager->validateAttributeCommonData($this->request->post)
);

//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);

return (!$this->error);
}

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

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

$this->data['tabs'][$type_id] = [
'text' => $type['type_name'],
'href' => $method == 'insert' ? $this->html->getSecureURL('catalog/attribute/'.$method, '&attribute_type_id='.$type_id) : '',
'href' => $method == 'insert'
? $this->html->getSecureURL('catalog/attribute/' . $method, '&attribute_type_id=' . $type_id)
: '',
];
}

if (in_array($active, array_keys($this->data['tabs']))) {
$this->data['tabs'][$active]['active'] = 1;
} else {
$this->data['tabs'][key($this->data['tabs'])]['active'] = 1;
}
$active = in_array($active, array_keys($this->data['tabs']))
? $active
: key($this->data['tabs']);
$this->data['tabs'][$active]['active'] = 1;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class ControllerPagesCatalogProductPromotions extends AController
{
public $error = [];
public $data = [];

public function main()
{
Expand All @@ -51,7 +52,7 @@ public function main()
$this->request->post
);
} else { //insert
$this->model_catalog_product->addProductDiscount(
$this->data['product_discount_id'] = $this->model_catalog_product->addProductDiscount(
$this->request->get['product_id'],
$this->request->post
);
Expand All @@ -63,13 +64,14 @@ public function main()
$this->request->post
);
} else { //insert
$this->model_catalog_product->addProductSpecial(
$this->data['product_special_id'] = $this->model_catalog_product->addProductSpecial(
$this->request->get['product_id'],
$this->request->post
);
}
}
$this->session->data['success'] = $this->language->get('text_success');
$this->extensions->hk_ProcessData($this, __FUNCTION__);
redirect(
$this->html->getSecureURL(
'catalog/product_promotions',
Expand Down
7 changes: 7 additions & 0 deletions public_html/admin/controller/pages/extension/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,13 @@ public function edit()
$this->data['extension_info']['note'] = $ext->getConfig('note')
? $this->html->convertLinks($this->language->get($extension.'_note'))
: '';
$noteWrp = $ext->getConfig('note_wrapper');
if($noteWrp) {
$view = new AView(Registry::getInstance(),0);
$view->assign('note_text', $this->data['extension_info']['note']);
$this->data['extension_info']['note_wrapper'] = $view->fetch($noteWrp);
}

$config = $ext->getConfig();
if (!empty($config->preview->item)) {
foreach ($config->preview->item as $item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function main()
$this->data['amp_product_url'] = $this->model_tool_mp_api->getMPURL().$mp_params.$token_param;

$return_url = base64_encode($this->html->getSecureURL('tool/extensions_store/install'));
$mp_params = '?rt=r/checkout/purchase&return_url='.$return_url;
$mp_params = '?rt=r/product/product&return_url='.$return_url;
$mp_params .= '&store_id='.UNIQUE_ID;
$mp_params .= '&store_url='.HTTPS_SERVER;
$mp_params .= '&store_version='.VERSION;
Expand Down
7 changes: 4 additions & 3 deletions public_html/admin/controller/pages/index/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
AbanteCart, Ideal OpenSource Ecommerce Solution
http://www.AbanteCart.com
Copyright © 2011-2020 Belavier Commerce LLC
Copyright © 2011-2023 Belavier Commerce LLC
This source file is subject to Open Software License (OSL 3.0)
License details is bundled with this package in the file LICENSE.txt.
Expand Down Expand Up @@ -35,7 +35,8 @@ public function main()

//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);

$this->redirect($this->html->getSecureURL('index/login'));
unset($_COOKIE[SESSION_ID]);
setcookie(SESSION_ID, '', 1);
redirect($this->html->getSecureURL('index/login'));
}
}
1 change: 0 additions & 1 deletion public_html/admin/controller/pages/sale/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ public function details(...$args)
$this->data['comment'] = nl2br($order_info['comment']);
$this->data['firstname'] = $order_info['firstname'];
$this->data['lastname'] = $order_info['lastname'];
$this->data['lastname'] = $order_info['lastname'];
$this->data['total'] = $this->currency->format(
$order_info['total'],
$order_info['currency'],
Expand Down

0 comments on commit 301333b

Please sign in to comment.