Skip to content

Commit

Permalink
Merge branch '1.2.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
abantecart committed Mar 18, 2019
2 parents 8468577 + e16eb97 commit f0ffbf2
Show file tree
Hide file tree
Showing 833 changed files with 75,118 additions and 5,722 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,7 @@ php:
# aliased to a recent 5.6.x version
#- 5.6
# aliased to a recent 7.x version
- 7.0
- 7.1
# aliased to a recent hhvm version
#- hhvm

Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/controller/pages/catalog/category.php
Expand Up @@ -165,7 +165,7 @@ public function main()
$grid_settings['multiaction_class'] = 'hidden';
}

$results = $this->model_catalog_category->getCategories(0);
$results = $this->model_catalog_category->getCategories(0, $this->config->get('config_store_id'));
$parents = array(
'null' => $this->language->get('text_select_all'),
0 => $this->language->get('text_top_level'),
Expand Down
10 changes: 9 additions & 1 deletion public_html/admin/controller/pages/catalog/product.php
Expand Up @@ -382,6 +382,7 @@ private function _getForm($args = array())
$product_info = $this->model_catalog_product->getProduct($product_id);
$product_info['featured'] = $product_info['featured'] ? 1 : 0;
$product_info['has_track_options'] = $this->model_catalog_product->hasTrackOptions($product_id);
$product_info['stock_locations'] = $this->model_catalog_product->getProductStockLocations($product_id);
if ($product_info['has_track_options']) {
$product_info['quantity'] = $this->model_catalog_product->hasAnyStock($product_id);
}
Expand Down Expand Up @@ -778,6 +779,7 @@ private function _getForm($args = array())
),
'help_url' => $this->gen_help_url('product_inventory'),
'style' => 'medium-field',
'attr' => 'reload_on_save="true" ',
'disabled' => ($product_info['has_track_options'] ? true : false),
));

Expand All @@ -787,9 +789,15 @@ private function _getForm($args = array())
'value' => (int)$this->data['quantity'],
'style' => 'col-xs-1 small-field',
'help_url' => $this->gen_help_url('product_inventory'),
'attr' => ($product_info['has_track_options'] ? 'disabled' : ''),
'attr' => ($product_info['has_track_options'] || $product_info['stock_locations'] ? 'disabled' : ''),
));

if($this->data['subtract'] && !$product_info['has_track_options']) {
$dd = new ADispatcher('responses/product/product/stockLocations', array($product_info['product_id']));
$this->data['form']['fields']['data']['stock_locations'] =
$dd->dispatchGetOutput('responses/product/product/stockLocations');
}

$this->data['form']['fields']['data']['minimum'] = $form->getFieldHtml(array(
'type' => 'input',
'name' => 'minimum',
Expand Down
19 changes: 10 additions & 9 deletions public_html/admin/controller/pages/design/blocks.php
Expand Up @@ -232,7 +232,7 @@ public function insert()
$content = $this->request->post['block_content'];
break;
default:
$this->redirect($this->html->getSecureURL('design/blocks'));
redirect($this->html->getSecureURL('design/blocks'));
break;
}

Expand Down Expand Up @@ -261,7 +261,7 @@ public function insert()
if (strpos($this->request->post['listing_datasource'], 'custom_') !== false) {
$listing_manager = new AListingManager($custom_block_id);
if ($this->request->post['selected']) {
$listing_manager->deleteCustomListing();
$listing_manager->deleteCustomListing($this->config->get('config_store_id'));
$k = 0;
foreach ($this->request->post['selected'] as $id) {
$listing_manager->saveCustomListItem(
Expand All @@ -270,6 +270,7 @@ public function insert()
'id' => $id,
'limit' => $this->request->post['limit'],
'sort_order' => (int)$k,
'store_id' => $this->config->get('config_store_id')
));
$k++;
}
Expand All @@ -278,7 +279,7 @@ public function insert()

$this->session->data ['success'] = $this->language->get('text_success');
unset($this->session->data['custom_list_changes'][$custom_block_id], $this->session->data['layout_params']);
$this->redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id));
redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id));
}

// if we need to save new block in layout - keep parameters in session
Expand Down Expand Up @@ -347,12 +348,12 @@ public function edit()
// if datasource changed - drop custom list

