// Dashboard update

This commit is contained in:
Damien Metzger
2013-10-11 16:18:52 +02:00
parent 0f28393c8f
commit 0e91352520
2 changed files with 21 additions and 37 deletions
@@ -1,36 +0,0 @@
<?php
/*
* 2007-2013 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-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function moduleReinstaller($moduleName, $force = false)
{
$module = Module::getInstanceByName($moduleName);
if (!is_object($module))
die(Tools::displayError());
if ($module->uninstall() OR $force)
return $module->install();
return false;
}
+21 -1
View File
@@ -32,4 +32,24 @@ CREATE TABLE `PREFIX_configuration_kpi_lang` (
UPDATE `PREFIX_configuration` SET `value`='-' WHERE `name` = 'PS_ATTRIBUTE_ANCHOR_SEPARATOR';
UPDATE `PREFIX_tab` SET class_name = 'AdminDashboard' WHERE class_name = 'AdminHome';
UPDATE `PREFIX_tab` SET class_name = 'AdminDashboard', id_parent = 0, active = 1, module = "" WHERE class_name = 'AdminHome';
INSERT INTO `PREFIX_module` (`name`, `active`, `version`)
VALUES ('dashactivity', '1', '0.1'), ('dashtrends', '1', '0.1'), ('dashproducts', '1', '0.1');
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `view`, `configure`) (
SELECT p.id_profile, m.id_module, 1, 1 FROM `PREFIX_module` m, `PREFIX_profile` p WHERE m.name IN ('dashactivity', 'dashtrends', 'dashproducts')
);
INSERT INTO `PREFIX_module_shop` (`id_module`, `id_shop`) (
SELECT m.id_module, s.id_shop FROM `PREFIX_module` m, `PREFIX_shop` s WHERE m.name IN ('dashactivity', 'dashtrends', 'dashproducts')
);
INSERT INTO `PREFIX_hook` (`name`, `title`, `position`, `live_edit`) VALUES
('dashboardZoneOne', 'dashboardZoneOne', 1, 0),
('dashboardZoneTwo', 'dashboardZoneTwo', 1, 0),
('dashboardData', 'dashboardData', 0, 0);
INSERT INTO `PREFIX_hook_module` (`id_module`, `id_shop`, `id_hook`, `position`) VALUES (
SELECT m.id_module, s.id_shop, h.id_hook, 1 FROM `PREFIX_module` m, `PREFIX_shop` s, `PREFIX_hook` h WHERE m.name IN ('dashactivity', 'dashtrends', 'dashproducts') AND h.name IN ('dashboardZoneOne', 'dashboardZoneTwo', 'dashboardData')
);