diff --git a/admin-dev/themes/default/js/admin-theme.js b/admin-dev/themes/default/js/admin-theme.js index fadac511a..4fbf3b363 100755 --- a/admin-dev/themes/default/js/admin-theme.js +++ b/admin-dev/themes/default/js/admin-theme.js @@ -129,5 +129,34 @@ $( document ).ready(function() { $(window).scroll(function() { animateGoTop(); }); - animateGoTop(); -}); \ No newline at end of file +}); + +function openModulesList() { + if (!modules_list_loaded) + { + $.ajax({ + type: "POST", + url : admin_modules_link, + async: true, + data : { + ajax : "1", + controller : "AdminModules", + action : "getTabModulesList", + tab_modules_list : tab_modules_list, + back_tab_modules_list : window.location.href + }, + success : function(data) + { + $('#modules_list_container_tab').html(data).slideDown(); + $('#modules_list_loader').hide(); + modules_list_loaded = true; + } + }); + } + else + { + $('#modules_list_container_tab').slideDown(); + $('#modules_list_loader').hide(); + } + return false; +} diff --git a/admin-dev/themes/default/template/controllers/modules/favorites.tpl b/admin-dev/themes/default/template/controllers/modules/favorites.tpl index 1596032a0..738e56c5b 100755 --- a/admin-dev/themes/default/template/controllers/modules/favorites.tpl +++ b/admin-dev/themes/default/template/controllers/modules/favorites.tpl @@ -1,4 +1,28 @@ - {include file='controllers/modules/header.tpl'} +{* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 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/afl-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 +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +{include file='controllers/modules/top.tpl'}
diff --git a/admin-dev/themes/default/template/controllers/modules/page.tpl b/admin-dev/themes/default/template/controllers/modules/page.tpl index e18bfe7f4..d088fd9a2 100644 --- a/admin-dev/themes/default/template/controllers/modules/page.tpl +++ b/admin-dev/themes/default/template/controllers/modules/page.tpl @@ -22,28 +22,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -{$kpis} - -
-

- {l s='List of modules'} -

-
-
- -
-
-
+{include file='controllers/modules/top.tpl'} {if $add_permission eq '1'}
diff --git a/admin-dev/themes/default/template/controllers/modules/top.tpl b/admin-dev/themes/default/template/controllers/modules/top.tpl new file mode 100644 index 000000000..91029ef1b --- /dev/null +++ b/admin-dev/themes/default/template/controllers/modules/top.tpl @@ -0,0 +1,45 @@ +{* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 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/afl-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 +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +{$kpis} + +
+

+ {l s='List of modules'} +

+
+
+ +
+
+
\ No newline at end of file diff --git a/admin-dev/themes/default/template/footer.tpl b/admin-dev/themes/default/template/footer.tpl index d13be1447..dee3e7560 100644 --- a/admin-dev/themes/default/template/footer.tpl +++ b/admin-dev/themes/default/template/footer.tpl @@ -32,15 +32,18 @@ PrestaShop™ {$ps_version} - {l s='Load time: '} {number_format(microtime(true) - $timer_start, 3, '.', '')}s
diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index 3eca86fd3..397b224e9 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -72,6 +72,8 @@ var currentIndex = '{$currentIndex}'; var default_language = '{$default_language|intval}'; var choose_language_translate = "{l s='Choose language' slashes=1}"; + var admin_modules_link = '{$link->getAdminLink("AdminModules")|addslashes}'; + var tab_modules_list = '{if isset($tab_modules_list) && $tab_modules_list}{$tab_modules_list|addslashes}{/if}'; {/if} {if isset($css_files)} diff --git a/admin-dev/themes/default/template/page_header_toolbar.tpl b/admin-dev/themes/default/template/page_header_toolbar.tpl index eeaba22db..92116296b 100644 --- a/admin-dev/themes/default/template/page_header_toolbar.tpl +++ b/admin-dev/themes/default/template/page_header_toolbar.tpl @@ -68,8 +68,7 @@ if (btn_submit.html().length > 0) lbl_save.find('span').html(btn_submit.html()); - if (btn_save_and_stay.length > 0) - { + if (btn_save_and_stay.length > 0) { //get reference on current save link label lbl_save_and_stay = $('#page-header-desc-{$table}-save-and-stay'); @@ -100,12 +99,10 @@ return false; }); - if (btn_save_and_stay) - { + if (btn_save_and_stay) { btn_save_and_stay.click(function() { //add hidden input to emulate submit button click when posting the form -> field name posted btn_submit.before(''); - $('#{$table}_form').submit(); return false; }); @@ -113,47 +110,17 @@ {/block} } - {if isset($tab_modules_open)} - if ({$tab_modules_open}) - openModulesList(); + {if isset($tab_modules_open) && $tab_modules_open} + $('#modules_list_container').modal('show'); + openModulesList(); {/if} }); + {if isset($tab_modules_list)} - $('.process-icon-modules-list').parent('a').unbind().bind('click', function (){ - openModulesList(); - }); - - function openModulesList() - { - $('#modules_list_container').modal('show'); - if (!modules_list_loaded) - { - $.ajax({ - type: "POST", - url : '{$admin_module_ajax_url}', - async: true, - data : { - ajax : "1", - controller : "AdminModules", - action : "getTabModulesList", - tab_modules_list : '{$tab_modules_list}', - back_tab_modules_list : '{$back_tab_modules_list}' - }, - success : function(data) - { - $('#modules_list_container_tab').html(data).slideDown(); - $('#modules_list_loader').hide(); - modules_list_loaded = true; - } - }); - } - else - { - $('#modules_list_container_tab').slideDown(); - $('#modules_list_loader').hide(); - } - return false; - } + $('.process-icon-modules-list').parent('a').unbind().bind('click', function (){ + $('#modules_list_container').modal('show'); + openModulesList(); + }); {/if} //]]> diff --git a/admin-dev/themes/default/template/toolbar.tpl b/admin-dev/themes/default/template/toolbar.tpl index b59459ebc..c2eb566ee 100644 --- a/admin-dev/themes/default/template/toolbar.tpl +++ b/admin-dev/themes/default/template/toolbar.tpl @@ -46,7 +46,7 @@ {/foreach} - diff --git a/classes/Autoload.php b/classes/Autoload.php index 5f832d932..dc780e1b8 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -139,15 +139,16 @@ class Autoload else { $filename_tmp = tempnam(dirname($filename), basename($filename.'.')); - if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE) + if ($filename_tmp !== false AND file_put_contents($filename_tmp, $content, LOCK_EX) !== false) { - @rename($filename_tmp, $filename); + if (!@rename($filename_tmp, $filename)) + unlink($filename_tmp); @chmod($filename, 0666); } + // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die. else - // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die. error_log('Cannot write temporary file '.$filename_tmp); - } + } $this->index = $classes; } @@ -189,4 +190,4 @@ class Autoload { return isset($this->index[$classname]) ? $this->index[$classname] : null; } -} +} \ No newline at end of file diff --git a/classes/Employee.php b/classes/Employee.php index 25a4fb383..8c6397337 100644 --- a/classes/Employee.php +++ b/classes/Employee.php @@ -64,7 +64,7 @@ class EmployeeCore extends ObjectModel public $bo_width; /** @var bool, false */ - public $bo_menu; + public $bo_menu = 1; /* Deprecated */ public $bo_show_screencast = false; diff --git a/install-dev/data/db_structure.sql b/install-dev/data/db_structure.sql index e0a2a934f..8d6096eb4 100644 --- a/install-dev/data/db_structure.sql +++ b/install-dev/data/db_structure.sql @@ -724,7 +724,7 @@ CREATE TABLE `PREFIX_employee` ( `bo_theme` varchar(32) default NULL, `default_tab` int(10) unsigned NOT NULL DEFAULT 0, `bo_width` int(10) unsigned NOT NULL DEFAULT 0, - `bo_menu` tinyint(1) NOT NULL default '0', + `bo_menu` tinyint(1) NOT NULL default '1', `active` tinyint(1) unsigned NOT NULL default '0', `id_last_order` int(10) unsigned NOT NULL default '0', `id_last_customer_message` int(10) unsigned NOT NULL default '0', diff --git a/install-dev/upgrade/sql/1.6.0.1.sql b/install-dev/upgrade/sql/1.6.0.1.sql index f870067b3..f03d2a719 100644 --- a/install-dev/upgrade/sql/1.6.0.1.sql +++ b/install-dev/upgrade/sql/1.6.0.1.sql @@ -3,8 +3,8 @@ SET NAMES 'utf8'; INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_DASHBOARD_USE_PUSH', '0', NOW(), NOW()); UPDATE `PREFIX_configuration` SET `value` = 'graphnvd3' WHERE `name` = 'PS_STATS_RENDER'; -ALTER TABLE `PREFIX_employee` CHANGE `bo_show_screencast` `bo_menu` TINYINT(1) NOT NULL DEFAULT '0'; -UPDATE `PREFIX_employee` SET bo_menu = 0; +ALTER TABLE `PREFIX_employee` CHANGE `bo_show_screencast` `bo_menu` TINYINT(1) NOT NULL DEFAULT '1'; +UPDATE `PREFIX_employee` SET bo_menu = 1; CREATE TABLE `PREFIX_configuration_kpi` ( `id_configuration_kpi` int(10) unsigned NOT NULL auto_increment, @@ -30,4 +30,4 @@ CREATE TABLE `PREFIX_configuration_kpi_lang` ( /* PHP:ps1600_add_missing_index(); */; -UPDATE `PREFIX_configuration` SET `value`='-' WHERE `name`='PS_ATTRIBUTE_ANCHOR_SEPARATOR'; \ No newline at end of file +UPDATE `PREFIX_configuration` SET `value`='-' WHERE `name` = 'PS_ATTRIBUTE_ANCHOR_SEPARATOR';