[*] BO : You have now 3 new default groups. Unidentified group, guest group, and customer group.

This commit is contained in:
vChabot
2011-11-17 17:22:15 +00:00
parent fddc403a09
commit 67fc5d1600
11 changed files with 288 additions and 100 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 6844 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function add_new_groups($french, $standard)
{
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'group` (`id_group`, `date_add`, `date_upd`) VALUES (NULL, NOW(), NOW())');
$last_id = Db::getInstance()->Insert_ID();
$languages = Language::getLanguages(false);
$sql = '';
foreach ($languages as $lang)
if (strtolower($lang['iso_code']) == 'fr')
$sql .= '('.(int)$last_id.', '.(int)$lang['id_lang'].', "'.pSQL($french).'"),';
else
$sql .= '('.(int)$last_id.', '.(int)$lang['id_lang'].', "'.pSQL($standard).'"),';
$sql = substr($sql, 0, strlen($sql) - 1);
DB::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'group_lang` (`id_group`, `id_lang`, `name`) VALUES '.$sql);
}
+110 -6
View File
@@ -2,7 +2,7 @@ SET NAMES 'utf8';
/* Carrier */
INSERT INTO `PREFIX_carrier` (`id_carrier`, `id_reference`, `id_tax_rules_group`, `name`, `active`, `deleted`, `shipping_handling`, `is_free`, `position`) VALUES (2, 2, 1, 'My carrier', 1, 0, 1, 0, 1);
INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) VALUES (2, 1);
INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) VALUES (2, 2), (2, 3);
INSERT INTO `PREFIX_carrier_shop` (`id_carrier`, `id_shop`) VALUES (2, 1);
INSERT INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`) VALUES (2, 1, 'Delivery next day!'),(2, 2, 'Livraison le lendemain !'),(2, 3, '¡Entrega día siguiente!'),(2, 4, 'Zustellung am nächsten Tag!'),(2, 5, 'Consegna il giorno dopo!');
INSERT INTO `PREFIX_carrier_zone` (`id_carrier`, `id_zone`) VALUES (2, 1),(2, 2);
@@ -159,11 +159,11 @@ INSERT INTO `PREFIX_range_weight` (`id_range_weight`, `id_carrier`, `delimiter1`
INSERT INTO `PREFIX_delivery` (`id_delivery`, `id_range_price`, `id_range_weight`, `id_carrier`, `id_zone`, `price`) VALUES
(1, NULL, 1, 2, 1, 5.00),(2, NULL, 1, 2, 2, 5.00),(4, 1, NULL, 2, 1, 5.00),(5, 1, NULL, 2, 2, 5.00);
INSERT INTO `PREFIX_customer_group` (`id_customer`, `id_group`) VALUES (1, 1);
INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) VALUES (2, 1),(3, 1),(4, 1);
INSERT INTO `PREFIX_customer_group` (`id_customer`, `id_group`) VALUES (1, 3);
INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) VALUES (2, 1),(3, 1),(4, 1),(2, 2),(3, 2),(4, 2),(2, 3),(3, 3),(4, 3);
INSERT INTO `PREFIX_customer` (`id_customer`, `id_gender`, `id_default_group`, `secure_key`, `email`, `passwd`, `birthday`, `lastname`, `newsletter`, `optin`, `firstname`, `active`, `is_guest`, `date_add`, `date_upd`)
VALUES (1, 1, 1, '47ce86627c1f3c792a80773c5d2deaf8', 'pub@prestashop.com', 'ad807bdf0426766c05c64041124d30ce', '1970-01-15', 'DOE', 1, 1, 'John', 1, 0, NOW(), NOW());
VALUES (1, 1, 3, '47ce86627c1f3c792a80773c5d2deaf8', 'pub@prestashop.com', 'ad807bdf0426766c05c64041124d30ce', '1970-01-15', 'DOE', 1, 1, 'John', 1, 0, NOW(), NOW());
INSERT INTO `PREFIX_connections` (`id_connections`, `id_guest`, `id_page`, `ip_address`, `date_add`, `http_referer`)
VALUES (1, 1, 1, '2130706433', NOW(), 'http://www.prestashop.com');
INSERT INTO `PREFIX_guest` (`id_guest`, `id_operating_system`, `id_web_browser`, `id_customer`, `javascript`, `screen_resolution_x`, `screen_resolution_y`, `screen_color`, `sun_java`, `adobe_flash`, `adobe_director`, `apple_quicktime`, `real_player`, `windows_media`, `accept_language`)
@@ -474,7 +474,7 @@ INSERT INTO `PREFIX_cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES (
/* Currency/Country module */
INSERT INTO `PREFIX_module_currency` (`id_module`, `id_currency`) VALUES (3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(6, 1),(6, 2),(6, 3);
INSERT INTO `PREFIX_module_group` (`id_module`, `id_group`) VALUES (3, 1),(4, 1),(6, 1);
INSERT INTO `PREFIX_module_group` (`id_module`, `id_group`) VALUES (3, 2),(4, 2),(6, 2),(3, 3),(4, 3),(6, 3);
INSERT INTO `PREFIX_module_country` (`id_module`, `id_country`) VALUES (3, 1),(3, 2),(3, 3),(3, 4),(3, 5),(3, 6),(3, 7),(3, 8),
(3, 9),(3, 10),(3, 11),(3, 12),(3, 13),(3, 14),(3, 15),(3, 16),(3, 17),(3, 18),(3, 19),(3, 20),(3, 21),(3, 22),(3, 23),(3, 24),
@@ -1225,7 +1225,111 @@ INSERT INTO `PREFIX_group_module_restriction` (`id_group`, `id_module`, `authori
("1", "52", "1"),
("1", "53", "1"),
("1", "54", "1"),
("1", "55", "1");
("1", "55", "1"),
("2", "1", "1"),
("2", "2", "1"),
("2", "3", "1"),
("2", "4", "1"),
("2", "5", "1"),
("2", "6", "1"),
("2", "7", "1"),
("2", "8", "1"),
("2", "9", "1"),
("2", "10", "1"),
("2", "11", "1"),
("2", "12", "1"),
("2", "13", "1"),
("2", "14", "1"),
("2", "15", "1"),
("2", "16", "1"),
("2", "17", "1"),
("2", "18", "1"),
("2", "19", "1"),
("2", "20", "1"),
("2", "21", "1"),
("2", "22", "1"),
("2", "24", "1"),
("2", "25", "1"),
("2", "26", "1"),
("2", "27", "1"),
("2", "28", "1"),
("2", "30", "1"),
("2", "31", "1"),
("2", "32", "1"),
("2", "33", "1"),
("2", "34", "1"),
("2", "35", "1"),
("2", "36", "1"),
("2", "37", "1"),
("2", "39", "1"),
("2", "40", "1"),
("2", "41", "1"),
("2", "42", "1"),
("2", "43", "1"),
("2", "44", "1"),
("2", "45", "1"),
("2", "46", "1"),
("2", "47", "1"),
("2", "48", "1"),
("2", "49", "1"),
("2", "50", "1"),
("2", "51", "1"),
("2", "52", "1"),
("2", "53", "1"),
("2", "54", "1"),
("2", "55", "1"),
("3", "1", "1"),
("3", "2", "1"),
("3", "3", "1"),
("3", "4", "1"),
("3", "5", "1"),
("3", "6", "1"),
("3", "7", "1"),
("3", "8", "1"),
("3", "9", "1"),
("3", "10", "1"),
("3", "11", "1"),
("3", "12", "1"),
("3", "13", "1"),
("3", "14", "1"),
("3", "15", "1"),
("3", "16", "1"),
("3", "17", "1"),
("3", "18", "1"),
("3", "19", "1"),
("3", "20", "1"),
("3", "21", "1"),
("3", "22", "1"),
("3", "24", "1"),
("3", "25", "1"),
("3", "26", "1"),
("3", "27", "1"),
("3", "28", "1"),
("3", "30", "1"),
("3", "31", "1"),
("3", "32", "1"),
("3", "33", "1"),
("3", "34", "1"),
("3", "35", "1"),
("3", "36", "1"),
("3", "37", "1"),
("3", "39", "1"),
("3", "40", "1"),
("3", "41", "1"),
("3", "42", "1"),
("3", "43", "1"),
("3", "44", "1"),
("3", "45", "1"),
("3", "46", "1"),
("3", "47", "1"),
("3", "48", "1"),
("3", "49", "1"),
("3", "50", "1"),
("3", "51", "1"),
("3", "52", "1"),
("3", "53", "1"),
("3", "54", "1"),
("3", "55", "1");
INSERT INTO `PREFIX_stock_available` (`id_stock_available`, `id_product`, `id_product_attribute`, `id_shop`, `quantity`, `depends_on_stock`, `out_of_stock`) VALUES
(1, 2, 7, 1, 10, 0, 2),
+12 -6
View File
@@ -319,7 +319,7 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
(143, 'PS_VIRTUAL_PROD_FEATURE_ACTIVE', '0', NOW(), NOW()),
(144, 'PS_CUSTOMIZATION_FEATURE_ACTIVE', '0', NOW(), NOW()),
(145, 'PS_CART_RULE_FEATURE_ACTIVE', '0', NOW(), NOW()),
(146, 'PS_GROUP_FEATURE_ACTIVE', '0', NOW(), NOW()),
(146, 'PS_GROUP_FEATURE_ACTIVE', '1', NOW(), NOW()),
(147, 'PS_PACK_FEATURE_ACTIVE', '0', NOW(), NOW()),
(148, 'PS_ALIAS_FEATURE_ACTIVE', '1', NOW(), NOW()),
(149, 'PS_CARRIER_DEFAULT', '1', NOW(), NOW()),
@@ -334,7 +334,10 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
(158, 'PS_STOCK_MVT_TRANSFER_FROM', '6', NOW(), NOW()),
(159, 'PS_CARRIER_DEFAULT_ORDER', '0', NOW(), NOW()),
(160, 'PS_STOCK_MVT_SUPPLY_ORDER', '8', NOW(), NOW()),
(161, 'PS_STOCK_CUSTOMER_ORDER_REASON', '3', NOW(), NOW());
(161, 'PS_STOCK_CUSTOMER_ORDER_REASON', '3', NOW(), NOW()),
(162, 'PS_UNIDENTIFIED_GROUP', '1', NOW(), NOW()),
(163, 'PS_GUEST_GROUP', '2', NOW(), NOW()),
(164, 'PS_CUSTOMER_GROUP', '3', NOW(), NOW());
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES
(36, 1, 'IN', NOW()),(36, 2, 'FA', NOW()),(36, 3, 'CU', NOW()),(36, 4, 'FA', NOW()),(36, 5, 'FA', NOW()),
@@ -1344,7 +1347,7 @@ INSERT INTO `PREFIX_cms_category` (`id_cms_category`, `id_parent`, `level_depth`
/* Carrier */
INSERT INTO `PREFIX_carrier` (`id_carrier`, `id_reference`, `id_tax_rules_group`, `name`, `active`, `deleted`, `shipping_handling`, `position`) VALUES (1, 1, 0, 0, 1, 0, 0, 0);
INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) VALUES (1, 1);
INSERT INTO `PREFIX_carrier_group` (`id_carrier`, `id_group`) (SELECT 1, `id_group` FROM `PREFIX_group`);
INSERT INTO `PREFIX_carrier_lang` (`id_carrier`, `id_lang`, `delay`) VALUES (1, 1, 'Pick up in-store'),(1, 2, 'Retrait au magasin'),(1, 3, 'Recogida en la tienda'),(1, 4, 'Abholung im Geschäft'),(1, 5, 'Ritiro in magazzino');
@@ -1432,12 +1435,15 @@ INSERT INTO `PREFIX_timezone` (`name`) VALUES ('Africa/Abidjan'),('Africa/Accra'
('US/East-Indiana'),('US/Eastern'),('US/Hawaii'),('US/Indiana-Starke'),('US/Michigan'),('US/Mountain'),('US/Pacific'),('US/Pacific-New'),('US/Samoa'),
('UTC'),('W-SU'),('WET'),('Zulu');
INSERT INTO `PREFIX_group` (`id_group`, `reduction`, `date_add`, `date_upd`) VALUES (1, 0, NOW(), NOW());
INSERT INTO `PREFIX_group` (`id_group`, `reduction`, `date_add`, `date_upd`) VALUES (1, 0, NOW(), NOW()), (2, 0, NOW(), NOW()), (3, 0, NOW(), NOW());
INSERT INTO `PREFIX_group_lang` (`id_group`, `id_lang`, `name`) VALUES (1, 1, 'Default'),(1, 2, 'Défaut'),(1, 3, 'Predeterminado'),(1, 4, 'Default'),(1, 5, 'Default');
INSERT INTO `PREFIX_group_lang` (`id_group`, `id_lang`, `name`) VALUES
(1, 1, 'Unidentified'),(1, 2, 'Non identifié'),(1, 3, 'Unidentified'),(1, 4, 'Unidentified'),(1, 5, 'Unidentified'),
(2, 1, 'Guest'),(2, 2, 'Invité'),(2, 3, 'Guest'),(2, 4, 'Guest'),(2, 5, 'Guest'),
(3, 1, 'Default'),(3, 2, 'Défaut'),(3, 3, 'Predeterminado'),(3, 4, 'Default'),(3, 5, 'Default');
INSERT INTO `PREFIX_group_group_shop` (`id_group`, `id_group_shop`) (SELECT `id_group`, 1 FROM `PREFIX_group`);
INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) VALUES (1, 1);
INSERT INTO `PREFIX_category_group` (`id_category`, `id_group`) (SELECT 1, `id_group` FROM `PREFIX_group`);
INSERT INTO `PREFIX_stock_mvt_reason` (`id_stock_mvt_reason`, `sign`, `date_add`, `date_upd`) VALUES
(1, 1, NOW(), NOW()),
+10 -5
View File
@@ -499,6 +499,7 @@ ALTER TABLE `PREFIX_tax` ADD COLUMN `account_number` VARCHAR(64) NOT NULL;
/* PHP:add_new_tab(AdminCMS, fr:Pages CMS|es:CMS pages|en:CMS pages|de:CMS pages|it:CMS pages, -1); */;
UPDATE `PREFIX_quick_access` SET `link` = 'index.php?controller=AdminCategories&addcategory' WHERE `id_quick_access` = 3;
UPDATE `PREFIX_quick_access` SET `link` = 'index.php?controller=AdminProducts&addproduct' WHERE `id_quick_access` = 4;
UPDATE `PREFIX_access` SET `view` = '1' WHERE `id_profile` = 5 AND `id_tab` = 95;
@@ -510,19 +511,19 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 93, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
);
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 94, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
);
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 101, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
);
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 102, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
);
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 103, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
);
INSERT INTO `PREFIX_access` ( `id_profile` , `id_tab` , `view` , `add` , `edit` , `delete` ) (
SELECT `id_profile`, 104, 1, 1, 1, 1 FROM `PREFIX_profile` WHERE `id_profile` != 1 AND `id_profile` != 2
)
@@ -539,3 +540,7 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES ('4', '106', '1', '1', '1', '1');
INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES ('5', '106', '0', '0', '0', '0');
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) ('PS_CUSTOMER_GROUP', '1', NOW(), NOW());
/* PHP:add_new_groups('Non identifié', 'Unidentified'); */;
/* PHP:add_new_groups('Invité', 'Guest'); */;