if ($block_info['content']['listing_datasource'] != $content['listing_datasource']) {
$listing_manager->deleteCustomListing();
//$listing_manager->deleteCustomListing();
}
if (strpos($content['listing_datasource'], 'custom_') !== false) {

if ($this->request->post['selected']) {
$listing_manager->deleteCustomListing();
$listing_manager->deleteCustomListing($this->config->get('config_store_id'));
$k = 0;
foreach ($this->request->post['selected'] as $id) {
$listing_manager->saveCustomListItem(
Expand All @@ -361,6 +362,7 @@ public function edit()
'id' => $id,
'limit' => $this->request->post['limit'],
'sort_order' => $k,
'store_id' => $this->config->get('config_store_id')
));
$k++;
}
Expand All @@ -377,7 +379,7 @@ public function edit()
$content = $this->request->post['block_content'];
break;
default:
$this->redirect($this->html->getSecureURL('design/blocks'));
redirect($this->html->getSecureURL('design/blocks'));
break;
}

Expand All @@ -394,7 +396,7 @@ public function edit()
));
$layout->editBlockStatus((int)$this->request->post['block_status'], 0, $custom_block_id);
$this->session->data ['success'] = $this->language->get('text_success');
$this->redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id));
redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id));
}
// end of saving

Expand Down Expand Up @@ -442,7 +444,6 @@ public function edit()

private function _init_tabs()
{

$blocks = array();
$lm = new ALayoutManager();
$default_block_type = '';
Expand Down Expand Up @@ -493,7 +494,7 @@ public function delete()
}
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
$this->redirect($this->html->getSecureURL('design/blocks'));
redirect($this->html->getSecureURL('design/blocks'));
}

private function _getHTMLForm()
Expand Down
15 changes: 14 additions & 1 deletion public_html/admin/controller/pages/report/customer/online.php
Expand Up @@ -88,7 +88,7 @@ public function main()
$grid = $this->dispatch('common/listing_grid', array($grid_settings));
$this->view->assign('listing_grid', $grid->dispatchGetOutput());

$this->view->assign('reset', $this->html->getSecureURL('report/customer/online'));
$this->view->assign('reset', $this->html->getSecureURL('report/customer/online/reset'));

$this->document->setTitle($this->language->get('heading_title'));
$this->document->initBreadcrumb(array(
Expand All @@ -108,5 +108,18 @@ public function main()
//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
}


public function reset()
{
//init controller data
$this->extensions->hk_InitData($this, __FUNCTION__);
$this->loadModel('report/customer');
$this->model_report_customer->clearOnlineCustomers();

//update controller data
$this->extensions->hk_UpdateData($this, __FUNCTION__);
redirect($this->html->getSecureURL('report/customer/online'));
}
}

40 changes: 30 additions & 10 deletions public_html/admin/controller/pages/sale/order.php
Expand Up @@ -17,9 +17,6 @@
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 ControllerPagesSaleOrder extends AController
{
Expand Down Expand Up @@ -264,8 +261,10 @@ public function update()
//recalc totals and update
$this->session->data['success'] = $this->language->get('text_success');
$this->session->data['attention'] = $this->language->get('attention_check_total');
redirect($this->html->getSecureURL('sale/order/recalc',
'&order_id='.$this->request->get['order_id']));
redirect($this->html->getSecureURL(
'sale/order/recalc',
'&order_id='.$this->request->get['order_id'])
);
}

redirect($this->html->getSecureURL('sale/order'));
Expand Down Expand Up @@ -301,8 +300,10 @@ public function details()
$this->loadModel('catalog/download');
foreach ($data as $order_download_id => $item) {
if ($item['expire_date']) {
$item['expire_date'] = dateDisplay2ISO($item['expire_date'],
$this->language->get('date_format_short'));
$item['expire_date'] = dateDisplay2ISO(
$item['expire_date'],
$this->language->get('date_format_short')
);
} else {
$item['expire_date'] = '';
}
Expand All @@ -324,9 +325,11 @@ public function details()
}

$enc = new AEncryption($this->config->get('encryption_key'));
redirect($this->html->getSecureURL('sale/order/recalc',
'&order_id='.$order_id.'&skip_recalc='.$enc->encrypt(serialize($skip_recalc))
)
redirect(
$this->html->getSecureURL(
'sale/order/recalc',
'&order_id='.$order_id.'&skip_recalc='.$enc->encrypt(serialize($skip_recalc))
)
);
}
}
Expand Down Expand Up @@ -523,6 +526,19 @@ public function details()
);
}

