[*] BO : groups attributes are now sortable
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8683 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?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_group_attribute_position()
|
||||
{
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'attribute_group`');
|
||||
$i = 0;
|
||||
if (sizeof($groups) && is_array($groups))
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'attribute_group`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_attribute_group` = '.(int)$group['id_attribute_group']);
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,7 @@ CREATE TABLE `PREFIX_attribute` (
|
||||
CREATE TABLE `PREFIX_attribute_group` (
|
||||
`id_attribute_group` int(10) unsigned NOT NULL auto_increment,
|
||||
`is_color_group` tinyint(1) NOT NULL default '0',
|
||||
`position` int(10) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id_attribute_group`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
@@ -146,4 +146,6 @@ ALTER TABLE `PREFIX_attribute` ADD `position` INT( 10 ) UNSIGNED NOT NULL DEFAUL
|
||||
ALTER TABLE `PREFIX_product_download` CHANGE `date_deposit` `date_add` DATETIME NOT NULL ;
|
||||
ALTER TABLE `PREFIX_product_download` CHANGE `physically_filename` `filename` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
|
||||
ALTER TABLE `PREFIX_product_download` ADD `id_product_attribute` INT( 10 ) UNSIGNED NOT NULL AFTER `id_product` , ADD INDEX ( `id_product_attribute` );
|
||||
ALTER TABLE `PREFIX_product_download` ADD `is_shareable` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `active`
|
||||
ALTER TABLE `PREFIX_product_download` ADD `is_shareable` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `active`;
|
||||
|
||||
ALTER TABLE `PREFIX_attribute_group` ADD `position` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
Reference in New Issue
Block a user