[*] BO : Features are now sortable.

This commit is contained in:
vChabot
2011-09-23 15:45:40 +00:00
parent c21c00f350
commit 02036512c0
12 changed files with 250 additions and 12 deletions
+42
View File
@@ -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_feature_position()
{
$features = Db::getInstance()->ExecuteS('
SELECT `id_feature`
FROM `'._DB_PREFIX_.'feature`');
$i = 0;
if (sizeof($features) && is_array($features))
foreach ($features as $feature)
{
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'feature`
SET `position` = '.$i++.'
WHERE `id_feature` = '.(int)$feature['id_feature']);
}
}
+1
View File
@@ -641,6 +641,7 @@ CREATE TABLE `PREFIX_employee` (
CREATE TABLE `PREFIX_feature` (
`id_feature` int(10) unsigned NOT NULL auto_increment,
`position` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id_feature`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
+1 -1
View File
@@ -371,7 +371,7 @@ INSERT INTO `PREFIX_product_attribute_combination` (`id_attribute`, `id_product_
(4, 26),(5, 10),(5, 35),(5, 36),(6, 8),(6, 39),(6, 40),(7, 33),(7, 34),(8, 13),(8, 15),(9, 12),(9, 14),(10, 12),(10, 13),(11, 14),(11, 15),(14, 31),(14, 32),(15, 19),
(15, 26),(15, 28),(15, 30),(15, 32),(15, 34),(15, 36),(15, 40),(15, 42),(16, 22),(16, 25),(16, 27),(16, 29),(16, 31),(16, 33),(16, 35),(16, 39),(16, 41),(17, 23),(18, 41),(18, 42),(19, 27),(19, 28);
INSERT INTO `PREFIX_feature` (`id_feature`) VALUES (1), (2), (3), (4), (5);
INSERT INTO `PREFIX_feature` (`id_feature`, `position`) VALUES (1, 0), (2, 1), (3, 2), (4, 3), (5, 4);
INSERT INTO `PREFIX_feature_group_shop` (`id_feature`, `id_group_shop`) (SELECT `id_feature`, 1 FROM PREFIX_feature);
+4
View File
@@ -151,3 +151,7 @@ ALTER TABLE `PREFIX_product_download` ADD `is_shareable` TINYINT( 1 ) UNSIGNED N
ALTER TABLE `PREFIX_attribute_group` ADD `position` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
/* PHP:add_group_attribute_position(); */;
ALTER TABLE `PREFIX_feature` ADD `position` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
/* PHP:add_feature_position(); */;