//append stock locations from order
$stock_located = $this->model_catalog_product->getOrderProductStockLocations($order_product['order_product_id']);
if($stock_located) {
$value = '';
foreach ($stock_located as $row) {
$value .= $row['location_name'].': '.$row['quantity']."\n";
}
$option_data[] = array(
'name' => $this->language->get('entry_stock_locations'),
'value' => nl2br($value)
);
}

//check if this product product is still available, so we can use recalculation against the cart
$product = $this->model_catalog_product->getProduct($order_product['product_id']);
if (empty($product) || !$product['status'] || $product['call_to_order']) {
Expand Down Expand Up @@ -1292,6 +1308,10 @@ public function payment_details()

//NOTE: This is an empty controller to be hooked from extensions

if( $this->session->data['error'] ){
$this->data['error_warning'] = $this->session->data['error'];
unset($this->session->data['error']);
}
$this->view->batchAssign($this->data);

$this->addChild('pages/sale/order_summary', 'summary_form', 'pages/sale/order_summary.tpl');
Expand Down
5 changes: 1 addition & 4 deletions public_html/admin/controller/pages/total/handling.php
Expand Up @@ -17,9 +17,6 @@
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 ControllerPagesTotalHandling extends AController
{
Expand Down Expand Up @@ -189,7 +186,7 @@ public function main()
$options[$row['key']] = $row['name'];
}
}
if (!sizeof($this->data['handling_per_payment']['handling_payment'])) {
if (!$this->data['handling_per_payment']['handling_payment']) {
$this->data['handling_per_payment'] = array(
'handling_payment' => array(0 => ''),
'handling_payment_subtotal' => array(0 => ''),
Expand Down
Expand Up @@ -150,10 +150,16 @@ public function update_field()
if (isset($this->request->post['selected']) && is_array($this->request->post['selected'])) {
//updating custom list of selected items
$listing_manager = new AListingManager($custom_block_id);
$listing_manager->deleteCustomListing();
$listing_manager->deleteCustomListing($this->config->get('config_store_id'));
$k = 0;
foreach ($this->request->post['selected'] as $id) {
$listing_manager->saveCustomListItem(array('id' => $id, 'sort_order' => (int)$k));
$listing_manager->saveCustomListItem(
array(
'id' => $id,
'sort_order' => (int)$k,
'store_id' => $this->config->get('config_store_id')
)
);
$k++;
}
}
Expand Down Expand Up @@ -332,7 +338,7 @@ public function getCustomListingSubForm()

if ($content['listing_datasource'] == $listing_datasource) {
$lm = new AListingManager($custom_block_id);
$list = $lm->getCustomList();
$list = $lm->getCustomList($this->config->get('config_store_id'));

if ($list) {
foreach ($list as $row) {
Expand Down
Expand Up @@ -47,6 +47,9 @@ public function main()
);
$filter_grid = new AFilter($filter_data);
$filter_array = $filter_grid->getFilterData();

$filter_array['store_id'] = $this->config->get('config_store_id');

if ($this->request->post['nodeid']) {
list(, $parent_id) = explode('_', $this->request->post['nodeid']);
$filter_array['parent_id'] = $parent_id;
Expand Down
Expand Up @@ -37,6 +37,7 @@ public function online()
$this->extensions->hk_InitData($this, __FUNCTION__);

$this->loadModel('report/customer');
$this->loadLanguage('report/customer/online');
$this->load->library('json');

//Prepare filter config
Expand Down Expand Up @@ -65,6 +66,11 @@ public function online()
$results = $this->model_report_customer->getOnlineCustomers($filter_params);
$i = 0;
foreach ($results as $result) {
$url = $result['url'];
if( $result['referer'] && $result['url'] != $result['referer'] ){
$url .= '<br>'.$this->language->get('text_referer').'<br>'.$result['referer'];
}

$response->rows[$i]['id'] = $result['customer_id'];
//mark inactive customers.
if ($result['status'] != 1) {
Expand All @@ -75,7 +81,7 @@ public function online()
$result['ip'],
dateISO2Display($result['date_added'],
$this->language->get('date_format_short').' '.$this->language->get('time_format')),
$result['url'],
$url,
);
$i++;
}
Expand Down

0 comments on commit f0ffbf2

Please sign in to comment.