diff --git a/.travis.yml b/.travis.yml index d028710431..702a08173b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/public_html/admin/controller/pages/catalog/category.php b/public_html/admin/controller/pages/catalog/category.php index 5d3424e20d..741202cab6 100755 --- a/public_html/admin/controller/pages/catalog/category.php +++ b/public_html/admin/controller/pages/catalog/category.php @@ -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'), diff --git a/public_html/admin/controller/pages/catalog/product.php b/public_html/admin/controller/pages/catalog/product.php index 1a7631d9d1..b296b55eee 100755 --- a/public_html/admin/controller/pages/catalog/product.php +++ b/public_html/admin/controller/pages/catalog/product.php @@ -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); } @@ -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), )); @@ -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', diff --git a/public_html/admin/controller/pages/design/blocks.php b/public_html/admin/controller/pages/design/blocks.php index 8d40074075..727a5f9ddc 100644 --- a/public_html/admin/controller/pages/design/blocks.php +++ b/public_html/admin/controller/pages/design/blocks.php @@ -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; } @@ -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( @@ -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++; } @@ -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 @@ -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( @@ -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++; } @@ -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; } @@ -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 @@ -442,7 +444,6 @@ public function edit() private function _init_tabs() { - $blocks = array(); $lm = new ALayoutManager(); $default_block_type = ''; @@ -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() diff --git a/public_html/admin/controller/pages/report/customer/online.php b/public_html/admin/controller/pages/report/customer/online.php index f299113e35..cedc0bbe31 100644 --- a/public_html/admin/controller/pages/report/customer/online.php +++ b/public_html/admin/controller/pages/report/customer/online.php @@ -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( @@ -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')); + } } diff --git a/public_html/admin/controller/pages/sale/order.php b/public_html/admin/controller/pages/sale/order.php index 5199865cd5..d3b6506db4 100755 --- a/public_html/admin/controller/pages/sale/order.php +++ b/public_html/admin/controller/pages/sale/order.php @@ -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 { @@ -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')); @@ -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'] = ''; } @@ -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)) + ) ); } } @@ -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']) { @@ -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'); diff --git a/public_html/admin/controller/pages/total/handling.php b/public_html/admin/controller/pages/total/handling.php index ce42cf17dc..f151381335 100755 --- a/public_html/admin/controller/pages/total/handling.php +++ b/public_html/admin/controller/pages/total/handling.php @@ -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 { @@ -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 => ''), diff --git a/public_html/admin/controller/responses/listing_grid/blocks_grid.php b/public_html/admin/controller/responses/listing_grid/blocks_grid.php index 9f95b327c3..df018aa3c3 100755 --- a/public_html/admin/controller/responses/listing_grid/blocks_grid.php +++ b/public_html/admin/controller/responses/listing_grid/blocks_grid.php @@ -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++; } } @@ -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) { diff --git a/public_html/admin/controller/responses/listing_grid/content.php b/public_html/admin/controller/responses/listing_grid/content.php index dae4c62b19..914db34a1b 100755 --- a/public_html/admin/controller/responses/listing_grid/content.php +++ b/public_html/admin/controller/responses/listing_grid/content.php @@ -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; diff --git a/public_html/admin/controller/responses/listing_grid/report_customer.php b/public_html/admin/controller/responses/listing_grid/report_customer.php index 1159742277..a1d2bbb0e3 100755 --- a/public_html/admin/controller/responses/listing_grid/report_customer.php +++ b/public_html/admin/controller/responses/listing_grid/report_customer.php @@ -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 @@ -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 .= '
'.$this->language->get('text_referer').'
'.$result['referer']; + } + $response->rows[$i]['id'] = $result['customer_id']; //mark inactive customers. if ($result['status'] != 1) { @@ -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++; } diff --git a/public_html/admin/controller/responses/product/product.php b/public_html/admin/controller/responses/product/product.php index cfa836be41..46475bdb8c 100755 --- a/public_html/admin/controller/responses/product/product.php +++ b/public_html/admin/controller/responses/product/product.php @@ -17,11 +17,8 @@ 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/'); -} -/** @noinspection PhpUndefinedClassInspection */ + class ControllerResponsesProductProduct extends AController { public $error = array(); @@ -467,7 +464,8 @@ public function load_option() $this->data['remove_option'] = $this->html->getSecureURL( 'product/product/del_option', - '&product_id='.$product_id.'&option_id='.$option_id); + '&product_id='.$product_id.'&option_id='.$option_id + ); $this->data['button_remove_option'] = $this->html->buildElement(array( 'type' => 'button', @@ -486,7 +484,10 @@ public function load_option() 'style' => 'button2', )); - $this->data['update_option_values'] = $this->html->getSecureURL('product/product/update_option_values', '&product_id='.$product_id.'&option_id='.$option_id); + $this->data['update_option_values'] = $this->html->getSecureURL( + 'product/product/update_option_values', + '&product_id='.$product_id.'&option_id='.$option_id + ); // form of option values list $form = new AForm('HT'); @@ -585,13 +586,21 @@ public function update_option_values() //remove html-code from textarea product option if (in_array($option_info['element_type'], array('T', 'B'))) { - foreach ($this->request->post['name'] as &$v) { + foreach ((array)$this->request->post['name'] as &$v) { $v = strip_tags(html_entity_decode($v, ENT_QUOTES, 'UTF-8')); $v = str_replace('\r\n', "\n", $v); } } $this->model_catalog_product->updateProductOptionValues($this->request->get['product_id'], $this->request->get['option_id'], $this->request->post); + + foreach((array)$this->request->post['stock_location'] as $product_option_value_id => $stock_locations) { + $this->model_catalog_product->updateProductStockLocations( + $stock_locations, + $this->request->get['product_id'], + $product_option_value_id); + } + $this->session->data['success'] = $this->language->get('text_success_option'); //update controller data @@ -605,8 +614,9 @@ public function update_option_values() * * @return string */ - private function _option_value_form($form) + protected function _option_value_form($form) { + $this->data['form'] = array(); $this->data['option_attribute'] = $this->attribute_manager->getAttributeByProductOptionId($this->request->get['option_id']); $this->data['option_attribute']['values'] = array(); @@ -631,7 +641,10 @@ private function _option_value_form($form) $values = $this->attribute_manager->getAttributeValues($attribute['attribute_id'], $this->language->getContentLanguageID()); foreach ($values as $v) { - $this->data['option_attribute']['group'][$option_id]['values'][$v['attribute_value_id']] = addslashes(html_entity_decode($v['value'], ENT_COMPAT, 'UTF-8')); + $this->data['option_attribute']['group'][$option_id]['values'][$v['attribute_value_id']] = addslashes( + html_entity_decode($v['value'], + ENT_COMPAT, + 'UTF-8')); } } } @@ -644,6 +657,7 @@ private function _option_value_form($form) $this->data['option_attribute']['attribute_id'], $this->language->getContentLanguageID() ); + } else { $values = $this->getProductOptionValues( $this->data['option_attribute']['attribute_id'], @@ -658,17 +672,36 @@ private function _option_value_form($form) } - $this->data['cancel'] = $this->html->getSecureURL('product/product/load_option', '&product_id='.$this->request->get['product_id'].'&option_id='.$this->request->get['option_id']); + $this->data['cancel'] = $this->html->getSecureURL( + 'product/product/load_option', + '&product_id='.$this->request->get['product_id'].'&option_id='.$this->request->get['option_id'] + ); if (isset($this->request->get['product_option_value_id'])) { $this->data['row_id'] = 'row'.$product_option_value_id; $this->data['attr_val_id'] = $product_option_value_id; - $item_info = $this->model_catalog_product->getProductOptionValue($this->request->get['product_id'], $product_option_value_id); + $item_info = $this->model_catalog_product->getProductOptionValue( + $this->request->get['product_id'], + $product_option_value_id + ); } else { $this->data['row_id'] = 'new_row'; } - $fields = array('default', 'name', 'sku', 'quantity', 'subtract', 'price', 'prefix', 'sort_order', 'weight', 'weight_type', 'attribute_value_id', 'children_options'); + $fields = array( + 'default', + 'name', + 'sku', + 'quantity', + 'subtract', + 'price', + 'prefix', + 'sort_order', + 'weight', + 'weight_type', + 'attribute_value_id', + 'children_options' + ); foreach ($fields as $f) { if (isset($this->request->post[$f])) { $this->data[$f] = $this->request->post[$f]; @@ -696,7 +729,6 @@ private function _option_value_form($form) 'options' => $data['values'], 'attr' => '', )).'
'; - } } else { if (in_array($this->data['option_attribute']['element_type'], $this->data['elements_with_options'])) { @@ -708,7 +740,7 @@ private function _option_value_form($form) )); } else { if ($this->data['option_attribute']['element_type'] == 'U') { - //for file there is no option value + //for file there is no option value $this->data['form']['fields']['option_value'] = ''; } else { @@ -750,11 +782,19 @@ private function _option_value_form($form) 'name' => 'sku['.$product_option_value_id.']', 'value' => $this->data['sku'], )); + $stock_locations = null; + if($this->data['subtract']){ + $stock_locations = $this->model_catalog_product->getProductStockLocations( + (int)$this->request->get['product_id'], + $product_option_value_id + ); + } $this->data['form']['fields']['quantity'] = $form->getFieldHtml(array( 'type' => 'input', 'name' => 'quantity['.$product_option_value_id.']', 'value' => $this->data['quantity'], 'style' => 'small-field', + 'attr' => ($stock_locations && $this->data['subtract'] ? 'disabled':'') )); $this->data['form']['fields']['subtract'] = $form->getFieldHtml(array( 'type' => 'selectbox', @@ -833,8 +873,18 @@ private function _option_value_form($form) 'options' => $wht_options, )); - $resources_html = $this->dispatch('responses/common/resource_library/get_resources_html'); - $this->data['resources_html'] = $resources_html->dispatchGetOutput(); + //do not show RL and stock locations for new row + if($product_option_value_id) { + $dd = new ADispatcher( + 'responses/product/product/stockLocations', + array((int)$this->request->get['product_id'], $product_option_value_id) + ); + $this->data['form']['fields']['stock_locations'] = + $dd->dispatchGetOutput('responses/product/product/stockLocations'); + + $resources_html = $this->dispatch('responses/common/resource_library/get_resources_html'); + $this->data['resources_html'] = $resources_html->dispatchGetOutput(); + } $this->view->batchAssign($this->data); return $this->view->fetch('responses/product/option_value_row.tpl'); @@ -851,13 +901,16 @@ public function getProductOptionValues($attribute_id, $language_id = 0) if (!$language_id) { $language_id = $this->language->getContentLanguageID(); } - $query = $this->db->query("SELECT pov.*, povd.name as value - FROM `".$this->db->table('product_options')."` po - LEFT JOIN `".$this->db->table('product_option_values')."` pov ON po.product_option_id = pov.product_option_id - LEFT JOIN `".$this->db->table('product_option_value_descriptions')."` povd - ON ( pov.product_option_value_id = povd.product_option_value_id AND povd.language_id = '".(int)$language_id."' ) - WHERE po.attribute_id = '".$this->db->escape($attribute_id)."' - ORDER BY pov.sort_order"); + $query = $this->db->query( + "SELECT ga.*, gad.value, pov.product_option_value_id + FROM ".$this->db->table("global_attributes_values")." ga + LEFT JOIN ".$this->db->table("global_attributes_value_descriptions")." gad + ON ( ga.attribute_value_id = gad.attribute_value_id AND gad.language_id = '".(int)$language_id."' ) + LEFT JOIN `".$this->db->table('product_option_values')."` pov + ON pov.attribute_value_id = ga.attribute_value_id + WHERE ga.attribute_id = '".$this->db->escape($attribute_id)."' + ORDER BY sort_order" + ); return $query->rows; } @@ -1659,4 +1712,94 @@ public function orderProductForm() $this->processTemplate('responses/product/product_form.tpl'); } + + public function stockLocations($product_id = 0, $product_option_value_id = null) + { + + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $product_id = $product_id ? (int)$product_id : $this->request->get['product_id']; + $product_option_value_id = $product_option_value_id ? (int)$product_option_value_id : $this->request->get['product_option_value_id']; + $this->data['product_option_value_id'] = $product_option_value_id; + + if(!$product_option_value_id){ + $this->data['save_url'] = $this->html->getSecureURL('listing_grid/product/update_field', '&id='.$product_id); + } + + $this->loadLanguage('catalog/product'); + $this->loadModel('catalog/product'); + $locations = $this->model_catalog_product->getProductStockLocations($product_id, $product_option_value_id); + + foreach($locations as $row){ + $location_id = $row['location_id']; + $this->data['locations'][$location_id] = + array( + 'name' => $row['name'].' '.$row['description'], + 'quantity' => + $this->html->buildElement( + array( + 'type' => 'input', + 'name' => + 'stock_location'.($product_option_value_id ? "[".$product_option_value_id."]":"").'['.$location_id.'][quantity]', + + 'value'=> $row['quantity'] + ) + ), + 'sort_order' => + $this->html->buildElement( + array( + 'type' => 'input', + 'name' => 'stock_location'.($product_option_value_id ? "[".$product_option_value_id."]":"").'['.$location_id.'][sort_order]', + 'value'=> $row['sort_order'] + ) + ) + ); + } + + $this->loadModel('localisation/location'); + + $all_locations = $this->model_localisation_location->getLocations(); + $options = array($this->language->get('text_select')); + foreach($all_locations as $row) { + $options[ $row['location_id'] ] = $row['name'].' '.$row['description']; + } + + $this->data['all_locations'] = + array( + 'location_list' => $this->html->buildElement( + array( + 'type' => 'selectbox', + 'name' => 'location_list', + 'options'=> $options, + 'disabled_options' => array_keys((array)$this->data['locations']), + 'style' => 'static_field' + ) + ), + 'quantity' => $this->html->buildElement( + array( + 'type' => 'input', + 'name' => 'stock_location'.($product_option_value_id ? "[".$product_option_value_id."]":"").'[0][quantity]', + 'value'=> '', + 'style' => 'stock_location_quantity static_field hidden', + ) + ), + 'sort_order' => $this->html->buildElement( + array( + 'type' => 'input', + 'name' => 'stock_location'.($product_option_value_id ? "[".$product_option_value_id."]":"").'[0][sort_order]', + 'value'=> '', + 'style' => 'stock_location_sort_order static_field hidden', + ) + ) + ); + + + + //update controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + $this->view->batchAssign($this->data); + $this->processTemplate('responses/product/product_stock_locations.tpl'); + } + } \ No newline at end of file diff --git a/public_html/admin/language/english/catalog/product.xml b/public_html/admin/language/english/catalog/product.xml index 38e9423cee..210d7ff406 100755 --- a/public_html/admin/language/english/catalog/product.xml +++ b/public_html/admin/language/english/catalog/product.xml @@ -598,4 +598,12 @@ text_success_relation_set + + entry_stock_locations + + + + entry_locations + + \ No newline at end of file diff --git a/public_html/admin/language/english/report/customer/online.xml b/public_html/admin/language/english/report/customer/online.xml index 8a253a15c1..76513b1cdf 100644 --- a/public_html/admin/language/english/report/customer/online.xml +++ b/public_html/admin/language/english/report/customer/online.xml @@ -20,4 +20,8 @@ column_url + + text_referer + + diff --git a/public_html/admin/language/english/sale/order.xml b/public_html/admin/language/english/sale/order.xml index 0de294ca9d..5f315e90a3 100755 --- a/public_html/admin/language/english/sale/order.xml +++ b/public_html/admin/language/english/sale/order.xml @@ -372,4 +372,8 @@ entry_im + + entry_stock_locations + + \ No newline at end of file diff --git a/public_html/admin/model/catalog/category.php b/public_html/admin/model/catalog/category.php index 6283242262..b4e498ac9c 100755 --- a/public_html/admin/model/catalog/category.php +++ b/public_html/admin/model/catalog/category.php @@ -218,7 +218,7 @@ public function getCategory($category_id) * * @return array */ - public function getCategories($parent_id, $store_id = null) + public function getCategories($parent_id = null, $store_id = null) { $language_id = $this->language->getContentLanguageID(); $cache_key = 'category.'.$parent_id.'.store_'.$store_id.'_lang_'.$language_id; diff --git a/public_html/admin/model/catalog/product.php b/public_html/admin/model/catalog/product.php index a733624170..770c30ff9f 100755 --- a/public_html/admin/model/catalog/product.php +++ b/public_html/admin/model/catalog/product.php @@ -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/'); -} /** * @property ModelCatalogDownload $model_catalog_download @@ -167,12 +164,12 @@ public function addProduct($data) if ($data['product_tags']) { if (is_string($data['product_tags'])) { - $tags = (array)explode(',', $data['product_tags']); + $tags = $this->getUniqueTags($data['product_tags']); $tags = array($language_id => $tags); } elseif (is_array($data['product_tags'])) { $tags = $data['product_tags']; foreach ($tags as &$taglist) { - $taglist = (array)explode(',', $taglist); + $taglist = $this->getUniqueTags($taglist); } unset($taglist); } else { @@ -360,8 +357,7 @@ public function updateProduct($product_id, $data) } if (isset($data['product_tags'])) { - $tags = explode(',', $data['product_tags']); - + $tags = $this->getUniqueTags($data['product_tags']); foreach ($tags as &$tag) { $tag = $this->db->escape(trim($tag)); } @@ -371,6 +367,10 @@ public function updateProduct($product_id, $data) array($language_id => array('tag' => array_unique($tags)))); } + if (isset($data['stock_location'])) { + $this->updateProductStockLocations($data['stock_location'], (int)$product_id); + } + $this->_touch_product($product_id); } @@ -2415,6 +2415,7 @@ public function getProductCondition($product_id) LEFT JOIN ".$this->db->table('product_option_descriptions')." pod ON (pod.product_option_id = pov.product_option_id AND pod.language_id = ".$language_id.") WHERE p.product_id = ".$product_id; + $result = $this->db->query($sql); // id product disabled do not run other checks @@ -2427,23 +2428,28 @@ public function getProductCondition($product_id) if (dateISO2Int($result->row['date_available']) > time()) { $output[] = $this->language->get('text_product_unavailable'); } - + $hasTrackOptions = $this->hasTrackOptions($product_id); + $out_of_stock = false; //check is stock track for whole product(not options) enabled and product quantity more than 0 - if ($result->row['base_subtract'] && $result->row['base_quantity'] <= 0 && !$this->hasTrackOptions($product_id) - && !$result->row['option_name'] + if ($result->row['base_subtract'] + && $result->row['base_quantity'] <= 0 + && !$hasTrackOptions ) { $output[] = $this->language->get('text_product_out_of_stock'); + $out_of_stock = true; } - $out_of_stock = false; + $error_txt = array(); - foreach ($result->rows as $k => $row) { - if ($row['subtract'] && $row['quantity'] <= 0) { - $error_txt[] = $row['option_name'].' => '.$row['option_value_name']; - $out_of_stock = true; + if ($hasTrackOptions) { + foreach ($result->rows as $k => $row) { + if ($row['subtract'] && $row['quantity'] <= 0) { + $error_txt[] = $row['option_name'].' => '.$row['option_value_name']; + $out_of_stock = true; + } } } - if ($out_of_stock) { + if ($out_of_stock && $error_txt) { $output[] = $this->language->get('text_product_option_out_of_stock'); $output = array_merge($output, $error_txt); } @@ -2622,4 +2628,104 @@ public function hasAnyStock($product_id) return $total_quantity; } + /** + * @param int $product_id + * + * @param int $product_option_value_id + * + * @return array + */ + public function getProductStockLocations($product_id, $product_option_value_id = 0) + { + $sql = "SELECT * + FROM ".$this->db->table('product_stock_locations')." psl + LEFT JOIN ".$this->db->table('locations')." l + ON l.location_id = psl.location_id + WHERE psl.product_id=".(int)$product_id; + if ($product_option_value_id) { + $sql .= " AND psl.product_option_value_id = ".(int)$product_option_value_id; + } else { + $sql .= " AND psl.product_option_value_id IS NULL"; + } + + $sql .= " ORDER BY psl.sort_order"; + + $result = $this->db->query($sql); + return $result->rows; + } + + public function updateProductStockLocations($locations, $product_id, $product_option_value_id = 0) + { + if (!$locations) { + return false; + } + + $this->db->query( + "DELETE + FROM ".$this->db->table("product_stock_locations")." + WHERE product_id = ".(int)$product_id + .((int)$product_option_value_id + ? " AND (product_option_value_id='".(int)$product_option_value_id."' OR product_option_value_id IS NULL)" + : "") + ); + + $totals = array(); + foreach ($locations as $location_id => $location_details) { + if (!(int)$location_id) { + continue; + } + $this->db->query( + "INSERT INTO ".$this->db->table("product_stock_locations")." + (product_id, product_option_value_id, location_id, quantity, sort_order) + VALUES( + ".(int)$product_id.", + ".((int)$product_option_value_id + ? (int)$product_option_value_id + : 'NULL').", + ".(int)$location_id.", + ".(int)$location_details['quantity'].", + ".(int)$location_details['sort_order']." + );" + ); + + $totals[] = (int)$location_details['quantity']; + } + + //update_total_quantity + if (!$product_option_value_id) { + $this->db->query("UPDATE `".$this->db->table("products`")." SET quantity= '".(int)array_sum($totals)."'"); + } elseif (array_sum($totals)) { + $this->db->query( + "UPDATE `".$this->db->table("product_option_values`")." + SET quantity= '".(int)array_sum($totals)."' + WHERE product_option_value_id=".(int)$product_option_value_id + ); + } + return true; + } + + /** + * @param $order_product_id + * + * @return mixed + */ + public function getOrderProductStockLocations($order_product_id) + { + $sql = "SELECT * + FROM ".$this->db->table('order_product_stock_locations')." + WHERE order_product_id=".(int)$order_product_id; + $result = $this->db->query($sql); + return $result->rows; + } + + /** + * @param $string + * + * @return array + */ + public function getUniqueTags($string) { + $tags = array_map('trim', explode(',', $string)); + return array_intersect_key($tags, array_unique(array_map('strtolower', $tags))); + } + } \ No newline at end of file diff --git a/public_html/admin/model/report/customer.php b/public_html/admin/model/report/customer.php index 5c4eb20edd..d74643a2b0 100644 --- a/public_html/admin/model/report/customer.php +++ b/public_html/admin/model/report/customer.php @@ -433,4 +433,11 @@ public function getCustomersCountByYear() } return $customer_data; } + + public function clearOnlineCustomers() + { + + $sql = "DELETE FROM ".$this->db->table("online_customers"); + $this->db->query($sql); + } } \ No newline at end of file diff --git a/public_html/admin/model/sale/order.php b/public_html/admin/model/sale/order.php index d2a543ad8e..d7b4824ed4 100755 --- a/public_html/admin/model/sale/order.php +++ b/public_html/admin/model/sale/order.php @@ -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 ModelSaleOrder @@ -44,45 +41,45 @@ public function addOrder($data) $key_sql = ", key_id = '".(int)$data['key_id']."'"; } $this->db->query("INSERT INTO `".$this->db->table("orders")."` - SET store_name = '".$this->db->escape($data['store_name'])."', - store_url = '".$this->db->escape($data['store_url'])."', - firstname = '".$this->db->escape($data['firstname'])."', - lastname = '".$this->db->escape($data['lastname'])."', - telephone = '".$this->db->escape($data['telephone'])."', - email = '".$this->db->escape($data['email'])."', - customer_id = '".(int)$data['customer_id']."', - customer_group_id = '".(int)$data['customer_group_id']."', - shipping_firstname = '".$this->db->escape($data['shipping_firstname'])."', - shipping_lastname = '".$this->db->escape($data['shipping_lastname'])."', - shipping_company = '".$this->db->escape($data['shipping_company'])."', - shipping_address_1 = '".$this->db->escape($data['shipping_address_1'])."', - shipping_address_2 = '".$this->db->escape($data['shipping_address_2'])."', - shipping_city = '".$this->db->escape($data['shipping_city'])."', - shipping_zone = '".$this->db->escape($data['shipping_zone'])."', - shipping_zone_id = '".(int)$data['shipping_zone_id']."', - shipping_country = '".$this->db->escape($data['shipping_country'])."', - shipping_country_id = '".(int)$data['shipping_country_id']."', - payment_method = '".$this->db->escape($data['payment_method'])."', - payment_firstname = '".$this->db->escape($data['payment_firstname'])."', - payment_lastname = '".$this->db->escape($data['payment_lastname'])."', - payment_company = '".$this->db->escape($data['payment_company'])."', - payment_address_1 = '".$this->db->escape($data['payment_address_1'])."', - payment_address_2 = '".$this->db->escape($data['payment_address_2'])."', - payment_city = '".$this->db->escape($data['payment_city'])."', - payment_postcode = '".$this->db->escape($data['payment_postcode'])."', - payment_zone = '".$this->db->escape($data['payment_zone'])."', - payment_zone_id = '".(int)$data['payment_zone_id']."', - payment_country = '".$this->db->escape($data['payment_country'])."', - payment_country_id = '".(int)$data['payment_country_id']."', - value = '".(float)$data['value']."', - currency_id = '".(int)$data['currency_id']."', - currency = '".$this->db->escape($data['currency'])."', - language_id = '".(int)$data['language_id']."', - order_status_id = '".(int)$data['order_status_id']."', - ip = '".$this->db->escape('0.0.0.0')."', - total = '".$this->db->escape(preformatFloat($data['total'], $this->language->get('decimal_point')))."'".$key_sql.", - date_added = NOW(), - date_modified = NOW()" + SET store_name = '".$this->db->escape($data['store_name'])."', + store_url = '".$this->db->escape($data['store_url'])."', + firstname = '".$this->db->escape($data['firstname'])."', + lastname = '".$this->db->escape($data['lastname'])."', + telephone = '".$this->db->escape($data['telephone'])."', + email = '".$this->db->escape($data['email'])."', + customer_id = '".(int)$data['customer_id']."', + customer_group_id = '".(int)$data['customer_group_id']."', + shipping_firstname = '".$this->db->escape($data['shipping_firstname'])."', + shipping_lastname = '".$this->db->escape($data['shipping_lastname'])."', + shipping_company = '".$this->db->escape($data['shipping_company'])."', + shipping_address_1 = '".$this->db->escape($data['shipping_address_1'])."', + shipping_address_2 = '".$this->db->escape($data['shipping_address_2'])."', + shipping_city = '".$this->db->escape($data['shipping_city'])."', + shipping_zone = '".$this->db->escape($data['shipping_zone'])."', + shipping_zone_id = '".(int)$data['shipping_zone_id']."', + shipping_country = '".$this->db->escape($data['shipping_country'])."', + shipping_country_id = '".(int)$data['shipping_country_id']."', + payment_method = '".$this->db->escape($data['payment_method'])."', + payment_firstname = '".$this->db->escape($data['payment_firstname'])."', + payment_lastname = '".$this->db->escape($data['payment_lastname'])."', + payment_company = '".$this->db->escape($data['payment_company'])."', + payment_address_1 = '".$this->db->escape($data['payment_address_1'])."', + payment_address_2 = '".$this->db->escape($data['payment_address_2'])."', + payment_city = '".$this->db->escape($data['payment_city'])."', + payment_postcode = '".$this->db->escape($data['payment_postcode'])."', + payment_zone = '".$this->db->escape($data['payment_zone'])."', + payment_zone_id = '".(int)$data['payment_zone_id']."', + payment_country = '".$this->db->escape($data['payment_country'])."', + payment_country_id = '".(int)$data['payment_country_id']."', + value = '".(float)$data['value']."', + currency_id = '".(int)$data['currency_id']."', + currency = '".$this->db->escape($data['currency'])."', + language_id = '".(int)$data['language_id']."', + order_status_id = '".(int)$data['order_status_id']."', + ip = '".$this->db->escape('0.0.0.0')."', + total = '".$this->db->escape(preformatFloat($data['total'], $this->language->get('decimal_point')))."'".$key_sql.", + date_added = NOW(), + date_modified = NOW()" ); $order_id = $this->db->getLastId(); @@ -90,20 +87,22 @@ public function addOrder($data) if (isset($data['product'])) { foreach ($data['product'] as $product) { if ($product['product_id']) { - $product_query = $this->db->query("SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) - WHERE p.product_id='".(int)$product['product_id']."'"); + $product_query = $this->db->query( + "SELECT *, p.product_id + FROM ".$this->db->table("products")." p + LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) + WHERE p.product_id='".(int)$product['product_id']."'" + ); $this->db->query("INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product['product_id']."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape(preformatFloat($product['price'], $this->language->get('decimal_point')))."', - total = '".$this->db->escape(preformatFloat($product['total'], $this->language->get('decimal_point')))."', - quantity = '".$this->db->escape($product['quantity'])."'"); + SET order_id = '".(int)$order_id."', + product_id = '".(int)$product['product_id']."', + name = '".$this->db->escape($product_query->row['name'])."', + model = '".$this->db->escape($product_query->row['model'])."', + sku = '".$this->db->escape($product_query->row['sku'])."', + price = '".$this->db->escape(preformatFloat($product['price'], $this->language->get('decimal_point')))."', + total = '".$this->db->escape(preformatFloat($product['total'], $this->language->get('decimal_point')))."', + quantity = '".$this->db->escape($product['quantity'])."'"); } } } @@ -124,13 +123,13 @@ public function addOrderTotal($order_id, $data) $value = preformatFloat($data['text'], $this->language->get('decimal_point')); $this->db->query("INSERT INTO ".$this->db->table("order_totals")." - SET `order_id` = '".(int)$order_id."', - `title` = '".$this->db->escape($data['title'])."', - `text` = '".$this->db->escape($data['text'])."', - `value` = '".$this->db->escape($value)."', - `sort_order` = '".(int)$data['sort_order']."', - `type` = '".$this->db->escape($data['type'])."', - `key` = '".$this->db->escape($data['key'])."'" + SET `order_id` = '".(int)$order_id."', + `title` = '".$this->db->escape($data['title'])."', + `text` = '".$this->db->escape($data['text'])."', + `value` = '".$this->db->escape($value)."', + `sort_order` = '".(int)$data['sort_order']."', + `type` = '".$this->db->escape($data['type'])."', + `key` = '".$this->db->escape($data['key'])."'" ); return $this->db->getLastId(); @@ -149,14 +148,16 @@ public function deleteOrderTotal($order_id, $order_total_id) } $this->db->query("DELETE FROM ".$this->db->table("order_totals")." - WHERE order_id = '".(int)$order_id."' AND order_total_id = '".(int)$order_total_id."'"); + WHERE order_id = '".(int)$order_id."' AND order_total_id = '".(int)$order_total_id."'"); return true; } /** - * @param int $order_id + * @param int $order_id * @param array $data + * + * @throws AException */ public function editOrder($order_id, $data) { @@ -196,8 +197,11 @@ public function editOrder($order_id, $data) if ($this->dcrypt->active) { //encrypt order data //check key_id to use from existing record - $query_key = $this->db->query("select key_id from ".$this->db->table("orders")." - WHERE order_id = '".(int)$order_id."'"); + $query_key = $this->db->query( + "SELECT key_id + FROM ".$this->db->table("orders")." + WHERE order_id = '".(int)$order_id."'" + ); $data['key_id'] = $query_key->rows[0]['key_id']; $data = $this->dcrypt->encrypt_data($data, 'orders'); $fields[] = 'key_id'; @@ -209,9 +213,11 @@ public function editOrder($order_id, $data) } } - $this->db->query("UPDATE `".$this->db->table("orders")."` - SET ".implode(',', $update)." - WHERE order_id = '".(int)$order_id."'"); + $this->db->query( + "UPDATE `".$this->db->table("orders")."` + SET ".implode(',', $update)." + WHERE order_id = '".(int)$order_id."'" + ); $order = $this->getOrder($order_id); if (isset($data['product'])) { @@ -222,44 +228,41 @@ public function editOrder($order_id, $data) $order_product_ids[] = $item['order_product_id']; } } - $this->db->query("DELETE FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - AND order_product_id NOT IN ('".(implode("','", $order_product_ids))."')"); + //get deleted + $result = $this->db->query( + "SELECT + op.order_product_id, + op.product_id, + op.quantity, + oo.product_option_value_id, + pov.subtract as option_subtract, + pov.quantity as option_quantity, + p.quantity as base_quantity, + p.subtract as base_subtract + FROM ".$this->db->table("order_products")." op + LEFT JOIN ".$this->db->table("products")." p + ON p.product_id = op.product_id + LEFT JOIN ".$this->db->table("order_options")." oo + ON oo.order_product_id = op.order_product_id + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON pov.product_option_value_id = oo.product_option_value_id + WHERE op.order_id = '".(int)$order_id."' + AND op.order_product_id NOT IN ('".(implode("','", $order_product_ids))."')" + ); + //then remove + if($result->num_rows) { + $this->removeOrderProducts($order_id, $result->rows); + } + foreach ($data['product'] as $product) { - if ($product['product_id']) { - $exists = $this->db->query("SELECT product_id - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - AND product_id='".(int)$product['product_id']."' - AND order_product_id = '".(int)$product['order_product_id']."'"); - $exists = $exists->num_rows; - if ($exists) { - $this->db->query("UPDATE ".$this->db->table("order_products")." - SET price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order['value']))."', - quantity = '".$this->db->escape($product['quantity'])."' - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); - } else { - // new products - $product_query = $this->db->query( - "SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) - WHERE p.product_id='".(int)$product['product_id']."'"); - - $this->db->query( - "INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product['product_id']."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order['value']))."', - quantity = '".$this->db->escape($product['quantity'])."'"); - } - } + + $productData = array( + 'order_product_id' => $product['order_product_id'], + 'product_id' => $product['product_id'], + 'product' => array($product) + ); + $this->editOrderProduct($order_id,$productData); } } @@ -269,9 +272,9 @@ public function editOrder($order_id, $data) //get number portion together with the sign $number = preformatFloat($text_value, $this->language->get('decimal_point')); $this->db->query("UPDATE ".$this->db->table("order_totals")." - SET `text` = '".$this->db->escape($text_value)."', - `value` = '".$number."' - WHERE order_total_id = '".(int)$total_id."'"); + SET `text` = '".$this->db->escape($text_value)."', + `value` = '".$number."' + WHERE order_total_id = '".(int)$total_id."'"); } // update total in order main table reading back from all totals and select key 'total' $totals = $this->getOrderTotals($order_id); @@ -279,8 +282,8 @@ public function editOrder($order_id, $data) foreach ($totals as $total_id => $t_data) { if ($t_data['key'] == 'total') { $this->db->query("UPDATE ".$this->db->table("orders")." - SET `total` = '".$t_data['value']."' - WHERE order_id = '".(int)$order_id."'"); + SET `total` = '".$t_data['value']."' + WHERE order_id = '".(int)$order_id."'"); break; } } @@ -288,11 +291,42 @@ public function editOrder($order_id, $data) } } + protected function removeOrderProducts( $order_id, $data ) + { + if(!$data){ + return false; + } + //get list of order products that need to delete + foreach($data as $order_product){ + + if($order_product['base_subtract'] && !$order_product['product_option_value_id']){ + $sql = "UPDATE ".$this->db->table('products')." + SET quantity = quantity + ".(int)$order_product['quantity']." + WHERE product_id = '".$order_product['product_id']."'"; + $this->db->query($sql); + $this->updateStocksInLocations($order_product['product_id'], 0, -$order_product['quantity']); + }elseif($order_product['option_subtract']){ + $sql = "UPDATE ".$this->db->table('product_option_values')." + SET quantity = quantity + ".(int)$order_product['quantity']." + WHERE product_option_value_id = '".$order_product['product_option_value_id']."'"; + $this->db->query($sql); + $this->updateStocksInLocations($order_product['product_id'], $order_product['product_option_value_id'], -$order_product['quantity']); + } + } + $order_product_ids = array_column($data,'order_product_id'); + $this->db->query( + "DELETE FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."' + AND order_product_id IN ('".(implode("','", $order_product_ids))."')" + ); + } + /** - * @param int $order_id + * @param int $order_id * @param array $data * * @return bool + * @throws AException */ public function editOrderProduct($order_id, $data) { @@ -319,19 +353,27 @@ public function editOrderProduct($order_id, $data) return false; } //check is product exists - $exists = $this->db->query("SELECT op.product_id, op.quantity - FROM ".$this->db->table("order_products")." op - WHERE op.order_id = '".(int)$order_id."' - AND op.product_id='".(int)$product_id."' - AND op.order_product_id = '".(int)$order_product_id."'"); + $exists = $this->db->query( + "SELECT op.product_id, op.quantity + FROM ".$this->db->table("order_products")." op + WHERE op.order_id = '".(int)$order_id."' + AND op.product_id='".(int)$product_id."' + AND op.order_product_id = '".(int)$order_product_id."'" + ); if ($exists->num_rows) { //update order quantity $sql = "UPDATE ".$this->db->table("order_products")." - SET price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order_info['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order_info['value']))."', - quantity = '".$this->db->escape($product['quantity'])."' - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$order_product_id."'"; + SET price = '".$this->db->escape( + preformatFloat( + $product['price'], + $this->language->get('decimal_point')) / $order_info['value'])."', + total = '".$this->db->escape( + preformatFloat( + $product['total'], + $this->language->get('decimal_point')) / $order_info['value'])."', + quantity = '".$this->db->escape($product['quantity'])."' + WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$order_product_id."'"; $this->db->query($sql); //update stock quantity @@ -341,48 +383,57 @@ public function editOrderProduct($order_id, $data) if ($qnt_diff != 0) { if ($qnt_diff < 0) { - $new_qnt = $stock_qnt - abs($qnt_diff); + $new_qnt = $stock_qnt + abs($qnt_diff); } else { - $new_qnt = $stock_qnt + $qnt_diff; + $new_qnt = $stock_qnt - abs($qnt_diff);; } if ($product_info['subtract']) { $sql = "UPDATE ".$this->db->table("products")." - SET quantity = '".$new_qnt."' - WHERE product_id = '".(int)$product_id."' AND subtract = 1"; + SET quantity = '".$new_qnt."' + WHERE product_id = '".(int)$product_id."' AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, 0, $qnt_diff); } } } else { // add new product into order $sql = "SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd - ON (p.product_id = pd.product_id AND pd.language_id=".$this->language->getContentLanguageID().") - WHERE p.product_id='".(int)$product_id."'"; + FROM ".$this->db->table("products")." p + LEFT JOIN ".$this->db->table("product_descriptions")." pd + ON (p.product_id = pd.product_id + AND pd.language_id=".$this->language->getContentLanguageID().") + WHERE p.product_id='".(int)$product_id."'"; $product_query = $this->db->query($sql); $sql = "INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product_id."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order_info['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order_info['value']))."', - quantity = '".(int)$product['quantity']."'"; + SET order_id = '".(int)$order_id."', + product_id = '".(int)$product_id."', + name = '".$this->db->escape($product_query->row['name'])."', + model = '".$this->db->escape($product_query->row['model'])."', + sku = '".$this->db->escape($product_query->row['sku'])."', + price = '".$this->db->escape( + preformatFloat( + $product['price'], + $this->language->get('decimal_point')) / $order_info['value'])."', + total = '".$this->db->escape( + preformatFloat( + $product['total'], + $this->language->get('decimal_point')) / $order_info['value'])."', + quantity = '".(int)$product['quantity']."'"; $this->db->query($sql); $order_product_id = $this->db->getLastId(); //update stock quantity - $qnt_diff = -$product['quantity']; + $qnt_diff = $product['quantity']; $stock_qnt = $product_query->row['quantity']; $new_qnt = $stock_qnt - (int)$product['quantity']; if ($product_info['subtract']) { $this->db->query("UPDATE ".$this->db->table("products")." - SET quantity = '".$new_qnt."' - WHERE product_id = '".(int)$product_id."' AND subtract = 1"); + SET quantity = '".$new_qnt."' + WHERE product_id = '".(int)$product_id."' AND subtract = 1"); + $this->updateStocksInLocations($product_id, 0, $qnt_diff); } } @@ -405,15 +456,15 @@ public function editOrderProduct($order_id, $data) } //get all data of given product options from db $sql = "SELECT *, pov.product_option_value_id, povd.name as option_value_name, pod.name as option_name - FROM ".$this->db->table('product_options')." po - LEFT JOIN ".$this->db->table('product_option_descriptions')." pod - ON (pod.product_option_id = po.product_option_id AND pod.language_id=".$this->language->getContentLanguageID().") - LEFT JOIN ".$this->db->table('product_option_values')." pov - ON po.product_option_id = pov.product_option_id - LEFT JOIN ".$this->db->table('product_option_value_descriptions')." povd - ON (povd.product_option_value_id = pov.product_option_value_id AND povd.language_id=".$this->language->getContentLanguageID().") - WHERE po.product_option_id IN (".implode(',', $po_ids).") - ORDER BY po.product_option_id"; + FROM ".$this->db->table('product_options')." po + LEFT JOIN ".$this->db->table('product_option_descriptions')." pod + ON (pod.product_option_id = po.product_option_id AND pod.language_id=".$this->language->getContentLanguageID().") + LEFT JOIN ".$this->db->table('product_option_values')." pov + ON po.product_option_id = pov.product_option_id + LEFT JOIN ".$this->db->table('product_option_value_descriptions')." povd + ON (povd.product_option_value_id = pov.product_option_value_id AND povd.language_id=".$this->language->getContentLanguageID().") + WHERE po.product_option_id IN (".implode(',', $po_ids).") + ORDER BY po.product_option_id"; $result = $this->db->query($sql); //list of option value that we do not re-save @@ -431,7 +482,7 @@ public function editOrderProduct($order_id, $data) //delete old options and then insert new $sql = "DELETE FROM ".$this->db->table('order_options')." - WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; + WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; if ($exclude_list) { $sql .= " AND product_option_value_id NOT IN (".implode(', ', $exclude_list).")"; } @@ -463,22 +514,22 @@ public function editOrderProduct($order_id, $data) foreach ($values as $value) { $arr_key = $opt_id.'_'.$value; $sql = "INSERT INTO ".$this->db->table('order_options')." - (`order_id`, - `order_product_id`, - `product_option_value_id`, - `name`, - `sku`, - `value`, - `price`, - `prefix`) - VALUES ('".$order_id."', - '".(int)$order_product_id."', - '".(int)$value."', - '".$this->db->escape($option_value_info[$arr_key]['option_name'])."', - '".$this->db->escape($option_value_info[$arr_key]['sku'])."', - '".$this->db->escape($option_value_info[$arr_key]['option_value_name'])."', - '".$this->db->escape($option_value_info[$arr_key]['price'])."', - '".$this->db->escape($option_value_info[$arr_key]['prefix'])."')"; + (`order_id`, + `order_product_id`, + `product_option_value_id`, + `name`, + `sku`, + `value`, + `price`, + `prefix`) + VALUES ('".$order_id."', + '".(int)$order_product_id."', + '".(int)$value."', + '".$this->db->escape($option_value_info[$arr_key]['option_name'])."', + '".$this->db->escape($option_value_info[$arr_key]['sku'])."', + '".$this->db->escape($option_value_info[$arr_key]['option_value_name'])."', + '".$this->db->escape($option_value_info[$arr_key]['price'])."', + '".$this->db->escape($option_value_info[$arr_key]['prefix'])."')"; $this->db->query($sql); @@ -498,11 +549,12 @@ public function editOrderProduct($order_id, $data) if (!in_array($v, $curr_arr)) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity + ".$product['quantity'].") - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; + SET quantity = (quantity + ".$product['quantity'].") + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, -$product['quantity']); } } @@ -510,11 +562,11 @@ public function editOrderProduct($order_id, $data) foreach ($curr_arr as $v) { if (!in_array($v, $prev_arr)) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity - ".$product['quantity'].") - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; - + SET quantity = (quantity - ".$product['quantity'].") + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, $product['quantity']); } } @@ -528,10 +580,11 @@ public function editOrderProduct($order_id, $data) } foreach ($intersect as $v) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = ".$sql_incl." - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; + SET quantity = ".$sql_incl." + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, $qnt_diff); } } } @@ -544,33 +597,97 @@ public function editOrderProduct($order_id, $data) //fix order total and subtotal $sql = "SELECT SUM(total) as subtotal - FROM ".$this->db->table('order_products')." - WHERE order_id=".$order_id; + FROM ".$this->db->table('order_products')." + WHERE order_id=".$order_id; $result = $this->db->query($sql); $subtotal = $result->row['subtotal']; $text = $this->currency->format($subtotal, $order_info['currency'], $order_info['value']); $sql = "UPDATE ".$this->db->table('order_totals')." - SET `value`='".$subtotal."', `text` = '".$text."' - WHERE order_id=".$order_id." AND type='subtotal'"; + SET `value`='".$subtotal."', `text` = '".$text."' + WHERE order_id=".$order_id." AND type='subtotal'"; $this->db->query($sql); $sql = "SELECT SUM(`value`) as total - FROM ".$this->db->table('order_totals')." - WHERE order_id=".$order_id." AND type<>'total'"; + FROM ".$this->db->table('order_totals')." + WHERE order_id=".$order_id." AND type<>'total'"; $result = $this->db->query($sql); $total = $result->row['total']; $text = $this->currency->format($total, $order_info['currency'], $order_info['value']); $sql = "UPDATE ".$this->db->table('order_totals')." - SET `value`='".$total."', `text` = '".$text."' - WHERE order_id=".$order_id." AND type='total'"; + SET `value`='".$total."', `text` = '".$text."' + WHERE order_id=".$order_id." AND type='total'"; $this->db->query($sql); $this->cache->remove('product'); return true; } + /** + * @param int $product_id + * @param int $product_option_value_id + * @param int $qnt_diff - difference between new and old quantities. + * if negative - decrease qnty in stock, otherwise - increase + * + * @return bool + * @throws AException + */ + public function updateStocksInLocations($product_id, $product_option_value_id, $qnt_diff) + { + $this->load->model('catalog/product'); + $stockLocations = $this->model_catalog_product->getProductStockLocations($product_id, (int)$product_option_value_id); + if(!$stockLocations){ + return false; + } + $totalStockQuantity = (int)array_sum(array_column($stockLocations, 'quantity')); + + $povId = !(int)$product_option_value_id ? 'IS NULL' : " = ".(int)$product_option_value_id; + + $remains = abs($qnt_diff); + foreach($stockLocations as $sl){ + //if qnt needs to increase stock quantity + if ($qnt_diff < 0){ + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = quantity + ".abs((int)$qnt_diff)." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id ".$povId; + $this->db->query($sql); + break; + } + //if needs to decrease stock quantity + else { + //if no stock enough - just made first location with negative quantity + if(!$totalStockQuantity) { + //update stocks + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = -".(int)$qnt_diff." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id ".$povId; + $this->db->query($sql); + break; + }elseif($sl['quantity']){ + if($sl['quantity']>= $remains){ + $new_qnt = $sl['quantity'] - $remains; + $remains = 0; + }else{ + $new_qnt = 0; + $remains = $remains - $sl['quantity']; + } + + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = ".(int)$new_qnt." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id ".$povId; + $this->db->query($sql); + } + } + } + } + /** * @param int $order_id */ @@ -578,27 +695,27 @@ public function deleteOrder($order_id) { if ($this->config->get('config_stock_subtract')) { $order_query = $this->db->query("SELECT * - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0' AND order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0' AND order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { $product_query = $this->db->query("SELECT * - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."'"); + FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."'"); foreach ($product_query->rows as $product) { $this->db->query("UPDATE `".$this->db->table("products")."` - SET quantity = (quantity + ".(int)$product['quantity'].") - WHERE product_id = '".(int)$product['product_id']."'"); + SET quantity = (quantity + ".(int)$product['quantity'].") + WHERE product_id = '".(int)$product['product_id']."'"); $option_query = $this->db->query("SELECT * - FROM ".$this->db->table("order_options")." - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); + FROM ".$this->db->table("order_options")." + WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); foreach ($option_query->rows as $option) { $this->db->query("UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity + ".(int)$product['quantity'].") - WHERE product_option_value_id = '".(int)$option['product_option_value_id']."' AND subtract = '1'"); + SET quantity = (quantity + ".(int)$product['quantity'].") + WHERE product_option_value_id = '".(int)$option['product_option_value_id']."' AND subtract = '1'"); } } } @@ -621,17 +738,17 @@ public function deleteOrder($order_id) public function addOrderHistory($order_id, $data) { $this->db->query("UPDATE `".$this->db->table("orders")."` - SET order_status_id = '".(int)$data['order_status_id']."', - date_modified = NOW() - WHERE order_id = '".(int)$order_id."'"); + SET order_status_id = '".(int)$data['order_status_id']."', + date_modified = NOW() + WHERE order_id = '".(int)$order_id."'"); if ($data['append']) { $this->db->query("INSERT INTO ".$this->db->table("order_history")." - SET order_id = '".(int)$order_id."', - order_status_id = '".(int)$data['order_status_id']."', - notify = '".(isset($data['notify']) ? (int)$data['notify'] : 0)."', - comment = '".$this->db->escape(strip_tags($data['comment']))."', - date_added = NOW()"); + SET order_id = '".(int)$order_id."', + order_status_id = '".(int)$data['order_status_id']."', + notify = '".(isset($data['notify']) ? (int)$data['notify'] : 0)."', + comment = '".$this->db->escape(strip_tags($data['comment']))."', + date_added = NOW()"); } /* @@ -640,10 +757,10 @@ public function addOrderHistory($order_id, $data) * */ if ($data['notify']) { $order_query = $this->db->query("SELECT *, os.name AS status - FROM `".$this->db->table("orders")."` o - LEFT JOIN ".$this->db->table("order_statuses")." os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) - LEFT JOIN ".$this->db->table("languages")." l ON (o.language_id = l.language_id) - WHERE o.order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` o + LEFT JOIN ".$this->db->table("order_statuses")." os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) + LEFT JOIN ".$this->db->table("languages")." l ON (o.language_id = l.language_id) + WHERE o.order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { //load language specific for the order in admin section @@ -736,8 +853,8 @@ public function addOrderHistory($order_id, $data) public function getOrder($order_id) { $order_query = $this->db->query("SELECT * - FROM `".$this->db->table("orders")."` - WHERE order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` + WHERE order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { //Decrypt order data @@ -871,13 +988,13 @@ public function getImFromOrderData($order_id, $customer_id) $p[] = $this->db->escape($protocol); } $sql = "SELECT od.*, odt.name as type_name - FROM ".$this->db->table('order_data')." od - LEFT JOIN ".$this->db->table('order_data_types')." odt ON odt.type_id = od.type_id - WHERE od.order_id = ".(int)$order_id." - AND od.type_id IN ( - SELECT DISTINCT `type_id` - FROM ".$this->db->table('order_data_types')." - WHERE `name` IN ('".implode("', '", $p)."')) "; + FROM ".$this->db->table('order_data')." od + LEFT JOIN ".$this->db->table('order_data_types')." odt ON odt.type_id = od.type_id + WHERE od.order_id = ".(int)$order_id." + AND od.type_id IN ( + SELECT DISTINCT `type_id` + FROM ".$this->db->table('order_data_types')." + WHERE `name` IN ('".implode("', '", $p)."')) "; $result = $this->db->query($sql); foreach ($result->rows as $row) { if ($row['type_name'] == 'email') { @@ -919,20 +1036,20 @@ public function getOrders($data = array(), $mode = 'default') $total_sql = 'count(*) as total'; } else { $total_sql = "o.order_id, - CONCAT(o.firstname, ' ', o.lastname) AS name, - (SELECT os.name - FROM ".$this->db->table("order_statuses")." os - WHERE os.order_status_id = o.order_status_id - AND os.language_id = '".(int)$language_id."') AS status, - o.order_status_id, - o.date_added, - o.total, - o.currency, - o.value"; + CONCAT(o.firstname, ' ', o.lastname) AS name, + (SELECT os.name + FROM ".$this->db->table("order_statuses")." os + WHERE os.order_status_id = o.order_status_id + AND os.language_id = '".(int)$language_id."') AS status, + o.order_status_id, + o.date_added, + o.total, + o.currency, + o.value"; } $sql = "SELECT ".$total_sql." - FROM `".$this->db->table("orders")."` o"; + FROM `".$this->db->table("orders")."` o"; if (has_value($data['filter_product_id'])) { $sql .= " LEFT JOIN `".$this->db->table("order_products")."` op ON o.order_id = op.order_id "; @@ -1007,9 +1124,9 @@ public function getOrders($data = array(), $mode = 'default') } } $sql .= " AND ( FLOOR(o.total) IN (".implode(",", $temp).") - OR FLOOR(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp).") - OR CEIL(o.total) IN (".implode(",", $temp2).") - OR CEIL(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp2).") )"; + OR FLOOR(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp).") + OR CEIL(o.total) IN (".implode(",", $temp2).") + OR CEIL(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp2).") )"; } } @@ -1080,8 +1197,8 @@ public function getOrderTotalWithProduct($product_id) return false; } $sql = "SELECT count(DISTINCT op.order_id, op.order_product_id) as total - FROM ".$this->db->table('order_products')." op - WHERE op.product_id = '".(int)$product_id."'"; + FROM ".$this->db->table('order_products')." op + WHERE op.product_id = '".(int)$product_id."'"; $query = $this->db->query($sql); return $query->row['total']; @@ -1105,10 +1222,10 @@ public function generateInvoiceId($order_id) } $this->db->query("UPDATE `".$this->db->table("orders")."` - SET invoice_id = '".(int)$invoice_id."', - invoice_prefix = '".$this->db->escape($this->config->get('invoice_prefix'))."', - date_modified = NOW() - WHERE order_id = '".(int)$order_id."'"); + SET invoice_id = '".(int)$invoice_id."', + invoice_prefix = '".$this->db->escape($this->config->get('invoice_prefix'))."', + date_modified = NOW() + WHERE order_id = '".(int)$order_id."'"); return $this->config->get('invoice_prefix').$invoice_id; } @@ -1122,9 +1239,9 @@ public function generateInvoiceId($order_id) public function getOrderProducts($order_id, $order_product_id = 0) { $query = $this->db->query("SELECT * - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - ".((int)$order_product_id ? " AND order_product_id='".(int)$order_product_id."'" : '')); + FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."' + ".((int)$order_product_id ? " AND order_product_id='".(int)$order_product_id."'" : '')); return $query->rows; } @@ -1137,13 +1254,13 @@ public function getOrderProducts($order_id, $order_product_id = 0) public function getOrderOptions($order_id, $order_product_id) { $query = $this->db->query("SELECT op.*, po.element_type, po.attribute_id, po.product_option_id, pov.subtract - FROM ".$this->db->table("order_options")." op - LEFT JOIN ".$this->db->table("product_option_values")." pov - ON op.product_option_value_id = pov.product_option_value_id - LEFT JOIN ".$this->db->table("product_options")." po - ON pov.product_option_id = po.product_option_id - WHERE op.order_id = '".(int)$order_id."' - AND op.order_product_id = '".(int)$order_product_id."'"); + FROM ".$this->db->table("order_options")." op + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON op.product_option_value_id = pov.product_option_value_id + LEFT JOIN ".$this->db->table("product_options")." po + ON pov.product_option_id = po.product_option_id + WHERE op.order_id = '".(int)$order_id."' + AND op.order_product_id = '".(int)$order_product_id."'"); return $query->rows; } @@ -1156,12 +1273,12 @@ public function getOrderOptions($order_id, $order_product_id) public function getOrderOption($order_option_id) { $query = $this->db->query("SELECT op.*, po.element_type, po.attribute_id, po.product_option_id, pov.subtract - FROM ".$this->db->table("order_options")." op - LEFT JOIN ".$this->db->table("product_option_values")." pov - ON op.product_option_value_id = pov.product_option_value_id - LEFT JOIN ".$this->db->table("product_options")." po - ON pov.product_option_id = po.product_option_id - WHERE op.order_option_id = '".(int)$order_option_id."'"); + FROM ".$this->db->table("order_options")." op + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON op.product_option_value_id = pov.product_option_value_id + LEFT JOIN ".$this->db->table("product_options")." po + ON pov.product_option_id = po.product_option_id + WHERE op.order_option_id = '".(int)$order_option_id."'"); return $query->row; } @@ -1173,9 +1290,9 @@ public function getOrderOption($order_option_id) public function getOrderTotals($order_id) { $query = $this->db->query("SELECT * - FROM ".$this->db->table("order_totals")." - WHERE order_id = '".(int)$order_id."' - ORDER BY sort_order"); + FROM ".$this->db->table("order_totals")." + WHERE order_id = '".(int)$order_id."' + ORDER BY sort_order"); return $query->rows; } @@ -1191,16 +1308,16 @@ public function getOrderHistory($order_id) $default_language_id = $this->language->getDefaultLanguageID(); $query = $this->db->query("SELECT oh.date_added, - COALESCE( os1.name, os1.name) AS status, - oh.comment, - oh.notify - FROM ".$this->db->table("order_history")." oh - LEFT JOIN ".$this->db->table("order_statuses")." os1 ON oh.order_status_id = os1.order_status_id - AND os1.language_id = '".(int)$language_id."' - LEFT JOIN ".$this->db->table("order_statuses")." os2 ON oh.order_status_id = os2.order_status_id - AND os2.language_id = '".(int)$default_language_id."' - WHERE oh.order_id = '".(int)$order_id."' - ORDER BY oh.date_added"); + COALESCE( os1.name, os1.name) AS status, + oh.comment, + oh.notify + FROM ".$this->db->table("order_history")." oh + LEFT JOIN ".$this->db->table("order_statuses")." os1 ON oh.order_status_id = os1.order_status_id + AND os1.language_id = '".(int)$language_id."' + LEFT JOIN ".$this->db->table("order_statuses")." os2 ON oh.order_status_id = os2.order_status_id + AND os2.language_id = '".(int)$default_language_id."' + WHERE oh.order_id = '".(int)$order_id."' + ORDER BY oh.date_added"); return $query->rows; } @@ -1213,19 +1330,19 @@ public function getOrderHistory($order_id) public function getOrderDownloads($order_id) { $query = $this->db->query("SELECT op.product_id, op.name as product_name, od.* - FROM ".$this->db->table("order_downloads")." od - LEFT JOIN ".$this->db->table("order_products")." op - ON op.order_product_id = od.order_product_id - WHERE od.order_id = '".(int)$order_id."' - ORDER BY op.order_product_id, od.sort_order, od.name"); + FROM ".$this->db->table("order_downloads")." od + LEFT JOIN ".$this->db->table("order_products")." op + ON op.order_product_id = od.order_product_id + WHERE od.order_id = '".(int)$order_id."' + ORDER BY op.order_product_id, od.sort_order, od.name"); $output = array(); foreach ($query->rows as $row) { $output[$row['product_id']]['product_name'] = $row['product_name']; // get download_history $result = $this->db->query("SELECT * - FROM ".$this->db->table("order_downloads_history")." - WHERE order_id = '".(int)$order_id."' AND order_download_id = '".$row['order_download_id']."' - ORDER BY `time` DESC"); + FROM ".$this->db->table("order_downloads_history")." + WHERE order_id = '".(int)$order_id."' AND order_download_id = '".$row['order_download_id']."' + ORDER BY `time` DESC"); $row['download_history'] = $result->rows; $output[$row['product_id']]['downloads'][] = $row; @@ -1241,8 +1358,8 @@ public function getOrderDownloads($order_id) public function getTotalOrderDownloads($order_id) { $query = $this->db->query("SELECT COUNT(*) as total - FROM ".$this->db->table("order_downloads")." od - WHERE od.order_id = '".(int)$order_id."'"); + FROM ".$this->db->table("order_downloads")." od + WHERE od.order_id = '".(int)$order_id."'"); return $query->row['total']; } @@ -1255,8 +1372,8 @@ public function getTotalOrderDownloads($order_id) public function getTotalOrdersByStoreId($store_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE store_id = '".(int)$store_id."'"); + FROM `".$this->db->table("orders")."` + WHERE store_id = '".(int)$store_id."'"); return $query->row['total']; } @@ -1269,10 +1386,10 @@ public function getTotalOrdersByStoreId($store_id) public function getOrderHistoryTotalByOrderStatusId($order_status_id) { $query = $this->db->query("SELECT oh.order_id - FROM ".$this->db->table("order_history")." oh - LEFT JOIN `".$this->db->table("orders")."` o ON (oh.order_id = o.order_id) - WHERE oh.order_status_id = '".(int)$order_status_id."' AND o.order_status_id > '0' - GROUP BY order_id"); + FROM ".$this->db->table("order_history")." oh + LEFT JOIN `".$this->db->table("orders")."` o ON (oh.order_id = o.order_id) + WHERE oh.order_status_id = '".(int)$order_status_id."' AND o.order_status_id > '0' + GROUP BY order_id"); return $query->num_rows; } @@ -1285,8 +1402,8 @@ public function getOrderHistoryTotalByOrderStatusId($order_status_id) public function getTotalOrdersByOrderStatusId($order_status_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id = '".(int)$order_status_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id = '".(int)$order_status_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1298,8 +1415,8 @@ public function getTotalOrdersByOrderStatusId($order_status_id) public function getTotalOrdersByLanguageId($language_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE language_id = '".(int)$language_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE language_id = '".(int)$language_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1311,8 +1428,8 @@ public function getTotalOrdersByLanguageId($language_id) public function getTotalOrdersByCurrencyId($currency_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE currency_id = '".(int)$currency_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE currency_id = '".(int)$currency_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1322,8 +1439,8 @@ public function getTotalOrdersByCurrencyId($currency_id) public function getTotalSales() { $query = $this->db->query("SELECT SUM(total) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0'"); return $query->row['total']; } @@ -1335,8 +1452,8 @@ public function getTotalSales() public function getTotalSalesByYear($year) { $query = $this->db->query("SELECT SUM(total) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0' AND YEAR(date_added) = '".(int)$year."'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0' AND YEAR(date_added) = '".(int)$year."'"); return $query->row['total']; } @@ -1353,10 +1470,10 @@ public function getGuestOrdersWithProduct($product_id) return array(); } $query = $this->db->query("SELECT DISTINCT o.* - FROM ".$this->db->table("order_products")." op - INNER JOIN ".$this->db->table("orders")." o - ON o.order_id = op.order_id - WHERE COALESCE(o.customer_id,0) = '0' AND op.product_id='".(int)$product_id."'"); + FROM ".$this->db->table("order_products")." op + INNER JOIN ".$this->db->table("orders")." o + ON o.order_id = op.order_id + WHERE COALESCE(o.customer_id,0) = '0' AND op.product_id='".(int)$product_id."'"); return $query->rows; } @@ -1380,9 +1497,9 @@ public function getCountOrdersByCustomerIds($customers_ids) return array(); } $query = $this->db->query("SELECT customer_id, COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE customer_id IN (".implode(",", $ids).") AND order_status_id > '0' - GROUP BY customer_id"); + FROM `".$this->db->table("orders")."` + WHERE customer_id IN (".implode(",", $ids).") AND order_status_id > '0' + GROUP BY customer_id"); $output = array(); foreach ($query->rows as $row) { $output[$row['customer_id']] = (int)$row['total']; diff --git a/public_html/admin/view/default/javascript/aform.js b/public_html/admin/view/default/javascript/aform.js index b2d18bb031..e7f7f92376 100755 --- a/public_html/admin/view/default/javascript/aform.js +++ b/public_html/admin/view/default/javascript/aform.js @@ -322,7 +322,7 @@ }); } - function flip_aswitch(elem, value){ + function flip_aswitch(elem, value) { var $el = $(elem); //change input field state var $field = $el.parent('.afield'); @@ -334,33 +334,16 @@ $el.val(value); } } else { - if($el.val() == '1') { + if ($el.val() == '1') { $el.val('0'); } else { $el.val('1'); } } - //reset off button - if ( $el.val() == 1) { - $field.find('.btn').removeClass('btn-off'); - } else { - $field.find('.btn-default').addClass('btn-off'); - } - //toggle buttons - $field.find('.btn').toggleClass('active'); - if ($field.find('.btn-primary').size() > 0) { - $field.find('.btn').toggleClass('btn-primary'); - } - if ($field.find('.btn-danger').size() > 0) { - $field.find('.btn').toggleClass('btn-danger'); - } - if ($field.find('.btn-success').size() > 0) { - $field.find('.btn').toggleClass('btn-success'); - } - if ($field.find('.btn-info').size() > 0) { - $field.find('.btn').toggleClass('btn-info'); - } - $field.find('.btn').toggleClass('btn-default'); + + //flip the switch + $field.find('.btn-on ').toggleClass('hidden'); + $field.find('.btn-off ').toggleClass('hidden'); //do custom action for status field statusMarker($el.parent('.input-group')); diff --git a/public_html/admin/view/default/stylesheet/bootstrap.custom.css b/public_html/admin/view/default/stylesheet/bootstrap.custom.css index d2e422685f..1a57ff43da 100644 --- a/public_html/admin/view/default/stylesheet/bootstrap.custom.css +++ b/public_html/admin/view/default/stylesheet/bootstrap.custom.css @@ -906,10 +906,15 @@ h4, .h4 { border-radius: 0 0 2px 2px; } +.nav-tabs > li { + margin-bottom: 1px; +} + .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { - background-color: #fcfcfc; + background-color: #064770; + color: #fff; border: 0; } diff --git a/public_html/admin/view/default/stylesheet/stylesheet.css b/public_html/admin/view/default/stylesheet/stylesheet.css index cde3feeb0f..6c6ab49cfb 100755 --- a/public_html/admin/view/default/stylesheet/stylesheet.css +++ b/public_html/admin/view/default/stylesheet/stylesheet.css @@ -6,7 +6,6 @@ Developers: Pavel Rojkov (projkov@abantecart.com) AbanteCart brand color styles: #064770 (dark blue) #F19013 (Orange) */ - @import url('bootstrap.min.css'); @import url('bootstrap.custom.css'); @import url('jquery-ui/ui-lightness/jquery-ui-1.10.4.custom.min.css'); @@ -19,11 +18,11 @@ AbanteCart brand color styles: #064770 (dark blue) #F19013 (Orange) @import url('animate.css'); body { - /*background: #1d2939;*/ - background: #064770; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif !important; - line-height: 21px; - color: #636e7b; + /*background: #1d2939;*/ + background: #064770; + font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif !important; + line-height: 21px; + color: #636e7b; } .abc_orange { @@ -34,8 +33,8 @@ body { color: #064770; } -input,select,textarea { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif !important; +input, select, textarea { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif !important; color: #636e7b; } @@ -47,18 +46,21 @@ a:hover, .btn-default:hover { color: #F19013; } -a:focus, a:active { outline: none; } +a:focus, a:active { + outline: none; +} -h1,h2,h3,h4,h5 { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif; +h1, h2, h3, h4, h5 { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif; } -h1 a:hover, h2 a:hover, h3 a:hover { + +h1 a:hover, h2 a:hover, h3 a:hover { text-decoration: none; } .grey_out { - opacity: 0.2; - text-shadow: 0 1px 0 #FFFFFF; + opacity: 0.2; + text-shadow: 0 1px 0 #FFFFFF; } .input-group.captcha, .form-group.captcha { @@ -66,61 +68,66 @@ h1 a:hover, h2 a:hover, h3 a:hover { } /* Voice commands */ -#results{ +#results { padding: 10px 0 0 0; } + .final_speech { font-weight: bold; } + .interim_speech { font-weight: normal; color: gray; } + .mic_on { color: red; padding: 0 10px 0 10px; } + .mic_off, .try_again { padding: 0 10px 0 10px; } + .voice-close { padding: 0 0 0 10px; } /* preloader */ #preloader { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: #e4e7ea; - color: #f19013 !important; - z-index: 10000; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #e4e7ea; + color: #f19013 !important; + z-index: 10000; } #preloader_status { - width: 30px; - height: 30px; - position: absolute; - left: 50%; - top: 50%; - margin: -15px 0 0 -15px; - font-size: 32px; + width: 30px; + height: 30px; + position: absolute; + left: 50%; + top: 50%; + margin: -15px 0 0 -15px; + font-size: 32px; } -.center_div { - position: fixed; - top: 45%; - left: 45%; - width: 100%; - height: 100%; +.center_div { + position: fixed; + top: 45%; + left: 45%; + width: 100%; + height: 100%; } -.center_div_abs { - position: absolute; - top: 45%; - left: 45%; +.center_div_abs { + position: absolute; + top: 45%; + left: 45%; } #iframe_loading { @@ -128,57 +135,57 @@ h1 a:hover, h2 a:hover, h3 a:hover { color: #f19013 !important; } - /***** Main Scaffolding ******/ .wrapper { } /***** Left panel *****/ .leftpanel { - width: 240px; - position: absolute; - top: 0; - left: 0; - z-index: 100; + width: 240px; + position: absolute; + top: 0; + left: 0; + z-index: 100; } /***** content panel for all pages *****/ .mainpanel { - margin-left: 240px; - background: #e4e7ea; + margin-left: 240px; + background: #e4e7ea; } + /***** content panel for no columns mode (no authentication) *****/ .mainpanel.no-columns { margin-left: 0px; max-width: 900px; - margin-left:auto; - margin-right:auto; + margin-left: auto; + margin-right: auto; } /***** right panel (hidden by default) *****/ .rightpanel { - width: 240px; - height: 100%; - position: fixed; - overflow-y: auto; - overflow-x: hidden; - top: 0; - right: -240px; - display: none; - z-index: 9999; - background: none repeat scroll 0 0 #064770; + width: 240px; + height: 100%; + position: fixed; + overflow-y: auto; + overflow-x: hidden; + top: 0; + right: -240px; + display: none; + z-index: 9999; + background: none repeat scroll 0 0 #064770; } /***** Header *****/ .headerbar { - border-left: 1px solid #eee; - background: #fff; + border-left: 1px solid #eee; + background: #fff; } .headerbar::after { - clear: both; - display: block; - content: ''; + clear: both; + display: block; + content: ''; } #menu_box { @@ -186,78 +193,82 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .menutoggle { - float: left; - width: 50px; - height: 50px; - font-size: 22px; - cursor: pointer; - float: left; - border-right: 1px solid #eee; - -moz-transition: all 0.2s ease-out 0s; - -webkit-transition: all 0.2s ease-out 0s; - transition: all 0.2s ease-out 0s; + float: left; + width: 50px; + height: 50px; + font-size: 22px; + cursor: pointer; + float: left; + border-right: 1px solid #eee; + -moz-transition: all 0.2s ease-out 0s; + -webkit-transition: all 0.2s ease-out 0s; + transition: all 0.2s ease-out 0s; } .menutoggle:hover { - background-color: #f7f7f7; + background-color: #f7f7f7; } .menutoggle .fa, .menutoggle .glyphicon { - margin: 14px 0 0 15px; + margin: 14px 0 0 15px; } #global_search_chosen { - width: 260px; - float: left; - border: 0; - border-right: 1px solid #eee; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - height: 50px; - font-size: 14px; + width: 260px; + float: left; + border: 0; + border-right: 1px solid #eee; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + height: 50px; + font-size: 14px; } + #global_search_chosen .chosen-single { - height: 50px; - border: 0; + height: 50px; + border: 0; } -#global_search_chosen .chosen-single span{ + +#global_search_chosen .chosen-single span { color: #ccc; } + #global_search_chosen .chosen-single span, #global_search_chosen .chosen-single div { padding-top: 10px; } + .header-left { - float: left; + float: left; } .header-right { - float: right; + float: right; } .headermenu { - list-style: none; - margin: 0; - padding: 0; + list-style: none; + margin: 0; + padding: 0; } .headermenu:after { - clear: both; - display: block; - content: ''; + clear: both; + display: block; + content: ''; } .headermenu > li { - display: inline-block; - float: left; + display: inline-block; + float: left; border-left: 1px solid #eee; position: relative; } .headermenu .dropdown-toggle { - padding: 12px 10px; - border-color: #fff; + padding: 12px 10px; + border-color: #fff; background: #fff; -moz-border-radius: 0; -webkit-border-radius: 0; @@ -265,57 +276,56 @@ h1 a:hover, h2 a:hover, h3 a:hover { border: 0; } - .headermenu .dropdown-toggle:focus, .headermenu .dropdown-toggle:active, .headermenu .dropdown-toggle.active, .headermenu .open .dropdown-toggle.dropdown-toggle { - background: #f7f7f7; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; + background: #f7f7f7; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } #right_side_view.dropdown-toggle { - background: none repeat scroll 0 0 #131D29; - color: rgba(255, 255, 255, 0.5); + background: none repeat scroll 0 0 #131D29; + color: rgba(255, 255, 255, 0.5); } .headermenu .dropdown-toggle img { - vertical-align: middle; - margin-right: 5px; - width: 26px; - -moz-border-radius: 50px; - -webkit-border-radius: 50px; - border-radius: 50px; + vertical-align: middle; + margin-right: 5px; + width: 26px; + -moz-border-radius: 50px; + -webkit-border-radius: 50px; + border-radius: 50px; } .headermenu .dropdown-toggle .caret { - margin-left: 5px; + margin-left: 5px; } .headermenu .dropdown-menu { - border: 0; - margin-top: 0px; + border: 0; + margin-top: 0px; margin-right: -1px; - -moz-border-radius: 2px 0 2px 2px; - -webkit-border-radius: 2px 0 2px 2px; - border-radius: 2px 0 2px 2px; - -moz-box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - -webkit-box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - padding: 5px; + -moz-border-radius: 2px 0 2px 2px; + -webkit-border-radius: 2px 0 2px 2px; + border-radius: 2px 0 2px 2px; + -moz-box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + -webkit-box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + padding: 5px; } .headermenu .dropdown-menu:after { - border-bottom: 6px solid #064770; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - content: ""; - display: inline-block; - right: 17px; - position: absolute; - top: -6px; + border-bottom: 6px solid #064770; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: ""; + display: inline-block; + right: 17px; + position: absolute; + top: -6px; } .headermenu .dropdown-menu li { @@ -327,40 +337,40 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .headermenu .dropdown-menu li a { - color: #EEEEEE; - font-size: 13px; - padding: 7px 10px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - -moz-transition: all 0.2s ease-out 0s; + color: #EEEEEE; + font-size: 13px; + padding: 7px 10px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + -moz-transition: all 0.2s ease-out 0s; -webkit-transition: all 0.2s ease-out 0s; transition: all 0.2s ease-out 0s; } .headermenu .dropdown-menu li a:hover { - background: #F19013; - color: #fff; + background: #F19013; + color: #fff; } .headermenu .dropdown-menu li i { - font-size: 11px; - margin-right: 5px; + font-size: 11px; + margin-right: 5px; } .headermenu .dropdown-menu-head { - padding: 0; - min-width: 250px; + padding: 0; + min-width: 250px; } -.headermenu .dropdown-menu-head.switcher{ - min-width: 180px; +.headermenu .dropdown-menu-head.switcher { + min-width: 180px; } .headermenu .tp-icon { - padding: 12px 15px; + padding: 12px 15px; height: 50px; - font-size: 16px; + font-size: 16px; background: #fff; border-color: #fff; -moz-transition: all 0.2s ease-out 0s; @@ -373,19 +383,19 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .headermenu .chat-icon { - border-right: 0; + border-right: 0; } .headermenu .dropdown-menu-head ul { - border: 1px solid #ddd; - border-top: 0; - padding: 0 10px; + border: 1px solid #ddd; + border-top: 0; + padding: 0 10px; } .headermenu .dropdown-menu-head li a { - color: #333; - padding: 0; - opacity: 1; + color: #333; + padding: 0; + opacity: 1; } .headermenu .dropdown-menu-head li a:hover { @@ -397,46 +407,48 @@ h1 a:hover, h2 a:hover, h3 a:hover { .headermenu .btn-group { margin-bottom: 0; } -.headermenu #language_form ul.dropdown-list img{ + +.headermenu #language_form ul.dropdown-list img { width: 16px; height: 11px; } + .dropdown-list li { - padding: 10px; - overflow: hidden; - border-bottom: 1px solid #eee; + padding: 10px; + overflow: hidden; + border-bottom: 1px solid #eee; } .dropdown-list li:last-child { - border-bottom: 0; + border-bottom: 0; } .dropdown-list .thumb { - max-width: 36px; - float: left; + max-width: 36px; + float: left; } .dropdown-list .thumb img { - width: 100%; - display: block; - vertical-align: middle; + width: 100%; + display: block; + vertical-align: middle; } .dropdown-list .desc { - margin-left: 20px; - display: block; + margin-left: 20px; + display: block; } .dropdown-list .desc h5 { - font-size: 13px; - margin-top: 7px; + font-size: 13px; + margin-top: 7px; } .dropdown-list li:last-child { } .dropdown-list li .badge { - float: right; + float: right; } .message-danger { @@ -447,67 +459,73 @@ h1 a:hover, h2 a:hover, h3 a:hover { /* Small dropdown */ .dropdown-menu-sm { margin-right: -1px; - -moz-border-radius: 2px 0 2px 2px; - -webkit-border-radius: 2px 0 2px 2px; - border-radius: 2px 0 2px 2px; - -moz-box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - -webkit-box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - box-shadow: 3px 3px 0 rgba(12,12,12,0.05); - border: 0; - margin: 0; - padding: 0; - font-size: 12px; + -moz-border-radius: 2px 0 2px 2px; + -webkit-border-radius: 2px 0 2px 2px; + border-radius: 2px 0 2px 2px; + -moz-box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + -webkit-box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + box-shadow: 3px 3px 0 rgba(12, 12, 12, 0.05); + border: 0; + margin: 0; + padding: 0; + font-size: 12px; } .dropdown-menu-sm:after { - border-bottom: 6px solid #064770; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - content: ""; - display: inline-block; - left: 40px; - position: absolute; - top: -6px; + border-bottom: 6px solid #064770; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: ""; + display: inline-block; + left: 40px; + position: absolute; + top: -6px; } + /* in the grid */ .ui-widget-content .dropdown-menu-sm:after { - left: 130px; + left: 130px; } + .dropdown-menu-sm ul { margin: 0; padding: 0 10px; border: 1px solid #ddd; border-top: 0; } + .dropdown-menu-sm li { - display: block; - margin: 0; - float: none; - background: none; + display: block; + margin: 0; + float: none; + background: none; } .dropdown-menu-sm li i { - font-size: 11px; - margin-right: 5px; + font-size: 11px; + margin-right: 5px; } .dropdown-list-sm li { - padding: 5px; - overflow: hidden; - border-bottom: 1px solid #eee; + padding: 5px; + overflow: hidden; + border-bottom: 1px solid #eee; } + .dropdown-menu-sm .title { - background: #064770; - color: #EEEEEE; - padding: 10px; - text-transform: uppercase; - font-size: 11px; - margin: 0; + background: #064770; + color: #EEEEEE; + padding: 10px; + text-transform: uppercase; + font-size: 11px; + margin: 0; } + .dropdown-menu-sm li a { cursor: pointer; display: block; } + .dropdown-menu-sm li a:hover { background: none; color: #428BCA; @@ -515,40 +533,39 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .gen-list li > a { - display: block; - cursor: pointer; + display: block; + cursor: pointer; } .gen-list li > a:hover { - text-decoration: none; + text-decoration: none; } .gen-list li .name { font-size: 13px; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif; - line-height: 21px; - display: block; + font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, sans-serif; + line-height: 21px; + display: block; } .gen-list li .msg { - font-size: 11px; - line-height: normal; - display: block; + font-size: 11px; + line-height: normal; + display: block; } - /***** Left Nav Panel *****/ .sticky-leftpanel { - position: fixed; - height: 100%; - overflow-y: auto; + position: fixed; + height: 100%; + overflow-y: auto; } .logopanel { - padding: 5px 10px 5px 10px; - background: #fff; - text-align: center; - max-height: 50px; + padding: 5px 10px 5px 10px; + background: #fff; + text-align: center; + max-height: 50px; } .logopanel .logo_image { @@ -556,128 +573,128 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .pageheader .logopanel { - background: none; + background: none; } .leftpanelinner { - padding: 5px 15px; + padding: 5px 15px; } .leftpanel #searchform { - display: none; + display: none; } .leftpanel #searchform::after { - content: ''; - display: block; - clear: both; + content: ''; + display: block; + clear: both; } .leftpanel #searchform input { - padding: 10px; - height: auto; - width: 100%; - margin: 5px 0 20px 0; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; + padding: 10px; + height: auto; + width: 100%; + margin: 5px 0 20px 0; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } .leftpanel .userlogged { - margin: 0; - padding: 0; - padding-bottom: 15px; - margin-bottom: 15px; - border-bottom: 1px solid rgba(255,255,255,0.1); - display: none; + margin: 0; + padding: 0; + padding-bottom: 15px; + margin-bottom: 15px; + border-bottom: 1px solid rgba(255, 255, 255, 0.1); + display: none; } .leftpanel .userlogged .media-object { - width: 40px; - -moz-border-radius: 100px; - -webkit-border-radius: 100px; - border-radius: 100px; - float: left; - border: 2px solid #F19013; - padding: 2px; - margin-left: 2px; + width: 40px; + -moz-border-radius: 100px; + -webkit-border-radius: 100px; + border-radius: 100px; + float: left; + border: 2px solid #F19013; + padding: 2px; + margin-left: 2px; } .leftpanel .userlogged .media-body { - margin-left: 50px; - color: #ccc; + margin-left: 50px; + color: #ccc; } .leftpanel .userlogged .media-body h4 { - font-size: 15px; - margin: 0; + font-size: 15px; + margin: 0; } .leftpanel .userlogged .media-body span { - font-style: italic; - font-size: 11px; - opacity: 0.5; + font-style: italic; + font-size: 11px; + opacity: 0.5; } .sidebartitle { - font-size: 12px; - text-transform: uppercase; - color: #fff; - margin-bottom: 10px; + font-size: 12px; + text-transform: uppercase; + color: #fff; + margin-bottom: 10px; } .nav-bracket { - margin-bottom: 30px; + margin-bottom: 30px; } .nav-bracket > li > a { - color: #EEEEEE; - padding: 7px 10px; + color: #EEEEEE; + padding: 7px 10px; } .nav-bracket a { - cursor: pointer; + cursor: pointer; } .nav-bracket > li > a:hover, .nav-bracket > li > a:active, .nav-bracket > li > a:focus { - background-color: #fff; + background-color: #fff; color: #064770; - -moz-box-shadow: 0 3px 0 rgba(0,0,0,0.2); - -webkit-box-shadow: 0 3px 0 rgba(0,0,0,0.2); - box-shadow: 0 3px 0 rgba(0,0,0,0.2); + -moz-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); + box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); } -.nav-bracket > li.nav-parent > a, +.nav-bracket > li.nav-parent > a, .nav-bracket .child1 > li.nav-parent > a { - background: transparent url(../image/plus-white.png) no-repeat 96% center; + background: transparent url(../image/plus-white.png) no-repeat 96% center; } .nav-bracket .child1 > li.nav-active > a { - background-color: #fff; - background: transparent url(../image/minus-white.png) no-repeat 96% center; + background-color: #fff; + background: transparent url(../image/minus-white.png) no-repeat 96% center; } .nav-bracket > li.nav-parent > a:focus { - color: #EEEEEE; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; + color: #EEEEEE; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } .nav-bracket > li.nav-parent > a:hover, .nav-bracket > li.nav-parent > a:active { - color: #064770; - background-color: #fff; - background-image: url(../image/plus.png); + color: #064770; + background-color: #fff; + background-image: url(../image/plus.png); } .nav-bracket > li.nav-active > a { - color: #064770; - -moz-box-shadow: 0 3px 0 rgba(0,0,0,0.2); - -webkit-box-shadow: 0 3px 0 rgba(0,0,0,0.2); - box-shadow: 0 3px 0 rgba(0,0,0,0.2); + color: #064770; + -moz-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); + box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); background: white url(../image/minus.png) no-repeat 96% center; } @@ -686,143 +703,144 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .nav-bracket > li.nav-active > a:focus { - color: #064770; + color: #064770; } .nav-bracket > li.active > a, .nav-bracket > li.active > a:hover, .nav-bracket > li.active > a:focus { - background-color: #F19013; - color: #fff; + background-color: #F19013; + color: #fff; } .nav-bracket > li.active > a { - -moz-box-shadow: 0 3px 0 rgba(0,0,0,0.1); - -webkit-box-shadow: 0 3px 0 rgba(0,0,0,0.1); - box-shadow: 0 3px 0 rgba(0,0,0,0.1); + -moz-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1); } .nav-bracket > li.nav-parent.active > a { - background-image: url(../image/plus.png); - background-repeat: no-repeat; + background-image: url(../image/plus.png); + background-repeat: no-repeat; } - .nav-bracket li .fa, .nav-bracket li .glyphicon { - font-size: 16px; - vertical-align: middle; - margin-right: 10px; - width: 16px; - text-align: center; + font-size: 16px; + vertical-align: middle; + margin-right: 10px; + width: 16px; + text-align: center; } .nav-bracket > li > a > .badge { - margin-top: 2px; + margin-top: 2px; } .nav-bracket .children { - list-style: none; - display: none; - margin: 5px 0; + list-style: none; + display: none; + margin: 5px 0; padding: 0; } .nav-bracket .children > li > a { - color: #EEEEEE; - font-size: 13px; - display: block; - padding: 5px 0 5px 27px; - -moz-transition: all 0.2s ease-out 0s; + color: #EEEEEE; + font-size: 13px; + display: block; + padding: 5px 0 5px 27px; + -moz-transition: all 0.2s ease-out 0s; -webkit-transition: all 0.2s ease-out 0s; transition: all 0.2s ease-out 0s; } .nav-bracket .children > li > a > span { - margin-top: 2px; + margin-top: 2px; } .nav-bracket .children > li > a:hover, .nav-bracket .children > li > a:active, .nav-bracket .children > li > a:focus { - text-decoration: none; - color: #F19013; + text-decoration: none; + color: #F19013; } .nav-bracket .children > li .fa { - font-size: 12px; - opacity: 0.5; - margin-right: 5px; - text-align: left; - width: auto; - vertical-align: baseline; + font-size: 12px; + opacity: 0.5; + margin-right: 5px; + text-align: left; + width: auto; + vertical-align: baseline; } .nav-bracket .children > li.active > a { - color: #F19013; + color: #F19013; } .nav-bracket .children ul { - margin-left: 12px; - border: 0; + margin-left: 12px; + border: 0; } .side_summary { - margin: 30px 0; + margin: 30px 0; } + .side_summary .text-muted { color: #ccc; } + .side_summary ul { - padding: 0; - margin: 20px 0 0; - list-style: none; - border-top: 1px solid rgba(255,255,255,0.05); + padding: 0; + margin: 20px 0 0; + list-style: none; + border-top: 1px solid rgba(255, 255, 255, 0.05); } .side_summary li { - padding: 5px 0 3px 0; - border-bottom: 1px solid rgba(255,255,255,0.05); + padding: 5px 0 3px 0; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); } .side_summary li:after { - clear: both; - display: block; - content: ''; + clear: both; + display: block; + content: ''; } .side_summary .stats_info { - float: left; - line-height: normal; + float: left; + line-height: normal; } .side_summary .stats_info h4 { - margin: 0; - font-size: 16px; - color: #fff; - opacity: 0.7; + margin: 0; + font-size: 16px; + color: #fff; + opacity: 0.7; } .side_summary span { - font-size: 11px; - line-height: normal; - text-transform: uppercase; - font-size: 10px; - opacity: 0.6; + font-size: 11px; + line-height: normal; + text-transform: uppercase; + font-size: 10px; + opacity: 0.6; } .side_summary .icon { - float: left; - margin: 5px 20px 5px 10px; - opacity: 0.8; + float: left; + margin: 5px 20px 5px 10px; + opacity: 0.8; } .pageheader { - padding: 15px; - border-bottom: 1px solid #d3d7db; - border-top: 1px solid #eee; - background: #f7f7f7; - position: relative; + padding: 15px; + border-bottom: 1px solid #d3d7db; + border-top: 1px solid #eee; + background: #f7f7f7; + position: relative; } .pageheader h2 { @@ -831,7 +849,7 @@ h1 a:hover, h2 a:hover, h3 a:hover { letter-spacing: -0.5px; margin: 0; max-width: 450px; - white-space:nowrap; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } @@ -868,30 +886,30 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .pageheader .fa-map-marker { - padding: 6px 12px; + padding: 6px 12px; } .pageheader .fa-dollar { - padding: 6px 12px; + padding: 6px 12px; } .pageheader .fa-clock-o { - padding: 6px 8px; + padding: 6px 8px; } .pageheader h2 span { - font-size: 13px; - text-transform: none; - color: #999; - font-style: italic; - vertical-align: middle; - letter-spacing: 0; + font-size: 13px; + text-transform: none; + color: #999; + font-style: italic; + vertical-align: middle; + letter-spacing: 0; } .pageheader h2 span::before { - content: '/'; - margin: 0 10px 0 5px; - color: #ccc; + content: '/'; + margin: 0 10px 0 5px; + color: #ccc; } .pageheader .ant-wrapper { @@ -902,35 +920,40 @@ h1 a:hover, h2 a:hover, h3 a:hover { max-height: 55px; font-size: 12px !important; line-height: 16px !important; - overflow-x: auto; - border: 1px solid #EEEEEE; - padding: 3px 10px 3px 10px; - text-align: justify; + overflow-x: auto; + border: 1px solid #EEEEEE; + padding: 3px 10px 3px 10px; + text-align: justify; } /* custom ant view */ -.ant_window ul > li{ +.ant_window ul > li { font-size: 12px !important; line-height: 16px !important; - text-align: justify; + text-align: justify; } + .ant_window .dropdown-menu-head .title { padding: 10px; } + .ant_window .dropdown-menu { top: 40px; } + .ant_window .dropdown-menu li { padding: 5px; } + .ant_window .dropdown-menu-head ul { padding: 0 5px; } + /* end: custom ant view */ .headermenu .ant-menu-head { - padding: 0; - min-width: 400px; + padding: 0; + min-width: 400px; } .pageheader .breadcrumb-wrapper { @@ -938,7 +961,7 @@ h1 a:hover, h2 a:hover, h3 a:hover { top: 23px; right: 25px; max-width: 400px; - white-space:nowrap; + white-space: nowrap; overflow: hidden; } @@ -965,8 +988,8 @@ h1 a:hover, h2 a:hover, h3 a:hover { } .contentpanel { - padding: 10px; - position: relative; + padding: 10px; + position: relative; } .contentpanel::after { @@ -976,7 +999,7 @@ h1 a:hover, h2 a:hover, h3 a:hover { } form .form-group:last-child { - margin-bottom: 0; + margin-bottom: 0; } .row-pad-5 { @@ -1014,33 +1037,40 @@ p { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); } + .content-nav > li { display: inline-block; padding: 8px 6px; border-right: 1px solid #eee; font-size: 12px; } + .content-nav > li:last-child { border-right: none; } + .content-nav > li a.disabled { opacity: 0.5; cursor: default; } + .content-nav > li a.disabled:hover { text-decoration: none; } + .content-nav > li i { font-size: 18px; margin-right: 5px; } + .content-nav .btn-group { margin: 0; } + .content-nav .form-inline .form-group { margin-right: 2px; } @@ -1051,8 +1081,9 @@ p { widows: 450; margin: auto; } + .tooltipflot { - background-color: rgba(0,0,0,0.75); + background-color: rgba(0, 0, 0, 0.75); font-size: 11px; color: #fff; padding: 3px 10px; @@ -1060,8 +1091,9 @@ p { -webkit-border-radius: 2px; border-radius: 2px; } -.jqstooltip{ - min-height: 25px; + +.jqstooltip { + min-height: 25px; border: 0; min-width: 30px; height: auto !important; @@ -1079,20 +1111,24 @@ p { } /* resource library */ -.reslibrary_block{ +.reslibrary_block { width: 150px; } + .reslibrary .thumbnail { - margin-bottom : 0px; + margin-bottom: 0px; } + .reslibrary .thumbnail .html { width: 100px; height: 100px; } + .reslibrary .thumbnail img { max-width: 100px; max-height: 100px; } + .reslibrary .thumbnail .resource_add { } @@ -1108,280 +1144,321 @@ p { } .reslibrary-options { - list-style: none; - margin: 0; - padding: 0; - margin-bottom: 15px; - background: #fcfcfc; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); + list-style: none; + margin: 0; + padding: 0; + margin-bottom: 15px; + background: #fcfcfc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); } + .reslibrary-options > li { - display: inline-block; - padding: 12px 15px; - border-right: 1px solid #eee; - font-size: 12px; - color: #666; + display: inline-block; + padding: 12px 15px; + border-right: 1px solid #eee; + font-size: 12px; + color: #666; } + .reslibrary-options.edit-resource { text-align: center; } + .reslibrary-options.edit-resource > li { border: none; padding: 12px 12px; } + .reslibrary-options > li a { - color: #666; + color: #666; } + .reslibrary-options > li a.disabled { - opacity: 0.5; - cursor: default; + opacity: 0.5; + cursor: default; } + .reslibrary-options > li a.disabled:hover { - text-decoration: none; + text-decoration: none; } + .reslibrary-options > li i { - font-size: 14px; - color: #444; + font-size: 14px; + color: #444; } + .reslibrary-options > li .fa-stack { height: 1.1em; width: 1.1em; line-height: 1.1em; } + .reslibrary-options > li i.fa-stack-2x { - font-size: 1.2em; + font-size: 1.2em; } + .reslibrary-options .btn-primary i { - color: #fff !important; + color: #fff !important; } .reslibrary-options .ckbox label { - margin: 0 !important; + margin: 0 !important; } .reslibrary-options .filter-type { - float: right; - border-right: 0; - border-left: 1px solid #eee; + float: right; + border-right: 0; + border-left: 1px solid #eee; } .reslibrary-options .filter-type a { - display: inline-block; - margin-right: 10px; + display: inline-block; + margin-right: 10px; } .reslibrary-options .filter-type a:last-child { - margin-right: 0; + margin-right: 0; } .reslibrary-options .filter-type a:first-child { - margin-left: 10px; + margin-left: 10px; } .reslibrary-options .filter-type a.active { - text-decoration: underline; - color: #2A6496; + text-decoration: underline; + color: #2A6496; } .reslibrary .thmb { - border: 1px solid #fcfcfc; - background: #fcfcfc; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - padding: 6px; - margin-bottom: 10px; - position: relative; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); + border: 1px solid #fcfcfc; + background: #fcfcfc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + padding: 6px; + margin-bottom: 10px; + position: relative; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); } + .reslibrary .thmb .img-responsive { display: block; margin-left: auto; margin-right: auto; } + .reslibrary .thmb.checked { - border-color: #ccc; + border-color: #ccc; } + .reslibrary .thmb.view_details { - border: solid 1px #F19013 !important; + border: solid 1px #F19013 !important; } + .reslibrary .thmb.view_details:before { - content: "\f00c"; + content: "\f00c"; font-family: FontAwesome; color: #F19013; font-size: 36px; - position:absolute; + position: absolute; bottom: 15px; right: 15px; } + .reslibrary .thmb::after { - clear: both; - display: block; - content: ''; + clear: both; + display: block; + content: ''; } + .reslibrary .ckbox { - position: absolute; - top: 15px; - left: 15px; - display: none; + position: absolute; + top: 15px; + left: 15px; + display: none; } .reslibrary .rl-group { - position: absolute; - top: 15px; - right: 15px; - display: none; + position: absolute; + top: 15px; + right: 15px; + display: none; } .reslibrary .rl-toggle { - padding: 1px 4px; - line-height: normal; - background: #fff; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; + padding: 1px 4px; + line-height: normal; + background: #fff; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; } .reslibrary .rl-menu { - min-width: 120px; + min-width: 120px; } .reslibrary .rl-menu a { - font-size: 12px; - color: #333; + font-size: 12px; + color: #333; } .reslibrary .rl-menu i { - margin-right: 7px; - color: #999; - width: 16px; - font-size: 13px; + margin-right: 7px; + color: #999; + width: 16px; + font-size: 13px; } .reslibrary .thmb.mapped { - background-color: #d9edf7; - border-color: #bce8f1; - color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; } .reslibrary .thmb-prev { - overflow: hidden; + overflow: hidden; } + .reslibrary .thmb-icon { - background: #eee; + background: #eee; height: 100px; } + .reslibrary .thmb-icon i { font-size: 7em; } .reslibrary .thmb-prev a { - display: block; + display: block; } .reslibrary .rl-title { - margin-bottom: 0; - font-size: 13px; - min-height: 15px; + margin-bottom: 0; + font-size: 13px; + min-height: 15px; } -.reslibrary .rl-title a, .reslibrary .ellipsis{ - overflow: hidden; - text-overflow: ellipsis; - display: block; + +.reslibrary .rl-title a, .reslibrary .ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: block; } .rl_pagination .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 8px; } + .rl_pagination .input-group { font-size: 12px; } + .rl_pagination li.disabled a { font-weight: bold; text-decoration: underline; } -#rl_dynamic_container{ +#rl_dynamic_container { border-left: 1px solid #e5e5e5; height: 660px; } + #rl_container .nav-tabs, #rl_edit_container .nav-tabs, #rl_add_container > .nav-tabs { background: none; -} +} + .rl-content .edit_resource_form { min-height: 360px; } + .rl-content .edit_resource_form .form-group { margin-bottom: 2px; } -.rl-content .edit_resource_form img{ + +.rl-content .edit_resource_form img { max-height: 90px; width: auto; } + #rl_edit_container .ellipsis { max-width: 260px; - white-space:nowrap; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + .maped_resources .ellipsis { max-width: 170px !important; } + #resource_types_tabs { overflow: auto; white-space: nowrap; -ms-overflow-style: -ms-autohiding-scrollbar; } + #rl_container .reslibrary { min-height: 380px; } -#choose_resource_type{ + +#choose_resource_type { margin: 0; margin-top: 20px; } -#choose_resource_type .fileupload-buttonbar .statusbar{ + +#choose_resource_type .fileupload-buttonbar .statusbar { font-size: 11px; } -#choose_resource_type .fileupload-buttonbar .btn{ + +#choose_resource_type .fileupload-buttonbar .btn { margin-top: 30% !important; color: #064770; } -#choose_resource_type .fileupload-buttonbar > div{ + +#choose_resource_type .fileupload-buttonbar > div { height: 200px; } -#choose_resource_type .fileupload-buttonbar .statusbar{ + +#choose_resource_type .fileupload-buttonbar .statusbar { height: 30px; } -#choose_resource_type .fileupload-buttonbar>div a.btn{ + +#choose_resource_type .fileupload-buttonbar > div a.btn { margin-top: 30% !important; } -#add_form{ + +#add_form { margin-top: 40px; } -#add_form, #code_subform, #add_resource_buttons{ + +#add_form, #code_subform, #add_resource_buttons { display: none; } -.rl-content .fileupload_drag_area{ + +.rl-content .fileupload_drag_area { height: 505px; padding: 5% 7%; overflow: auto; border: 1px dashed #e5e5e5; background-color: #f7f7f7; } -.rl-content .fileupload_drag_area .fileupload-buttonbar label{ + +.rl-content .fileupload_drag_area .fileupload-buttonbar label { margin-top: 1%; } -.rl-content .fileupload_drag_area .statusbar{ + +.rl-content .fileupload_drag_area .statusbar { text-align: left; } -.edit_resource_form .fileupload_drag_area{ + +.edit_resource_form .fileupload_drag_area { height: 140px; padding: 3px 0 0 0; margin-top: 5px; @@ -1389,570 +1466,576 @@ p { border: 1px dashed #e5e5e5; background-color: #f7f7f7; } + .edit_resource_form label { font-size: 13px; margin-bottom: 1px !important; } + .resource_details { border: 1px solid #e5e5e5; font-size: 11px; padding: 2px 5px 2px 10px; } + .resource_details label { margin-bottom: 0; } + .resource_details .row { margin-bottom: 2px; line-height: 15px; } + .resource_details .rl_details { - font-size: 10px; - height: 20px; - width: 130px; - border: medium none; + font-size: 10px; + height: 20px; + width: 130px; + border: medium none; } + .reslibrary-options .confirm_popover.dropdown-menu { bottom: auto; } -.confirm_popover.dropdown-menu{ - z-index: 2001; +.confirm_popover.dropdown-menu { + z-index: 2001; } .thumbnail .rl_large_icon { height: 114px; } + .thumbnail .rl_large_icon i { text-align: center; font-size: 7em; } -a.resource_edit .img-responsive{ +a.resource_edit .img-responsive { max-height: 100px; } /* locked screen */ .lockedpanel { - width: 320px; - margin: 10% auto 0 auto; - padding-bottom: 100px; - min-height: 500px; - text-align: center; + width: 320px; + margin: 10% auto 0 auto; + padding-bottom: 100px; + min-height: 500px; + text-align: center; } .lockedpanel .loginuser { - text-align: center; + text-align: center; } .lockedpanel .loginuser img { - -moz-border-radius: 100px; - -webkit-border-radius: 100px; - border-radius: 100px; - background: rgba(255,255,255,0.4); - padding: 5px; + -moz-border-radius: 100px; + -webkit-border-radius: 100px; + border-radius: 100px; + background: rgba(255, 255, 255, 0.4); + padding: 5px; } .lockedpanel .locked { - font-size: 42px; - margin-bottom: 20px; + font-size: 42px; + margin-bottom: 20px; } .lockedpanel .logged { - margin-top: 20px; + margin-top: 20px; } .lockedpanel .logged h4 { - margin: 0; - font-size: 21px; - color: #333; + margin: 0; + font-size: 21px; + color: #333; } .lockedpanel form { - margin-top: 20px; + margin-top: 20px; } .lockedpanel form .btn { - display: block; - margin-top: 10px; + display: block; + margin-top: 10px; } /* sign in */ .signinpanel { - width: 780px; - margin: 10% auto 0 auto; + width: 780px; + margin: 10% auto 0 auto; } .signinpanel .logopanel { - float: none; - width: auto; - padding: 0; - background: none; + float: none; + width: auto; + padding: 0; + background: none; } .signinpanel .signin-info ul { - list-style: none; - padding: 0; - margin: 20px 0; + list-style: none; + padding: 0; + margin: 20px 0; } .signinpanel .signin-info a { - color: #333; + color: #333; } .signinpanel .form-control { - display: block; - margin-top: 15px; + display: block; + margin-top: 15px; } .signinpanel .uname { - background: #fff url(../image/user.png) no-repeat 95% center; + background: #fff url(../image/user.png) no-repeat 95% center; } .signinpanel .pword { - background: #fff url(../image/locked.png) no-repeat 95% center; + background: #fff url(../image/locked.png) no-repeat 95% center; } .signinpanel .btn { - margin-top: 15px; + margin-top: 15px; } .signinpanel form { - background: rgba(255,255,255,0.2); - border: 1px solid #ccc; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - padding: 30px; + background: rgba(255, 255, 255, 0.2); + border: 1px solid #ccc; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + padding: 30px; } .signinpanel form a { - color: #666; + color: #666; } /* sign up */ .signuppanel { - margin: 5% auto 0 auto; - width: 780px; + margin: 5% auto 0 auto; + width: 780px; } .signuppanel .row { - margin-left: -5px; - margin-right: -5px; + margin-left: -5px; + margin-right: -5px; } .signuppanel .logopanel { - float: none; - width: auto; - padding: 0; - background: none; + float: none; + width: auto; + padding: 0; + background: none; } .signuppanel .col-sm-6, .signuppanel .col-sm-5, .signuppanel .col-sm-3, .signuppanel .col-sm-4 { - padding-left: 5px; - padding-right: 5px; + padding-left: 5px; + padding-right: 5px; } .signuppanel .signup-info { - padding-right: 20px; + padding-right: 20px; } .signuppanel form { - background: rgba(255,255,255,0.2); - border: 1px solid #ccc; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - padding: 30px; + background: rgba(255, 255, 255, 0.2); + border: 1px solid #ccc; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + padding: 30px; } .feat-list { - margin-top: 20px; + margin-top: 20px; } .feat-list .fa { - font-size: 20px; - border: 2px solid #636e7b; - padding: 4px 5px; - -moz-border-radius: 100px; - -webkit-border-radius: 100px; - border-radius: 100px; - float: left; + font-size: 20px; + border: 2px solid #636e7b; + padding: 4px 5px; + -moz-border-radius: 100px; + -webkit-border-radius: 100px; + border-radius: 100px; + float: left; } .feat-list h4 { - margin-left: 45px; - padding-top: 3px; + margin-left: 45px; + padding-top: 3px; } .feat-list p { - margin-left: 45px; + margin-left: 45px; } .signup-footer { - border-top: 1px solid #ddd; - margin-top: 30px; - padding-top: 10px; - font-size: 12px; + border-top: 1px solid #ddd; + margin-top: 30px; + padding-top: 10px; + font-size: 12px; } - /***** LEFT PANEL COLLAPSE *****/ /*******************************/ - .leftpanel-collapsed .logopanel { - display: none; + display: none; } .leftpanel-collapsed .sticky_left { - display: none; + display: none; } .leftpanel-collapsed .headerbar { - margin-left: -50px; + margin-left: -50px; } .leftpanel-collapsed .leftpanel { - width: 50px; - top: 50px; + width: 50px; + top: 50px; } .leftpanel-collapsed .leftpanelinner { - padding: 0; + padding: 0; } .leftpanel-collapsed .leftpanelinner .sidebartitle { - display: none; + display: none; } .leftpanel-collapsed .nav-bracket { - margin: 5px; + margin: 5px; } .leftpanel-collapsed .nav-bracket li a { - text-align: center; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - padding: 10px; - position: relative; + text-align: center; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding: 10px; + position: relative; } .leftpanel-collapsed .nav-bracket > li > a:hover { - border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; } .leftpanel-collapsed .nav-bracket > li.nav-parent > a { - background-image: none; + background-image: none; } /* Show first level menues in collapse state*/ .leftpanel-collapsed .nav-bracket > li > a > span:last-child { - position: absolute; - background: #fff; - padding: 10px 10px 10px 5px; - left: 40px; - top: 0; - min-width: 209px; - text-align: left; - z-index: 100; - display: none; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -moz-border-radius: 0 2px 2px 0; - -webkit-border-radius: 0 2px 2px 0; - border-radius: 0 2px 2px 0; + position: absolute; + background: #fff; + padding: 10px 10px 10px 5px; + left: 40px; + top: 0; + min-width: 209px; + text-align: left; + z-index: 100; + display: none; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -moz-border-radius: 0 2px 2px 0; + -webkit-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; } .leftpanel-collapsed .nav-bracket > li > a .badge { - display: none; + display: none; } .leftpanel-collapsed .nav-bracket > li.active > a > span:last-child { - -moz-border-radius: 0 2px 0 0; - -webkit-border-radius: 0 2px 0 0; - border-radius: 0 2px 0 0; + -moz-border-radius: 0 2px 0 0; + -webkit-border-radius: 0 2px 0 0; + border-radius: 0 2px 0 0; } .leftpanel-collapsed .nav-bracket ul { - display: none; + display: none; } .leftpanel-collapsed .nav-bracket > li.nav-hover > a { - background: #fff; - color: #064770; + background: #fff; + color: #064770; } .leftpanel-collapsed .nav-bracket > li.nav-hover.active > a { - background: #F19013; - color: #fff; + background: #F19013; + color: #fff; } .leftpanel-collapsed .nav-bracket > li.nav-hover > a > span:last-child { - display: block; + display: block; } .leftpanel-collapsed .nav-bracket > li.nav-hover.active > a > span:last-child { - background: #F19013; - color: #fff; + background: #F19013; + color: #fff; } .leftpanel-collapsed .nav-bracket li.nav-hover ul.child1 { - display: block; - position: absolute; - top: 41px; - left: 45px; - margin: 0; - min-width: 204px; - background: #064770; - z-index: 100; - -moz-border-radius: 0 0 2px 0; - -webkit-border-radius: 0 0 2px 0; - border-radius: 0 0 2px 0; + display: block; + position: absolute; + top: 41px; + left: 45px; + margin: 0; + min-width: 204px; + background: #064770; + z-index: 100; + -moz-border-radius: 0 0 2px 0; + -webkit-border-radius: 0 0 2px 0; + border-radius: 0 0 2px 0; } .leftpanel-collapsed .nav-bracket ul a { - text-align: left; - padding: 6px 10px; - padding-left: 0; + text-align: left; + padding: 6px 10px; + padding-left: 0; } .leftpanel-collapsed .nav-bracket ul a:hover { - background: none; + background: none; } .leftpanel-collapsed .nav-bracket li a i { - margin-right: 0; + margin-right: 0; } .leftpanel-collapsed .mainpanel { - margin-left: 50px; + margin-left: 50px; } .leftpanel-collapsed .side_summary { - display: none; + display: none; } .leftpanel-collapsed .sticky-leftpanel { - overflow-y: visible; + overflow-y: visible; } .leftpanel-collapsed .nav-bracket .children { - display: none; + display: none; } /* Show second level menues in collapse state*/ .leftpanel-collapsed .nav-bracket .child1 > li.nav-parent.nav-hover > a > span:last-child { - position: absolute; - background: #fff; - padding: 5px 10px 5px 5px; - top: 0; - min-width: 349px; - text-align: left; - z-index: 100; - -moz-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -webkit-box-shadow: 0 3px 0 rgba(12,12,12,0.03); - box-shadow: 0 3px 0 rgba(12,12,12,0.03); - -moz-border-radius: 0 2px 2px 0; - -webkit-border-radius: 0 2px 2px 0; - border-radius: 0 2px 2px 0; + position: absolute; + background: #fff; + padding: 5px 10px 5px 5px; + top: 0; + min-width: 349px; + text-align: left; + z-index: 100; + -moz-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -webkit-box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + box-shadow: 0 3px 0 rgba(12, 12, 12, 0.03); + -moz-border-radius: 0 2px 2px 0; + -webkit-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; } .leftpanel-collapsed .nav-bracket .child1 > li.nav-parent.nav-hover > a { - background: #fff; - color: #064770; + background: #fff; + color: #064770; } .leftpanel-collapsed .nav-bracket .child1 > li.nav-hover.active > a { - background: #F19013; - color: #fff; + background: #F19013; + color: #fff; } .leftpanel-collapsed .nav-bracket .child1 > li.nav-hover.active > a > span:last-child { - background: #F19013; - color: #fff; + background: #F19013; + color: #fff; } -.leftpanel-collapsed .nav-bracket .child1 > li.nav-hover ul.child2{ - display: block; - position: absolute; - left: 154px; - margin: 0; - min-width: 204px; - background: #064770; - z-index: 100; - -moz-border-radius: 0 0 2px 0; - -webkit-border-radius: 0 0 2px 0; - border-radius: 0 0 2px 0; - padding: 5px; +.leftpanel-collapsed .nav-bracket .child1 > li.nav-hover ul.child2 { + display: block; + position: absolute; + left: 154px; + margin: 0; + min-width: 204px; + background: #064770; + z-index: 100; + -moz-border-radius: 0 0 2px 0; + -webkit-border-radius: 0 0 2px 0; + border-radius: 0 0 2px 0; + padding: 5px; } - /***** Right Panel *****/ .stats-view { - margin-right: 240px; + margin-right: 240px; } .stats-view .rightpanel { - display: block; - right: 0; + display: block; + right: 0; } .stats-relative-view { - right: 240px; + right: 240px; } .stats-relative-view .rightpanel { - display: block; - right: 0; + display: block; + right: 0; } .rightpanel, .rightpanel label { - color: #999; + color: #999; } .rightpanel .nav-tabs { - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - background: #131d29; - position: fixed; - width: 240px; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + background: #131d29; + position: fixed; + width: 240px; } .rightpanel .nav-tabs > li { - display: table-cell; - width: 1%; + display: table-cell; + width: 1%; } .rightpanel .nav-tabs > li > a { - padding: 15px 20px 16px 20px; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - color: rgba(255,255,255,0.5); + padding: 15px 20px 16px 20px; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + color: rgba(255, 255, 255, 0.5); } .rightpanel .nav-tabs > .active > a, .rightpanel .nav-tabs > .active > a:hover, .rightpanel .nav-tabs > .active > a:focus { - background: #064770; - color: #fff; + background: #064770; + color: #fff; } -.rightpanel a{ +.rightpanel a { color: #fff; } .rightpanel .tab-content { - background: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; - margin-top: 65px; - padding: 15px; + background: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + margin-top: 65px; + padding: 15px; } .latestuserlist { - list-style: none; - padding: 0; - border-bottom: 1px dotted rgba(255,255,255,0.05); + list-style: none; + padding: 0; + border-bottom: 1px dotted rgba(255, 255, 255, 0.05); } .latestuserlist li { - border-top: 1px dotted rgba(255,255,255,0.05); + border-top: 1px dotted rgba(255, 255, 255, 0.05); } .latestuserlist .media-thumb { - -moz-border-radius: 50px; - -webkit-border-radius: 50px; - border-radius: 50px; - border: 2px solid #999; - padding: 3px; - display: block; + -moz-border-radius: 50px; + -webkit-border-radius: 50px; + border-radius: 50px; + border: 2px solid #999; + padding: 3px; + display: block; } .latestuserlist .media { - margin: 10px 0; - padding: 0; + margin: 10px 0; + padding: 0; } .latestuserlist .approved .media-thumb { - border-color: #F19013; + border-color: #F19013; } .latestuserlist .media-object { - width: 30px; - -moz-border-radius: 50px; - -webkit-border-radius: 50px; - border-radius: 50px; + width: 30px; + -moz-border-radius: 50px; + -webkit-border-radius: 50px; + border-radius: 50px; } .latestuserlist .media-body { - line-height: normal; - padding-top: 7px; - padding-left: 5px; + line-height: normal; + padding-top: 7px; + padding-left: 5px; } .latestuserlist .media-body small { - color: #999; - display: block; + color: #999; + display: block; } .latestuserlist .media-body strong { - color: #bbb; - font-size: 13px; - margin-bottom: 4px; - display: block; + color: #bbb; + font-size: 13px; + margin-bottom: 4px; + display: block; } .latestuserlist .badge { - margin-top: 5px; + margin-top: 5px; } .rightpanel .pane-settings { - font-size: 13px; + font-size: 13px; } -.status_test, .status_test a{ - position:relative; +.status_test, .status_test a { + position: relative; } + .status_test:before { content: ' '; position: absolute; display: block; - width: 98%; - height: 98%; - background: transparent url(../image/icon-gears.png); + width: 98%; + height: 98%; + background: transparent url(../image/icon-gears.png); filter: alpha(opacity=5); -moz-opacity: 0.05; -khtml-opacity: 0.05; opacity: 0.05; } -.status_off, .status_off a{ - position:relative; +.status_off, .status_off a { + position: relative; } + .status_off:before { content: ' '; position: absolute; display: block; - width: 98%; - height: 98%; - background: transparent url(../image/icon-ban.png); + width: 98%; + height: 98%; + background: transparent url(../image/icon-ban.png); filter: alpha(opacity=5); -moz-opacity: 0.05; -khtml-opacity: 0.05; @@ -1962,77 +2045,77 @@ a.resource_edit .img-responsive{ /***** header *****/ .headerbar .logopanel { - float: left; - width: 240px; - border-right: 1px solid #eee; + float: left; + width: 240px; + border-right: 1px solid #eee; } .headerbar .topnav { - float: left; - margin: 0; + float: left; + margin: 0; } .headerbar .topnav > ul { - padding: 0; - margin: 0; - float: left; + padding: 0; + margin: 0; + float: left; } .headerbar .topnav > ul > li { - margin: 0; - float: left; + margin: 0; + float: left; } .headerbar .topnav > ul > li > a { - padding: 15px 15px 12px 15px; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; - text-transform: uppercase; - font-size: 12px; - color: #666; - font-family: sans-serif; + padding: 15px 15px 12px 15px; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + text-transform: uppercase; + font-size: 12px; + color: #666; + font-family: sans-serif; } .headerbar .topnav > ul > li > a:hover, .headerbar .topnav > ul > li > a:focus, .headerbar .topnav > ul > li.open > a, .headerbar .topnav > ul > li.active > a { - box-shadow: 0 3px 0 #F19013; - color: #F19013; - background: none; + box-shadow: 0 3px 0 #F19013; + color: #F19013; + background: none; } .headerbar .topnav > ul > li > a i { - margin-right: 5px; + margin-right: 5px; } .headerbar .topnav > ul > li > a .badge { - margin-left: 10px; + margin-left: 10px; } .headerbar .topnav > ul > li .dropdown-menu { - margin-top: 2px; - -moz-border-radius: 0 0 3px 3px; - -webkit-border-radius: 0 0 3px 3px; - border-radius: 0 0 3px 3px; + margin-top: 2px; + -moz-border-radius: 0 0 3px 3px; + -webkit-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; } .headerbar .topnav > ul > li .dropdown-menu > li > a { - padding: 6px 10px; - font-size: 13px; + padding: 6px 10px; + font-size: 13px; } .headerbar .topnav > ul > li .dropdown-menu > li > a:hover { - background: #F19013; - color: #FFFFFF; + background: #F19013; + color: #FFFFFF; } .headerbar .topnav > ul > li .dropdown-menu i { - display: none; + display: none; } -#footer{ +#footer { padding: 10px 20px 10px 20px; font-size: 10px; line-height: 15px; @@ -2051,6 +2134,7 @@ a.resource_edit .img-responsive{ #footer .help_links a { padding: 0 5px 0 5px; } + .leftpanel-collapsed #footer { padding-left: 50px } @@ -2067,7 +2151,7 @@ a.resource_edit .img-responsive{ overflow: hidden } -.debug_alert{ +.debug_alert { z-index: 100; width: 800px; position: absolute; @@ -2078,170 +2162,168 @@ a.resource_edit .img-responsive{ /***** Fixed *****/ .fixed { - background: #c9cccf; + background: #c9cccf; } .fixed section { - margin: auto; - max-width: 1050px; - position: relative; - background: #064770; + margin: auto; + max-width: 1050px; + position: relative; + background: #064770; } .fixed .rightpanel { - background: #064770; + background: #064770; } .fixed-noleft .leftpanel { - display: none; + display: none; } .fixed-noleft .mainpanel { - margin-left: 0; + margin-left: 0; } .fixed-noleft.stats-view .headerbar { - margin-left: 0; + margin-left: 0; } .fixed-noleft.stats-view .logopanel { - display: block; + display: block; } .fixed-noleft .menutoggle { - display: none; + display: none; } - /***** Modals *****/ .bs-example-modal-panel .modal-content { - background: none; + background: none; } .modal-photo-viewer { - margin-top: 0; - margin-bottom: 0; - top: 50%; - left: 50%; - width: auto; - position: absolute; + margin-top: 0; + margin-bottom: 0; + top: 50%; + left: 50%; + width: auto; + position: absolute; } .modal-photo-viewer .modal-content { - position: relative; - width: 900px; - height: 600px; - margin-left: -50%; - margin-top: -300px; + position: relative; + width: 900px; + height: 600px; + margin-left: -50%; + margin-top: -300px; } .modal-photo-viewer .modal-photo-left, .modal-photo-viewer .modal-photo-right { - padding: 0; + padding: 0; } .modal-photo-viewer .modal-photo-left { - background: #000; + background: #000; } .modal-photo-viewer .modal-photo { - top: 50%; - position: relative; + top: 50%; + position: relative; } .modal-photo-viewer .row { - margin-left: 0; - margin-right: 0; + margin-left: 0; + margin-right: 0; } .modal-photo-viewer .img-responsive { - max-height: 600px; - margin: auto; + max-height: 600px; + margin: auto; } .media-details { - padding: 20px; + padding: 20px; } .media-details .categ { - font-size: 11px; + font-size: 11px; } .media-details .media-title { - margin: 0; - margin-bottom: 10px; - color: #333; - font-size: 20px; + margin: 0; + margin-bottom: 10px; + color: #333; + font-size: 20px; } .media-details p { - font-size: 13px; + font-size: 13px; } .media-details .details { - margin-top: 20px; + margin-top: 20px; } .media-details .details h4 { - font-size: 12px; - color: #333; - text-transform: uppercase; + font-size: 12px; + color: #333; + text-transform: uppercase; } .media-details .table { - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; } .media-details .table tr td { - padding: 3px 0; - font-size: 13px; + padding: 3px 0; + font-size: 13px; } - /* DROPDOWN */ .dropdown-menu-head { - background: #fff + background: #fff } .dropdown-menu-head .title { - background: #064770; - color: #EEEEEE; - padding: 15px; + background: #064770; + color: #EEEEEE; + padding: 15px; text-transform: uppercase; font-size: 11px; margin: 0; } + .dropdown-menu-head .title a { - float: right; + float: right; color: #eeeeee; } - /* Icon */ .tp-icon { - padding: 10px 20px; - line-height: 20px; - border-color: #ddd; - position: relative; + padding: 10px 20px; + line-height: 20px; + border-color: #ddd; + position: relative; } .tp-icon .badge { - position: absolute; - font-size: 10px; - font-weight: normal; - right: 4px; - top: 10px; - line-height: 13px; - background-color: #D9534F; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - padding: 2px 5px; -} + position: absolute; + font-size: 10px; + font-weight: normal; + right: 4px; + top: 10px; + line-height: 13px; + background-color: #D9534F; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding: 2px 5px; +} /* Stick Header */ .sticky_header { @@ -2251,6 +2333,7 @@ a.resource_edit .img-responsive{ cursor: pointer; z-index: 1000; } + .sticky_left { position: absolute; top: 55px; @@ -2258,652 +2341,721 @@ a.resource_edit .img-responsive{ cursor: pointer; color: #fff; } + body.stickyheader .sticky_left { top: 5px; } + .sticky-leftpanel .sticky_left { top: 55px !important; } + .panel_frozen { color: #F19013; } + .stickyheader .logopanel { - position: fixed; - top: 0; - left: 0; - width: 240px; - z-index: 100; + position: fixed; + top: 0; + left: 0; + width: 240px; + z-index: 100; } + .stickyheader .leftpanel { - top: 50px; + top: 50px; } + .stickyheader .sticky-leftpanel { - top: 0; + top: 0; } + .stickyheader .sticky-leftpanel .leftpanelinner { - margin-top: 55px; + margin-top: 55px; } + .stickyheader .headerbar { - position: fixed; - top: 0; - left: 240px; - width: 100%; - z-index: 100; - box-shadow: 0 1px rgba(0,0,0,0.05); + position: fixed; + top: 0; + left: 240px; + width: 100%; + z-index: 100; + box-shadow: 0 1px rgba(0, 0, 0, 0.05); } + .stickyheader .mainpanel { - padding-top: 50px; + padding-top: 50px; } + .stickyheader .header-right { - margin-right: 240px; + margin-right: 240px; } + .stickyheader.leftpanel-collapsed .headerbar { - left: 50px; + left: 50px; } + .stickyheader.leftpanel-collapsed .header-right { - margin-right: 0; + margin-right: 0; } + .stickyheader.stats-view .headerbar { - right: 240px; - width: auto; + right: 240px; + width: auto; } /* Other styles */ -#summary th, #summary td{ +#summary th, #summary td { border: none; } + .summary_label { - font-weight: bold; - text-align: left; - color: #333; + font-weight: bold; + text-align: left; + color: #333; font-size: 13px; } + .summary_value { font-size: 13px; color: #636e7b; } .panel-body .shortcut img { - -moz-border-radius: 100px; - -webkit-border-radius: 100px; - border-radius: 100px; - background: rgba(255,255,255,0.4); - padding: 5px; - border: 3px solid #EEEEEE; + -moz-border-radius: 100px; + -webkit-border-radius: 100px; + border-radius: 100px; + background: rgba(255, 255, 255, 0.4); + padding: 5px; + border: 3px solid #EEEEEE; } .mb0 { margin-bottom: 0; } + .mb5 { margin-bottom: 5px; } + .mb10 { margin-bottom: 10px; } + .mb15 { - margin-bottom: 15px; + margin-bottom: 15px; } + .mb20 { margin-bottom: 20px; } + .mb30 { margin-bottom: 30px; } + .mb40 { - margin-bottom: 40px; + margin-bottom: 40px; } + .mr5 { margin-right: 5px; } + .ml10 { margin-left: 10px; } + .ml20 { margin-left: 20px; } + .ml30 { margin-left: 30px; } + .mr10 { margin-right: 10px; } + .mr20 { margin-right: 20px; } + .mr30 { margin-right: 30px; } + .mt5 { margin-top: 5px; } + .mt10 { margin-top: 10px; } -.center{ - text-align: center; + +.center { + text-align: center; } + .nomargin { margin: 0; } + .border-right-0 { - border-right: 0; + border-right: 0; } + .border-left-0 { - border-left: 0; + border-left: 0; } + .nopadding { padding: 0 !important; } + .padding-top-0 { padding-top: 0; } + .padding5 { padding: 5px; } + .padding10 { padding: 10px; } + .serif { font-family: 'Georgia, serif'; } + .italic { font-style: italic; } + .dark { color: #333; } + .width100p { width: 100%; } + .width20 { width: 20px; } + .width30 { width: 30px; } + .inblock { - display: inline-block; + display: inline-block; } + .transparent { -moz-opacity: 0.2; -khtml-opacity: 0.2; opacity: 0.2; } + .widthM300 { max-width: 300px; } + .widthM400 { max-width: 400px; } + .ellipsis { - overflow-x: hidden; - white-space: nowrap; - text-overflow: ellipsis; + overflow-x: hidden; + white-space: nowrap; + text-overflow: ellipsis; } + .error-log { - width:100%; - height:100%; - min-height:400px; - max-height:700px; + width: 100%; + height: 100%; + min-height: 400px; + max-height: 700px; overflow: scroll; - padding:10px; + padding: 10px; } /***** Bootstrap Overrides *****/ .panel-body { padding: 10px; } + .btn-primary { - background-color: #064770; + background-color: #064770; } + .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { - border-radius: 3px; - font-size: 12px; - height: 25px; - line-height: 1.3; - padding: 3px 5px; + border-radius: 3px; + font-size: 12px; + height: 25px; + line-height: 1.3; + padding: 3px 5px; } + .btn-default:hover, .btn-default:focus, .btn-default:active, .open .dropdown-toggle.btn-default { - background-color: #EBEBEB; - border-color: #ADADAD; - color: #333333; + background-color: #EBEBEB; + border-color: #ADADAD; + color: #333333; } + .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .open .dropdown-toggle.btn-primary { - background-color: #F19013; - border-color: #285E8E; - color: #FFFFFF; + background-color: #F19013; + border-color: #285E8E; + color: #FFFFFF; } + .btn-toggle.btn_switch { min-width: 100px; } + .btn-toggle.btn_switch.xs { min-width: inherit; } + .btn-toggle.btn_switch .btn-default:hover, .btn-toggle.btn_switch .btn-default:hover { background-color: #fff; } + .btn-off { - background-color: #EBEBEB !important; - border-color: #ADADAD !important; - color: #333333 !important; + background-color: #EBEBEB !important; + border-color: #ADADAD !important; + color: #333333 !important; + margin-left: -4px !important; } -.dl-horizontal.product-options-list-sm dt{ +.dl-horizontal.product-options-list-sm dt { width: 120px; } -.dl-horizontal.product-options-list-sm dd{ + +.dl-horizontal.product-options-list-sm dd { margin-left: 130px; } .grid-dropdown { - padding-left: 5px; + padding-left: 5px; } -.grid-dropdown li{ - padding: 5px; + +.grid-dropdown li { + padding: 5px; } -.grid-dropdown li a{ + +.grid-dropdown li a { display: block; width: 100%; color: #333 !important; } -.grid-dropdown li a:hover{ - color: #5894fb !important; + +.grid-dropdown li a:hover { + color: #5894fb !important; } -.panel .table > tbody > tr > td, + +.panel .table > tbody > tr > td, .panel .table > tbody > tr > th { vertical-align: middle; } + .import-table > thead td { - text-align: center; + text-align: center; } + .import-table > tbody td { - text-align: center; + text-align: center; } + .import-table td > div, .import-table td .form-group { - max-width: 300px; - margin: auto; + max-width: 300px; + margin: auto; } + .import-table td .input-group { - width: 100%; - margin: auto; + width: 100%; + margin: auto; } + .import-table td .form-group.field_updater { - width: 30px; + width: 30px; } - /***** Retina Resolution Logo *****/ -@media all and (min-device-pixel-ratio : 2) { +@media all and (min-device-pixel-ratio: 2) { .logo_image { - display: block; - -moz-box-sizing: border-box; - box-sizing: border-box; - background: url(../image/logo@2x.png) no-repeat; + display: block; + -moz-box-sizing: border-box; + box-sizing: border-box; + background: url(../image/logo@2x.png) no-repeat; } } + /***** Media queries section *****/ @media screen and (max-width: 1024px) { - body { - position: relative; - } - - .leftpanel { - display: none; - } - - .mainpanel { - margin-left: 0; - width: 100%; - } - - .leftpanel-collapsed .leftpanel { - display: none; - } - - .leftpanel-collapsed .mainpanel { - margin-left: 0; - } - - .leftpanel-collapsed .headerbar { - margin-left: 0; - } - - .leftpanel-show section { - overflow-x: hidden; - } - - .leftpanel-show .leftpanel { - display: block; - } - - .leftpanel-show .mainpanel { - margin-left: 240px; - } - - .stickyheader .headerbar { - left: 0; - } - - .stickyheader.leftpanel-show .headerbar { - left: 240px; - } - - .stickyheader.stats-relative-view .headerbar { - right: 240px; - left: auto; - } - - .stickyheader .header-right { - margin-right: 0; - } - - .leftpanelinner { - padding: 5px 10px; - } - - .leftpanelinner #searchform input { - background: #131b26; - border: 0; - } - - .nav-horizontal { - position: relative; - } - - .fixed-noleft .menutoggle { - display: block; - } - - .fixed-noleft .headerbar .logopanel { - display: none; - } - - .fixed-noleft .header-left, - .fixed-noleft .topnav { - float: none; - } - - .modal-dialog.modal-lg { - width: 99%; - } + body { + position: relative; + } + + .leftpanel { + display: none; + } + + .mainpanel { + margin-left: 0; + width: 100%; + } + + .leftpanel-collapsed .leftpanel { + display: none; + } + + .leftpanel-collapsed .mainpanel { + margin-left: 0; + } + + .leftpanel-collapsed .headerbar { + margin-left: 0; + } + + .leftpanel-show section { + overflow-x: hidden; + } + + .leftpanel-show .leftpanel { + display: block; + } + + .leftpanel-show .mainpanel { + margin-left: 240px; + } + + .stickyheader .headerbar { + left: 0; + } + + .stickyheader.leftpanel-show .headerbar { + left: 240px; + } + + .stickyheader.stats-relative-view .headerbar { + right: 240px; + left: auto; + } + + .stickyheader .header-right { + margin-right: 0; + } + + .leftpanelinner { + padding: 5px 10px; + } + + .leftpanelinner #searchform input { + background: #131b26; + border: 0; + } + + .nav-horizontal { + position: relative; + } + + .fixed-noleft .menutoggle { + display: block; + } + + .fixed-noleft .headerbar .logopanel { + display: none; + } + + .fixed-noleft .header-left, + .fixed-noleft .topnav { + float: none; + } + + .modal-dialog.modal-lg { + width: 99%; + } } @media screen and (max-width: 767px) { - /* Horizontal Scroll for grid */ + /* Horizontal Scroll for grid */ .panel-body { - overflow : scroll; - white-space:nowrap; - } - - #searchform { - position: relative; - } - - .headermenu li:nth-child(4) { - /* display: none; */ - } - - .leftpanel #searchform, - .leftpanel .userlogged { - display: block; - } - - .breadcrumb-wrapper { - display: none; - } - - .ant-wrapper { - display: none; - } - - .headermenu .dropdown-menu:after { - display: none; - } - - .rightpanel .nav-tabs.nav-justified > li > a, - .rightpanel .nav-justified > li > a { - margin-bottom: 0; - } - - .panel-email .col-sm-3 { - display: none; - } - - .modal-dialog.modal-lg { - width: 99%; - } + overflow: scroll; + white-space: nowrap; + } + + #searchform { + position: relative; + } + + .headermenu li:nth-child(4) { + /* display: none; */ + } + + .leftpanel #searchform, + .leftpanel .userlogged { + display: block; + } + + .breadcrumb-wrapper { + display: none; + } + + .ant-wrapper { + display: none; + } + + .headermenu .dropdown-menu:after { + display: none; + } + + .rightpanel .nav-tabs.nav-justified > li > a, + .rightpanel .nav-justified > li > a { + margin-bottom: 0; + } + + .panel-email .col-sm-3 { + display: none; + } + + .modal-dialog.modal-lg { + width: 99%; + } } @media screen and (max-width: 640px) { - .leftpanel-show .mainpanel { - margin-left: 50px; - } - - .notfoundpanel { - width: auto; - padding: 0 20px; - } - - .notfoundpanel h1 { - font-size: 72px; - line-height: 72px; - } - - .notfoundpanel h3 { - font-size: 14px; - line-height: normal; - } - - .notfound h4 { - font-size: 12px; - line-height: 18px; - } - - .notfoundpanel form { - width: auto; - } - - .notfoundpanel .form-control { - float: none; - width: 100%; - } - - .notfoundpanel .btn { - margin-top: 10px; - width: 100%; - } - - .signinpanel, - .signuppanel { - margin: 0 auto; - width: 480px; - padding: 20px; - } - - .signinpanel form { - margin-top: 20px; - } - - .signup-footer { - margin-bottom: 10px; - } - - .signuppanel .form-control { - margin-bottom: 10px; - } - - .signup-footer .pull-left, - .signup-footer .pull-right { - float: none !important; - text-align: center; - } - - .widget-quick-status-post .nav-tabs.nav-justified > li { - display: table-cell; - width: 1%; - margin-bottom: -5px; - } - - .widget-quick-status-post .nav-tabs.nav-justified > li a { - margin: 0; - } - - .nav-tabs.nav-justified.nav-profile > li { - float: none; - margin-bottom: 0; - display: table-cell; - width: 1%; - } - - .nav-tabs.nav-justified.nav-profile > li a { - margin: 0; - -moz-border-radius: 3px 3px 0 0; - -webkit-border-radius: 3px 3px 0 0; - border-radius: 3px 3px 0 0; - - } - - .dataTables_info { - float: none !important; - text-align: center; - margin-bottom: 10px; - } - - .dataTables_paginate { - margin-bottom: 10px; - text-align: center !important; - float: none !important; - } - - .paginate_disabled_previous, - .paginate_enabled_previous, - .paginate_disabled_next, - .paginate_enabled_next { - float: none !important; - } - - .dataTables_filter, - .dataTables_length { - float: none !important; - padding: 10px 0 0 10px; - margin: auto !important; - display: inline-block; - } - - .table.dataTable th, - .table.dataTable td { - font-size: 13px; - min-width: 150px; - } - - .paging_full_numbers { - min-width: 500px; - margin: 0 0 10px 10px; - } - - .paging_full_numbers:after { - clear: both; - display: block; - content: ''; - } - - .modal-dialog.modal-lg { - width: 99%; - } + .leftpanel-show .mainpanel { + margin-left: 50px; + } + + .notfoundpanel { + width: auto; + padding: 0 20px; + } + + .notfoundpanel h1 { + font-size: 72px; + line-height: 72px; + } + + .notfoundpanel h3 { + font-size: 14px; + line-height: normal; + } + + .notfound h4 { + font-size: 12px; + line-height: 18px; + } + + .notfoundpanel form { + width: auto; + } + + .notfoundpanel .form-control { + float: none; + width: 100%; + } + + .notfoundpanel .btn { + margin-top: 10px; + width: 100%; + } + + .signinpanel, + .signuppanel { + margin: 0 auto; + width: 480px; + padding: 20px; + } + + .signinpanel form { + margin-top: 20px; + } + + .signup-footer { + margin-bottom: 10px; + } + + .signuppanel .form-control { + margin-bottom: 10px; + } + + .signup-footer .pull-left, + .signup-footer .pull-right { + float: none !important; + text-align: center; + } + + .widget-quick-status-post .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + margin-bottom: -5px; + } + + .widget-quick-status-post .nav-tabs.nav-justified > li a { + margin: 0; + } + + .nav-tabs.nav-justified.nav-profile > li { + float: none; + margin-bottom: 0; + display: table-cell; + width: 1%; + } + + .nav-tabs.nav-justified.nav-profile > li a { + margin: 0; + -moz-border-radius: 3px 3px 0 0; + -webkit-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + + } + + .dataTables_info { + float: none !important; + text-align: center; + margin-bottom: 10px; + } + + .dataTables_paginate { + margin-bottom: 10px; + text-align: center !important; + float: none !important; + } + + .paginate_disabled_previous, + .paginate_enabled_previous, + .paginate_disabled_next, + .paginate_enabled_next { + float: none !important; + } + + .dataTables_filter, + .dataTables_length { + float: none !important; + padding: 10px 0 0 10px; + margin: auto !important; + display: inline-block; + } + + .table.dataTable th, + .table.dataTable td { + font-size: 13px; + min-width: 150px; + } + + .paging_full_numbers { + min-width: 500px; + margin: 0 0 10px 10px; + } + + .paging_full_numbers:after { + clear: both; + display: block; + content: ''; + } + + .modal-dialog.modal-lg { + width: 99%; + } } @media screen and (max-width: 480px) { - - .signinpanel, - .signuppanel { - width: 360px; - } - #footer{ + .signinpanel, + .signuppanel { + width: 360px; + } + + #footer { padding-left: 20px; } - - .panel-email .pull-right { - float: none !important; - } - - .pageheader h2 { - font-size: 18px; - } - - .pageheader .glyphicon, - .pageheader .fa { - font-size: 18px; - } - - .pageheader h2 span { - font-size: 11px; - } - - .fc-header td { - display: block !important; - text-align: center; - width: 100%; - border: 1px solid #eee; - padding: 10px !important; - margin-top: -1px; - } - - .fc-button { - padding: 2px 5px !important; - margin: 0 !important; - } - - .fc-header-title h2 { - margin: 0 !important; - } - - .reslibrary-options li { - padding: 5px 7px; - } - - .reslibrary-options .filter-type { - display: block; - float: none; - border-top: 1px solid #eee; - } - - .btn-invoice:before { - display: block; - content: ''; - clear: both; - } - - .btn-invoice .btn { - display: block; - width: 100%; - margin-top: 10px; - } - - .nav-tabs.nav-justified.nav-profile > li a { - font-size: 13px; - padding: 14px 10px; - } - - #bloglist > div { - padding: 0; - margin: 0; - float: none; - width: auto; - } - - .common_content_actions { - padding-top: 20px; - } - - .modal-dialog.modal-lg { - width: 99%; - } - + + .panel-email .pull-right { + float: none !important; + } + + .pageheader h2 { + font-size: 18px; + } + + .pageheader .glyphicon, + .pageheader .fa { + font-size: 18px; + } + + .pageheader h2 span { + font-size: 11px; + } + + .fc-header td { + display: block !important; + text-align: center; + width: 100%; + border: 1px solid #eee; + padding: 10px !important; + margin-top: -1px; + } + + .fc-button { + padding: 2px 5px !important; + margin: 0 !important; + } + + .fc-header-title h2 { + margin: 0 !important; + } + + .reslibrary-options li { + padding: 5px 7px; + } + + .reslibrary-options .filter-type { + display: block; + float: none; + border-top: 1px solid #eee; + } + + .btn-invoice:before { + display: block; + content: ''; + clear: both; + } + + .btn-invoice .btn { + display: block; + width: 100%; + margin-top: 10px; + } + + .nav-tabs.nav-justified.nav-profile > li a { + font-size: 13px; + padding: 14px 10px; + } + + #bloglist > div { + padding: 0; + margin: 0; + float: none; + width: auto; + } + + .common_content_actions { + padding-top: 20px; + } + + .modal-dialog.modal-lg { + width: 99%; + } + } @media screen and (max-width: 360px) { @@ -2912,107 +3064,108 @@ body.stickyheader .sticky_left { width: 250px; } - #footer{ + #footer { padding-left: 20px; } - - .pageheader h2 span { - display: none; - } - - .headermenu li:first-child .dropdown-menu { - margin-right: -130px; - } - - .headermenu li:nth-child(2) .dropdown-menu { - margin-right: -85px; - } - - .headermenu li:nth-child(3) .dropdown-menu { - margin-right: -37px; - } - - .nav-tabs.nav-justified.nav-profile > li { - float: none; - display: block; - width: auto; - } - - .reslibrary-options li { - display: block; - border-top: 1px solid #eee; - } - - .reslibrary-options li:first-child { - border-top: 0; - } - - .authorpanel .media-object { - width: 80px; - margin-right: 10px; - } - - .people-item .media-object { - width: 80px !important; - height: 80px !important; - } - - .pagination { - margin-bottom: 20px; - } - - .common_content_actions { - padding-top: 20px; - } - .modal-dialog.modal-lg { - width: 99%; - } + + .pageheader h2 span { + display: none; + } + + .headermenu li:first-child .dropdown-menu { + margin-right: -130px; + } + + .headermenu li:nth-child(2) .dropdown-menu { + margin-right: -85px; + } + + .headermenu li:nth-child(3) .dropdown-menu { + margin-right: -37px; + } + + .nav-tabs.nav-justified.nav-profile > li { + float: none; + display: block; + width: auto; + } + + .reslibrary-options li { + display: block; + border-top: 1px solid #eee; + } + + .reslibrary-options li:first-child { + border-top: 0; + } + + .authorpanel .media-object { + width: 80px; + margin-right: 10px; + } + + .people-item .media-object { + width: 80px !important; + height: 80px !important; + } + + .pagination { + margin-bottom: 20px; + } + + .common_content_actions { + padding-top: 20px; + } + + .modal-dialog.modal-lg { + width: 99%; + } } @media screen and (max-width: 320px) { - .signinpanel, - .signuppanel { - width: 310px; - } - - .common_content_actions { - padding-top: 20px; - } + .signinpanel, + .signuppanel { + width: 310px; + } + + .common_content_actions { + padding-top: 20px; + } + + .modal-dialog.modal-lg { + width: 99%; + } - .modal-dialog.modal-lg { - width: 99%; - } - } /* debug section */ .debug_info { - text-align: left; - margin: 50px 0 0; - width: 100%; - clear: both; + text-align: left; + margin: 50px 0 0; + width: 100%; + clear: both; } .debug_info td { - border-bottom: 1px solid #aaa; + border-bottom: 1px solid #aaa; } .mysql { - margin-top: 10px; + margin-top: 10px; } .debug_info .even { - background-color: #eeeeee; + background-color: #eeeeee; } .debug_error { - background: #EFEBAA; - color: #FF0000; + background: #EFEBAA; + color: #FF0000; } .debug_warning { - background: #e7ed0e; - color: #030000; + background: #e7ed0e; + color: #030000; } /* Post-it notes */ @@ -3021,121 +3174,121 @@ body.stickyheader .sticky_left { } .postit_notes_box { - font: 11px Tahoma, Arial, Helvetica; - color: #000000; - position: absolute; - top: 0; - right: 0; + font: 11px Tahoma, Arial, Helvetica; + color: #000000; + position: absolute; + top: 0; + right: 0; } .postit_notes_box_parent { - font: 11px Tahoma, Arial, Helvetica; - color: #000000; - position: absolute; - top: 0px; - left: 5px; + font: 11px Tahoma, Arial, Helvetica; + color: #000000; + position: absolute; + top: 0px; + left: 5px; } #header .postit_notes_box_parent { - top: -5px; + top: -5px; } .postit_icon { - background: url(../image/icons/icon_note.png) 50% 50% no-repeat; - width: 20px; - height: 16px; - display: inline-block; - margin: 10px 6px 0 0; - cursor: pointer; + background: url(../image/icons/icon_note.png) 50% 50% no-repeat; + width: 20px; + height: 16px; + display: inline-block; + margin: 10px 6px 0 0; + cursor: pointer; } .postit_notes { - display: none; - position: absolute; - z-index: 99; - top: 0; - margin: 8px 0 0 25px; - border: 1px solid #000; - background: #d6df2f; - padding: 6px 8px; + display: none; + position: absolute; + z-index: 99; + top: 0; + margin: 8px 0 0 25px; + border: 1px solid #000; + background: #d6df2f; + padding: 6px 8px; } .postit_notes ul { - list-style: none; - margin: 0; - padding: 0; - display: block; - overflow: hidden; + list-style: none; + margin: 0; + padding: 0; + display: block; + overflow: hidden; } .postit_notes ul li { - margin: 4px 0; - display: block; - white-space: nowrap; + margin: 4px 0; + display: block; + white-space: nowrap; } .postit_notes ul ul { - margin-left: 8px; + margin-left: 8px; } .postit_notes a { - text-decoration: none; + text-decoration: none; } .postit_notes a.icon_xpandarrow { - background: url(../image/icons/icon_collapse.png) 100% 50% no-repeat; - padding-right: 12px; - color: #000; - font-weight: bold; + background: url(../image/icons/icon_collapse.png) 100% 50% no-repeat; + padding-right: 12px; + color: #000; + font-weight: bold; } .postit_notes a.icon_xpandarrow:hover { - text-decoration: underline; + text-decoration: underline; } .postit_notes a.icon_xpandarrow.expand { - background: url(../image/icons/icon_expand.png) 100% 50% no-repeat; + background: url(../image/icons/icon_expand.png) 100% 50% no-repeat; } .postit_notes.show { - display: block; + display: block; } .postit_notes .collapse { - height: 0; + height: 0; } .postit_notes .expand { - height: auto; + height: auto; } .postit_close { - position: absolute; - right: 8px; + position: absolute; + right: 8px; } .postit_close .icon_close { - display: inline-block; - background: url(../image/icons/close_icon.gif) no-repeat; - width: 11px; - height: 11px; + display: inline-block; + background: url(../image/icons/close_icon.gif) no-repeat; + width: 11px; + height: 11px; } /* product option default value radio button*/ -.optionRow .radio label{ +.optionRow .radio label { margin: 0; padding: 0; display: block; } -.optionRow .radio input{ + +.optionRow .radio input { margin: 0; padding: 0; display: block; } - /* styles for embed code management*/ -.embed_preview{ +.embed_preview { background-color: #fff; border-color: #ddd; border-radius: 4px 4px 0 0; @@ -3149,17 +3302,16 @@ body.stickyheader .sticky_left { height: 400px; } - .embed-code::after { color: #959595; - content: "html"; - font-size: 12px; - font-weight: 700; - left: 15px; - letter-spacing: 1px; - position: absolute; - text-transform: uppercase; - top: 15px; + content: "html"; + font-size: 12px; + font-weight: 700; + left: 15px; + letter-spacing: 1px; + position: absolute; + text-transform: uppercase; + top: 15px; } .embed-code { @@ -3175,20 +3327,20 @@ body.stickyheader .sticky_left { position: relative; } - #code_options .acheckboxgroup { +#code_options .acheckboxgroup { height: 157px !important; margin-bottom: 10px; } -#code_options div.aform div.scrollbox{ +#code_options div.aform div.scrollbox { width: 100%; } -#code_options .checkbox_element div.form-inline{ +#code_options .checkbox_element div.form-inline { width: 100% !important; } -#code_options .scrollbox .acheckbox input, #code_options .scrollbox div.acheckbox{ +#code_options .scrollbox .acheckbox input, #code_options .scrollbox div.acheckbox { width: auto !important; } @@ -3196,228 +3348,262 @@ body.stickyheader .sticky_left { border: 1px solid #e1e1e8; border: 1px solid #e1e1e8; - border-radius: 0 4px; - display: block; - font-size: 12px; - padding: 5px 8px; - position: absolute; - right: -1px; - top: -1px; - z-index: 10; + border-radius: 0 4px; + display: block; + font-size: 12px; + padding: 5px 8px; + position: absolute; + right: -1px; + top: -1px; + z-index: 10; } .template_thumbnail.default { - background-color: #e4eef7; - border: 1px solid #064770; + background-color: #e4eef7; + border: 1px solid #064770; } + .template_thumbnail { - background-color: #fff; - border: 1px solid #ddd; - display: block; - line-height: 1.42857; - margin-bottom: 10px; - transition: all 0.2s ease-in-out 0s; + background-color: #fff; + border: 1px solid #ddd; + display: block; + line-height: 1.42857; + margin-bottom: 10px; + transition: all 0.2s ease-in-out 0s; } + .template_thumbnail .img-responsive { - display:inline; + display: inline; max-height: 250px; } /*TextEditor RL button label style*/ .text-editor { - padding: 3px; - margin-bottom: 0px; + padding: 3px; + margin-bottom: 0px; } -.text-editor .nav.nav-tabs{ - display: inline-block; - margin-bottom: -10px; + +.text-editor .nav.nav-tabs { + display: inline-block; + margin-bottom: -10px; } -.text-editor .tab-content{ - display: block; + +.text-editor .tab-content { + display: block; } + .text-editor .toolbar { - text-align: center; + text-align: center; } -.text-editor .toolbar .btn-group .btn-xs { + +.text-editor .toolbar .btn-group .btn-xs { padding: 1px 5px; font-size: 11px; } -.text-editor .tab-content .tab-pane{ - height: 330px; + +.text-editor .tab-content .tab-pane { + height: 330px; } -.text-editor .visual_editor{ - height: 250px; + +.text-editor .visual_editor { + height: 250px; } .zennable { - position: absolute; - width: 100%; + position: absolute; + width: 100%; } + .zennable textarea { - background-color: #fff; - border: 0; - border-radius: 3px; - box-sizing: border-box; - -moz-box-sizing: border-box; - color: #333; - display: block; - font-size: 12px; - height: 310px; - padding: 3px 5px; - width: 100%; + background-color: #fff; + border: 0; + border-radius: 3px; + box-sizing: border-box; + -moz-box-sizing: border-box; + color: #333; + display: block; + font-size: 12px; + height: 310px; + padding: 3px 5px; + width: 100%; } + .zennable textarea:focus { - background-color: #fff; + background-color: #fff; } + .zennable .toolbar { - background-color: #f6f6f6; + background-color: #f6f6f6; } -.zennable .toolbar .btn-group{ - overflow: auto; - white-space: nowrap; - -ms-overflow-style: -ms-autohiding-scrollbar; - width: 100%; + +.zennable .toolbar .btn-group { + overflow: auto; + white-space: nowrap; + -ms-overflow-style: -ms-autohiding-scrollbar; + width: 100%; } + .zennable .toolbar .btn-group > .btn { float: none; } .zennable.expanded { - position: relative; + position: relative; } + .zennable.expanded .zen-backdrop .expander { - display: none; + display: none; } + .zennable.expanded .zen-backdrop .shrinker { - display: block; - position: absolute; - top: 0; + display: block; + position: absolute; + top: 0; } + .zennable.expanded .zen-backdrop textarea { - height: 100%; - font-size: 14px; - padding: 5px; - background-color: white; - margin: 0 auto; - border: 0; - resize: none; - border-radius: 0; - outline: none; - z-index: 2000; - margin-top: 30px; + height: 100%; + font-size: 14px; + padding: 5px; + background-color: white; + margin: 0 auto; + border: 0; + resize: none; + border-radius: 0; + outline: none; + z-index: 2000; + margin-top: 30px; } + .zennable.expanded .zen-backdrop { - position: fixed; - top: 0; - right: 0; - left: 0; - bottom: 0; - background-color: white; - z-index: 2000; + position: fixed; + top: 0; + right: 0; + left: 0; + bottom: 0; + background-color: white; + z-index: 2000; } + .zennable.expanded .toolbar { - position: fixed; - top: 0; - right: 0; - width: 100%; - height: 30px; - letter-spacing: 1px; - font-weight: 500; - font-size: 12px; - z-index: 20000; - background-color: #f6f6f6; - padding: 5px 0 5px 0; -} -.zennable.expanded .toolbar .btn-group .btn-xs { + position: fixed; + top: 0; + right: 0; + width: 100%; + height: 30px; + letter-spacing: 1px; + font-weight: 500; + font-size: 12px; + z-index: 20000; + background-color: #f6f6f6; + padding: 5px 0 5px 0; +} + +.zennable.expanded .toolbar .btn-group .btn-xs { padding: 1px 8px; font-size: 12px; } + /*mce fix*/ .mce-container .mce-btn button { - font-size: 11px; - padding: 1px 3px; + font-size: 11px; + padding: 1px 3px; } -#task_modal .modal-body div{ - font-size: 14px; - line-height: 21px; +#task_modal .modal-body div { + font-size: 14px; + line-height: 21px; } -#task_modal .modal-body .progress-info{ - padding: 10px 20px 5px 10px; +#task_modal .modal-body .progress-info { + padding: 10px 20px 5px 10px; } -#task_modal .modal-body div.progress, #task_modal .modal-body div.progress-bar{ - height: 31px; - padding: 0; + +#task_modal .modal-body div.progress, #task_modal .modal-body div.progress-bar { + height: 31px; + padding: 0; } -#task_modal .modal-body .panel-footer{ - padding: 0; - margin: 0; + +#task_modal .modal-body .panel-footer { + padding: 0; + margin: 0; } -#task_modal .modal-body div.progress-bar{ - margin: 0; - padding: 5px; + +#task_modal .modal-body div.progress-bar { + margin: 0; + padding: 5px; } -#task_modal .modal-body div.task_result_message{ - max-height: 450px; - padding-top: 20px; + +#task_modal .modal-body div.task_result_message { + max-height: 450px; + padding-top: 20px; } -#task_modal .modal-body div.task_result_message div{ - margin-top: 2px; - padding: 5px; + +#task_modal .modal-body div.task_result_message div { + margin-top: 2px; + padding: 5px; } + #task_modal .modal-body a.details-button { - text-decoration: none; + text-decoration: none; } + #task_modal .modal-body a.details-button:after { - font-family: FontAwesome; - content: "\f066"; - font-size: 20px; - font-weight: 400; - position: relative; + font-family: FontAwesome; + content: "\f066"; + font-size: 20px; + font-weight: 400; + position: relative; } + #task_modal .modal-body a.details-button.collapsed:after { - font-family: FontAwesome; - content: "\f065"; + font-family: FontAwesome; + content: "\f065"; } -.input-group-cell{ - float: left; - display: table; - white-space: nowrap; +.input-group-cell { + float: left; + display: table; + white-space: nowrap; } /* phone input css*/ -.intl-tel-input .country-list{ +.intl-tel-input .country-list { z-index: 4 !important; } -#getEmbedFrm{ - display: table-row-group; +#getEmbedFrm { + display: table-row-group; } -#getEmbedFrm .control-label{ - padding-top: 2px; +#getEmbedFrm .control-label { + padding-top: 2px; } -img.extension-summary-icon{ +img.extension-summary-icon { width: 57px; } -.stars{ +.stars { cursor: default; } -.fa-star, .fa-star-o{ + +.fa-star, .fa-star-o { margin-right: 2px; } -.fa-star::before, .fa-star-o::before{ + +.fa-star::before, .fa-star-o::before { color: gold; } -.ext_store span.review{ +.ext_store span.review { white-space: nowrap; } -.primary_content_actions .btn-group{ +.primary_content_actions .btn-group { margin-bottom: 3px; } + +td[aria-describedby="extension_grid_name"]{ + white-space: normal !important; +} \ No newline at end of file diff --git a/public_html/admin/view/default/template/form/switch.tpl b/public_html/admin/view/default/template/form/switch.tpl index 83e936a633..7763a1eb49 100644 --- a/public_html/admin/view/default/template/form/switch.tpl +++ b/public_html/admin/view/default/template/form/switch.tpl @@ -1,19 +1,21 @@
> - - - - - - - + + + + + + + + +
+ name="" + id="" + value="" + data-orgvalue="" + class="aswitcher " + /> diff --git a/public_html/admin/view/default/template/pages/catalog/product_form.tpl b/public_html/admin/view/default/template/pages/catalog/product_form.tpl index 6ef257fb15..843a4fc137 100755 --- a/public_html/admin/view/default/template/pages/catalog/product_form.tpl +++ b/public_html/admin/view/default/template/pages/catalog/product_form.tpl @@ -1,4 +1,4 @@ - + @@ -7,91 +7,106 @@
- -
- - - -
- + +
+ + + +
+ - -
- - - -
- + +
+ + + +
+
- +
- +
- - $fields) { ?> - - $field) { ?> - style, 'large-field')) ) { - $widthcasses = "col-sm-7"; - } else if ( is_int(stripos($field->style, 'medium-field')) || is_int(stripos($field->style, 'date')) ) { - $widthcasses = "col-sm-5"; - } else if ( is_int(stripos($field->style, 'small-field')) || is_int(stripos($field->style, 'btn_switch')) ) { - $widthcasses = "col-sm-3"; - } else if ( is_int(stripos($field->style, 'tiny-field')) ) { - $widthcasses = "col-sm-2"; - } - $widthcasses .= " col-xs-12"; - ?> -
"> - -
- - - - - - -
- - - -
- - - + + $fields) { ?> + + $field) { ?> + style, 'large-field'))) { + $widthcasses = "col-sm-7"; + } else { + if (is_int(stripos($field->style, 'medium-field')) + || is_int(stripos($field->style, 'date')) + ) { + $widthcasses = "col-sm-5"; + } else { + if (is_int(stripos($field->style, 'small-field')) + || is_int(stripos($field->style, 'btn_switch')) + ) { + $widthcasses = "col-sm-3"; + } else { + if (is_int(stripos($field->style, 'tiny-field')) + ) { + $widthcasses = "col-sm-2"; + } + } + } + } + $widthcasses .= " col-xs-12"; + ?> +
"> + +
+ + + + + + +
+ + + +
+ + +
- + - + \ No newline at end of file diff --git a/public_html/admin/view/default/template/pages/catalog/product_options.tpl b/public_html/admin/view/default/template/pages/catalog/product_options.tpl index c16b967cf5..9134be2e1d 100755 --- a/public_html/admin/view/default/template/pages/catalog/product_options.tpl +++ b/public_html/admin/view/default/template/pages/catalog/product_options.tpl @@ -105,16 +105,16 @@ echo $this->html->buildElement( var setRLparams = function (attr_val_id) { urls = { - resource_library: '&object_id=' + attr_val_id, - resources: '&object_id=' + attr_val_id, - resource_single: '&object_id=' + attr_val_id, - map: '&object_id=' + attr_val_id, - unmap: '&object_id=' + attr_val_id, - del: '&object_id=' + attr_val_id, - download: '&object_id=' + attr_val_id, - upload: '&object_id=' + attr_val_id, - resource: '' - }; + resource_library: '&object_id=' + attr_val_id, + resources: '&object_id=' + attr_val_id, + resource_single: '&object_id=' + attr_val_id, + map: '&object_id=' + attr_val_id, + unmap: '&object_id=' + attr_val_id, + del: '&object_id=' + attr_val_id, + download: '&object_id=' + attr_val_id, + upload: '&object_id=' + attr_val_id, + resource: '' + }; urls.attr_val_id = attr_val_id; } @@ -136,33 +136,35 @@ jQuery(function ($) { $(document).on('change', '#new_option_form_attribute_id', function () { var current_opt_attr_id = $(this).val(); - if ( current_opt_attr_id != 'new' ) { + if ( current_opt_attr_id !== 'new' ) { $("#option_name_block").hide(); } else { $("#option_name_block").show(); - $("#option_name_reset").show(); + $("#option_name_reset").show(); } }); $("#product_form").submit(function () { - - if ($("#new_option_form_attribute_id").val() == 'new' && ( $("#new_option_form_option_name").val() == '' || $("#new_option_form_element_type").val() == '' )) { - if ($("#new_option_form_option_name").val() == '') { + + if ($("#new_option_form_attribute_id").val() === 'new' + && ( $("#new_option_form_option_name").val() === '' || $("#new_option_form_element_type").val() === '' ) + ){ + if ($("#new_option_form_option_name").val() === '') { $("#new_option_form_option_name").focus(); $("#new_option_form_option_name").closest("span").next().next().show(); } else { $("#new_option_form_option_name").closest("span").next().next().hide(); } - if ($("#new_option_form_element_type").val() == '') { + if ($("#new_option_form_element_type").val() === '') { $("#new_option_form_element_type").focus(); $("#new_option_form_element_type").closest("span").next().next().show(); } else { $("#new_option_form_element_type").closest("span").next().next().hide(); } return false; - } else if( $("#new_option_form_attribute_id").val() != 'new' ) { + } else if( $("#new_option_form_attribute_id").val() !== 'new' ) { $("#new_option_form_option_name").val(''); $("#new_option_form_element_type").val(''); } @@ -287,24 +289,27 @@ jQuery(function ($) { $(new_row).attr('id', 'new' + row_id); //find next sort order number - var so = $('#option_values_tbl').find("input[name^='sort_order']"); + var so = $('#option_values_tbl>tbody>tr').find("input[name^='sort_order']"); if (so.length > 0) { var highest = 0; so.each(function () { highest = Math.max(highest, Number(this.value)); }); - $(new_row).find("input[name^='sort_order']").val(highest + 1); + new_row.find("input[name^='sort_order']").val(highest + 1); } else { - $(new_row).find("input[name^='sort_order']").val(0); + new_row.find("input[name^='sort_order']").val(0); } - if($('#option_values_tbl tbody').length){ + //console.log(new_row.html); return false; + if($('#option_values_tbl>tbody').length){ //add one more row - $('#option_values_tbl tbody tr:last-child').after(new_row); + $('#option_values_tbl>tbody>tr:last-child').after(new_row); } else { //we insert first row - $('#option_values_tbl tr:last-child').after(new_row); + $('#option_values_tbl>thead').after(''); + $('#option_values_tbl>tbody').append(new_row); } + bindAform($("input, textarea, select", new_row)); //Mark rows to be new $('#new' + row_id + ' input[name=default_value]').last() @@ -370,7 +375,7 @@ jQuery(function ($) { return false; }); - //save option values + //save option values $(document).on('click','#option_values button[type="submit"]', function () { //Mark rows to be deleted $('#option_values_tbl .toDelete input[name^=product_option_value_id]').val('delete'); diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl index ad68d7c6d4..eb2bb5d488 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl @@ -5,7 +5,7 @@
-
+
diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl index d868063183..f45fc19dc4 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl @@ -5,7 +5,7 @@
-
+
diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl index ed5168bd83..668e2af065 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl @@ -5,7 +5,7 @@
-
+
diff --git a/public_html/admin/view/default/template/responses/product/option_value_row.tpl b/public_html/admin/view/default/template/responses/product/option_value_row.tpl index d6cc195965..52a57a7b83 100755 --- a/public_html/admin/view/default/template/responses/product/option_value_row.tpl +++ b/public_html/admin/view/default/template/responses/product/option_value_row.tpl @@ -51,15 +51,24 @@
+ +
+ +
+
+
+
- - -
'.$this->html->buildElement( array( - 'type' => 'textarea', - 'id' => 'option_textarea_value', - 'name' => 'option_textarea_value', - 'value' => $form['fields']['option_value']->value, - 'style' => 'col-sm-12', - 'attr' => 'row="10"' + 'type' => 'textarea', + 'id' => 'option_textarea_value', + 'name' => 'option_textarea_value', + 'value' => $form['fields']['option_value']->value, + 'style' => 'col-sm-12', + 'attr' => 'row="10"' )).'
diff --git a/public_html/admin/view/default/template/responses/product/product_form.tpl b/public_html/admin/view/default/template/responses/product/product_form.tpl index 531144884e..6b49692ee3 100755 --- a/public_html/admin/view/default/template/responses/product/product_form.tpl +++ b/public_html/admin/view/default/template/responses/product/product_form.tpl @@ -77,7 +77,7 @@ dataType: 'json', data: data, success: function (data) { - if (data.total) { + if (data && data.total) { $('#orderProductFrm_product0price').val(data.price); $('#orderProductFrm_product0total').val(data.total); } diff --git a/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl b/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl new file mode 100755 index 0000000000..95cf8ac6ee --- /dev/null +++ b/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl @@ -0,0 +1,122 @@ + + + + + + + + + + + $location) { ?> + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/public_html/core/engine/extensions.php b/public_html/core/engine/extensions.php index 21a1d0b37a..ccadcb5da3 100755 --- a/public_html/core/engine/extensions.php +++ b/public_html/core/engine/extensions.php @@ -1303,7 +1303,7 @@ public function validateResources() continue; } foreach ($checked_resources as $section => $section_resources) { - $conflict = array_intersect($resources[$section], $section_resources); + $conflict = array_intersect((array)$resources[$section], (array)$section_resources); if (!empty($conflict)) { $conflict_resources[$checked_name][$resource_type][$section] = $conflict; } diff --git a/public_html/core/engine/form.php b/public_html/core/engine/form.php index c26397f433..074a5a329b 100755 --- a/public_html/core/engine/form.php +++ b/public_html/core/engine/form.php @@ -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')) { - header('Location: static_pages/'); -} /** * Load form data, render output @@ -630,7 +627,7 @@ public function validateFormData($data = array()) foreach ($this->fields as $field) { // for multivalue required fields if (in_array($field['element_type'], HtmlElementFactory::getMultivalueElements()) - && !sizeof($data[$field['field_name']]) + && !$data[$field['field_name']] && $field['required'] == 'Y' ) { $errors[$field['field_name']] = $field['name'].' '.$this->language->get('text_field_required'); diff --git a/public_html/core/engine/html.php b/public_html/core/engine/html.php index 9e183ff595..135d255ddb 100755 --- a/public_html/core/engine/html.php +++ b/public_html/core/engine/html.php @@ -998,7 +998,7 @@ protected function _validate_options() $this->disabled_options = (array)$this->disabled_options; //check case when all options are disabled $all_disabled = true; - foreach ($this->options as $id => $text) { + foreach ((array)$this->options as $id => $text) { if (!in_array($id, $this->disabled_options)) { $all_disabled = false; break; diff --git a/public_html/core/engine/resources.php b/public_html/core/engine/resources.php index fb7240b32a..6f9da10b70 100755 --- a/public_html/core/engine/resources.php +++ b/public_html/core/engine/resources.php @@ -604,7 +604,7 @@ public function getResourceAllObjects($object_name, $object_id, $sizes = array(' 'url' => $http_path.'image/'.$result['resource_path'], 'width' => $sizes['main']['width'], 'height' => $sizes['main']['height'], - 'attr' => 'alt="'.$rsrc_info['title'].'"', + 'attr' => 'alt="'.addslashes($rsrc_info['title']).'"', )), 'thumb_url' => $thumb_url, 'thumb_width' => $sizes['thumb']['width'], @@ -613,7 +613,7 @@ public function getResourceAllObjects($object_name, $object_id, $sizes = array(' 'url' => $thumb_url, 'width' => $sizes['thumb']['width'], 'height' => $sizes['thumb']['height'], - 'attr' => 'alt="'.$rsrc_info['title'].'"', + 'attr' => 'alt="'.addslashes($rsrc_info['title']).'"', )), ); if ($sizes['thumb2']) { @@ -624,7 +624,7 @@ public function getResourceAllObjects($object_name, $object_id, $sizes = array(' 'url' => $thumb2_url, 'width' => $sizes['thumb2']['width'], 'height' => $sizes['thumb2']['height'], - 'attr' => 'alt="'.$rsrc_info['title'].'"', + 'attr' => 'alt="'.addslashes($rsrc_info['title']).'"', )); } $resources[$k]['description'] = $rsrc_info['description']; @@ -638,6 +638,10 @@ public function getResourceAllObjects($object_name, $object_id, $sizes = array(' 'description' => $rsrc_info['description'], ); } + + if($limit && count($resources) == $limit){ + break; + } } if ($limit == 1) { @@ -816,7 +820,7 @@ public function getMainThumbList($object_name, $object_ids = array(), $width = 0 'url' => $thumb_url, 'width' => $width, 'height' => $height, - 'attr' => 'alt="'.$row['title'].'"', + 'attr' => 'alt="'.addslashes($row['title']).'"', )); $output[$object_id]['thumb_url'] = $thumb_url; } @@ -887,4 +891,4 @@ public function getMainImage($object_name, $object_id, $width, $height, $noimage return $output; } -} \ No newline at end of file +} diff --git a/public_html/core/lib/cart.php b/public_html/core/lib/cart.php index b12674227b..75f1a7cbfc 100755 --- a/public_html/core/lib/cart.php +++ b/public_html/core/lib/cart.php @@ -374,7 +374,7 @@ public function buildProductDetails($product_id, $quantity = 0, $options = array $download_data = $this->download->getProductOrderDownloads($product_id); //check if we need to check main product stock. Do only if no stock trackable options selected - if (!$op_stock_trackable + if (!$options && $product_query['subtract'] && $product_query['quantity'] < $quantity && !$product_query['stock_checkout'] diff --git a/public_html/core/lib/listing.php b/public_html/core/lib/listing.php index ea5a26fccf..2ed5a7a2fb 100644 --- a/public_html/core/lib/listing.php +++ b/public_html/core/lib/listing.php @@ -169,22 +169,29 @@ public function __set($key, $value) } /** + * @param int $store_id + * * @return array */ - public function getCustomList() + public function getCustomList($store_id=0) { - if (!$this->custom_block_id) { + $store_id = (int)$store_id; + if (!(int)$this->custom_block_id) { return array(); } + $custom_block_id = (int)$this->custom_block_id; - $cache_key = 'blocks.custom.'.$custom_block_id; + $cache_key = 'blocks.custom.'.$custom_block_id.$store_id; $output = $this->cache->pull($cache_key); + if ($output !== false) { return $output; } + $result = $this->db->query("SELECT * FROM `".$this->db->table('custom_lists')."` WHERE custom_block_id = '".$custom_block_id."' + AND store_id = '".$store_id."' ORDER BY sort_order"); $output = $result->rows; $this->cache->push($cache_key, $output); diff --git a/public_html/core/lib/listing_manager.php b/public_html/core/lib/listing_manager.php index da9de086ba..94e56ea77e 100755 --- a/public_html/core/lib/listing_manager.php +++ b/public_html/core/lib/listing_manager.php @@ -62,16 +62,24 @@ public function __construct($custom_block_id) public function saveCustomListItem($data) { $custom_block_id = (int)$this->custom_block_id; + if(!$custom_block_id){ + return false; + } + $data['store_id'] = (int)$data['store_id']; + if (!isset($data['data_type']) && isset($data['listing_datasource'])) { $listing_properties = $this->getListingDataSources(); $data['data_type'] = $listing_properties[$data['listing_datasource']]['data_type']; } - $result = $this->db->query("SELECT * - FROM ".$this->db->table("custom_lists")." - WHERE custom_block_id = '".$custom_block_id."' - AND id='".$data['id']."' - AND data_type='".$data['data_type']."'"); + $result = $this->db->query( + "SELECT * + FROM ".$this->db->table("custom_lists")." + WHERE custom_block_id = '".$custom_block_id."' + AND id='".(int)$data['id']."' + AND data_type='".$this->db->escape($data['data_type'])."' + AND store_id='".(int)$data['store_id']."'" + ); if ($result->num_rows && $custom_block_id) { $this->db->query("UPDATE ".$this->db->table("custom_lists")." @@ -79,22 +87,25 @@ public function saveCustomListItem($data) ".(!is_null($data['sort_order']) ? ", sort_order = '".(int)$data['sort_order']."'" : "")." WHERE custom_block_id = '".$custom_block_id."' AND id='".$data['id']."' - AND data_type='".$data['data_type']."'"); + AND data_type='".$this->db->escape($data['data_type'])."' + AND store_id='".(int)$data['store_id']."'"); } else { $this->db->query("INSERT INTO ".$this->db->table("custom_lists")." ( custom_block_id, data_type, id, sort_order, + store_id, date_added ) VALUES ('".$custom_block_id."', '".$data['data_type']."', '".(int)$data['id']."', '".( int )$data ['sort_order']."', + '".( int )$data ['store_id']."', NOW())"); } - $this->cache->remove('blocks.custom.'.$custom_block_id); + $this->cache->remove('blocks.custom.'.$custom_block_id.$data ['store_id']); return true; } @@ -121,12 +132,14 @@ public function deleteCustomListItem($data) // delete all custom list of custom listing block - public function deleteCustomListing() + public function deleteCustomListing($store_id) { + $store_id = (int)$store_id; $custom_block_id = (int)$this->custom_block_id; $sql = "DELETE FROM ".$this->db->table("custom_lists")." - WHERE custom_block_id = '".$custom_block_id."'"; + WHERE custom_block_id = '".$custom_block_id."' + AND store_id = '".$store_id."'"; $this->db->query($sql); - $this->cache->remove('blocks.custom.'.$custom_block_id); + $this->cache->remove('blocks.custom.'.$custom_block_id.$store_id); } } \ No newline at end of file diff --git a/public_html/core/lib/request.php b/public_html/core/lib/request.php index da52494588..6d33387385 100755 --- a/public_html/core/lib/request.php +++ b/public_html/core/lib/request.php @@ -222,11 +222,18 @@ public function getVersion() public function getRemoteIP() { - if (!empty($this->server['HTTP_CLIENT_IP'])) { + + if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) + { //if user behind cloudflare proxy + $ip = $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; + }elseif(!empty($this->server['HTTP_CLIENT_IP'])) + { $ip = $this->server['HTTP_CLIENT_IP']; - } elseif (!empty($this->server['HTTP_X_FORWARDED_FOR'])) { + }elseif(!empty($this->server['HTTP_X_FORWARDED_FOR'])) + { $ip = $this->server['HTTP_X_FORWARDED_FOR']; - } else { + }else + { $ip = $this->server['REMOTE_ADDR']; } return $ip; diff --git a/public_html/core/version.php b/public_html/core/version.php index 2ee3cd39a7..02d40fce84 100755 --- a/public_html/core/version.php +++ b/public_html/core/version.php @@ -1,4 +1,4 @@ + + UPGRADE NOTE: + Do not edit or add to this file if you wish to upgrade AbanteCart to newer + versions in the future. If you wish to customize AbanteCart for your + needs please refer to http://www.AbanteCart.com for more information. +------------------------------------------------------------------------------*/ + + +class Extension2Checkout extends Extension +{ + //payment confirmation pending page + public function onControllerPagesCheckoutSuccess_InitData() + { + $that = $this->baseObject; + $order_id = (int)$that->session->data['order_id']; + if (!$order_id || $that->session->data['2checkout_pending_ipn_skip']) { + return null; + } + $that->loadModel('checkout/order'); + $order_info = $that->model_checkout_order->getOrder($order_id); + //do nothing if order confirmed or it's not created with paypal standart + if ((int)$order_info['order_status_id'] != 0 || $order_info['payment_method_key'] != '2checkout') { + return null; + } + //set sign to prevent double redirect (see above) + $that->session->data['2checkout_pending_ipn_skip'] = true; + redirect($that->html->getSecureURL('extension/2checkout/pending_payment')); + } + + //delete sign after success + public function onControllerPagesCheckoutSuccess_UpdateData() + { + unset($this->baseObject->session->data['2checkout_pending_ipn_skip']); + } + +} diff --git a/public_html/extensions/2checkout/main.php b/public_html/extensions/2checkout/main.php index d45c74c9de..50aba9224d 100755 --- a/public_html/extensions/2checkout/main.php +++ b/public_html/extensions/2checkout/main.php @@ -8,7 +8,7 @@ Copyright © 2011-2018 Belavier Commerce LLC This source file is subject to Open Software License (OSL 3.0) - Lincence details is bundled with this package in the file LICENSE.txt. + Licence details is bundled with this package in the file LICENSE.txt. It is also available at this URL: @@ -17,10 +17,7 @@ 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')) { - header('Location: static_pages/'); -} - +require_once(__DIR__.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'hooks.php'); $controllers = array( 'storefront' => array('responses/extension/2checkout'), 'admin' => array(), @@ -43,6 +40,7 @@ $templates = array( 'storefront' => array( 'responses/2checkout.tpl', + 'responses/pending_ipn.tpl' ), 'admin' => array(), ); \ No newline at end of file diff --git a/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php b/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php index 1bced582f0..1262635688 100755 --- a/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php +++ b/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php @@ -88,7 +88,12 @@ public function main() 'name' => $product['name'], 'description' => $product['name'], 'quantity' => $product['quantity'], - 'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value'], false), + 'price' => $this->currency->format( + $product['price'], + $order_info['currency'], + $order_info['value'], + false + ), ); } @@ -115,7 +120,12 @@ public function callback() } $post = $this->request->post; // hash check - if (!md5($post['sale_id'].$this->config->get('2checkout_account').$post['invoice_id'].$this->config->get('2checkout_secret')) == strtolower($post['md5_hash'])) { + if (!md5( + $post['sale_id'] + .$this->config->get('2checkout_account') + .$post['invoice_id'] + .$this->config->get('2checkout_secret')) == strtolower($post['md5_hash']) + ){ exit; } @@ -128,18 +138,68 @@ public function callback() } $this->load->model('extension/2checkout'); if ($post['message_type'] == 'ORDER_CREATED') { - $this->model_checkout_order->confirm((int)$post['vendor_order_id'], $this->config->get('2checkout_order_status_id')); + $this->model_checkout_order->confirm( + (int)$post['vendor_order_id'], + $this->config->get('2checkout_order_status_id') + ); } elseif ($post['message_type'] == 'REFUND_ISSUED') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('failed'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } elseif ($post['message_type'] == 'FRAUD_STATUS_CHANGED' && $post['fraud_status'] == 'pass') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('processing'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } elseif ($post['message_type'] == 'SHIP_STATUS_CHANGED' && $post['ship_status'] == 'shipped') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('complete'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } else { redirect($this->html->getSecureURL('checkout/confirm')); } } + + public function pending_payment() + { + $this->addChild('common/head', 'head', 'common/head.tpl'); + $this->addChild('common/footer', 'footer', 'common/footer.tpl'); + $this->document->setTitle('waiting for payment'); + $this->view->assign('text_message', 'waiting for payment confirmation'); + $this->view->assign('text_redirecting', 'redirecting'); + $this->view->assign('test_url', $this->html->getSecureURL('r/extension/2checkout/is_confirmed')); + $this->view->assign('success_url', $this->html->getSecureURL('checkout/success')); + $this->processTemplate('responses/pending_ipn.tpl'); + } + + public function is_confirmed() + { + $order_id = (int)$this->session->data['order_id']; + if (!$order_id) { + $result = true; + } else { + $this->loadModel('checkout/order'); + $order_info = $this->model_checkout_order->getOrder($order_id); + //do nothing if order confirmed or it's not created with paypal standart + if ((int)$order_info['order_status_id'] != 0 + || $order_info['payment_method_key'] != '2checkout' + ) { + $result = true; + } else { + $result = false; + } + } + + $this->load->library('json'); + $this->response->addJSONHeader(); + $this->response->setOutput(AJson::encode(array('result' => $result))); + } } \ No newline at end of file diff --git a/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl b/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl new file mode 100755 index 0000000000..7a22855b9e --- /dev/null +++ b/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl @@ -0,0 +1,37 @@ + +getHookVar('hk_html_attribute'); ?>> + + +
+
+

+
+
+ + + + \ No newline at end of file diff --git a/public_html/extensions/avatax_integration/core/avatax_integration.php b/public_html/extensions/avatax_integration/core/avatax_integration.php index 3ea3a0068c..3216be9788 100644 --- a/public_html/extensions/avatax_integration/core/avatax_integration.php +++ b/public_html/extensions/avatax_integration/core/avatax_integration.php @@ -882,7 +882,7 @@ public function validate_address($address_data) $customerAddress = $that->model_account_address->getAddress($address_data['address_id']); } - if (strpos($countryISO, $customerAddress['iso_code_2']) >= 0) { + if (is_int(strpos($countryISO, (string)$customerAddress['iso_code_2']))) { // Required Request Parameters $address->setLine1($customerAddress['address_1']); $address->setCity($customerAddress['city']); diff --git a/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php b/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php index f5e68ea2b6..7143386fb3 100644 --- a/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php +++ b/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php @@ -662,13 +662,14 @@ public function insert_block() if ($this->request->post['block_banners']) { $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); foreach ($this->request->post['block_banners'] as $k => $id) { $listing_manager->saveCustomListItem( array( 'data_type' => 'banner_id', 'id' => (int)$id, 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') )); } @@ -792,7 +793,7 @@ public function edit_block() // save list if it is custom if ($this->request->post['block_banners']) { $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['block_banners'] as $id) { $listing_manager->saveCustomListItem( @@ -800,13 +801,14 @@ public function edit_block() 'data_type' => 'banner_id', 'id' => $id, 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') )); $k++; } } else { //delete the list as nothing provided $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); } $this->session->data ['success'] = $this->language->get('text_banner_success'); @@ -876,7 +878,7 @@ private function _getBlockForm() $this->data['banner_group_name'] = $content['banner_group_name']; $lm = new AListingManager($this->request->get ['custom_block_id']); - $list = $lm->getCustomList(); + $list = $lm->getCustomList($this->config->get('config_store_id')); $options_list = array(); if ($list) { diff --git a/public_html/extensions/banner_manager/config.xml b/public_html/extensions/banner_manager/config.xml index a6fe8faa74..89cc85fd34 100644 --- a/public_html/extensions/banner_manager/config.xml +++ b/public_html/extensions/banner_manager/config.xml @@ -1,27 +1,27 @@ - banner_manager - 1.0.1 + banner_manager + 1.0.1 extensions extensions - - 1.2 - - - 10 - - - preview.png - - - - true - - install.sql - install.php + + 1.2 + + + 10 + + + preview.png + + + + true + + install.sql + install.php - uninstall.sql - uninstall.php + uninstall.sql + uninstall.php diff --git a/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml b/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml new file mode 100644 index 0000000000..d8ba6fef07 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml @@ -0,0 +1,183 @@ + + + + default_authorizenet_name + + + + default_authorizenet_note + + + + text_payment + + + + text_success + + + + default_authorizenet_location_id + + + + default_authorizenet_location_id_0 + + + + default_authorizenet_api_login_id + + + + default_authorizenet_test_mode + + + + default_authorizenet_api_transaction_key + + + + default_authorizenet_api_public_key + + + + default_authorizenet_autoselect + + You can set to skip payment selection page if there is only one payment option. This payment method will be selected automatically]]> + + + default_authorizenet_save_cards_limit + + Set maximum number of credit cards to be saved by customers (up to 100). If set to 0 or blank saving of cards will not be allowed. Security note: Customer credit card details are saved on authorizenet secure servers to ensure maximum data security measures. No credit card details will be saved on your site.]]> + + + + text_authorizenet_connect + + + + + text_authorizenet_settings + + + + text_connect + + + + text_disconnect + + + + text_skip_connect + + + + text_connect_success + + + + text_disconnect_success + + + + default_authorizenet_sort_order + + + + default_authorizenet_test_mode + Set to ON if you want to use test key]]> + + + default_authorizenet_sk_live + Locate this in Authorize.Net API Keys Section. Key starts with sk_live_... ]]> + + + default_authorizenet_pk_live + Locate this in Authorize.Net API Keys Section. Key starts with pk_live_... ]]> + + + default_authorizenet_sk_test + Locate this in Authorize.Net API Keys Section. Key starts with sk_test_... ]]> + + + default_authorizenet_pk_test + Locate this in Authorize.Net API Keys Section. Key starts with pk_test_... ]]> + + + default_authorizenet_settlement + + + + default_authorizenet_settlement_auth + + + + default_authorizenet_settlement_authcapture + + + + default_authorizenet_status_success_settled + Select main order status you want to set in responce to payment processor status]]> + + + default_authorizenet_status_success_unsettled + Select main order status you want to set in responce to payment processor status]]> + + + text_column_date_added + + + + text_column_amount + + + + default_authorizenet_settlement_auto + + + + default_authorizenet_settlement_delayed + + + + text_payment_info + + + + text_order_ref + + + + text_transaction_status + + + + text_order_total + + + + text_balance + + + + error_system + + + + error_missing_amount + + + + error_authorizenet_sk_test + + + + error_authorizenet_sk_live + + + + error_permission + + + diff --git a/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php new file mode 100644 index 0000000000..a5ae5c7a07 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php @@ -0,0 +1,125 @@ +setName($this->config->get('default_authorizenet_api_login_id')); + $merchantAuthentication->setTransactionKey($this->config->get('default_authorizenet_api_transaction_key')); + + return $merchantAuthentication; + } + + /** + * @param int $order_id + * + * @return bool + */ + public function getAuthorizeNetOrder($order_id) + { + $qry = $this->db->query("SELECT ao.* + FROM ".$this->db->table("authorizenet_orders")." ao + WHERE ao.order_id = '".(int)$order_id."' + LIMIT 1"); + if ($qry->num_rows) { + $order = $qry->row; + return $order; + } else { + return false; + } + } + + /** + * @param $ch_id + * + * @return array|null + */ + public function getAuthorizeNetTransaction($ch_id) + { + if (!has_value($ch_id)) { + return array(); + } + + try { + + $merchantAuthentication = $this->getAccess(); + + $request = new AnetAPI\GetTransactionDetailsRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setTransId($ch_id); + + $controller = new AnetController\GetTransactionDetailsController($request); + + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) { + $transaction = $response->getTransaction(); + + $output['transId'] = $transaction->getTransId(); + $output['cardNumber'] = $transaction->getPayment()->getCreditCard()->getCardNumber(); + $output['authAmount'] = $transaction->getAuthAmount(); + $output['settleAmount'] = $transaction->getSettleAmount(); + $output['transactionStatus'] = $transaction->getTransactionStatus(); + return $output; + } else { + return $this->processApiResponse($response, false); + } + } catch (Exception $e) { + //log in AException + $ae = new AException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); + ac_exception_handler($ae); + + return null; + } + } + + /** + * @param \net\authorize\api\contract\v1\TransactionResponseType $api_response + * @param string $mode + * + * @return array + * @throws AException + */ + private function processApiResponse($api_response, $mode = 'exception') + { + $output = array(); + if (method_exists($api_response, 'getErrors') && $api_response->getErrors() != null) { + $errors = $api_response->getErrors(); + $output['error'] = $errors[0]->getErrorText().' ('.$errors[0]->getErrorCode().')'; + $output['code'] = $errors[0]->getErrorCode(); + } else { + $messages = $api_response->getMessages(); + if (!is_array($messages)) { + $messages = $messages->getMessage(); + } + if ($messages) { + $output['error'] = $messages[0]->getText().' ('.$messages[0]->getCode().')'; + $output['code'] = $messages[0]->getCode(); + } + } + + if ($output) { + $err = new AError('Authorize.net:'.var_export($output, true)); + $err->toDebug()->toLog(); + } + + if ($output && $mode == 'exception') { + throw new AException (AC_ERR_LOAD, 'Error: '.$output['error']); + } + + return $output; + } + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/composer.lock b/public_html/extensions/default_authorizenet/composer.lock new file mode 100644 index 0000000000..2c95f0a9f0 --- /dev/null +++ b/public_html/extensions/default_authorizenet/composer.lock @@ -0,0 +1,63 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "8cf1d470a25f973992ba90d6e6ee6ca3", + "packages": [ + { + "name": "authorizenet/authorizenet", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/AuthorizeNet/sdk-php.git", + "reference": "7fa78e6397d363296e462c3b348573c17175b7a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/AuthorizeNet/sdk-php/zipball/7fa78e6397d363296e462c3b348573c17175b7a8", + "reference": "7fa78e6397d363296e462c3b348573c17175b7a8", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpmd/phpmd": "~2.0", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "proprietary" + ], + "description": "Official PHP SDK for Authorize.Net", + "homepage": "http://developer.authorize.net", + "keywords": [ + "authorize.net", + "authorizenet", + "ecommerce", + "payment" + ], + "time": "2019-01-14T13:32:41+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6" + }, + "platform-dev": [] +} diff --git a/public_html/extensions/default_authorizenet/config.xml b/public_html/extensions/default_authorizenet/config.xml new file mode 100644 index 0000000000..341c1ccbf7 --- /dev/null +++ b/public_html/extensions/default_authorizenet/config.xml @@ -0,0 +1,72 @@ + + + default_authorizenet + 1.2.0 + payment + payment + + 1.2 + + + 10 + + + input + + + + input + + + + input + + + + checkbox + 1 + + + selectbox + + auth + authcapture + + auth + + + checkbox + 0 + + + selectbox + + + localisation/order_status + getOrderStatuses + + + order_status_id + name + + + 2 + + + selectbox + + 0 + + localisation/location + getLocations + + + location_id + name + + + + + + + diff --git a/public_html/extensions/default_authorizenet/core/hooks.php b/public_html/extensions/default_authorizenet/core/hooks.php new file mode 100644 index 0000000000..8138b106b4 --- /dev/null +++ b/public_html/extensions/default_authorizenet/core/hooks.php @@ -0,0 +1,55 @@ +registry = Registry::getInstance(); + } + + //Hook to extension edit in the admin + public function onControllerPagesExtensionExtensions_UpdateData() + { + $that = $this->baseObject; + $current_ext_id = $that->request->get['extension']; + if (IS_ADMIN && $current_ext_id == 'authorizenet' && $this->baseObject_method == 'edit') { + $html = ' + + '; + $that->view->addHookVar('extension_toolbar_buttons', $html); + } + } + + //Hook to extension edit in the admin + public function onControllerPagesSaleOrderSummary_UpdateData() + { + $that = $this->baseObject; + if ( IS_ADMIN !== true) { + return null; + } + $order_info = $that->model_sale_order->getOrder($that->request->get['order_id']); + if($order_info['payment_method_key'] != 'default_authorizenet'){ + return null; + } + $method_info = unserialize($order_info['payment_method_data']); + + $view_order_details = $that->view->getData('order'); + if($method_info) { + $view_order_details['payment_method'] = $view_order_details['payment_method'] + .'
' + .($method_info['authorizenet_transaction_id'] + ? 'Transaction ID: '.$method_info['authorizenet_transaction_id'].'('.$method_info['cc_type'].')' + : ''); + $that->view->assign('order', $view_order_details); + } + } + + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/help.txt b/public_html/extensions/default_authorizenet/help.txt new file mode 100644 index 0000000000..2d8224c2e6 --- /dev/null +++ b/public_html/extensions/default_authorizenet/help.txt @@ -0,0 +1,32 @@ +Authorize.Net Payment Configuration +

+1. To use this extension, you need to get API credentials (API Login ID & Transaction Key and Public Client Key) from new or existing Authorize.Net account
+If you do not have Authorize.Net account, please visit page http://www.authorize.net/
+
    +
  • Get API login id and key in Account > Security Settings > API Credentials & Keys
  • +
  • Get Client key in Account > Security Settings > Manage Public Client Key
  • +
+

+2. Fill in required fields with information provided in Authorize.Net dashboard.
+When you signed up you can use test or live mode connect button. +Important to know!: Test and live mode do not share customer, cards and transaction information. If you switch connection between modes, existing customers and order payment details from prior mode will not be available in new mode.
+To obtain sandbox credentials please go to https://sandbox.authorize.net +
+Sandbox testing notes: +
    +
  • Enable Transaction Details API setting on Account > Settings > Security Settings inside your Authorize.Net account.
  • +
  • Sandbox account have some delay when process transactions.
  • +
  • When you test card save feature use different cards for different customers
  • +
  • In sandbox account you need to enable Live mode for testing! (Sandbox > Account > Settings > Test Mode > switch to Live)
  • +
+

+3. Set up Order Status that will be applied when customer successfully payed with Authorize.Net payment option.

+4. Authorize.Net payment option will appear at customer's checkout at storefront. You can add custom icon or image in the setting to be displayed to customers.

+5. Once orders with authorize.net are created, you can perform capture, void or refund in order Payment Details section of AbanteCart admin.

+6. To test how Authorize.Net works go to storefront, add products to cart and follow checkout process. Payment option will be available at payment's details page. For testing you, can enable test mode and save in the extension your sandbox API credentials. +

+ +For more details about Authorize.Net service and details about transactions you need to access Authorize.Net dashboard. +

+For more details about affiliate program please visit http://reseller.authorize.net/application/?resellerId=34073 + diff --git a/public_html/extensions/default_authorizenet_aim/image/icon.png b/public_html/extensions/default_authorizenet/image/icon.png similarity index 100% rename from public_html/extensions/default_authorizenet_aim/image/icon.png rename to public_html/extensions/default_authorizenet/image/icon.png diff --git a/public_html/extensions/default_authorizenet/main.php b/public_html/extensions/default_authorizenet/main.php new file mode 100644 index 0000000000..a1da781d99 --- /dev/null +++ b/public_html/extensions/default_authorizenet/main.php @@ -0,0 +1,29 @@ + array('responses/extension/default_authorizenet'), + 'admin' => array(), +); + +$models = array( + 'storefront' => array('extension/default_authorizenet'), + 'admin' => array('extension/default_authorizenet'), +); + +$languages = array( + 'storefront' => array( + 'default_authorizenet/default_authorizenet', + ), + 'admin' => array( + 'default_authorizenet/default_authorizenet', + ), +); + +$templates = array( + 'storefront' => array( + 'responses/default_authorizenet.tpl', + ), + 'admin' => array(), +); \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php new file mode 100644 index 0000000000..352f4cdf31 --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php @@ -0,0 +1,278 @@ +extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $data = $this->buildCCForm(); + $this->view->batchAssign($data); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + //load creditcard input validation + $this->document->addScriptBottom($this->view->templateResource('/javascript/credit_card_validation.js')); + + $this->processTemplate('responses/default_authorizenet.tpl'); + } + + public function form_verification() + { + + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $data = $this->buildCCForm(); + $this->view->batchAssign($data); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + //load creditcard input validation + $this->document->addScriptBottom($this->view->templateResource('/javascript/credit_card_validation.js')); + + $this->processTemplate('responses/default_authorizenet_verification.tpl'); + } + + public function buildCCForm() + { + $data = array(); + //need an order details + $this->loadModel('checkout/order'); + $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); + $data['payment_address'] = $order_info['payment_address_1']." ".$order_info['payment_address_2']; + $data['edit_address'] = $this->html->getSecureURL('checkout/address/payment'); + + $data['text_credit_card'] = $this->language->get('text_credit_card'); + $data['text_wait'] = $this->language->get('text_wait'); + + $csrftoken = $this->registry->get('csrftoken'); + $data['csrfinstance'] = HtmlElementFactory::create(array( + 'type' => 'hidden', + 'name' => 'csrfinstance', + 'value' => $csrftoken->setInstance(), + )); + $data['csrftoken'] = HtmlElementFactory::create(array( + 'type' => 'hidden', + 'name' => 'csrftoken', + 'value' => $csrftoken->setToken(), + )); + + $data['entry_cc_owner'] = $this->language->get('entry_cc_owner'); + $data['cc_owner_firstname'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_owner_firstname', + 'placeholder' => 'First name', + 'value' => $order_info['payment_firstname'], + )); + + $data['cc_owner_lastname'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_owner_lastname', + 'placeholder' => 'Last name', + 'value' => $order_info['payment_lastname'], + )); + + $data['entry_cc_number'] = $this->language->get('entry_cc_number'); + $data['cc_number'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_number', + 'attr' => 'autocomplete="off"', + 'placeholder' => $this->language->get('entry_cc_number'), + 'value' => '', + )); + + $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date'); + + $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2'); + $data['entry_cc_cvv2_short'] = $this->language->get('entry_cc_cvv2_short'); + $data['cc_cvv2_help_url'] = $this->html->getURL('r/extension/default_authorizenet/cvv2_help'); + + $data['cc_cvv2'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_cvv2', + 'value' => '', + 'style' => 'short', + 'attr' => ' autocomplete="off" ', + )); + + $data['button_confirm'] = $this->language->get('button_confirm'); + $data['button_back'] = $this->language->get('button_back'); + + $months = array(); + + for ($i = 1; $i <= 12; $i++) { + $months[sprintf('%02d', $i)] = sprintf('%02d - ', $i).strftime('%B', mktime(0, 0, 0, $i, 1, 2000)); + } + $data['cc_expire_date_month'] = HtmlElementFactory::create( + array( + 'type' => 'selectbox', + 'name' => 'cc_expire_date_month', + 'value' => sprintf('%02d', date('m')), + 'options' => $months, + 'style' => 'input-medium short', + )); + + $today = getdate(); + $years = array(); + for ($i = $today['year']; $i < $today['year'] + 11; $i++) { + $years[strftime('%Y', mktime(0, 0, 0, 1, 1, $i))] = strftime('%Y', mktime(0, 0, 0, 1, 1, $i)); + } + $data['cc_expire_date_year'] = HtmlElementFactory::create(array( + 'type' => 'selectbox', + 'name' => 'cc_expire_date_year', + 'value' => sprintf('%02d', date('Y') + 1), + 'options' => $years, + 'style' => 'short', + )); + + $back = $this->request->get['rt'] != 'checkout/guest_step_3' + ? $this->html->getSecureURL('checkout/payment') + : $this->html->getSecureURL('checkout/guest_step_2'); + $data['back'] = HtmlElementFactory::create(array( + 'type' => 'button', + 'name' => 'back', + 'text' => $this->language->get('button_back'), + 'style' => 'button', + 'href' => $back, + 'icon' => 'icon-arrow-left', + )); + + $data['submit'] = HtmlElementFactory::create(array( + 'type' => 'button', + 'name' => 'authorizenet_button', + 'text' => $this->language->get('button_confirm'), + 'style' => 'button btn-orange pull-right', + 'icon' => 'icon-ok icon-white', + )); + + return $data; + } + + public function cvv2_help() + { + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $image = ''.$this->language->get('entry_what_cvv2').''; + + $this->view->assign('title', ''); + $this->view->assign('description', $image); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + $this->processTemplate('responses/content/content.tpl'); + } + + public function send() + { + if ( ! $this->csrftoken->isTokenValid()) { + $json['error'] = $this->language->get('error_unknown'); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + + return; + } + + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + //validate input + $post = $this->request->post; + //check if saved cc mode is used + if ( ! $post['use_saved_cc']) { + if (empty($post['cc_owner_firstname']) && empty($post['cc_owner_lastname'])) { + $json['error'] = $this->language->get('error_incorrect_name'); + } + if (empty($post['dataValue']) || empty($post['dataDescriptor'])) { + $json['error'] = $this->language->get('error_system'); + } + } + + if (isset($json['error'])) { + $csrftoken = $this->registry->get('csrftoken'); + $json['csrfinstance'] = $csrftoken->setInstance(); + $json['csrftoken'] = $csrftoken->setToken(); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + + return null; + } + + $this->loadModel('checkout/order'); + $this->loadModel('extension/default_authorizenet'); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + $order_id = $this->session->data['order_id']; + + $order_info = $this->model_checkout_order->getOrder($order_id); + // currency code + $currency = $this->currency->getCode(); + // order amount without decimal delimiter + $amount = round($order_info['total'], 2); + + // Card owner name + $card_firstname = html_entity_decode($post['cc_owner_firstname'], ENT_QUOTES, 'UTF-8'); + $card_lastname = html_entity_decode($post['cc_owner_lastname'], ENT_QUOTES, 'UTF-8'); + + ADebug::checkpoint('AuthorizeNet Payment: Order ID '.$order_id); + + $pd = array( + 'amount' => $amount, + 'currency' => $currency, + 'order_id' => $order_id, + 'cc_owner_firstname' => $card_firstname, + 'cc_owner_lastname' => $card_lastname, + 'dataDescriptor' => $post['dataDescriptor'], + 'dataValue' => $post['dataValue'], + ); + + $p_result = $this->model_extension_default_authorizenet->processPayment($pd); + + ADebug::variable('Processing payment result: ', $p_result); + if ($p_result['error']) { + // transaction failed + $json['error'] = (string)$p_result['error']; + if ($p_result['code']) { + $json['error'] .= ' ('.$p_result['code'].')'; + } + + } else { + if ($p_result['paid']) { + $json['success'] = $this->html->getSecureURL('checkout/success'); + } else { + //Unexpected result + $json['error'] = $this->language->get('error_system').'(abc)'; + } + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + if (isset($json['error']) && $json['error']) { + $csrftoken = $this->registry->get('csrftoken'); + $json['csrfinstance'] = $csrftoken->setInstance(); + $json['csrftoken'] = $csrftoken->setToken(); + } + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } + +} + diff --git a/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml b/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml new file mode 100644 index 0000000000..1fc991302a --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml @@ -0,0 +1,93 @@ + + + + text_title + + + + text_credit_card + + + + text_wait + + + + entry_cc_owner + + + + entry_cc_number + + + + entry_cc_expire_date + + + + entry_cc_cvv2 + + + + entry_cc_cvv2_short + + + + entry_what_cvv2 + + + + entry_cc_type + + + + entry_cc_save + + + + entry_cc_save_details + + + + + entry_billing_address + + + + entry_edit + + + + text_saved_credit_card + + + + text_delete_saved_credit_card + + + + text_new_credit_card + + + + error_incorrect_number + + + + error_incorrect_name + + + + error_incorrect_expiration + + + + error_incorrect_cvv + + + + error_system + + + + diff --git a/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php new file mode 100644 index 0000000000..a93f50c58a --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php @@ -0,0 +1,469 @@ +setName($this->config->get('default_authorizenet_api_login_id')); + $merchantAuthentication->setTransactionKey($this->config->get('default_authorizenet_api_transaction_key')); + return $merchantAuthentication; + } + + /** + * @param $address + * + * @return array + * @throws AException + */ + public function getMethod($address) + { + //create new instance of language for case when model called from admin-side + $language = new ALanguage($this->registry, $this->language->getLanguageCode(), 0); + $language->load($language->language_details['directory']); + $language->load('default_authorizenet/default_authorizenet'); + if ($this->config->get('default_authorizenet_status')) { + $query = $this->db->query( + "SELECT * + FROM `".$this->db->table("zones_to_locations")."` + WHERE location_id = '".(int)$this->config->get('default_authorizenet_location_id')."' + AND country_id = '".(int)$address['country_id']."' + AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')"); + + if ( ! $this->config->get('default_authorizenet_location_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + } else { + $status = false; + } + + $payment_data = array(); + if ($status) { + $payment_data = array( + 'id' => 'default_authorizenet', + 'title' => $language->get('text_title'), + 'sort_order' => $this->config->get('default_authorizenet_sort_order'), + ); + } + + return $payment_data; + } + + /** + * @param $pd + * + * @return array + * @throws AException + */ + public function processPayment($pd) + { + $output = array(); + $this->load->model('checkout/order'); + $this->load->language('default_authorizenet/default_authorizenet'); + $order_info = $this->model_checkout_order->getOrder($pd['order_id']); + + try { + + //grab price from order total + $amount = round($order_info['total'], 2); + //build charge data array + $charge_data = array( + 'amount' => $amount, + 'currency' => $pd['currency'], + 'description' => $this->config->get('store_name').' Order #'.$pd['order_id'], + 'statement_descriptor' => 'Order #'.$pd['order_id'], + 'receipt_email' => $order_info['email'], + 'capture' => ($this->config->get('default_authorizenet_settlement') == 'auth' + ? false + : true), + ); + + //build cc details + $cc_details = array( + 'first_name' => $pd['cc_owner_firstname'], + 'last_name' => $pd['cc_owner_lastname'], + 'address_line1' => trim($order_info['payment_address_1']), + 'address_line2' => trim($order_info['payment_address_2']), + 'address_city' => $order_info['payment_city'], + 'address_zip' => $order_info['payment_postcode'], + 'address_state' => $order_info['payment_zone'], + 'address_country' => $order_info['payment_iso_code_2'], + ); + + if ($order_info['shipping_method']) { + $charge_data['shipping'] = array( + 'name' => $order_info['firstname'].' '.$order_info['lastname'], + 'phone' => $order_info['telephone'], + 'address' => array( + 'line1' => $order_info['shipping_address_1'], + 'line2' => $order_info['shipping_address_2'], + 'city' => $order_info['shipping_city'], + 'postal_code' => $order_info['shipping_postcode'], + 'state' => $order_info['shipping_zone'], + 'country' => $order_info['shipping_iso_code_2'], + ), + ); + } + + $charge_data['metadata'] = array(); + $charge_data['metadata']['order_id'] = $pd['order_id']; + if ($this->customer->getId() > 0) { + $charge_data['metadata']['customer_id'] = (int)$this->customer->getId(); + } + $amount = $pd['amount']; + + ADebug::variable('Processing authorizenet payment request: ', $charge_data); + + $payment_details = $pd + $cc_details + $charge_data + $order_info; + $tr_details = $this->processPaymentByToken($payment_details, $amount); + + + } catch (AException $e) { + $output = array(); + // Something else happened, completely unrelated to AuthorizeNet + $msg = new AMessage(); + $msg->saveError( + 'Unexpected error in authorizenet payment!', + 'Authorize.Net processing failed.
'.$e->getMessage()."(".$e->getCode().")" + ); + + $output['error'] = $e->getMessage(); + + return $output; + } + + //we still have no result. something unexpected happened + if (empty($tr_details)) { + $output['error'] = $this->language->get('error_system').'(**)'; + + return $output; + } + + $responseCode = $tr_details['response_code']; + //we allow only 1 = Approved & 4 = Held for Review + if ($responseCode == 1 || $responseCode == 4) { + //get credit cart type from directResponse + $transaction_id = $tr_details['refTransId']; + $order_info['transaction_id'] = $transaction_id; + $card_type = $tr_details['accountType']; + + $message = 'Order id: '.(string)$pd['order_id']."\n"; + $message .= 'Order total: '.(string)$amount."\n"; + $message .= 'Transaction ID: '.(string)$transaction_id."\n"; + $message .= 'Transaction Timestamp: '.(string)date('m/d/Y H:i:s'); + + //update authorizenet_transaction_id and CC type in the order table + $this->db->query( + "UPDATE ".$this->db->table('orders')." + SET payment_method_data = '".$this->db->escape( + serialize(array('authorizenet_transaction_id' => $transaction_id, 'cc_type' => $card_type)) + )."' + WHERE order_id = '".(int)$pd['order_id']."'" + ); + + //finalize order only if payment is a success + $this->model_checkout_order->confirm($pd['order_id'], + $this->config->get('default_authorizenet_status_success_settled')); + if ($order_info['shipping_method'] == 'Pickup From Store') { + $comment = '
'. + 'You will be contacted by an account representative ' + .'when your order is available for pickup.
'."\n"; + $this->model_checkout_order->update($pd['order_id'], + $this->config->get('default_authorizenet_status_success_settled'), $comment); + } + $order_status = $this->config->get('default_authorizenet_status_success_settled'); + //diff order status for pending review + if ($responseCode == 4) { + $order_status = 1; + } + $this->model_checkout_order->update($pd['order_id'], $order_status, $message, false); + $output['paid'] = true; + } else { + // Some other error, assume payment declined + $message = 'Timestamp: '.(string)date('m/d/Y H:i:s')."\n"; + $message .= 'Authorize.net status: '.(string)$tr_details['resultCode']."\n"; + $message .= 'Authorize.net message: '.(string)$tr_details['description']."\n"; + $this->model_checkout_order->update( + $pd['order_id'], + $this->config->get('default_authorizenet_status_decline'), + $message, + false + ); + + if ($tr_details['error']) { + $output['error'] = "Payment has failed! ".$tr_details['error']; + $output['code'] = $tr_details['code']; + } + } + + return $output; + } + + protected function processPaymentByToken($payment_data, $amount) + { + + $merchantAuthentication = $this->getAccess(); + // Set the transaction's refId + $refId = 'refpbt'.$payment_data['order_id']; + // Create the payment object for a payment nonce + $opaqueData = new OpaqueDataType(); + $opaqueData->setDataDescriptor($payment_data['dataDescriptor']); + $opaqueData->setDataValue($payment_data['dataValue']); + + // Add the payment data to a paymentType object + $paymentOne = new PaymentType(); + $paymentOne->setOpaqueData($opaqueData); + // Create order information + $order = new OrderType(); + $order->setInvoiceNumber($payment_data['order_id']); + $order->setDescription($payment_data['description']); + // Set the customer's Bill To address + $customerAddress = new CustomerAddressType(); + $customerAddress->setFirstName($payment_data['first_name']); + $customerAddress->setLastName($payment_data['last_name']); + $customerAddress->setAddress($payment_data['address_line1'].' '.$payment_data['address_line2']); + $customerAddress->setCity($payment_data['payment_city']); + $customerAddress->setState($payment_data['payment_zone']); + $customerAddress->setZip($payment_data['payment_postcode']); + $customerAddress->setCountry($payment_data['payment_iso_code_2']); + $customerAddress->setPhoneNumber($payment_data['telephone']); + + // Set the customer's Ship To address + $ship_address_obj = new AnetAPI\CustomerAddressType(); + $ship_address_obj->setFirstName($payment_data['first_name']); + $ship_address_obj->setLastName($payment_data['last_name']); + $ship_address_obj->setAddress($payment_data['shipping_address_1'].' '.$payment_data['shipping_address_2']); + $ship_address_obj->setCity($payment_data['shipping_city']); + $ship_address_obj->setState($payment_data['shipping_zone']); + $ship_address_obj->setZip($payment_data['shipping_postcode']); + $ship_address_obj->setCountry($payment_data['shipping_iso_code_2']); + // Set the customer's identifying information + $customerData = new CustomerDataType(); + $customerData->setType("individual"); + $customerData->setId($this->customer->getId()); + $customerData->setEmail($payment_data['email']); + // Add values for transaction settings + $duplicateWindowSetting = new SettingType(); + $duplicateWindowSetting->setSettingName("duplicateWindow"); + $duplicateWindowSetting->setSettingValue("60"); + // Create a TransactionRequestType object and add the previous objects to it + $transactionRequestType = new TransactionRequestType(); + $t_type = $this->config->get('default_authorizenet_settlement') == 'authcapture' + ? "authCaptureTransaction" + : 'authOnlyTransaction'; + $transactionRequestType->setTransactionType($t_type); + $transactionRequestType->setAmount($amount); + $transactionRequestType->setOrder($order); + $transactionRequestType->setPayment($paymentOne); + $transactionRequestType->setBillTo($customerAddress); + $transactionRequestType->setShipTo($ship_address_obj); + $transactionRequestType->setCustomer($customerData); + $transactionRequestType->addToTransactionSettings($duplicateWindowSetting); + /*$transactionRequestType->addToUserFields($merchantDefinedField1); + $transactionRequestType->addToUserFields($merchantDefinedField2);*/ + // Assemble the complete transaction request + $request = new CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($transactionRequestType); + // Create the controller and get the response + $controller = new AnetController\CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + /** + * @var AnetApiResponseType $response + */ + $response = $controller->executeWithApiResponse($endpoint_url); + if ($response != null) { + // Check to see if the API request was successfully received and acted upon + $tresponse = $response->getTransactionResponse(); + if ( ! $tresponse && $this->config->get('default_authorizenet_test_mode')) { + $this->log->write(var_export($response, true)); + } + if ($response->getMessages()->getResultCode() == 'Ok') { + // Since the API request was successful, look for a transaction response + // and parse it to display the results of authorizing the card + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'response_object' => $tresponse, + 'refId' => $refId, + 'refTransId' => $tresponse->getTransId(), + 'auth_code' => $tresponse->getAuthCode(), + 'accountNumber' => $tresponse->getAccountNumber(), + 'accountType' => $tresponse->getAccountType(), + 'response_code' => $tresponse->getResponseCode(), + 'message_code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + // Or, print errors if the API request wasn't successful + } else { + return $this->processApiResponse($tresponse, false); + } + } + + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + + /** + * @param int $customer_authorizenet_id + * @param int $payment_profile_id + * @param float $amount + * @param array $payment_data + * + * @return array|ANetApiResponseType + */ + protected function chargeCustomerProfile( + $customer_authorizenet_id, + $payment_profile_id, + $amount, + $payment_data + ){ + $merchantAuthentication = $this->getAccess(); + + // Set the transaction's refId + $refId = 'refcpp'.$payment_data['order_id']; + $profile_2_charge = new CustomerProfilePaymentType(); + $profile_2_charge->setCustomerProfileId($customer_authorizenet_id); + $payment_profile = new PaymentProfileType(); + $payment_profile->setPaymentProfileId($payment_profile_id); + $profile_2_charge->setPaymentProfile($payment_profile); + $t_request_type = new TransactionRequestType(); + $t_type = $this->config->get('default_authorizenet_settlement') == 'authcapture' + ? "authCaptureTransaction" + : 'authOnlyTransaction'; + $t_request_type->setTransactionType($t_type); + $t_request_type->setAmount($amount); + $t_request_type->setProfile($profile_2_charge); + + // Set the customer's Ship To address + $ship_address_obj = new CustomerAddressType(); + $ship_address_obj->setFirstName($payment_data['first_name']); + $ship_address_obj->setLastName($payment_data['last_name']); + $ship_address_obj->setAddress($payment_data['shipping_address_1'].' '.$payment_data['shipping_address_2']); + $ship_address_obj->setCity($payment_data['shipping_city']); + $ship_address_obj->setState($payment_data['shipping_zone']); + $ship_address_obj->setZip($payment_data['shipping_postcode']); + $ship_address_obj->setCountry($payment_data['shipping_iso_code_2']); + + $t_request_type->setShipTo($ship_address_obj); + $t_request_type->setPoNumber($payment_data['order_id']); + + $request = new CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($t_request_type); + $controller = new CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + if ($response != null) { + if ($response->getMessages()->getResultCode() == 'Ok') { + /** + * @var \net\authorize\api\contract\v1\TransactionResponseType $tresponse + */ + $tresponse = $response->getTransactionResponse(); + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'response_object' => $tresponse, + 'refId' => $refId, + 'refTransId' => $tresponse->getTransId(), + 'auth_code' => $tresponse->getAuthCode(), + 'accountNumber' => $tresponse->getAccountNumber(), + 'accountType' => $tresponse->getAccountType(), + 'response_code' => $tresponse->getResponseCode(), + 'message_code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + $tresponse = $response->getTransactionResponse(); + + return $this->processApiResponse($tresponse, false); + } + } + + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + + /** + * @param TransactionResponseType | AnetApiResponseType $api_response + * @param string $mode + * + * @return array + * @throws AException + */ + private function processApiResponse($api_response, $mode = 'exception') + { + $output = array(); + + if (method_exists($api_response, 'getErrors') && $api_response->getErrors() != null) { + $errors = $api_response->getErrors(); + $output['error'] = $errors[0]->getErrorText(); + $output['code'] = $errors[0]->getErrorCode(); + } else { + $messages = $api_response->getMessages(); + if ( ! is_array($messages)) { + $messages = $messages->getMessage(); + } + if ($messages) { + $output['error'] = $messages[0]->getText(); + $output['code'] = $messages[0]->getCode(); + } + } + + + if ($output) { + $err = new AError('Authorize.net:'.var_export($output, true)); + $err->toDebug()->toLog(); + } + + if ($output && $mode == 'exception') { + throw new AException (AC_ERR_LOAD, 'Error: '.$output['error']); + } + + return $output; + } + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet_aim/storefront/view/default/image/securitycode.jpg b/public_html/extensions/default_authorizenet/storefront/view/default/image/securitycode.jpg similarity index 100% rename from public_html/extensions/default_authorizenet_aim/storefront/view/default/image/securitycode.jpg rename to public_html/extensions/default_authorizenet/storefront/view/default/image/securitycode.jpg diff --git a/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl new file mode 100644 index 0000000000..c48af2105c --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl @@ -0,0 +1,241 @@ + +
+ +
+ +

+ + getHookVar('payment_table_pre'); ?> + +
+ : ... + +
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+ + +
+ + +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ + + +
+ + getHookVar('payment_table_post'); ?> + +
+ + + text ?> + + +
+ +
+ +
+ + + +config->get('default_authorizenet_test_mode') + ? 'https://jstest.authorize.net/v1/Accept.js' + : 'https://js.authorize.net/v1/Accept.js'; +?> + + + \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl new file mode 100644 index 0000000000..e154dffdbc --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl @@ -0,0 +1,117 @@ +
+ + + + + + +
+ Please provide a Credit Card to complete the order. There will be no charge to your card unless it is necessary to initiate our Market Loss Policy in the event of you canceling or defaulting on payment. +
+
+ + +
+
+

+ + + + + +
: ... + + + +
+
+ + + + + + + +
+ +   + + + +
+ + + + +
+
+ +
+
+ + -
\ No newline at end of file +
+ \ No newline at end of file diff --git a/public_html/storefront/view/default/template/pages/product/product.tpl b/public_html/storefront/view/default/template/pages/product/product.tpl index 5d22853a58..13ecec4d4e 100755 --- a/public_html/storefront/view/default/template/pages/product/product.tpl +++ b/public_html/storefront/view/default/template/pages/product/product.tpl @@ -39,7 +39,7 @@ if ($error){ ?> @@ -47,8 +47,8 @@ if ($error){ ?> title=""> <?php echo $image['title']; ?> + alt="" + title=""/> @@ -228,14 +228,14 @@ if ($error){ ?> getHookVar('buttons'); ?>
-
@@ -396,13 +396,15 @@ if ($error){ ?>