From 06a178b8fe1fb8a4982ca5421bdead268af01745 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 12 Sep 2013 18:23:44 +0200 Subject: [PATCH] // Replaced screencast option by menu option --- admin-dev/ajax.php | 9 -- .../template/controllers/home/content.tpl | 125 +++--------------- classes/Employee.php | 9 +- .../admin/AdminEmployeesController.php | 19 ++- controllers/admin/AdminHomeController.php | 17 --- install-dev/data/db_structure.sql | 2 +- install-dev/upgrade/sql/1.6.0.1.sql | 3 + 7 files changed, 41 insertions(+), 143 deletions(-) diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index 8f41e44cb..a8f1f3e28 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -144,15 +144,6 @@ if (Tools::isSubmit('submitTrackClickOnHelp')) HelpAccess::trackClick($label, $version); } -if (Tools::isSubmit('toggleScreencast')) -{ - if (Validate::isLoadedObject($context->employee)) - { - $context->employee->bo_show_screencast = !$context->employee->bo_show_screencast; - $context->employee->update(); - } -} - if (Tools::isSubmit('getChildrenCategories') && Tools::isSubmit('id_category_parent')) { $children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), Context::getContext()->language->id, null, Tools::getValue('use_shop_context')); diff --git a/admin-dev/themes/default/template/controllers/home/content.tpl b/admin-dev/themes/default/template/controllers/home/content.tpl index df2d03d7f..1c1f002b9 100644 --- a/admin-dev/themes/default/template/controllers/home/content.tpl +++ b/admin-dev/themes/default/template/controllers/home/content.tpl @@ -23,110 +23,51 @@ * International Registered Trademark & Property of PrestaShop SA *} -
-

{l s='Dashboard'}

-
+
+

{l s='Dashboard'}

+
- -
- {if $upgrade} -
- {if $upgrade->need_upgrade} -

{l s='A new version of PrestaShop is available.'} : {l s='Download'} {$upgrade->version_name} !

- {/if} -
- {else} -

{l s='Update notifications are unavailable'}

-

 

-

{l s='To receive PrestaShop update warnings, you need to activate you account. '} allow_url_fopen [{l s='more info on php.net'}]

-

{l s='If you don\'t know how to do this, please contact your hosting provider!'}


+
+{if $upgrade} +
+ {if $upgrade->need_upgrade} +

{l s='A new version of PrestaShop is available.'} : {l s='Download'} {$upgrade->version_name} !

{/if} - -{if $employee->bo_show_screencast} -
-

{l s='Video'}

-
- -
-
-

{l s='Take part in the e-commerce adventure with PrestaShop, the best open-source shopping-cart solution on the planet. With more than 310 native features, PrestaShop comes fully equipped to help create a world of opportunity without limits. '}

-
- -
-
- +{else} +

{l s='Update notifications are unavailable'}

+

 

+

{l s='To receive PrestaShop update warnings, you need to activate you account. '} allow_url_fopen [{l s='more info on php.net'}]

+

{l s='If you don\'t know how to do this, please contact your hosting provider!'}


{/if} -

{l s='Quick links'}

-
    - {foreach from=$quick_links key=k item=link} +

    {l s='Quick links'}

    + - + {/foreach} + {hook h="displayAdminHomeQuickLinks"} +

-
- - {$tips_optimization}

{l s='Loading...'}

- {hook h="displayAdminHomeInfos"} {hook h="displayBackOfficeHome"} {*old name of the hook*} -
-

{l s='Your Information'}

+

{l s='Your Information'}

{$monthly_statistics} {$customers_service} {$stats_sales} @@ -136,8 +77,8 @@ $(document).ready(function() {
 
- -
+ +
diff --git a/classes/Employee.php b/classes/Employee.php index 1debb4eed..76462ca55 100644 --- a/classes/Employee.php +++ b/classes/Employee.php @@ -63,8 +63,11 @@ class EmployeeCore extends ObjectModel /** @var integer employee desired screen width */ public $bo_width; - /** @var bool, true */ - public $bo_show_screencast; + /** @var bool, false */ + public $bo_menu; + + /* Deprecated */ + public $bo_show_screencast = false; /** @var boolean Status */ public $active = 1; @@ -90,7 +93,7 @@ class EmployeeCore extends ObjectModel 'default_tab' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'bo_theme' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 32), 'bo_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), - 'bo_show_screencast' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'bo_menu' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'stats_date_from' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'stats_date_to' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), ), diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 892bca213..fad63e9eb 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -234,22 +234,21 @@ class AdminEmployeesControllerCore extends AdminController 'hint' => $this->l('Back Office theme') ), array( - 'type' => 'switch', - 'label' => $this->l('Show screencast at login:'), - 'name' => 'bo_show_screencast', - 'hint' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'), + 'type' => 'radio', + 'label' => $this->l('Display admin menu:'), + 'name' => 'bo_menu', 'required' => false, 'is_bool' => true, 'values' => array( array( - 'id' => 'bo_show_screencast_on', - 'value' => 1, - 'label' => $this->l('Enabled') + 'id' => 'bo_menu_on', + 'value' => 0, + 'label' => $this->l('Top') ), array( - 'id' => 'bo_show_screencast_off', - 'value' => 0, - 'label' => $this->l('Disabled') + 'id' => 'bo_menu_off', + 'value' => 1, + 'label' => $this->l('Left') ) ) ) diff --git a/controllers/admin/AdminHomeController.php b/controllers/admin/AdminHomeController.php index 45797273e..55a1ecbb0 100644 --- a/controllers/admin/AdminHomeController.php +++ b/controllers/admin/AdminHomeController.php @@ -491,9 +491,6 @@ class AdminHomeControllerCore extends AdminController $isoCountry = Context::getContext()->country->iso_code; $stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 2))); - // SCREENCAST - $result['screencast'] = 'OK'; - // PREACTIVATION $result['partner_preactivation'] = $this->getBlockPartners(); @@ -510,20 +507,6 @@ class AdminHomeControllerCore extends AdminController $this->content = Tools::jsonEncode($result); } - public function ajaxProcessHideScreencast() - { - if ($employee = new Employee((int)Tools::getValue('id_employee'))) - { - $employee->bo_show_screencast = 0; - if ($employee->save()) - $this->content = '{"status":"ok"}'; - else - $this->content = '{"status":"error","msg":"not saved"}'; - } - else - $this->content = '{"status":"error", "msg":"employee does not exists"}'; - } - public function getBlockPartners() { // Init var diff --git a/install-dev/data/db_structure.sql b/install-dev/data/db_structure.sql index d067ea6f0..24fa6acfb 100644 --- a/install-dev/data/db_structure.sql +++ b/install-dev/data/db_structure.sql @@ -702,7 +702,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_show_screencast` tinyint(1) NOT NULL default '1', + `bo_menu` tinyint(1) NOT NULL default '0', `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 66e22d19f..1c10e1fad 100644 --- a/install-dev/upgrade/sql/1.6.0.1.sql +++ b/install-dev/upgrade/sql/1.6.0.1.sql @@ -1,3 +1,6 @@ SET NAMES 'utf8'; INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_DASHBOARD_USE_PUSH', '0', NOW(), NOW()); + +ALTER TABLE `PREFIX_employee` CHANGE `bo_show_screencast` `bo_menu` TINYINT(1) NOT NULL DEFAULT '0'; +UPDATE `PREFIX_employee` SET bo_menu = 0;