Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/release-7.002.1.4-RC6'
Browse files Browse the repository at this point in the history
  • Loading branch information
datazen committed Mar 18, 2014
2 parents 66843c7 + 82385e4 commit a0bf3ce
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public static function getData($id, $key = null) {

if ( $Qcurrency->numberOfRows() === 1 ) {
$result = $Qcurrency->toArray();
$result['symbol_left'] = utf8_decode($Qcurrency->value('symbol_left'));
$result['symbol_right'] = utf8_decode($Qcurrency->value('symbol_right'));
$result['symbol_left'] = $Qcurrency->value('symbol_left');
$result['symbol_right'] = $Qcurrency->value('symbol_right');

if ( !empty($key) && isset($result[$key]) ) {
$result = $result[$key];
Expand Down
5 changes: 3 additions & 2 deletions catalog/admin/includes/applications/currencies/modal/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ function (rdata) {
oTable.fnReloadAjax();
} }
);
win.closeModal();
//win.closeModal();
win.location.href = win.location.href;
}
}
}
},
buttonsLowPadding: true
});
});
$("#editTitle").val(data.currencyData.title);
$("#editCode").val(data.currencyData.code);
$("#editSymbolLeft").val(data.currencyData.symbol_left);
Expand Down
3 changes: 2 additions & 1 deletion catalog/admin/includes/applications/currencies/modal/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ function (rdata) {
}
}
);
win.closeModal();
//win.closeModal();
win.location.href = win.location.href;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ public static function getAll() {
$group = '<td><small class="tag ' . $tagColor . ' glossy">' . lc_get_customer_groups_name($Qcustomers->valueInt('customers_group_id')) . '</small></td>';
$date = '<td>' . lC_DateTime::getShort($Qcustomers->value('date_account_created')) . '</td>';
$action = '<td class="align-right vertical-center">
<span class="button-group" style="white-space:nowrap;"><a href="' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://" onclick="editCustomer(\'' . $Qcustomers->valueInt('customers_id') . '\')') . '" class="button icon-pencil with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_edit_customer') . '">' . '</a></span>&nbsp;<span class="button-group" style="white-space:nowrap;"><a href="' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://" onclick="createOrder(\'' . $Qcustomers->valueInt('customers_id') . '\',\''.$Qcustomers->valueInt('customers_default_address_id').'\')') . '" class="button icon-plus-round with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_create_order') . '"></a></span>&nbsp;<span class="button-group" style="white-space:nowrap;"><a href="' . ((int)($_SESSION['admin']['access'][$_module] < 2) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'orders&cID=' . $Qcustomers->valueInt('customers_id'))) . '" class="button icon-price-tag with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 2) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_view_orders') . '"></a></span>
</td>';
<span class="button-group">
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://" onclick="editCustomer(\'' . $Qcustomers->valueInt('customers_id') . '\')') . '" class="button icon-pencil' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? ' disabled' : NULL) . '">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://" onclick="createOrder(\'' . $Qcustomers->valueInt('customers_id') . '\',\''.$Qcustomers->valueInt('customers_default_address_id').'\')') . '" class="button icon-plus-round with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_create_order') . '"></a>
<a href="javascript:void(0);" class="button icon-monitor with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_login_as_customer') . ' (PRO)"></a>
</span>
<span class="button-group">
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'orders&cID=' . $Qcustomers->valueInt('customers_id'))) . '" class="button icon-price-tag with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_view_orders') . '"></a>
</span>
</td>';
$result['aaData'][] = array("$check", "$gender", "$name", "$email", "$order_count", "$group", "$date", "$action");
$cnt++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"aoColumns": [{ "sWidth": "10px", "bSortable": false, "sClass": "hide-on-mobile dataColCheck" },
{ "sWidth": "10px", "bSortable": false, "sClass": "hide-on-mobile dataColIcon" },
{ "sWidth": "22%", "bSortable": true, "sClass": "dataColLast" },
{ "sWidth": "30%", "bSortable": true, "sClass": "hide-on-mobile hide-on-tablet dataColEmail" },
{ "sWidth": "25%", "bSortable": true, "sClass": "hide-on-mobile hide-on-tablet dataColEmail" },
{ "sWidth": "8%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColFirst" },
{ "sWidth": "10%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColGroup" },
{ "sWidth": "10%", "bSortable": true, "sClass": "hide-on-tablet hide-on-mobile dataColDate" },
{ "sWidth": "20%", "bSortable": false, "sClass": "dataColAction" }]
{ "sWidth": "25%", "bSortable": false, "sClass": "dataColAction" }]
});

