// Fixed #PSTEST-751

This commit is contained in:
bMancone
2012-02-20 17:46:11 +00:00
parent 669c8afc5a
commit a1a6ca9a8d
11 changed files with 79 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

View File

@@ -7,5 +7,6 @@
<gender id="Mr" type="0"/>
<gender id="Ms" type="1"/>
<gender id="Miss" type="1"/>
<gender id="Unknown" type="2"/>
</entities>
</entity_gender>

View File

@@ -19,7 +19,7 @@
<field name="is_guest"/>
</fields>
<entities>
<customer id="John" id_gender="" id_default_group="3" firstname="John" lastname="DOE" passwd="75b019568bc6c84dda367661e855bdc2" last_passwd_gen="2012-02-01 09:08:06" birthday="1970-01-15" newsletter="1" ip_registration_newsletter="" newsletter_date_add="0000-00-00 00:00:00" optin="1" secure_key="b59e02456693eb0903a3645512ac9e1a" active="1" is_guest="0">
<customer id="John" id_gender="4" id_default_group="3" firstname="John" lastname="DOE" passwd="75b019568bc6c84dda367661e855bdc2" last_passwd_gen="2012-02-01 09:08:06" birthday="1970-01-15" newsletter="1" ip_registration_newsletter="" newsletter_date_add="0000-00-00 00:00:00" optin="1" secure_key="b59e02456693eb0903a3645512ac9e1a" active="1" is_guest="0">
<email>pub@prestashop.com</email>
<note/>
</customer>

View File

@@ -3,4 +3,5 @@
<gender id="Mr" name="Herr"/>
<gender id="Ms" name="Frau"/>
<gender id="Miss" name="Miss"/>
<gender id="Unknown" name="Unbekannte"/>
</entity_gender>

View File

@@ -3,4 +3,5 @@
<gender id="Mr" name="Mr."/>
<gender id="Ms" name="Ms."/>
<gender id="Miss" name="Miss"/>
<gender id="Unknown" name="Unknown"/>
</entity_gender>

View File

@@ -3,4 +3,5 @@
<gender id="Mr" name="Sr."/>
<gender id="Ms" name="Sra."/>
<gender id="Miss" name="Miss"/>
<gender id="Unknown" name="Desconocido"/>
</entity_gender>

View File

@@ -3,4 +3,5 @@
<gender id="Mr" name="M."/>
<gender id="Ms" name="Mme"/>
<gender id="Miss" name="Melle"/>
<gender id="Unknown" name="Inconnu"/>
</entity_gender>

View File

@@ -3,4 +3,5 @@
<gender id="Mr" name="Sig."/>
<gender id="Ms" name="Sig.ra"/>
<gender id="Miss" name="Miss"/>
<gender id="Unknown" name="Sconosciuto"/>
</entity_gender>

View File

@@ -0,0 +1,63 @@
<?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$
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function add_unknown_gender()
{
$res = true;
// creates the new gender
$id_type = 2;
$res &= Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'gender` (`type`)
VALUES ('.(int)$id_type.')');
// retrieves its id
$id_gender = Db::getInstance()->Insert_ID();
// inserts lang values
$languages = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'lang`');
$lang_names = array(
1 => 'Unknown',
2 => 'Unbekannte',
3 => 'Desconocido',
4 => 'Inconnu',
5 => 'Sconosciuto',
);
foreach ($languages as $lang)
{
$res &= Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'gender_lang` (`id_gender`, `id_lang`, `name`) VALUES
('.(int)$id_gender.', '.(int)$lang['id_lang'].', \''.pSQL($lang_names[$lang['id_lang']]).'\')');
}
// for all clients where id gender is 0, sets the new id gender
$res &= Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'customers`
SET `id_gender` = '.(int)$id_gender.'
WHERE `id_gender` = 0');
}

View File

@@ -9,6 +9,8 @@ SET o.`current_state` = (
LIMIT 1
);
/* PHP:add_unknown_gender(); */;
ALTER TABLE `PREFIX_cart_rule` ADD `gift_product_attribute` int(10) unsigned NOT NULL default 0 AFTER `gift_product`;
UPDATE `PREFIX_product` set is_virtual = 1 WHERE id_product IN (SELECT id_product FROM `PREFIX_product_download` WHERE active = 1);