// merge 6036 6069 6071 6093

This commit is contained in:
tDidierjean committed 2011-04-28 11:32:07 +00:00
1 parent f364758a94
commit 02d1f7aa6a
3 files changed
+50 -24

No files matched your search

+29 -21
View File
@@ -612,15 +612,17 @@ class ToolsCore
elseif ($id_manufacturer = self::getValue('id_manufacturer')) elseif ($id_manufacturer = self::getValue('id_manufacturer'))
{ {
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `meta_title`, `meta_description`, `meta_keywords` SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
FROM `'._DB_PREFIX_.'manufacturer_lang` FROM `'._DB_PREFIX_.'manufacturer_lang` ml
WHERE id_lang = '.(int)($id_lang).' AND id_manufacturer = '.(int)($id_manufacturer)); LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (ml.`id_manufacturer` = m.`id_manufacturer`)
WHERE ml.id_lang = '.(int)($id_lang).' AND ml.id_manufacturer = '.(int)($id_manufacturer));
if ($row) if ($row)
{ {
if (empty($row['meta_description'])) if (empty($row['meta_description']))
$row['meta_description'] = strip_tags($row['meta_description']); $row['meta_description'] = strip_tags($row['meta_description']);
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); if (!empty($row['meta_title']))
return self::completeMetaTags($row, $row['meta_title']); $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
return self::completeMetaTags($row, $row['name']);
} }
} }
@@ -628,15 +630,18 @@ class ToolsCore
elseif ($id_supplier = self::getValue('id_supplier')) elseif ($id_supplier = self::getValue('id_supplier'))
{ {
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `meta_title`, `meta_description`, `meta_keywords` SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
FROM `'._DB_PREFIX_.'supplier_lang` FROM `'._DB_PREFIX_.'supplier_lang` sl
WHERE id_lang = '.(int)($id_lang).' AND id_supplier = '.(int)($id_supplier)); LEFT JOIN `'._DB_PREFIX_.'supplier` s ON (sl.`id_supplier` = s.`id_supplier`)
WHERE sl.id_lang = '.(int)($id_lang).' AND sl.id_supplier = '.(int)($id_supplier));
if ($row) if ($row)
{ {
if (empty($row['meta_description'])) if (empty($row['meta_description']))
$row['meta_description'] = strip_tags($row['meta_description']); $row['meta_description'] = strip_tags($row['meta_description']);
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME'); if (!empty($row['meta_title']))
return self::completeMetaTags($row, $row['meta_title']); $row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
return self::completeMetaTags($row, $row['name']);
} }
} }
@@ -1256,18 +1261,21 @@ class ToolsCore
//overriding of modules js files //overriding of modules js files
foreach ($js_uri AS $key => &$file) foreach ($js_uri AS $key => &$file)
{ {
$different = 0; if (!preg_match('/^http(s?):\/\//i', $file))
$override_path = str_replace(__PS_BASE_URI__.'modules/', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/js/modules/', $file, $different);
if ($different && file_exists($override_path))
$file = str_replace(__PS_BASE_URI__.'modules/', __PS_BASE_URI__.'themes/'._THEME_NAME_.'/js/modules/', $file, $different);
else
{ {
// remove PS_BASE_URI on _PS_ROOT_DIR_ for the following $different = 0;
$url_data = parse_url($file); $override_path = str_replace(__PS_BASE_URI__.'modules/', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/js/modules/', $file, $different);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); if ($different && file_exists($override_path))
// check if js files exists $file = str_replace(__PS_BASE_URI__.'modules/', __PS_BASE_URI__.'themes/'._THEME_NAME_.'/js/modules/', $file, $different);
if (!file_exists($file_uri)) else
unset($js_uri[$key]); {
// remove PS_BASE_URI on _PS_ROOT_DIR_ for the following
$url_data = parse_url($file);
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
// check if js files exists
if (!file_exists($file_uri))
unset($js_uri[$key]);
}
} }
} }
+7 -3
View File
@@ -32,9 +32,13 @@ function regenerate_level_depth()
foreach($cats as $cat) foreach($cats as $cat)
{ {
$category = new Category((int)$cat['id_category']); $category = new Category((int)$cat['id_category']);
$catParent = new Category((int)$category->id_parent); // if the category has no parent, it's the home
$category->level_depth = $catParent->level_depth +1; if ((int)$category->id_parent != 0)
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$category->level_depth.' WHERE `id_category` = '.(int)$category->id); {
$catParent = new Category((int)$category->id_parent);
$category->level_depth = $catParent->level_depth +1;
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$category->level_depth.' WHERE `id_category` = '.(int)$category->id);
}
} }
Category::regenerateEntireNtree(); Category::regenerateEntireNtree();
+14
View File
@@ -172,6 +172,13 @@ INSERT INTO `PREFIX_order_history` (`id_order_history`, `id_employee`, `id_order
INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'Apple Computer, Inc', NOW(), NOW(), 1); INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'Apple Computer, Inc', NOW(), NOW(), 1);
INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES(2, 'Shure Incorporated', NOW(), NOW(), 1); INSERT INTO `PREFIX_manufacturer` (`id_manufacturer`, `name`, `date_add`, `date_upd`, `active`) VALUES(2, 'Shure Incorporated', NOW(), NOW(), 1);
INSERT INTO `PREFIX_manufacturer_lang` (`id_manufacturer`, `id_lang`, `description`, `short_description`, `meta_title`, `meta_keywords`, `meta_description`) VALUES
(1, 1, '', '', '', '', ''),
(1, 2, '', '', '', '', ''),
(1, 3, '', '', '', '', ''),
(1, 4, '', '', '', '', ''),
(1, 5, '', '', '', '', '');
INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `lastname`, `firstname`, `address1`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`) INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `lastname`, `firstname`, `address1`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`)
VALUES (1, 21, 5, 0, 1, 0, 'manufacturer', 'JOBS', 'STEVE', '1 Infinite Loop', '95014', 'Cupertino', '(800) 275-2273', NOW(), NOW(), 1, 0); VALUES (1, 21, 5, 0, 1, 0, 'manufacturer', 'JOBS', 'STEVE', '1 Infinite Loop', '95014', 'Cupertino', '(800) 275-2273', NOW(), NOW(), 1, 0);
INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `company`, `lastname`, `firstname`, `address1`, `address2`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`) INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_customer`, `id_manufacturer`, `id_supplier`, `alias`, `company`, `lastname`, `firstname`, `address1`, `address2`, `postcode`, `city`, `phone`, `date_add`, `date_upd`, `active`, `deleted`)
@@ -180,6 +187,13 @@ INSERT INTO `PREFIX_address` (`id_address`, `id_country`, `id_state`, `id_custom
INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'AppleStore', NOW(), NOW(), 1); INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (1, 'AppleStore', NOW(), NOW(), 1);
INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (2, 'Shure Online Store', NOW(), NOW(), 1); INSERT INTO `PREFIX_supplier` (`id_supplier`, `name`, `date_add`, `date_upd`, `active`) VALUES (2, 'Shure Online Store', NOW(), NOW(), 1);
INSERT INTO `PREFIX_supplier_lang` (`id_supplier`, `id_lang`, `description`, `meta_title`, `meta_keywords`, `meta_description`) VALUES
(1, 1, '', '', '', ''),
(1, 2, '', '', '', ''),
(1, 3, '', '', '', ''),
(1, 4, '', '', '', ''),
(1, 5, '', '', '', '');
INSERT INTO `PREFIX_product` (`id_product`, `indexed`, `id_supplier`, `id_manufacturer`, `id_tax_rules_group`, `id_category_default`, `id_color_default`, `on_sale`, `online_only`, `ean13`, `ecotax`, `quantity`, `price`, `wholesale_price`, `reference`, `supplier_reference`, `weight`, `out_of_stock`, `quantity_discount`, `customizable`, `uploadable_files`, `text_fields`, `active`, `date_add`, `date_upd`) VALUES INSERT INTO `PREFIX_product` (`id_product`, `indexed`, `id_supplier`, `id_manufacturer`, `id_tax_rules_group`, `id_category_default`, `id_color_default`, `on_sale`, `online_only`, `ean13`, `ecotax`, `quantity`, `price`, `wholesale_price`, `reference`, `supplier_reference`, `weight`, `out_of_stock`, `quantity_discount`, `customizable`, `uploadable_files`, `text_fields`, `active`, `date_add`, `date_upd`) VALUES
(1, 1, 1, 1, 1, 2, 2, 0, 0, '0', 0.00, 800, 124.581940, 70.000000, '', '', 0.5, 2, 0, 0, 0, 0, 1, NOW(), NOW()), (1, 1, 1, 1, 1, 2, 2, 0, 0, '0', 0.00, 800, 124.581940, 70.000000, '', '', 0.5, 2, 0, 0, 0, 0, 1, NOW(), NOW()),
(2, 1, 1, 1, 1, 2, 0, 0, 0, '0', 0.00, 100, 66.053500, 33.000000, '', '', 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()), (2, 1, 1, 1, 1, 2, 0, 0, 0, '0', 0.00, 100, 66.053500, 33.000000, '', '', 0, 2, 0, 0, 0, 0, 1, NOW(), NOW()),