setTimeout('hideElements()', 800); // because of server-side processing we need to delay for race condition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static function getProducts($pfilter, $pgtype, $pgformat) {
$product['products_date_added'] = lC_Datetime::getShort($product['products_date_added']);

foreach ($product as $column_output) {
$content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim;
$content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim;
}

// categories
Expand All @@ -192,7 +192,7 @@ public static function getProducts($pfilter, $pgtype, $pgformat) {
$categories[] = $Qcategories->value('categories_name');
$catids[] = $Qcategories->value('categories_id');
}
$content .= "\"" . implode($seperator, $categories) . "\"" . $delim;
$content .= implode($seperator, $categories) . $delim;

foreach ($catids as $cat) {
$path = '';
Expand All @@ -202,14 +202,14 @@ public static function getProducts($pfilter, $pgtype, $pgformat) {
$pArr = array_reverse(array_filter($pathParts));
unset($catids);

$content .= "\"" . implode($seperator, $pArr) . "\"" . $delim;
$content .= implode($seperator, $pArr) . $delim;

$Qimage = $lC_Database->query("SELECT * FROM :table_products_images WHERE products_id = :products_id");
$Qimage->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES);
$Qimage->bindInt(':products_id', $product['products_id']);
$Qimage->execute();

$content .= "\"" . $Qimage->value('image') . "\"" . $delim;
$content .= $Qimage->value('image') . $delim;

$content .= "\n";

Expand Down Expand Up @@ -321,7 +321,7 @@ public static function getCategories($cfilter, $cgformat) {
foreach ($categories as $category) {
$category['date_added'] = lC_Datetime::getShort($category['date_added']);
foreach ($category as $column_output) {
$content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim;
$content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim;
}
$content .= "\n";
}
Expand Down Expand Up @@ -401,7 +401,7 @@ public static function getOptionGroups($ofilter, $ogformat) {
$content = '';
foreach ($optiongroups as $optiongroup) {
foreach ($optiongroup as $column_output) {
$content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim;
$content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim;
}
$content .= "\n";
}
Expand Down Expand Up @@ -480,7 +480,7 @@ public static function getOptionVariants($ofilter, $ogformat) {
$content = '';
foreach ($optionvariants as $optionvariant) {
foreach ($optionvariant as $column_output) {
$content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim;
$content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim;
}
$content .= "\n";
}
Expand Down Expand Up @@ -564,7 +564,7 @@ public static function getOptionProducts($ofilter, $ogformat) {
$content = '';
foreach ($optionproducts as $optionproduct) {
foreach ($optionproduct as $column_output) {
$content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim;
$content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim;
}
$content .= "\n";
}
Expand Down Expand Up @@ -700,21 +700,21 @@ public static function importProducts($filename, $pwizard, $ptype, $pbackup, $pm
$product['categories'] = explode(",", $product['categories']);
foreach ($product['categories'] as $catName) {
if ($catName != '') {
$catCheck = $lC_Database->query("select cd.* from :table_categories_description cd left join :table_categories c on (cd.categories_id = c.categories_id) where cd.categories_name = :categories_name" . $ifParent);
if ($product['parent_categories'] != '') {
$parentCheck = $lC_Database->query("select categories_id from :table_categories_description where categories_name = :categories_name and language_id = :language_id");
$parentCheck->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
$parentCheck->bindValue(':categories_name', end(explode(",", $product['parent_categories'])));
$parentCheck->bindInt(':language_id', $product['language_id']);
$parentCheck->execute();

$ifParent = ' and c.parent_id = :parent_id';
$ifParent = ' and c.parent_id = :parent_id';
$catCheck->bindInt(':parent_id', $parentCheck->value('categories_id'));
}

$catCheck = $lC_Database->query("select cd.* from :table_categories_description cd left join :table_categories c on (cd.categories_id = c.categories_id) where cd.categories_name = :categories_name" . $ifParent);
$catCheck->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
$catCheck->bindTable(':table_categories', TABLE_CATEGORIES);
$catCheck->bindValue(':categories_name', $catName);
$catCheck->bindInt(':parent_id', $parentCheck->value('categories_id'));
$catCheck->execute();

if ($catCheck->numberOfRows()) {
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/includes/languages/en_US/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
text_new_address_saved = New Address Saved
text_changes_saved = Changes Saved
button_continue_title_tag = Add address
button_continue_title_tag = Add address
29 changes: 20 additions & 9 deletions catalog/includes/classes/currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class lC_Currencies {

// class constructor
public function lC_Currencies() {
global $lC_Database;
global $lC_Database, $lC_Language;

$Qcurrencies = $lC_Database->query('select * from :table_currencies');
$Qcurrencies->bindTable(':table_currencies', TABLE_CURRENCIES);
Expand All @@ -22,8 +22,8 @@ public function lC_Currencies() {
while ($Qcurrencies->next()) {
$this->currencies[$Qcurrencies->value('code')] = array('id' => $Qcurrencies->valueInt('currencies_id'),
'title' => $Qcurrencies->value('title'),
'symbol_left' => utf8_decode($Qcurrencies->value('symbol_left')),
'symbol_right' => utf8_decode($Qcurrencies->value('symbol_right')),
'symbol_left' => $Qcurrencies->value('symbol_left'),
'symbol_right' => $Qcurrencies->value('symbol_right'),
'decimal_places' => $Qcurrencies->valueInt('decimal_places'),
'value' => $Qcurrencies->valueDecimal('value'));
}
Expand Down Expand Up @@ -60,19 +60,18 @@ public function formatRaw($number, $currency_code = '', $currency_value = '') {

public function addTaxRateToPrice($price, $tax_rate, $quantity = 1) {
global $lC_Tax;

$price = $this->santizePrice($price);
$price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']);

if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_rate > 0) ) {
$price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']);
}

return lc_round($price * $quantity, $this->currencies[DEFAULT_CURRENCY]['decimal_places']);
}

public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_code = null, $currency_value = null) {
global $lC_Tax;

$price = $this->santizePrice($price);
$price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']);

if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_class_id > 0) ) {
Expand All @@ -84,15 +83,19 @@ public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_cod

public function displayPriceWithTaxRate($price, $tax_rate, $quantity = 1, $force = false, $currency_code = '', $currency_value = '') {
global $lC_Tax;

$price = $this->santizePrice($price);
$price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']);

if ( (($force === true) || (DISPLAY_PRICE_WITH_TAX == '1')) && ($tax_rate > 0) ) {
$price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']);
}

return $this->format($price * $quantity, $currency_code, $currency_value);
}

public function santizePrice($price){
//santize the prise string
return(str_replace(",", "", $price));
}

public function exists($code) {
if (isset($this->currencies[$code])) {
Expand Down Expand Up @@ -164,6 +167,14 @@ public function getSessionSymbolLeft() {
return $value['symbol_left'];
}
}
}

public function getSessionSymbolRight() {
foreach ($this->currencies as $key => $value) {
if ($key == $_SESSION['currency']) {
return $value['symbol_right'];
}
}
}
}
?>
?>
1 change: 1 addition & 0 deletions catalog/includes/content/account/logoff.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ protected function _process() {
$lC_ShoppingCart->reset();
$lC_Coupons->reset();
$lC_Customer->reset();
if (isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === TRUE) unset($_SESSION['admin_login']);
}
}
?>
Loading

0 comments on commit a0bf3ce

Please sign in to comment.