[*] 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:
vChabot
2011-09-21 10:04:54 +00:00
parent 526a94a0e6
commit d0102a81b7
10 changed files with 241 additions and 27 deletions
@@ -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']);
}
}
+1
View File
@@ -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;
+3 -1
View File
@@ -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';